ATLAS Offline Software
HelloWorldSkeleton.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 import sys
4 
5 from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
6 from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
7 from AthExHelloWorld.HelloWorldConfig import HelloWorldCfg
8 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
9 
10 # force no legacy job properties
11 from AthenaCommon import JobProperties
12 JobProperties.jobPropertiesDisallowed = True
13 
14 
15 def fromRunArgs(runArgs):
16  from AthenaConfiguration.AllConfigFlags import initConfigFlags
17  flags = initConfigFlags()
18 
19  commonRunArgsToFlags(runArgs, flags)
20 
21  processPreInclude(runArgs, flags)
22  processPreExec(runArgs, flags)
23 
24  if '_ATHENA_GENERIC_INPUTFILE_NAME_' in flags.Input.Files:
25  flags.Input.Files = []
26 
27  # To respect --athenaopts
28  flags.fillFromArgs()
29 
30  # Run 10 events by default
31  if flags.Exec.MaxEvents == -1:
32  flags.Exec.MaxEvents = 10
33 
34  flags.lock()
35 
36  cfg=MainServicesCfg(flags)
37  cfg.merge(HelloWorldCfg(flags))
38 
39  processPostInclude(runArgs, flags, cfg)
40  processPostExec(runArgs, flags, cfg)
41 
42  # Run the final accumulator
43  sc = cfg.run()
44  sys.exit(not sc.isSuccess())
python.TransformUtils.processPreExec
def processPreExec(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:41
python.TransformUtils.processPostExec
def processPostExec(runArgs, flags, cfg)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:50
python.TransformUtils.processPostInclude
def processPostInclude(runArgs, flags, cfg)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:69
python.TransformUtils.processPreInclude
def processPreInclude(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:62
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
python.CommonRunArgsToFlags.commonRunArgsToFlags
def commonRunArgsToFlags(runArgs, configFlags)
Definition: CommonRunArgsToFlags.py:12
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
HelloWorldConfig.HelloWorldCfg
def HelloWorldCfg(flags)
Definition: HelloWorldConfig.py:28
python.HelloWorldSkeleton.fromRunArgs
def fromRunArgs(runArgs)
Definition: HelloWorldSkeleton.py:15