#include <TAPAlgorithms.h>
Public Member Functions | |
MaxBinAmplitude (double ped, int trig_pol) | |
double | operator() (const TPulseIsland *tpi) const |
double | GetTime () const |
double | GetAmplitude () const |
Public Attributes | |
const int | trigger_polarity |
const double | pedestal |
Private Attributes | |
double | time |
double | amplitude |
Definition at line 17 of file TAPAlgorithms.h.
Algorithm::MaxBinAmplitude::MaxBinAmplitude | ( | double | ped, | |
int | trig_pol | |||
) | [inline] |
Definition at line 19 of file TAPAlgorithms.h.
00020 :trigger_polarity(trig_pol), pedestal(ped){}
double Algorithm::MaxBinAmplitude::GetAmplitude | ( | ) | const [inline] |
Definition at line 23 of file TAPAlgorithms.h.
References amplitude.
Referenced by IntegralRatioAPGenerator::ProcessPulses().
00023 {return amplitude;}
double Algorithm::MaxBinAmplitude::GetTime | ( | ) | const [inline] |
Definition at line 22 of file TAPAlgorithms.h.
References time.
Referenced by TemplateFitAPGenerator::ProcessPulses(), and IntegralRatioAPGenerator::ProcessPulses().
00022 {return time;}
double Algorithm::MaxBinAmplitude::operator() | ( | const TPulseIsland * | tpi | ) | const |
Definition at line 12 of file TAPAlgorithms.cpp.
References amplitude, TPulseIsland::GetSamples(), pedestal, time, and trigger_polarity.
00012 { 00013 00014 // Get the samples and get an iterator ready to find the peak sample 00015 const std::vector<int>& pulseSamples = tpi->GetSamples(); 00016 std::vector<int>::const_iterator peak_sample_pos; 00017 00018 // Find the position of the peak samples 00019 if (trigger_polarity == 1) 00020 peak_sample_pos = std::max_element(pulseSamples.begin(), pulseSamples.end()); 00021 else if (trigger_polarity == -1) 00022 peak_sample_pos = std::min_element(pulseSamples.begin(), pulseSamples.end()); 00023 00024 // Now calculate the amplitude 00025 amplitude = trigger_polarity*(*peak_sample_pos - pedestal); 00026 time = peak_sample_pos- pulseSamples.begin(); 00027 00028 return amplitude; 00029 }
double Algorithm::MaxBinAmplitude::amplitude [mutable, private] |
Definition at line 29 of file TAPAlgorithms.h.
Referenced by GetAmplitude(), and operator()().
const double Algorithm::MaxBinAmplitude::pedestal |
Definition at line 26 of file TAPAlgorithms.h.
Referenced by operator()().
double Algorithm::MaxBinAmplitude::time [mutable, private] |
Definition at line 28 of file TAPAlgorithms.h.
Referenced by GetTime(), and operator()().
Definition at line 25 of file TAPAlgorithms.h.
Referenced by operator()().