44 if(begin >= wf.size() || end >= wf.size() || begin >
end){
46 std::cerr <<
"Invalid arguments: waveform length = " << wf.size() <<
" begin = " << begin <<
" end = " << end <<
std::endl;
51 if(!end) end = wf.size() - 1;
74 std::cerr <<
"\033[93m" 75 <<
"Invalid pulse index: " <<
index 107 begin_iter = begin_iter +
begin;
109 end_iter = end_iter +
end + 1;
111 result = (double)(std::accumulate(begin_iter, end_iter, 0));
118 std::vector<int32_t> &diff,
131 diff.push_back(wf.at(
index+1) - wf.at(
index));
148 size_t target_index = wf.size() + 1;
172 size_t target_index = wf.size() + 1;
end
while True: pbar.update(maxval-len(onlies[E][S])) #print iS, "/", len(onlies[E][S]) found = False for...
bool _status
Status after pulse reconstruction.
bool Integral(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
bool Status() const
Status getter.
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.
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< short > Waveform_t
virtual bool RecoPulse(const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)=0
bool Reconstruct(const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)
decltype(auto) constexpr begin(T &&obj)
ADL-aware version of std::begin.
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
QTextStream & endl(QTextStream &s)