ATLAS Offline Software
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",
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-0DR3-eEM9jJ40_MU5VF", "L1_BPH-0M9-eEM9-eEM7_MU5VF", "L1_BPH-0DR3-eEM9jJ40_2MU3V",
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-eTAU30MeTAU20M",
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  topo3_monitems = [
169  "L1_HT190-jJ40s5pETA21", "L1_jMJJ-500-NFF",
170  "L1_LLP-RO-eEM", "L1_LLP-NOMATCH-eEM",
171  "L1_SC111-CjJ40",
172  "L1_ZAFB-25DPHI-eEM18M",
173  "L1_jMJJ-300-NFF",
174  "L1_LFV-eEM10L-MU8VF", "L1_LFV-eEM15L-MU5VF",
175  ]
176  # Add triggers that are not in the MC menu
177  if 'MC' not in menuName:
178  monItems[TBP|TAP|TAV] += [
179  # Detector items
180  # "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_AND",
181  "L1_LUCID_A", "L1_LUCID_C",
182  "L1_CALREQ1", "L1_CALREQ2",
183  "L1_TGC_BURST",
184  "L1_TRT_FILLED",
185  "L1_BPTX0_BGRP12", "L1_BPTX1_BGRP12",
186  "L1_NSW_MONITOR",
187  #Background
188  "L1_BCM_Wide",
189  "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN",
190  #AFP
191  "L1_AFP_A_AND_C_TOF_T0T1",
192  "L1_AFP_FSA_BGRP12", "L1_AFP_FSC_BGRP12",
193  "L1_AFP_FSA_TOF_T0_BGRP12", "L1_AFP_FSA_TOF_T1_BGRP12", "L1_AFP_FSA_TOF_T2_BGRP12", "L1_AFP_FSA_TOF_T3_BGRP12",
194  "L1_AFP_FSC_TOF_T0_BGRP12", "L1_AFP_FSC_TOF_T1_BGRP12", "L1_AFP_FSC_TOF_T2_BGRP12", "L1_AFP_FSC_TOF_T3_BGRP12",
195  "L1_AFP_A_OR_C_EMPTY",
196  "L1_AFP_NSA_BGRP12", "L1_AFP_NSC_BGRP12",
197  "L1_AFP_A", "L1_AFP_C", "L1_AFP_A_AND_C",
198  "L1_MBTS_A", "L1_MBTS_C",
199  "L1_MBTS_1", "L1_MBTS_1_1", "L1_MBTS_2",
200  "L1_MBTS_1_A", "L1_MBTS_1_C", "L1_MBTS_4_A", "L1_MBTS_4_C",
201  "L1_ZeroBias",
202  "L1_AFP_A_AND_C_TOF_jJ50",
203  # Phase-I
204  "L1_AFP_A_AND_C_TOF_T0T1_jJ90",
205  "L1_jJ500_LAR",
206  # Other triggers disabled in MC
207  "L1_MU3VF", "L1_MU8F", "L1_MU8FC", "L1_MU8VF",
208  "L1_MU3VC", "L1_MU3EOF", "L1_MU4BO",
209  "L1_MU8FH", "L1_MU8EOF",
210  "L1_MU9VF", "L1_MU9VFC",
211  "L1_MU12FCH", "L1_MU14FCHR", "L1_MU14EOF",
212  "L1_MU15VFCH", "L1_MU15VFCHR",
213  "L1_MU18VFCH", "L1_MU20VFC",
214  "L1_2MU8F", "L1_2MU8VF",
215  "L1_2MU14FCH_OVERLAY",
216  #
217  "L1_jJ55", "L1_jJ80", "L1_jJ140", "L1_jJ180",
218  "L1_jJ30p0ETA25", "L1_jJ40p0ETA25",
219  "L1_jJ70p0ETA23", "L1_jJ55p0ETA23",
220  "L1_jJ80p0ETA25", "L1_jJ85p0ETA21",
221  "L1_jLJ180",
222  "L1_jEM20", "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_J12",
305  "L1_AFP_A_AND_C_TOF_J20",
306  "L1_AFP_A_AND_C_TOF_J30",
307  "L1_AFP_A_AND_C_TOF_J50",
308  "L1_AFP_A_AND_C_TOF_J75",
309  "L1_AFP_A_AND_C_TOF_T0T1_J20",
310  "L1_AFP_A_AND_C_TOF_T0T1_J30",
311  "L1_AFP_A_AND_C_TOF_T0T1_J50",
312  "L1_AFP_A_AND_C_TOF_T0T1_J75",
313  "L1_AFP_A_AND_C_TOF_T0T1_jJ125",
314  "L1_AFP_A_AND_C_TOF_T0T1_jJ50",
315  "L1_AFP_A_AND_C_TOF_T0T1_jJ60",
316  "L1_AFP_A_AND_C_TOF_T0T1_jJ90",
317  "L1_AFP_A_AND_C_TOF_jJ125",
318  "L1_AFP_A_AND_C_TOF_jJ50",
319  "L1_AFP_A_AND_C_TOF_jJ60",
320  "L1_AFP_A_AND_C_TOF_jJ90",
321  "L1_AFP_A_AND_C_jJ20",
322  "L1_AFP_A_AND_C_jJ30",
323  "L1_AFP_A_OR_C_J12",
324  "L1_AFP_A_OR_C_jJ20",
325  "L1_AFP_A_OR_C_jJ30",
326  # ZDC
327  "L1_ZDC_A_AND_C",
328  "L1_ZDC_E1_AND_E1", "L1_ZDC_E2_AND_E2", "L1_ZDC_E2_AND_E3", "L1_ZDC_E3_AND_E3",
329  "L1_ZDC_E1_AND_E2ORE3",
330  "L1_ZDC_XOR_E1_E3", "L1_ZDC_XOR_E2",
331  # ZDC items in pp
332  "L1_ZDC_PP_A", "L1_ZDC_PP_C", "L1_ZDC_PP_OR", "L1_ZDC_PP_A_C",
333  "L1_ZDC_PP_A2", "L1_ZDC_PP_C2", "L1_ZDC_PP_OR2",
334  # Mu+X
335  "L1_MU5VF_AFP_A_OR_C",
336  # Phase-I L1Calo
337  "L1_eEM9_AFP_A_AND_C", #"L1_eEM9_AFP_A_OR_C",
338  ])
339 
340  # lowMu HLT menu: Add triggers that are not in the MC menu
341  if "MC" not in menuName:
342  monItems[TBP|TAP|TAV].extend([
343  # Forward
344  # AFP
345  "L1_AFP_A", "L1_AFP_C",
346  # AFP Calib
347  "L1_AFP_FSA_BGRP12",
348  "L1_AFP_FSA_TOF_T0_BGRP12",
349  "L1_AFP_FSA_TOF_T1_BGRP12",
350  "L1_AFP_FSA_TOF_T2_BGRP12",
351  "L1_AFP_FSA_TOF_T3_BGRP12",
352  "L1_AFP_FSC_BGRP12",
353  "L1_AFP_FSC_TOF_T0_BGRP12",
354  "L1_AFP_FSC_TOF_T1_BGRP12",
355  "L1_AFP_FSC_TOF_T2_BGRP12",
356  "L1_AFP_FSC_TOF_T3_BGRP12",
357  "L1_AFP_NSA_BGRP12",
358  "L1_AFP_NSC_BGRP12",
359  # AFP combined
360  "L1_AFP_A_AND_C_MBTS_2",
361  "L1_AFP_A_AND_C_TOF_T0T1",
362  "L1_AFP_A_OR_C_MBTS_2",
363  ])
364 
365  else: # HI HLT menu
366  monItems[TBP|TAP|TAV].extend([
367  # Forward
368  # ZDC
369  # Basic inputs
370  "L1_ZDC_XOR", "L1_ZDC_C_VZDC_A", "L1_ZDC_A_VZDC_C",
371  "L1_1ZDC_A_VZDC_C", "L1_VZDC_A_1ZDC_C",
372  "L1_1ZDC_A_1ZDC_C", "L1_5ZDC_A_VZDC_C", "L1_VZDC_A_5ZDC_C",
373  "L1_ZDC_1XOR5", "L1_5ZDC_A_5ZDC_C",
374  # Mu+X
375  "L1_MU3V_jJ40",
376  # Phase-I L1Calo
377  "L1_eEM1", "L1_eEM2",
378  "L1_eTAU1",
379  "L1_DPHI-2eEM1", "L1_DPHI-2eTAU1",
380  "L1_DPHI-2eEM1_VjTE200",
381  "L1_2eEM1_VjTE200", "L1_2eEM2_VjTE200", "L1_2eEM1_VjTE200_GAP_AANDC",
382  "L1_eEM5_VjTE200", "L1_eEM9_VjTE200",
383  "L1_eEM1_jTE4_VjTE200", "L1_eEM2_jTE4_VjTE200", "L1_eTAU1_jTE4_VjTE200",
384  "L1_2eTAU1_VjTE200", "L1_2eTAU1_VjTE200_GAP_AANDC",
385  "L1_eEM1_TRT_VjTE200", "L1_eTAU1_TRT_VjTE200",
386  "L1_eEM1_TRT_ZDC_XOR_VjTE200", "L1_eTAU1_TRT_ZDC_XOR_VjTE200", "L1_jTAU1_TRT_ZDC_XOR_VjTE200",
387  "L1_eEM1_TRT_VZDC_A_VZDC_C_VjTE100", "L1_eTAU1_TRT_VZDC_A_VZDC_C_VjTE100",
388  "L1_eEM1_TRT_ZDC_XOR4_VjTE100", "L1_eTAU1_TRT_ZDC_XOR4_VjTE100",
389  #
390  "L1_jJ5", "L1_jJ10",
391  #
392  "L1_jTE3", "L1_jTE4", "L1_jTE5", "L1_jTE10", "L1_jTE20", "L1_jTE50",
393  "L1_jTE100", "L1_jTE600", "L1_jTE1500", "L1_jTE6500", "L1_jTE8300",
394  "L1_jTE9000", "L1_jTE10000", "L1_jTE12000",
395  "L1_jTE5_VjTE200", "L1_gTE5_VjTE200",
396  #
397  "L1_VjTE10", "L1_VjTE200", "L1_VjTE600", "L1_jTE50_VjTE600",
398  #
399  "L1_GAP_A", "L1_GAP_C", "L1_GAP_AANDC",
400  #
401  "L1_MU3V_VjTE50", "L1_MU3V_VjTE200",
402  #
403  "L1_TRT_VjTE20", "L1_eEM1_TRT_VjTE100",
404  "L1_TRT_ZDC_XOR_VjTE200", "L1_TRT_1ZDC_NZDC_VjTE200",
405  #
406  "L1_ZDC_A_C_VjTE10", "L1_ZDC_XOR_VjTE10", "L1_TRT_ZDC_A_C_VjTE10", "L1_TRT_ZDC_XOR_VjTE10",
407  "L1_TRT_ZDC_A_VjTE50", "L1_TRT_ZDC_C_VjTE50",
408  #
409  "L1_MBTS_2_VZDC_A_ZDC_C_VjTE200_GAP_A", "L1_MBTS_2_1ZDC_NZDC_VjTE200_GAP_A",
410  "L1_MBTS_2_ZDC_A_VZDC_C_VjTE200_GAP_C", "L1_MBTS_2_1ZDC_NZDC_VjTE200_GAP_C",
411  "L1_MBTS_1_VZDC_A_ZDC_C_jTE3_VjTE200", "L1_MBTS_1_ZDC_A_VZDC_C_jTE3_VjTE200",
412  "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200",
413  "L1_MBTS_1_VZDC_A_ZDC_C_jTE3_VjTE200_GAP_A", "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200_GAP_A",
414  "L1_MBTS_1_ZDC_A_VZDC_C_jTE3_VjTE200_GAP_C", "L1_MBTS_1_1ZDC_NZDC_jTE3_VjTE200_GAP_C",
415  #
416  "L1_1ZDC_A_1ZDC_C_VjTE200", "L1_ZDC_1XOR5_VjTE200",
417  "L1_ZDC_XOR_VjTE200",
418  "L1_VZDC_A_VZDC_C_jTE5_VjTE200", "L1_ZDC_XOR_jTE5_VjTE200",
419  "L1_1ZDC_NZDC_jTE5_VjTE200", "L1_5ZDC_A_5ZDC_C_jTE5_VjTE200",
420  "L1_VZDC_A_VZDC_C_jTE10_VjTE200", "L1_ZDC_XOR_jTE10_VjTE200",
421  "L1_1ZDC_NZDC_jTE10_VjTE200",
422  "L1_VZDC_A_VZDC_C_gTE5_VjTE200", "L1_ZDC_XOR_gTE5_VjTE200",
423  "L1_1ZDC_NZDC_gTE5_VjTE200", "L1_5ZDC_A_5ZDC_C_gTE5_VjTE200",
424  "L1_TRT_VZDC_A_VZDC_C_jTE5_VjTE200", "L1_TRT_ZDC_XOR_jTE5_VjTE200",
425  #
426  "L1_ZDC_XOR_jJ5_VjTE200", "L1_ZDC_XOR_jJ10_VjTE200", "L1_1ZDC_NZDC_jJ5_VjTE200",
427  "L1_1ZDC_NZDC_jJ10_VjTE200", "L1_VZDC_A_VZDC_C_jJ5_VjTE200", "L1_VZDC_A_VZDC_C_jJ10_VjTE200",
428  #
429  "L1_gTE3", "L1_gTE5",
430  #
431  "L1_ZDC_HELT15_jTE4000", "L1_ZDC_HELT20_jTE4000", "L1_ZDC_HELT25_jTE4000",
432  "L1_ZDC_HELT35_jTE4000", "L1_ZDC_HELT50_jTE4000",
433  ])
434 
435  # HI HLT menu: Add triggers that are not in the MC menu
436  if "MC" not in menuName:
437  monItems[TBP|TAP|TAV].extend([
438  ])
439 
440  monItems[TBP|TAP|TAV] += topo3_monitems
441 
442 
443  # if any of the HF items are changed CTP and OLC shall be informed (via TrigOps)
444  monItemsHF[TBP|TAP|TAV] = [
445  "L1_jJ30", # beam-induced background measurements
446  "L1_MBTS_1", "L1_MBTS_2", "L1_MBTS_1_1",
447  "L1_BCM_Wide", # beam-induced background measurements
448  "L1_BCM_2A_FIRSTINTRAIN", "L1_BCM_2C_FIRSTINTRAIN" # beam-induced background measurements, used for SCT HV ramp
449  ]
450  # total number of items for HF monitoring doubled from 8 to 16 for HI and pp-ref
451  if "HI" in menuName:
452  monItemsHF[TBP|TAP|TAV].extend([
453  "L1_eEM15" # luminosity measurements
454  ])
455  if "lowMu" in menuFullName:
456  monItemsHF[TBP|TAP|TAV].extend([
457  "L1_ZDC_PP_A", "L1_ZDC_PP_C", "L1_ZDC_PP_A_C", # luminosity measurements
458  "L1_ZDC_PP_OR", # luminosity measurements
459  "L1_ZDC_PP_A2", "L1_ZDC_PP_C2", # luminosity measurements
460  "L1_ZDC_PP_OR2", # luminosity measurements
461  ])
462  else: # HI HLT menu
463  monItemsHF[TBP|TAP|TAV].extend([
464  "L1_ZDC_A", "L1_ZDC_C", "L1_ZDC_A_C", # luminosity measurements
465  "L1_ZDC_OR", "L1_ZDC_XOR", # luminosity measurements
466  "L1_ZDC_C_VZDC_A", "L1_ZDC_A_VZDC_C", "L1_5ZDC_A_5ZDC_C", # luminosity measurements
467  ])
468 
469 
470 
471 
472  check = True
473  if check:
474  counts_LF_items = { TBP : set(), TAP : set(), TAV : set() }
475  counts_HF_items = { TBP : set(), TAP : set(), TAV : set() }
476 
477  for k in range(1,8):
478 
479  if k & TBP:
480  counts_LF_items[TBP].update( monItems[k] )
481  counts_HF_items[TBP].update( monItemsHF[k] )
482 
483  if k & TAP:
484  counts_LF_items[TAP].update( monItems[k] )
485  counts_HF_items[TAP].update( monItemsHF[k] )
486 
487  if k & TAV:
488  counts_LF_items[TAV].update( monItems[k] )
489  counts_HF_items[TAV].update( monItemsHF[k] )
490 
491  counts_LF = dict( map(lambda x : (x[0],len(x[1])), counts_LF_items.items() ) )
492  counts_HF = dict( map(lambda x : (x[0],len(x[1])), counts_HF_items.items() ) )
493 
494  lutsLF = int( (max(counts_LF.values())-1) / 8) + 1
495  lutsHF = int( (max(counts_HF.values())-1) / 8) + 1
496 
497  maxLUTs = 32
498  if lutsLF + lutsHF > maxLUTs:
499  log.error("too many monitoring items are defined:")
500  log.error(" low frequency TBP: %i",counts_LF[TBP])
501  log.error(" TAP: %i",counts_LF[TAP])
502  log.error(" TAV: %i",counts_LF[TAV])
503  log.error(" required LUTs: %i",lutsLF)
504  log.error(" high frequency TBP: %i",counts_HF[TBP])
505  log.error(" TAP: %i",counts_HF[TAP])
506  log.error(" TAV: %i",counts_HF[TAV])
507  log.error(" required LUTs: %i",lutsHF)
508  log.error(" this menu requires %i monitoring LUTs while only %i are available", (lutsLF + lutsHF), maxLUTs)
509  raise RuntimeError("Reduce the number of monitored items")
510 
511  if 'AllCTPIn' not in menuName:
512  MonitorDef.checkForNonExistingMonItems(items, monItems)
513 
514  # for each item set the monitor flags
515  for item in items:
516 
517  itemName = item.name
518  for k,l in monItems.items():
519 
520  if itemName in l:
521  item.addMonitor(k, MonitorDef.LOW_FREQ)
522 
523 
524  for k,l in monItemsHF.items():
525 
526  if itemName in l:
527  item.addMonitor(k, MonitorDef.HIGH_FREQ)
528 
529 
530  @staticmethod
531  def checkForNonExistingMonItems(items, monItems):
532  # check is based on item names
533  allItemNames = [item.name for item in items]
534 
535  # unify all item names that are monitored
536  allMonitorItems = set()
537  for i in range(1,8):
538  allMonitorItems.update(monItems[i])
539 
540  # register all monitems that don't exist in here
541  nonExistingMonItems = []
542 
543  for monItem in allMonitorItems:
544  if monItem not in allItemNames:
545  nonExistingMonItems += [monItem]
546 
547  if len(nonExistingMonItems)>0:
548  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:531
CaloCellPos2Ntuple.int
int
Definition: CaloCellPos2Ntuple.py:24
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:63
plotBeamSpotVxVal.range
range
Definition: plotBeamSpotVxVal.py:195
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.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:56
WriteBchToCool.update
update
Definition: WriteBchToCool.py:67