LArSoft
v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
|
#include "PedAlgoRmsSlider.h"
Public Member Functions | |
PedAlgoRmsSlider (const std::string name="PedRmsSlider") | |
Default constructor. More... | |
PedAlgoRmsSlider (const fhicl::ParameterSet &pset, const std::string name="PedRmsSlider") | |
Alternative ctor. More... | |
void | PrintInfo () |
Print settings. More... | |
const std::string & | Name () const |
Name getter. More... | |
bool | Evaluate (const pmtana::Waveform_t &wf) |
Method to compute a pedestal. More... | |
double | Mean (size_t i) const |
Getter of the pedestal mean value. More... | |
const pmtana::PedestalMean_t & | Mean () const |
Getter of the pedestal mean value. More... | |
double | Sigma (size_t i) const |
Getter of the pedestal standard deviation. More... | |
const pmtana::PedestalSigma_t & | Sigma () const |
Getter of the pedestal standard deviation. More... | |
Protected Member Functions | |
bool | ComputePedestal (const pmtana::Waveform_t &wf, pmtana::PedestalMean_t &mean_v, pmtana::PedestalSigma_t &sigma_v) |
Method to compute a pedestal of the input waveform using "nsample" ADC samples from "start" index. More... | |
virtual bool | ComputePedestal (const ::pmtana::Waveform_t &wf, pmtana::PedestalMean_t &mean_v, pmtana::PedestalSigma_t &sigma_v)=0 |
Private Member Functions | |
double | CalcMean (const std::vector< double > &wf, size_t start, size_t nsample) |
Returns the mean of the elements of the vector from start to start+nsample. More... | |
double | CalcStd (const std::vector< double > &wf, const double ped_mean, size_t start, size_t nsample) |
Returns the std of the elements of the vector from start to start+nsample. More... | |
bool | CheckSanity (pmtana::PedestalMean_t &mean_v, pmtana::PedestalSigma_t &sigma_v) |
Checks the sanity of the estimated pedestal, returns false if not sane. More... | |
Private Attributes | |
size_t | _sample_size |
How many samples are used to calculate local rms and mean. More... | |
double | _threshold |
Threshold applied to local rms to claim a pulse. More... | |
float | _max_sigma |
Max sigma to consider adc as 'sane'. More... | |
float | _ped_range_max |
Max value of adc to consider adc as 'sane'. More... | |
float | _ped_range_min |
Min value of adc to consider adc as 'sane'. More... | |
bool | _verbose |
For debugging. More... | |
int | _n_wf_to_csvfile |
If greater than zero saves firsts waveforms with pedestal to csv file. More... | |
int | _wf_saved = 0 |
int | _num_presample |
number of ADCs to sample before the gap More... | |
int | _num_postsample |
number of ADCs to sample after the gap More... | |
std::ofstream | _csvfile |
A class that calculates pedestal mean & standard deviation (here and elsewhere called as "RMS").
Definition at line 35 of file PedAlgoRmsSlider.h.
pmtana::PedAlgoRmsSlider::PedAlgoRmsSlider | ( | const std::string | name = "PedRmsSlider" | ) |
Default constructor.
Definition at line 19 of file PedAlgoRmsSlider.cxx.
pmtana::PedAlgoRmsSlider::PedAlgoRmsSlider | ( | const fhicl::ParameterSet & | pset, |
const std::string | name = "PedRmsSlider" |
||
) |
Alternative ctor.
Definition at line 26 of file PedAlgoRmsSlider.cxx.
References _csvfile, _max_sigma, _n_wf_to_csvfile, _num_postsample, _num_presample, _ped_range_max, _ped_range_min, _sample_size, _threshold, _verbose, and fhicl::ParameterSet::get().
|
private |
Returns the mean of the elements of the vector from start to start+nsample.
Definition at line 58 of file PedAlgoRmsSlider.cxx.
References sum.
Referenced by ComputePedestal().
|
private |
Returns the std of the elements of the vector from start to start+nsample.
Definition at line 73 of file PedAlgoRmsSlider.cxx.
Referenced by ComputePedestal().
|
private |
Checks the sanity of the estimated pedestal, returns false if not sane.
Definition at line 382 of file PedAlgoRmsSlider.cxx.
References _max_sigma, _ped_range_max, _verbose, and pmtana::mean().
Referenced by ComputePedestal().
|
protected |
Method to compute a pedestal of the input waveform using "nsample" ADC samples from "start" index.
Definition at line 95 of file PedAlgoRmsSlider.cxx.
References _csvfile, _n_wf_to_csvfile, _num_postsample, _num_presample, _sample_size, _threshold, _verbose, _wf_saved, CalcMean(), CalcStd(), CheckSanity(), pmtana::mean(), PrintInfo(), and pmtana::std().
|
protectedpure virtualinherited |
Method to compute pedestal: mean and sigma array should be filled per ADC. The length of each array is guaranteed to be same.
Referenced by pmtana::PMTPedestalBase::Evaluate().
|
inherited |
Method to compute a pedestal.
Definition at line 30 of file PMTPedestalBase.cxx.
References pmtana::PMTPedestalBase::_mean_v, pmtana::PMTPedestalBase::_sigma_v, and pmtana::PMTPedestalBase::ComputePedestal().
Referenced by pmtana::PedAlgoUB::ComputePedestal(), and pmtana::PulseRecoManager::Reconstruct().
|
inherited |
Getter of the pedestal mean value.
Definition at line 50 of file PMTPedestalBase.cxx.
References pmtana::PMTPedestalBase::_mean_v.
Referenced by pmtana::PedAlgoUB::ComputePedestal(), and pmtana::PulseRecoManager::Reconstruct().
|
inherited |
Getter of the pedestal mean value.
Definition at line 74 of file PMTPedestalBase.cxx.
References pmtana::PMTPedestalBase::_mean_v.
|
inherited |
Name getter.
Definition at line 23 of file PMTPedestalBase.cxx.
References pmtana::PMTPedestalBase::_name.
void pmtana::PedAlgoRmsSlider::PrintInfo | ( | ) |
Print settings.
Definition at line 48 of file PedAlgoRmsSlider.cxx.
References _n_wf_to_csvfile, _sample_size, _threshold, and _verbose.
Referenced by ComputePedestal().
|
inherited |
Getter of the pedestal standard deviation.
Definition at line 62 of file PMTPedestalBase.cxx.
References pmtana::PMTPedestalBase::_sigma_v.
Referenced by pmtana::PedAlgoUB::ComputePedestal(), and pmtana::PulseRecoManager::Reconstruct().
|
inherited |
Getter of the pedestal standard deviation.
Definition at line 81 of file PMTPedestalBase.cxx.
References pmtana::PMTPedestalBase::_sigma_v.
|
private |
Definition at line 66 of file PedAlgoRmsSlider.h.
Referenced by ComputePedestal(), and PedAlgoRmsSlider().
|
private |
Max sigma to consider adc as 'sane'.
Definition at line 57 of file PedAlgoRmsSlider.h.
Referenced by CheckSanity(), and PedAlgoRmsSlider().
|
private |
If greater than zero saves firsts waveforms with pedestal to csv file.
Definition at line 62 of file PedAlgoRmsSlider.h.
Referenced by ComputePedestal(), PedAlgoRmsSlider(), and PrintInfo().
|
private |
number of ADCs to sample after the gap
Definition at line 65 of file PedAlgoRmsSlider.h.
Referenced by ComputePedestal(), and PedAlgoRmsSlider().
|
private |
number of ADCs to sample before the gap
Definition at line 64 of file PedAlgoRmsSlider.h.
Referenced by ComputePedestal(), and PedAlgoRmsSlider().
|
private |
Max value of adc to consider adc as 'sane'.
Definition at line 58 of file PedAlgoRmsSlider.h.
Referenced by CheckSanity(), and PedAlgoRmsSlider().
|
private |
Min value of adc to consider adc as 'sane'.
Definition at line 59 of file PedAlgoRmsSlider.h.
Referenced by PedAlgoRmsSlider().
|
private |
How many samples are used to calculate local rms and mean.
Definition at line 54 of file PedAlgoRmsSlider.h.
Referenced by ComputePedestal(), PedAlgoRmsSlider(), and PrintInfo().
|
private |
Threshold applied to local rms to claim a pulse.
Definition at line 55 of file PedAlgoRmsSlider.h.
Referenced by ComputePedestal(), PedAlgoRmsSlider(), and PrintInfo().
|
private |
For debugging.
Definition at line 61 of file PedAlgoRmsSlider.h.
Referenced by CheckSanity(), ComputePedestal(), PedAlgoRmsSlider(), and PrintInfo().
|
private |
Definition at line 63 of file PedAlgoRmsSlider.h.
Referenced by ComputePedestal().