NSCL DDAS  1.0
Support for XIA DDAS at the NSCL
 All Classes Namespaces Files Functions Variables Macros Pages
ddaschannel.h
1 /* ddaschannel class definition header file */
2 
3 #ifndef DDASCHANNEL_H
4 #define DDASCHANNEL_H
5 
6 #include <vector>
7 #include <stdint.h>
8 #include "TObject.h"
9 
10 namespace DAQ {
11  namespace DDAS {
12  class DDASHit;
13  }
14 }
15 
41 class ddaschannel : public TObject {
42 public:
43 
44  /********** Variables **********/
45 
46  // ordering is important with regards to access and file size. Should
47  // always try to maintain order from largest to smallest data type
48  // Double_t, Int_t, Short_t, Bool_t, pointers
49 
50  /* Channel events always have the following info. */
51  Double_t time;
52  Double_t coarsetime;
53  Double_t cfd;
54 
55  UInt_t energy;
56  UInt_t timehigh;
57  UInt_t timelow;
58  UInt_t timecfd;
59 
60  Int_t channelnum;
61  Int_t finishcode;
62  Int_t channellength;
64  Int_t overflowcode;
65  Int_t chanid;
66  Int_t slotid;
67  Int_t crateid;
68  Int_t id;
69 
71  Int_t cfdfailbit;
72 
73  Int_t tracelength;
74 
75  Int_t ModMSPS;
79 
80  /* A channel may have extra information... */
81  std::vector<UInt_t> energySums;
82  std::vector<UInt_t> qdcSums;
83 
84  /* A waveform (trace) may be stored too. */
85  std::vector<UShort_t> trace;
86 
87  Double_t externalTimestamp;
88  // Canonicals
90 
95  ddaschannel();
96 
97 
99  ddaschannel(const ddaschannel& obj) = default;
100 
102  ddaschannel& operator=(const ddaschannel& obj) = default;
103 
121 
123  ~ddaschannel();
124 
138  void UnpackChannelData(const uint32_t *data);
139 
145  void Reset();
146 
148 
150  UInt_t GetEnergy() const {return energy;}
151 
153  UInt_t GetTimeHigh() const {return timehigh;}
154 
156  UInt_t GetTimeLow() const {return timelow;}
157 
159  UInt_t GetCFDTime() const {return timecfd;}
160 
184  Double_t GetTime() const {return time;}
185 
187  Double_t GetCoarseTime() const {return coarsetime;}
188 
190  Double_t GetCFD() const {return cfd;}
191 
199  UInt_t GetEnergySums(Int_t i) const {return energySums[i];}
200 
202  Int_t GetChannelNum() const {return channelnum;}
203 
208  Int_t GetFinishCode() const {return finishcode;}
209 
215  Int_t GetChannelLength() const {return channellength;}
216 
219 
221  Int_t GetOverflowCode() const {return overflowcode;}
222 
224  Int_t GetSlotID() const {return slotid;}
225 
227  Int_t GetCrateID() const {return crateid;}
228 
230  Int_t GetChannelID() const {return chanid;}
231 
233  Int_t GetID() const {return id;}
234 
236  Int_t GetModMSPS() const {return ModMSPS;}
237 
239  std::vector<UShort_t> GetTrace() const {return trace;}
240 
241  Int_t GetADCResolution() const { return m_adcResolution; }
242  Int_t GetHardwareRevision() const { return m_hdwrRevision; }
243  Bool_t GetADCOverflowUnderflow() const { return m_adcOverUnderflow; }
244 
245  uint32_t GetCfdTrigSource() const { return cfdtrigsourcebit; }; // Per S.L. request.
246 
247  ClassDef(ddaschannel, 5)
248 };
249 
250 #endif
Bool_t m_adcOverUnderflow
whether adc overflowed or underflowed
Definition: ddaschannel.h:78
Int_t cfdtrigsourcebit
value of trigger source bit(s) for 250 MSPS and 500 MSPS
Definition: ddaschannel.h:70
Int_t GetChannelNum() const
Retrieve the channel number.
Definition: ddaschannel.h:202
Int_t channelheaderlength
length of header
Definition: ddaschannel.h:63
Int_t m_adcResolution
adc resolution (i.e. bit depth)
Definition: ddaschannel.h:76
Encapsulation of a generic DDAS event.
Definition: ddaschannel.h:41
UInt_t GetTimeHigh() const
Retrieve most significant 16-bits of raw timestamp.
Definition: ddaschannel.h:153
Int_t slotid
slot index
Definition: ddaschannel.h:66
Encapsulation of a generic DDAS event.
Definition: DDASHit.h:51
ddaschannel & operator=(const ddaschannel &obj)=default
Assignment operator.
Int_t tracelength
length of stored trace
Definition: ddaschannel.h:73
Int_t overflowcode
1 = overflow
Definition: ddaschannel.h:64
std::vector< UShort_t > trace
Trace data.
Definition: ddaschannel.h:85
Int_t ModMSPS
Sampling rate of the module (MSPS)
Definition: ddaschannel.h:75
Int_t GetOverflowCode() const
Retrieve the overflow code.
Definition: ddaschannel.h:221
Int_t channelnum
Definition: ddaschannel.h:60
Double_t time
assembled time including cfd
Definition: ddaschannel.h:51
UInt_t timehigh
bits 32-47 of timestamp
Definition: ddaschannel.h:56
void UnpackChannelData(const uint32_t *data)
Parse the DDAS Readout event data.
Definition: ddaschannel.cpp:143
Int_t finishcode
indicates whether pile-up occurred
Definition: ddaschannel.h:61
Double_t GetTime() const
Retrieve computed time.
Definition: ddaschannel.h:184
Int_t GetChannelLength() const
Retrieve number of 32-bit words that were in original data packet.
Definition: ddaschannel.h:215
UInt_t GetEnergy() const
Retrieve the energy.
Definition: ddaschannel.h:150
Int_t channellength
number of 32-bit words of raw data
Definition: ddaschannel.h:62
Double_t GetCoarseTime() const
Retrieve the 48-bit timestamp in nanoseconds without any CFD correction.
Definition: ddaschannel.h:187
Int_t chanid
channel index
Definition: ddaschannel.h:65
Int_t GetID() const
Definition: ddaschannel.h:233
Int_t id
Definition: ddaschannel.h:68
UInt_t energy
energy of event
Definition: ddaschannel.h:55
ddaschannel()
Default constructor.
Definition: ddaschannel.cpp:26
std::vector< UInt_t > qdcSums
QDC sum data.
Definition: ddaschannel.h:82
~ddaschannel()
Destructor.
Definition: ddaschannel.cpp:138
Double_t coarsetime
assembled time without cfd
Definition: ddaschannel.h:52
Int_t GetSlotID() const
Retrieve the slot that the module resided in.
Definition: ddaschannel.h:224
Double_t externalTimestamp
External clock.
Definition: ddaschannel.h:87
Int_t cfdfailbit
indicates whether the cfd algo failed
Definition: ddaschannel.h:71
Int_t GetChannelLengthHeader() const
Retrieve length of header in original data packet.
Definition: ddaschannel.h:218
Int_t GetChannelID() const
Retrieve the channel index.
Definition: ddaschannel.h:230
Int_t m_hdwrRevision
hardware revision
Definition: ddaschannel.h:77
UInt_t GetTimeLow() const
Retrieve least significant 32-bit of raw timestamp.
Definition: ddaschannel.h:156
Int_t crateid
crate index
Definition: ddaschannel.h:67
Double_t cfd
cfd time only
Definition: ddaschannel.h:53
UInt_t GetCFDTime() const
Retrieve the raw cfd time.
Definition: ddaschannel.h:159
std::vector< UInt_t > energySums
Energy sum data.
Definition: ddaschannel.h:81
Double_t GetCFD() const
Definition: ddaschannel.h:190
std::vector< UShort_t > GetTrace() const
Retrieve a copy of the trace stored.
Definition: ddaschannel.h:239
UInt_t GetEnergySums(Int_t i) const
Retrieve specific energy sum.
Definition: ddaschannel.h:199
void Reset()
Resets the state of all member data to that of initialization.
Definition: ddaschannel.cpp:100
Int_t GetFinishCode() const
Retrieve finish code.
Definition: ddaschannel.h:208
Definition: functions.h:26
UInt_t timecfd
raw cfd time
Definition: ddaschannel.h:58
Definition: SystemBooter.cpp:16
UInt_t timelow
bits 0-31 of timestamp
Definition: ddaschannel.h:57
Int_t GetModMSPS() const
Retrieve the ADC frequency of the module.
Definition: ddaschannel.h:236
Int_t GetCrateID() const
Retrieve the index of the crate the module resided in.
Definition: ddaschannel.h:227