LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
PMTPulseRecoBase.h
Go to the documentation of this file.
1 
15 #ifndef PMTPULSERECOBASE_H
16 #define PMTPULSERECOBASE_H
17 
18 // STL
19 #include <vector>
20 #include <cmath>
21 #include <functional>
22 #include <numeric>
23 #include <iostream>
24 
25 #include "OpticalRecoTypes.h"
26 namespace pmtana
27 {
28 
29  struct pulse_param{
30  public:
32  double t_start, t_max, t_end;
33 
34  //for vic
35  double t_cfdcross;
36 
38  reset_param();
39  }
40 
42 
43  void reset_param(){
44  area = 0;
45  peak = -1;
46  ped_mean = ped_sigma = -1;
47  t_start = t_max = t_end = -1;
48  t_cfdcross = -1;
49  }
50 
51  };
52 
53  typedef std::vector<pmtana::pulse_param> pulse_param_array;
54 
71 
72  public:
73 
75  PMTPulseRecoBase(const std::string name="noname");
76 
78  virtual ~PMTPulseRecoBase();
79 
81  const std::string& Name() const;
82 
84  const bool Status() const;
85 
87  virtual void Reset();
88 
92  bool Reconstruct( const pmtana::Waveform_t&,
94  const pmtana::PedestalSigma_t& );
95 
100  const pulse_param& GetPulse(size_t index=0) const;
101 
103  const pulse_param_array& GetPulses() const;
104 
106  size_t GetNPulse() const {return _pulse_v.size();};
107 
108  private:
109 
111  std::string _name;
112 
114  bool _status;
115 
116  protected:
117 
118  virtual bool RecoPulse( const pmtana::Waveform_t&,
119  const pmtana::PedestalMean_t&,
120  const pmtana::PedestalSigma_t& ) = 0;
121 
123  pulse_param_array _pulse_v;
124 
127 
128  protected:
129 
134  bool Integral (const std::vector<short> &wf, double &result, size_t begin=0, size_t end=0) const;
135 
140  bool Derivative (const std::vector<short> &wf, std::vector<int32_t> &diff, size_t begin=0, size_t end=0) const;
141 
146  size_t Max(const std::vector<short> &wf, double &result, size_t begin=0, size_t end=0) const;
147 
152  size_t Min(const std::vector<short> &wf, double &result, size_t begin=0, size_t end=0) const;
153 
154  };
155 
156 }
157 #endif
158  // end of doxygen group
bool _status
Status after pulse reconstruction.
std::vector< double > PedestalSigma_t
size_t GetNPulse() const
A getter for the number of reconstructed pulses from the input waveform.
pulse_param _pulse
A subject pulse_param object to be filled with the last reconstructed pulse parameters.
ntupleExperimental Reset()
std::vector< evd::details::RawDigitInfo_t >::const_iterator begin(RawDigitCacheDataClass const &cache)
std::vector< short > Waveform_t
std::vector< evd::details::RawDigitInfo_t >::const_iterator end(RawDigitCacheDataClass const &cache)
std::vector< pmtana::pulse_param > pulse_param_array
std::vector< double > PedestalMean_t
pulse_param_array _pulse_v
A container array of pulse_param struct objects to store (possibly multiple) reconstructed pulse(s)...