CMS 3D CMS Logo

GlobalEventNumber.cc
Go to the documentation of this file.
1 #include "EventFilter/Utilities/interface/GlobalEventNumber.icc"
2 
3 namespace evf {
4  namespace evtn {
5 
6  bool daq_board_sense(const unsigned char *p) {
7  return (*(unsigned int *)(p + FEDHeader::length + DAQ_BOARDID_OFFSET * SLINK_WORD_SIZE / 2) >>
9  }
10 
11  bool gtpe_board_sense(const unsigned char *p) {
12  return (*(unsigned int *)(p + GTPE_BOARDID_OFFSET * SLINK_WORD_SIZE / 2) >> GTPE_BOARDID_SHIFT) != 0;
13  }
14 
15  bool evm_board_sense(const unsigned char *p, size_t size) {
16  switch (size) {
17  case BST32_3BX:
18  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0000;
19  EVM_FDL_NOBX = 3;
20  break;
21  case BST32_5BX:
22  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0000;
23  EVM_FDL_NOBX = 5;
24  break;
25  case BST52_3BX:
26  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0011;
27  EVM_FDL_NOBX = 3;
28  break;
29  case BST52_5BX:
30  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0011;
31  EVM_FDL_NOBX = 5;
32  break;
33  default:
34  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0000;
35  EVM_FDL_NOBX = 3;
36  }
37  return (*(const unsigned int *)(p + FEDHeader::length + EVM_BOARDID_OFFSET * SLINK_WORD_SIZE / 2) >>
39  }
40 
41  bool evm_tcs_board_sense(const unsigned char *p) {
42  return (*(const unsigned int *)(p + FEDHeader::length +
43  (EVM_GTFE_BLOCK * 2 + EVM_TCS_BOARDID_OFFSET) * SLINK_WORD_SIZE / 2) >>
45  }
46 
47  void evm_board_setformat(size_t size) {
48  switch (size) {
49  case BST32_3BX:
50  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0000;
51  EVM_FDL_NOBX = 3;
52  break;
53  case BST32_5BX:
54  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0000;
55  EVM_FDL_NOBX = 5;
56  break;
57  case BST52_3BX:
58  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0011;
59  EVM_FDL_NOBX = 3;
60  break;
61  case BST52_5BX:
62  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0011;
63  EVM_FDL_NOBX = 5;
64  break;
65  default:
66  EVM_GTFE_BLOCK = EVM_GTFE_BLOCK_V0000;
67  EVM_FDL_NOBX = 3;
68  }
69  }
70 
71  unsigned int offset(bool evm) {
72  if (evm)
73  return FEDHeader::length + (EVM_GTFE_BLOCK * 2 + EVM_TCS_TRIGNR_OFFSET) * SLINK_WORD_SIZE / 2;
74  else
76  }
77  unsigned int get(const unsigned char *p, bool evm) {
78  if (evm && evm_tcs_board_sense(p))
79  return *(const unsigned int *)(p + offset(true));
80  else
81  return *(const unsigned int *)(p + offset(false)); // cover case of evm but invalid tcs info
82  }
83  unsigned int gtpe_get(const unsigned char *p) {
84  return *(const unsigned int *)(p + GTPE_TRIGNR_OFFSET * SLINK_HALFWORD_SIZE);
85  }
86  unsigned int getlbn(const unsigned char *p) {
87  return (*(const unsigned int *)(p + FEDHeader::length +
88  (EVM_GTFE_BLOCK * 2 + EVM_TCS_LSBLNR_OFFSET) * SLINK_WORD_SIZE / 2)) &
90  }
91  unsigned int gtpe_getlbn(const unsigned char *p) { return gtpe_getorbit(p) / 0x00100000; }
92  unsigned int getgpslow(const unsigned char *p) {
93  return (*(const unsigned int *)(p + FEDHeader::length + EVM_GTFE_BSTGPS_OFFSET * SLINK_WORD_SIZE / 2));
94  }
95  unsigned int getgpshigh(const unsigned char *p) {
96  return (*(const unsigned int *)(p + FEDHeader::length + EVM_GTFE_BSTGPS_OFFSET * SLINK_WORD_SIZE / 2 +
98  }
99  unsigned int getorbit(const unsigned char *p) {
100  return (*(const unsigned int *)(p + FEDHeader::length +
101  (EVM_GTFE_BLOCK * 2 + EVM_TCS_ORBTNR_OFFSET) * SLINK_WORD_SIZE / 2));
102  }
103  unsigned int getevtyp(const unsigned char *p) {
104  return (((*(const unsigned int *)(p + FEDHeader::length +
105  (EVM_GTFE_BLOCK * 2 + EVM_TCS_LSBLNR_OFFSET) * SLINK_WORD_SIZE / 2)) &
108  }
109  unsigned int gtpe_getorbit(const unsigned char *p) {
110  return (*(const unsigned int *)(p + GTPE_ORBTNR_OFFSET * SLINK_HALFWORD_SIZE));
111  }
112  unsigned int getfdlbx(const unsigned char *p) {
113  return (*(const unsigned int *)(p + FEDHeader::length +
114  (EVM_GTFE_BLOCK + EVM_TCS_BLOCK + EVM_FDL_BLOCK * (EVM_FDL_NOBX / 2)) *
118  }
119  unsigned int gtpe_getbx(const unsigned char *p) {
120  return (*(const unsigned int *)(p + GTPE_BCNRIN_OFFSET * SLINK_HALFWORD_SIZE)) & GTPE_BCNRIN_MASK;
121  }
122  unsigned int getfdlpsc(const unsigned char *p) {
123  return (*(const unsigned int *)(p + FEDHeader::length +
124  (EVM_GTFE_BLOCK + EVM_TCS_BLOCK + EVM_FDL_BLOCK * (EVM_FDL_NOBX / 2)) *
127  }
128  unsigned long long getfdlttr(const unsigned char *p) {
129  return (*(const unsigned long long *)(p + FEDHeader::length +
130  (EVM_GTFE_BLOCK + EVM_TCS_BLOCK + EVM_FDL_BLOCK * (EVM_FDL_NOBX / 2)) *
133  }
134  unsigned long long getfdlta1(const unsigned char *p) {
135  return (*(const unsigned long long *)(p + FEDHeader::length +
136  (EVM_GTFE_BLOCK + EVM_TCS_BLOCK + EVM_FDL_BLOCK * (EVM_FDL_NOBX / 2)) *
139  }
140  unsigned long long getfdlta2(const unsigned char *p) {
141  return (*(const unsigned long long *)(p + FEDHeader::length +
142  (EVM_GTFE_BLOCK + EVM_TCS_BLOCK + EVM_FDL_BLOCK * (EVM_FDL_NOBX / 2)) *
145  }
146  } // namespace evtn
147 } // namespace evf
evf::evtn::gtpe_getlbn
unsigned int gtpe_getlbn(const unsigned char *)
Definition: GlobalEventNumber.cc:91
evf::evtn::EVM_FDL_ALGOB2_OFFSET
const unsigned int EVM_FDL_ALGOB2_OFFSET
Definition: GlobalEventNumber.h:55
evf::evtn::EVM_BOARDID_OFFSET
const unsigned int EVM_BOARDID_OFFSET
Definition: GlobalEventNumber.h:29
evf::evtn::EVM_TCS_ORBTNR_OFFSET
const unsigned int EVM_TCS_ORBTNR_OFFSET
Definition: GlobalEventNumber.h:43
evf::evtn::daq_board_sense
bool daq_board_sense(const unsigned char *p)
Definition: GlobalEventNumber.cc:6
evf::evtn::DAQ_BOARDID_VALUE
const unsigned int DAQ_BOARDID_VALUE
Definition: GlobalEventNumber.h:20
evf::evtn::getlbn
unsigned int getlbn(const unsigned char *)
Definition: GlobalEventNumber.cc:86
evf::evtn::getfdlta2
unsigned long long getfdlta2(const unsigned char *)
Definition: GlobalEventNumber.cc:140
evf::evtn::BST32_5BX
Definition: GlobalEventNumber.h:24
evf::evtn::getfdlta1
unsigned long long getfdlta1(const unsigned char *)
Definition: GlobalEventNumber.cc:134
evf::evtn::EVM_TCS_BOARDID_SHIFT
const unsigned int EVM_TCS_BOARDID_SHIFT
Definition: GlobalEventNumber.h:46
evf::evtn::DAQ_BOARDID_OFFSET
const unsigned int DAQ_BOARDID_OFFSET
Definition: GlobalEventNumber.h:17
AlCaHLTBitMon_ParallelJobs.p
p
Definition: AlCaHLTBitMon_ParallelJobs.py:153
evf::evtn::EVM_GTFE_BSTGPS_OFFSET
const unsigned int EVM_GTFE_BSTGPS_OFFSET
Definition: GlobalEventNumber.h:36
evf::evtn::gtpe_board_sense
bool gtpe_board_sense(const unsigned char *p)
Definition: GlobalEventNumber.cc:11
evf::evtn::getfdlbx
unsigned int getfdlbx(const unsigned char *)
Definition: GlobalEventNumber.cc:112
evf::evtn::EVM_TCS_EVNTYP_SHIFT
const unsigned int EVM_TCS_EVNTYP_SHIFT
Definition: GlobalEventNumber.h:48
evf::evtn::EVM_TCS_BCNRIN_MASK
const unsigned int EVM_TCS_BCNRIN_MASK
Definition: GlobalEventNumber.h:49
evf::evtn::get
unsigned int get(const unsigned char *, bool)
Definition: GlobalEventNumber.cc:77
evf::evtn::getgpslow
unsigned int getgpslow(const unsigned char *)
Definition: GlobalEventNumber.cc:92
evf::evtn::EVM_FDL_ALGOB1_OFFSET
const unsigned int EVM_FDL_ALGOB1_OFFSET
Definition: GlobalEventNumber.h:54
evf::evtn::EVM_TCS_LSBLNR_MASK
const unsigned int EVM_TCS_LSBLNR_MASK
Definition: GlobalEventNumber.h:44
evf::evtn::BST52_5BX
Definition: GlobalEventNumber.h:26
evf::evtn::EVM_TCS_BOARDID_OFFSET
const unsigned int EVM_TCS_BOARDID_OFFSET
Definition: GlobalEventNumber.h:42
evf::evtn::offset
unsigned int offset(bool)
Definition: GlobalEventNumber.cc:71
evf::evtn::evm_tcs_board_sense
bool evm_tcs_board_sense(const unsigned char *p)
Definition: GlobalEventNumber.cc:41
evf::evtn::DAQ_BOARDID_SHIFT
const unsigned int DAQ_BOARDID_SHIFT
Definition: GlobalEventNumber.h:19
evf::evtn::getevtyp
unsigned int getevtyp(const unsigned char *)
Definition: GlobalEventNumber.cc:103
evf::evtn::GTPE_BCNRIN_OFFSET
const unsigned int GTPE_BCNRIN_OFFSET
Definition: GlobalEventNumber.h:64
evf::evtn::getfdlttr
unsigned long long getfdlttr(const unsigned char *)
Definition: GlobalEventNumber.cc:128
evf::evtn::EVM_TCS_BOARDID_VALUE
const unsigned int EVM_TCS_BOARDID_VALUE
Definition: GlobalEventNumber.h:38
evf::evtn::evm_board_setformat
void evm_board_setformat(size_t size)
Definition: GlobalEventNumber.cc:47
evf::evtn::GTPE_ORBTNR_OFFSET
const unsigned int GTPE_ORBTNR_OFFSET
Definition: GlobalEventNumber.h:63
evf::evtn::gtpe_getorbit
unsigned int gtpe_getorbit(const unsigned char *)
Definition: GlobalEventNumber.cc:109
evf::evtn::EVM_FDL_PSCVSN_OFFSET
const unsigned int EVM_FDL_PSCVSN_OFFSET
Definition: GlobalEventNumber.h:56
evf::evtn::EVM_FDL_BCNRIN_OFFSET
const unsigned int EVM_FDL_BCNRIN_OFFSET
Definition: GlobalEventNumber.h:52
evf::evtn::EVM_TCS_EVNTYP_MASK
const unsigned int EVM_TCS_EVNTYP_MASK
Definition: GlobalEventNumber.h:47
evf::evtn::EVM_BOARDID_VALUE
const unsigned int EVM_BOARDID_VALUE
Definition: GlobalEventNumber.h:32
evf::evtn::gtpe_getbx
unsigned int gtpe_getbx(const unsigned char *)
Definition: GlobalEventNumber.cc:119
evf::evtn::getorbit
unsigned int getorbit(const unsigned char *)
Definition: GlobalEventNumber.cc:99
evf::evtn::getfdlpsc
unsigned int getfdlpsc(const unsigned char *)
Definition: GlobalEventNumber.cc:122
evf::evtn::EVM_TCS_LSBLNR_OFFSET
const unsigned int EVM_TCS_LSBLNR_OFFSET
Definition: GlobalEventNumber.h:41
evf::evtn::EVM_TCS_BLOCK
const unsigned int EVM_TCS_BLOCK
Definition: GlobalEventNumber.h:39
FEDHeader::length
static const uint32_t length
Definition: FEDHeader.h:54
evf::evtn::BST52_3BX
Definition: GlobalEventNumber.h:25
evf::evtn::SLINK_HALFWORD_SIZE
const unsigned int SLINK_HALFWORD_SIZE
Definition: GlobalEventNumber.h:12
evf::evtn::DAQ_TOTTRG_OFFSET
const unsigned int DAQ_TOTTRG_OFFSET
Definition: GlobalEventNumber.h:16
evf::evtn::evm_board_sense
bool evm_board_sense(const unsigned char *p, size_t size)
Definition: GlobalEventNumber.cc:15
evf::evtn::EVM_GTFE_BLOCK_V0011
const unsigned int EVM_GTFE_BLOCK_V0011
Definition: GlobalEventNumber.h:35
evf::evtn::BST32_3BX
Definition: GlobalEventNumber.h:23
evf::evtn::EVM_TCS_TRIGNR_OFFSET
const unsigned int EVM_TCS_TRIGNR_OFFSET
Definition: GlobalEventNumber.h:40
evf
Definition: fillJson.h:27
evf::evtn::GTPE_BCNRIN_MASK
const unsigned int GTPE_BCNRIN_MASK
Definition: GlobalEventNumber.h:65
evf::evtn::GTPE_TRIGNR_OFFSET
const unsigned int GTPE_TRIGNR_OFFSET
Definition: GlobalEventNumber.h:62
evf::evtn::SLINK_WORD_SIZE
const unsigned int SLINK_WORD_SIZE
Definition: GlobalEventNumber.h:11
evf::evtn::GTPE_BOARDID_SHIFT
const unsigned int GTPE_BOARDID_SHIFT
Definition: GlobalEventNumber.h:60
evf::evtn::gtpe_get
unsigned int gtpe_get(const unsigned char *)
Definition: GlobalEventNumber.cc:83
evf::evtn::GTPE_BOARDID_OFFSET
const unsigned int GTPE_BOARDID_OFFSET
Definition: GlobalEventNumber.h:58
evf::evtn::EVM_BOARDID_SHIFT
const unsigned int EVM_BOARDID_SHIFT
Definition: GlobalEventNumber.h:31
evf::evtn::EVM_FDL_BLOCK
const unsigned int EVM_FDL_BLOCK
Definition: GlobalEventNumber.h:51
evf::evtn::EVM_FDL_TECTRG_OFFSET
const unsigned int EVM_FDL_TECTRG_OFFSET
Definition: GlobalEventNumber.h:53
evf::evtn::getgpshigh
unsigned int getgpshigh(const unsigned char *)
Definition: GlobalEventNumber.cc:95
evf::evtn::EVM_GTFE_BLOCK_V0000
const unsigned int EVM_GTFE_BLOCK_V0000
Definition: GlobalEventNumber.h:34
findQualityFiles.size
size
Write out results.
Definition: findQualityFiles.py:443