A uniform format for data from many different detectors. More...
#include <TPulseIsland.h>
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 | |
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. |
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.
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.
[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[
[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.
TPulseIsland::ClassDef | ( | TPulseIsland | , | |
2 | ||||
) | [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] |
Definition at line 63 of file TPulseIsland.h.
References fBankName.
Referenced by PulseTemplate::AddPulse(), PulseCandidateFinder::CheckDigitiserOverflow(), PulseCandidateFinder::FillParameterHistogram(), PulseCandidateFinder::FindCandidatePulses_Fast(), PulseCandidateFinder::FindCandidatePulses_Slow(), PulseCandidateFinder::GetPulseCandidates(), GetTime(), functions::InterpolatePulse(), isValid(), and pulse_islands_stitch().
00063 { return fBankName; }
double TPulseIsland::GetClockTickInNs | ( | ) | const [inline] |
Definition at line 65 of file TPulseIsland.h.
References fBankName, TSetupData::GetClockTick(), and TSetupData::Instance().
Referenced by PulseTemplate::AddPulse(), GetPulseTime(), GetTime(), and TAnalysedPulse::SetParentTPIProperties().
00065 { return TSetupData::Instance()->GetClockTick(fBankName); }
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 |
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 |
[in] | nPedSamples | Deprecated |
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 |
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] |
Definition at line 81 of file TPulseIsland.h.
References fSamples.
Referenced by FirstCompleteAPGenerator::AnalyseOneTpi(), GaussFitAPGenerator::FitPulse(), ExportPulse::MakeHistTPI(), ExportPulse::PlotTPI(), and TAnalysedPulse::SetParentTPIProperties().
00081 { return fSamples.size(); }
double TPulseIsland::GetPulseTime | ( | ) | const |
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 |
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] |
Definition at line 61 of file TPulseIsland.h.
References fSamples.
Referenced by PulseTemplate::AddPulse(), PulseCandidateFinder::CheckDigitiserOverflow(), PulseTemplate::Chi2Fit(), PulseCandidateFinder::FillParameterHistogram(), PulseCandidateFinder::FindCandidatePulses_Fast(), PulseCandidateFinder::FindCandidatePulses_Slow(), PrePulse::FindPrePulses(), PulseCandidateFinder::GetPulseCandidates(), GetTime(), functions::InterpolatePulse(), isValid(), ExportPulse::MakeHistTPI(), Algorithm::SimpleIntegral::operator()(), Algorithm::ConstantFractionTime::operator()(), Algorithm::MaxBinTime::operator()(), Algorithm::MaxBinAmplitude::operator()(), MakeTemplate::ProcessEntry(), pulse_islands_stitch(), Algorithm::IntegralRatio::SetPedestalToMinimum(), and TemplateCreator::StartTemplate().
00061 { return fSamples; }
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] |
Definition at line 62 of file TPulseIsland.h.
References fTimeStamp.
Referenced by TemplateConvolveAPGenerator::CalibrateTime(), PulseCandidateFinder::GetPulseCandidates(), GetTime(), Algorithm::ConstantFractionTime::operator()(), Algorithm::MaxBinTime::operator()(), ExportPulse::PlotTPI(), pulse_islands_stitch(), pulse_islands_t_comp(), and TAnalysedPulse::SetParentTPIProperties().
00062 { return fTimeStamp; }
int TPulseIsland::GetTriggerPolarity | ( | ) | const [inline] |
Definition at line 66 of file TPulseIsland.h.
References fBankName, TSetupData::GetTriggerPolarity(), and TSetupData::Instance().
Referenced by PulseTemplate::AddPulse(), PulseCandidateFinder::FillParameterHistogram(), PulseCandidateFinder::FindCandidatePulses_Fast(), PulseCandidateFinder::FindCandidatePulses_Slow(), PrePulse::FindPrePulses(), GetFastPulseAmplitude(), GetPeakSample(), GetPulseHeight(), and GetSlowPulseAmplitude().
00066 {return TSetupData::Instance()->GetTriggerPolarity(fBankName);};
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().
void TPulseIsland::SetTimeStamp | ( | int | t | ) | [inline] |
Definition at line 91 of file TPulseIsland.h.
References fTimeStamp.
Referenced by PulseCandidateFinder::GetPulseCandidates().
00091 {fTimeStamp=t;}
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().