LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#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 66 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.
References Reset().
|
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 121 of file PMTPulseRecoBase.cxx.
References util::begin(), pmtana::CheckIndex(), and util::end().
|
inline |
A getter for the number of reconstructed pulses from the input waveform.
Definition at line 101 of file PMTPulseRecoBase.h.
Referenced by opdet::LEDCalibrationAna::analyze().
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 74 of file PMTPulseRecoBase.cxx.
References _pulse_v.
Referenced by opdet::LEDCalibrationAna::analyze().
const pulse_param_array & pmtana::PMTPulseRecoBase::GetPulses | ( | ) | const |
A getter for the whole array of pulse_param struct object.
Definition at line 91 of file PMTPulseRecoBase.cxx.
References _pulse_v.
Referenced by opdet::RunHitFinder().
|
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 98 of file PMTPulseRecoBase.cxx.
References util::begin(), pmtana::CheckIndex(), and util::end().
Referenced by pmtana::AlgoFixedWindow::RecoPulse().
|
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 144 of file PMTPulseRecoBase.cxx.
References util::begin(), pmtana::CheckIndex(), and util::end().
Referenced by pmtana::AlgoFixedWindow::RecoPulse().
|
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 169 of file PMTPulseRecoBase.cxx.
References util::begin(), pmtana::CheckIndex(), and util::end().
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 36 of file PMTPulseRecoBase.cxx.
References _status, and RecoPulse().
|
protectedpure virtual |
Implemented in pmtana::AlgoFixedWindow, pmtana::AlgoCFD, pmtana::AlgoThreshold, pmtana::AlgoSlidingWindow, and pmtana::AlgoSiPM.
Referenced by Reconstruct().
|
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 63 of file PMTPulseRecoBase.cxx.
References _pulse, _pulse_v, and pmtana::pulse_param::reset_param().
Referenced by PMTPulseRecoBase(), pmtana::AlgoSiPM::Reset(), pmtana::AlgoSlidingWindow::Reset(), pmtana::AlgoThreshold::Reset(), and pmtana::AlgoCFD::Reset().
bool pmtana::PMTPulseRecoBase::Status | ( | ) | const |
Status getter.
Definition at line 29 of file PMTPulseRecoBase.cxx.
References _status.
|
private |
|
protected |
A subject pulse_param object to be filled with the last reconstructed pulse parameters.
Definition at line 119 of file PMTPulseRecoBase.h.
Referenced by pmtana::AlgoSiPM::RecoPulse(), pmtana::AlgoSlidingWindow::RecoPulse(), pmtana::AlgoThreshold::RecoPulse(), pmtana::AlgoCFD::RecoPulse(), pmtana::AlgoFixedWindow::RecoPulse(), pmtana::AlgoFixedWindow::Reset(), and Reset().
|
protected |
A container array of pulse_param struct objects to store (possibly multiple) reconstructed pulse(s).
Definition at line 116 of file PMTPulseRecoBase.h.
Referenced by GetPulse(), GetPulses(), pmtana::AlgoSiPM::RecoPulse(), pmtana::AlgoSlidingWindow::RecoPulse(), pmtana::AlgoCFD::RecoPulse(), pmtana::AlgoThreshold::RecoPulse(), pmtana::AlgoFixedWindow::RecoPulse(), pmtana::AlgoFixedWindow::Reset(), and Reset().
|
protected |
Tool for rise time calculation.
Definition at line 122 of file PMTPulseRecoBase.h.
Referenced by pmtana::AlgoCFD::AlgoCFD(), pmtana::AlgoFixedWindow::AlgoFixedWindow(), pmtana::AlgoSiPM::AlgoSiPM(), pmtana::AlgoSlidingWindow::AlgoSlidingWindow(), pmtana::AlgoThreshold::AlgoThreshold(), pmtana::AlgoSiPM::RecoPulse(), pmtana::AlgoSlidingWindow::RecoPulse(), pmtana::AlgoThreshold::RecoPulse(), pmtana::AlgoCFD::RecoPulse(), and pmtana::AlgoFixedWindow::RecoPulse().
|
private |
Status after pulse reconstruction.
Definition at line 108 of file PMTPulseRecoBase.h.
Referenced by Reconstruct(), and Status().