LArSoft  v06_85_00
Liquid Argon Software toolkit - http://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 
18 // STL
19 #include "PMTPedestalBase.h"
20 #include "fhiclcpp/ParameterSet.h"
21 
22 #include <fstream>
23 
24 namespace pmtana
25 {
26 
32 
33  public:
34 
36  PedAlgoRmsSlider(const std::string name="PedRmsSlider");
37 
39  PedAlgoRmsSlider(const fhicl::ParameterSet &pset,const std::string name="PedRmsSlider");
40 
42  virtual ~PedAlgoRmsSlider();
43 
45  void PrintInfo();
46 
47 
48  protected:
49 
51  bool ComputePedestal( const pmtana::Waveform_t& wf,
52  pmtana::PedestalMean_t& mean_v,
53  pmtana::PedestalSigma_t& sigma_v);
54 
55  private:
56 
57  size_t _sample_size;
58  double _threshold;
59 
60  float _max_sigma;
63 
64  bool _verbose;
66  int _wf_saved = 0;
67  std::ofstream _csvfile;
68 
70  double CalcMean(const std::vector<double>& wf, size_t start, size_t nsample);
71 
73  double CalcStd(const std::vector<double>& wf, const double ped_mean, size_t start, size_t nsample);
74 
77  };
78 }
79 #endif
80  // end of doxygen group
void PrintInfo()
Print settings.
bool CheckSanity(pmtana::PedestalMean_t &mean_v, pmtana::PedestalSigma_t &sigma_v)
Checks the sanity of the estimated pedestal, returns false if not sane.
std::vector< double > PedestalSigma_t
float _ped_range_min
Min value of adc to consider adc as &#39;sane&#39;.
virtual ~PedAlgoRmsSlider()
Default destructor.
float _max_sigma
Max sigma to consider adc as &#39;sane&#39;.
PedAlgoRmsSlider(const std::string name="PedRmsSlider")
Default constructor.
Class definition file of PMTPedestalBase.
double CalcStd(const std::vector< double > &wf, const double ped_mean, size_t start, size_t nsample)
Returns the std of the elements of the vector from start to start+nsample.
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...
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;.
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.
double CalcMean(const std::vector< double > &wf, size_t start, size_t nsample)
Returns the mean of the elements of the vector from start to start+nsample.
std::vector< double > PedestalMean_t
bool _verbose
For debugging.