16from PyJobTransforms.TransformUtils
import processPreExec, processPostExec, processPreInclude, processPostInclude
33 """Set default flags for running HLT"""
34 from AthenaConfiguration.Enums
import BeamType
36 flags.Trigger.doHLT =
True
37 flags.Beam.Type = BeamType.Collisions
38 flags.InDet.useDCS =
False
39 flags.Muon.MuonTrigger =
True
42 flags.Detector.GeometryALFA =
False
43 flags.Detector.GeometryFwdRegion =
False
44 flags.Detector.GeometryLucid =
False
47 flags.Scheduler.CheckDependencies =
True
48 flags.Scheduler.EnableVerboseViews =
True
49 flags.Input.FailOnUnknownCollections =
True
50 flags.Scheduler.AutoLoadUnmetDependencies =
False
54 """Main function to configure the HLT in athena and athenaHLT.
56 checkMT: perform sanity check if we are running in MT mode
59 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
60 from AthenaCommon.Logging
import logging
62 log = logging.getLogger(
'runHLT')
63 cfg = ComponentAccumulator()
67 if checkMT
and flags.Concurrency.NumThreads == 0:
68 raise RuntimeError(
"Trigger jobs must be run in multi-threaded mode. Use --threads=1 (or greater).")
71 loadFromSG = [(
'xAOD::EventInfo',
'StoreGateSvc+EventInfo'),
72 (
'TrigConf::L1Menu',
'DetectorStore+L1TriggerMenu'),
73 (
'TrigConf::HLTMenu',
'DetectorStore+HLTTriggerMenu')]
75 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
76 cfg.merge(SGInputLoaderCfg(flags, loadFromSG))
78 from TriggerJobOpts.TriggerHistSvcConfig
import TriggerHistSvcConfig
79 cfg.merge(TriggerHistSvcConfig(flags))
82 from TriggerMenuMT.HLT.Config.GenerateMenuMT
import generateMenuMT
83 from TriggerJobOpts.TriggerConfig
import triggerRunCfg
84 menu = triggerRunCfg(flags, menu=generateMenuMT)
87 from LumiBlockComps.LumiBlockMuWriterConfig
import LumiBlockMuWriterCfg
88 cfg.merge(LumiBlockMuWriterCfg(flags), sequenceName=
"HLTBeginSeq")
90 if flags.Trigger.doTransientByteStream
and flags.Trigger.doCalo:
91 from TriggerJobOpts.TriggerTransBSConfig
import triggerTransBSCfg_Calo
92 cfg.merge(triggerTransBSCfg_Calo(flags), sequenceName=
"HLTBeginSeq")
95 if flags.Trigger.doLVL1:
96 from TriggerJobOpts.Lvl1SimulationConfig
import Lvl1SimulationCfg
97 cfg.merge(Lvl1SimulationCfg(flags), sequenceName=
"HLTBeginSeq")
101 if flags.Overlay.doTrackOverlay:
102 from TrkEventCnvTools.TrkEventCnvToolsConfig
import TrkEventCnvSuperToolCfg
103 cfg.merge(TrkEventCnvSuperToolCfg(flags))
105 if flags.Common.isOnline:
106 from TrigOnlineMonitor.TrigOnlineMonitorConfig
import trigOpMonitorCfg
107 cfg.merge( trigOpMonitorCfg(flags) )
110 if log.getEffectiveLevel() <= logging.DEBUG:
111 cfg.printConfig(withDetails=
False, summariseProps=
True, printDefaults=
True)
115 cfg.addService(CompFactory.MessageSvc(setError=[
"HepMcParticleLink"]))
117 from AthenaConfiguration.AccumulatorCache
import AccumulatorDecorator
118 AccumulatorDecorator.printStats()
144 """Top-level cfg function when running in athena"""
145 from AthenaConfiguration.Enums
import Format
151 flags.Common.isOnline =
lambda f:
not f.Input.isMC
155 parser = flags.getArgumentParser()
156 parser.add_argument(
'--preExec', metavar=
'CMD', nargs=
'+',
157 help=
'Commands executed before Python configuration')
158 parser.add_argument(
'--postExec', metavar=
'CMD', nargs=
'+',
159 help=
'Commands executed after Python configuration')
160 parser.add_argument(
'--preInclude', metavar=
'CMD', nargs=
'+',
161 help=
'Module to execute before Python configuration')
162 parser.add_argument(
'--postInclude', metavar=
'CMD', nargs=
'+',
163 help=
'Module to execute after Python configuration')
166 args = flags.fillFromArgs(parser=parser)
168 if flags.Trigger.writeBS:
169 flags.Output.doWriteBS =
True
171 flags.Output.doWriteRDO =
True
172 if not flags.Output.RDOFileName:
173 flags.Output.RDOFileName =
'RDO_TRIG.pool.root'
177 if flags.Trigger.selectChains
or len(flags.Trigger.enabledSignatures)==1:
178 flags.Scheduler.ShowControlFlow =
True
179 flags.Scheduler.ShowDataDeps =
True
181 processPreInclude(args, flags)
182 processPreExec(args, flags)
185 _allflags = flags.clone()
187 if _allflags.Concurrency.NumThreads == 0:
188 raise RuntimeError(
"Trigger jobs must be run in multi-threaded mode. Use --threads=1 (or greater).")
190 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
191 cfg = MainServicesCfg(_allflags)
197 if flags.Input.Format
is Format.BS:
198 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
199 cfg.merge(ByteStreamReadCfg(flags))
201 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
202 cfg.merge(PoolReadCfg(flags))
205 cfg.merge(
runHLTCfg(flags, checkMT=
False))
208 processPostInclude(args, flags, cfg)
211 processPostExec(args, flags, cfg)
214 from AthenaConfiguration.Utils
import setupLoggingLevels
215 setupLoggingLevels(flags, cfg)