waveform_sampler.hh

Go to the documentation of this file.
00001 
00015 #ifndef WAVEFORM_SAMPLER_HH
00016 #define WAVEFORM_SAMPLER_HH
00017 
00018 #include <TH2D.h>
00019 #include <set>
00020 #include <map>
00021 
00022 #include "ana_base.hh"
00023 #include "pulse_selector_simple.hh"
00024 
00029 class waveform_sampler : public ana_base{
00030 
00031 public:
00032 
00034   waveform_sampler();
00035 
00037   virtual ~waveform_sampler(){};
00038 
00042   virtual bool initialize();
00043 
00047   virtual bool analyze(storage_manager* storage);
00048 
00052   virtual bool finalize();
00053 
00054   void set_selection(pulse_selector_base* algo){_selector=algo;};
00055 
00056   void set_waveform_length(int length){_wf_length=length;};
00057 
00058   TH2D* get_waveform(PMT::ch_number_t ch){ 
00059 
00060     if(_hWF_map.find(ch)==_hWF_map.end()) return 0; 
00061     return _hWF_map[ch];
00062 
00063   };
00064 
00065 protected:
00066 
00067   void clear_event();
00068 
00069   void sample_waveform(const pmt_waveform *wf);
00070 
00071   std::map<PMT::ch_number_t,std::map<PMT::word_t,std::set<PMT::word_t> > > _sel_info;
00072   
00073   pulse_selector_base* _selector;
00074 
00075   std::map<PMT::ch_number_t,TH2D*> _hWF_map;
00076 
00077   int _wf_length;
00078 
00079 };
00080 
00081 #endif
00082  // end of doxygen group 

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