NanoSliceHeaderConstructor.h
Go to the documentation of this file.
1 /*
2  * File: NanoSliceHeaderConstructor.h
3  * Author: denis
4  *
5  * Created on September 20, 2012, 2:18 PM
6  */
7 
8 #ifndef NANOSLICEHEADERCONSTRUCTOR_H
9 #define NANOSLICEHEADERCONSTRUCTOR_H
10 //#include "DAQDataFormats/../unittest/RawDAQDataConstructor.h"
11 #include "RawDAQDataConstructor.h"
12 #include "DAQDataFormats/RawNanoSliceHeader.h"
13 
14 /// It is requred to
15 /// 1. include DAQDataFormats/DataFormatFirst.inc
16 /// 2. define CURRENT_CLASS
17 /// 3. define CURRENT_CLASS_VERSION for version of the class
18 /// OR define LAST_CLASS_VERSION for the main structure of the class
19 /// 4. (optional) define CURRENT_FIELDS_SUB_NAMESPACE
20 /// 5. include DAQDataFormats/DataFormatLast.inc
21 /// before the declaration of the DataFormat version class in the header.
22 #include "DAQDataFormats/DataFormatFirst.inc"
23 #define CURRENT_CLASS RawNanoSliceHeader
24 #define LAST_CLASS_VERSION 2
25 #define CURRENT_FIELDS_SUB_NAMESPACE nanosliceheader
26 #include "DAQDataFormats/DataFormatLast.inc"
27 
28 namespace daqdataformats {
30 
32  TEST_VALUE_LinkStatus = 1, //! Link Status (1 bit)
33  TEST_VALUE_DataPresent = 1, //! Denis Perevalov Present/Absent flag (1 bit)
34  TEST_VALUE_DebugMode = 1, //! Debug Mode (1 bit)
35  TEST_VALUE_FEBId = 2, //! FEB ID (6 bit)
36  TEST_VALUE_FEBStatus = 3, //! FEB Status (7 bit)
37  TEST_VALUE_PixelAddr = 4, //! Pixel Address (5 bit)
38  TEST_VALUE_Sequence = 6, //! Sequence number (3 bit)
39  TEST_VALUE_Pad3 = 4, //! Pad3 (3 bit)
40  TEST_VALUE_DAQEnabled = 1, //! DAQ Enabled Status Bit (1 bit)
41  TEST_VALUE_BufferEmpty = 1, //! APD Data Buffer Empty (1 bit)
42  TEST_VALUE_BufferFull = 1, //! APD Data Buffer Full (1 bit)
43  TEST_VALUE_CommError = 1, //! FEB Communications Error (1 bit)
44  TEST_VALUE_PacketError = 1, //! FEB Packet Error (1 bit)
45  TEST_VALUE_OverflowError= 1, //! FEB Data Buff Overflow Error (1 bit)
46  TEST_VALUE_ADCError = 1, //! FEB ADC Error (1 bit)
47  };// end of NanoSliceHeaderMASKS
48 
50 public:
53  DEFINE_TESTVALUE_BOOL(LinkStatus);
54  DEFINE_TESTVALUE_BOOL(DataPresent);
55  DEFINE_TESTVALUE_BOOL(DebugMode);
56  DEFINE_TESTVALUE (FEBId);
57  DEFINE_TESTVALUE (FEBStatus);
58  DEFINE_TESTVALUE (PixelAddr);
59  DEFINE_TESTVALUE (Sequence);
60  DEFINE_TESTVALUE (Pad3);
61  DEFINE_TESTVALUE_BOOL(DAQEnabled);
62  DEFINE_TESTVALUE_BOOL(BufferEmpty);
63  DEFINE_TESTVALUE_BOOL(BufferFull);
64  DEFINE_TESTVALUE_BOOL(CommError);
65  DEFINE_TESTVALUE_BOOL(PacketError);
66  DEFINE_TESTVALUE_BOOL(OverflowError);
67  DEFINE_TESTVALUE_BOOL(ADCError);
71 
73  const RawNanoSliceHeader* nano_ver = (const RawNanoSliceHeader*)inver;
74  return nano_ver->getVersion();
75  }
76 
77 private:
78 
79 };
80 
81 }}// end of namespaces
82 
83 
84 #endif /* NANOSLICEHEADERCONSTRUCTOR_H */
85 
bool fillDataFormat(daqdataformats::RawDAQData *) const
method to Fill the input dataformat
daqdataformats::RawDAQData * getEmptyDataFormat(const daqdataformats::version_t) const
method to create an empty dataformat with a given version
daqdataformats::RawDAQData * getFilledDataFormat(const daqdataformats::version_t) const
version_t getVersion(const daqdataformats::RawDAQData *inver) const
Get version of the input dataformat.
#define CURRENT_FIELDS_SUB_NAMESPACE
int32_t version_t
Definition: RawDAQData.h:72
Class to hold the data from the FEBs in correct formats.