LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
pmtana::PedAlgoUB Class Referenceabstract

#include "PedAlgoUB.h"

Inheritance diagram for pmtana::PedAlgoUB:
pmtana::PMTPedestalBase

Public Member Functions

 PedAlgoUB (const std::string name="PedCD")
 Default constructor. More...
 
 PedAlgoUB (const fhicl::ParameterSet &pset, const std::string name="PedAlgoUB")
 Alternative ctor. More...
 
virtual ~PedAlgoUB ()
 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...
 
const pmtana::PedestalMean_tMean () const
 Getter of the pedestal mean value. More...
 
double Sigma (size_t i) const
 Getter of the pedestal standard deviation. More...
 
const pmtana::PedestalSigma_tSigma () 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 Attributes

PedAlgoRmsSlider _beamgatealgo
 
unsigned int _beam_gate_samples
 

Detailed Description

A class that calculates pedestal mean & standard deviation (here and elsewhere called as "RMS").

Definition at line 32 of file PedAlgoUB.h.

Constructor & Destructor Documentation

pmtana::PedAlgoUB::PedAlgoUB ( const std::string  name = "PedCD")

Default constructor.

Definition at line 17 of file PedAlgoUB.cxx.

18  : PMTPedestalBase(name),
19  _beamgatealgo(name)
20  //************************************************
21  {}
PedAlgoRmsSlider _beamgatealgo
Definition: PedAlgoUB.h:57
PMTPedestalBase(std::string name="noname")
Default constructor.
pmtana::PedAlgoUB::PedAlgoUB ( const fhicl::ParameterSet pset,
const std::string  name = "PedAlgoUB" 
)

Alternative ctor.

Definition at line 24 of file PedAlgoUB.cxx.

References _beam_gate_samples, and fhicl::ParameterSet::get().

27  : PMTPedestalBase(name)
28  //, _beamgatealgo(pset.get_pset("BeamGateAlgo"),"BeamGateAlgo")
29  , _beamgatealgo(pset,"BeamGateAlgo")
30  //*************************************************************
31  {
32  _beam_gate_samples = pset.get<unsigned int>("BeamGateSamples");
33  }
PedAlgoRmsSlider _beamgatealgo
Definition: PedAlgoUB.h:57
PMTPedestalBase(std::string name="noname")
Default constructor.
unsigned int _beam_gate_samples
Definition: PedAlgoUB.h:58
T get(std::string const &key) const
Definition: ParameterSet.h:231
pmtana::PedAlgoUB::~PedAlgoUB ( )
virtual

Default destructor.

Definition at line 36 of file PedAlgoUB.cxx.

38  {}

Member Function Documentation

bool pmtana::PedAlgoUB::ComputePedestal ( const pmtana::Waveform_t wf,
pmtana::PedestalMean_t mean_v,
pmtana::PedestalSigma_t sigma_v 
)
protected

Method to compute a pedestal of the input waveform using "nsample" ADC samples from "start" index.

Definition at line 41 of file PedAlgoUB.cxx.

References _beam_gate_samples, _beamgatealgo, pmtana::PMTPedestalBase::Evaluate(), pmtana::PMTPedestalBase::Mean(), and pmtana::PMTPedestalBase::Sigma().

45  {
46 
47  if ( wf.size() < _beam_gate_samples ) {
48 
49  double ped_mean = wf.front(); //first sample
50  double ped_sigma = 0;
51 
52  for( auto &v : mean_v ) v = ped_mean;
53  for( auto &v : sigma_v ) v = ped_sigma;
54 
55  return true;
56 
57  }
58 
59  else {
60 
62  mean_v = _beamgatealgo.Mean();
63  sigma_v = _beamgatealgo.Sigma();
64 
65  return true;
66  }
67 
68  }
double Mean(size_t i) const
Getter of the pedestal mean value.
PedAlgoRmsSlider _beamgatealgo
Definition: PedAlgoUB.h:57
unsigned int _beam_gate_samples
Definition: PedAlgoUB.h:58
bool Evaluate(const pmtana::Waveform_t &wf)
Method to compute a pedestal.
double Sigma(size_t i) const
Getter of the pedestal standard deviation.
virtual bool pmtana::PMTPedestalBase::ComputePedestal ( const ::pmtana::Waveform_t wf,
pmtana::PedestalMean_t mean_v,
pmtana::PedestalSigma_t sigma_v 
)
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().

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

Method to compute a pedestal.

Definition at line 33 of file PMTPedestalBase.cxx.

References pmtana::PMTPedestalBase::_mean_v, pmtana::PMTPedestalBase::_sigma_v, and pmtana::PMTPedestalBase::ComputePedestal().

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

35  {
36  _mean_v.resize(wf.size(),0);
37  _sigma_v.resize(wf.size(),0);
38 
39  for(size_t i=0; i<wf.size(); ++i)
40  _mean_v[i] = _sigma_v[i] = 0;
41 
42  const bool res = ComputePedestal(wf, _mean_v, _sigma_v);
43 
44  if(wf.size() != _mean_v.size())
45  throw OpticalRecoException("Internal error: computed pedestal mean array length changed!");
46  if(wf.size() != _sigma_v.size())
47  throw OpticalRecoException("Internal error: computed pedestal sigma array length changed!");
48 
49  return res;
50  }
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
inherited

Getter of the pedestal mean value.

Definition at line 53 of file PMTPedestalBase.cxx.

References pmtana::PMTPedestalBase::_mean_v, and ss.

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

55  {
56  if(i > _mean_v.size()) {
57  std::stringstream ss;
58  ss << "Invalid index: no pedestal mean exist @ " << i;
59  throw OpticalRecoException(ss.str());
60  }
61  return _mean_v[i];
62  }
Float_t ss
Definition: plot.C:23
pmtana::PedestalMean_t _mean_v
A variable holder for pedestal mean value.
const PedestalMean_t & pmtana::PMTPedestalBase::Mean ( ) const
inherited

Getter of the pedestal mean value.

Definition at line 77 of file PMTPedestalBase.cxx.

References pmtana::PMTPedestalBase::_mean_v.

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

Name getter.

Definition at line 28 of file PMTPedestalBase.cxx.

References pmtana::PMTPedestalBase::_name.

30  { return _name;}
std::string _name
Name.
double pmtana::PMTPedestalBase::Sigma ( size_t  i) const
inherited

Getter of the pedestal standard deviation.

Definition at line 65 of file PMTPedestalBase.cxx.

References pmtana::PMTPedestalBase::_sigma_v, and ss.

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

67  {
68  if(i > _sigma_v.size()) {
69  std::stringstream ss;
70  ss << "Invalid index: no pedestal sigma exist @ " << i;
71  throw OpticalRecoException(ss.str());
72  }
73  return _sigma_v[i];
74  }
Float_t ss
Definition: plot.C:23
pmtana::PedestalSigma_t _sigma_v
A variable holder for pedestal standard deviation.
const PedestalSigma_t & pmtana::PMTPedestalBase::Sigma ( ) const
inherited

Getter of the pedestal standard deviation.

Definition at line 82 of file PMTPedestalBase.cxx.

References pmtana::PMTPedestalBase::_sigma_v.

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

Member Data Documentation

unsigned int pmtana::PedAlgoUB::_beam_gate_samples
private

Definition at line 58 of file PedAlgoUB.h.

Referenced by ComputePedestal(), and PedAlgoUB().

PedAlgoRmsSlider pmtana::PedAlgoUB::_beamgatealgo
private

Definition at line 57 of file PedAlgoUB.h.

Referenced by ComputePedestal().


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