RawConfigurationTailV0.h
Go to the documentation of this file.
1 #ifndef RAWCONFIGURATIONTAILV0_H
2 #define RAWCONFIGURATIONTAILV0_H
3 #include "DAQDataFormats/RawDAQData.h"
4 #include "DAQDataFormats/Macros.h"
5 #include "DAQDataFormats/BitFields.h"
6 
7 /// It is requred to
8 /// 1. include DAQDataFormats/DataFormatFirst.inc
9 /// 2. define CURRENT_CLASS
10 /// 3. define CURRENT_CLASS_VERSION for version of the class
11 /// OR define LAST_CLASS_VERSION for the main structure of the class
12 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
13 /// 5. include DAQDataFormats/DataFormatLast.inc
14 /// before the declaration of the DataFormat version class in the header.
15 #include "DAQDataFormats/DataFormatFirst.inc"
16 #define CURRENT_CLASS RawConfigurationTail
17 #define CURRENT_CLASS_VERSION 0
18 #define CURRENT_FIELDS_SUB_NAMESPACE rawconftail
19 #include "DAQDataFormats/DataFormatLast.inc"
20 
21 namespace daqdataformats {
22 
24  // Configuration tail delimiter
25  static const uint32_t Marker_value[2] = {0x464E4F43, 0x44444E45};
26  }
27 
28 namespace VERSION_NAMESPACE {
30 
31  static const uint32_t RAWCONFIGURATIONTAIL_SIZE = 5;
32 
34  MASK_Version = 0x00000FFF, //! Configuration Block Tail Version (12 bits)
35  MASK_Reserved1 = 0xFFFFF000, //! Reserved word 1 (20 bits)
36  MASK_Reserved2 = 0xFFFFFFFF, //! Reserved word 2 (32 bits)
37  MASK_MarkerLo1 = 0xFFFFFFFF, //! Marker lower word 1 (32 bits)
38  MASK_MarkerLo2 = 0xFFFFFFFF, //! Marker lower word 2 (32 bits)
39  MASK_CRC = 0xFFFFFFFF //! Check sum for the tail (32 bits)
40  };
41 
43  WORD_Version = 0, //! Version
44  WORD_Reserved1 = 0, //! Reserved word
45  WORD_Reserved2 = 1, //! Reserved word
46  WORD_MarkerLo1 = 2, //! Marker lower word 1 (32 bits)
47  WORD_MarkerLo2 = 3, //! Marker lower word 2 (32 bits)
48  WORD_CRC = 4 //! Check sum for the tail (32 bits)
49  };
50 
51  DEFINE_SHIFT_FROM_MASK(Version);
52  DEFINE_SHIFT_FROM_MASK(Reserved1);
53  DEFINE_SHIFT_FROM_MASK(Reserved2);
54  DEFINE_SHIFT_FROM_MASK(MarkerLo1);
55  DEFINE_SHIFT_FROM_MASK(MarkerLo2);
57  }// end of namespace rawconftail
58 
59 
60  class RawConfigurationTail : public PREVIOUS_VERSION_CLASS_NAME {
61 
62  public:
63  RawConfigurationTail (const version_t); ///< The default constructor
65  ~RawConfigurationTail(); ///< Destructor
66 
67  void init ();
69  void print (std::ostream& os=std::cout) const;
71  using PREVIOUS_VERSION_CLASS_NAME::readData;
72  void* readData(const void* pointer){return RawDAQData::readDataGeneral(pointer);};
73 
74  /// Make set protected, so that users of the class cannot access this method
75  IMPLEMENT_FIRST_GET_AND_SET(Version , uint32_t);
76  IMPLEMENT_FIRST_GET_AND_SET(Reserved1, uint32_t);
77  IMPLEMENT_FIRST_GET_AND_SET(Reserved2, uint32_t);
78  IMPLEMENT_FIRST_GET_AND_SET(MarkerLo1, uint32_t);
79  IMPLEMENT_FIRST_GET_AND_SET(MarkerLo2, uint32_t);
80  IMPLEMENT_FIRST_GET_AND_SET(CRC , uint32_t);
81  };
82 
83 
84 }} // END NAMESPCE daqdataformats
85 #endif /* RAWCONFIGURATIONTAILV0_H */
void * readDataGeneral(const void *buffer)
General ReadData method when the sizeofdata is known.
Definition: RawDAQData.cpp:186
#define VERSION_NAMESPACE
#define IMPLEMENT_FIRST_GET_AND_SET(FUNC, UNITS)
Definition: Macros.h:171
bool print
OStream cout
Definition: OStream.cxx:6
#define CURRENT_FIELDS_SUB_NAMESPACE
int32_t version_t
Definition: RawDAQData.h:72
Class to hold the data from the FEBs in correct formats.