ROOTANA
Loading...
Searching...
No Matches
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
15public:
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
35private:
36
37 /// Fields to hold the header, measurement, trailer and error words.
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
54class TV792NData: public TGenericData {
55
56
57public:
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
81private:
82
83 /// Vector of TDC Measurements.
84 std::vector<VADCNMeasurement> fMeasurements;
85
86
87 /// Fields to hold the header, measurement, trailer and error words.
90
91};
92
93#endif
Class for storing data from CAEN V792 module.
void Print()
Print the bank contents in a structured way.
uint32_t GetCrate() const
Get the crate number.
uint32_t fAdc_header_word
Fields to hold the header, measurement, trailer and error words.
uint32_t fAdc_trailer_word
uint32_t GetNumberChannels() const
Get the number of converted channels.
uint32_t GetEventCounter() const
Get the event counter.
std::vector< VADCNMeasurement > & GetMeasurements()
Get the Vector of TDC Measurements.
uint32_t GetGeoAddress() const
Get GEO address.
std::vector< VADCNMeasurement > fMeasurements
Vector of TDC Measurements.
uint32_t GetGeoAddress() const
Get GEO address.
VADCNMeasurement(uint32_t header, uint32_t measurement)
Constructor; need to pass in header and measurement.
uint32_t adc_measurement_word
uint32_t GetCrate() const
Get the crate number.
uint32_t GetChannel() const
Get the channel number.
bool IsOverFlow() const
Is OverFlow?
uint32_t adc_header_word
Fields to hold the header, measurement, trailer and error words.
bool IsUnderThreshold() const
Is Under Threshold?
uint32_t GetMeasurement() const
Get the ADC measurement.