RawSummaryDCMDataPointV0.h
Go to the documentation of this file.
1 #ifndef RAWSUMMARYDCMDATAPOINTV0_H
2 #define RAWSUMMARYDCMDATAPOINTV0_H
3 
4 #include "DAQDataFormats/RawDAQData.h"
5 #include "DAQDataFormats/Macros.h"
6 #include "DAQDataFormats/BitFields.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 RawSummaryDCMDataPoint
18 #define CURRENT_CLASS_VERSION 0
19 #define CURRENT_FIELDS_SUB_NAMESPACE summarydcmdatapoint
20 #include "DAQDataFormats/DataFormatLast.inc"
21 
22 namespace daqdataformats {
23 
28  };
29 
30  namespace VERSION_NAMESPACE {
31 
33 
34  static const uint32_t RAWSUMMARYDCMDATAPOINT_SIZE = 3;
35 
37  WORD_Version = 0,
42  };
44  MASK_Version = 0xFF000000,
45  MASK_DataType = 0x00FF0000,
46  MASK_DCMID = 0x0000FFFF,
47  MASK_TimeStampLow = 0xFFFFFFFF,
48  MASK_TimeStampHigh = 0xFFFFFFFF
49  };
50 
53  DEFINE_SHIFT_FROM_MASK(TimeStampLow);
54  DEFINE_SHIFT_FROM_MASK(TimeStampHigh);
55  DEFINE_SHIFT_FROM_MASK(Version);
56 
57  } // end of namespace rawnano
58 
59 
60  class RawSummaryDCMDataPoint: public PREVIOUS_VERSION_CLASS_NAME {
61 
62  public:
63  // Constructors
66  /// Destructor
68 
69  void init ();
71  void print (std::ostream& os=std::cout) const;
73 
74  /// Nanoslice of version 0 is a fixed size format
76  void* readData(const void* pointer){return RawDAQData::readDataGeneral(pointer);};
77 
78  protected:
79  IMPLEMENT_FIRST_GET_AND_SET(Version, uint32_t);
81  IMPLEMENT_FIRST_GET_AND_SET(DCMID, uint32_t);
82  IMPLEMENT_FIRST_GET_AND_SET(TimeStampLow , uint32_t);
83  IMPLEMENT_FIRST_GET_AND_SET(TimeStampHigh , uint32_t);
84 
85  INIT_FIRST(getTimeStamp, const, uint64_t, );
86  INIT_FIRST(setTimeStamp, , bool, const uint64_t );
87 
88  };// end of RawSummaryDCMDataPoint
89 
90 
91 }} // END NAMESPCE daqdataformats
92 #endif /* RAWNANOSLICEV0_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
#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.