LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
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
 

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 40 of file RiseTimeThreshold_tool.cc.

41  : fPeakRatio{config().PeakRatio()}
42  {}

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 44 of file RiseTimeThreshold_tool.cc.

References DEFINE_ART_CLASS_TOOL, and fPeakRatio.

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

Member Data Documentation

double pmtana::RiseTimeThreshold::fPeakRatio
private

Definition at line 37 of file RiseTimeThreshold_tool.cc.

Referenced by RiseTime().


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