algo_fixed_window.cc

Go to the documentation of this file.
00001 #ifndef ALGO_FIXED_WINDOW_CC
00002 #define ALGO_FIXED_WINDOW_CC
00003 
00004 #include "algo_fixed_window.hh"
00005 
00006 //***************************************************************
00007 algo_fixed_window::algo_fixed_window() : preco_algo_base() {
00008 //***************************************************************
00009 
00010   _name = "algo_fixed_window";
00011   
00012   reset();
00013 
00014   _index_start = 0;
00015 
00016   _index_end = 0;
00017 
00018 }
00019 
00020 void algo_fixed_window::reset(){
00021 
00022   if(!(_pulse_v.size()))
00023 
00024     _pulse_v.push_back(_pulse);
00025 
00026   _pulse_v[0].reset_param();
00027 
00028 }
00029 
00030 //***************************************************************
00031 bool algo_fixed_window::reco(const std::vector<UShort_t> *wf) {
00032 //***************************************************************
00033 
00034   this->reset();
00035 
00036   _pulse_v[0].t_start = (double)(_index_start);
00037 
00038   if(!_index_end)
00039 
00040     _pulse_v[0].t_end = (double)(wf->size() - 1);
00041 
00042   else
00043 
00044     _pulse_v[0].t_end = (double)_index_end;
00045 
00046   _pulse_v[0].t_max = preco_algo_base::max(wf, _pulse_v[0].peak, _index_start, _index_end);
00047 
00048   _pulse_v[0].peak -= _ped_mean;
00049 
00050   preco_algo_base::integral(wf, _pulse_v[0].area, _index_start, _index_end);
00051 
00052   _pulse_v[0].area = _pulse_v[0].area - ( _pulse_v[0].t_end - _pulse_v[0].t_start + 1) * _ped_mean;
00053 
00054   return true;
00055 
00056 }
00057 
00058 #endif

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