CMS 3D CMS Logo

GlobalEventNumber.h
Go to the documentation of this file.
1 #ifndef EVF_UTILITIES_GLOBALEVENTNUMBER_H
2 #define EVF_UTILITIES_GLOBALEVENTNUMBER_H
3 
4 #include <cstddef>
5 
7 
8 namespace evf {
9  namespace evtn {
10 
11  const unsigned int SLINK_WORD_SIZE = 8;
12  const unsigned int SLINK_HALFWORD_SIZE = 4;
13  const unsigned int FED_HEADER_SIZE = SLINK_WORD_SIZE;
14  const unsigned int FED_TRAILER_SIZE = SLINK_WORD_SIZE;
15 
16  const unsigned int DAQ_TOTTRG_OFFSET = 2; //offset in 32-bit words
17  const unsigned int DAQ_BOARDID_OFFSET = 1;
18  const unsigned int DAQ_BOARDID_MASK = 0xffff0000;
19  const unsigned int DAQ_BOARDID_SHIFT = 24;
20  const unsigned int DAQ_BOARDID_VALUE = 0x11;
21 
26  BST52_5BX = 51 * SLINK_WORD_SIZE
27  }; // EvmRecordsize
28 
29  const unsigned int EVM_BOARDID_OFFSET = 1;
30  const unsigned int EVM_BOARDID_MASK = 0xffff0000;
31  const unsigned int EVM_BOARDID_SHIFT = 24;
32  const unsigned int EVM_BOARDID_VALUE = 0x11;
33 
34  const unsigned int EVM_GTFE_BLOCK_V0000 = 6; //size in 64-bit words
35  const unsigned int EVM_GTFE_BLOCK_V0011 = 9; //size in 64-bit words, new format
36  const unsigned int EVM_GTFE_BSTGPS_OFFSET = 4; //offset in 32-bit words
37 
38  const unsigned int EVM_TCS_BOARDID_VALUE = 0xcc07;
39  const unsigned int EVM_TCS_BLOCK = 5; //size in 64-bit words
40  const unsigned int EVM_TCS_TRIGNR_OFFSET = 5; //offset in 32-bit words
41  const unsigned int EVM_TCS_LSBLNR_OFFSET = 0; //offset in 32-bit words
42  const unsigned int EVM_TCS_BOARDID_OFFSET = 1; //offset in 32-bit words
43  const unsigned int EVM_TCS_ORBTNR_OFFSET = 6; //offset in 32-bit words
44  const unsigned int EVM_TCS_LSBLNR_MASK = 0x0000ffff; // 16 LSB
45  const unsigned int EVM_TCS_BOARDID_MASK = 0xffff0000; // 16 MSB
46  const unsigned int EVM_TCS_BOARDID_SHIFT = 16; // 16 MSB
47  const unsigned int EVM_TCS_EVNTYP_MASK = 0x00f00000; // 4 bits
48  const unsigned int EVM_TCS_EVNTYP_SHIFT = 20;
49  const unsigned int EVM_TCS_BCNRIN_MASK = 0x00000fff; // 12 LSB
50 
51  const unsigned int EVM_FDL_BLOCK = 7; //size in 64-bit words
52  const unsigned int EVM_FDL_BCNRIN_OFFSET = 1; //offset in 32-bit words
53  const unsigned int EVM_FDL_TECTRG_OFFSET = 2; //offset in 32-bit words
54  const unsigned int EVM_FDL_ALGOB1_OFFSET = 4; //offset in 32-bit words
55  const unsigned int EVM_FDL_ALGOB2_OFFSET = 6; //offset in 32-bit words
56  const unsigned int EVM_FDL_PSCVSN_OFFSET = 11; //offset in 32-bit words
57 
58  const unsigned int GTPE_BOARDID_OFFSET = 16;
59  const unsigned int GTPE_BOARDID_MASK = 0x000000ff;
60  const unsigned int GTPE_BOARDID_SHIFT = 0;
61  const unsigned int GTPE_BOARDID_VALUE = 0x1;
62  const unsigned int GTPE_TRIGNR_OFFSET = 14; //offset in 32-bit words
63  const unsigned int GTPE_ORBTNR_OFFSET = 18; //offset in 32-bit words
64  const unsigned int GTPE_BCNRIN_OFFSET = 3; //offset in 32-bit words
65  const unsigned int GTPE_BCNRIN_MASK = 0x00000fff; // 12 LSB
66 
67  unsigned int offset(bool);
68  bool daq_board_sense(const unsigned char *p);
69  bool gtpe_board_sense(const unsigned char *p);
70  bool evm_board_sense(const unsigned char *p, size_t size);
71  bool evm_tcs_board_sense(const unsigned char *p);
72  void evm_board_setformat(size_t size);
73 
74  unsigned int get(const unsigned char *, bool);
75  unsigned int gtpe_get(const unsigned char *);
76  unsigned int getlbn(const unsigned char *);
77  unsigned int gtpe_getlbn(const unsigned char *);
78  unsigned int getgpslow(const unsigned char *);
79  unsigned int getgpshigh(const unsigned char *);
80  unsigned int getorbit(const unsigned char *);
81  unsigned int getevtyp(const unsigned char *);
82  unsigned int gtpe_getorbit(const unsigned char *);
83  unsigned int getfdlbx(const unsigned char *);
84  unsigned int gtpe_getbx(const unsigned char *);
85  unsigned int getfdlpsc(const unsigned char *);
86  unsigned long long getfdlttr(const unsigned char *);
87  unsigned long long getfdlta1(const unsigned char *);
88  unsigned long long getfdlta2(const unsigned char *);
89  } // namespace evtn
90 } // namespace evf
91 #endif
const unsigned int DAQ_BOARDID_MASK
size
Write out results.
const unsigned int GTPE_BOARDID_OFFSET
const unsigned int EVM_GTFE_BLOCK_V0000
unsigned long long getfdlttr(const unsigned char *)
Definition: fillJson.h:27
const unsigned int EVM_TCS_LSBLNR_OFFSET
const unsigned int GTPE_BOARDID_VALUE
unsigned int getgpshigh(const unsigned char *)
unsigned int getfdlbx(const unsigned char *)
const unsigned int EVM_TCS_TRIGNR_OFFSET
bool gtpe_board_sense(const unsigned char *p)
const unsigned int DAQ_BOARDID_SHIFT
const unsigned int DAQ_TOTTRG_OFFSET
const unsigned int EVM_BOARDID_VALUE
const unsigned int DAQ_BOARDID_OFFSET
const unsigned int EVM_TCS_BOARDID_VALUE
unsigned int getfdlpsc(const unsigned char *)
const unsigned int EVM_TCS_BOARDID_MASK
const unsigned int SLINK_HALFWORD_SIZE
const unsigned int EVM_FDL_BLOCK
void evm_board_setformat(size_t size)
unsigned int getlbn(const unsigned char *)
const unsigned int EVM_TCS_BOARDID_SHIFT
const unsigned int GTPE_BCNRIN_MASK
const unsigned int EVM_GTFE_BLOCK_V0011
const unsigned int EVM_TCS_BLOCK
const unsigned int EVM_FDL_ALGOB2_OFFSET
const unsigned int GTPE_BOARDID_SHIFT
const unsigned int FED_TRAILER_SIZE
unsigned int offset(bool)
bool evm_tcs_board_sense(const unsigned char *p)
const unsigned int FED_HEADER_SIZE
bool evm_board_sense(const unsigned char *p, size_t size)
const unsigned int EVM_TCS_EVNTYP_SHIFT
const unsigned int GTPE_TRIGNR_OFFSET
const unsigned int GTPE_BOARDID_MASK
unsigned int getorbit(const unsigned char *)
unsigned int gtpe_getorbit(const unsigned char *)
const unsigned int EVM_FDL_PSCVSN_OFFSET
const unsigned int EVM_TCS_ORBTNR_OFFSET
unsigned int getevtyp(const unsigned char *)
unsigned long long getfdlta1(const unsigned char *)
const unsigned int SLINK_WORD_SIZE
const unsigned int EVM_BOARDID_MASK
const unsigned int EVM_BOARDID_OFFSET
unsigned int gtpe_getbx(const unsigned char *)
const unsigned int EVM_FDL_TECTRG_OFFSET
const unsigned int EVM_GTFE_BSTGPS_OFFSET
unsigned long long getfdlta2(const unsigned char *)
unsigned int gtpe_get(const unsigned char *)
const unsigned int EVM_BOARDID_SHIFT
const unsigned int GTPE_BCNRIN_OFFSET
const unsigned int EVM_TCS_EVNTYP_MASK
bool daq_board_sense(const unsigned char *p)
unsigned int gtpe_getlbn(const unsigned char *)
const unsigned int EVM_FDL_ALGOB1_OFFSET
const unsigned int EVM_TCS_LSBLNR_MASK
unsigned int getgpslow(const unsigned char *)
const unsigned int EVM_FDL_BCNRIN_OFFSET
const unsigned int EVM_TCS_BOARDID_OFFSET
const unsigned int EVM_TCS_BCNRIN_MASK
const unsigned int GTPE_ORBTNR_OFFSET
const unsigned int DAQ_BOARDID_VALUE