LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PedAlgoUB.cxx
Go to the documentation of this file.
1 //
3 // PedAlgoUB source
4 //
6 
7 #include "PedAlgoUB.h"
8 
10 
11 namespace pmtana {
12 
13  //************************************************
14  PedAlgoUB::PedAlgoUB(const std::string name) : PMTPedestalBase(name), _beamgatealgo(name)
15  //************************************************
16  {}
17 
18  //*************************************************************
20  //PedAlgoUB::PedAlgoUB(const ::fcllite::PSet &pset,
21  const std::string name)
22  : PMTPedestalBase(name)
23  //, _beamgatealgo(pset.get_pset("BeamGateAlgo"),"BeamGateAlgo")
24  , _beamgatealgo(pset, "BeamGateAlgo")
25  //*************************************************************
26  {
27  _beam_gate_samples = pset.get<unsigned int>("BeamGateSamples");
28  }
29 
30  //*********************************************************************
32  pmtana::PedestalMean_t& mean_v,
33  pmtana::PedestalSigma_t& sigma_v)
34  //*********************************************************************
35  {
36 
37  if (wf.size() < _beam_gate_samples) {
38 
39  double ped_mean = wf.front(); //first sample
40  double ped_sigma = 0;
41 
42  for (auto& v : mean_v)
43  v = ped_mean;
44  for (auto& v : sigma_v)
45  v = ped_sigma;
46 
47  return true;
48  }
49 
50  else {
51 
53  mean_v = _beamgatealgo.Mean();
54  sigma_v = _beamgatealgo.Sigma();
55 
56  return true;
57  }
58  }
59 
60 }
double Mean(size_t i) const
Getter of the pedestal mean value.
std::vector< double > PedestalSigma_t
PedAlgoRmsSlider _beamgatealgo
Definition: PedAlgoUB.h:52
unsigned int _beam_gate_samples
Definition: PedAlgoUB.h:53
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:314
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:31
PedAlgoUB(const std::string name="PedCD")
Default constructor.
Definition: PedAlgoUB.cxx:14
std::vector< double > PedestalMean_t