RawTriggerTimingMarkerV0.h
Go to the documentation of this file.
1 #ifndef DAQRAWTRIGGERTIMEMARKERV0_H
2 #define DAQRAWTRIGGERTIMEMARKERV0_H
3 
4 #include "DAQDataFormats/RawDAQData.h"
5 #include "DAQDataFormats/BitFields.h"
6 #include "DAQDataFormats/TriggerDefines.h"
7 #include "DAQDataFormats/Macros.h"
8 
9 /// It is requred to
10 /// 1. include DAQDataFormats/DataFormatFirst.inc
11 /// 2. define CURRENT_CLASS
12 /// 3. define CURRENT_CLASS_VERSION for version of the class
13 /// OR define LAST_CLASS_VERSION for the main structure of the class
14 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
15 /// 5. include DAQDataFormats/DataFormatLast.inc
16 /// before the declaration of the DataFormat version class in the header.
17 #include "DAQDataFormats/DataFormatFirst.inc"
18 #define CURRENT_CLASS RawTriggerTimingMarker
19 #define CURRENT_CLASS_VERSION 0
20 #define CURRENT_FIELDS_SUB_NAMESPACE triggertimingmarker
21 #include "DAQDataFormats/DataFormatLast.inc"
22 
23 namespace daqdataformats {
24 namespace VERSION_NAMESPACE {
25 
27 
28  static const uint32_t TRIGGERTIMINGMARKER_SIZE = 4;
29 
30  //! Enumeration of the Masks for the Trigger Timing Marker
34  MASK_Version = 0xFF000000,
37  };
38 
39  //! Enumeration of the Words for the Trigger Timing Marker
43  WORD_Version = 1,
46  };
47  DEFINE_SHIFT_FROM_MASK(TriggerStartLow_baseClock);
48  DEFINE_SHIFT_FROM_MASK(TriggerStartHigh_baseClock);
49  DEFINE_SHIFT_FROM_MASK(Version);
50  DEFINE_SHIFT_FROM_MASK(TriggerStartLow_833kHz);
51  DEFINE_SHIFT_FROM_MASK(TriggerStartHigh_833kHz);
52  }
53 
54 
55  //! Class that contains the timing information relating to a given trigger
56  /*!
57  The RawTriggerTimingMarkerV0 contains the start indicator for data collection.
58 
59  The class supports general initialization with an internal or external
60  data buffer as well as copyin style initialization for use with
61  STL containers.
62  */
63  class RawTriggerTimingMarker: public PREVIOUS_VERSION_CLASS_NAME {
64 
65  public:
66 
67  RawTriggerTimingMarker (const version_t); ///< The default constructor
69  ~RawTriggerTimingMarker(); ///< Destructor
70 
71  void init ();
73  void print (std::ostream& os=std::cout) const;
75  /// Nanoslice of version 0 is a fixed size format
77  void* readData(const void* pointer){return RawDAQData::readDataGeneral(pointer);};
78 
79  IMPLEMENT_FIRST_GET_AND_SET(Version , uint32_t);
80  IMPLEMENT_FIRST_GET_AND_SET(TriggerStartLow_baseClock , uint32_t);
81  IMPLEMENT_FIRST_GET_AND_SET(TriggerStartHigh_baseClock, uint32_t);
82  IMPLEMENT_FIRST_GET_AND_SET(TriggerStartLow_833kHz , uint32_t);
83  IMPLEMENT_FIRST_GET_AND_SET(TriggerStartHigh_833kHz , uint32_t);
84 
85  INIT_FIRST(getTriggerStart_baseClock, const, uint64_t, );
86  INIT_FIRST(setTriggerStart_baseClock, , bool , const uint64_t);
87  INIT_FIRST(getTriggerStart_833kHz , const, uint64_t, );
88  INIT_FIRST(setTriggerStart_833kHz , , bool , const uint64_t);
89  };
90 
91 
92 }} // END NAMESPCE daqdataformats
93 #endif /* DAQRAWTRIGGERTIMEMARKERV0_H */
void * readDataGeneral(const void *buffer)
General ReadData method when the sizeofdata is known.
Definition: RawDAQData.cpp:186
#define CURRENT_FIELDS_SUB_NAMESPACE
#define VERSION_NAMESPACE
TriggerTimeMarkerMASKS
Enumeration of the Masks for the Trigger Timing Marker.
#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
TriggerTimeMarkerWORDS
Enumeration of the Words for the Trigger Timing Marker.
Class that contains the timing information relating to a given trigger.
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.