RawTriggerMaskV0.h
Go to the documentation of this file.
1 #ifndef DAQRAWTRIGGERMASKV0_H
2 #define DAQRAWTRIGGERMASKV0_H
3 #include "DAQDataFormats/RawDAQData.h"
4 #include "DAQDataFormats/BitFields.h"
5 #include "DAQDataFormats/TriggerDefines.h"
6 #include "DAQDataFormats/Macros.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 RawTriggerMask
18 #define CURRENT_CLASS_VERSION 0
19 #define CURRENT_FIELDS_SUB_NAMESPACE triggermask
20 #include "DAQDataFormats/DataFormatLast.inc"
21 
22 namespace daqdataformats {
23 
24  namespace VERSION_NAMESPACE {
26 
27  static const uint32_t TRIGGERMASK_SIZE = 4;
28 
30  MASK_MonteCarloFlag = 0x80000000,
31  MASK_TrigMod = 0x3F000000,
32  MASK_TrigMask_Low = 0x00FFFFFF,
33  MASK_TrigMask_High = 0xFFFFFFFF,
34  MASK_TrigMask_High2 = 0xFFFFFFFF,
35  MASK_Prescale = 0x0000FFFF,
36  MASK_Version = 0xFFFF0000
37  };
38 
46  WORD_Version = 3
47  };
48 
49  DEFINE_SHIFT_FROM_MASK(MonteCarloFlag);
50  DEFINE_SHIFT_FROM_MASK(TrigMod);
51  DEFINE_SHIFT_FROM_MASK(TrigMask_Low);
52  DEFINE_SHIFT_FROM_MASK(TrigMask_High);
53  DEFINE_SHIFT_FROM_MASK(TrigMask_High2);
54  DEFINE_SHIFT_FROM_MASK(Prescale);
55  DEFINE_SHIFT_FROM_MASK(Version);
56  }// end of namespace triggermask
57 
58 
59  //! Class to hold the data corresponding to the trigger mask
60  /*!
61  The RawTriggerMaskV0 contains the information on the type of trigger
62  that is being issued.
63 
64  The class supports general initialization with an internal or external
65  data buffer as well as copyin style initialization for use with
66  STL containers.
67  */
68  class RawTriggerMask: public PREVIOUS_VERSION_CLASS_NAME {
69 
70  public:
71 
72  RawTriggerMask (const version_t); ///< The default constructor
74  ~RawTriggerMask(); ///< Destructor
75 
76  void init ();
78  void print (std::ostream& os=std::cout) const;
80  /// Nanoslice of version 0 is a fixed size format
82  void* readData(const void* pointer){return RawDAQData::readDataGeneral(pointer);};
83 
84  IMPLEMENT_FIRST_GET_AND_SET(Version , uint32_t);
85  IMPLEMENT_FIRST_GET_AND_SET(MonteCarloFlag, uint32_t);
86  IMPLEMENT_FIRST_GET_AND_SET(TrigMod , uint32_t);
87  IMPLEMENT_FIRST_GET_AND_SET(TrigMask_Low , uint32_t);
88  IMPLEMENT_FIRST_GET_AND_SET(TrigMask_High , uint32_t);
89  IMPLEMENT_FIRST_GET_AND_SET(TrigMask_High2, uint32_t);
90  IMPLEMENT_FIRST_GET_AND_SET(Prescale , uint32_t);
91 
92  INIT_FIRST(getTriggerMask, const, uint32_t, );
93  INIT_FIRST(setTriggerMask, , bool , const uint32_t);
94 
95  };
96 
97 
98 }} // END NAMESPACE daqdataformats
99 #endif /* DAQRAWTRIGGERMASKV0_H */
void * readDataGeneral(const void *buffer)
General ReadData method when the sizeofdata is known.
Definition: RawDAQData.cpp:186
Class to hold the data corresponding to the trigger mask.
#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.