RawTriggerRangeV0.h
Go to the documentation of this file.
1 #ifndef DAQRAWTRIGGERRANGEV0_H
2 #define DAQRAWTRIGGERRANGEV0_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 RawTriggerRange
18 #define CURRENT_CLASS_VERSION 0
19 #define CURRENT_FIELDS_SUB_NAMESPACE triggerrange
20 #include "DAQDataFormats/DataFormatLast.inc"
21 
22 namespace daqdataformats {
23 
24 namespace VERSION_NAMESPACE {
26 
27  static const uint32_t TRIGGERRANGE_SIZE = 1;
28 
30  MASK_TriggerLength = 0x0FFFFFFF,
31  MASK_Version = 0xF0000000
32  };
35  WORD_Version = 0
36  };
37 
38  DEFINE_SHIFT_FROM_MASK(TriggerLength);
39  DEFINE_SHIFT_FROM_MASK(Version);
40  }// end of namespace triggerrange
41 
42  //! Class to hold the data from the global trigger range in the correct format
43  /*!
44  The RawTriggerRangeV0 contains the width of the trigger gate in
45  500 nsec units.
46 
47  The class supports general initialization with an internal or external
48  data buffer as well as copyin style initialization for use with
49  STL containers.
50  */
51  class RawTriggerRange: public PREVIOUS_VERSION_CLASS_NAME {
52 
53  public:
54 
55  RawTriggerRange (const version_t); ///< The default constructor
57  ~RawTriggerRange(); ///< Destructor
58 
59  void init ();
61  void print (std::ostream& os=std::cout) const;
63 
64  /// Nanoslice of version 0 is a fixed size format
66  void* readData(const void* pointer){return RawDAQData::readDataGeneral(pointer);};
67 
68  IMPLEMENT_FIRST_GET_AND_SET(Version , uint32_t);
69  IMPLEMENT_FIRST_GET_AND_SET(TriggerLength, uint32_t);
70  };
71 
72 
73 }} // END NAMESPCE daqdataformats
74 #endif /* DAQRAWTRIGGERRANGEV0_H */
void * readDataGeneral(const void *buffer)
General ReadData method when the sizeofdata is known.
Definition: RawDAQData.cpp:186
#define VERSION_NAMESPACE
Class to hold the data from the global trigger range in the correct format.
#define IMPLEMENT_FIRST_GET_AND_SET(FUNC, UNITS)
Definition: Macros.h:171
#define CURRENT_FIELDS_SUB_NAMESPACE
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
Class to hold the data from the FEBs in correct formats.