7 #ifndef PMTPULSERECOBASE_CC 8 #define PMTPULSERECOBASE_CC 49 if(begin >= wf.size() || end >= wf.size() || begin >
end){
51 std::cerr <<
"Invalid arguments: waveform length = " << wf.size() <<
" begin = " << begin <<
" end = " << end << std::endl;
56 if(!end) end = wf.size() - 1;
79 std::cerr <<
"\033[93m" 80 <<
"Invalid pulse index: " << index
112 begin_iter = begin_iter +
begin;
114 end_iter = end_iter +
end + 1;
116 result = (double)(std::accumulate(begin_iter, end_iter, 0));
123 std::vector<int32_t> &diff,
134 for(
size_t index =
begin ; index <=
end ; ++index)
136 diff.push_back(wf.at(index+1) - wf.at(index));
153 size_t target_index = wf.size() + 1;
159 for(
size_t index =
begin; index <=
end; ++index)
161 if( result < wf.at(index)) { target_index = index; result = (double)(wf.at(index)); }
177 size_t target_index = wf.size() + 1;
183 for(
size_t index =
begin; index <=
end; ++index)
185 if( result > wf.at(index)) { target_index = index; result = (double)(wf.at(index)); }
bool _status
Status after pulse reconstruction.
bool Integral(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
std::vector< double > PedestalSigma_t
virtual void Reset()
A method to be called event-wise to reset parameters.
std::string _name
Unique name.
size_t Min(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
const std::string & Name() const
Name getter.
pulse_param _pulse
A subject pulse_param object to be filled with the last reconstructed pulse parameters.
virtual ~PMTPulseRecoBase()
Default destructor.
size_t Max(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
bool CheckIndex(const std::vector< short > &wf, const size_t &begin, size_t &end)
const pulse_param_array & GetPulses() const
A getter for the whole array of pulse_param struct object.
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
std::vector< short > Waveform_t
virtual bool RecoPulse(const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)=0
const bool Status() const
Status getter.
bool Reconstruct(const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
std::vector< pmtana::pulse_param > pulse_param_array
Class definition file of PMTPulseRecoBase.
std::vector< double > PedestalMean_t
const pulse_param & GetPulse(size_t index=0) const
pulse_param_array _pulse_v
A container array of pulse_param struct objects to store (possibly multiple) reconstructed pulse(s)...
bool Derivative(const std::vector< short > &wf, std::vector< int32_t > &diff, size_t begin=0, size_t end=0) const
PMTPulseRecoBase(const std::string name="noname")
Default constructor with fhicl parameters.
cet::coded_exception< error, detail::translate > exception