preco_algo_base.hh

Go to the documentation of this file.
00001 
00015 #ifndef PRECO_ALGO_BASE_HH
00016 #define PRECO_ALGO_BASE_HH
00017 
00018 #include "Base-TypeDef.hh"
00019 #include <TString.h>
00020 #include <cmath>
00021 #include <functional>
00022 #include <numeric>
00023 
00024 struct pulse_param{
00025   
00026   double peak, area;
00027   double t_start, t_max, t_end;
00028   
00029   pulse_param(){
00030     reset_param();
00031   };
00032   
00033   void reset_param(){      
00034     peak = area = -1;
00035     t_start = t_max = t_end = -1;
00036   };
00037   
00038 };
00039 
00055 class preco_algo_base : public decoder_base {
00056 
00057 public:
00058 
00060   preco_algo_base();
00061 
00063   virtual ~preco_algo_base(){};
00064 
00070   virtual DATA_STRUCT::DATA_TYPE storage_type(){return DATA_STRUCT::PULSE_COLLECTION;};
00071 
00073   virtual void reset();
00074 
00078   virtual bool reco(const std::vector<UShort_t> *wf)=0;
00079 
00084   const pulse_param* get_pulse(size_t index=0) const;
00085 
00087   size_t get_npulse() const   {return _pulse_v.size();};
00088 
00090   void set_ped_mean(double v) { _ped_mean = v; };
00091 
00093   void set_ped_rms(double v)  { _ped_rms = v; };
00094 
00096   double ped_mean() const     {return _ped_mean; };
00097 
00099   double ped_rms() const      {return _ped_rms;  };
00100 
00101 protected:
00102 
00104   std::vector<pulse_param> _pulse_v;
00105 
00107   pulse_param _pulse;
00108 
00110   double _ped_mean;
00111 
00113   double _ped_rms;
00114 
00115 protected:
00116 
00121   bool integral   (const std::vector<UShort_t> *wf, double &result, size_t begin=0, size_t end=0) const;
00122 
00127   bool derivative (const std::vector<UShort_t> *wf, std::vector<Int_t> &diff, size_t begin=0, size_t end=0) const;
00128 
00133   size_t max(const std::vector<UShort_t> *wf, double &result, size_t begin=0, size_t end=0) const;
00134 
00139   size_t min(const std::vector<UShort_t> *wf, double &result, size_t begin=0, size_t end=0) const;
00140 
00141 };
00142 
00143 
00144 #endif
00145  // end of doxygen group

Generated on Mon Apr 7 15:35:12 2014 for MyProject by  doxygen 1.4.7