13 #define OpHitFinder_H 1 112 std::string threshAlgName = hit_alg_pset.
get< std::string >(
"Name");
113 if (threshAlgName ==
"Threshold")
115 else if (threshAlgName ==
"SiPM")
117 else if (threshAlgName ==
"SlidingWindow")
119 else if (threshAlgName ==
"FixedWindow")
121 else if (threshAlgName ==
"CFD" )
124 <<
"Cannot find implementation for " 125 << threshAlgName <<
" algorithm.\n";
128 std::string pedAlgName = ped_alg_pset.
get< std::string >(
"Name");
129 if (pedAlgName ==
"Edges")
131 else if (pedAlgName ==
"RollingMean")
133 else if (pedAlgName ==
"UB" )
136 <<
"Cannot find implementation for " 137 << pedAlgName <<
" algorithm.\n";
139 produces< std::vector< recob::OpHit > >();
155 for (
auto const& ch : pset.
get< std::vector< unsigned int > >
156 (
"ChannelMasks", std::vector< unsigned int >()))
160 bool useCalibrator = pset.
get<
bool > (
"UseCalibrator",
false);
162 auto const& geometry(*lar::providerFrom< geo::Geometry >());
167 fCalib = lar::providerFrom<calib::IPhotonCalibratorService>();
172 bool areaToPE = pset.
get<
bool > (
"AreaToPE");
173 float SPEArea = pset.
get<
float >(
"SPEArea");
174 float SPEShift = pset.
get<
float >(
"SPEShift", 0.);
177 if (!areaToPE) SPEArea = 20;
213 std::unique_ptr< std::vector< recob::OpHit > >
214 HitPtr(
new std::vector< recob::OpHit >);
216 std::vector< const sim::BeamGateInfo* > beamGateArray;
226 auto const& geometry(*lar::providerFrom< geo::Geometry >());
227 auto const& detectorClocks(*lar::providerFrom< detinfo::DetectorClocksService >());
228 auto const& calibrator(*
fCalib);
239 if (!wfHandle.
isValid())
continue;
240 totalsize += wfHandle->size();
244 std::vector< raw::OpDetWaveform > WaveformVector;
245 WaveformVector.reserve(totalsize);
246 for (
auto label : fInputLabels)
250 if (!wfHandle.
isValid())
continue;
254 for(
auto const& wf : *wfHandle)
258 WaveformVector.push_back(wf);
272 evt.
put(std::move(HitPtr));
Utilities related to art service access.
std::set< unsigned int > fChannelMasks
void reconfigure(fhicl::ParameterSet const &pset)
unsigned int fMaxOpChannel
std::vector< double > GetSPEScales()
std::vector< std::string > fInputLabels
void AddRecoAlgo(pmtana::PMTPulseRecoBase *algo, PMTPedestalBase *ped_algo=nullptr)
A method to set pulse reconstruction algorithm.
OpHitFinder(const fhicl::ParameterSet &)
ProductID put(std::unique_ptr< PROD > &&product)
std::size_t getView(std::string const &moduleLabel, std::string const &productInstanceName, std::vector< ELEMENT const * > &result) const
std::map< int, int > GetChannelMap()
#define DEFINE_ART_MODULE(klass)
Class definition file of PedAlgoRollingMean.
Class definition file of AlgoCFD.
T get(std::string const &key) const
Class definition file of PedAlgoUB.
void RunHitFinder(std::vector< raw::OpDetWaveform > const &opDetWaveformVector, std::vector< recob::OpHit > &hitVector, pmtana::PulseRecoManager const &pulseRecoMgr, pmtana::PMTPulseRecoBase const &threshAlg, geo::GeometryCore const &geometry, float hitThreshold, detinfo::DetectorClocks const &detectorClocks, calib::IPhotonCalibrator const &calibrator)
pmtana::PMTPulseRecoBase * fThreshAlg
void produce(art::Event &)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Class definition file of AlgoFixedWindow.
calib::IPhotonCalibrator const * fCalib
std::vector< double > GetSPEShifts()
bool getByLabel(std::string const &label, std::string const &productInstanceName, Handle< PROD > &result) const
Class definition file of AlgoSlidingWindow.
Class definition file of AlgoThreshold.
pmtana::PulseRecoManager fPulseRecoMgr
void SetDefaultPedAlgo(pmtana::PMTPedestalBase *algo)
A method to set a choice of pedestal estimation method.
Class definition file of PMTPulseRecoBase.
Class definition file of PedAlgoEdges.
art framework interface to geometry description
pmtana::PMTPedestalBase * fPedAlg
Class definition file of PulseRecoManager.