AlgoFixedWindow.cxx
Go to the documentation of this file.
1 ////////////////////////////////////////////////////////////////////////
2 //
3 // AlgoFixedWindow source
4 //
5 ////////////////////////////////////////////////////////////////////////
6 
8 
9 #include "AlgoFixedWindow.h"
10 
11 namespace pmtana{
12 
13  //*******************************************************************************
15  //*******************************************************************************
16  {
17  Reset();
18 
19  _index_start = 0;
20 
21  _index_end = 0;
22  }
23 
24  //****************************************************************************************
26  //AlgoFixedWindow::AlgoFixedWindow(const ::fcllite::PSet& pset,
27  const std::string name)
28  : PMTPulseRecoBase(name)
29  //****************************************************************************************
30  {
31  Reset();
32 
33  _index_start = pset.get<size_t>("StartIndex");
34 
35  _index_end = pset.get<size_t>("EndIndex");
36  }
37 
38  //***************************************************************
40  //***************************************************************
41  {
42  if(!(_pulse_v.size()))
43 
44  _pulse_v.push_back(_pulse);
45 
46  _pulse_v[0].reset_param();
47 
48  }
49 
50  //***************************************************************
52  const PedestalMean_t& mean_v,
53  const PedestalSigma_t& sigma_v)
54  //***************************************************************
55  {
56  this->Reset();
57 
58  if( _index_start >= wf.size() ) return true;
59 
60  _pulse_v[0].t_start = (double)(_index_start);
61 
62  _pulse_v[0].ped_mean = mean_v.front();
63 
64  _pulse_v[0].ped_sigma = sigma_v.front();
65 
66  if(!_index_end)
67 
68  _pulse_v[0].t_end = (double)(wf.size() - 1);
69 
70  else if(_index_end < wf.size())
71 
72  _pulse_v[0].t_end = (double)_index_end;
73 
74  else
75 
76  _pulse_v[0].t_end = wf.size() - 1;
77 
78  _pulse_v[0].t_max = PMTPulseRecoBase::Max(wf, _pulse_v[0].peak, _index_start, _pulse_v[0].t_end);
79 
80  _pulse_v[0].peak -= mean_v.front();
81 
83 
84  _pulse_v[0].area = _pulse_v[0].area - ( _pulse_v[0].t_end - _pulse_v[0].t_start + 1) * mean_v.front();
85 
86  return true;
87 
88  }
89 
90 }
static QCString name
Definition: declinfo.cpp:673
bool Integral(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
std::vector< double > PedestalSigma_t
std::string string
Definition: nybbler.cc:12
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:271
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.