8 from AthenaCommon.Logging
import logging
9 log = logging.getLogger(
'ValidateEBMenu.py')
13 return chainName.replace(
"HLT_noalg_L1",
"L1_").
replace(
"_noPS",
"")
16 if __name__==
'__main__':
17 from argparse
import ArgumentParser
18 parser = ArgumentParser()
19 parser.add_argument(
'--hltPsk', type=str, help=
'HLTPrescale.json file')
20 parser.add_argument(
'--l1Psk', type=str, help=
'HLTPrescale.json file')
21 args = parser.parse_args()
24 "HLT_eb_low_L1RD2_FILLED",
"HLT_eb_medium_L1RD2_FILLED",
25 "HLT_noalg_L1PhysicsHigh_noPS",
"HLT_noalg_L1PhysicsVeryHigh_noPS",
26 "HLT_noalg_L1RD3_FILLED",
"HLT_noalg_L1RD3_EMPTY",
27 "HLT_noalg_L1EMPTY_noPS",
"HLT_noalg_L1FIRSTEMPTY_noPS",
28 "HLT_noalg_L1UNPAIRED_ISO_noPS",
"HLT_noalg_L1UNPAIRED_NONISO_noPS"
31 if not args.hltPsk
or not args.l1Psk:
32 log.error(
"Prescale files are required!")
35 with open(args.hltPsk)
as f:
36 HLTPrescales = json.load(f)[
"prescales"]
38 with open(args.l1Psk)
as f:
39 L1Prescales = json.load(f)[
"cutValues"]
41 from TriggerMenuMT.HLT.Menu.L1Seeds
import getEBnoL1PSSeed
42 from TriggerMenuMT.HLT.CalibCosmicMon.EnhancedBiasChainConfiguration
import l1seeds
46 for chainName
in ebChains:
47 log.info(f
"Processing chain {chainName}...")
48 hltPrescale = HLTPrescales[chainName]
50 log.error(f
"Chain {chainName} not found in the HLT Prescales file")
53 if not hltPrescale[
"enabled"]:
54 log.error(f
"Chain {chainName} disabled in the HLT Prescales file")
57 if "noalg" not in chainName:
58 if "medium" in chainName:
59 currentSeeds = l1seeds[
"medium"]
61 currentSeeds = l1seeds[
"low"]
63 for seedName
in currentSeeds:
64 if seedName
in alreadyProcessed:
65 log.error(f
"Seed {seedName} is already part of eb chain {alreadyProcessed[seedName]}")
67 alreadyProcessed[seedName] = chainName
69 l1Prescale = L1Prescales[seedName]
71 log.error(f
"Seed {seedName} of chain {chainName} not found in the L1 Prescales file")
74 if not l1Prescale[
"enabled"]:
75 log.error(f
"Seed {seedName} of chain {chainName} is disabled in the L1 Prescales file")
78 elif "_noPS" in chainName:
80 for seedName
in currentSeeds:
81 if seedName
in alreadyProcessed:
82 log.error(f
"Seed {seedName} is already part of eb chain {alreadyProcessed[seedName]}")
84 alreadyProcessed[seedName] = chainName
86 l1Prescale = L1Prescales[seedName]
88 log.error(f
"Seed {seedName} of chain {chainName} not found in the L1 Prescales file")
91 if not l1Prescale[
"enabled"]:
92 log.error(f
"Seed {seedName} of chain {chainName} is disabled in the L1 Prescales file")
95 if l1Prescale[
"cut"] != 1:
96 log.error(f
"Seed {seedName} of chain {chainName} is prescaled in the L1 Prescales file (it is in no prescale category)")
101 l1Prescale = L1Prescales[seedName]
103 log.error(f
"Seed {seedName} of chain {chainName} not found in the L1 Prescales file")
106 if not l1Prescale[
"enabled"]:
107 log.error(f
"Seed {seedName} of chain {chainName} is disabled in the L1 Prescales file")