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",
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_gXENC100", "L1_gXENC110",
150 "L1_cXE100", "L1_cXE110",
151 "L1_gTE200",
152 "L1_gMHT500",
153 # Combined
154 "L1_2eEM10L_MU8F", "L1_MU3V_jJ40",
155 # L1Topo (Topo2 always in)
156 "L1_LLPDPHI-jXE40-jJ40",
157 "L1_BPH-0M9-eEM9-eEM7_MU5VF",
158 "L1_BTAG-MU5VFjJ20_2jJ40p0ETA25_jJ50p0ETA25",
159 "L1_BPH-0M9-eEM9-eEM7", "L1_BPH-0M10-3MU3V", "L1_BPH-0M10-3MU3VF",
160 "L1_JPSI-1M5-eEM9", "L1_JPSI-1M5-eEM15",
161 "L1_BTAG-MU3VjJ40", "L1_BTAG-MU5VFjJ80",
162 "L1_cTAU30M_2cTAU20M_DR-eTAU30LeTAU20L",
163 "L1_jMJJ-700",
164 "L1_DY-BOX-2MU3VF", "L1_DY-BOX-MU5VFMU3V",
165 "L1_LAR-ZEE-eEM", "L1_LFV-MU5VF",
166 "L1_10DR-MU14FCH-MU5VF_EMPTY", "L1_DPHI-M70-2eEM12M",
167 ]
168
169 # Changed-in-place primary thresholds for Run 4
170 if 'HI' not in menuName:
171 if 'run3' in menuName:
172 monItems[TBP|TAP|TAV] += ["L1_eTAU140"]
173 monItems[TBP|TAP|TAV] += ["L1_3jJ90", "L1_jJ90", "L1_jJ90p30ETA49"]
174 else:
175 monItems[TBP|TAP|TAV] += ["L1_eTAU120"]
176 monItems[TBP|TAP|TAV] += ["L1_3jJ70", "L1_jJ70"]
177
178 topo3_monitems = [
179 "L1_HT190-jJ40s5pETA21", "L1_jMJJ-500-NFF",
180 "L1_LLP-RO-eEM", "L1_LLP-NOMATCH-eEM",
181 "L1_SC175-SCjJ10",
182 "L1_ZAFB-25DPHI-eEM18M",
183 "L1_jMJJ-300-NFF",
184 "L1_LFV-eEM10L-MU8VF", "L1_LFV-eEM15L-MU5VF",
185 ]
186 # Add triggers that are not in the MC menu
187 if 'MC' not in menuName:
188 monItems[TBP|TAP|TAV] += [
189 # Detector items
190 # "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_AND",
191 "L1_LUCID_A", "L1_LUCID_C",
192 "L1_CALREQ1", "L1_CALREQ2",
193 "L1_TGC_BURST",
194 "L1_TRT_FILLED",
195 "L1_BPTX0_BGRP12", "L1_BPTX1_BGRP12",
196 "L1_NSW_MONITOR",
197 #Background
198 "L1_BCM_Wide",
199 "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN",
200 #AFP
201 "L1_AFP_A_AND_C_TOF_T0T1",
202 "L1_AFP_FSA_BGRP12", "L1_AFP_FSC_BGRP12",
203 "L1_AFP_FSA_TOF_T0_BGRP12", "L1_AFP_FSA_TOF_T1_BGRP12",
204 "L1_AFP_FSC_TOF_T0_BGRP12", "L1_AFP_FSC_TOF_T1_BGRP12",
205 "L1_AFP_A_OR_C_EMPTY",
206 "L1_AFP_NSA_BGRP12", "L1_AFP_NSC_BGRP12",
207 "L1_AFP_A", "L1_AFP_C", "L1_AFP_A_AND_C",
208 "L1_MBTS_A", "L1_MBTS_C",
209 "L1_MBTS_1", "L1_MBTS_1_1", "L1_MBTS_2",
210 "L1_MBTS_1_A", "L1_MBTS_1_C", "L1_MBTS_4_A", "L1_MBTS_4_C",
211 "L1_ZeroBias",
212 "L1_AFP_A_AND_C_TOF_jJ50",
213 # Phase-I
214 "L1_AFP_A_AND_C_TOF_T0T1_jJ90",
215 "L1_jJ500_LAR",
216 # Other triggers disabled in MC
217 "L1_MU3VF", "L1_MU8F", "L1_MU8FC", "L1_MU8VF",
218 "L1_MU3VC", "L1_MU3EOF", "L1_MU4BO",
219 "L1_MU8FH", "L1_MU8EOF",
220 "L1_MU9VF", "L1_MU9VFC",
221 "L1_MU12FCH", "L1_MU14FCHR", "L1_MU14EOF",
222 "L1_MU15VFCH", "L1_MU15VFCHR",
223 "L1_MU18VFCH", "L1_MU20VFC",
224 "L1_2MU8F", "L1_2MU8VF",
225 "L1_2MU14FCH_OVERLAY",
226 #
227 "L1_jJ55", "L1_jJ80", "L1_jJ140", "L1_jJ180",
228 "L1_jJ30p0ETA25", "L1_jJ40p0ETA25",
229 "L1_jJ70p0ETA23", "L1_jJ55p0ETA23",
230 "L1_jJ80p0ETA25", "L1_jJ85p0ETA21",
231 "L1_jEM25", "L1_jEM20M",
232 #
233 "L1_eEM7", "L1_eEM10L", "L1_eEM15",
234 "L1_eEM18", "L1_eEM22M", "L1_eEM24VM",
235 "L1_3eEM12L",
236 #
237 "L1_eTAU20L", "L1_eTAU35", "L1_eTAU40HM",
238 #
239 # AD monitoring - ATR-32397
240 "L1_ADVAET", "L1_ADVAEL", "L1_ADBDTT", "L1_ADBDTL",
241 "L1_ARTEMISL", "L1_ARTEMIST",
242 #
243 # splash items
244 "L1_eEM22A", "L1_eEM22C",
245 ]
246
247 else: # HI L1 menu
248 monItems[TBP|TAP|TAV] = [
249 # Random
250 "L1_RD0_FILLED",
251 # Forward
252 # ZDC
253 "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C",
254 "L1_VZDC_A_VZDC_C",
255 "L1_ZDC_OR",
256 # LHCF
257 "L1_LHCF",
258 # MBTS
259 "L1_MBTS_2_2", "L1_MBTS_3_3", "L1_MBTS_4_4",
260 # LAr Zee
261 "L1_LAR-ZEE-eEM",
262 # Muons
263 "L1_MU3V", "L1_MU5VF",
264 "L1_MU8F", "L1_MU8VF",
265 "L1_MU14FCH",
266 "L1_2MU3V", "L1_2MU5VF",
267 "L1_3MU3V",
268 "L1_2MU14FCH_OVERLAY",
269 # Phase-I L1Calo
270 "L1_eEM5", "L1_eEM9", "L1_eEM12", "L1_eEM15",
271 "L1_eEM18", "L1_eEM18L",
272 "L1_eEM26", "L1_eEM26M",
273 "L1_2eEM18",
274 #
275 "L1_jJ20", "L1_jJ30", "L1_jJ40", "L1_jJ50",
276 "L1_jJ55", "L1_jJ60", "L1_jJ90", "L1_jJ125",
277 "L1_jJ500",
278 "L1_jJ40p30ETA49", "L1_jJ50p30ETA49", "L1_jJ60p30ETA49",
279 "L1_jJ90p30ETA49",
280 #
281 "L1_gJ20p0ETA25", "L1_gJ400p0ETA25",
282 #
283 "L1_gLJ80p0ETA25", "L1_gXEJWOJ100",
284 #
285 "L1_jTE200",
286 #
287 "L1_TRT_FILLED",
288 ]
289
290 # HI L1 menu: Add triggers that are not in the MC menu
291 if "MC" not in menuName:
292 monItems[TBP|TAP|TAV] += [
293 # Detector
294 "L1_CALREQ0", "L1_CALREQ1", "L1_CALREQ2",
295 "L1_BPTX0_BGRP12", "L1_BPTX1_BGRP12",
296 "L1_TGC_BURST",
297 "L1_ZeroBias",
298 "L1_jJ500_LAR",
299 # Background
300 "L1_BCM_Wide",
301 "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN",
302 # LUCID
303 "L1_LUCID_A", "L1_LUCID_C",
304 # MBTS
305 "L1_MBTS_A",
306 "L1_MBTS_C",
307 "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
308 ]
309
310 topo3_monitems = []
311
312 if "lowMu" in menuFullName:
313 monItems[TBP|TAP|TAV].extend([
314 # AFP
315 "L1_AFP_A_OR_C", "L1_AFP_A_AND_C",
316 # AFP combined
317 "L1_AFP_A_AND_C_TOF_T0T1_jJ125",
318 "L1_AFP_A_AND_C_TOF_T0T1_jJ50",
319 "L1_AFP_A_AND_C_TOF_T0T1_jJ60",
320 "L1_AFP_A_AND_C_TOF_T0T1_jJ90",
321 "L1_AFP_A_AND_C_TOF_jJ125",
322 "L1_AFP_A_AND_C_TOF_jJ50",
323 "L1_AFP_A_AND_C_TOF_jJ60",
324 "L1_AFP_A_AND_C_TOF_jJ90",
325 "L1_AFP_A_AND_C_jJ20",
326 "L1_AFP_A_AND_C_jJ30",
327 "L1_AFP_A_OR_C_jJ20",
328 "L1_AFP_A_OR_C_jJ30",
329 # ZDC
330 "L1_ZDC_A_AND_C",
331 # Mu+X
332 "L1_MU5VF_AFP_A_OR_C",
333 # Phase-I L1Calo
334 "L1_eEM9_AFP_A_AND_C", #"L1_eEM9_AFP_A_OR_C",
335 # ATR-31296 – Oxygen/Neon runs
336 "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", "L1_ZDC_OR", "L1_ZDC_XOR",
337 # "L1_ZDC_XNXN", "L1_ZDC_XNYN", "L1_ZDC_XNZN",
338 # L1_ZDC_XN_XOR", "L1_ZDC_YN_XOR", "L1_ZDC_ZN_XOR",
339 # "L1_ZDC_YN", "L1_ZDC_ZN", "L1_ZDC_LOR", "L1_ZDC_YNYN",
340 "L1_TRT_FILLED",
341 "L1_jTE5", "L1_jTE10", "L1_jTE20", "L1_jTE50",
342 "L1_jJ10", "L1_jJ20",
343 "L1_eEM5", "L1_eEM9",
344 "L1_ARTEMISL", "L1_ARTEMIST",
345 ])
346
347 # lowMu HLT menu: Add triggers that are not in the MC menu
348 if "MC" not in menuName:
349 monItems[TBP|TAP|TAV].extend([
350 # Forward
351 # AFP
352 "L1_AFP_A", "L1_AFP_C",
353 # AFP Calib
354 "L1_AFP_FSA_BGRP12",
355 "L1_AFP_FSA_TOF_T0_BGRP12",
356 "L1_AFP_FSA_TOF_T1_BGRP12",
357 "L1_AFP_FSA_TOF_T2_BGRP12",
358 "L1_AFP_FSA_TOF_T3_BGRP12",
359 "L1_AFP_FSC_BGRP12",
360 "L1_AFP_FSC_TOF_T0_BGRP12",
361 "L1_AFP_FSC_TOF_T1_BGRP12",
362 "L1_AFP_FSC_TOF_T2_BGRP12",
363 "L1_AFP_FSC_TOF_T3_BGRP12",
364 "L1_AFP_NSA_BGRP12",
365 "L1_AFP_NSC_BGRP12",
366 # AFP combined
367 "L1_AFP_A_AND_C_TOF_T0T1",
368 ])
369
370 else: # HI HLT menu
371 monItems[TBP|TAP|TAV].extend([
372 # Forward
373 # ZDC
374 # Basic inputs
375 "L1_ZDC_XOR", "L1_ZDC_C_VZDC_A", "L1_ZDC_A_VZDC_C",
376 "L1_1ZDC_A_VZDC_C", "L1_VZDC_A_1ZDC_C",
377 "L1_1ZDC_A_1ZDC_C", "L1_ZDC_1XOR5",
378 "L1_5ZDC_A_5ZDC_C",
379 # Mu+X
380 "L1_MU3V_jJ40",
381 # Phase-I L1Calo
382 "L1_eEM1", "L1_eEM2",
383 "L1_eTAU1",
384 "L1_DPHI-2eEM1", "L1_DPHI-2eTAU1",
385 "L1_DPHI-2eEM1_VjTE200",
386 "L1_2eEM1_VjTE200", "L1_2eEM2_VjTE200",
387 "L1_eEM5_VjTE200", "L1_eEM9_VjTE200",
388 "L1_eEM1_jTE4_VjTE200", "L1_eEM2_jTE4_VjTE200", "L1_eTAU1_jTE4_VjTE200",
389 "L1_2eTAU1_VjTE200",
390 # "L1_eEM1_TRT_VjTE200", "L1_eTAU1_TRT_VjTE200",
391 # "L1_eEM1_TRT_ZDC_XOR_VjTE200", "L1_eTAU1_TRT_ZDC_XOR_VjTE200",
392 # "L1_eEM1_TRT_VZDC_A_VZDC_C_VjTE100", "L1_eTAU1_TRT_VZDC_A_VZDC_C_VjTE100",
393 # "L1_eEM1_TRT_ZDC_XOR4_VjTE100", "L1_eTAU1_TRT_ZDC_XOR4_VjTE100",
394 #
395 "L1_jJ5", "L1_jJ10",
396 "L1_jJ5p30ETA49","L1_jJ10p30ETA49",
397 #
398 "L1_jTE3", "L1_jTE4", "L1_jTE5", "L1_jTE10", "L1_jTE20", "L1_jTE50",
399 "L1_jTE100", "L1_jTE600", "L1_jTE1500", "L1_jTE6500",
400 # temporarily commented out to make room for items needed for lowMu HLT menu
401 # "L1_jTEFWD2600", "L1_jTEFWD5600", "L1_jTEFWD6300", "L1_jTEFWD6600",
402 "L1_jTE5_VjTE200",
403 #
404 "L1_VjTE10", "L1_VjTE200", "L1_VjTE600", "L1_jTE50_VjTE600",
405 #
406 "L1_GAP_A", "L1_GAP_C", "L1_GAP_AANDC",
407 #
408 "L1_MU3V_VjTE50", "L1_MU3V_VjTE200",
409 #
410 "L1_TRT_VjTE20", "L1_eEM1_TRT_VjTE100",
411 "L1_TRT_ZDC_XOR_VjTE200", "L1_TRT_1ZDC_NZDC_VjTE200",
412 #
413 "L1_ZDC_A_C_VjTE10", "L1_ZDC_XOR_VjTE10", "L1_TRT_ZDC_A_C_VjTE10", "L1_TRT_ZDC_XOR_VjTE10",
414 "L1_TRT_ZDC_A_VjTE50", "L1_TRT_ZDC_C_VjTE50",
415 #
416 "L1_MBTS_2_VZDC_A_ZDC_C_VjTE200_GAP_A", "L1_MBTS_2_1ZDC_NZDC_VjTE200_GAP_A",
417 "L1_MBTS_2_ZDC_A_VZDC_C_VjTE200_GAP_C", "L1_MBTS_2_1ZDC_NZDC_VjTE200_GAP_C",
418 "L1_MBTS_1_VZDC_A_ZDC_C_jTE3_VjTE200_GAP_A", "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200_GAP_A",
419 "L1_MBTS_1_ZDC_A_VZDC_C_jTE3_VjTE200_GAP_C", "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200_GAP_C",
420 #
421 "L1_1ZDC_A_1ZDC_C_VjTE200", "L1_ZDC_1XOR5_VjTE200",
422 "L1_ZDC_XOR_VjTE200",
423 #
424 "L1_ZDC_XOR_jJ10_VjTE200",
425 #
426 "L1_ZDC_HELT20_jTEFWD2600",
427 "L1_ZDC_HELT35_jTEFWD2600",
428 "L1_ZDC_HELT50_jTEFWD2600",
429 #
430 "L1_TEA_TeAsymmetry-jTENoSort",
431 "L1_TEA_eEM2",
432 "L1_TEA_eTAU2",
433 "L1_TEA_jJ5",
434 "L1_TEA_jJ5p30ETA49",
435 "L1_ESP_TeAsymmetry-jTENoSort",
436 "L1_ESP_eEM2",
437 "L1_ESP_eTAU2",
438 "L1_ESP_jJ5",
439 "L1_ESP_jJ5p30ETA49",
440 #
441 'L1_TeATIME-jTENoSort',
442 'L1_ESPRESSO',
443 'L1_TeAsymmetry-jTENoSort',
444 'L1_TeAsymmetry1-jTENoSort',
445 'L1_TeAsymmetry2-jTENoSort',
446 'L1_TeAsymmetry3-jTENoSort',
447
448 'L1_CALMTEA_eEM2',
449 'L1_CALMTEA_eTAU2',
450
451 'L1_CALMTEA_eEM2_VjTE200',
452 'L1_CALMTEA_eTAU2_VjTE200',
453
454 'L1_MATCHA_eTAU2',
455 'L1_MATCHA_eTAU2_VjTE200',
456 'L1_MATCHA_eTAU2_EMPTY',
457 'L1_MATCHA_eTAU2_VjTE200_EMPTY',
458
459 'L1_ESP_1ZDC_NZDC_jJ10_VjTE200',
460 'L1_ESP_5ZDC_A_5ZDC_C_jJ10_VjTE200',
461 'L1_ESP_VZDC_A_VZDC_C_jJ10_VjTE200',
462 'L1_ESP_VZDC_A_VZDC_C_jJ10p30ETA49_VjTE200',
463 'L1_ESP_VZDC_A_VZDC_C_jJ5p30ETA49_VjTE200',
464 'L1_ESP_ZDC_5XOR_jJ10_VjTE200',
465 'L1_ESP_ZDC_XOR_jJ10_VjTE200',
466 'L1_ESP_ZDC_XOR_jJ10p30ETA49_VjTE200',
467 'L1_ESP_ZDC_XOR_jJ5p30ETA49_VjTE200',
468
469 'L1_ESP_ASYM0_TRT_ZDC_XOR_VjTE200',
470 'L1_ESP_ASYM1_TRT_ZDC_XOR_VjTE200',
471 'L1_ESP_ASYM2_TRT_ZDC_XOR_VjTE200',
472 'L1_ESP_ASYM3_TRT_ZDC_XOR_VjTE200',
473
474 'L1_ESP_ASYM0_ZDC_XOR_VjTE200',
475 'L1_ESP_ASYM1_ZDC_XOR_VjTE200',
476 'L1_ESP_ASYM2_ZDC_XOR_VjTE200',
477 'L1_ESP_ASYM3_ZDC_XOR_VjTE200',
478
479 'L1_23INVM-27DPHI-2eTAU1_VjTE200',
480
481 'L1_CALMTEA_DPHI-2eTAU1_VjTE200',
482 'L1_CALMTEA_DPHI-2eTAU1_VjTE200_EMPTY',
483
484 'L1_CALMTEA_23INVM-27DPHI-2eTAU1_VjTE200',
485 'L1_CALMTEA_23INVM-27DPHI-2eTAU1_VjTE200_EMPTY',
486 ])
487
488 # HI HLT menu: Add triggers that are not in the MC menu
489 if "MC" not in menuName:
490 monItems[TBP|TAP|TAV].extend([
491 ])
492
493 monItems[TBP|TAP|TAV] += topo3_monitems
494
495
496 # if any of the HF items are changed CTP and OLC shall be informed (via TrigOps)
497 monItemsHF[TBP|TAP|TAV] = [
498 "L1_jJ30", # beam-induced background measurements
499 "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
500 "L1_BCM_Wide", # beam-induced background measurements
501 "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN" # beam-induced background measurements, used for SCT HV ramp
502 ]
503 # total number of items for HF monitoring doubled from 8 to 16 for HI and pp-ref
504 if "HI" in menuName:
505 monItemsHF[TBP|TAP|TAV].extend([
506 "L1_eEM15" # luminosity measurements
507 ])
508 if "lowMu" in menuFullName:
509 monItemsHF[TBP|TAP|TAV].extend([
510 # ATR-31296 – Oxygen/Neon runs
511 "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", "L1_ZDC_OR",
512 # "L1_ZDC_LOR", "L1_ZDC_XN_XOR", "L1_ZDC_YN_XOR", "L1_ZDC_ZN_XOR"
513 ])
514 else: # HI HLT menu
515 monItemsHF[TBP|TAP|TAV].extend([
516 "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", # luminosity measurements
517 "L1_ZDC_OR", "L1_ZDC_XOR", # luminosity measurements
518 "L1_ZDC_C_VZDC_A", "L1_ZDC_A_VZDC_C", "L1_5ZDC_A_5ZDC_C", # luminosity measurements
519 ])
520
521
522
523
524 check = True
525 if check:
526 counts_LF_items = { TBP : set(), TAP : set(), TAV : set() }
527 counts_HF_items = { TBP : set(), TAP : set(), TAV : set() }
528
529 for k in range(1,8):
530
531 if k & TBP:
532 counts_LF_items[TBP].update( monItems[k] )
533 counts_HF_items[TBP].update( monItemsHF[k] )
534
535 if k & TAP:
536 counts_LF_items[TAP].update( monItems[k] )
537 counts_HF_items[TAP].update( monItemsHF[k] )
538
539 if k & TAV:
540 counts_LF_items[TAV].update( monItems[k] )
541 counts_HF_items[TAV].update( monItemsHF[k] )
542
543 counts_LF = dict( map(lambda x : (x[0],len(x[1])), counts_LF_items.items() ) )
544 counts_HF = dict( map(lambda x : (x[0],len(x[1])), counts_HF_items.items() ) )
545
546 lutsLF = int( (max(counts_LF.values())-1) / 8) + 1
547 lutsHF = int( (max(counts_HF.values())-1) / 8) + 1
548
549 maxLUTs = 32
550 if lutsLF + lutsHF > maxLUTs:
551 log.error("too many monitoring items are defined:")
552 log.error(" low frequency TBP: %i",counts_LF[TBP])
553 log.error(" TAP: %i",counts_LF[TAP])
554 log.error(" TAV: %i",counts_LF[TAV])
555 log.error(" required LUTs: %i",lutsLF)
556 log.error(" high frequency TBP: %i",counts_HF[TBP])
557 log.error(" TAP: %i",counts_HF[TAP])
558 log.error(" TAV: %i",counts_HF[TAV])
559 log.error(" required LUTs: %i",lutsHF)
560 log.error(" this menu requires %i monitoring LUTs while only %i are available", (lutsLF + lutsHF), maxLUTs)
561 raise RuntimeError("Reduce the number of monitored items")
562
563 if 'AllCTPIn' not in menuName:
564 MonitorDef.checkForNonExistingMonItems(items, monItems)
565
566 # for each item set the monitor flags
567 for item in items:
568
569 itemName = item.name
570 for k,l in monItems.items():
571
572 if itemName in l:
573 item.addMonitor(k, MonitorDef.LOW_FREQ)
574
575
576 for k,l in monItemsHF.items():
577
578 if itemName in l:
579 item.addMonitor(k, MonitorDef.HIGH_FREQ)
580
581
582 @staticmethod
583 def checkForNonExistingMonItems(items, monItems):
584 # check is based on item names
585 allItemNames = [item.name for item in items]
586
587 # unify all item names that are monitored
588 allMonitorItems = set()
589 for i in range(1,8):
590 allMonitorItems.update(monItems[i])
591
592 # register all monitems that don't exist in here
593 nonExistingMonItems = []
594
595 for monItem in allMonitorItems:
596 if monItem not in allItemNames:
597 nonExistingMonItems += [monItem]
598
599 if len(nonExistingMonItems)>0:
600 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.