3 from AthenaCommon.Logging
import logging
4 log = logging.getLogger(__name__)
9 from TriggerMenuMT.L1.Config.TriggerTypeDef
import TT
10 rpcout_type = TT.muon | TT.phys
11 rpcin_type = TT.muon | TT.phys
12 cl_type = TT.calo | TT.phys
15 calo_exceptions =
set([])
24 The function returns those items where the items triggertype, after applying the mask, matches the pattern.
25 With this one can also select items where a certain bit is disabled
27 if triggertype_pattern<0
or triggertype_pattern>0xFF:
28 raise RuntimeError(
'TriggerPythonConfig.Lvl1ItemByTriggerType(triggertype_pattern,triggertype_bitmask) needs to be called with 0<=triggertype_pattern<=0xFF, ' + \
29 +
'but is called with triggertype_pattern=%i' % triggertype_pattern)
30 if triggertype_bitmask<0
or triggertype_bitmask>0xFF:
31 raise RuntimeError(
'TriggerPythonConfig.Lvl1ItemByTriggerType(triggertype_pattern,triggertype_bitmask) needs to be called with 0<=triggertype_bitmask<=0xFF, ' + \
32 +
'but is called with triggertype_bitmask=%i' % triggertype_bitmask)
33 itemsForMenu = [item
for item
in l1object
if l1object[item][
'ctpid'] != -1]
35 log.error(
'No item defined for the L1 Menu, the TriggerConfL1 object does not contain items')
36 res = [item
for item
in itemsForMenu
if ( (triggertype_bitmask &
int(l1object[item][
'triggerType'],2)) == triggertype_pattern)]
44 'L1_BCM_2A_2C_BGRP12',
'L1_BCM_2A_2C_UNPAIRED_ISO',
45 'L1_BCM_Wide_CALIB',
'L1_BCM_Wide_BGRP12',
'L1_BCM_Wide_EMPTY',
'L1_BCM_Wide_UNPAIREDB1',
'L1_BCM_Wide_UNPAIREDB2',
46 'L1_BCM_2A_CALIB',
'L1_BCM_2C_CALIB',
47 'L1_BCM_2A_EMPTY',
'L1_BCM_2C_EMPTY',
48 'L1_BCM_2A_UNPAIREDB1',
'L1_BCM_2C_UNPAIREDB1',
'L1_BCM_2A_UNPAIREDB2',
'L1_BCM_2C_UNPAIREDB2',
49 'L1_BCM_2A_FIRSTINTRAIN',
'L1_BCM_2C_FIRSTINTRAIN',
50 'L1_jJ30_UNPAIREDB1',
'L1_jJ30_UNPAIREDB2',
51 'L1_jJ30_UNPAIRED_ISO',
'L1_jJ30_UNPAIRED_NONISO',
52 'L1_jJ90_UNPAIRED_ISO',
'L1_jJ90_UNPAIRED_NONISO',
53 'L1_jJ30_EMPTY',
'L1_jJ30_FIRSTEMPTY',
'L1_jJ30_BGRP12',
58 standby_seeds = [ x
for x
in l1items
if \
59 "_EMPTY" not in x
and "CALREQ" not in x
and "ZB" not in x
and \
60 "-" not in x
and "CMU" not in x
and "RD" not in x
and \
61 "BCM" not in x
and "BGRP12" not in x
67 return [ x
for x
in l1items
if "-" in x
or "CMU" in x ]
71 if (
'EMPTY' in l1seed):
75 if (
'EMPTY' in x
and 'FIRSTEMPTY' not in x) ]
77 l1calo_seeds = [ x
for x
in Lvl1ItemByTriggerType(l1object, cl_type, cl_type)
if (
"EMPTY" not in x
or "FIRSTEMPTY" in x) \
78 and (x
not in calo_exceptions) ]
83 tau_seeds = [ x
for x
in l1items
if "TAU" in x
and "-" not in x
and "EMPTY" not in x
and "ISO" not in x]
88 return [
'L1_J15',
'L1_3J15',
'L1_3J10',
'L1_4J10']
91 return [
'L1_J15',
'L1_3J15',
'L1_3J10',
'L1_4J10']
95 if (
'EMPTY' in l1seed):
96 muon_seeds_list = [ x
for x
in Lvl1ItemByTriggerType(l1object, rpcout_type, rpcout_type)
if (
'MU' in x
and '_EMPTY' in x ) ]
97 muon_seeds_list =
list(
set(muon_seeds_list))
98 muon_seeds = muon_seeds_list
100 muon_seeds_list = [ x
for x
in Lvl1ItemByTriggerType(l1object, rpcout_type, rpcout_type)
if (
'MU' in x
and 'FIRSTEMPTY' in x ) ]
102 muon_seeds_list =
list(
set(muon_seeds_list))
103 muon_seeds = muon_seeds_list
110 ebitem = l1seedname.strip(
'L1_').rstrip(
'_noPS')
115 'L1_eEM18L_MU8F',
'L1_eEM26M',
'L1_eEM26T',
'L1_eEM28M',
'L1_2eEM10L_MU8F',
'L1_2eEM18M',
117 'L1_4jJ40',
'L1_jJ160',
'L1_jXE100',
'L1_2jJ40_jXE110',
119 'L1_MU8F_cTAU30M',
'L1_MU14FCH',
'L1_MU18VFCH',
'L1_MU10BOM',
121 'L1_3MU5VF',
'L1_MU8F_2jJ40_jJ50',
122 'L1_jJ55p0ETA23_2jJ40p30ETA49',
'L1_jJ125p30ETA49',
'L1_jJ80p0ETA25_2jJ55_jJ50p30ETA49',
123 'L1_2MU5VF_3MU3V',
'L1_MU8VF_2MU5VF',
124 'L1_jMJJ-500-NFF',
'L1_jJ85p0ETA21_3jJ40p0ETA25',
'L1_SC111-CjJ40',
125 'L1_HT190-jJ40s5pETA21',
'L1_cTAU30M_2cTAU20M_4jJ30p0ETA25',
126 'L1_cTAU30M_2cTAU20M_DR-eTAU30eTAU20-jJ55',
'L1_eEM18M_2cTAU20M_jXE70',
130 'L1_jJ500',
'L1_jXE500'
134 'L1_jJ30_EMPTY',
'L1_MU8VF_EMPTY',
'L1_eTAU12_EMPTY',
'L1_eTAU60_EMPTY',
'L1_eEM9_EMPTY'
138 'L1_jJ30_FIRSTEMPTY',
'L1_eTAU12_FIRSTEMPTY',
'L1_eEM9_FIRSTEMPTY'
142 'L1_jJ30_UNPAIRED_ISO',
'L1_jJ40p30ETA49_UNPAIRED_ISO',
143 'L1_MU3V_UNPAIRED_ISO',
'L1_eEM9_UNPAIRED_ISO',
'L1_eTAU12_UNPAIRED_ISO',
'L1_eTAU60_UNPAIRED_ISO'
147 'L1_jJ30_UNPAIRED_NONISO',
149 'ABORTGAPNOTCALIB': []
159 'L1_2MU5VF',
'L1_3MU3V',
162 'L1_TAU60',
'L1_eTAU30M_2eTAU20M_jJ55_2jJ50_3jJ30',
163 'L1_EM15HI_2TAU12IM_XE35',
164 'L1_MU8F_eTAU20M_jXE70',
165 'L1_MU8F_cTAU20M_jXE70',
166 'L1_TAU20_2TAU12_XE35',
167 'L1_eTAU30M_2eTAU20M_jXE70',
168 'L1_EM15HI_2TAU12IM',
'L1_EM15HI_2TAU12IM_J25_3J12',
169 'L1_EM15HI_TAU40_2TAU15',
170 'L1_MU8F_eTAU20M_jJ55_2jJ30',
174 'L1_XE50',
'L1_3J25p0ETA23',
175 'L1_3J40',
'L1_2jJ40_jXE110',
176 'L1_MU5VF_jJ80',
'L1_J75p31ETA49'
183 'L1_JPSI-1M5-eEM9',
'L1_JPSI-1M5-eEM15',
184 'L1_BPH-0M9-eEM9-eEM7_MU5VF',
186 'L1_eEM22M_jMJJ-300',
188 'L1_BPH-0M9-eEM9-eEM7_2MU3V',
193 'L1_MU8F_eTAU20M_3jJ30',
194 'L1_MU8F_cTAU20M_3jJ30',
197 'L1_eEM18M_2cTAU20M_jXE70',
198 'L1_cTAU35M_2cTAU30M_2jJ55_3jJ50',
199 'L1_cTAU30M_2cTAU20M_4jJ30p0ETA25',
200 'L1_eEM18M_2cTAU20M_4jJ30',
204 'L1_jJ80p0ETA25_2jJ55_jJ50p30ETA49',
205 'L1_jJ55p0ETA23_2jJ40p30ETA49',
211 'L1_eEM18',
'L1_2eEM18',
'L1_2eEM18M',
'L1_2eEM18L',
212 'L1_eEM26M',
'L1_eEM26L',
217 'L1_cTAU30M_2cTAU20M_DR-eTAU30eTAU20-jJ55'
225 'L1_JPSI-1M5-eEM9',
'L1_JPSI-1M5-eEM15',
226 'L1_BPH-0M9-eEM9-eEM7_MU5VF',
228 'L1_EM18VHI_MJJ-300',
230 'L1_BPH-0M9-EM7-EM5_2MU3V',
234 'L1_MU8F_TAU12IM_3J12',
237 'L1_TAU40_2TAU12IM_XE40',
238 'L1_EM15VHI_2TAU12IM_XE35',
239 'L1_TAU25IM_2TAU20IM_2J25_3J20',
240 'L1_TAU20IM_2TAU12IM_4J12p0ETA25',
241 'L1_EM15VHI_2TAU12IM_4J12',
242 'L1_DR-TAU20ITAU12I-J25',
246 'L1_J40p0ETA25_2J25_J20p31ETA49',
247 'L1_J25p0ETA23_2J15p31ETA49',
251 'L1_3J15p0ETA25_XE40',
253 'L1_eEM18',
'L1_2eEM18',
'L1_2eEM18M',
'L1_2eEM18L',
254 'L1_eEM26M',
'L1_eEM26L',
257 'L1_eEM22M_jMJJ-300',
260 'L1_BPH-0M9-eEM9-eEM7_2MU3V',
271 'L1_BPH-2M9-0DR15-MU5VFMU3V',
272 'L1_BPH-2M9-0DR15-2MU3V',
273 'L1_BPH-2M9-0DR15-2MU3V',
274 'L1_BPH-0M9-eEM9-eEM7_MU5VF',
275 'L1_BPH-0DR3-eEM9jJ40_MU5VF',
276 'L1_BPH-0DR3-eEM9jJ40_2MU3V',
280 'L1_jJ90_DETA20-jJ90J',
299 'L1_BPH-2M9-0DR15-MU5VFMU3V',
300 'L1_BPH-2M9-0DR15-2MU3V',
301 'L1_BPH-2M9-0DR15-2MU3V',
302 'L1_BPH-0M9-EM7-EM5_MU5VF',
303 'L1_BPH-0DR3-EM7J15_MU5VF',
304 'L1_BPH-0DR3-EM7J15_2MU3V',
309 'L1_J50_DETA20-J50J',
324 L1_multiseed_simple_getters = {
326 'L1_Bkg': getL1BackgroundSeed,
327 'L1_BS': getL1BSSeed,
328 'L1_LowLumi': getL1LowLumi,
329 'L1_BKeePrimary': getL1BKeePrimary,
330 'L1_BKeePrimaryLegacy': getL1BKeePrimaryLegacy,
331 'L1_BKeePrescaled': getL1BKeePrescaled,
332 'L1_BKeePrescaledLegacy': getL1BKeePrescaledLegacy,
338 'L1_PhysicsHigh_noPS',
'L1_PhysicsVeryHigh_noPS',
339 'L1_EMPTY_noPS',
'L1_FIRSTEMPTY_noPS',
340 'L1_UNPAIRED_ISO_noPS',
'L1_UNPAIRED_NONISO_noPS',
'L1_UNPAIREDB1_noPS',
'L1_UNPAIREB2_noPS',
'L1_ABORTGAPNOTCALIB_noPS',
342 'L1_Calo',
'L1_Calo_EMPTY',
343 'L1_Muon',
'L1_Muon_EMPTY',
345 'L1_Standby',
'L1_Topo',
'L1_TAU'
346 ] +
list(L1_multiseed_simple_getters.keys())
349 l1items = l1itemobject.keys()
353 log.error(
'No L1item name given!')
354 raise RuntimeError(
'No name provided to multiseed getter')
356 if l1seedname
in L1_multiseed_simple_getters:
357 L1Seed = L1_multiseed_simple_getters[l1seedname]()
358 elif l1seedname ==
'L1_Standby':
360 elif l1seedname ==
'L1_Topo':
362 elif l1seedname ==
'L1_TAU':
364 elif (l1seedname
in [
'L1_PhysicsHigh_noPS',
'L1_PhysicsVeryHigh_noPS',
'L1_EMPTY_noPS',
'L1_FIRSTEMPTY_noPS',
'L1_UNPAIRED_ISO_noPS',
'L1_UNPAIRED_NONISO_noPS',
'L1_UNPAIREDB1_noPS',
'L1_UNPAIREB2_noPS',
'L1_ABORTGAPNOTCALIB_noPS']):
366 elif (l1seedname
in [
'L1_Calo',
'L1_Calo_EMPTY']):
368 elif (l1seedname
in [
'L1_Muon',
'L1_Muon_EMPTY']):
370 elif (l1seedname ==
'L1_All'):
373 log.error(
'Given seed %s could not be found!', l1seedname)
374 raise RuntimeError(f
'Failed to retrieve L1 item list for {l1seedname}')
378 if item
not in l1items:
379 log.error(
'L1 item %s from %s seeds is not in current L1 menu', item, l1seedname)
382 L1Seed =
",".
join(L1Seed)
392 'L1_TAU8_EMPTY' : [
'HA8'],
393 'L1_TAU8_FIRSTEMPTY' : [
'HA8'],
394 'L1_TAU8_UNPAIRED_ISO' : [
'HA8'],
395 'L1_TAU8_UNPAIRED_NONISO': [
'HA8'],
396 'L1_TAU12_EMPTY' : [
'HA12'],
397 'L1_TAU12_FIRSTEMPTY' : [
'HA12'],
398 'L1_TAU12_UNPAIRED_ISO' : [
'HA12'],
399 'L1_RD0_FIRSTEMPTY' : [
''],
400 'L1_TAU30' : [
'HA30'],
401 'L1_TAU30_EMPTY' : [
'HA30'],
402 'L1_TAU30_UNPAIRED_ISO' : [
'HA30'],
403 'L1_TAU40' : [
'HA40'],
404 'L1_TAU60' : [
'HA60'],
405 'L1_TAU100' : [
'HA100'],
408 L1Map[
'L1_CALREQ2']=[
'CAL2']
412 log.debug(
'Mapped L1 input TE from %s to %s.', l1item, TE)
415 TE = l1item.replace(
"L1_",
"").
split(
"_")[0]
416 TE = TE[1:]
if TE[0].isdigit()
else TE