13 #define OpHitFinder_H 1 114 std::string threshAlgName = hit_alg_pset.
get< std::string >(
"Name");
115 if (threshAlgName ==
"Threshold")
117 else if (threshAlgName ==
"SiPM")
119 else if (threshAlgName ==
"SlidingWindow")
121 else if (threshAlgName ==
"FixedWindow")
123 else if (threshAlgName ==
"CFD" )
126 <<
"Cannot find implementation for " 127 << threshAlgName <<
" algorithm.\n";
130 std::string pedAlgName = ped_alg_pset.
get< std::string >(
"Name");
131 if (pedAlgName ==
"Edges")
133 else if (pedAlgName ==
"RollingMean")
135 else if (pedAlgName ==
"UB" )
138 <<
"Cannot find implementation for " 139 << pedAlgName <<
" algorithm.\n";
141 produces< std::vector< recob::OpHit > >();
157 for (
auto const& ch : pset.
get< std::vector< unsigned int > >
158 (
"ChannelMasks", std::vector< unsigned int >()))
166 auto const& geometry(*lar::providerFrom< geo::Geometry >());
199 std::unique_ptr< std::vector< recob::OpHit > >
200 HitPtr(
new std::vector< recob::OpHit >);
202 std::vector< const sim::BeamGateInfo* > beamGateArray;
212 auto const& geometry(*lar::providerFrom< geo::Geometry >());
213 auto const& detectorClocks
214 (*lar::providerFrom< detinfo::DetectorClocksService >());
226 if (!wfHandle.
isValid())
continue;
227 totalsize += wfHandle->size();
231 std::vector< raw::OpDetWaveform > WaveformVector;
232 WaveformVector.reserve(totalsize);
233 for (
auto label : fInputLabels)
237 if (!wfHandle.
isValid())
continue;
241 for(
auto const& wf : *wfHandle)
245 WaveformVector.push_back(wf);
261 evt.
put(std::move(HitPtr));
274 else return std::vector< double >(fMaxOpChannel + 1, 20);
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
std::vector< double > fSPEShiftPerChan
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, std::vector< double > const &SPESize, bool areaToPE, std::vector< double > const &SPEShiftPerChan)
pmtana::PMTPulseRecoBase * fThreshAlg
void produce(art::Event &)
cet::coded_exception< errors::ErrorCodes, ExceptionDetail::translate > Exception
Class definition file of AlgoFixedWindow.
std::vector< double > fSPESize
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.