RawSummaryDCMDataHeaderV0.h
Go to the documentation of this file.
1 #ifndef RAWSUMMARYDCMDATAHEADERV0_H
2 #define RAWSUMMARYDCMDATAHEADERV0_H
3 #include "DAQDataFormats/RawDAQData.h"
4 #include "DAQDataFormats/Macros.h"
5 #include "DAQDataFormats/BitFields.h"
6 #include "DAQDataFormats/RawDCMChan.h"
7 
8 /// It is requred to
9 /// 1. include DAQDataFormats/DataFormatFirst.inc
10 /// 2. define CURRENT_CLASS
11 /// 3. define CURRENT_CLASS_VERSION for version of the class
12 /// OR define LAST_CLASS_VERSION for the main structure of the class
13 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
14 /// 5. include DAQDataFormats/DataFormatLast.inc
15 /// before the declaration of the DataFormat version class in the header.
16 #include "DAQDataFormats/DataFormatFirst.inc"
17 #define CURRENT_CLASS RawSummaryDCMDataHeader
18 #define CURRENT_CLASS_VERSION 0
19 #define CURRENT_FIELDS_SUB_NAMESPACE summarydcmdatahdr
20 #include "DAQDataFormats/DataFormatLast.inc"
21 
22 namespace daqdataformats {
23 namespace VERSION_NAMESPACE {
25 
26  static const uint32_t RAWSUMMARYDCMDATAHEADER_SIZE = 2;
27 
29  MASK_Version = 0xFF000000,
30  MASK_NumEntries = 0xFFFFFFFF
31  };
32 
34  WORD_Version = 0,
36  };
37 
38  DEFINE_SHIFT_FROM_MASK(Version);
39  DEFINE_SHIFT_FROM_MASK(NumEntries);
40  }// end of namespace rawmicroblockhdr
41 
42 
43 
44  class RawSummaryDCMDataHeader: public PREVIOUS_VERSION_CLASS_NAME {
45 
46  public:
47 
48  // Constructors
52 
53  void init ();
55  void print (std::ostream& os=std::cout) const;
57 
58  /// RawSummaryDCMDataHeader is a fixed size format
60  void* readData(const void* pointer){return RawDAQData::readDataGeneral(pointer);};
61 
62  protected:
63 
64  IMPLEMENT_FIRST_GET_AND_SET(Version, uint32_t);
65  IMPLEMENT_FIRST_GET_AND_SET(NumEntries, uint32_t);
66 
67  INIT_FIRST(advanceNumEntries, , bool, );
68  };
69 
70 
71 }} // END NAMESPCE daqdataformats
72 #endif /* RAWSUMMARYDCMDATAHEADERV0_H */
void * readDataGeneral(const void *buffer)
General ReadData method when the sizeofdata is known.
Definition: RawDAQData.cpp:186
#define VERSION_NAMESPACE
#define INIT_FIRST(FUNC, CONSTNESS, OUTPUT_UNITS,...)
Definition: Macros.h:239
#define IMPLEMENT_FIRST_GET_AND_SET(FUNC, UNITS)
Definition: Macros.h:171
bool print
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
#define CURRENT_FIELDS_SUB_NAMESPACE
Class to hold the data from the FEBs in correct formats.