198 fNPedestalSamples(4), fNPeakSamples(9),
199 fPeakPedestalRatio(1.0*fNPeakSamples/fNPedestalSamples),
200 fSubsampleToTimeFactor(0.0625),
201 fPed(0), fPulseInt(), fPulseAmp(), fPulseTime(), fSample(),
202 fRefTime(0), fHasMulti(
kFALSE), fHasRefTime(
kFALSE), fNPulses(0), fNSamples(0)
208 if (
this != &right) {
251 throw std::out_of_range(
252 "`THcRawAdcHit::SetData`: too many pulses!"
270 throw std::out_of_range(
271 "`THcRawAdcHit::SetSample`: too many samples!"
282 throw std::out_of_range(
283 "`THcRawAdcHit::SetDataTimePedestalPeak`: too many pulses!"
295 if (iPulse >=
fNPulses && iPulse != 0) {
297 "`THcRawAdcHit::GetRawData`: requested pulse %d where only %d pulses available!",
300 throw std::out_of_range(msg.
Data());
302 else if (iPulse >=
fNPulses && iPulse == 0) {
313 "`THcRawAdcHit::GetAverage`: not this many samples available!"
315 throw std::out_of_range(msg.
Data());
319 for (
UInt_t i=iSampleLow; i<=iSampleHigh; ++i) {
322 return average / (iSampleHigh - iSampleLow + 1);
330 "`THcRawAdcHit::GetAverage`: not this many samples available!"
332 throw std::out_of_range(msg.
Data());
336 for (
UInt_t i=iSampleLow; i<=iSampleHigh; ++i) {
348 -
GetAverage(iPedHigh, iPedLow) * (iIntHigh - iIntLow + 1);
371 else if (iPulse == 0) {
376 "`THcRawAdcHit::GetPulseIntRaw`: Trying to get pulse %d where only %d pulses available!",
379 throw std::out_of_range(msg.
Data());
387 else if (iPulse == 0) {
392 "`THcRawAdcHit::GetPulseAmpRaw`: Trying to get pulse %d where only %d pulses available!",
395 throw std::out_of_range(msg.
Data());
403 else if (iPulse == 0) {
408 "`THcRawAdcHit::GetPulseTimeRaw`: Trying to get pulse %d where only %d pulses available!",
411 throw std::out_of_range(msg.
Data());
421 "`THcRawAdcHit::GetSampleRaw`: Trying to get sample %d where only %d samples available!",
424 throw std::out_of_range(msg.
Data());
445 return (static_cast<Double_t>(rawtime)*
GetAdcTons());
463 if (NSA < 0 || NSB < 0 || NPED < 0) {
465 "`THcRawAdcHit::SetF250Params`: One of the params is negative! NSA = %d NSB = %d NPED = %d",
468 throw std::invalid_argument(msg.
Data());
499 "`THcRawAdcHit::GetRefTime`: Reference time not available!"
501 throw std::runtime_error(msg.
Data());
511 "`THcRawAdcHit::GetRefTime`: Reference time not available!"
513 throw std::runtime_error(msg.
Data());
Double_t GetData(UInt_t iPedLow, UInt_t iPedHigh, UInt_t iIntLow, UInt_t iIntHigh) const
Gets pedestal subtracted integral of samples. In channels.
virtual void Clear(Option_t *="")
static const Double_t fNAdcChan
static const Double_t fAdcTimeSample
Double_t GetSampleInt() const
Gets pedestal subtracted integral of samples. In channels.
UInt_t GetNSamples() const
Gets number of set samples.
void SetSample(Int_t data)
Sets raw signal sample.
Int_t GetRawData(UInt_t iPulse=0) const
Gets raw pulse integral. In channels.
Int_t GetPulseTimeRaw(UInt_t iPulse=0) const
Gets raw pulse time. In subsamples.
Double_t GetAverage(UInt_t iSampleLow, UInt_t iSampleHigh) const
Gets average of raw samples. In channels.
Int_t GetSampleRaw(UInt_t iSample=0) const
Gets raw sample. In channels.
static const Double_t fAdcRange
void SetRefTime(Int_t refTime)
Sets reference time. In channels.
const char * Data() const
static TString Format(const char *fmt,...)
Int_t fPulseAmp[fMaxNPulses]
Int_t fPulseTime[fMaxNPulses]
static const UInt_t fMaxNPulses
TObject & operator=(const TObject &rhs)
Double_t GetAdcTons() const
Double_t GetPed() const
Gets sample pedestal. In channels.
void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED)
Sets F250 parameters used for pedestal subtraction.
Bool_t HasMulti() const
Queries whether data is from flash 250 module.
Int_t GetPulseAmpRaw(UInt_t iPulse=0) const
Gets raw pulse amplitude. In channels.
Int_t fSample[fMaxNSamples]
Double_t GetPulseAmp(UInt_t iPulse=0) const
Gets pedestal subtracted pulse amplitude. In channels.
Double_t GetPulseInt(UInt_t iPulse=0) const
Gets pedestal subtracted pulse integral. In channels.
void SetRefDiffTime(Int_t refDiffTime)
Int_t GetSampleIntRaw() const
Gets raw integral of sTimeFacamples. In channels.
static const UInt_t fMaxNSamples
static const Double_t fAdcImpedence
Int_t fPulseInt[fMaxNPulses]
void SetDataTimePedestalPeak(Int_t data, Int_t time, Int_t pedestal, Int_t peak)
Sets various bits of ADC data.
static const Double_t fAdcTimeRes
THcRawAdcHit()
Constructor.
virtual void Clear(Option_t *opt="")
Clears variables before next event.
Int_t GetPulseIntRaw(UInt_t iPulse=0) const
Gets raw pulse integral. In channels.
Bool_t HasRefTime() const
UInt_t GetNPulses() const
Gets number of set pulses.
void SetData(Int_t data)
Sets raw ADC value.
Int_t GetIntegral(UInt_t iSampleLow, UInt_t iSampleHigh) const
Gets integral of raw samples. In channels.
ClassImp(THcDCLookupTTDConv) THcDCLookupTTDConv
Double_t fPeakPedestalRatio
Int_t GetPedRaw() const
Gets raw signal pedestal. In channels.
THcRawAdcHit & operator=(const THcRawAdcHit &right)
Assignment operator.
Double_t GetPulseTime(UInt_t iPulse=0) const
Int_t GetRefDiffTime() const
virtual ~THcRawAdcHit()
Destructor.
Double_t GetAdcTopC() const
Class representing a single raw ADC hit.
Double_t GetAdcTomV() const