ATLAS Offline Software
MuCTPI_Bits.h
Go to the documentation of this file.
1 // Dear emacs, this is -*- c++ -*-
2 
3 /*
4  Copyright (C) 2002-2022 CERN for the benefit of the ATLAS collaboration
5 */
6 
7 #ifndef TRIGT1MUCTPIBITS_MUCTPI_BITS_H
8 #define TRIGT1MUCTPIBITS_MUCTPI_BITS_H
9 
10 #include <cstdint>
11 
12 namespace LVL1::MuCTPIBits {
14  static constexpr uint32_t MULT_VAL = 7;
16  static constexpr uint32_t MULT_BITS = 3;
18  static constexpr uint32_t RUN3_MULT_THRESH_NUM = 32;
19  static constexpr uint32_t MULT_THRESH_NUM = 6;
21  static constexpr uint32_t RUN3_MULT_BCID_POS = 26;
22  static constexpr uint32_t MULT_BCID_POS = 7;
23 
25  static constexpr uint32_t CAND_OVERFLOW_MASK = 0x1;
27  static constexpr uint32_t RUN3_CAND_OVERFLOW_SHIFT = 17;
28  static constexpr uint32_t CAND_OVERFLOW_SHIFT = 0;
29 
31  static constexpr uint32_t ROI_OVERFLOW_MASK = 0x1;
33  static constexpr uint32_t RUN3_ROI_OVERFLOW_SHIFT = 12;
34  static constexpr uint32_t ROI_OVERFLOW_SHIFT = 1;
35 
37  static constexpr uint32_t ROI_MASK = 0xff;
38  static constexpr uint32_t BARREL_ROI_MASK = 0x1f;
41  static constexpr uint32_t ENDCAP_ROI_MASK = 0xff;
43  static constexpr uint32_t FORWARD_ROI_MASK = 0x3f;
45  static constexpr uint32_t RUN3_ROI_SHIFT = 0;
46  static constexpr uint32_t ROI_SHIFT = 2;
47 
48  //===== Need to double check that the run3 positions are correct for the OL flags=====
50  static constexpr uint32_t BARREL_OL_MASK = 0x3;
51  static constexpr uint32_t BARREL_PHI_OL_MASK = 0x1;
52  static constexpr uint32_t BARREL_ETA_OL_MASK = 0x2;
54  static constexpr uint32_t BARREL_OL_SHIFT = 9;
56  static constexpr uint32_t ENDCAP_OL_MASK = 0x1;
58  //static constexpr uint32_t RUN3_ENDCAP_OL_SHIFT = 8; // 10-2 = 8 // not used in run3 format
59  static constexpr uint32_t ENDCAP_OL_SHIFT = 10;
60 
62  static constexpr uint32_t RUN3_CAND_PT_MASK = 0xf;
63  static constexpr uint32_t CAND_PT_MASK = 0x7;
65  static constexpr uint32_t RUN3_CAND_PT_SHIFT = 8;
66  static constexpr uint32_t CAND_PT_SHIFT = 11;
67 
69  //These aren't part of the LVL2 word in run 2, but part of the DAQ word
71  static constexpr uint32_t CAND_BCID_MASK = 0x7;
73  static constexpr uint32_t CAND_BCID_SHIFT = 14;
74 
77  static constexpr uint32_t RUN3_CAND_SECTOR_ADDRESS_MASK = 0xff;
78  static constexpr uint32_t CAND_SECTOR_ADDRESS_MASK = 0xff;
80  static constexpr uint32_t SECTOR_HEMISPHERE_MASK = 0x1;
82  static constexpr uint32_t RUN3_CAND_SECTOR_ADDRESS_SHIFT = 21;
83  static constexpr uint32_t CAND_SECTOR_ADDRESS_SHIFT = 14;//17; 17 is for the DAQ word, not LVL2
84 
85  //====The shift doesn't correspond to the mask here (the mask corresponds to the SECTOR_ADDRESS_SHIFT above) ===
87  static constexpr uint32_t ENDCAP_ADDRESS_MASK = 0x80;
89  static constexpr uint32_t FORWARD_ADDRESS_MASK = 0x40;
91  static constexpr uint32_t SUBSYS_ADDRESS_MASK = 0xc0;
93  static constexpr uint32_t RUN3_SUBSYS_ADDRESS_SHIFT = 27;
94  static constexpr uint32_t SUBSYS_ADDRESS_SHIFT = 20;
96  static constexpr uint32_t RUN3_SUBSYS_ADDRESS_BAFW_SHIFT = 27;
97  static constexpr uint32_t RUN3_SUBSYS_ADDRESS_BAFW_MASK = 0b11;
98  static constexpr uint32_t RUN3_SUBSYS_ADDRESS_BA_VAL = 0b00;
99  static constexpr uint32_t RUN3_SUBSYS_ADDRESS_FW_VAL = 0b01;
100  static constexpr uint32_t RUN3_SUBSYS_ADDRESS_EC_SHIFT = 28;
101  static constexpr uint32_t RUN3_SUBSYS_ADDRESS_EC_MASK = 0b1;
102  static constexpr uint32_t RUN3_SUBSYS_ADDRESS_EC_VAL = 0b1;
103  static constexpr uint32_t RUN3_SUBSYS_HEMISPHERE_SHIFT = 21;
104  static constexpr uint32_t RUN3_SUBSYS_HEMISPHERE_MASK = 0b1;
105 
107  static constexpr uint32_t ENDCAP_SECTORID_MASK = 0x3f;
109  static constexpr uint32_t FORWARD_SECTORID_MASK = 0x1f;
111  static constexpr uint32_t BARREL_SECTORID_MASK = 0x1f;
113  static constexpr uint32_t RUN3_CAND_SECTORID_MASK = 0x7f;
114  static constexpr uint32_t RUN3_CAND_SECTORID_SHIFT = 22;
115  static constexpr uint32_t CAND_SECTORID_SHIFT = 15;
116 
119  static constexpr uint32_t CAND_HIGHEST_PT_MASK = 0x1;
121  static constexpr uint32_t CAND_HIGHEST_PT_SHIFT = 22;
122 
124  //These aren't part of the LVL2 word in run 2, but part of the DAQ word
126  static constexpr uint32_t CAND_SENT_ROI_MASK = 0x1;
128  static constexpr uint32_t CAND_SENT_ROI_SHIFT = 26;
129 
131  static constexpr uint32_t MULT_WORD_FLAG_SHIFT = 29;
132 
134  static constexpr uint32_t RUN3_CAND_TGC_CHARGE_SIGN_SHIFT = 12;
135  static constexpr uint32_t CAND_TGC_CHARGE_SIGN_SHIFT = 27;
137  static constexpr uint32_t RUN3_CAND_TGC_BW2OR3_SHIFT = 13;
139  static constexpr uint32_t RUN3_CAND_TGC_INNERCOIN_SHIFT = 14;
141  static constexpr uint32_t RUN3_CAND_TGC_GOODMF_SHIFT = 15;
142 
144  static constexpr uint32_t RUN3_CAND_VETO_SHIFT = 16;
145  static constexpr uint32_t CAND_VETO_SHIFT = 28;
146 
147  // Timeslice and multiplicity words
148  static constexpr uint32_t RUN3_TIMESLICE_MULT_WORD_ID_SHIFT = 30;
149  static constexpr uint32_t RUN3_TIMESLICE_MULT_WORD_ID_MASK = 0b11;
150  static constexpr uint32_t RUN3_TIMESLICE_MULT_WORD_ID_VAL = 0b10;
151  static constexpr uint32_t RUN3_TIMESLICE_MULT_WORD_NUM_SHIFT = 28;
152  static constexpr uint32_t RUN3_TIMESLICE_MULT_WORD_NUM_MASK = 0b11;
153  static constexpr uint32_t RUN3_TIMESLICE_WORD_NUM_VAL = 0b00; // Timeslice word is 0, multiplicity words are 1, 2, 3
154  static constexpr uint32_t RUN3_TIMESLICE_BCID_SHIFT = 16;
155  static constexpr uint32_t RUN3_TIMESLICE_BCID_MASK = 0xfff;
156  static constexpr uint32_t RUN3_TIMESLICE_NTOB_SHIFT = 10;
157  static constexpr uint32_t RUN3_TIMESLICE_NTOB_MASK = 0x3f;
158  static constexpr uint32_t RUN3_TIMESLICE_NCAND_SHIFT = 0;
159  static constexpr uint32_t RUN3_TIMESLICE_NCAND_MASK = 0x3ff;
160  static constexpr uint32_t RUN3_NSW_MONITORING_TRIGGER_SHIFT = 0x8;
161  static constexpr uint32_t RUN3_NSW_MONITORING_TRIGGER_MASK = 0b1;
162  static constexpr uint32_t RUN3_MULTIPLICITY_OVERFLOW_SHIFT = 0x9;
163  static constexpr uint32_t RUN3_MULTIPLICITY_OVERFLOW_MASK = 0b1;
164  static constexpr uint32_t RUN3_MULTIPLICITY_TRIGBITS_SHIFT = 0xa;
165  static constexpr uint32_t RUN3_MULTIPLICITY_TRIGBITS_MASK = 0x3ffff;
166 
167  // Multiplicity word encoding (split 64-bit word into 28+28+8)
168  static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART1_SHIFT = 0;
169  static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART1_MASK = 0xffffff;
170  static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART2_SHIFT = 28;
171  static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART2_MASK = 0xffffff;
172  static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART3_SHIFT = 56;
173  static constexpr uint32_t RUN3_MULTIPLICITY_ENC_PART3_MASK = 0xff;
174  // Multiplicity word decoding (28+28+8 into 64-bit word)
175  static constexpr uint32_t RUN3_MULTIPLICITY_PART1_SHIFT = 0;
176  static constexpr uint32_t RUN3_MULTIPLICITY_PART1_MASK = 0xfffffff;
177  static constexpr uint32_t RUN3_MULTIPLICITY_PART2_SHIFT = 0;
178  static constexpr uint32_t RUN3_MULTIPLICITY_PART2_MASK = 0xfffffff;
179  static constexpr uint32_t RUN3_MULTIPLICITY_PART3_SHIFT = 0;
180  static constexpr uint32_t RUN3_MULTIPLICITY_PART3_MASK = 0xff;
181 
182  // Candidate words
183  static constexpr uint32_t RUN3_CAND_WORD_ID_SHIFT = 31;
184  static constexpr uint32_t RUN3_CAND_WORD_ID_MASK = 0b1;
185  static constexpr uint32_t RUN3_CAND_WORD_ID_VAL = 0b0;
186  static constexpr uint32_t RUN3_CAND_WORD_SECTORERRORFLAG_SHIFT = 29;
187  static constexpr uint32_t RUN3_CAND_WORD_SECTORERRORFLAG_MASK = 0x1;
188  static constexpr uint32_t RUN3_CAND_WORD_SLID_SHIFT = 21;
189  static constexpr uint32_t RUN3_CAND_WORD_SLID_MASK = 0xff;
190  static constexpr uint32_t RUN3_CAND_WORD_SECTORFLAGS_GTN_SHIFT = 17;
191  static constexpr uint32_t RUN3_CAND_WORD_SECTORFLAGS_GTN_MASK = 0x1;
192  static constexpr uint32_t RUN3_CAND_WORD_VETO_SHIFT = 16;
193  static constexpr uint32_t RUN3_CAND_WORD_VETO_MASK = 0x1;
194  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_SHIFT = 12;
195  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_MASK = 0xf;
196  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_R_SHIFT = 2;
197  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_EC_R_MASK = 0x3f;
198  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_FW_R_MASK = 0xf;
199  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_PHI_SHIFT = 0;
200  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_PHI_MASK = 0x3;
201  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_BA_PHIOVERLAP_SHIFT = 13;
202  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_BA_PHIOVERLAP_MASK = 0x1;
203  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_NSWMON_SHIFT = 18;
204  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_NSWMON_MASK = 0x1;
205  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_BA_GT1ROI_SHIFT = 12;
206  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_BA_GT1ROI_MASK = 0x1;
207  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_GOODMF_SHIFT = 15;
208  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_GOODMF_MASK = 0x1;
209  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_INNERCOIN_SHIFT = 14;
210  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_INNERCOIN_MASK = 0x1;
211  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_BW23_SHIFT = 13;
212  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_BW23_MASK = 0x1;
213  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_CHARGE_SHIFT = 12;
214  static constexpr uint32_t RUN3_CAND_WORD_CANDFLAGS_ECFW_CHARGE_MASK = 0x1;
215  static constexpr uint32_t RUN3_CAND_WORD_PT_SHIFT = 8;
216  static constexpr uint32_t RUN3_CAND_WORD_PT_MASK = 0xf;
217  static constexpr uint32_t RUN3_CAND_WORD_ROI_SHIFT = 0;
218  static constexpr uint32_t RUN3_CAND_WORD_ROI_MASK = 0xff;
219 
220  // Topo TOB words
221  static constexpr uint32_t RUN3_TOPO_WORD_ID_SHIFT = 29;
222  static constexpr uint32_t RUN3_TOPO_WORD_ID_MASK = 0b111;
223  static constexpr uint32_t RUN3_TOPO_WORD_ID_VAL = 0b110;
224  static constexpr uint32_t RUN3_TOPO_WORD_HEMI_SHIFT = 24;
225  static constexpr uint32_t RUN3_TOPO_WORD_HEMI_MASK = 0x1;
226  static constexpr uint32_t RUN3_TOPO_WORD_FLAGS_SHIFT = 20;
227  static constexpr uint32_t RUN3_TOPO_WORD_FLAGS_MASK = 0xf;
228  static constexpr uint32_t RUN3_TOPO_WORD_PT_SHIFT = 16;
229  static constexpr uint32_t RUN3_TOPO_WORD_PT_MASK = 0xf;
230  static constexpr uint32_t RUN3_TOPO_WORD_ETA_SHIFT = 8;
231  static constexpr uint32_t RUN3_TOPO_WORD_ETA_MASK = 0xff;
232  static constexpr uint32_t RUN3_TOPO_WORD_PHI_SHIFT = 0;
233  static constexpr uint32_t RUN3_TOPO_WORD_PHI_MASK = 0xff;
234  static constexpr uint32_t RUN3_TOPO_WORD_DET_SHIFT = 13;
235  static constexpr uint32_t RUN3_TOPO_WORD_DET_MASK = 0x3;
236  static constexpr uint32_t RUN3_TOPO_WORD_CANDFLAGS_ECFW_CHARGE_SHIFT = 20;
237  static constexpr uint32_t RUN3_TOPO_WORD_CANDFLAGS_ECFW_BW23_SHIFT = 21;
238  static constexpr uint32_t RUN3_TOPO_WORD_CANDFLAGS_ECFW_INNERCOIN_SHIFT = 22;
239  static constexpr uint32_t RUN3_TOPO_WORD_CANDFLAGS_ECFW_GOODMF_SHIFT = 23;
240  static constexpr uint32_t RUN3_TOPO_WORD_CANDFLAGS_ECFW_CHARGE_MASK = 0x1;
241  static constexpr uint32_t RUN3_TOPO_WORD_CANDFLAGS_ECFW_BW23_MASK = 0x1;
242  static constexpr uint32_t RUN3_TOPO_WORD_CANDFLAGS_ECFW_INNERCOIN_MASK = 0x1;
243  static constexpr uint32_t RUN3_TOPO_WORD_CANDFLAGS_ECFW_GOODMF_MASK = 0x1;
244 
245  // ROD status word
246  static constexpr uint32_t RUN3_STATUS_WORD_ID_SHIFT = 29;
247  static constexpr uint32_t RUN3_STATUS_WORD_ID_MASK = 0b111;
248  static constexpr uint32_t RUN3_STATUS_WORD_ID_VAL = 0b111;
249  static constexpr uint32_t RUN3_STATUS_WORD_SHIFT = 0;
250  static constexpr uint32_t RUN3_STATUS_WORD_MASK = 0xffff;
251 
252 } // namespace LVL1::MuCTPIBits
253 
254 #endif // TRIGT1MUCTPIBITS_MUCTPI_BITS_H
xAOD::uint32_t
setEventNumber uint32_t
Definition: EventInfo_v1.cxx:127
LVL1::MuCTPIBits
Definition: HelpersPhase1.h:14