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"
@@ -1351,7 +1351,9 @@ void CAFMaker::produce(art::Event& evt) noexcept {
13511351 auto const clock_data = art::ServiceHandle<detinfo::DetectorClocksService const >()->DataFor (evt);
13521352 auto const dprop =
13531353 art::ServiceHandle<detinfo::DetectorPropertiesService const >()->DataFor (evt, clock_data);
1354- const geo::GeometryCore *geometry = lar::providerFrom<geo::Geometry>();
1354+ const geo::GeometryCore* geom = lar::providerFrom<geo::Geometry>();
1355+ const geo::WireReadoutGeom &wireReadout =
1356+ art::ServiceHandle<geo::WireReadout>()->Get ();
13551357
13561358 auto const *sce = lar::providerFrom<spacecharge::SpaceChargeService>();
13571359
@@ -1379,7 +1381,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
13791381 if ( !isRealData ) {
13801382 art::ServiceHandle<cheat::BackTrackerService> bt_serv;
13811383
1382- id_to_ide_map = PrepSimChannels (simchannels, *geometry );
1384+ id_to_ide_map = PrepSimChannels (simchannels, wireReadout );
13831385 id_to_truehit_map = PrepTrueHits (hits, clock_data, *bt_serv);
13841386 id_to_hit_energy_map = SetupIDHitEnergyMap (hits, clock_data, *bt_serv);
13851387 }
@@ -1638,22 +1640,17 @@ void CAFMaker::produce(art::Event& evt) noexcept {
16381640 }
16391641 }
16401642
1641- // Get all of the CRTPMT Matches ..
1643+ // Get all of the CRTPMT Matches
16421644 std::vector<caf::SRCRTPMTMatch> srcrtpmtmatches;
1643- std::cout << " srcrtpmtmatches.size = " << srcrtpmtmatches.size () << " \n " ;
16441645 art::Handle<std::vector<sbn::crt::CRTPMTMatching>> crtpmtmatch_handle;
16451646 GetByLabelStrict (evt, fParams .CRTPMTLabel (), crtpmtmatch_handle);
16461647 if (crtpmtmatch_handle.isValid ()){
1647- std::cout << " valid handle! label: " << fParams .CRTPMTLabel () << " \n " ;
16481648 const std::vector<sbn::crt::CRTPMTMatching> &crtpmtmatches = *crtpmtmatch_handle;
16491649 for (unsigned i = 0 ; i < crtpmtmatches.size (); i++) {
16501650 srcrtpmtmatches.emplace_back ();
1651- FillCRTPMTMatch (crtpmtmatches[i],srcrtpmtmatches.back ());
1651+ FillCRTPMTMatch (crtpmtmatches[i], srcrtpmtmatches.back ());
16521652 }
16531653 }
1654- else {
1655- std::cout << " crtpmtmatch_handle.isNOTValid!\n " ;
1656- }
16571654
16581655 // Get all of the OpFlashes
16591656 std::vector<caf::SROpFlash> srflashes;
@@ -2136,7 +2133,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
21362133 FillTrackRangeP (*thisTrack[0 ], rangePs, trk);
21372134
21382135 if (fmChi2PID.isValid ()) {
2139- FillTrackChi2PID (fmChi2PID.at (iPart), lar::providerFrom<geo::Geometry>(), trk);
2136+ FillTrackChi2PID (fmChi2PID.at (iPart), trk);
21402137 }
21412138 if (fmScatterClosestApproach.isValid () && fmScatterClosestApproach.at (iPart).size ()==1 ) {
21422139 FillTrackScatterClosestApproach (fmScatterClosestApproach.at (iPart).front (), trk);
@@ -2151,7 +2148,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
21512148 FillTrackCalo (fmCalo.at (iPart), fmTrackHit.at (iPart),
21522149 (fParams .FillHitsNeutrinoSlices () && NeutrinoSlice) || fParams .FillHitsAllSlices (),
21532150 fParams .TrackHitFillRRStartCut (), fParams .TrackHitFillRREndCut (),
2154- lar::providerFrom<geo::Geometry>(), dprop, trk);
2151+ dprop, trk);
21552152 }
21562153 if (fmCRTHitMatch.isValid () && fDet == kICARUS ) {
21572154 art::FindManyP<sbn::crt::CRTHit> CRTT02Hit = FindManyPStrict<sbn::crt::CRTHit>
@@ -2189,7 +2186,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
21892186 FillTrackTruth (fmTrackHit.at (iPart), id_to_hit_energy_map, true_particles, clock_data, trk);
21902187 // Hit truth information corresponding to Calo-Points
21912188 // Assumes truth matching and calo-points are filled
2192- if (mc_particles.isValid () && fParams .FillTrackCaloTruth ()) FillTrackCaloTruth (id_to_ide_map, *mc_particles, geometry , clock_data, sce, trk);
2189+ if (mc_particles.isValid () && fParams .FillTrackCaloTruth ()) FillTrackCaloTruth (id_to_ide_map, *mc_particles, *geom, wireReadout , clock_data, sce, trk);
21932190 }
21942191 }
21952192 } // thisTrack exists
@@ -2198,7 +2195,7 @@ void CAFMaker::produce(art::Event& evt) noexcept {
21982195 assert (thisShower.size () == 1 );
21992196
22002197 SRShower& shw = pfp.shw ;
2201- FillShowerVars (*thisShower[0 ], vertex, fmShowerHit.at (iPart), lar::providerFrom<geo::Geometry>() , producer, shw);
2198+ FillShowerVars (*thisShower[0 ], vertex, fmShowerHit.at (iPart), wireReadout , producer, shw);
22022199
22032200 // We may have many residuals per shower depending on how many showers ar in the slice
22042201 if (fmShowerRazzle.isValid () && fmShowerRazzle.at (iPart).size ()==1 ) {
0 commit comments