Loading [MathJax]/jax/output/SVG/config.js
ATLAS Offline Software
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
MonitorDef.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 """
4 The CTP monitors three different types of signals. In the XML file
5 they are listed in the section <TriggerCounterList>
6 
7 1) type CTPIN
8 
9 Almost each input threshold is monitored with one counter per
10 multiplicity it can have. E.g. there are 7 counters for the EM10VH
11 threshold: "1EM10VH" ... "7EM10VH"
12 
13 Due to limitations of the CTPIN monitoring LUT (there are only 4 LUT
14 per CTPIN connector and a LUT has 8 bit input) only 2 3-bit thresholds
15 can be monitored per LUT, so max 8 3-bit thresholds per
16 connector. Hence JET thresholds 8 and 9 can not be monitored.
17 
18 
19 2) type CTPMON
20 
21 This allows to monitor any combination of conditions built in the same
22 way 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 
26 3) type TBP, TAP, TAV
27 
28 For each of these type 64 L1Items can be monitored independently
29 Please take note that the bunch mask is not applied for the per-bunch monitoring, thus one item per threshold is sufficient
30 
31 """
32 
33 from AthenaCommon.Logging import logging
34 log = logging.getLogger(__name__)
35 
36 from ..Base.MonCounters import CtpinCounter, CtpmonCounter
37 
38 class MonitorDef:
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", "L1_eTAU140",
129  "L1_jTAU20",
130  "L1_cTAU20M", "L1_cTAU35M",
131  "L1_cTAU30M_2cTAU20M",
132  "L1_jJ30", "L1_jJ40", "L1_jJ50",
133  "L1_jJ60", "L1_jJ90", "L1_jJ125",
134  "L1_jJ160", "L1_jJ500",
135  "L1_jJ40p30ETA49", "L1_jJ50p30ETA49",
136  "L1_jJ60p30ETA49", "L1_jJ90p30ETA49", "L1_jJ125p30ETA49",
137  "L1_3jJ90", "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_gXERHO70", "L1_gXERHO100",
149  "L1_gXENC70", "L1_gXENC100",
150  "L1_gXEJWOJ60", "L1_gXEJWOJ70", "L1_gXEJWOJ80", "L1_gXEJWOJ100", "L1_gXEJWOJ110", "L1_gXEJWOJ120", "L1_gXEJWOJ500",
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  topo3_monitems = [
170  "L1_HT190-jJ40s5pETA21", "L1_jMJJ-500-NFF",
171  "L1_LLP-RO-eEM", "L1_LLP-NOMATCH-eEM",
172  "L1_SC175-SCjJ10",
173  "L1_ZAFB-25DPHI-eEM18M",
174  "L1_jMJJ-300-NFF",
175  "L1_LFV-eEM10L-MU8VF", "L1_LFV-eEM15L-MU5VF",
176  ]
177  # Add triggers that are not in the MC menu
178  if 'MC' not in menuName:
179  monItems[TBP|TAP|TAV] += [
180  # Detector items
181  # "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_AND",
182  "L1_LUCID_A", "L1_LUCID_C",
183  "L1_CALREQ1", "L1_CALREQ2",
184  "L1_TGC_BURST",
185  "L1_TRT_FILLED",
186  "L1_BPTX0_BGRP12", "L1_BPTX1_BGRP12",
187  "L1_NSW_MONITOR",
188  #Background
189  "L1_BCM_Wide",
190  "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN",
191  #AFP
192  "L1_AFP_A_AND_C_TOF_T0T1",
193  "L1_AFP_FSA_BGRP12", "L1_AFP_FSC_BGRP12",
194  "L1_AFP_FSA_TOF_T0_BGRP12", "L1_AFP_FSA_TOF_T1_BGRP12", "L1_AFP_FSA_TOF_T2_BGRP12", "L1_AFP_FSA_TOF_T3_BGRP12",
195  "L1_AFP_FSC_TOF_T0_BGRP12", "L1_AFP_FSC_TOF_T1_BGRP12", "L1_AFP_FSC_TOF_T2_BGRP12", "L1_AFP_FSC_TOF_T3_BGRP12",
196  "L1_AFP_A_OR_C_EMPTY",
197  "L1_AFP_NSA_BGRP12", "L1_AFP_NSC_BGRP12",
198  "L1_AFP_A", "L1_AFP_C", "L1_AFP_A_AND_C",
199  "L1_MBTS_A", "L1_MBTS_C",
200  "L1_MBTS_1", "L1_MBTS_1_1", "L1_MBTS_2",
201  "L1_MBTS_1_A", "L1_MBTS_1_C", "L1_MBTS_4_A", "L1_MBTS_4_C",
202  "L1_ZeroBias",
203  "L1_AFP_A_AND_C_TOF_jJ50",
204  # Phase-I
205  "L1_AFP_A_AND_C_TOF_T0T1_jJ90",
206  "L1_jJ500_LAR",
207  # Other triggers disabled in MC
208  "L1_MU3VF", "L1_MU8F", "L1_MU8FC", "L1_MU8VF",
209  "L1_MU3VC", "L1_MU3EOF", "L1_MU4BO",
210  "L1_MU8FH", "L1_MU8EOF",
211  "L1_MU9VF", "L1_MU9VFC",
212  "L1_MU12FCH", "L1_MU14FCHR", "L1_MU14EOF",
213  "L1_MU15VFCH", "L1_MU15VFCHR",
214  "L1_MU18VFCH", "L1_MU20VFC",
215  "L1_2MU8F", "L1_2MU8VF",
216  "L1_2MU14FCH_OVERLAY",
217  #
218  "L1_jJ55", "L1_jJ80", "L1_jJ140", "L1_jJ180",
219  "L1_jJ30p0ETA25", "L1_jJ40p0ETA25",
220  "L1_jJ70p0ETA23", "L1_jJ55p0ETA23",
221  "L1_jJ80p0ETA25", "L1_jJ85p0ETA21",
222  "L1_jEM25", "L1_jEM20M",
223  #
224  "L1_eEM7", "L1_eEM10L", "L1_eEM15",
225  "L1_eEM18", "L1_eEM22M", "L1_eEM24VM",
226  "L1_3eEM12L",
227  #
228  "L1_eTAU20L", "L1_eTAU35", "L1_eTAU40HM",
229  ]
230 
231  else: # HI L1 menu
232  monItems[TBP|TAP|TAV] = [
233  # Random
234  "L1_RD0_FILLED",
235  # Forward
236  # ZDC
237  "L1_ZDC_BIT0", "L1_ZDC_BIT1", "L1_ZDC_BIT2",
238  "L1_ZDC_COMB0", "L1_ZDC_COMB1", "L1_ZDC_COMB2", "L1_ZDC_COMB3",
239  "L1_ZDC_COMB4", "L1_ZDC_COMB5", "L1_ZDC_COMB6", "L1_ZDC_COMB7",
240  "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C",
241  "L1_VZDC_A_VZDC_C",
242  "L1_ZDC_OR",
243  # LHCF
244  "L1_LHCF",
245  # MBTS
246  "L1_MBTS_2_2", "L1_MBTS_3_3", "L1_MBTS_4_4",
247  # LAr Zee
248  "L1_LAR-ZEE-eEM",
249  # Muons
250  "L1_MU3V", "L1_MU5VF",
251  "L1_MU8F", "L1_MU8VF",
252  "L1_MU14FCH",
253  "L1_2MU3V", "L1_2MU5VF",
254  "L1_3MU3V",
255  "L1_2MU14FCH_OVERLAY",
256  # Phase-I L1Calo
257  "L1_eEM5", "L1_eEM9", "L1_eEM12", "L1_eEM15",
258  "L1_eEM18", "L1_eEM18L",
259  "L1_eEM26", "L1_eEM26M",
260  "L1_2eEM18",
261  #
262  "L1_jJ20", "L1_jJ30", "L1_jJ40", "L1_jJ50",
263  "L1_jJ55", "L1_jJ60", "L1_jJ90", "L1_jJ125",
264  "L1_jJ500",
265  "L1_jJ40p30ETA49", "L1_jJ50p30ETA49", "L1_jJ60p30ETA49",
266  "L1_jJ90p30ETA49",
267  #
268  "L1_gJ20p0ETA25", "L1_gJ400p0ETA25",
269  #
270  "L1_gLJ80p0ETA25", "L1_gXEJWOJ100",
271  #
272  "L1_jTE200",
273  #
274  "L1_TRT_FILLED",
275  ]
276 
277  # HI L1 menu: Add triggers that are not in the MC menu
278  if "MC" not in menuName:
279  monItems[TBP|TAP|TAV] += [
280  # Detector
281  "L1_CALREQ0", "L1_CALREQ1", "L1_CALREQ2",
282  "L1_BPTX0_BGRP12", "L1_BPTX1_BGRP12",
283  "L1_TGC_BURST",
284  "L1_ZeroBias",
285  "L1_jJ500_LAR",
286  # Background
287  "L1_BCM_Wide",
288  "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN",
289  # LUCID
290  "L1_LUCID_A", "L1_LUCID_C",
291  # MBTS
292  "L1_MBTS_A",
293  "L1_MBTS_C",
294  "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
295  ]
296 
297  topo3_monitems = []
298 
299  if "lowMu" in menuFullName:
300  monItems[TBP|TAP|TAV].extend([
301  # AFP
302  "L1_AFP_A_OR_C", "L1_AFP_A_AND_C",
303  # AFP combined
304  "L1_AFP_A_AND_C_TOF_T0T1_jJ125",
305  "L1_AFP_A_AND_C_TOF_T0T1_jJ50",
306  "L1_AFP_A_AND_C_TOF_T0T1_jJ60",
307  "L1_AFP_A_AND_C_TOF_T0T1_jJ90",
308  "L1_AFP_A_AND_C_TOF_jJ125",
309  "L1_AFP_A_AND_C_TOF_jJ50",
310  "L1_AFP_A_AND_C_TOF_jJ60",
311  "L1_AFP_A_AND_C_TOF_jJ90",
312  "L1_AFP_A_AND_C_jJ20",
313  "L1_AFP_A_AND_C_jJ30",
314  "L1_AFP_A_OR_C_jJ20",
315  "L1_AFP_A_OR_C_jJ30",
316  # ZDC
317  "L1_ZDC_A_AND_C",
318  # Mu+X
319  "L1_MU5VF_AFP_A_OR_C",
320  # Phase-I L1Calo
321  "L1_eEM9_AFP_A_AND_C", #"L1_eEM9_AFP_A_OR_C",
322  # ATR-31296 – Oxygen/Neon runs
323  "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", "L1_ZDC_OR", "L1_ZDC_XOR",
324  "L1_ZDC_XNXN", "L1_ZDC_XNYN", "L1_ZDC_XNZN",
325  "L1_ZDC_XN_XOR", "L1_ZDC_YN_XOR", "L1_ZDC_ZN_XOR",
326  "L1_ZDC_YN", "L1_ZDC_ZN", "L1_ZDC_LOR", "L1_ZDC_YNYN",
327  "L1_TRT_FILLED",
328  "L1_jTE5", "L1_jTE10", "L1_jTE20", "L1_jTE50",
329  "L1_jJ10", "L1_jJ20",
330  "L1_eEM5", "L1_eEM9",
331  ])
332 
333  # lowMu HLT menu: Add triggers that are not in the MC menu
334  if "MC" not in menuName:
335  monItems[TBP|TAP|TAV].extend([
336  # Forward
337  # AFP
338  "L1_AFP_A", "L1_AFP_C",
339  # AFP Calib
340  "L1_AFP_FSA_BGRP12",
341  "L1_AFP_FSA_TOF_T0_BGRP12",
342  "L1_AFP_FSA_TOF_T1_BGRP12",
343  "L1_AFP_FSA_TOF_T2_BGRP12",
344  "L1_AFP_FSA_TOF_T3_BGRP12",
345  "L1_AFP_FSC_BGRP12",
346  "L1_AFP_FSC_TOF_T0_BGRP12",
347  "L1_AFP_FSC_TOF_T1_BGRP12",
348  "L1_AFP_FSC_TOF_T2_BGRP12",
349  "L1_AFP_FSC_TOF_T3_BGRP12",
350  "L1_AFP_NSA_BGRP12",
351  "L1_AFP_NSC_BGRP12",
352  # AFP combined
353  "L1_AFP_A_AND_C_TOF_T0T1",
354  ])
355 
356  else: # HI HLT menu
357  monItems[TBP|TAP|TAV].extend([
358  # Forward
359  # ZDC
360  # Basic inputs
361  "L1_ZDC_XOR", "L1_ZDC_C_VZDC_A", "L1_ZDC_A_VZDC_C",
362  "L1_1ZDC_A_VZDC_C", "L1_VZDC_A_1ZDC_C",
363  "L1_1ZDC_A_1ZDC_C", "L1_5ZDC_A_VZDC_C", "L1_VZDC_A_5ZDC_C",
364  "L1_ZDC_1XOR5", "L1_5ZDC_A_5ZDC_C",
365  # Mu+X
366  "L1_MU3V_jJ40",
367  # Phase-I L1Calo
368  "L1_eEM1", "L1_eEM2",
369  "L1_eTAU1",
370  "L1_DPHI-2eEM1", "L1_DPHI-2eTAU1",
371  "L1_DPHI-2eEM1_VjTE200",
372  "L1_2eEM1_VjTE200", "L1_2eEM2_VjTE200", "L1_2eEM1_VjTE200_GAP_AANDC",
373  "L1_eEM5_VjTE200", "L1_eEM9_VjTE200",
374  "L1_eEM1_jTE4_VjTE200", "L1_eEM2_jTE4_VjTE200", "L1_eTAU1_jTE4_VjTE200",
375  "L1_2eTAU1_VjTE200", "L1_2eTAU1_VjTE200_GAP_AANDC",
376  "L1_eEM1_TRT_VjTE200", "L1_eTAU1_TRT_VjTE200",
377  "L1_eEM1_TRT_ZDC_XOR_VjTE200", "L1_eTAU1_TRT_ZDC_XOR_VjTE200", "L1_jTAU1_TRT_ZDC_XOR_VjTE200",
378  "L1_eEM1_TRT_VZDC_A_VZDC_C_VjTE100", "L1_eTAU1_TRT_VZDC_A_VZDC_C_VjTE100",
379  "L1_eEM1_TRT_ZDC_XOR4_VjTE100", "L1_eTAU1_TRT_ZDC_XOR4_VjTE100",
380  #
381  "L1_jJ5", "L1_jJ10",
382  "L1_jJ5p30ETA49","L1_jJ10p30ETA49",
383  #
384  "L1_jTE3", "L1_jTE4", "L1_jTE5", "L1_jTE10", "L1_jTE20", "L1_jTE50",
385  "L1_jTE100", "L1_jTE600", "L1_jTE1500", "L1_jTE6500", "L1_jTE8300",
386  "L1_jTE9000", "L1_jTE10000", "L1_jTE12000",
387  "L1_jTE5_VjTE200", "L1_gTE5_VjTE200",
388  #
389  "L1_VjTE10", "L1_VjTE200", "L1_VjTE600", "L1_jTE50_VjTE600",
390  #
391  "L1_GAP_A", "L1_GAP_C", "L1_GAP_AANDC",
392  #
393  "L1_MU3V_VjTE50", "L1_MU3V_VjTE200",
394  #
395  "L1_TRT_VjTE20", "L1_eEM1_TRT_VjTE100",
396  "L1_TRT_ZDC_XOR_VjTE200", "L1_TRT_1ZDC_NZDC_VjTE200",
397  #
398  "L1_ZDC_A_C_VjTE10", "L1_ZDC_XOR_VjTE10", "L1_TRT_ZDC_A_C_VjTE10", "L1_TRT_ZDC_XOR_VjTE10",
399  "L1_TRT_ZDC_A_VjTE50", "L1_TRT_ZDC_C_VjTE50",
400  #
401  "L1_MBTS_2_VZDC_A_ZDC_C_VjTE200_GAP_A", "L1_MBTS_2_1ZDC_NZDC_VjTE200_GAP_A",
402  "L1_MBTS_2_ZDC_A_VZDC_C_VjTE200_GAP_C", "L1_MBTS_2_1ZDC_NZDC_VjTE200_GAP_C",
403  "L1_MBTS_1_VZDC_A_ZDC_C_jTE3_VjTE200", "L1_MBTS_1_ZDC_A_VZDC_C_jTE3_VjTE200",
404  "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200",
405  "L1_MBTS_1_VZDC_A_ZDC_C_jTE3_VjTE200_GAP_A", "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200_GAP_A",
406  "L1_MBTS_1_ZDC_A_VZDC_C_jTE3_VjTE200_GAP_C", "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200_GAP_C",
407  #
408  "L1_1ZDC_A_1ZDC_C_VjTE200", "L1_ZDC_1XOR5_VjTE200",
409  "L1_ZDC_XOR_VjTE200",
410  "L1_VZDC_A_VZDC_C_jTE5_VjTE200", "L1_ZDC_XOR_jTE5_VjTE200",
411  "L1_1ZDC_NZDC_jTE5_VjTE200", "L1_5ZDC_A_5ZDC_C_jTE5_VjTE200",
412  "L1_VZDC_A_VZDC_C_jTE10_VjTE200", "L1_ZDC_XOR_jTE10_VjTE200",
413  "L1_1ZDC_NZDC_jTE10_VjTE200",
414  "L1_VZDC_A_VZDC_C_gTE5_VjTE200", "L1_ZDC_XOR_gTE5_VjTE200",
415  "L1_1ZDC_NZDC_gTE5_VjTE200", "L1_5ZDC_A_5ZDC_C_gTE5_VjTE200",
416  "L1_TRT_VZDC_A_VZDC_C_jTE5_VjTE200", "L1_TRT_ZDC_XOR_jTE5_VjTE200",
417  #
418  "L1_ZDC_XOR_jJ5_VjTE200", "L1_ZDC_XOR_jJ10_VjTE200", "L1_1ZDC_NZDC_jJ5_VjTE200",
419  "L1_1ZDC_NZDC_jJ10_VjTE200", "L1_VZDC_A_VZDC_C_jJ5_VjTE200", "L1_VZDC_A_VZDC_C_jJ10_VjTE200",
420  #
421  "L1_ZDC_HELT15_jTE4000", "L1_ZDC_HELT20_jTE4000", "L1_ZDC_HELT25_jTE4000",
422  "L1_ZDC_HELT35_jTE4000", "L1_ZDC_HELT50_jTE4000",
423  ])
424 
425  # HI HLT menu: Add triggers that are not in the MC menu
426  if "MC" not in menuName:
427  monItems[TBP|TAP|TAV].extend([
428  ])
429 
430  monItems[TBP|TAP|TAV] += topo3_monitems
431 
432 
433  # if any of the HF items are changed CTP and OLC shall be informed (via TrigOps)
434  monItemsHF[TBP|TAP|TAV] = [
435  "L1_jJ30", # beam-induced background measurements
436  "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
437  "L1_BCM_Wide", # beam-induced background measurements
438  "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN" # beam-induced background measurements, used for SCT HV ramp
439  ]
440  # total number of items for HF monitoring doubled from 8 to 16 for HI and pp-ref
441  if "HI" in menuName:
442  monItemsHF[TBP|TAP|TAV].extend([
443  "L1_eEM15" # luminosity measurements
444  ])
445  if "lowMu" in menuFullName:
446  monItemsHF[TBP|TAP|TAV].extend([
447  # ATR-31296 – Oxygen/Neon runs
448  "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", "L1_ZDC_OR", "L1_ZDC_LOR",
449  "L1_ZDC_XN_XOR", "L1_ZDC_YN_XOR", "L1_ZDC_ZN_XOR"
450  ])
451  else: # HI HLT menu
452  monItemsHF[TBP|TAP|TAV].extend([
453  "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", # luminosity measurements
454  "L1_ZDC_OR", "L1_ZDC_XOR", # luminosity measurements
455  "L1_ZDC_C_VZDC_A", "L1_ZDC_A_VZDC_C", "L1_5ZDC_A_5ZDC_C", # luminosity measurements
456  ])
457 
458 
459 
460 
461  check = True
462  if check:
463  counts_LF_items = { TBP : set(), TAP : set(), TAV : set() }
464  counts_HF_items = { TBP : set(), TAP : set(), TAV : set() }
465 
466  for k in range(1,8):
467 
468  if k & TBP:
469  counts_LF_items[TBP].update( monItems[k] )
470  counts_HF_items[TBP].update( monItemsHF[k] )
471 
472  if k & TAP:
473  counts_LF_items[TAP].update( monItems[k] )
474  counts_HF_items[TAP].update( monItemsHF[k] )
475 
476  if k & TAV:
477  counts_LF_items[TAV].update( monItems[k] )
478  counts_HF_items[TAV].update( monItemsHF[k] )
479 
480  counts_LF = dict( map(lambda x : (x[0],len(x[1])), counts_LF_items.items() ) )
481  counts_HF = dict( map(lambda x : (x[0],len(x[1])), counts_HF_items.items() ) )
482 
483  lutsLF = int( (max(counts_LF.values())-1) / 8) + 1
484  lutsHF = int( (max(counts_HF.values())-1) / 8) + 1
485 
486  maxLUTs = 32
487  if lutsLF + lutsHF > maxLUTs:
488  log.error("too many monitoring items are defined:")
489  log.error(" low frequency TBP: %i",counts_LF[TBP])
490  log.error(" TAP: %i",counts_LF[TAP])
491  log.error(" TAV: %i",counts_LF[TAV])
492  log.error(" required LUTs: %i",lutsLF)
493  log.error(" high frequency TBP: %i",counts_HF[TBP])
494  log.error(" TAP: %i",counts_HF[TAP])
495  log.error(" TAV: %i",counts_HF[TAV])
496  log.error(" required LUTs: %i",lutsHF)
497  log.error(" this menu requires %i monitoring LUTs while only %i are available", (lutsLF + lutsHF), maxLUTs)
498  raise RuntimeError("Reduce the number of monitored items")
499 
500  if 'AllCTPIn' not in menuName:
501  MonitorDef.checkForNonExistingMonItems(items, monItems)
502 
503  # for each item set the monitor flags
504  for item in items:
505 
506  itemName = item.name
507  for k,l in monItems.items():
508 
509  if itemName in l:
510  item.addMonitor(k, MonitorDef.LOW_FREQ)
511 
512 
513  for k,l in monItemsHF.items():
514 
515  if itemName in l:
516  item.addMonitor(k, MonitorDef.HIGH_FREQ)
517 
518 
519  @staticmethod
520  def checkForNonExistingMonItems(items, monItems):
521  # check is based on item names
522  allItemNames = [item.name for item in items]
523 
524  # unify all item names that are monitored
525  allMonitorItems = set()
526  for i in range(1,8):
527  allMonitorItems.update(monItems[i])
528 
529  # register all monitems that don't exist in here
530  nonExistingMonItems = []
531 
532  for monItem in allMonitorItems:
533  if monItem not in allItemNames:
534  nonExistingMonItems += [monItem]
535 
536  if len(nonExistingMonItems)>0:
537  raise RuntimeError("These monitoring items are not part of the menu: %s" % ','.join(nonExistingMonItems))
python.L1.Config.MonitorDef.MonitorDef.checkForNonExistingMonItems
def checkForNonExistingMonItems(items, monItems)
Definition: MonitorDef.py:520
max
constexpr double max()
Definition: ap_fixedTest.cxx:33
python.L1.Config.MonitorDef.MonitorDef.ctpmonCounters
def ctpmonCounters(thresholds, connectors)
Definition: MonitorDef.py:72
python.L1.Base.MonCounters.CtpmonCounter
Definition: MonCounters.py:60
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:194
CxxUtils::set
constexpr std::enable_if_t< is_bitmask_v< E >, E & > set(E &lhs, E rhs)
Convenience function to set bits in a class enum bitmask.
Definition: bitmask.h:232
TCS::join
std::string join(const std::vector< std::string > &v, const char c=',')
Definition: Trigger/TrigT1/L1Topo/L1TopoCommon/Root/StringUtils.cxx:10
ActsTrk::detail::MakeDerivedVariant::extend
constexpr std::variant< Args..., T > extend(const std::variant< Args... > &, const T &)
Definition: MakeDerivedVariant.h:17
python.L1.Config.MonitorDef.MonitorDef.applyItemCounter
def applyItemCounter(menuName, items, menuFullName)
Definition: MonitorDef.py:96
python.CaloAddPedShiftConfig.int
int
Definition: CaloAddPedShiftConfig.py:45
python.L1.Config.MonitorDef.MonitorDef
Definition: MonitorDef.py:38
python.L1.Config.MonitorDef.MonitorDef.ctpinCounters
def ctpinCounters(thresholds, connectors, ctpinConfig)
Definition: MonitorDef.py:47
python.L1.Base.MonCounters.CtpinCounter
Definition: MonCounters.py:53