#include <PrePulse.h>
Public Member Functions | |
PrePulse (int start, int stop, int location, int height, TPulseIsland *pulse) | |
~PrePulse () | |
int | GetStart () const |
int | GetStop () const |
int | GetLocation () const |
int | GetHeight () const |
TPulseIsland * | GetPulse () const |
void | Print () |
Static Public Member Functions | |
static std::vector< PrePulse > | FindPrePulses (TPulseIsland *, int rise, int fall) |
Private Attributes | |
int | fStart |
int | fStop |
int | fLocation |
int | fHeight |
TPulseIsland * | fPulse |
Definition at line 8 of file PrePulse.h.
PrePulse::PrePulse | ( | int | start, | |
int | stop, | |||
int | location, | |||
int | height, | |||
TPulseIsland * | pulse | |||
) |
Definition at line 8 of file PrePulse.cpp.
Referenced by FindPrePulses().
PrePulse::~PrePulse | ( | ) |
Definition at line 11 of file PrePulse.cpp.
std::vector< PrePulse > PrePulse::FindPrePulses | ( | TPulseIsland * | pulse, | |
int | rise, | |||
int | fall | |||
) | [static] |
Definition at line 44 of file PrePulse.cpp.
References TPulseIsland::GetPedestal(), TPulseIsland::GetSamples(), TPulseIsland::GetTriggerPolarity(), and PrePulse().
Referenced by MakeTemplate::ProcessEntry().
00044 { 00045 // Looks through pulse to look for samples that go rise as fast as rise between two samples 00046 // and then fall 00047 std::vector<int> samples = pulse->GetSamples(); 00048 unsigned int nsamps = samples.size(); 00049 int pPed = pulse->GetPedestal(0); 00050 int pPol = pulse->GetTriggerPolarity(); 00051 std::vector<PrePulse> prepulses; 00052 00053 int s1, s2, ds; 00054 int start, stop, loc, height; 00055 bool found = false; 00056 for (unsigned int i = 1; i < nsamps; ++i) { 00057 s1 = pPol * (samples[i-1] - pPed); 00058 s2 = pPol * (samples[i] - pPed); 00059 ds = s2 - s1; 00060 if (found) { 00061 if (-ds > fall) { 00062 stop = (int)i; 00063 prepulses.push_back(PrePulse(start, stop, loc, height, pulse)); 00064 start = stop = loc = height = 0; 00065 found = false; 00066 } 00067 if (s2 > height) { 00068 loc = (int)i; 00069 height = s2; 00070 } 00071 } else { 00072 if (ds > rise) { 00073 found = true; 00074 start = (int)(i - 1); 00075 loc = start + 1; 00076 height = s2; 00077 } 00078 } 00079 } 00080 00081 return prepulses; 00082 }
int PrePulse::GetHeight | ( | ) | const |
Definition at line 25 of file PrePulse.cpp.
References fHeight.
00025 { 00026 return fHeight; 00027 }
int PrePulse::GetLocation | ( | ) | const |
Definition at line 21 of file PrePulse.cpp.
References fLocation.
00021 { 00022 return fLocation; 00023 }
TPulseIsland * PrePulse::GetPulse | ( | ) | const |
int PrePulse::GetStart | ( | ) | const |
int PrePulse::GetStop | ( | ) | const |
void PrePulse::Print | ( | ) |
Definition at line 33 of file PrePulse.cpp.
int PrePulse::fHeight [private] |
Definition at line 14 of file PrePulse.h.
Referenced by GetHeight(), and Print().
int PrePulse::fLocation [private] |
Definition at line 13 of file PrePulse.h.
Referenced by GetLocation(), and Print().
TPulseIsland* PrePulse::fPulse [private] |
Definition at line 15 of file PrePulse.h.
Referenced by GetPulse().
int PrePulse::fStart [private] |
Definition at line 11 of file PrePulse.h.
Referenced by GetStart(), and Print().
int PrePulse::fStop [private] |
Definition at line 12 of file PrePulse.h.