TPulseIsland Class Reference
[alcapanarootana]

A uniform format for data from many different detectors. More...

#include <TPulseIsland.h>

Inheritance diagram for TPulseIsland:
TObject

List of all members.

Public Member Functions

 TPulseIsland ()
 This defaultconstructor I believe exists so ROOT can load these from file and is not used explcitly.
 TPulseIsland (int timestamp, const std::vector< int > &samples_vector, std::string bank_name)
 TPulseIsland (int timestamp, const std::vector< int >::const_iterator &first, const std::vector< int >::const_iterator &last, std::string bank_name)
 Construct a TPI from a sub-range of an existing vector of ints.
void Reset (Option_t *o="")
 The TPI goes to the state the default constructor would set it to. Not generally used.
void SetBankName (const std::string &name)
void SetTimeStamp (int t)
void SetSamples (const std::vector< int >::const_iterator &first, const std::vector< int >::const_iterator &last)
Getters

Return copies of all fields in the TPI and TSD.



const std::vector< int > & GetSamples () const
int GetTimeStamp () const
std::string GetBankName () const
double GetClockTickInNs () const
int GetTriggerPolarity () const
double GetAmplitude () const
 Deprecated.
double GetFastPulseAmplitude () const
 Deprecated.
double GetSlowPulseAmplitude () const
 Deprecated.
double GetPulseHeight () const
double GetPulseTime () const
TH1I * GetPulseWaveform (std::string histname, std::string histtitle) const
int GetPulseLength () const
int GetPeakSample () const
double GetPedestal (int nPedSamples) const

Private Member Functions

 TPulseIsland (const TPulseIsland &src)
 Copying is made explicitly private since we do not need it yet.
TPulseIsland operator= (const TPulseIsland &rhs)
 Assignment is made explicitly private since we do not need it yet.
 ClassDef (TPulseIsland, 2)

Private Attributes

std::vector< int > fSamples
 Time ordered ADC samples of the pulse.
int fTimeStamp
 The time, in sample clock ticks, of the first samples.
std::string fBankName
 The name describing the digitizer channel the pulse originated.

Detailed Description

A uniform format for data from many different detectors.

The TPulseIsland (TPI) class is a simple format for pulses from many different detectors. The pulse shape is stored, the time stamp, and the bank (digitizer channel) the pulse is from. More information is stored in TSetupData (TSD) which TPIs depend on.

Definition at line 23 of file TPulseIsland.h.


Constructor & Destructor Documentation

TPulseIsland::TPulseIsland (  ) 

This defaultconstructor I believe exists so ROOT can load these from file and is not used explcitly.

Definition at line 13 of file TPulseIsland.cpp.

00013                            : fSamples(), fTimeStamp(0), fBankName("") {
00014 }

TPulseIsland::TPulseIsland ( int  timestamp,
const std::vector< int > &  samples_vector,
std::string  bank_name 
)

The constructor we should use.

Parameters:
[in] timestamp The time in units of clock ticks of the first sample in the pulse
[in] samples_vector Consecutive ADC values representing the pulse
[in] bank_name The (4 character long) name identifying the digitizer channel the pulse originated.

Definition at line 21 of file TPulseIsland.cpp.

00021                                                                                              :
00022   fSamples(samples_vector), fTimeStamp(timestamp), fBankName(bank_name) {
00023 }

TPulseIsland::TPulseIsland ( int  timestamp,
const std::vector< int >::const_iterator &  first,
const std::vector< int >::const_iterator &  last,
std::string  bank_name 
)

Construct a TPI from a sub-range of an existing vector of ints.

Copies all samples in the range [first,last[

Parameters:
[in] timestamp The time in units of clock ticks of the first sample in the pulse
[in] first Iterator to the first sample of the input waveform
[in] first Iterator to the last sample of the input waveform
[in] bank_name The (4 character long) name identifying the digitizer channel the pulse originated.

Definition at line 16 of file TPulseIsland.cpp.

00017                                                                  :
00018   fSamples(first,last), fTimeStamp(timestamp), fBankName(bank_name) {
00019 }

TPulseIsland::TPulseIsland ( const TPulseIsland src  )  [private]

Copying is made explicitly private since we do not need it yet.


Member Function Documentation

TPulseIsland::ClassDef ( TPulseIsland  ,
 
) [private]
double TPulseIsland::GetAmplitude (  )  const

Deprecated.

Definition at line 34 of file TPulseIsland.cpp.

References fBankName, GetFastPulseAmplitude(), GetSlowPulseAmplitude(), and TSetupData::Instance().

00034                                         {
00035 
00036   if (TSetupData::Instance()->IsFast(fBankName))
00037     return GetFastPulseAmplitude();
00038   else
00039     return GetSlowPulseAmplitude();
00040 
00041 }

std::string TPulseIsland::GetBankName (  )  const [inline]
double TPulseIsland::GetClockTickInNs (  )  const [inline]
double TPulseIsland::GetFastPulseAmplitude (  )  const

Deprecated.

Definition at line 46 of file TPulseIsland.cpp.

References fSamples, GetPeakSample(), GetPedestal(), and GetTriggerPolarity().

Referenced by GetAmplitude().

00046                                                  {
00047 
00048   double pedestal = GetPedestal(10);
00049   int peak_sample_element = GetPeakSample();
00050 
00051   return ( GetTriggerPolarity()*(fSamples.at(peak_sample_element) - pedestal) );
00052 }

int TPulseIsland::GetPeakSample (  )  const
Returns:
Index in samples vector corresponding to pulse peak.

Definition at line 90 of file TPulseIsland.cpp.

References fSamples, and GetTriggerPolarity().

Referenced by GetFastPulseAmplitude(), GetPulseHeight(), GetPulseTime(), GetSlowPulseAmplitude(), and TemplateCreator::StartTemplate().

00090                                       {
00091 
00092   std::vector<int>::const_iterator peak;
00093   if(GetTriggerPolarity() == 1)
00094     peak = std::max_element(fSamples.begin(), fSamples.end());
00095   else
00096     peak = std::min_element(fSamples.begin(), fSamples.end());
00097 
00098   return peak - fSamples.begin();
00099 }

double TPulseIsland::GetPedestal ( int  nPedSamples  )  const
Parameters:
[in] nPedSamples Deprecated
Returns:
Pedestal as stored in ODB

Definition at line 101 of file TPulseIsland.cpp.

References fBankName, TSetupData::GetPedestal(), and TSetupData::Instance().

Referenced by PulseTemplate::AddPulse(), PrePulse::FindPrePulses(), GetFastPulseAmplitude(), GetPulseHeight(), and GetSlowPulseAmplitude().

00101                                                       {
00102   return TSetupData::Instance()->GetPedestal(fBankName);
00103 }

double TPulseIsland::GetPulseHeight (  )  const
Returns:
Pedestal subtracted value of largest (smallest) sample for positive (negative) pulses.

Definition at line 62 of file TPulseIsland.cpp.

References fSamples, GetPeakSample(), GetPedestal(), and GetTriggerPolarity().

00062                                           {
00063   
00064   double pedestal = GetPedestal(10);
00065   int peak_sample_element = GetPeakSample();
00066 
00067   return ( GetTriggerPolarity()*(fSamples.at(peak_sample_element) - pedestal) );
00068 }

int TPulseIsland::GetPulseLength (  )  const [inline]
double TPulseIsland::GetPulseTime (  )  const
Returns:
Time in nanoseconds of the peak of the pulse.

Definition at line 70 of file TPulseIsland.cpp.

References fTimeStamp, GetClockTickInNs(), and GetPeakSample().

Referenced by GetTime().

00070                                         {
00071 
00072   return (fTimeStamp + GetPeakSample()) * GetClockTickInNs();
00073 }

TH1I * TPulseIsland::GetPulseWaveform ( std::string  histname,
std::string  histtitle 
) const
Returns:
An histogram representing the pulse for drawing or fitting.

Definition at line 77 of file TPulseIsland.cpp.

References fSamples.

Referenced by GaussFitAPGenerator::FitPulse().

00077                                                                                   {
00078 
00079   TH1I* hWaveform = new TH1I(histname.c_str(), histtitle.c_str(), fSamples.size(),0,fSamples.size());
00080 
00081   // Loop over the samples and fill the histogram
00082   for (std::vector<int>::const_iterator sampleIter = fSamples.begin(); sampleIter != fSamples.end(); sampleIter++) {
00083     hWaveform->Fill(sampleIter - fSamples.begin(), *sampleIter);
00084   }
00085 
00086   return hWaveform;
00087 }

const std::vector<int>& TPulseIsland::GetSamples (  )  const [inline]
double TPulseIsland::GetSlowPulseAmplitude (  )  const

Deprecated.

Definition at line 54 of file TPulseIsland.cpp.

References fSamples, GetPeakSample(), GetPedestal(), and GetTriggerPolarity().

Referenced by GetAmplitude().

00054                                                  {
00055 
00056   double pedestal = GetPedestal(10);
00057   int peak_sample_element = GetPeakSample();
00058 
00059   return ( GetTriggerPolarity()*(fSamples.at(peak_sample_element) - pedestal) );
00060 }

int TPulseIsland::GetTimeStamp (  )  const [inline]
int TPulseIsland::GetTriggerPolarity (  )  const [inline]
TPulseIsland TPulseIsland::operator= ( const TPulseIsland rhs  )  [private]

Assignment is made explicitly private since we do not need it yet.

void TPulseIsland::Reset ( Option_t *  o = ""  ) 

The TPI goes to the state the default constructor would set it to. Not generally used.

Definition at line 25 of file TPulseIsland.cpp.

References fBankName, fSamples, and fTimeStamp.

00026 {
00027   fTimeStamp = 0;
00028   fSamples.clear();
00029   fBankName = "";
00030 }

void TPulseIsland::SetBankName ( const std::string &  name  )  [inline]

Definition at line 90 of file TPulseIsland.h.

References fBankName.

Referenced by PulseCandidateFinder::GetPulseCandidates().

00090 {fBankName=name;}

void TPulseIsland::SetSamples ( const std::vector< int >::const_iterator &  first,
const std::vector< int >::const_iterator &  last 
) [inline]

Definition at line 92 of file TPulseIsland.h.

References fSamples.

Referenced by PulseCandidateFinder::GetPulseCandidates().

00093                                                    {fSamples.assign(first,last);}

void TPulseIsland::SetTimeStamp ( int  t  )  [inline]

Definition at line 91 of file TPulseIsland.h.

References fTimeStamp.

Referenced by PulseCandidateFinder::GetPulseCandidates().

00091 {fTimeStamp=t;}


Member Data Documentation

std::string TPulseIsland::fBankName [private]

The name describing the digitizer channel the pulse originated.

Definition at line 30 of file TPulseIsland.h.

Referenced by GetAmplitude(), GetBankName(), GetClockTickInNs(), GetPedestal(), GetTriggerPolarity(), Reset(), and SetBankName().

std::vector<int> TPulseIsland::fSamples [private]

Time ordered ADC samples of the pulse.

Definition at line 26 of file TPulseIsland.h.

Referenced by GetFastPulseAmplitude(), GetPeakSample(), GetPulseHeight(), GetPulseLength(), GetPulseWaveform(), GetSamples(), GetSlowPulseAmplitude(), Reset(), and SetSamples().

int TPulseIsland::fTimeStamp [private]

The time, in sample clock ticks, of the first samples.

Definition at line 28 of file TPulseIsland.h.

Referenced by GetPulseTime(), GetTimeStamp(), Reset(), and SetTimeStamp().


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

Generated on 15 Jun 2016 for AlcapDAQ by  doxygen 1.6.1