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