PrePulse Class Reference

#include <PrePulse.h>

List of all members.

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
TPulseIslandGetPulse () const
void Print ()

Static Public Member Functions

static std::vector< PrePulseFindPrePulses (TPulseIsland *, int rise, int fall)

Private Attributes

int fStart
int fStop
int fLocation
int fHeight
TPulseIslandfPulse

Detailed Description

Definition at line 8 of file PrePulse.h.


Constructor & Destructor Documentation

PrePulse::PrePulse ( int  start,
int  stop,
int  location,
int  height,
TPulseIsland pulse 
)

Definition at line 8 of file PrePulse.cpp.

Referenced by FindPrePulses().

00008                                                                                 :
00009   fStart(start), fStop(stop), fLocation(loc), fHeight(height), fPulse(pulse) {}

PrePulse::~PrePulse (  ) 

Definition at line 11 of file PrePulse.cpp.

00011 {}


Member Function Documentation

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

Definition at line 29 of file PrePulse.cpp.

References fPulse.

00029                                        {
00030   return fPulse;
00031 }

int PrePulse::GetStart (  )  const

Definition at line 13 of file PrePulse.cpp.

References fStart.

00013                              {
00014   return fStart;
00015 }

int PrePulse::GetStop (  )  const

Definition at line 17 of file PrePulse.cpp.

References fStop.

00017                             {
00018   return fStop;
00019 }

void PrePulse::Print (  ) 

Definition at line 33 of file PrePulse.cpp.

References fHeight, fLocation, fStart, and fStop.

00033                      {
00034   std::cout << "PrePulse Information:"
00035             << "\t" << "Strt" << "\t" << "Stop"
00036             << "\t" << "Loc" << "\t" << "Hght"
00037             << std::endl;
00038   std::cout << "                     "
00039             << "\t" << fStart << "\t" << fStop
00040             << "\t" << fLocation << "\t" << fHeight
00041             << std::endl;
00042 }


Member Data Documentation

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().

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.

Referenced by GetStop(), and Print().


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

Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1