Algorithm::SimpleIntegral Struct Reference

#include <TAPAlgorithms.h>

List of all members.

Public Member Functions

 SimpleIntegral (double ped, int trig_pol)
 SimpleIntegral (double ped, int trig_pol, int first, int last)
double operator() (const TPulseIsland *tpi) const
double GetPedestal () const
int GetStart () const
int GetStop () const
void SetPedestal (double v)
void SetStart (int v)
void SetStop (int v)

Public Attributes

const int trigger_polarity

Private Member Functions

void operator= (const SimpleIntegral &rhs)

Private Attributes

double pedestal
int start
int stop

Detailed Description

Definition at line 58 of file TAPAlgorithms.h.


Constructor & Destructor Documentation

Algorithm::SimpleIntegral::SimpleIntegral ( double  ped,
int  trig_pol 
) [inline]

Definition at line 60 of file TAPAlgorithms.h.

00061     :trigger_polarity(trig_pol), pedestal(ped),start(0),stop(0){}

Algorithm::SimpleIntegral::SimpleIntegral ( double  ped,
int  trig_pol,
int  first,
int  last 
) [inline]
Parameters:
first Start integral from "samples.begin()+first" sample
last End integral at "samples.begin()+last" if last>0 or "samples.end()+last" if last<=0

Definition at line 65 of file TAPAlgorithms.h.

00066     :trigger_polarity(trig_pol), pedestal(ped),start(first),stop(last){}


Member Function Documentation

double Algorithm::SimpleIntegral::GetPedestal (  )  const [inline]

Definition at line 71 of file TAPAlgorithms.h.

References pedestal.

00071 {return pedestal;};

int Algorithm::SimpleIntegral::GetStart (  )  const [inline]

Definition at line 72 of file TAPAlgorithms.h.

References start.

00072 {return start;};

int Algorithm::SimpleIntegral::GetStop (  )  const [inline]

Definition at line 73 of file TAPAlgorithms.h.

References stop.

00073 {return stop;};

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

Definition at line 67 of file TAPAlgorithms.cpp.

References TPulseIsland::GetSamples(), pedestal, start, stop, and trigger_polarity.

00067                                                                         {
00068   const std::vector<int>& samples = tpi->GetSamples();
00069   
00070   double length = samples.size();
00071   typedef std::vector<int> SampleVector;
00072   SampleVector::const_iterator begin=samples.begin()+start;
00073   if(start > length 
00074           || ( stop>0 && stop<start ) 
00075           || (stop<0 && length+stop <start) ){
00076       throw std::out_of_range("Algorithm::SimpleIntegral::operator() bad integral range" );
00077   }
00078   SampleVector::const_iterator end=(stop>0?samples.begin():samples.end())+stop;
00079   double tempint=std::accumulate(begin,end,0);
00080 
00081   double integral = trigger_polarity * (tempint - (pedestal * (end-begin)));
00082 
00083   return integral;
00084 }

void Algorithm::SimpleIntegral::operator= ( const SimpleIntegral rhs  )  [inline, private]

Definition at line 80 of file TAPAlgorithms.h.

00080 {};

void Algorithm::SimpleIntegral::SetPedestal ( double  v  )  [inline]

Definition at line 75 of file TAPAlgorithms.h.

References pedestal.

Referenced by Algorithm::IntegralRatio::SetPedestal().

00075 {pedestal=v;};

void Algorithm::SimpleIntegral::SetStart ( int  v  )  [inline]

Definition at line 76 of file TAPAlgorithms.h.

References start.

Referenced by Algorithm::IntegralRatio::SetTailStart().

00076 {start=v;};

void Algorithm::SimpleIntegral::SetStop ( int  v  )  [inline]

Definition at line 77 of file TAPAlgorithms.h.

References stop.

Referenced by Algorithm::IntegralRatio::SetTailStart().

00077 {stop=v;};


Member Data Documentation

Definition at line 80 of file TAPAlgorithms.h.

Referenced by GetPedestal(), operator()(), and SetPedestal().

Definition at line 82 of file TAPAlgorithms.h.

Referenced by GetStart(), operator()(), and SetStart().

Definition at line 83 of file TAPAlgorithms.h.

Referenced by GetStop(), operator()(), and SetStop().

Definition at line 69 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