CMS 3D CMS Logo

fed_trailer.h
Go to the documentation of this file.
1 #ifndef DataFormats_FEDRawData_fed_trailer_h
2 #define DataFormats_FEDRawData_fed_trailer_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 trailer - at the end of each FED block
18  */
19 
20 typedef struct fedt_struct {
21  uint32_t conscheck;
22  uint32_t eventsize;
23 } fedt_t;
24 
25 #define FED_SLINK_END_MARKER 0xa
26 
27 #define FED_TCTRLID_WIDTH 0x0000000f
28 #define FED_TCTRLID_SHIFT 28
29 #define FED_TCTRLID_MASK (FED_TCTRLID_WIDTH << FED_TCTRLID_SHIFT)
30 #define FED_TCTRLID_EXTRACT(a) (((a) >> FED_TCTRLID_SHIFT) & FED_TCTRLID_WIDTH)
31 
32 #define FED_EVSZ_WIDTH 0x00ffffff
33 #define FED_EVSZ_SHIFT 0
34 #define FED_EVSZ_MASK (FED_EVSZ_WIDTH << FED_EVSZ_SHIFT)
35 #define FED_EVSZ_EXTRACT(a) (((a) >> FED_EVSZ_SHIFT) & FED_EVSZ_WIDTH)
36 
37 #define FED_CRCS_WIDTH 0x0000ffff
38 #define FED_CRCS_SHIFT 16
39 #define FED_CRCS_MASK (FED_CRCS_WIDTH << FED_CRCS_SHIFT)
40 #define FED_CRCS_EXTRACT(a) (((a) >> FED_CRCS_SHIFT) & FED_CRCS_WIDTH)
41 
42 #define FED_STAT_WIDTH 0x0000000f
43 #define FED_STAT_SHIFT 8
44 #define FED_STAT_MASK (FED_STAT_WIDTH << FED_STAT_SHIFT)
45 #define FED_STAT_EXTRACT(a) (((a) >> FED_STAT_SHIFT) & FED_STAT_WIDTH)
46 
47 #define FED_TTSI_WIDTH 0x0000000f
48 #define FED_TTSI_SHIFT 4
49 #define FED_TTSI_MASK (FED_TTSI_WIDTH << FED_TTSI_SHIFT)
50 #define FED_TTSI_EXTRACT(a) (((a) >> FED_TTSI_SHIFT) & FED_TTSI_WIDTH)
51 
52 #define FED_MORE_TRAILERS_WIDTH 0x00000001
53 #define FED_MORE_TRAILERS_SHIFT 3
54 #define FED_MORE_TRAILERS_MASK (FED_MORE_TRAILERS_WIDTH << FED_MORE_TRAILERS_SHIFT)
55 #define FED_MORE_TRAILERS_EXTRACT(a) (((a) >> FED_MORE_TRAILERS_SHIFT) & FED_MORE_TRAILERS_WIDTH)
56 
57 #define FED_CRC_MODIFIED_WIDTH 0x00000001
58 #define FED_CRC_MODIFIED_SHIFT 2
59 #define FED_CRC_MODIFIED_MASK (FED_CRC_MODIFIED_WIDTH << FED_CRC_MODIFIED_SHIFT)
60 #define FED_CRC_MODIFIED_EXTRACT(a) (((a) >> FED_CRC_MODIFIED_SHIFT) & FED_CRC_MODIFIED_WIDTH)
61 
62 #define FED_SLINK_ERROR_WIDTH 0x00000001
63 #define FED_SLINK_ERROR_SHIFT 14
64 #define FED_SLINK_ERROR_MASK (FED_SLINK_ERROR_WIDTH << FED_SLINK_ERROR_SHIFT)
65 #define FED_SLINK_ERROR_EXTRACT(a) (((a) >> FED_SLINK_ERROR_SHIFT) & FED_SLINK_ERROR_WIDTH)
66 
67 #define FED_WRONG_FEDID_WIDTH 0x00000001
68 #define FED_WRONG_FEDID_SHIFT 15
69 #define FED_WRONG_FEDID_MASK (FED_WRONG_FEDID_WIDTH << FED_WRONG_FEDID_SHIFT)
70 #define FED_WRONG_FEDID_EXTRACT(a) (((a) >> FED_WRONG_FEDID_SHIFT) & FED_WRONG_FEDID_WIDTH)
71 
72 #ifdef __cplusplus
73 }
74 #endif
75 
76 #endif // DataFormats_FEDRawData_fed_trailer_h
struct fedt_struct fedt_t
uint32_t eventsize
Definition: fed_trailer.h:22
uint32_t conscheck
Definition: fed_trailer.h:21