All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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, std::unique_ptr< pmtana::RiseTimeCalculatorBase > risetimecalculator=nullptr, 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::string & Name () 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...
 
std::unique_ptr
< pmtana::RiseTimeCalculatorBase
_risetime_calc_ptr = nullptr
 Tool for rise time calculation. 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 37 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  }
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
then echo fcl name
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,
std::unique_ptr< pmtana::RiseTimeCalculatorBase risetimecalculator = nullptr,
const std::string  name = "FixedWindow" 
)

Alternative ctor.

Definition at line 25 of file AlgoFixedWindow.cxx.

30  //****************************************************************************************
31  {
32  _risetime_calc_ptr = std::move(risetimecalculator);
33 
34  Reset();
35 
36  _index_start = pset.get<size_t>("StartIndex");
37 
38  _index_end = pset.get<size_t>("EndIndex");
39  }
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
std::unique_ptr< pmtana::RiseTimeCalculatorBase > _risetime_calc_ptr
Tool for rise time calculation.
then echo fcl name
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 54 of file AlgoFixedWindow.cxx.

58  {
59  this->Reset();
60 
61  if( _index_start >= wf.size() ) return true;
62 
63  _pulse_v[0].t_start = (double)(_index_start);
64 
65  _pulse_v[0].ped_mean = mean_v.front();
66 
67  _pulse_v[0].ped_sigma = sigma_v.front();
68 
69  if(!_index_end)
70 
71  _pulse_v[0].t_end = (double)(wf.size() - 1);
72 
73  else if(_index_end < wf.size())
74 
75  _pulse_v[0].t_end = (double)_index_end;
76 
77  else
78 
79  _pulse_v[0].t_end = wf.size() - 1;
80 
81  _pulse_v[0].t_max = PMTPulseRecoBase::Max(wf, _pulse_v[0].peak, _index_start, _pulse_v[0].t_end);
82 
83  _pulse_v[0].peak -= mean_v.front();
84 
86 
87  _pulse_v[0].area = _pulse_v[0].area - ( _pulse_v[0].t_end - _pulse_v[0].t_start + 1) * mean_v.front();
88 
90  _pulse_v[0].t_rise = _risetime_calc_ptr->RiseTime(
91  {wf.begin()+_pulse.t_start, wf.begin()+_pulse.t_end},
92  {mean_v.begin()+_pulse.t_start, mean_v.begin()+_pulse.t_end},
93  true);
94 
95  return true;
96 
97  }
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
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
std::unique_ptr< pmtana::RiseTimeCalculatorBase > _risetime_calc_ptr
Tool for rise time calculation.
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 ( )
virtual

Implementation of AlgoFixedWindow::reset() method.

Reimplemented from pmtana::PMTPulseRecoBase.

Definition at line 42 of file AlgoFixedWindow.cxx.

44  {
45  if(!(_pulse_v.size()))
46 
47  _pulse_v.push_back(_pulse);
48 
49  _pulse_v[0].reset_param();
50 
51  }
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 61 of file AlgoFixedWindow.h.

size_t pmtana::AlgoFixedWindow::_index_start
protected

index marker for the beginning of the pulse time window

Definition at line 60 of file AlgoFixedWindow.h.


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