LArSoft  v07_13_02
Liquid Argon Software toolkit - http://larsoft.org/
hit::RegionAboveThresholdFinder Class Reference

#include "RegionAboveThresholdFinder.h"

Public Member Functions

 RegionAboveThresholdFinder (float threshold)
 
void FillStartAndEndTicks (const std::vector< float > &signal, std::vector< unsigned int > &start_ticks, std::vector< unsigned int > &end_ticks)
 

Private Attributes

float fThreshold
 

Detailed Description

Definition at line 19 of file RegionAboveThresholdFinder.h.

Constructor & Destructor Documentation

hit::RegionAboveThresholdFinder::RegionAboveThresholdFinder ( float  threshold)
inline

Definition at line 22 of file RegionAboveThresholdFinder.h.

References FillStartAndEndTicks(), and fThreshold.

Member Function Documentation

void hit::RegionAboveThresholdFinder::FillStartAndEndTicks ( const std::vector< float > &  signal,
std::vector< unsigned int > &  start_ticks,
std::vector< unsigned int > &  end_ticks 
)

Title: RegionAboveThresholdFinder Class Author: Wes Ketchum (wketc.nosp@m.hum@.nosp@m.lanl..nosp@m.gov)

Description: Class that finds a region above threshold in which to do hit-finding.

Input: Vector of floats (like a recob::Wire vector) Output: Vector of begin times, and vector of end times.

Definition at line 15 of file RegionAboveThresholdFinder.cxx.

References fThreshold.

Referenced by RegionAboveThresholdFinder().

18 {
19 
20  start_ticks.clear(); end_ticks.clear();
21 
22  bool in_RAT = false;
23  for(unsigned int i_tick=0; i_tick<signal.size(); i_tick++){
24 
25  if(!in_RAT && signal[i_tick]>=fThreshold){
26  start_ticks.push_back(i_tick);
27  in_RAT = true;
28  }
29  else if(in_RAT && signal[i_tick]<fThreshold){
30  end_ticks.push_back(i_tick);
31  in_RAT = false;
32  }
33 
34  }
35 
36  if(in_RAT)
37  end_ticks.push_back(signal.size());
38 
39  if(end_ticks.size()!=start_ticks.size())
40  throw std::runtime_error("ERROR in RegionAboveThresholdFinder: start and end tick vectors not equal.");
41 
42 }

Member Data Documentation

float hit::RegionAboveThresholdFinder::fThreshold
private

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