ROOTANA
TDT724RawData.hxx
Go to the documentation of this file.
1 #ifndef TDT724RawData_hxx_seen
2 #define TDT724RawData_hxx_seen
3 
4 #include <vector>
5 
6 #include "TGenericData.hxx"
7 
8 /// Class for each channel measurement
9 /// For the definition of obscure variables see the CAEN DT724 manual.
11 
12  friend class TDT724RawData;
13 
14 public:
15 
16  int GetNSamples(){
17  return fSamples.size();
18  }
19 
20  int GetChannel(){ return fChan;}
21 
22  /// Get Errors
23  uint32_t GetSample(int i){
24  if(i >= 0 && i < (int)fSamples.size())
25  return fSamples[i];
26  return 9999999;
27  }
28 
29  void AddSamples(std::vector<uint32_t> Samples){
30  fSamples = Samples;
31  }
32 
33 private:
34 
35  int fChan; // channel number
36 
37  /// Constructor; need to pass in header and measurement.
39  fChan = chan;
40  }
41 
42  std::vector<uint32_t> fSamples;
43 
44 
45 };
46 
47 
48 /// Class to store raw data from CAEN 100MHz DT724 (for raw readout, no-DPP).
49 class TDT724RawData: public TGenericData {
50 
51 public:
52 
53  /// Constructor
54  TDT724RawData(int bklen, int bktype, const char* name, void *pdata);
55 
56 
57  /// Get Event Counter
58  uint32_t GetEventCounter() const {return (fGlobalHeader[2] & 0xffffff);};
59 
60  /// Get Event Counter
61  uint32_t GetEventSize() const {return (fGlobalHeader[0] & 0xfffffff);};
62 
63  /// Get Geographical Address
64  uint32_t GetGeoAddress() const {return (fGlobalHeader[1] & 0xf8000000) >> 27 ;};
65 
66  /// Get the extended trigger time tag
67  uint32_t GetTriggerTimeTag() const {return fGlobalHeader[3];};
68 
69  /// Get channel mask
70  uint32_t GetChMask(){return (fGlobalHeader[1] & 0xff) + ((fGlobalHeader[2] & 0xff000000) >> 16);};
71 
72  void Print();
73 
74  /// Get the Vector of TDC Measurements.
75  std::vector<RawChannelMeasurement>& GetMeasurements() {return fMeasurements;}
76 
77 
78 
79 private:
80 
81  // We have vectors of the headers/trailers/etc, since there can be
82  // multiple events in a bank.
83 
84  /// The overall global header
85  std::vector<uint32_t> fGlobalHeader;
86 
87  /// Vector of DT724 Measurements.
88  std::vector<RawChannelMeasurement> fMeasurements;
89 
90 };
91 
92 #endif
std::vector< uint32_t > fSamples
uint32_t GetSample(int i)
Get Errors.
void AddSamples(std::vector< uint32_t > Samples)
RawChannelMeasurement(int chan)
Constructor; need to pass in header and measurement.
Class to store raw data from CAEN 100MHz DT724 (for raw readout, no-DPP).
void Print()
Print the bank contents in a structured way.
uint32_t GetEventSize() const
Get Event Counter.
std::vector< RawChannelMeasurement > & GetMeasurements()
Get the Vector of TDC Measurements.
std::vector< RawChannelMeasurement > fMeasurements
Vector of DT724 Measurements.
std::vector< uint32_t > fGlobalHeader
The overall global header.
uint32_t GetGeoAddress() const
Get Geographical Address.
uint32_t GetTriggerTimeTag() const
Get the extended trigger time tag.
uint32_t GetEventCounter() const
Get Event Counter.
TDT724RawData(int bklen, int bktype, const char *name, void *pdata)
Constructor.
uint32_t GetChMask()
Get channel mask.