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()
145 """Top-level cfg function when running in athena"""
146 from AthenaConfiguration.Enums
import Format
152 flags.Common.isOnline =
lambda f:
not f.Input.isMC
156 parser = flags.getArgumentParser()
157 parser.add_argument(
'--preExec', metavar=
'CMD', nargs=
'+',
158 help=
'Commands executed before Python configuration')
159 parser.add_argument(
'--postExec', metavar=
'CMD', nargs=
'+',
160 help=
'Commands executed after Python configuration')
161 parser.add_argument(
'--preInclude', metavar=
'CMD', nargs=
'+',
162 help=
'Module to execute before Python configuration')
163 parser.add_argument(
'--postInclude', metavar=
'CMD', nargs=
'+',
164 help=
'Module to execute after Python configuration')
167 args = flags.fillFromArgs(parser=parser)
169 if flags.Trigger.writeBS:
170 flags.Output.doWriteBS =
True
172 flags.Output.doWriteRDO =
True
173 if not flags.Output.RDOFileName:
174 flags.Output.RDOFileName =
'RDO_TRIG.pool.root'
178 if flags.Trigger.selectChains
or len(flags.Trigger.enabledSignatures)==1:
179 flags.Scheduler.ShowControlFlow =
True
180 flags.Scheduler.ShowDataDeps =
True
182 processPreInclude(args, flags)
183 processPreExec(args, flags)
186 _allflags = flags.clone()
188 if _allflags.Concurrency.NumThreads == 0:
189 raise RuntimeError(
"Trigger jobs must be run in multi-threaded mode. Use --threads=1 (or greater).")
191 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
192 cfg = MainServicesCfg(_allflags)
198 if flags.Input.Format
is Format.BS:
199 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
200 cfg.merge(ByteStreamReadCfg(flags))
202 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
203 cfg.merge(PoolReadCfg(flags))
206 cfg.merge(
runHLTCfg(flags, checkMT=
False))
209 processPostInclude(args, flags, cfg)
212 processPostExec(args, flags, cfg)
215 from AthenaConfiguration.Utils
import setupLoggingLevels
216 setupLoggingLevels(flags, cfg)