@@ -8,7 +8,7 @@ namespace sbnd::crt {
88 }
99
1010 CRTBackTrackerAlg::CRTBackTrackerAlg (){}
11-
11+
1212 CRTBackTrackerAlg::~CRTBackTrackerAlg (){}
1313
1414 void CRTBackTrackerAlg::reconfigure (const Config& config)
@@ -20,6 +20,7 @@ namespace sbnd::crt {
2020 fClusterModuleLabel = config.ClusterModuleLabel ();
2121 fSpacePointModuleLabel = config.SpacePointModuleLabel ();
2222 fTrackModuleLabel = config.TrackModuleLabel ();
23+ fCRTGeoAlgConfig = config.GeoAlgConfig ();
2324
2425 return ;
2526 }
@@ -37,6 +38,8 @@ namespace sbnd::crt {
3738 fTrackIDMotherMap .clear ();
3839 fStripHitMCPMap .clear ();
3940
41+ CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
42+
4043 art::Handle<std::vector<sim::ParticleAncestryMap>> droppedTrackIDMapVecHandle;
4144 event.getByLabel (fSimModuleLabel , droppedTrackIDMapVecHandle);
4245
@@ -91,7 +94,7 @@ namespace sbnd::crt {
9194 const double x = (ide->entryX + ide->exitX ) / 2 .;
9295 const double y = (ide->entryY + ide->exitY ) / 2 .;
9396 const double z = (ide->entryZ + ide->exitZ ) / 2 .;
94- const CRTTagger tagger = fCRTGeoAlg .WhichTagger (x, y, z);
97+ const CRTTagger tagger = geoAlg .WhichTagger (x, y, z);
9598
9699 const int rollUpID = RollUpID (ide->trackID );
97100
@@ -244,7 +247,7 @@ namespace sbnd::crt {
244247 const double x = (ide->entryX + ide->exitX ) / 2 .;
245248 const double y = (ide->entryY + ide->exitY ) / 2 .;
246249 const double z = (ide->entryZ + ide->exitZ ) / 2 .;
247- const CRTTagger tagger = fCRTGeoAlg .WhichTagger (x, y, z);
250+ const CRTTagger tagger = geoAlg .WhichTagger (x, y, z);
248251
249252 const int rollUpID = RollUpID (ide->trackID );
250253 Category category (rollUpID, tagger);
@@ -260,7 +263,7 @@ namespace sbnd::crt {
260263
261264 for (auto const stripHit : stripHitVec)
262265 {
263- const CRTTagger tagger = fCRTGeoAlg .ChannelToTaggerEnum (stripHit->Channel ());
266+ const CRTTagger tagger = geoAlg .ChannelToTaggerEnum (stripHit->Channel ());
264267 TruthMatchMetrics truthMatch = TruthMatching (event, stripHit);
265268
266269 fStripHitMCPMap [stripHit.key ()] = truthMatch.trackid ;
@@ -337,6 +340,8 @@ namespace sbnd::crt {
337340
338341 CRTBackTrackerAlg::TruthMatchMetrics CRTBackTrackerAlg::TruthMatching (const art::Event &event, const art::Ptr<CRTStripHit> &stripHit)
339342 {
343+ CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
344+
340345 art::Handle<std::vector<FEBData>> febDataHandle;
341346 event.getByLabel (fFEBDataModuleLabel , febDataHandle);
342347
@@ -345,7 +350,7 @@ namespace sbnd::crt {
345350
346351 art::FindManyP<sim::AuxDetIDE, FEBTruthInfo> febDataToIDEs (febDataHandle, event, fFEBDataModuleLabel );
347352 art::FindOneP<FEBData> stripHitToFEBData (stripHitHandle, event, fStripHitModuleLabel );
348- const CRTTagger tagger = fCRTGeoAlg .ChannelToTaggerEnum (stripHit->Channel ());
353+ const CRTTagger tagger = geoAlg .ChannelToTaggerEnum (stripHit->Channel ());
349354
350355 auto const febData = stripHitToFEBData.at (stripHit.key ());
351356 auto const assnIDEVec = febDataToIDEs.at (febData.key ());
@@ -540,8 +545,10 @@ namespace sbnd::crt {
540545 const geo::Vector_t &dir,
541546 const CRTTagger &tagger)
542547 {
548+ CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
549+
543550 const CoordSet constrainedPlane = CRTCommonUtils::GetTaggerDefinedCoordinate (tagger);
544- const CRTTaggerGeo taggerGeo = fCRTGeoAlg .GetTagger (CRTCommonUtils::GetTaggerName (tagger));
551+ const CRTTaggerGeo taggerGeo = geoAlg .GetTagger (CRTCommonUtils::GetTaggerName (tagger));
545552 double k;
546553
547554 switch (constrainedPlane)
@@ -570,14 +577,15 @@ namespace sbnd::crt {
570577 break ;
571578 }
572579
573- if (!fCRTGeoAlg .IsPointInsideCRTLimits (start + k * dir))
580+ if (!geoAlg .IsPointInsideCRTLimits (start + k * dir))
574581 return {999999 ., {999999 ., 999999 ., 999999 .}};
575582
576583 return {k, start + k * dir};
577584 }
578585
579586 void CRTBackTrackerAlg::TrueParticlePDGEnergyTime (const int trackID, int &pdg, double &energy, double &time)
580587 {
588+ art::ServiceHandle<cheat::ParticleInventoryService> particleInv;
581589 const simb::MCParticle* particle = particleInv->TrackIdToParticle_P (trackID);
582590
583591 pdg = particle == NULL ? -std::numeric_limits<int >::max () : particle->PdgCode ();
0 commit comments