ROOTANA
TV792Data.hxx
Go to the documentation of this file.
1 #ifndef TV792Data_hxx_seen
2 #define TV792Data_hxx_seen
3 
4 #include <vector>
5 
6 #include "TGenericData.hxx"
7 
8 /// Class for each TDC measurement
9 /// For the definition of obscure variables see the CAEN V792 manual.
11 
12  friend class TV792Data;
13 
14 public:
15 
16  /// Get the ADC measurement
17  uint32_t GetMeasurement() const {return (adc_measurement_word & 0xfff);}
18 
19  /// Get GEO address
20  uint32_t GetGeoAddress() const {return ((adc_measurement_word & 0xf8000000) >> 27);}
21 
22  /// Get the crate number
23  uint32_t GetCrate() const {return ((adc_header_word & 0xff0000) >> 16);}
24 
25  /// Get the channel number
26  uint32_t GetChannel() const {return ((adc_measurement_word & 0x1f0000) >> 16);}
27 
28  /// Is Under Threshold?
29  bool IsUnderThreshold() const {return ((adc_measurement_word & 0x2000) == 0x2000);}
30 
31  /// Is OverFlow?
32  bool IsOverFlow() const {return ((adc_measurement_word & 0x1000) == 0x1000);}
33 
34 private:
35 
36  /// Fields to hold the header, measurement, trailer and error words.
37  uint32_t adc_header_word;
39 
40  /// Constructor; need to pass in header and measurement.
41  VADCMeasurement(uint32_t header, uint32_t measurement):
42  adc_header_word(header),
43  adc_measurement_word(measurement){
44 
45  }
46 
47 
49 };
50 
51 
52 /// Class for storing data from CAEN V792 module
53 class TV792Data: public TGenericData {
54 
55 
56 public:
57 
58  /// Constructor
59  TV792Data(int bklen, int bktype, const char* name, void *pdata);
60 
61 
62  void Print();
63 
64  /// Get GEO address
65  uint32_t GetGeoAddress() const {return ((fAdc_header_word & 0xf8000000) >> 27);}
66 
67  /// Get the crate number
68  uint32_t GetCrate() const {return ((fAdc_header_word & 0xff0000) >> 16);}
69 
70  /// Get the number of converted channels.
71  uint32_t GetNumberChannels() const {return ((fAdc_header_word & 0x3f00) >> 8); };
72 
73  /// Get the event counter
74  uint32_t GetEventCounter() const {return (fAdc_trailer_word & 0xffffff); };
75 
76  /// Get the Vector of TDC Measurements.
77  std::vector<VADCMeasurement>& GetMeasurements() {return fMeasurements;}
78 
79 
80 private:
81 
82  /// Vector of TDC Measurements.
83  std::vector<VADCMeasurement> fMeasurements;
84 
85 
86  /// Fields to hold the header, measurement, trailer and error words.
87  uint32_t fAdc_header_word;
89 
90 };
91 
92 #endif
Class for storing data from CAEN V792 module.
Definition: TV792Data.hxx:53
uint32_t fAdc_trailer_word
Definition: TV792Data.hxx:88
uint32_t GetGeoAddress() const
Get GEO address.
Definition: TV792Data.hxx:65
uint32_t GetEventCounter() const
Get the event counter.
Definition: TV792Data.hxx:74
std::vector< VADCMeasurement > & GetMeasurements()
Get the Vector of TDC Measurements.
Definition: TV792Data.hxx:77
uint32_t fAdc_header_word
Fields to hold the header, measurement, trailer and error words.
Definition: TV792Data.hxx:87
std::vector< VADCMeasurement > fMeasurements
Vector of TDC Measurements.
Definition: TV792Data.hxx:83
TV792Data(int bklen, int bktype, const char *name, void *pdata)
Constructor.
Definition: TV792Data.cxx:5
uint32_t GetNumberChannels() const
Get the number of converted channels.
Definition: TV792Data.hxx:71
uint32_t GetCrate() const
Get the crate number.
Definition: TV792Data.hxx:68
void Print()
Print the bank contents in a structured way.
Definition: TV792Data.cxx:32
bool IsOverFlow() const
Is OverFlow?
Definition: TV792Data.hxx:32
uint32_t GetCrate() const
Get the crate number.
Definition: TV792Data.hxx:23
bool IsUnderThreshold() const
Is Under Threshold?
Definition: TV792Data.hxx:29
uint32_t GetGeoAddress() const
Get GEO address.
Definition: TV792Data.hxx:20
uint32_t adc_header_word
Fields to hold the header, measurement, trailer and error words.
Definition: TV792Data.hxx:37
uint32_t GetMeasurement() const
Get the ADC measurement.
Definition: TV792Data.hxx:17
VADCMeasurement(uint32_t header, uint32_t measurement)
Constructor; need to pass in header and measurement.
Definition: TV792Data.hxx:41
uint32_t GetChannel() const
Get the channel number.
Definition: TV792Data.hxx:26
uint32_t adc_measurement_word
Definition: TV792Data.hxx:38