6 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
8 from AthenaConfiguration.AutoConfigFlags
import GetFileMD
10 from AthenaCommon.Logging
import logging
11 log = logging.getLogger(
'RunEBWeightsComputation.py')
17 ebAlg = CompFactory.EnhancedBiasWeightCompAlg()
18 ebAlg.ChainToItemMap = itemsMap
19 ebAlg.OutputLevel = flags.Exec.OutputLevel
20 acc.addEventAlgo(ebAlg)
27 run =
GetFileMD(inputFile)[
'runNumbers'][0]
28 lb =
GetFileMD(inputFile)[
'lumiBlockNumbers'][0]
30 from TrigConfigSvc.TrigConfigSvcCfg
import getTrigConfFromCool
36 from TrigConfIO.HLTTriggerConfigAccess
import HLTJobOptionsAccess
37 joData = HLTJobOptionsAccess(dbalias = db, smkey = smk)
42 chainToItem[
"HLT_eb_low_L1RD2_FILLED"] = ast.literal_eval(joData.properties(
"EnhancedBiasHypo.HLT_eb_low_L1RD2_FILLED")[
"L1ItemNames"])
43 chainToItem[
"HLT_eb_medium_L1RD2_FILLED"] = ast.literal_eval(joData.properties(
"EnhancedBiasHypo.HLT_eb_medium_L1RD2_FILLED")[
"L1ItemNames"])
48 if __name__==
'__main__':
50 from argparse
import ArgumentParser
51 parser = ArgumentParser()
52 parser.add_argument(
'--maxEvents', type=int, help=
'Maximum number of events to process')
53 parser.add_argument(
'--skipEvents', type=int, help=
'Number of events to skip')
54 parser.add_argument(
'--skipHLTSeeds', action=
"store_true", help=
'Read HLT seeds for EB items, used for pp EB runs')
55 parser.add_argument(
'--loglevel', type=int, default=3, help=
'Verbosity level: 1 - VERBOSE, 2 - DEBUG, 3 - INFO')
56 parser.add_argument(
'flags', nargs=
'*', help=
'Config flag overrides')
57 args = parser.parse_args()
59 log.setLevel(args.loglevel)
62 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
63 from AthenaConfiguration.TestDefaults
import defaultGeometryTags
66 flags.fillFromArgs(args.flags)
67 flags.Trigger.triggerConfig =
'DB'
68 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
69 flags.Exec.OutputLevel = args.loglevel
70 flags.Trigger.doNavigationSlimming =
False
71 flags.Exec.EventPrintoutInterval = 1000
75 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
78 isRunningFromAOD =
True if len(flags.Input.Collections)
else False
80 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
83 from TriggerJobOpts.TriggerRecoConfig
import TriggerRecoCfg
87 itemsMap = {}
if args.skipHLTSeeds
else readHLTSeeds(smk = configKeys[
"SMK"], db = configKeys[
"DB"])
92 cfg.printConfig(withDetails=
False)
94 sc = cfg.run(args.maxEvents)
95 sys.exit(0
if sc.isSuccess()
else 1)