Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
pmtana::AlgoFixedWindow Class Reference

#include <AlgoFixedWindow.h>

Inheritance diagram for pmtana::AlgoFixedWindow:
pmtana::PMTPulseRecoBase

Public Member Functions

 AlgoFixedWindow (const std::string name="FixedWindow")
 Default ctor. More...
 
 AlgoFixedWindow (const fhicl::ParameterSet &pset, const std::string name="FixedWindow")
 Alternative ctor. More...
 
void Reset ()
 Implementation of AlgoFixedWindow::reset() method. More...
 
- Public Member Functions inherited from pmtana::PMTPulseRecoBase
 PMTPulseRecoBase (const std::string name="noname")
 Default constructor with fhicl parameters. More...
 
virtual ~PMTPulseRecoBase ()=default
 Default destructor. More...
 
const std::stringName () const
 Name getter. More...
 
bool Status () const
 Status getter. More...
 
bool Reconstruct (const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)
 
const pulse_paramGetPulse (size_t index=0) const
 
const pulse_param_arrayGetPulses () const
 A getter for the whole array of pulse_param struct object. More...
 
size_t GetNPulse () const
 A getter for the number of reconstructed pulses from the input waveform. More...
 

Protected Member Functions

bool RecoPulse (const pmtana::Waveform_t &, const pmtana::PedestalMean_t &, const pmtana::PedestalSigma_t &)
 Implementation of AlgoFixedWindow::reco() method. More...
 
- Protected Member Functions inherited from pmtana::PMTPulseRecoBase
bool Integral (const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
 
bool Derivative (const std::vector< short > &wf, std::vector< int32_t > &diff, size_t begin=0, size_t end=0) const
 
size_t Max (const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
 
size_t Min (const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
 

Protected Attributes

size_t _index_start
 index marker for the beginning of the pulse time window More...
 
size_t _index_end
 index marker for the end of pulse time window More...
 
- Protected Attributes inherited from pmtana::PMTPulseRecoBase
pulse_param_array _pulse_v
 A container array of pulse_param struct objects to store (possibly multiple) reconstructed pulse(s). More...
 
pulse_param _pulse
 A subject pulse_param object to be filled with the last reconstructed pulse parameters. More...
 

Detailed Description

This class implements fixed_window algorithm to AlgoFixedWindow class. The algorithm defines a pulse in user-specified time window. A typical usage is to set the beginning of the window to be 0 (= start of the waveform) and integrate over the time of interest. By default, the ending is set to index=0, in which case it uses the ending index of the input waveform (i.e. full integration).

Definition at line 35 of file AlgoFixedWindow.h.

Constructor & Destructor Documentation

pmtana::AlgoFixedWindow::AlgoFixedWindow ( const std::string  name = "FixedWindow")

Default ctor.

Definition at line 14 of file AlgoFixedWindow.cxx.

15  //*******************************************************************************
16  {
17  Reset();
18 
19  _index_start = 0;
20 
21  _index_end = 0;
22  }
static QCString name
Definition: declinfo.cpp:673
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
PMTPulseRecoBase(const std::string name="noname")
Default constructor with fhicl parameters.
void Reset()
Implementation of AlgoFixedWindow::reset() method.
pmtana::AlgoFixedWindow::AlgoFixedWindow ( const fhicl::ParameterSet pset,
const std::string  name = "FixedWindow" 
)

Alternative ctor.

Definition at line 25 of file AlgoFixedWindow.cxx.

29  //****************************************************************************************
30  {
31  Reset();
32 
33  _index_start = pset.get<size_t>("StartIndex");
34 
35  _index_end = pset.get<size_t>("EndIndex");
36  }
static QCString name
Definition: declinfo.cpp:673
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
T get(std::string const &key) const
Definition: ParameterSet.h:271
PMTPulseRecoBase(const std::string name="noname")
Default constructor with fhicl parameters.
void Reset()
Implementation of AlgoFixedWindow::reset() method.

Member Function Documentation

bool pmtana::AlgoFixedWindow::RecoPulse ( const pmtana::Waveform_t wf,
const pmtana::PedestalMean_t mean_v,
const pmtana::PedestalSigma_t sigma_v 
)
protectedvirtual

Implementation of AlgoFixedWindow::reco() method.

Implements pmtana::PMTPulseRecoBase.

Definition at line 51 of file AlgoFixedWindow.cxx.

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  }
bool Integral(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
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
size_t Max(const std::vector< short > &wf, double &result, size_t begin=0, size_t end=0) const
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.
void pmtana::AlgoFixedWindow::Reset ( void  )
virtual

Implementation of AlgoFixedWindow::reset() method.

Reimplemented from pmtana::PMTPulseRecoBase.

Definition at line 39 of file AlgoFixedWindow.cxx.

41  {
42  if(!(_pulse_v.size()))
43 
44  _pulse_v.push_back(_pulse);
45 
46  _pulse_v[0].reset_param();
47 
48  }
pulse_param _pulse
A subject pulse_param object to be filled with the last reconstructed pulse parameters.
pulse_param_array _pulse_v
A container array of pulse_param struct objects to store (possibly multiple) reconstructed pulse(s)...

Member Data Documentation

size_t pmtana::AlgoFixedWindow::_index_end
protected

index marker for the end of pulse time window

Definition at line 57 of file AlgoFixedWindow.h.

size_t pmtana::AlgoFixedWindow::_index_start
protected

index marker for the beginning of the pulse time window

Definition at line 56 of file AlgoFixedWindow.h.


The documentation for this class was generated from the following files: