ATLAS Offline Software
Loading...
Searching...
No Matches
MonitorDef.py
Go to the documentation of this file.
1# Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2
3"""
4The CTP monitors three different types of signals. In the XML file
5they are listed in the section <TriggerCounterList>
6
71) type CTPIN
8
9Almost each input threshold is monitored with one counter per
10multiplicity it can have. E.g. there are 7 counters for the EM10VH
11threshold: "1EM10VH" ... "7EM10VH"
12
13Due to limitations of the CTPIN monitoring LUT (there are only 4 LUT
14per CTPIN connector and a LUT has 8 bit input) only 2 3-bit thresholds
15can be monitored per LUT, so max 8 3-bit thresholds per
16connector. Hence JET thresholds 8 and 9 can not be monitored.
17
18
192) type CTPMON
20
21This allows to monitor any combination of conditions built in the same
22way as L1 Items. However, since we can also monitor L1 Items directly
23(see 3)), there is little need for this type of monitoring. We use it to monitor simple conditions
24
25
263) type TBP, TAP, TAV
27
28For each of these type 64 L1Items can be monitored independently
29Please take note that the bunch mask is not applied for the per-bunch monitoring, thus one item per threshold is sufficient
30
31"""
32
33from AthenaCommon.Logging import logging
34log = logging.getLogger(__name__)
35
36from ..Base.MonCounters import CtpinCounter, CtpmonCounter
37
39
40 LOW_FREQ = 0
41 HIGH_FREQ = 1
42
43
44 # CTPIN counters
45 # these are generated for all CTPIN signals except the two highest JET inputs on JET1 (see comment at start of file)
46 @staticmethod
47 def ctpinCounters( thresholds, connectors, ctpinConfig ):
48
49 connectedCables = []
50 for slotConnectors in ctpinConfig.values():
51 for connName in slotConnectors.values():
52 if connName:
53 connectedCables += [ connName ]
54
55 counters = []
56 for ctpinCableName in connectedCables:
57 conn = connectors[ctpinCableName]
58 for i, tl in enumerate(conn.triggerLines):
59 if ctpinCableName == "JET1" and i==8:
60 break
61 for mult in range(1, 2**tl.nbits):
62 counters += [ CtpinCounter(threshold=tl.name, multiplicity = mult) ]
63
64 return counters
65
66
67
68
69 # CTPMON counters
70 # we only have a few for the moment
71 @staticmethod
72 def ctpmonCounters( thresholds, connectors ):
73
74 counters = []
75
76 cThr = {}
77 cThr[1] = [
78 'AFP_NSA', 'AFP_NSC', 'AFP_FSA', 'AFP_FSC', 'AFP_FSA_TOF_T0', 'AFP_FSC_TOF_T0',
79 'AFP_FSA_TOF_T1', 'AFP_FSC_TOF_T1', 'AFP_FSA_TOF_T2', 'AFP_FSC_TOF_T2', 'AFP_FSA_TOF_T3', 'AFP_FSC_TOF_T3',
80 'MBTS_A0', 'MBTS_A1', 'MBTS_A2', 'MBTS_A3', 'MBTS_A4', 'MBTS_A5', 'MBTS_A6', 'MBTS_A7',
81 'MBTS_A8', 'MBTS_A9', 'MBTS_A10', 'MBTS_A11', 'MBTS_A12', 'MBTS_A13', 'MBTS_A14', 'MBTS_A15',
82 'MBTS_C0', 'MBTS_C1', 'MBTS_C2', 'MBTS_C3', 'MBTS_C4', 'MBTS_C5', 'MBTS_C6', 'MBTS_C7',
83 'MBTS_C8', 'MBTS_C9', 'MBTS_C10', 'MBTS_C11', 'MBTS_C12', 'MBTS_C13', 'MBTS_C14', 'MBTS_C15',
84 'BMA0', 'BMA1', 'BMA2', 'BMA3', "ZDC_0", "ZDC_1", "ZDC_2", "ZDC_ALT_0", "ZDC_ALT_1", "ZDC_ALT_2"
85 ]
86
87 for mult in cThr:
88 for thrName in cThr[mult]:
89 counters += [ CtpmonCounter(thrName,1) ]
90
91 return counters
92
93
94
95 @staticmethod
96 def applyItemCounter( menuName, items, menuFullName ):
97 """
98 this functions marks the items that should be monitored by setting the corresponding monitoring flags
99 e.g. to "LF:000|HF:111" for high frequency monitoring of TBP, TAP, and TAV.
100 """
101
102 TBP=1
103 TAP=2
104 TAV=4
105
106 monItems = { 1 :[], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [] }
107 monItemsHF = { 1 :[], 2: [], 3: [], 4: [], 5: [], 6: [], 7: [] }
108
109 # definitions hardcoded at the moment
110
111 if 'HI' not in menuName:
112 monItems[TBP|TAP|TAV] = [
113 # L1Muon
114 "L1_MU10BO", "L1_MU10BOM", "L1_MU12BOM", "L1_MU14FCH",
115 "L1_MU3V", "L1_MU4BOM", "L1_MU5VF", "L1_MU8VFC",
116 "L1_2MU3V", "L1_2MU3VF", "L1_2MU5VF",
117 "L1_MU5VF_2MU3V", "L1_MU8VF_2MU5VF",
118 "L1_3MU3V", "L1_MU5VF_3MU3VF", "L1_4MU3V",
119
121 "L1_eEM5", "L1_eEM9", "L1_eEM12L",
122 "L1_eEM18L", "L1_eEM18M", "L1_eEM24L",
123 "L1_eEM26", "L1_eEM26L", "L1_eEM26M", "L1_eEM26T",
124 "L1_eEM28M",
125 "L1_2eEM18M", "L1_2eEM24L",
126 "L1_eEM24L_3eEM12L", "L1_eEM40L_2eEM18L",
127 "L1_eTAU20M", "L1_eTAU30",
128 "L1_eTAU60", "L1_eTAU80",
129 "L1_jTAU20",
130 "L1_cTAU20M", "L1_cTAU35M",
131 "L1_cTAU30M_2cTAU20M",
132 "L1_jJ30", "L1_jJ40", "L1_jJ50",
133 "L1_jJ60", "L1_jJ125",
134 "L1_jJ160", "L1_jJ500",
135 "L1_jJ40p30ETA49", "L1_jJ50p30ETA49",
136 "L1_jJ60p30ETA49", "L1_jJ125p30ETA49",
137 "L1_4jJ40", "L1_4jJ50",
138 "L1_3jJ70p0ETA23", "L1_4jJ40p0ETA25", "L1_5jJ40p0ETA25",
139 "L1_jJ140_3jJ60", "L1_jJ85p0ETA21_3jJ40p0ETA25",
140 "L1_jXE60", "L1_jXE70", "L1_jXE80", "L1_jXE90", "L1_jXE100", "L1_eTAU12",
141 "L1_jXE110", "L1_jXE120", "L1_jXE500",
142 "L1_jXEC100",
143 "L1_jTE200",
144 "L1_jTEC200", "L1_jTEFWD100", "L1_jTEFWDA100", "L1_jTEFWDC100",
145 "L1_gJ20p0ETA25", "L1_gJ20p25ETA49", "L1_gJ50p0ETA25",
146 "L1_gJ100p0ETA25", "L1_gJ400p0ETA25",
147 "L1_gLJ80p0ETA25", "L1_gLJ100p0ETA25", "L1_gLJ140p0ETA25", "L1_gLJ160p0ETA25",
148 "L1_gXEJWOJ60", "L1_gXEJWOJ70", "L1_gXEJWOJ80", "L1_gXEJWOJ100", "L1_gXEJWOJ110", "L1_gXEJWOJ120", "L1_gXEJWOJ500",
149 "L1_cXE100", "L1_cXE110",
150 "L1_gTE200",
151 "L1_gMHT500",
152 # Combined
153 "L1_2eEM10L_MU8F", "L1_MU3V_jJ40",
154 # L1Topo (Topo2 always in)
155 "L1_LLPDPHI-jXE40-jJ40",
156 "L1_BPH-0M9-eEM9-eEM7_MU5VF",
157 "L1_BTAG-MU5VFjJ20_2jJ40p0ETA25_jJ50p0ETA25",
158 "L1_BPH-0M9-eEM9-eEM7", "L1_BPH-0M10-3MU3V", "L1_BPH-0M10-3MU3VF",
159 "L1_JPSI-1M5-eEM9", "L1_JPSI-1M5-eEM15",
160 "L1_BTAG-MU3VjJ40", "L1_BTAG-MU5VFjJ80",
161 "L1_cTAU30M_2cTAU20M_DR-eTAU30LeTAU20L",
162 "L1_jMJJ-700",
163 "L1_DY-BOX-2MU3VF", "L1_DY-BOX-MU5VFMU3V",
164 "L1_LAR-ZEE-eEM", "L1_LFV-MU5VF",
165 "L1_10DR-MU14FCH-MU5VF_EMPTY", "L1_DPHI-M70-2eEM12M",
166 ]
167
168 # Changed-in-place primary thresholds for Run 4
169 if 'HI' not in menuName:
170 if 'run3' in menuName:
171 monItems[TBP|TAP|TAV] += ["L1_eTAU140"]
172 monItems[TBP|TAP|TAV] += ["L1_3jJ90", "L1_jJ90", "L1_jJ90p30ETA49"]
173 else:
174 monItems[TBP|TAP|TAV] += ["L1_eTAU120"]
175 monItems[TBP|TAP|TAV] += ["L1_3jJ70", "L1_jJ70"]
176
177 topo3_monitems = [
178 "L1_HT190-jJ40s5pETA21", "L1_jMJJ-500-NFF",
179 "L1_LLP-RO-eEM", "L1_LLP-NOMATCH-eEM",
180 "L1_SC175-SCjJ10",
181 "L1_ZAFB-25DPHI-eEM18M",
182 "L1_jMJJ-300-NFF",
183 "L1_LFV-eEM10L-MU8VF", "L1_LFV-eEM15L-MU5VF",
184 ]
185 # Add triggers that are not in the MC menu
186 if 'MC' not in menuName:
187 monItems[TBP|TAP|TAV] += [
188 # Detector items
189 # "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_AND",
190 "L1_LUCID_A", "L1_LUCID_C",
191 "L1_CALREQ1", "L1_CALREQ2",
192 "L1_TGC_BURST",
193 "L1_TRT_FILLED",
194 "L1_BPTX0_BGRP12", "L1_BPTX1_BGRP12",
195 "L1_NSW_MONITOR",
196 #Background
197 "L1_BCM_Wide",
198 "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN",
199 #AFP
200 "L1_AFP_A_AND_C_TOF_T0T1",
201 "L1_AFP_FSA_BGRP12", "L1_AFP_FSC_BGRP12",
202 "L1_AFP_FSA_TOF_T0_BGRP12", "L1_AFP_FSA_TOF_T1_BGRP12",
203 "L1_AFP_FSC_TOF_T0_BGRP12", "L1_AFP_FSC_TOF_T1_BGRP12",
204 "L1_AFP_A_OR_C_EMPTY",
205 "L1_AFP_NSA_BGRP12", "L1_AFP_NSC_BGRP12",
206 "L1_AFP_A", "L1_AFP_C", "L1_AFP_A_AND_C",
207 "L1_MBTS_A", "L1_MBTS_C",
208 "L1_MBTS_1", "L1_MBTS_1_1", "L1_MBTS_2",
209 "L1_MBTS_1_A", "L1_MBTS_1_C", "L1_MBTS_4_A", "L1_MBTS_4_C",
210 "L1_ZeroBias",
211 "L1_AFP_A_AND_C_TOF_jJ50",
212 # Phase-I
213 "L1_AFP_A_AND_C_TOF_T0T1_jJ90",
214 "L1_jJ500_LAR",
215 # Other triggers disabled in MC
216 "L1_MU3VF", "L1_MU8F", "L1_MU8FC", "L1_MU8VF",
217 "L1_MU3VC", "L1_MU3EOF", "L1_MU4BO",
218 "L1_MU8FH", "L1_MU8EOF",
219 "L1_MU9VF", "L1_MU9VFC",
220 "L1_MU12FCH", "L1_MU14FCHR", "L1_MU14EOF",
221 "L1_MU15VFCH", "L1_MU15VFCHR",
222 "L1_MU18VFCH", "L1_MU20VFC",
223 "L1_2MU8F", "L1_2MU8VF",
224 "L1_2MU14FCH_OVERLAY",
225 #
226 "L1_jJ55", "L1_jJ80", "L1_jJ140", "L1_jJ180",
227 "L1_jJ30p0ETA25", "L1_jJ40p0ETA25",
228 "L1_jJ70p0ETA23", "L1_jJ55p0ETA23",
229 "L1_jJ80p0ETA25", "L1_jJ85p0ETA21",
230 "L1_jEM25", "L1_jEM20M",
231 #
232 "L1_eEM7", "L1_eEM10L", "L1_eEM15",
233 "L1_eEM18", "L1_eEM22M", "L1_eEM24VM",
234 "L1_3eEM12L",
235 #
236 "L1_eTAU20L", "L1_eTAU35", "L1_eTAU40HM",
237 ]
238
239 else: # HI L1 menu
240 monItems[TBP|TAP|TAV] = [
241 # Random
242 "L1_RD0_FILLED",
243 # Forward
244 # ZDC
245 "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C",
246 "L1_VZDC_A_VZDC_C",
247 "L1_ZDC_OR",
248 # LHCF
249 "L1_LHCF",
250 # MBTS
251 "L1_MBTS_2_2", "L1_MBTS_3_3", "L1_MBTS_4_4",
252 # LAr Zee
253 "L1_LAR-ZEE-eEM",
254 # Muons
255 "L1_MU3V", "L1_MU5VF",
256 "L1_MU8F", "L1_MU8VF",
257 "L1_MU14FCH",
258 "L1_2MU3V", "L1_2MU5VF",
259 "L1_3MU3V",
260 "L1_2MU14FCH_OVERLAY",
261 # Phase-I L1Calo
262 "L1_eEM5", "L1_eEM9", "L1_eEM12", "L1_eEM15",
263 "L1_eEM18", "L1_eEM18L",
264 "L1_eEM26", "L1_eEM26M",
265 "L1_2eEM18",
266 #
267 "L1_jJ20", "L1_jJ30", "L1_jJ40", "L1_jJ50",
268 "L1_jJ55", "L1_jJ60", "L1_jJ90", "L1_jJ125",
269 "L1_jJ500",
270 "L1_jJ40p30ETA49", "L1_jJ50p30ETA49", "L1_jJ60p30ETA49",
271 "L1_jJ90p30ETA49",
272 #
273 "L1_gJ20p0ETA25", "L1_gJ400p0ETA25",
274 #
275 "L1_gLJ80p0ETA25", "L1_gXEJWOJ100",
276 #
277 "L1_jTE200",
278 #
279 "L1_TRT_FILLED",
280 ]
281
282 # HI L1 menu: Add triggers that are not in the MC menu
283 if "MC" not in menuName:
284 monItems[TBP|TAP|TAV] += [
285 # Detector
286 "L1_CALREQ0", "L1_CALREQ1", "L1_CALREQ2",
287 "L1_BPTX0_BGRP12", "L1_BPTX1_BGRP12",
288 "L1_TGC_BURST",
289 "L1_ZeroBias",
290 "L1_jJ500_LAR",
291 # Background
292 "L1_BCM_Wide",
293 "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN",
294 # LUCID
295 "L1_LUCID_A", "L1_LUCID_C",
296 # MBTS
297 "L1_MBTS_A",
298 "L1_MBTS_C",
299 "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
300 ]
301
302 topo3_monitems = []
303
304 if "lowMu" in menuFullName:
305 monItems[TBP|TAP|TAV].extend([
306 # AFP
307 "L1_AFP_A_OR_C", "L1_AFP_A_AND_C",
308 # AFP combined
309 "L1_AFP_A_AND_C_TOF_T0T1_jJ125",
310 "L1_AFP_A_AND_C_TOF_T0T1_jJ50",
311 "L1_AFP_A_AND_C_TOF_T0T1_jJ60",
312 "L1_AFP_A_AND_C_TOF_T0T1_jJ90",
313 "L1_AFP_A_AND_C_TOF_jJ125",
314 "L1_AFP_A_AND_C_TOF_jJ50",
315 "L1_AFP_A_AND_C_TOF_jJ60",
316 "L1_AFP_A_AND_C_TOF_jJ90",
317 "L1_AFP_A_AND_C_jJ20",
318 "L1_AFP_A_AND_C_jJ30",
319 "L1_AFP_A_OR_C_jJ20",
320 "L1_AFP_A_OR_C_jJ30",
321 # ZDC
322 "L1_ZDC_A_AND_C",
323 # Mu+X
324 "L1_MU5VF_AFP_A_OR_C",
325 # Phase-I L1Calo
326 "L1_eEM9_AFP_A_AND_C", #"L1_eEM9_AFP_A_OR_C",
327 # ATR-31296 – Oxygen/Neon runs
328 "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", "L1_ZDC_OR", "L1_ZDC_XOR",
329 # "L1_ZDC_XNXN", "L1_ZDC_XNYN", "L1_ZDC_XNZN",
330 # L1_ZDC_XN_XOR", "L1_ZDC_YN_XOR", "L1_ZDC_ZN_XOR",
331 # "L1_ZDC_YN", "L1_ZDC_ZN", "L1_ZDC_LOR", "L1_ZDC_YNYN",
332 "L1_TRT_FILLED",
333 "L1_jTE5", "L1_jTE10", "L1_jTE20", "L1_jTE50",
334 "L1_jJ10", "L1_jJ20",
335 "L1_eEM5", "L1_eEM9",
336 ])
337
338 # lowMu HLT menu: Add triggers that are not in the MC menu
339 if "MC" not in menuName:
340 monItems[TBP|TAP|TAV].extend([
341 # Forward
342 # AFP
343 "L1_AFP_A", "L1_AFP_C",
344 # AFP Calib
345 "L1_AFP_FSA_BGRP12",
346 "L1_AFP_FSA_TOF_T0_BGRP12",
347 "L1_AFP_FSA_TOF_T1_BGRP12",
348 "L1_AFP_FSA_TOF_T2_BGRP12",
349 "L1_AFP_FSA_TOF_T3_BGRP12",
350 "L1_AFP_FSC_BGRP12",
351 "L1_AFP_FSC_TOF_T0_BGRP12",
352 "L1_AFP_FSC_TOF_T1_BGRP12",
353 "L1_AFP_FSC_TOF_T2_BGRP12",
354 "L1_AFP_FSC_TOF_T3_BGRP12",
355 "L1_AFP_NSA_BGRP12",
356 "L1_AFP_NSC_BGRP12",
357 # AFP combined
358 "L1_AFP_A_AND_C_TOF_T0T1",
359 ])
360
361 else: # HI HLT menu
362 monItems[TBP|TAP|TAV].extend([
363 # Forward
364 # ZDC
365 # Basic inputs
366 "L1_ZDC_XOR", "L1_ZDC_C_VZDC_A", "L1_ZDC_A_VZDC_C",
367 "L1_1ZDC_A_VZDC_C", "L1_VZDC_A_1ZDC_C",
368 "L1_1ZDC_A_1ZDC_C", "L1_5ZDC_A_VZDC_C", "L1_VZDC_A_5ZDC_C",
369 "L1_ZDC_1XOR5", "L1_5ZDC_A_5ZDC_C",
370 # Mu+X
371 "L1_MU3V_jJ40",
372 # Phase-I L1Calo
373 "L1_eEM1", "L1_eEM2",
374 "L1_eTAU1",
375 "L1_DPHI-2eEM1", "L1_DPHI-2eTAU1",
376 "L1_DPHI-2eEM1_VjTE200",
377 "L1_2eEM1_VjTE200", "L1_2eEM2_VjTE200",
378 "L1_eEM5_VjTE200", "L1_eEM9_VjTE200",
379 "L1_eEM1_jTE4_VjTE200", "L1_eEM2_jTE4_VjTE200", "L1_eTAU1_jTE4_VjTE200",
380 "L1_2eTAU1_VjTE200",
381 # "L1_eEM1_TRT_VjTE200", "L1_eTAU1_TRT_VjTE200",
382 # "L1_eEM1_TRT_ZDC_XOR_VjTE200", "L1_eTAU1_TRT_ZDC_XOR_VjTE200",
383 # "L1_eEM1_TRT_VZDC_A_VZDC_C_VjTE100", "L1_eTAU1_TRT_VZDC_A_VZDC_C_VjTE100",
384 # "L1_eEM1_TRT_ZDC_XOR4_VjTE100", "L1_eTAU1_TRT_ZDC_XOR4_VjTE100",
385 #
386 "L1_jJ5", "L1_jJ10",
387 "L1_jJ5p30ETA49","L1_jJ10p30ETA49",
388 #
389 "L1_jTE3", "L1_jTE4", "L1_jTE5", "L1_jTE10", "L1_jTE20", "L1_jTE50",
390 "L1_jTE100", "L1_jTE600", "L1_jTE1500", "L1_jTE6500", "L1_jTEFWD2600", "L1_jTEFWD5600", "L1_jTEFWD6300", "L1_jTEFWD6600",
391 "L1_jTE5_VjTE200",
392 #
393 "L1_VjTE10", "L1_VjTE200", "L1_VjTE600", "L1_jTE50_VjTE600",
394 #
395 "L1_GAP_A", "L1_GAP_C", "L1_GAP_AANDC",
396 #
397 "L1_MU3V_VjTE50", "L1_MU3V_VjTE200",
398 #
399 "L1_TRT_VjTE20", "L1_eEM1_TRT_VjTE100",
400 "L1_TRT_ZDC_XOR_VjTE200", "L1_TRT_1ZDC_NZDC_VjTE200",
401 #
402 "L1_ZDC_A_C_VjTE10", "L1_ZDC_XOR_VjTE10", "L1_TRT_ZDC_A_C_VjTE10", "L1_TRT_ZDC_XOR_VjTE10",
403 "L1_TRT_ZDC_A_VjTE50", "L1_TRT_ZDC_C_VjTE50",
404 #
405 "L1_MBTS_2_VZDC_A_ZDC_C_VjTE200_GAP_A", "L1_MBTS_2_1ZDC_NZDC_VjTE200_GAP_A",
406 "L1_MBTS_2_ZDC_A_VZDC_C_VjTE200_GAP_C", "L1_MBTS_2_1ZDC_NZDC_VjTE200_GAP_C",
407 "L1_MBTS_1_VZDC_A_ZDC_C_jTE3_VjTE200_GAP_A", "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200_GAP_A",
408 "L1_MBTS_1_ZDC_A_VZDC_C_jTE3_VjTE200_GAP_C", "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200_GAP_C",
409 #
410 "L1_1ZDC_A_1ZDC_C_VjTE200", "L1_ZDC_1XOR5_VjTE200",
411 "L1_ZDC_XOR_VjTE200",
412 #
413 "L1_ZDC_XOR_jJ10_VjTE200",
414 #
415 "L1_ZDC_HELT20_jTEFWD2600",
416 "L1_ZDC_HELT35_jTEFWD2600",
417 "L1_ZDC_HELT50_jTEFWD2600",
418 #
419 "L1_TEA_TeAsymmetry-jTENoSort",
420 "L1_TEA_eEM2",
421 "L1_TEA_eTAU2",
422 "L1_TEA_jJ5",
423 "L1_TEA_jJ5p30ETA49",
424 "L1_ESP_TeAsymmetry-jTENoSort",
425 "L1_ESP_eEM2",
426 "L1_ESP_eTAU2",
427 "L1_ESP_jJ5",
428 "L1_ESP_jJ5p30ETA49",
429 #
430 'L1_TeATIME-jTENoSort',
431 'L1_ESPRESSO',
432 'L1_TeAsymmetry-jTENoSort',
433 'L1_TeAsymmetry1-jTENoSort',
434 'L1_TeAsymmetry2-jTENoSort',
435 'L1_TeAsymmetry3-jTENoSort',
436
437 'L1_CALMTEA_eEM2',
438 'L1_CALMTEA_eTAU2',
439
440 'L1_CALMTEA_eEM2_VjTE200',
441 'L1_CALMTEA_eTAU2_VjTE200',
442
443 'L1_MATCHA_eTAU2',
444 'L1_MATCHA_eTAU2_VjTE200',
445 'L1_MATCHA_eTAU2_EMPTY',
446 'L1_MATCHA_eTAU2_VjTE200_EMPTY',
447
448 'L1_ESP_1ZDC_NZDC_jJ10_VjTE200',
449 'L1_ESP_5ZDC_A_5ZDC_C_jJ10_VjTE200',
450 'L1_ESP_VZDC_A_VZDC_C_jJ10_VjTE200',
451 'L1_ESP_VZDC_A_VZDC_C_jJ10p30ETA49_VjTE200',
452 'L1_ESP_VZDC_A_VZDC_C_jJ5p30ETA49_VjTE200',
453 'L1_ESP_ZDC_5XOR_jJ10_VjTE200',
454 'L1_ESP_ZDC_XOR_jJ10_VjTE200',
455 'L1_ESP_ZDC_XOR_jJ10p30ETA49_VjTE200',
456 'L1_ESP_ZDC_XOR_jJ5p30ETA49_VjTE200',
457
458 'L1_ESP_ASYM0_TRT_ZDC_XOR_VjTE200',
459 'L1_ESP_ASYM1_TRT_ZDC_XOR_VjTE200',
460 'L1_ESP_ASYM2_TRT_ZDC_XOR_VjTE200',
461 'L1_ESP_ASYM3_TRT_ZDC_XOR_VjTE200',
462
463 'L1_ESP_ASYM0_ZDC_XOR_VjTE200',
464 'L1_ESP_ASYM1_ZDC_XOR_VjTE200',
465 'L1_ESP_ASYM2_ZDC_XOR_VjTE200',
466 'L1_ESP_ASYM3_ZDC_XOR_VjTE200',
467
468 'L1_23INVM-27DPHI-2eTAU1_VjTE200',
469
470 'L1_CALMTEA_DPHI-2eTAU1_VjTE200',
471 'L1_CALMTEA_DPHI-2eTAU1_VjTE200_EMPTY',
472
473 'L1_CALMTEA_23INVM-27DPHI-2eTAU1_VjTE200',
474 'L1_CALMTEA_23INVM-27DPHI-2eTAU1_VjTE200_EMPTY',
475 ])
476
477 # HI HLT menu: Add triggers that are not in the MC menu
478 if "MC" not in menuName:
479 monItems[TBP|TAP|TAV].extend([
480 ])
481
482 monItems[TBP|TAP|TAV] += topo3_monitems
483
484
485 # if any of the HF items are changed CTP and OLC shall be informed (via TrigOps)
486 monItemsHF[TBP|TAP|TAV] = [
487 "L1_jJ30", # beam-induced background measurements
488 "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
489 "L1_BCM_Wide", # beam-induced background measurements
490 "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN" # beam-induced background measurements, used for SCT HV ramp
491 ]
492 # total number of items for HF monitoring doubled from 8 to 16 for HI and pp-ref
493 if "HI" in menuName:
494 monItemsHF[TBP|TAP|TAV].extend([
495 "L1_eEM15" # luminosity measurements
496 ])
497 if "lowMu" in menuFullName:
498 monItemsHF[TBP|TAP|TAV].extend([
499 # ATR-31296 – Oxygen/Neon runs
500 "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", "L1_ZDC_OR",
501 # "L1_ZDC_LOR", "L1_ZDC_XN_XOR", "L1_ZDC_YN_XOR", "L1_ZDC_ZN_XOR"
502 ])
503 else: # HI HLT menu
504 monItemsHF[TBP|TAP|TAV].extend([
505 "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", # luminosity measurements
506 "L1_ZDC_OR", "L1_ZDC_XOR", # luminosity measurements
507 "L1_ZDC_C_VZDC_A", "L1_ZDC_A_VZDC_C", "L1_5ZDC_A_5ZDC_C", # luminosity measurements
508 ])
509
510
511
512
513 check = True
514 if check:
515 counts_LF_items = { TBP : set(), TAP : set(), TAV : set() }
516 counts_HF_items = { TBP : set(), TAP : set(), TAV : set() }
517
518 for k in range(1,8):
519
520 if k & TBP:
521 counts_LF_items[TBP].update( monItems[k] )
522 counts_HF_items[TBP].update( monItemsHF[k] )
523
524 if k & TAP:
525 counts_LF_items[TAP].update( monItems[k] )
526 counts_HF_items[TAP].update( monItemsHF[k] )
527
528 if k & TAV:
529 counts_LF_items[TAV].update( monItems[k] )
530 counts_HF_items[TAV].update( monItemsHF[k] )
531
532 counts_LF = dict( map(lambda x : (x[0],len(x[1])), counts_LF_items.items() ) )
533 counts_HF = dict( map(lambda x : (x[0],len(x[1])), counts_HF_items.items() ) )
534
535 lutsLF = int( (max(counts_LF.values())-1) / 8) + 1
536 lutsHF = int( (max(counts_HF.values())-1) / 8) + 1
537
538 maxLUTs = 32
539 if lutsLF + lutsHF > maxLUTs:
540 log.error("too many monitoring items are defined:")
541 log.error(" low frequency TBP: %i",counts_LF[TBP])
542 log.error(" TAP: %i",counts_LF[TAP])
543 log.error(" TAV: %i",counts_LF[TAV])
544 log.error(" required LUTs: %i",lutsLF)
545 log.error(" high frequency TBP: %i",counts_HF[TBP])
546 log.error(" TAP: %i",counts_HF[TAP])
547 log.error(" TAV: %i",counts_HF[TAV])
548 log.error(" required LUTs: %i",lutsHF)
549 log.error(" this menu requires %i monitoring LUTs while only %i are available", (lutsLF + lutsHF), maxLUTs)
550 raise RuntimeError("Reduce the number of monitored items")
551
552 if 'AllCTPIn' not in menuName:
553 MonitorDef.checkForNonExistingMonItems(items, monItems)
554
555 # for each item set the monitor flags
556 for item in items:
557
558 itemName = item.name
559 for k,l in monItems.items():
560
561 if itemName in l:
562 item.addMonitor(k, MonitorDef.LOW_FREQ)
563
564
565 for k,l in monItemsHF.items():
566
567 if itemName in l:
568 item.addMonitor(k, MonitorDef.HIGH_FREQ)
569
570
571 @staticmethod
572 def checkForNonExistingMonItems(items, monItems):
573 # check is based on item names
574 allItemNames = [item.name for item in items]
575
576 # unify all item names that are monitored
577 allMonitorItems = set()
578 for i in range(1,8):
579 allMonitorItems.update(monItems[i])
580
581 # register all monitems that don't exist in here
582 nonExistingMonItems = []
583
584 for monItem in allMonitorItems:
585 if monItem not in allItemNames:
586 nonExistingMonItems += [monItem]
587
588 if len(nonExistingMonItems)>0:
589 raise RuntimeError("These monitoring items are not part of the menu: %s" % ','.join(nonExistingMonItems))
#define max(a, b)
Definition cfImp.cxx:41
STL class.
applyItemCounter(menuName, items, menuFullName)
Definition MonitorDef.py:96
ctpinCounters(thresholds, connectors, ctpinConfig)
Definition MonitorDef.py:47
ctpmonCounters(thresholds, connectors)
Definition MonitorDef.py:72
STL class.