RawTrigger.h
Go to the documentation of this file.
1 #ifndef DAQRAWTRIGGER_H
2 #define DAQRAWTRIGGER_H
3 #include "DAQDataFormats/RawTriggerV2.h"
4 #include "DAQDataFormats/RawTriggerHeader.h"
5 #include "DAQDataFormats/RawTriggerRange.h"
6 
7 /// It is requred to
8 /// 1. include DAQDataFormats/DataFormatFirst.inc
9 /// 2. define CURRENT_CLASS
10 /// 3. define CURRENT_CLASS_VERSION for version of the class
11 /// OR define LAST_CLASS_VERSION for the main structure of the class
12 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
13 /// 5. include DAQDataFormats/DataFormatLast.inc
14 /// before the declaration of the DataFormat version class in the header.
15 #include "DAQDataFormats/DataFormatFirst.inc"
16 #define CURRENT_CLASS RawTrigger
17 #define LAST_CLASS_VERSION 2
18 #define CURRENT_FIELDS_SUB_NAMESPACE rawtrigger
19 #include "DAQDataFormats/DataFormatLast.inc"
20 
21 namespace daqdataformats {
22 
25  RAWTRIGGER_MAXIMUM_SIZE = 50 ///< needed to reserve the buffer
26  };// end of NanoSliceVersion
27  }// end of namespace rawnano
28 
29 
30  //! Class to hold the data from the global trigger in the correct format
31  /*!
32  The RawTrigger class is designed to mimic the format of the actual
33  data that emitted from the global trigger process. This information
34  include the source of the trigger, the trigger number etc...
35 
36  The class supports general initialization with an internal or external
37  data buffer as well as copyin style initialization for use with
38  STL containers.
39  */
40  class RawTrigger: public PREVIOUS_VERSION_CLASS_NAME {
41 
42  public:
43 
44  // Constructors
46  RawTrigger (const RawTrigger& copy_in); //! Deep copy constructor
47  RawTrigger (const void* trigger_buffer, const version_t version = rawdaqdataformat::DAQDATAFORMAT_UNKNOWN_VERSION ); //! Shallow copy constructor
48  /// Destructor
49  ~RawTrigger();
50 
53 
54  /// Method to read data from a PIPE (not socket).
55  /// Only one read can be made. After that the pipe is closed.
56  /// According to Ron Rechenmacher, the maximum size of a PIPE is 512 bytes.
57  readDataStatus readData(const int fd){RETURN_FUNCTION(readDataFromFileDescriptor)(fd);}
58 
64  IMPLEMENT_GET_AND_SET_MAIN(TriggerStart, uint64_t)
65 
66 
68  private:
69  bool setFunctionPointers();
70 
71 
72  };
73 
74 
75 } // END NAMESPCE daqdataformats
76 #endif /* DAQRAWTRIGGER_H */
#define IMPLEMENT_SET_MAIN(FUNC, UNITS)
Definition: Macros.h:210
#define IMPLEMENT_MAIN_STANDARD
Definition: Macros.h:230
#define IMPLEMENT_MAIN_setBufferSource
Definition: Macros.h:228
Class to hold the data from the global trigger in the correct format.
Definition: RawTrigger.h:40
#define RETURN_FUNCTION(FULLFUNCTIONNAME)
Definition: Macros.h:57
IMPLEMENT_MAIN_STANDARD IMPLEMENT_MAIN_setBufferSource readDataStatus readData(const int fd)
Definition: RawTrigger.h:57
Class to hold the data corresponding to the trigger mask.
Class to hold the data from the global trigger range in the correct format.
#define CURRENT_FIELDS_SUB_NAMESPACE
Definition: RawTrigger.h:18
Class that contains the timing information relating to a given trigger.
const XML_Char * version
Definition: expat.h:187
#define IMPLEMENT_FIGUREOUT_VERSION_STATIC(CLASS)
This should be in the header.
Definition: Macros.h:295
static const version_t RAWTRIGGERHEADER_LATEST_VERSION
int32_t version_t
Definition: RawDAQData.h:72
#define IMPLEMENT_GET_AND_SET_MAIN(FUNC, UNITS)
Definition: Macros.h:217
static const version_t DAQDATAFORMAT_UNKNOWN_VERSION
Definition: RawDAQData.h:81
Class to hold the data from the FEBs in correct formats.
Class to hold the data corresponding to the trigger mask.