LArSoft  v06_85_00
Liquid Argon Software toolkit - http://larsoft.org/
AlgoFixedWindow.cxx
Go to the documentation of this file.
1 //
3 // AlgoFixedWindow source
4 //
6 
7 #ifndef ALGOFIXEDWINDOW_CC
8 #define ALGOFIXEDWINDOW_CC
9 
10 #include "AlgoFixedWindow.h"
11 
12 namespace pmtana{
13 
14  //*******************************************************************************
15  AlgoFixedWindow::AlgoFixedWindow(const std::string name) : PMTPulseRecoBase(name)
16  //*******************************************************************************
17  {
18  Reset();
19 
20  _index_start = 0;
21 
22  _index_end = 0;
23  }
24 
25  //****************************************************************************************
27  //AlgoFixedWindow::AlgoFixedWindow(const ::fcllite::PSet& pset,
28  const std::string name)
29  : PMTPulseRecoBase(name)
30  //****************************************************************************************
31  {
32  Reset();
33 
34  _index_start = pset.get<size_t>("StartIndex");
35 
36  _index_end = pset.get<size_t>("EndIndex");
37  }
38 
39  //***************************************************************
41  //***************************************************************
42  {}
43 
44  //***************************************************************
46  //***************************************************************
47  {
48  if(!(_pulse_v.size()))
49 
50  _pulse_v.push_back(_pulse);
51 
52  _pulse_v[0].reset_param();
53 
54  }
55 
56  //***************************************************************
58  const PedestalMean_t& mean_v,
59  const PedestalSigma_t& sigma_v)
60  //***************************************************************
61  {
62  this->Reset();
63 
64  if( _index_start >= wf.size() ) return true;
65 
66  _pulse_v[0].t_start = (double)(_index_start);
67 
68  _pulse_v[0].ped_mean = mean_v.front();
69 
70  _pulse_v[0].ped_sigma = sigma_v.front();
71 
72  if(!_index_end)
73 
74  _pulse_v[0].t_end = (double)(wf.size() - 1);
75 
76  else if(_index_end < wf.size())
77 
78  _pulse_v[0].t_end = (double)_index_end;
79 
80  else
81 
82  _pulse_v[0].t_end = wf.size() - 1;
83 
84  _pulse_v[0].t_max = PMTPulseRecoBase::Max(wf, _pulse_v[0].peak, _index_start, _pulse_v[0].t_end);
85 
86  _pulse_v[0].peak -= mean_v.front();
87 
89 
90  _pulse_v[0].area = _pulse_v[0].area - ( _pulse_v[0].t_end - _pulse_v[0].t_start + 1) * mean_v.front();
91 
92  return true;
93 
94  }
95 
96 }
97 
98 #endif
bool Integral(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
std::vector< double > PedestalSigma_t
size_t _index_end
index marker for the end of pulse time window
size_t _index_start
index marker for the beginning of the pulse time window
bool RecoPulse(const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)
Implementation of AlgoFixedWindow::reco() method.
pulse_param _pulse
A subject pulse_param object to be filled with the last reconstructed pulse parameters.
size_t Max(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
T get(std::string const &key) const
Definition: ParameterSet.h:231
virtual ~AlgoFixedWindow()
Default destructor.
std::vector< short > Waveform_t
Class definition file of AlgoFixedWindow.
AlgoFixedWindow(const std::string name="FixedWindow")
Default ctor.
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)...
void Reset()
Implementation of AlgoFixedWindow::reset() method.