All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
PedAlgoUB.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // PedAlgoUB source
4 //
5 ////////////////////////////////////////////////////////////////////////
6 
7 #include "PedAlgoUB.h"
8 
9 #include "fhiclcpp/ParameterSet.h"
10 
11 namespace pmtana{
12 
13  //************************************************
14  PedAlgoUB::PedAlgoUB(const std::string name)
15  : PMTPedestalBase(name),
16  _beamgatealgo(name)
17  //************************************************
18  {}
19 
20  //*************************************************************
21  PedAlgoUB::PedAlgoUB(const fhicl::ParameterSet &pset,
22  //PedAlgoUB::PedAlgoUB(const ::fcllite::PSet &pset,
23  const std::string name)
24  : PMTPedestalBase(name)
25  //, _beamgatealgo(pset.get_pset("BeamGateAlgo"),"BeamGateAlgo")
26  , _beamgatealgo(pset,"BeamGateAlgo")
27  //*************************************************************
28  {
29  _beam_gate_samples = pset.get<unsigned int>("BeamGateSamples");
30  }
31 
32  //*********************************************************************
34  pmtana::PedestalMean_t& mean_v,
35  pmtana::PedestalSigma_t& sigma_v)
36  //*********************************************************************
37  {
38 
39  if ( wf.size() < _beam_gate_samples ) {
40 
41  double ped_mean = wf.front(); //first sample
42  double ped_sigma = 0;
43 
44  for( auto &v : mean_v ) v = ped_mean;
45  for( auto &v : sigma_v ) v = ped_sigma;
46 
47  return true;
48 
49  }
50 
51  else {
52 
54  mean_v = _beamgatealgo.Mean();
55  sigma_v = _beamgatealgo.Sigma();
56 
57  return true;
58  }
59 
60  }
61 
62 }
double Mean(size_t i) const
Getter of the pedestal mean value.
std::vector< double > PedestalSigma_t
PedAlgoRmsSlider _beamgatealgo
Definition: PedAlgoUB.h:54
unsigned int _beam_gate_samples
Definition: PedAlgoUB.h:55
bool Evaluate(const pmtana::Waveform_t &wf)
Method to compute a pedestal.
double Sigma(size_t i) const
Getter of the pedestal standard deviation.
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 &quot;nsample&quot; ADC samples from &quot;start&quot; index...
Definition: PedAlgoUB.cxx:33
PedAlgoUB(const std::string name="PedCD")
Default constructor.
Definition: PedAlgoUB.cxx:14
then echo fcl name
std::vector< double > PedestalMean_t