#include <PMTPulseRecoBase.h>
Public Member Functions | |
PMTPulseRecoBase (const std::string name="noname") | |
Default constructor with fhicl parameters. More... | |
virtual | ~PMTPulseRecoBase ()=default |
Default destructor. More... | |
const std::string & | Name () const |
Name getter. More... | |
bool | Status () const |
Status getter. More... | |
virtual void | Reset () |
A method to be called event-wise to reset parameters. More... | |
bool | Reconstruct (const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &) |
const pulse_param & | GetPulse (size_t index=0) const |
const pulse_param_array & | GetPulses () const |
A getter for the whole array of pulse_param struct object. More... | |
size_t | GetNPulse () const |
A getter for the number of reconstructed pulses from the input waveform. More... | |
Protected Member Functions | |
virtual bool | RecoPulse (const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)=0 |
bool | Integral (const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const |
bool | Derivative (const std::vector< short > &wf, std::vector< int32_t > &diff, size_t begin=0, size_t end=0) const |
size_t | Max (const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const |
size_t | Min (const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const |
Protected Attributes | |
pulse_param_array | _pulse_v |
A container array of pulse_param struct objects to store (possibly multiple) reconstructed pulse(s). More... | |
pulse_param | _pulse |
A subject pulse_param object to be filled with the last reconstructed pulse parameters. More... | |
std::unique_ptr < pmtana::RiseTimeCalculatorBase > | _risetime_calc_ptr = nullptr |
Tool for rise time calculation. More... | |
Private Attributes | |
std::string | _name |
Unique name. More... | |
bool | _status |
Status after pulse reconstruction. More... | |
The base class of pulse reconstruction algorithms. All algorithms should inherit from this calss to be executed by a manager class, pulse_reco. Note that this class does not depend on the rest of the framework except for the use of constants. In order to reconstruct a pulse, all it requires is a std::vector<short> type object (i.e. raw waveform), waveform pedestal, and its standard deviation. All of these are to be provided by an executer. Reconstructed pulse parameters are stored in the pulse_param struct object.
All methods specified as "virtual" should be implemented by the inherit children class.
This class provides some basic std::vector calculation algorithms such as integral, derivative, max and min algorithms. Inherit children classes are encouraged to use these provided methods when possible.
Definition at line 70 of file PMTPulseRecoBase.h.
pmtana::PMTPulseRecoBase::PMTPulseRecoBase | ( | const std::string | name = "noname" | ) |
Default constructor with fhicl parameters.
Definition at line 15 of file PMTPulseRecoBase.cxx.
|
virtualdefault |
Default destructor.
|
protected |
A method to compute derivative, which is a simple subtraction of previous ADC sample from each sample. The result is stored in the input "diff" reference vector which is int32_t type as a derivative could be negative.
Definition at line 117 of file PMTPulseRecoBase.cxx.
|
inline |
A getter for the number of reconstructed pulses from the input waveform.
Definition at line 106 of file PMTPulseRecoBase.h.
const pulse_param & pmtana::PMTPulseRecoBase::GetPulse | ( | size_t | index = 0 | ) | const |
A getter for the pulse_param struct object. Reconstruction algorithm may have more than one pulse reconstructed from an input waveform. Note you must, accordingly, provide an index key to specify which pulse_param object to be retrieved.
Definition at line 68 of file PMTPulseRecoBase.cxx.
const pulse_param_array & pmtana::PMTPulseRecoBase::GetPulses | ( | ) | const |
A getter for the whole array of pulse_param struct object.
Definition at line 87 of file PMTPulseRecoBase.cxx.
|
protected |
A method to integrate an waveform from index "begin" to the "end". The result is filled in "result" reference. If the "end" is default (=0), then "end" is set to the last index of the waveform.
Definition at line 94 of file PMTPulseRecoBase.cxx.
|
protected |
A method to return the maximum value of ADC sample within the index from "begin" to "end". If the "end" is default (=0), then "end" is set to the last index of the waveform.
Definition at line 141 of file PMTPulseRecoBase.cxx.
|
protected |
A method to return the minimum value of ADC sample within the index from "begin" to "end". If the "end" is default (=0), then "end" is set to the last index of the waveform.
Definition at line 165 of file PMTPulseRecoBase.cxx.
const std::string & pmtana::PMTPulseRecoBase::Name | ( | ) | const |
bool pmtana::PMTPulseRecoBase::Reconstruct | ( | const pmtana::Waveform_t & | wf, |
const pmtana::PedestalMean_t & | mean_v, | ||
const pmtana::PedestalSigma_t & | sigma_v | ||
) |
A core method: this executes the algorithm and stores reconstructed parameters in the pulse_param struct object.
Definition at line 31 of file PMTPulseRecoBase.cxx.
|
protectedpure virtual |
Implemented in pmtana::AlgoFixedWindow, pmtana::AlgoCFD, pmtana::AlgoThreshold, pmtana::AlgoSlidingWindow, and pmtana::AlgoSiPM.
|
virtual |
A method to be called event-wise to reset parameters.
Reimplemented in pmtana::AlgoFixedWindow, pmtana::AlgoCFD, pmtana::AlgoThreshold, pmtana::AlgoSlidingWindow, and pmtana::AlgoSiPM.
Definition at line 57 of file PMTPulseRecoBase.cxx.
bool pmtana::PMTPulseRecoBase::Status | ( | ) | const |
Status getter.
Definition at line 26 of file PMTPulseRecoBase.cxx.
|
private |
Unique name.
Definition at line 106 of file PMTPulseRecoBase.h.
|
protected |
A subject pulse_param object to be filled with the last reconstructed pulse parameters.
Definition at line 126 of file PMTPulseRecoBase.h.
|
protected |
A container array of pulse_param struct objects to store (possibly multiple) reconstructed pulse(s).
Definition at line 123 of file PMTPulseRecoBase.h.
|
protected |
Tool for rise time calculation.
Definition at line 129 of file PMTPulseRecoBase.h.
|
private |
Status after pulse reconstruction.
Definition at line 114 of file PMTPulseRecoBase.h.