RawEventTailV0.h
Go to the documentation of this file.
1 #ifndef RAWEVENTTAILV0_H
2 #define RAWEVENTTAILV0_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 RawEventTail
17 #define CURRENT_CLASS_VERSION 0
18 #define CURRENT_FIELDS_SUB_NAMESPACE raweventtail
19 #include "DAQDataFormats/DataFormatLast.inc"
20 
21 namespace daqdataformats {
22 
24 
25  // MilliSlice header delimiter. [0] value in the header, [1] value in the tail
26  static const uint32_t Marker_value[3] = {0xEEEE, 0x929E, 0x929E};
27  }
28 
29 namespace VERSION_NAMESPACE {
31 
32 
33  static const uint32_t RAWEVENTTAIL_SIZE = 4;
34 
36  MASK_EventNumberHi = 0x000000FF,//! Universal event number higher 32-39 bits
37  MASK_Version = 0x0000FF00,//! Version
38  MASK_Marker = 0xFFFF0000,// Marker Mask (16 bits)
39  MASK_EventNumberLo = 0xFFFFFFFF,//! Universal event number lower 0-31 bits
40  MASK_EventSize = 0xFFFFFFFF, //! Size of the event in words (8 bits)
41  MASK_MarkerRight = 0x0000FFFF,// Marker Mask (16 bits)
42  MASK_MarkerLeft = 0xFFFF0000// Marker Mask (16 bits)
43  };
44 
47  WORD_Version = 0,
48  WORD_Marker = 0,
50  WORD_EventSize = 2,
51  WORD_MarkerRight = 3,
52  WORD_MarkerLeft = 3
53  };
54 
55  DEFINE_SHIFT_FROM_MASK(EventNumberHi);
56  DEFINE_SHIFT_FROM_MASK(Version);
57  DEFINE_SHIFT_FROM_MASK(Marker);
58  DEFINE_SHIFT_FROM_MASK(EventNumberLo);
59  DEFINE_SHIFT_FROM_MASK(EventSize);
60  DEFINE_SHIFT_FROM_MASK(MarkerRight);
61  DEFINE_SHIFT_FROM_MASK(MarkerLeft);
62 
63  }
64 
65  class RawEventTail: public PREVIOUS_VERSION_CLASS_NAME {
66  public:
67  RawEventTail (const version_t); ///< The default constructor
68  RawEventTail (const RawEventTail&);
69  ~RawEventTail(); ///< Destructor
70 
71  void init ();
73  void print (std::ostream& os=std::cout) const;
76  void* readData(const void* pointer){return RawDAQData::readDataGeneral(pointer);};
77 
78  protected:
79  IMPLEMENT_FIRST_GET_AND_SET(Marker , uint32_t);
80  IMPLEMENT_FIRST_GET_AND_SET(MarkerLeft , uint32_t);
81  IMPLEMENT_FIRST_GET_AND_SET(MarkerRight , uint32_t);
82  IMPLEMENT_FIRST_GET_AND_SET(Version , uint32_t);
83  IMPLEMENT_FIRST_GET_AND_SET(EventNumberLo, uint32_t);
84  IMPLEMENT_FIRST_GET_AND_SET(EventNumberHi, uint32_t);
85  IMPLEMENT_FIRST_GET_AND_SET(EventSize , uint32_t);
86 
87  };
88 
89 
90 }} // END NAMESPCE daqdataformats
91 #endif /* RAWEVENTTAILV0_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
#define CURRENT_FIELDS_SUB_NAMESPACE
OStream cout
Definition: OStream.cxx:6
void * readData(const void *buffer)
Shallow copy constructor.
Definition: RawDAQData.cpp:181
int32_t version_t
Definition: RawDAQData.h:72
Class to hold the data from the FEBs in correct formats.