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;
72 if(index >= _pulse_v.size()) {
75 <<
"Invalid pulse index: " << index
79 throw std::exception();
82 else return _pulse_v.at(index);
103 std::vector<short>::const_iterator begin_iter(wf.begin());
105 std::vector<short>::const_iterator end_iter(wf.begin());
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,
129 for(
size_t index =
begin ; index <=
end ; ++index)
131 diff.push_back(wf.at(index+1) - wf.at(index));
148 size_t target_index = wf.size() + 1;
154 for(
size_t index =
begin; index <=
end; ++index)
156 if( result < wf.at(index)) { target_index = index; result = (double)(wf.at(index)); }
172 size_t target_index = wf.size() + 1;
178 for(
size_t index =
begin; index <=
end; ++index)
180 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
bool Status() const
Status getter.
std::vector< double > PedestalSigma_t
virtual void Reset()
A method to be called event-wise to reset parameters.
BEGIN_PROLOG could also be cerr
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.
auto end(FixedBins< T, C > const &) noexcept
std::vector< short > Waveform_t
virtual bool RecoPulse(const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)=0
auto begin(FixedBins< T, C > const &) noexcept
bool Reconstruct(const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)
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
BEGIN_PROLOG don t mess with this pandoraTrackGausCryoW true
PMTPulseRecoBase(const std::string name="noname")
Default constructor with fhicl parameters.