@@ -20,7 +20,6 @@ namespace sbnd::crt {
2020 fClusterModuleLabel = config.ClusterModuleLabel ();
2121 fSpacePointModuleLabel = config.SpacePointModuleLabel ();
2222 fTrackModuleLabel = config.TrackModuleLabel ();
23- fCRTGeoAlgConfig = config.GeoAlgConfig ();
2423
2524 return ;
2625 }
@@ -38,35 +37,33 @@ namespace sbnd::crt {
3837 fTrackIDMotherMap .clear ();
3938 fStripHitMCPMap .clear ();
4039
41- CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
42-
4340 art::Handle<std::vector<sim::ParticleAncestryMap>> droppedTrackIDMapVecHandle;
4441 event.getByLabel (fSimModuleLabel , droppedTrackIDMapVecHandle);
4542
4643 if (droppedTrackIDMapVecHandle.isValid ())
4744 {
48- for (auto const & droppedTrackIdMap : *droppedTrackIDMapVecHandle)
49- {
50- for (auto const & [mother, ids] : droppedTrackIdMap.GetMap ())
51- {
52- for (auto const & id : ids)
53- fTrackIDMotherMap [id] = mother;
54- }
55- }
45+ for (auto const & droppedTrackIdMap : *droppedTrackIDMapVecHandle)
46+ {
47+ for (auto const & [mother, ids] : droppedTrackIdMap.GetMap ())
48+ {
49+ for (auto const & id : ids)
50+ fTrackIDMotherMap [id] = mother;
51+ }
52+ }
5653 }
5754
5855 art::Handle<sim::ParticleAncestryMap> droppedTrackIDMapHandle;
5956 event.getByLabel (fSimModuleLabel , droppedTrackIDMapHandle);
6057
6158 if (droppedTrackIDMapHandle.isValid ())
6259 {
63- auto const & droppedTrackIdMap = droppedTrackIDMapHandle->GetMap ();
60+ auto const & droppedTrackIdMap = droppedTrackIDMapHandle->GetMap ();
6461
65- for (auto const & [mother, ids] : droppedTrackIdMap)
66- {
67- for (auto const & id : ids)
68- fTrackIDMotherMap [id] = mother;
69- }
62+ for (auto const & [mother, ids] : droppedTrackIdMap)
63+ {
64+ for (auto const & id : ids)
65+ fTrackIDMotherMap [id] = mother;
66+ }
7067 }
7168
7269 art::Handle<std::vector<sim::AuxDetIDE>> ideHandle;
@@ -94,7 +91,7 @@ namespace sbnd::crt {
9491 const double x = (ide->entryX + ide->exitX ) / 2 .;
9592 const double y = (ide->entryY + ide->exitY ) / 2 .;
9693 const double z = (ide->entryZ + ide->exitZ ) / 2 .;
97- const CRTTagger tagger = geoAlg. WhichTagger (x, y, z);
94+ const CRTTagger tagger = fCRTGeoService -> WhichTagger (x, y, z);
9895
9996 const int rollUpID = RollUpID (ide->trackID );
10097
@@ -247,7 +244,7 @@ namespace sbnd::crt {
247244 const double x = (ide->entryX + ide->exitX ) / 2 .;
248245 const double y = (ide->entryY + ide->exitY ) / 2 .;
249246 const double z = (ide->entryZ + ide->exitZ ) / 2 .;
250- const CRTTagger tagger = geoAlg. WhichTagger (x, y, z);
247+ const CRTTagger tagger = fCRTGeoService -> WhichTagger (x, y, z);
251248
252249 const int rollUpID = RollUpID (ide->trackID );
253250 Category category (rollUpID, tagger);
@@ -263,7 +260,7 @@ namespace sbnd::crt {
263260
264261 for (auto const stripHit : stripHitVec)
265262 {
266- const CRTTagger tagger = geoAlg. ChannelToTaggerEnum (stripHit->Channel ());
263+ const CRTTagger tagger = fCRTGeoService -> ChannelToTaggerEnum (stripHit->Channel ());
267264 TruthMatchMetrics truthMatch = TruthMatching (event, stripHit);
268265
269266 fStripHitMCPMap [stripHit.key ()] = truthMatch.trackid ;
@@ -340,8 +337,6 @@ namespace sbnd::crt {
340337
341338 CRTBackTrackerAlg::TruthMatchMetrics CRTBackTrackerAlg::TruthMatching (const art::Event &event, const art::Ptr<CRTStripHit> &stripHit)
342339 {
343- CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
344-
345340 art::Handle<std::vector<FEBData>> febDataHandle;
346341 event.getByLabel (fFEBDataModuleLabel , febDataHandle);
347342
@@ -350,7 +345,7 @@ namespace sbnd::crt {
350345
351346 art::FindManyP<sim::AuxDetIDE, FEBTruthInfo> febDataToIDEs (febDataHandle, event, fFEBDataModuleLabel );
352347 art::FindOneP<FEBData> stripHitToFEBData (stripHitHandle, event, fStripHitModuleLabel );
353- const CRTTagger tagger = geoAlg. ChannelToTaggerEnum (stripHit->Channel ());
348+ const CRTTagger tagger = fCRTGeoService -> ChannelToTaggerEnum (stripHit->Channel ());
354349
355350 auto const febData = stripHitToFEBData.at (stripHit.key ());
356351 auto const assnIDEVec = febDataToIDEs.at (febData.key ());
@@ -545,10 +540,8 @@ namespace sbnd::crt {
545540 const geo::Vector_t &dir,
546541 const CRTTagger &tagger)
547542 {
548- CRTGeoAlg geoAlg = CRTGeoAlg (fCRTGeoAlgConfig );
549-
550543 const CoordSet constrainedPlane = CRTCommonUtils::GetTaggerDefinedCoordinate (tagger);
551- const CRTTaggerGeo taggerGeo = geoAlg. GetTagger (CRTCommonUtils::GetTaggerName (tagger));
544+ const CRTTaggerGeo taggerGeo = fCRTGeoService -> GetTagger (CRTCommonUtils::GetTaggerName (tagger));
552545 double k;
553546
554547 switch (constrainedPlane)
@@ -577,7 +570,7 @@ namespace sbnd::crt {
577570 break ;
578571 }
579572
580- if (!geoAlg. IsPointInsideCRTLimits (start + k * dir))
573+ if (!fCRTGeoService -> IsPointInsideCRTLimits (start + k * dir))
581574 return {999999 ., {999999 ., 999999 ., 999999 .}};
582575
583576 return {k, start + k * dir};
0 commit comments