8787#include " messagefacility/MessageLogger/MessageLogger.h"
8888
8989// LArSoft includes
90+ #include " larcore/Geometry/WireReadout.h"
91+ #include " larcore/Geometry/Geometry.h"
9092#include " lardataobj/RecoBase/PFParticle.h"
9193#include " lardataobj/RecoBase/Slice.h"
9294#include " lardataobj/RecoBase/Track.h"
99101#include " nusimdata/SimulationBase/MCNeutrino.h"
100102#include " nusimdata/SimulationBase/GTruth.h"
101103
102- #include " fhiclcpp/ParameterSetRegistry.h"
103-
104104#include " sbnobj/Common/EventGen/MeVPrtl/MeVPrtlTruth.h"
105105#include " sbnobj/Common/Reco/RangeP.h"
106106#include " sbnobj/Common/SBNEventWeight/EventWeightMap.h"
@@ -1302,7 +1302,9 @@ void CAFMaker::produce(art::Event& evt) noexcept {
13021302 auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const >()->DataFor (evt);
13031303 auto const dprop =
13041304 art::ServiceHandle<detinfo::DetectorPropertiesService const >()->DataFor (evt, clock_data);
1305- const geo::GeometryCore *geometry = lar::providerFrom<geo::Geometry>();
1305+ const geo::GeometryCore* geom = lar::providerFrom<geo::Geometry>();
1306+ const geo::WireReadoutGeom &wireReadout =
1307+ art::ServiceHandle<geo::WireReadout>()->Get ();
13061308
13071309 auto const *sce = lar::providerFrom<spacecharge::SpaceChargeService>();
13081310
@@ -1330,7 +1332,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
13301332 if ( !isRealData ) {
13311333 art::ServiceHandle<cheat::BackTrackerService> bt_serv;
13321334
1333- id_to_ide_map = PrepSimChannels (simchannels, *geometry );
1335+ id_to_ide_map = PrepSimChannels (simchannels, wireReadout );
13341336 id_to_truehit_map = PrepTrueHits (hits, clock_data, *bt_serv);
13351337 id_to_hit_energy_map = SetupIDHitEnergyMap (hits, clock_data, *bt_serv);
13361338 }
@@ -1550,22 +1552,17 @@ void CAFMaker::produce(art::Event& evt) noexcept {
15501552 }
15511553 }
15521554
1553- // Get all of the CRTPMT Matches ..
1555+ // Get all of the CRTPMT Matches
15541556 std::vector<caf::SRCRTPMTMatch> srcrtpmtmatches;
1555- std::cout << " srcrtpmtmatches.size = " << srcrtpmtmatches.size () << " \n " ;
15561557 art::Handle<std::vector<sbn::crt::CRTPMTMatching>> crtpmtmatch_handle;
15571558 GetByLabelStrict (evt, fParams .CRTPMTLabel (), crtpmtmatch_handle);
15581559 if (crtpmtmatch_handle.isValid ()){
1559- std::cout << " valid handle! label: " << fParams .CRTPMTLabel () << " \n " ;
15601560 const std::vector<sbn::crt::CRTPMTMatching> &crtpmtmatches = *crtpmtmatch_handle;
15611561 for (unsigned i = 0 ; i < crtpmtmatches.size (); i++) {
15621562 srcrtpmtmatches.emplace_back ();
1563- FillCRTPMTMatch (crtpmtmatches[i],srcrtpmtmatches.back ());
1563+ FillCRTPMTMatch (crtpmtmatches[i], srcrtpmtmatches.back ());
15641564 }
15651565 }
1566- else {
1567- std::cout << " crtpmtmatch_handle.isNOTValid!\n " ;
1568- }
15691566
15701567 // Get all of the OpFlashes
15711568 std::vector<caf::SROpFlash> srflashes;
@@ -2048,7 +2045,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
20482045 FillTrackRangeP (*thisTrack[0 ], rangePs, trk);
20492046
20502047 if (fmChi2PID.isValid ()) {
2051- FillTrackChi2PID (fmChi2PID.at (iPart), lar::providerFrom<geo::Geometry>(), trk);
2048+ FillTrackChi2PID (fmChi2PID.at (iPart), trk);
20522049 }
20532050 if (fmScatterClosestApproach.isValid () && fmScatterClosestApproach.at (iPart).size ()==1 ) {
20542051 FillTrackScatterClosestApproach (fmScatterClosestApproach.at (iPart).front (), trk);
@@ -2063,7 +2060,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
20632060 FillTrackCalo (fmCalo.at (iPart), fmTrackHit.at (iPart),
20642061 (fParams .FillHitsNeutrinoSlices () && NeutrinoSlice) || fParams .FillHitsAllSlices (),
20652062 fParams .TrackHitFillRRStartCut (), fParams .TrackHitFillRREndCut (),
2066- lar::providerFrom<geo::Geometry>(), dprop, trk);
2063+ dprop, trk);
20672064 }
20682065 if (fmCRTHitMatch.isValid () && fDet == kICARUS ) {
20692066 art::FindManyP<sbn::crt::CRTHit> CRTT02Hit = FindManyPStrict<sbn::crt::CRTHit>
@@ -2101,7 +2098,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
21012098 FillTrackTruth (fmTrackHit.at (iPart), id_to_hit_energy_map, true_particles, clock_data, trk);
21022099 // Hit truth information corresponding to Calo-Points
21032100 // Assumes truth matching and calo-points are filled
2104- if (mc_particles.isValid () && fParams .FillTrackCaloTruth ()) FillTrackCaloTruth (id_to_ide_map, *mc_particles, geometry , clock_data, sce, trk);
2101+ if (mc_particles.isValid () && fParams .FillTrackCaloTruth ()) FillTrackCaloTruth (id_to_ide_map, *mc_particles, *geom, wireReadout , clock_data, sce, trk);
21052102 }
21062103 }
21072104 } // thisTrack exists
@@ -2110,7 +2107,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
21102107 assert (thisShower.size () == 1 );
21112108
21122109 SRShower& shw = pfp.shw ;
2113- FillShowerVars (*thisShower[0 ], vertex, fmShowerHit.at (iPart), lar::providerFrom<geo::Geometry>() , producer, shw);
2110+ FillShowerVars (*thisShower[0 ], vertex, fmShowerHit.at (iPart), wireReadout , producer, shw);
21142111
21152112 // We may have many residuals per shower depending on how many showers ar in the slice
21162113 if (fmShowerRazzle.isValid () && fmShowerRazzle.at (iPart).size ()==1 ) {
0 commit comments