Hall C ROOT/C++ Analyzer (hcana)
THcRawAdcHit.h
Go to the documentation of this file.
1 #ifndef ROOT_THcRawAdcHit
2 #define ROOT_THcRawAdcHit
3 
4 #include "TObject.h"
5 
6 
7 class THcRawAdcHit : public TObject {
8  public:
9  THcRawAdcHit();
10  THcRawAdcHit& operator=(const THcRawAdcHit& right);
11  virtual ~THcRawAdcHit();
12 
13  virtual void Clear(Option_t* opt="");
14 
15  void SetData(Int_t data);
16  void SetSample(Int_t data);
17  void SetRefTime(Int_t refTime);
18  void SetRefDiffTime(Int_t refDiffTime);
20  Int_t data, Int_t time, Int_t pedestal, Int_t peak
21  );
22 
23  Int_t GetRawData(UInt_t iPulse=0) const;
26 
27  Double_t GetAverage(UInt_t iSampleLow, UInt_t iSampleHigh) const;
28  Int_t GetIntegral(UInt_t iSampleLow, UInt_t iSampleHigh) const;
30  UInt_t iPedLow, UInt_t iPedHigh, UInt_t iIntLow, UInt_t iIntHigh
31  ) const;
32 
33  UInt_t GetNPulses() const;
34  UInt_t GetNSamples() const;
35 
36  Bool_t HasMulti() const;
37  Bool_t HasRefTime() const;
38 
39  Int_t GetPedRaw() const;
40  Int_t GetPulseIntRaw(UInt_t iPulse=0) const;
41  Int_t GetPulseAmpRaw(UInt_t iPulse=0) const;
42  Int_t GetPulseTimeRaw(UInt_t iPulse=0) const;
43  Int_t GetSampleRaw(UInt_t iSample=0) const;
44  Int_t GetRefTime() const;
45  Int_t GetRefDiffTime() const;
46 
47  Double_t GetPed() const;
48  Double_t GetPulseInt(UInt_t iPulse=0) const;
49  Double_t GetPulseAmp(UInt_t iPulse=0) const;
50  Double_t GetPulseTime(UInt_t iPulse=0) const;
51  //Int_t GetSample(UInt_t iSample=0) const;
52 
53  Int_t GetSampleIntRaw() const;
54  Double_t GetSampleInt() const;
55  Double_t GetAdcTomV() const;
56  Double_t GetAdcTopC() const;
57  Double_t GetAdcTons() const;
58 
59  void SetF250Params(Int_t NSA, Int_t NSB, Int_t NPED);
60 
61  protected:
62  static const UInt_t fMaxNPulses = 4;
63  static const UInt_t fMaxNSamples = 511;
64 
65  // FADC conversion factors
66  static const Double_t fNAdcChan; // Number of FADC channels in units of ADC channels
67  static const Double_t fAdcRange; // Dynamic range of FADCs in units of V, // TO-DO: Get fAdcRange from pre-start event
68  static const Double_t fAdcImpedence; // FADC input impedence in units of Ohms
69  static const Double_t fAdcTimeSample; // Length of FADC time sample in units of ps
70  static const Double_t fAdcTimeRes; // FADC time resolution in units of ns
71 
72  Int_t fNPedestalSamples; // TODO: Get this from prestart event...
76 
84 
89 
90  private:
92 };
93 
94 
95 #endif // ROOT_THcRawAdcHit
Double_t GetData(UInt_t iPedLow, UInt_t iPedHigh, UInt_t iIntLow, UInt_t iIntHigh) const
Gets pedestal subtracted integral of samples. In channels.
Double_t GetF250_PeakPedestalRatio()
Definition: THcRawAdcHit.h:24
static const Double_t fNAdcChan
Definition: THcRawAdcHit.h:66
Int_t fRefTime
Definition: THcRawAdcHit.h:82
static const Double_t fAdcTimeSample
Definition: THcRawAdcHit.h:69
Double_t GetSampleInt() const
Gets pedestal subtracted integral of samples. In channels.
UInt_t GetNSamples() const
Gets number of set samples.
Int_t fNPeakSamples
Definition: THcRawAdcHit.h:73
void SetSample(Int_t data)
Sets raw signal sample.
const char Option_t
Bool_t fHasRefTime
Definition: THcRawAdcHit.h:86
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.
int Int_t
bool Bool_t
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
Definition: THcRawAdcHit.h:67
void SetRefTime(Int_t refTime)
Sets reference time. In channels.
#define ClassDef(name, id)
Int_t fPulseAmp[fMaxNPulses]
Definition: THcRawAdcHit.h:79
UInt_t fNPulses
Definition: THcRawAdcHit.h:87
Int_t fPulseTime[fMaxNPulses]
Definition: THcRawAdcHit.h:80
Bool_t fHasMulti
Definition: THcRawAdcHit.h:85
static const UInt_t fMaxNPulses
Definition: THcRawAdcHit.h:62
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]
Definition: THcRawAdcHit.h:81
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.
tuple data
void SetRefDiffTime(Int_t refDiffTime)
unsigned int UInt_t
Int_t GetSampleIntRaw() const
Gets raw integral of sTimeFacamples. In channels.
static const UInt_t fMaxNSamples
Definition: THcRawAdcHit.h:63
static const Double_t fAdcImpedence
Definition: THcRawAdcHit.h:68
Int_t fPulseInt[fMaxNPulses]
Definition: THcRawAdcHit.h:78
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
Definition: THcRawAdcHit.h:70
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.
Int_t GetRefTime() const
double Double_t
Bool_t HasRefTime() const
UInt_t GetNPulses() const
Gets number of set pulses.
void SetData(Int_t data)
Sets raw ADC value.
Int_t fRefDiffTime
Definition: THcRawAdcHit.h:83
Int_t GetIntegral(UInt_t iSampleLow, UInt_t iSampleHigh) const
Gets integral of raw samples. In channels.
Double_t fPeakPedestalRatio
Definition: THcRawAdcHit.h:74
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
Double_t fSubsampleToTimeFactor
Definition: THcRawAdcHit.h:75
Int_t GetF250_NPedestalSamples()
Definition: THcRawAdcHit.h:25
Int_t fNPedestalSamples
Definition: THcRawAdcHit.h:72
Int_t GetRefDiffTime() const
virtual ~THcRawAdcHit()
Destructor.
Double_t GetAdcTopC() const
Class representing a single raw ADC hit.
Definition: THcRawAdcHit.h:7
Double_t GetAdcTomV() const
UInt_t fNSamples
Definition: THcRawAdcHit.h:88