LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
pmtana::PMTPedestalBase Class Referenceabstract

#include "PMTPedestalBase.h"

Inheritance diagram for pmtana::PMTPedestalBase:
pmtana::PedAlgoEdges pmtana::PedAlgoRmsSlider pmtana::PedAlgoRollingMean pmtana::PedAlgoUB

Public Member Functions

 PMTPedestalBase (std::string name="noname")
 Default constructor. More...
 
virtual ~PMTPedestalBase ()
 Default destructor. 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...
 
double Sigma (size_t i) const
 Getter of the pedestal standard deviation. More...
 
const pmtana::PedestalMean_tMean () const
 Getter of the pedestal mean value. More...
 
const pmtana::PedestalSigma_tSigma () const
 Getter of the pedestal standard deviation. More...
 

Protected Member Functions

virtual bool ComputePedestal (const ::pmtana::Waveform_t &wf, pmtana::PedestalMean_t &mean_v, pmtana::PedestalSigma_t &sigma_v)=0
 

Private Attributes

std::string _name
 Name. More...
 
pmtana::PedestalMean_t _mean_v
 A variable holder for pedestal mean value. More...
 
pmtana::PedestalSigma_t _sigma_v
 A variable holder for pedestal standard deviation. More...
 

Detailed Description

A base class for pedestal calculation

Definition at line 27 of file PMTPedestalBase.h.

Constructor & Destructor Documentation

pmtana::PMTPedestalBase::PMTPedestalBase ( std::string  name = "noname")

Default constructor.

Definition at line 13 of file PMTPedestalBase.cxx.

13  : _name(name), _mean_v(), _sigma_v()
14  //**************************************************************
15  {}
std::string _name
Name.
pmtana::PedestalMean_t _mean_v
A variable holder for pedestal mean value.
pmtana::PedestalSigma_t _sigma_v
A variable holder for pedestal standard deviation.
pmtana::PMTPedestalBase::~PMTPedestalBase ( )
virtual

Default destructor.

Definition at line 18 of file PMTPedestalBase.cxx.

20  {}

Member Function Documentation

virtual bool pmtana::PMTPedestalBase::ComputePedestal ( const ::pmtana::Waveform_t wf,
pmtana::PedestalMean_t mean_v,
pmtana::PedestalSigma_t sigma_v 
)
protectedpure virtual

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 Evaluate().

bool pmtana::PMTPedestalBase::Evaluate ( const pmtana::Waveform_t wf)

Method to compute a pedestal.

Definition at line 30 of file PMTPedestalBase.cxx.

References _mean_v, _sigma_v, and ComputePedestal().

Referenced by pmtana::PedAlgoUB::ComputePedestal(), and pmtana::PulseRecoManager::Reconstruct().

32  {
33  _mean_v.resize(wf.size(), 0);
34  _sigma_v.resize(wf.size(), 0);
35 
36  for (size_t i = 0; i < wf.size(); ++i)
37  _mean_v[i] = _sigma_v[i] = 0;
38 
39  const bool res = ComputePedestal(wf, _mean_v, _sigma_v);
40 
41  if (wf.size() != _mean_v.size())
42  throw OpticalRecoException("Internal error: computed pedestal mean array length changed!");
43  if (wf.size() != _sigma_v.size())
44  throw OpticalRecoException("Internal error: computed pedestal sigma array length changed!");
45 
46  return res;
47  }
pmtana::PedestalMean_t _mean_v
A variable holder for pedestal mean value.
virtual bool ComputePedestal(const ::pmtana::Waveform_t &wf, pmtana::PedestalMean_t &mean_v, pmtana::PedestalSigma_t &sigma_v)=0
pmtana::PedestalSigma_t _sigma_v
A variable holder for pedestal standard deviation.
double pmtana::PMTPedestalBase::Mean ( size_t  i) const

Getter of the pedestal mean value.

Definition at line 50 of file PMTPedestalBase.cxx.

References _mean_v.

Referenced by pmtana::PedAlgoUB::ComputePedestal(), and pmtana::PulseRecoManager::Reconstruct().

52  {
53  if (i > _mean_v.size()) {
54  std::stringstream ss;
55  ss << "Invalid index: no pedestal mean exist @ " << i;
56  throw OpticalRecoException(ss.str());
57  }
58  return _mean_v[i];
59  }
pmtana::PedestalMean_t _mean_v
A variable holder for pedestal mean value.
const PedestalMean_t & pmtana::PMTPedestalBase::Mean ( ) const

Getter of the pedestal mean value.

Definition at line 74 of file PMTPedestalBase.cxx.

References _mean_v.

76  {
77  return _mean_v;
78  }
pmtana::PedestalMean_t _mean_v
A variable holder for pedestal mean value.
const std::string & pmtana::PMTPedestalBase::Name ( ) const

Name getter.

Definition at line 23 of file PMTPedestalBase.cxx.

References _name.

25  {
26  return _name;
27  }
std::string _name
Name.
double pmtana::PMTPedestalBase::Sigma ( size_t  i) const

Getter of the pedestal standard deviation.

Definition at line 62 of file PMTPedestalBase.cxx.

References _sigma_v.

Referenced by pmtana::PedAlgoUB::ComputePedestal(), and pmtana::PulseRecoManager::Reconstruct().

64  {
65  if (i > _sigma_v.size()) {
66  std::stringstream ss;
67  ss << "Invalid index: no pedestal sigma exist @ " << i;
68  throw OpticalRecoException(ss.str());
69  }
70  return _sigma_v[i];
71  }
pmtana::PedestalSigma_t _sigma_v
A variable holder for pedestal standard deviation.
const PedestalSigma_t & pmtana::PMTPedestalBase::Sigma ( ) const

Getter of the pedestal standard deviation.

Definition at line 81 of file PMTPedestalBase.cxx.

References _sigma_v.

83  {
84  return _sigma_v;
85  }
pmtana::PedestalSigma_t _sigma_v
A variable holder for pedestal standard deviation.

Member Data Documentation

pmtana::PedestalMean_t pmtana::PMTPedestalBase::_mean_v
private

A variable holder for pedestal mean value.

Definition at line 68 of file PMTPedestalBase.h.

Referenced by Evaluate(), and Mean().

std::string pmtana::PMTPedestalBase::_name
private

Name.

Definition at line 65 of file PMTPedestalBase.h.

Referenced by Name().

pmtana::PedestalSigma_t pmtana::PMTPedestalBase::_sigma_v
private

A variable holder for pedestal standard deviation.

Definition at line 71 of file PMTPedestalBase.h.

Referenced by Evaluate(), and Sigma().


The documentation for this class was generated from the following files: