CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
fed_header.h
Go to the documentation of this file.
1 #ifndef DataFormats_FEDRawData_fed_header_h
2 #define DataFormats_FEDRawData_fed_header_h
3 
4 #include <cstdint>
5 
6 #ifdef __cplusplus
7 extern "C" {
8 #endif
9 
10 /*************************************************************************
11  *
12  * data structures and associated typedefs
13  *
14  *************************************************************************/
15 
16 /*
17  * FED header - in front of each FED block
18  */
19 
20 typedef struct fedh_struct {
21  uint32_t sourceid;
22  uint32_t eventid;
23 } fedh_t;
24 
25 #define FED_SLINK_START_MARKER 0x5
26 
27 #define FED_HCTRLID_WIDTH 0x0000000f
28 #define FED_HCTRLID_SHIFT 28
29 #define FED_HCTRLID_MASK (FED_HCTRLID_WIDTH << FED_HCTRLID_SHIFT)
30 #define FED_HCTRLID_EXTRACT(a) (((a) >> FED_HCTRLID_SHIFT) & FED_HCTRLID_WIDTH)
31 
32 #define FED_EVTY_WIDTH 0x0000000f
33 #define FED_EVTY_SHIFT 24
34 #define FED_EVTY_MASK (FED_EVTY_WIDTH << FED_EVTY_SHIFT)
35 #define FED_EVTY_EXTRACT(a) (((a) >> FED_EVTY_SHIFT) & FED_EVTY_WIDTH)
36 
37 #define FED_LVL1_WIDTH 0x00ffffff
38 #define FED_LVL1_SHIFT 0
39 #define FED_LVL1_MASK (FED_LVL1_WIDTH << FED_LVL1_SHIFT)
40 #define FED_LVL1_EXTRACT(a) (((a) >> FED_LVL1_SHIFT) & FED_LVL1_WIDTH)
41 
42 #define FED_BXID_WIDTH 0x00000fff
43 #define FED_BXID_SHIFT 20
44 #define FED_BXID_MASK (FED_BXID_WIDTH << FED_BXID_SHIFT)
45 #define FED_BXID_EXTRACT(a) (((a) >> FED_BXID_SHIFT) & FED_BXID_WIDTH)
46 
47 #define FED_SOID_WIDTH 0x00000fff
48 #define FED_SOID_SHIFT 8
49 #define FED_SOID_MASK (FED_SOID_WIDTH << FED_SOID_SHIFT)
50 #define FED_SOID_EXTRACT(a) (((a) >> FED_SOID_SHIFT) & FED_SOID_WIDTH)
51 
52 #define FED_VERSION_WIDTH 0x0000000f
53 #define FED_VERSION_SHIFT 4
54 #define FED_VERSION_MASK (FED_VERSION_WIDTH << FED_VERSION_SHIFT)
55 #define FED_VERSION_EXTRACT(a) (((a) >> FED_VERSION_SHIFT) & FED_VERSION_WIDTH)
56 
57 #define FED_MORE_HEADERS_WIDTH 0x00000001
58 #define FED_MORE_HEADERS_SHIFT 3
59 #define FED_MORE_HEADERS_MASK (FED_MORE_HEADERS_WIDTH << FED_MORE_HEADERS_SHIFT)
60 #define FED_MORE_HEADERS_EXTRACT(a) (((a) >> FED_MORE_HEADERS_SHIFT) & FED_MORE_HEADERS_WIDTH)
61 
62 #ifdef __cplusplus
63 }
64 #endif
65 
66 #endif // DataFormats_FEDRawData_fed_header_h
uint32_t eventid
Definition: fed_header.h:22
struct fedh_struct fedh_t
uint32_t sourceid
Definition: fed_header.h:21