LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PedAlgoRmsSlider.h
Go to the documentation of this file.
1 
15 #ifndef larana_OPTICALDETECTOR_PEDALGORMSSLIDER_H
16 #define larana_OPTICALDETECTOR_PEDALGORMSSLIDER_H
17 
19 
20 #include "PMTPedestalBase.h"
21 namespace fhicl {
22  class ParameterSet;
23 }
24 
25 #include <fstream>
26 #include <string>
27 #include <vector>
28 
29 namespace pmtana {
30 
36 
37  public:
39  PedAlgoRmsSlider(const std::string name = "PedRmsSlider");
40 
42  PedAlgoRmsSlider(const fhicl::ParameterSet& pset, const std::string name = "PedRmsSlider");
43 
45  void PrintInfo();
46 
47  protected:
49  bool ComputePedestal(const pmtana::Waveform_t& wf,
50  pmtana::PedestalMean_t& mean_v,
51  pmtana::PedestalSigma_t& sigma_v);
52 
53  private:
54  size_t _sample_size;
55  double _threshold;
56 
57  float _max_sigma;
60 
61  bool _verbose;
63  int _wf_saved = 0;
66  std::ofstream _csvfile;
67 
69  double CalcMean(const std::vector<double>& wf, size_t start, size_t nsample);
70 
72  double CalcStd(const std::vector<double>& wf,
73  const double ped_mean,
74  size_t start,
75  size_t nsample);
76 
78  bool CheckSanity(pmtana::PedestalMean_t& mean_v, pmtana::PedestalSigma_t& sigma_v);
79  };
80 }
81 #endif
82  // end of doxygen group
std::vector< double > PedestalSigma_t
float _ped_range_min
Min value of adc to consider adc as &#39;sane&#39;.
int _num_postsample
number of ADCs to sample after the gap
float _max_sigma
Max sigma to consider adc as &#39;sane&#39;.
Class definition file of PMTPedestalBase.
int _num_presample
number of ADCs to sample before the gap
double _threshold
Threshold applied to local rms to claim a pulse.
float _ped_range_max
Max value of adc to consider adc as &#39;sane&#39;.
parameter set interface
std::vector< short > Waveform_t
int _n_wf_to_csvfile
If greater than zero saves firsts waveforms with pedestal to csv file.
size_t _sample_size
How many samples are used to calculate local rms and mean.
std::vector< double > PedestalMean_t
bool _verbose
For debugging.