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