@@ -9,7 +9,7 @@ namespace sbnd::crt {
99 }
1010
1111 CRTBackTrackerAlg::CRTBackTrackerAlg (){}
12-
12+
1313 CRTBackTrackerAlg::~CRTBackTrackerAlg (){}
1414
1515 void CRTBackTrackerAlg::reconfigure (const Config& config)
@@ -21,6 +21,7 @@ namespace sbnd::crt {
2121 fClusterModuleLabel = config.ClusterModuleLabel ();
2222 fSpacePointModuleLabel = config.SpacePointModuleLabel ();
2323 fTrackModuleLabel = config.TrackModuleLabel ();
24+ fCRTGeoAlgConfig = config.GeoAlgConfig ();
2425
2526 return ;
2627 }
@@ -38,6 +39,8 @@ namespace sbnd::crt {
3839 fTrackIDMotherMap .clear ();
3940 fStripHitMCPMap .clear ();
4041
42+ CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
43+
4144 art::Handle<std::vector<sim::ParticleAncestryMap>> droppedTrackIDMapVecHandle;
4245 event.getByLabel (fSimModuleLabel , droppedTrackIDMapVecHandle);
4346
@@ -92,7 +95,7 @@ namespace sbnd::crt {
9295 const double x = (ide->entryX + ide->exitX ) / 2 .;
9396 const double y = (ide->entryY + ide->exitY ) / 2 .;
9497 const double z = (ide->entryZ + ide->exitZ ) / 2 .;
95- const CRTTagger tagger = fCRTGeoAlg .WhichTagger (x, y, z);
98+ const CRTTagger tagger = geoAlg .WhichTagger (x, y, z);
9699
97100 const int rollUpID = RollUpID (ide->trackID );
98101
@@ -245,7 +248,7 @@ namespace sbnd::crt {
245248 const double x = (ide->entryX + ide->exitX ) / 2 .;
246249 const double y = (ide->entryY + ide->exitY ) / 2 .;
247250 const double z = (ide->entryZ + ide->exitZ ) / 2 .;
248- const CRTTagger tagger = fCRTGeoAlg .WhichTagger (x, y, z);
251+ const CRTTagger tagger = geoAlg .WhichTagger (x, y, z);
249252
250253 const int rollUpID = RollUpID (ide->trackID );
251254 Category category (rollUpID, tagger);
@@ -261,7 +264,7 @@ namespace sbnd::crt {
261264
262265 for (auto const stripHit : stripHitVec)
263266 {
264- const CRTTagger tagger = fCRTGeoAlg .ChannelToTaggerEnum (stripHit->Channel ());
267+ const CRTTagger tagger = geoAlg .ChannelToTaggerEnum (stripHit->Channel ());
265268 TruthMatchMetrics truthMatch = TruthMatching (event, stripHit);
266269
267270 fStripHitMCPMap [stripHit.key ()] = truthMatch.trackid ;
@@ -338,6 +341,8 @@ namespace sbnd::crt {
338341
339342 CRTBackTrackerAlg::TruthMatchMetrics CRTBackTrackerAlg::TruthMatching (const art::Event &event, const art::Ptr<CRTStripHit> &stripHit)
340343 {
344+ CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
345+
341346 art::Handle<std::vector<FEBData>> febDataHandle;
342347 event.getByLabel (fFEBDataModuleLabel , febDataHandle);
343348
@@ -346,7 +351,7 @@ namespace sbnd::crt {
346351
347352 art::FindManyP<sim::AuxDetIDE, FEBTruthInfo> febDataToIDEs (febDataHandle, event, fFEBDataModuleLabel );
348353 art::FindOneP<FEBData> stripHitToFEBData (stripHitHandle, event, fStripHitModuleLabel );
349- const CRTTagger tagger = fCRTGeoAlg .ChannelToTaggerEnum (stripHit->Channel ());
354+ const CRTTagger tagger = geoAlg .ChannelToTaggerEnum (stripHit->Channel ());
350355
351356 auto const febData = stripHitToFEBData.at (stripHit.key ());
352357 auto const assnIDEVec = febDataToIDEs.at (febData.key ());
@@ -541,8 +546,10 @@ namespace sbnd::crt {
541546 const geo::Vector_t &dir,
542547 const CRTTagger &tagger)
543548 {
549+ CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
550+
544551 const CoordSet constrainedPlane = CRTCommonUtils::GetTaggerDefinedCoordinate (tagger);
545- const CRTTaggerGeo taggerGeo = fCRTGeoAlg .GetTagger (CRTCommonUtils::GetTaggerName (tagger));
552+ const CRTTaggerGeo taggerGeo = geoAlg .GetTagger (CRTCommonUtils::GetTaggerName (tagger));
546553 double k;
547554
548555 switch (constrainedPlane)
@@ -571,14 +578,15 @@ namespace sbnd::crt {
571578 break ;
572579 }
573580
574- if (!fCRTGeoAlg .IsPointInsideCRTLimits (start + k * dir))
581+ if (!geoAlg .IsPointInsideCRTLimits (start + k * dir))
575582 return {999999 ., {999999 ., 999999 ., 999999 .}};
576583
577584 return {k, start + k * dir};
578585 }
579586
580587 void CRTBackTrackerAlg::TrueParticlePDGEnergyTime (const int trackID, int &pdg, double &energy, double &time)
581588 {
589+ art::ServiceHandle<cheat::ParticleInventoryService> particleInv;
582590 const simb::MCParticle* particle = particleInv->TrackIdToParticle_P (trackID);
583591
584592 pdg = particle == NULL ? -std::numeric_limits<int >::max () : particle->PdgCode ();
0 commit comments