ROOTANA
TMesytecData.hxx
Go to the documentation of this file.
1 #ifndef TMesytecData_hxx_seen
2 #define TMesytecData_hxx_seen
3 
4 #include <vector>
5 
6 #include "TGenericData.hxx"
7 
8 
9 /// Class for each TDC measurement
10 /// For the definition of obscure variables see the CAEN V1190 manual.
11 /// Currently doesn't support reading out extended timestamp!
12 ///
13 class ADCMeasMesy {
14 
15  friend class TMesytecData;
16 
17 public:
18 
19  /// Get the ADC measurement
20  uint32_t GetMeasurement() const;
21 
22  /// Get Module ID
23  uint32_t GetModuleID() 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 Out Of Range?
29  bool IsOutOfRange() const {return ((adc_measurement_word & 0x4000) == 0x4000);}
30 
31 private:
32 
33  /// Fields to hold the header, measurement, extendedtimestamp words.
34  uint32_t adc_header_word;
37 
38  /// Constructor; need to pass in header and measurement.
39  ADCMeasMesy(uint32_t header, uint32_t measurement):
40  adc_header_word(header),
41  adc_measurement_word(measurement),
43 
44 
46 };
47 
48 
49 
50 
51 /// Class to store data from Mesytec MADC32 module.
52 /// For details on this module see:
53 /// http://daq-plone.triumf.ca/HR/VME/mesytec-modules/MADC-32_V14_fw0126.pdf/at_download/file
54 class TMesytecData: public TGenericData {
55 
56 public:
57 
58  /// Constructor
59  TMesytecData(int bklen, int bktype, const char* name, void *pdata);
60 
61  void Print();
62 
63  /// Get the Vector of ADC Measurements.
64  std::vector<ADCMeasMesy>& GetMeasurements() {return fMeasurements;}
65 
66  /// Get ADC resolution (11, 12 or 13 bit);
67  /// Return values: 1 -> 11 bit, 2 -> 12 bit, 3 -> 13 bit (??)
68  uint32_t GetADCResolution() const {return (fGlobalHeader & 0x7000) >> 12;};
69 
70  /// Get Module ID
71  uint32_t GetModuleID() const {return (fGlobalHeader & 0xff0000) >> 16;};
72 
73  /// Get Output format (???)
74  uint32_t GetOutputFormat() const {return (fGlobalHeader & 0x8000) >> 15;};
75 
76  // Get overall timestamp
77  uint32_t GetTimeStamp() const {return (fGlobalTrailer & 0x3fffffff);};
78 
79 private:
80 
81  /// The overall global header
82  uint32_t fGlobalHeader;
83 
84  /// The overall global trailer
85  uint32_t fGlobalTrailer;
86 
87  /// Vector of ADC Measurements.
88  std::vector<ADCMeasMesy> fMeasurements;
89 
90 };
91 
92 
93 
94 
95 #endif
uint32_t adc_header_word
Fields to hold the header, measurement, extendedtimestamp words.
ADCMeasMesy(uint32_t header, uint32_t measurement)
Constructor; need to pass in header and measurement.
bool IsOutOfRange() const
Is Out Of Range?
uint32_t GetModuleID() const
Get Module ID.
uint32_t GetChannel() const
Get the channel number.
uint32_t adc_extendedtimestamp_word
uint32_t GetMeasurement() const
Get the ADC measurement.
Definition: TMesytecData.cxx:7
uint32_t adc_measurement_word
uint32_t fGlobalTrailer
The overall global trailer.
TMesytecData(int bklen, int bktype, const char *name, void *pdata)
Constructor.
uint32_t fGlobalHeader
The overall global header.
uint32_t GetADCResolution() const
uint32_t GetOutputFormat() const
Get Output format (???)
uint32_t GetTimeStamp() const
void Print()
Print the bank contents in a structured way.
std::vector< ADCMeasMesy > fMeasurements
Vector of ADC Measurements.
uint32_t GetModuleID() const
Get Module ID.
std::vector< ADCMeasMesy > & GetMeasurements()
Get the Vector of ADC Measurements.