RawEventTailV0.cpp
Go to the documentation of this file.
1 #include "DAQDataFormats/RawEventTailV0.h"
2 #include <boost/format.hpp>
3 /// It is requred to
4 /// 1. include DAQDataFormats/DataFormatFirst.inc
5 /// 2. define CURRENT_CLASS
6 /// 3. define CURRENT_CLASS_VERSION for version of the class
7 /// OR define LAST_CLASS_VERSION for the main structure of the class
8 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
9 /// 5. include DAQDataFormats/DataFormatLast.inc
10 /// before the declaration of the DataFormat version class in the header.
11 #include "DAQDataFormats/DataFormatFirst.inc"
12 #define CURRENT_CLASS RawEventTail
13 #define CURRENT_CLASS_VERSION 0
14 #define CURRENT_FIELDS_SUB_NAMESPACE raweventtail
15 #include "DAQDataFormats/DataFormatLast.inc"
16 
17 namespace daqdataformats{
18 namespace VERSION_NAMESPACE{
19 
20 //------------------------------------------------------------------------------
21 // Default constructor
23  RawDAQData(version)
24  ,ZEROOUT_GET_AND_SET(Marker )
25  ,ZEROOUT_GET_AND_SET(MarkerLeft )
26  ,ZEROOUT_GET_AND_SET(MarkerRight )
27  ,ZEROOUT_GET_AND_SET(Version )
28  ,ZEROOUT_GET_AND_SET(EventNumberLo)
29  ,ZEROOUT_GET_AND_SET(EventNumberHi)
30  ,ZEROOUT_GET_AND_SET(EventSize )
31 { }
32 
33 //------------------------------------------------------------------------------
35  RawDAQData(copyin)
36  ,DEEPCOPY_GET_AND_SET(Marker )
37  ,DEEPCOPY_GET_AND_SET(MarkerLeft )
38  ,DEEPCOPY_GET_AND_SET(MarkerRight )
39  ,DEEPCOPY_GET_AND_SET(Version )
40  ,DEEPCOPY_GET_AND_SET(EventNumberLo)
41  ,DEEPCOPY_GET_AND_SET(EventNumberHi)
42  ,DEEPCOPY_GET_AND_SET(EventSize )
43 { }
44 
45 //------------------------------------------------------------------------------
46 // Destructor
48 
49 //------------------------------------------------------------------------------
50 // Initialization of data members
52 
53  EXECUTE_FUNCTION(setVersion )(_version);
57 }
58 //------------------------------------------------------------------------------
59 // Print the RawEventTail header information
60 void RawEventTail::print(std::ostream& os) const{
61  os<<boost::format("\nRawEvent Tail version %d :") % EXECUTE_FUNCTION(getVersion)();
62  os<<boost::format(" Marker=%u" ) % EXECUTE_FUNCTION(getMarker)(); //! RawEventTail header delimiter
63  os<<boost::format(" EventNumberLo=%u" ) % EXECUTE_FUNCTION(getEventNumberLo)();
64  os<<boost::format(" EventNumberHi=%u" ) % EXECUTE_FUNCTION(getEventNumberHi)();
65  os<<boost::format(" MarkerLeft=%u" ) % EXECUTE_FUNCTION(getMarkerLeft)(); //! RawEventTail header delimiter
66  os<<boost::format(" MarkerRight=%u" ) % EXECUTE_FUNCTION(getMarkerRight)(); //! RawEventTail header delimiter
67  os<<boost::format(" EventSize=%u" ) % EXECUTE_FUNCTION(getEventSize)();
68 
69  const uint32_t size_of_data = EXECUTE_FUNCTION(sizeofdata)();
70 
71  os<<"\nRAW:";
72  for(uint32_t i = 0; i < size_of_data; ++i){
73  os<<" ";
74  printWord(i,false, os);
75  }
76 
77  os<<"\nRAW:";
78  for(uint32_t i = 0; i < size_of_data; ++i){
79  os<<std::endl;
80  printWord(i,true, os);
81  }
82 
83 }
84 
85 
86 }}
#define EXECUTE_FUNCTION(FULLFUNCTIONNAME)
Execute and return the delegate.
Definition: Macros.h:54
#define DEEPCOPY_GET_AND_SET(FUNC)
Definition: FunctionBind.h:44
#define VERSION_NAMESPACE
#define ZEROOUT_GET_AND_SET(FUNC)
Definition: FunctionBind.h:56
void print(std::ostream &os=std::cout) const
std::string format(const int32_t &value, const int &ndigits=8)
Definition: HexUtils.cpp:14
const XML_Char * version
Definition: expat.h:187
int32_t version_t
Definition: RawDAQData.h:72
RawEventTail(const version_t)
The default constructor.
Class to hold the data from the FEBs in correct formats.