99#include " art_root_io/TFileDirectory.h"
1010#include " messagefacility/MessageLogger/MessageLogger.h"
1111
12- #include " larcore/Geometry/Geometry.h"
13- #include " larcore/CoreUtils/ServiceUtil.h" // lar::providerFrom()
12+ #include " larcore/Geometry/WireReadout.h"
1413#include " icaruscode/TPC/Utilities/SignalShapingICARUSService_service.h"
1514#include " lardataalg/DetectorInfo/DetectorClocks.h"
1615#include " lardata/DetectorInfoServices/DetectorPropertiesService.h"
@@ -137,7 +136,7 @@ class BasicRawDigitAnalysis : virtual public IRawDigitHistogramTool
137136 FFTPointer fFFT ; // < Object to handle thread safe FFT
138137
139138 // Useful services, keep copies for now (we can update during begin run periods)
140- const geo::GeometryCore & fGeometry ; // /< pointer to Geometry service
139+ const geo::WireReadoutGeom & fChannelMapAlg ; // /< pointer to ChannelMapAlg
141140 icarusutil::SignalShapingICARUSService& fSignalServices ; // /< The signal shaping service
142141 const lariov::DetPedestalProvider& fPedestalRetrievalAlg ; // /< Keep track of an instance to the pedestal retrieval alg
143142};
@@ -151,7 +150,7 @@ class BasicRawDigitAnalysis : virtual public IRawDigitHistogramTool
151150// /
152151BasicRawDigitAnalysis::BasicRawDigitAnalysis (fhicl::ParameterSet const & pset) :
153152 fCharacterizationAlg (pset.get<fhicl::ParameterSet>(" CharacterizationAlg" )),
154- fGeometry (*lar::providerFrom <geo::Geometry> ()),
153+ fChannelMapAlg (art::ServiceHandle <geo::WireReadout const >()-> Get ()),
155154 fSignalServices(*art::ServiceHandle<icarusutil::SignalShapingICARUSService>()),
156155 fPedestalRetrievalAlg(*lar::providerFrom<lariov::DetPedestalService>())
157156{
@@ -227,7 +226,7 @@ void BasicRawDigitAnalysis::initializeHists(detinfo::DetectorClocksData const& c
227226 fAveFFTImaginaryVec .resize (3 );
228227 fAveSmoothPowerVec .resize (3 );
229228
230- for (size_t plane = 0 ; plane < fGeometry .Nplanes (); plane++)
229+ for (size_t plane = 0 ; plane < fChannelMapAlg .Nplanes (); plane++)
231230 {
232231 size_t numHists = fHiWireByPlane [plane] - fLoWireByPlane [plane];
233232
@@ -305,7 +304,7 @@ void BasicRawDigitAnalysis::initializeHists(detinfo::DetectorClocksData const& c
305304 fFullRmsHist [plane] = dir.make <TH1D>(histName.c_str (), " ;ADC" , 100 , 0 ., 20 .);
306305
307306 // Need a channel...
308- raw::ChannelID_t channel = fGeometry .PlaneWireToChannel (geo::WireID (0 , 0 , plane, 0 ));
307+ raw::ChannelID_t channel = fChannelMapAlg .PlaneWireToChannel (geo::WireID (0 , 0 , plane, 0 ));
309308
310309 // Recover the filter from signal shaping services...
311310 const icarusutil::FrequencyVec& response = fSignalServices .GetResponse (channel).getConvKernel ();
@@ -325,7 +324,7 @@ void BasicRawDigitAnalysis::initializeHists(detinfo::DetectorClocksData const& c
325324void BasicRawDigitAnalysis::fillHistograms (const detinfo::DetectorClocksData& clockData,
326325 const detinfo::DetectorPropertiesData& detProp,
327326 const IRawDigitHistogramTool::RawDigitPtrVec& rawDigitPtrVec,
328- const IRawDigitHistogramTool::SimChannelMap& channelMap ) const
327+ const IRawDigitHistogramTool::SimChannelMap& wireReadout ) const
329328{
330329 // Sadly, the RawDigits come to us in an unsorted condition which is not optimal for
331330 // what we want to do here. So we make a vector of pointers to the input raw digits and sort them
@@ -381,7 +380,7 @@ void BasicRawDigitAnalysis::fillHistograms(const detinfo::DetectorClocksData& cl
381380 // Decode the channel and make sure we have a valid one
382381 std::vector<geo::WireID> wids;
383382 try {
384- wids = fGeometry .ChannelToWire (channel);
383+ wids = fChannelMapAlg .ChannelToWire (channel);
385384 }
386385 catch (...)
387386 {
@@ -404,7 +403,7 @@ void BasicRawDigitAnalysis::fillHistograms(const detinfo::DetectorClocksData& cl
404403 }
405404
406405 // If MC, does this channel have signal?
407- bool hasSignal = channelMap .find (channel) != channelMap .end ();
406+ bool hasSignal = wireReadout .find (channel) != wireReadout .end ();
408407
409408 // vector holding uncompressed adc values
410409 std::vector<short >& rawadc = rawDataWireTimeVec[0 ];
@@ -570,7 +569,7 @@ void BasicRawDigitAnalysis::endJob(int numEvents)
570569
571570 // A task to complete is to fit the average power displays with aim to develop a "good" filter function and
572571 // get the signal to noise ratio
573- for (size_t planeIdx = 0 ; planeIdx < fGeometry .Nplanes (); planeIdx++)
572+ for (size_t planeIdx = 0 ; planeIdx < fChannelMapAlg .Nplanes (); planeIdx++)
574573 {
575574 TH1* avePowerHist = fAveFFTPowerVec [planeIdx];
576575
0 commit comments