CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
GlobalEventNumber.h
Go to the documentation of this file.
1 #ifndef EVF_FEDINTERFACE_GLOBALEVENTNUMBER_H
2 #define EVF_FEDINTERFACE_GLOBALEVENTNUMBER_H
3 
4 
5 #include <stddef.h>
6 #include "interface/shared/fed_header.h" // from xdaq
7 
9 
10 namespace evf{
11  namespace evtn{
12 
13  const unsigned int DAQ_TOTTRG_OFFSET = 2; //offset in 32-bit words
14  const unsigned int DAQ_BOARDID_OFFSET = 1;
15  const unsigned int DAQ_BOARDID_MASK = 0xffff0000;
16  const unsigned int DAQ_BOARDID_SHIFT = 24;
17  const unsigned int DAQ_BOARDID_VALUE = 0x11;
18 
24  }; // EvmRecordsize
25 
26  const unsigned int EVM_BOARDID_OFFSET = 1;
27  const unsigned int EVM_BOARDID_MASK = 0xffff0000;
28  const unsigned int EVM_BOARDID_SHIFT = 24;
29  const unsigned int EVM_BOARDID_VALUE = 0x11;
30 
31  const unsigned int EVM_GTFE_BLOCK_V0000 = 6; //size in 64-bit words
32  const unsigned int EVM_GTFE_BLOCK_V0011 = 9; //size in 64-bit words, new format, not yet in effect
33  const unsigned int EVM_GTFE_BSTGPS_OFFSET = 4; //offset in 32-bit words
34 
35  const unsigned int EVM_TCS_BLOCK = 5; //size in 64-bit words
36  const unsigned int EVM_TCS_TRIGNR_OFFSET = 5; //offset in 32-bit words
37  const unsigned int EVM_TCS_LSBLNR_OFFSET = 0; //offset in 32-bit words
38  const unsigned int EVM_TCS_ORBTNR_OFFSET = 6; //offset in 32-bit words
39  const unsigned int EVM_TCS_LSBLNR_MASK = 0x0000ffff; // 16 LSB
40  const unsigned int EVM_TCS_EVNTYP_MASK = 0x00f00000; // 4 bits
41  const unsigned int EVM_TCS_EVNTYP_SHIFT = 20;
42  const unsigned int EVM_TCS_BCNRIN_MASK = 0x00000fff; // 12 LSB
43 
44  const unsigned int EVM_FDL_BLOCK = 7; //size in 64-bit words
45  const unsigned int EVM_FDL_BCNRIN_OFFSET = 1; //offset in 32-bit words
46  const unsigned int EVM_FDL_TECTRG_OFFSET = 2; //offset in 32-bit words
47  const unsigned int EVM_FDL_ALGOB1_OFFSET = 4; //offset in 32-bit words
48  const unsigned int EVM_FDL_ALGOB2_OFFSET = 6; //offset in 32-bit words
49  const unsigned int EVM_FDL_PSCVSN_OFFSET = 11; //offset in 32-bit words
50 
51 
52 
53  const unsigned int GTPE_BOARDID_OFFSET = 16;
54  const unsigned int GTPE_BOARDID_MASK = 0x000000ff;
55  const unsigned int GTPE_BOARDID_SHIFT = 0;
56  const unsigned int GTPE_BOARDID_VALUE = 0x1;
57  const unsigned int GTPE_TRIGNR_OFFSET = 14; //offset in 32-bit words
58  const unsigned int GTPE_ORBTNR_OFFSET = 18; //offset in 32-bit words
59  const unsigned int GTPE_BCNRIN_OFFSET = 3; //offset in 32-bit words
60  const unsigned int GTPE_BCNRIN_MASK = 0x00000fff; // 12 LSB
61 
62  unsigned int offset(bool);
63  inline bool daq_board_sense(const unsigned char *p)
64  {
65  return (*(unsigned int*)(p + sizeof(fedh_t) + DAQ_BOARDID_OFFSET * SLINK_WORD_SIZE / 2) >> DAQ_BOARDID_SHIFT) == DAQ_BOARDID_VALUE;
66  }
67  bool evm_board_sense(const unsigned char *p, size_t size);
68  void evm_board_setformat(size_t size);
69 
70  inline bool gtpe_board_sense(const unsigned char *p)
71  {
72  return (*(unsigned int*)(p + GTPE_BOARDID_OFFSET * SLINK_WORD_SIZE / 2) >> GTPE_BOARDID_SHIFT) != 0;
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  }
90 }
91 #endif
const unsigned int DAQ_BOARDID_MASK
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
unsigned int getfdlpsc(const unsigned char *)
const unsigned int EVM_FDL_BLOCK
void evm_board_setformat(size_t size)
unsigned int getlbn(const unsigned char *)
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
unsigned int offset(bool)
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
Definition: FEDConstants.h:6
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
tuple size
Write out results.
const unsigned int EVM_TCS_BCNRIN_MASK
const unsigned int GTPE_ORBTNR_OFFSET
const unsigned int DAQ_BOARDID_VALUE