4 CA module to configure the (standalone) HLT for athena and athenaHLT.
5 There is a separate entry point for each application to tailor some
6 flags and services. All common code should go to runLTCfg(flags).
9 athena [options] TriggerJobOpts/runHLT.py [flags]
10 athenaHLT [options] TriggerJobOpts.runHLT [flags]
12 python -m TriggerJobOpts.runHLT # not recommended (due to missing LD_PRELOADs)
15 from AthenaConfiguration.ComponentFactory
import CompFactory
18 """Deny access to a few flags and lock"""
21 raise RuntimeError(
"Concurrency flags cannot be used in the HLT to ensure "
22 "that the configuration is portable across different CPUs")
24 flags.Concurrency.NumProcs = bomb
25 flags.Concurrency.NumThreads = bomb
26 flags.Concurrency.NumConcurrentEvents = bomb
32 """Set default flags for running HLT"""
33 from AthenaConfiguration.Enums
import BeamType
35 flags.Trigger.doHLT =
True
36 flags.Beam.Type = BeamType.Collisions
37 flags.InDet.useDCS =
False
38 flags.Muon.MuonTrigger =
True
41 flags.Detector.GeometryALFA =
False
42 flags.Detector.GeometryFwdRegion =
False
43 flags.Detector.GeometryLucid =
False
46 flags.Scheduler.CheckDependencies =
True
47 flags.Scheduler.EnableVerboseViews =
True
48 flags.Input.FailOnUnknownCollections =
True
49 flags.Scheduler.AutoLoadUnmetDependencies =
False
53 """Main function to configure the HLT in athena and athenaHLT.
55 checkMT: perform sanity check if we are running in MT mode
58 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
59 from AthenaCommon.Logging
import logging
61 log = logging.getLogger(
'runHLT')
66 if checkMT
and flags.Concurrency.NumThreads == 0:
67 raise RuntimeError(
"Trigger jobs must be run in multi-threaded mode. Use --threads=1 (or greater).")
70 loadFromSG = [(
'xAOD::EventInfo',
'StoreGateSvc+EventInfo'),
71 (
'TrigConf::L1Menu',
'DetectorStore+L1TriggerMenu'),
72 (
'TrigConf::HLTMenu',
'DetectorStore+HLTTriggerMenu')]
74 from SGComps.SGInputLoaderConfig
import SGInputLoaderCfg
77 from TriggerJobOpts.TriggerHistSvcConfig
import TriggerHistSvcConfig
81 from TriggerMenuMT.HLT.Config.GenerateMenuMT
import generateMenuMT
82 from TriggerJobOpts.TriggerConfig
import triggerRunCfg
86 from LumiBlockComps.LumiBlockMuWriterConfig
import LumiBlockMuWriterCfg
89 if flags.Trigger.doTransientByteStream
and flags.Trigger.doCalo:
90 from TriggerJobOpts.TriggerTransBSConfig
import triggerTransBSCfg_Calo
94 if flags.Trigger.doLVL1:
95 from TriggerJobOpts.Lvl1SimulationConfig
import Lvl1SimulationCfg
100 if flags.Overlay.doTrackOverlay:
101 from TrkEventCnvTools.TrkEventCnvToolsConfig
import TrkEventCnvSuperToolCfg
104 if flags.Common.isOnline:
105 from TrigOnlineMonitor.TrigOnlineMonitorConfig
import trigOpMonitorCfg
109 if log.getEffectiveLevel() <= logging.DEBUG:
110 cfg.printConfig(withDetails=
False, summariseProps=
True, printDefaults=
True)
114 cfg.addService(CompFactory.MessageSvc(setError=[
"HepMcParticleLink"]))
116 from AthenaConfiguration.AccumulatorCache
import AccumulatorDecorator
117 AccumulatorDecorator.printStats()
123 """Top-level cfg function when running in athenaHLT"""
131 from TrigPSC
import PscConfig
132 for flag_arg
in PscConfig.unparsedArguments:
133 flags.fillFromString(flag_arg)
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(
'--postExec', metavar=
'CMD',
157 help=
'Commands executed after Python configuration')
160 args = flags.fillFromArgs(parser=parser)
162 if flags.Trigger.writeBS:
163 flags.Output.doWriteBS =
True
165 flags.Output.doWriteRDO =
True
166 if not flags.Output.RDOFileName:
167 flags.Output.RDOFileName =
'RDO_TRIG.pool.root'
171 if flags.Trigger.selectChains
or len(flags.Trigger.enabledSignatures)==1:
172 flags.Scheduler.ShowControlFlow =
True
173 flags.Scheduler.ShowDataDeps =
True
176 _allflags = flags.clone()
178 if _allflags.Concurrency.NumThreads == 0:
179 raise RuntimeError(
"Trigger jobs must be run in multi-threaded mode. Use --threads=1 (or greater).")
181 from AthenaConfiguration.MainServicesConfig
import MainServicesCfg
188 if flags.Input.Format
is Format.BS:
189 from ByteStreamCnvSvc.ByteStreamConfig
import ByteStreamReadCfg
192 from AthenaPoolCnvSvc.PoolReadConfig
import PoolReadCfg
196 cfg.merge(
runHLTCfg(flags, checkMT=
False))
202 from AthenaConfiguration.Utils
import setupLoggingLevels
209 """This method is called by athenaHLT (with pre-populated flags)"""
214 if __name__ ==
"__main__":
215 from AthenaConfiguration.AllConfigFlags
import initConfigFlags