All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | Private Attributes | List of all members
pmtana::RiseTimeThreshold Class Reference
Inheritance diagram for pmtana::RiseTimeThreshold:
pmtana::RiseTimeCalculatorBase

Classes

struct  Config
 

Public Member Functions

 RiseTimeThreshold (art::ToolConfigTable< Config > const &config)
 
double RiseTime (const pmtana::Waveform_t &wf_pulse, const pmtana::PedestalMean_t &ped_pulse, bool _positive) const override
 

Private Attributes

double fPeakRatio
 

Additional Inherited Members

- Private Member Functions inherited from pmtana::RiseTimeCalculatorBase
virtual ~RiseTimeCalculatorBase () noexcept=default
 

Detailed Description

Definition at line 19 of file RiseTimeThreshold_tool.cc.

Constructor & Destructor Documentation

pmtana::RiseTimeThreshold::RiseTimeThreshold ( art::ToolConfigTable< Config > const &  config)
explicit

Definition at line 47 of file RiseTimeThreshold_tool.cc.

48  : fPeakRatio { config().PeakRatio() }
49  {
50  }

Member Function Documentation

double pmtana::RiseTimeThreshold::RiseTime ( const pmtana::Waveform_t wf_pulse,
const pmtana::PedestalMean_t ped_pulse,
bool  _positive 
) const
overridevirtual

Implements pmtana::RiseTimeCalculatorBase.

Definition at line 52 of file RiseTimeThreshold_tool.cc.

54  {
55 
56  // Pedestal-subtracted pulse
57  std::vector<double> wf_aux (ped_pulse);
58  if(_positive){
59  for(size_t ix=0; ix<wf_aux.size(); ix++){
60  wf_aux[ix]=((double)wf_pulse[ix])-wf_aux[ix];
61  }
62  }
63  else{
64  for(size_t ix=0; ix<wf_aux.size(); ix++){
65  wf_aux[ix]=wf_aux[ix]-((double)wf_pulse[ix]);
66  }
67  }
68 
69  auto it_max = max_element(wf_aux.begin(), wf_aux.end());
70  size_t rise = std::lower_bound( wf_aux.begin(), it_max, fPeakRatio*(*it_max) ) - wf_aux.begin();
71 
72  return rise;
73  }

Member Data Documentation

double pmtana::RiseTimeThreshold::fPeakRatio
private

Definition at line 43 of file RiseTimeThreshold_tool.cc.


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