Algorithm::MaxBinTime Struct Reference

#include <TAPAlgorithms.h>

List of all members.

Public Member Functions

 MaxBinTime (int trig_pol, double clk_tick, double t_shift)
double operator() (const TPulseIsland *tpi) const

Public Attributes

const int trigger_polarity
const double clock_tick_in_ns
const double time_shift

Detailed Description

Definition at line 32 of file TAPAlgorithms.h.


Constructor & Destructor Documentation

Algorithm::MaxBinTime::MaxBinTime ( int  trig_pol,
double  clk_tick,
double  t_shift 
) [inline]

Definition at line 34 of file TAPAlgorithms.h.

00035     :trigger_polarity(trig_pol), clock_tick_in_ns(clk_tick), time_shift(t_shift){}


Member Function Documentation

double Algorithm::MaxBinTime::operator() ( const TPulseIsland tpi  )  const

Definition at line 31 of file TAPAlgorithms.cpp.

References clock_tick_in_ns, TPulseIsland::GetSamples(), TPulseIsland::GetTimeStamp(), time_shift, and trigger_polarity.

00031                                                                      {
00032 
00033   // Get the samples and get an iterator ready to find the peak sample
00034   std::vector<int> pulseSamples = tpi->GetSamples();  
00035   std::vector<int>::iterator peak_sample_pos;
00036 
00037   // Find the position of the peak samples
00038   if (trigger_polarity == 1)
00039     peak_sample_pos = std::max_element(pulseSamples.begin(), pulseSamples.end());
00040   else if (trigger_polarity == -1)
00041     peak_sample_pos = std::min_element(pulseSamples.begin(), pulseSamples.end());
00042 
00043   // Now calculate the time
00044   double time = ((tpi->GetTimeStamp() + (peak_sample_pos - pulseSamples.begin())) * clock_tick_in_ns) - time_shift;
00045 
00046   return time;
00047 }


Member Data Documentation

Definition at line 39 of file TAPAlgorithms.h.

Referenced by operator()().

Definition at line 40 of file TAPAlgorithms.h.

Referenced by operator()().

Definition at line 38 of file TAPAlgorithms.h.

Referenced by operator()().


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

Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1