LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
PedAlgoUB.cxx
Go to the documentation of this file.
1 //
3 // PedAlgoUB source
4 //
6 
7 #ifndef larana_OPTICALDETECTOR_PEDALGOUB_CXX
8 #define larana_OPTICALDETECTOR_PEDALGOUB_CXX
9 
10 #include "PedAlgoUB.h"
11 #include "UtilFunc.h"
12 #include "OpticalRecoException.h"
13 
14 namespace pmtana{
15 
16  //************************************************
17  PedAlgoUB::PedAlgoUB(const std::string name)
18  : PMTPedestalBase(name),
19  _beamgatealgo(name)
20  //************************************************
21  {}
22 
23  //*************************************************************
25  //PedAlgoUB::PedAlgoUB(const ::fcllite::PSet &pset,
26  const std::string name)
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  }
34 
35  //***************************
37  //***************************
38  {}
39 
40  //*********************************************************************
42  pmtana::PedestalMean_t& mean_v,
43  pmtana::PedestalSigma_t& sigma_v)
44  //*********************************************************************
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  }
69 
70 }
71 
72 #endif
Class def header for exception classes in OpticalDetector package.
double Mean(size_t i) const
Getter of the pedestal mean value.
std::vector< double > PedestalSigma_t
PedAlgoRmsSlider _beamgatealgo
Definition: PedAlgoUB.h:57
virtual ~PedAlgoUB()
Default destructor.
Definition: PedAlgoUB.cxx:36
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.
T get(std::string const &key) const
Definition: ParameterSet.h:231
std::vector< short > Waveform_t
Class definition file of PedAlgoUB.
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...
Definition: PedAlgoUB.cxx:41
PedAlgoUB(const std::string name="PedCD")
Default constructor.
Definition: PedAlgoUB.cxx:17
std::vector< double > PedestalMean_t