ATLAS Offline Software
Loading...
Searching...
No Matches
HelloWorldSkeleton.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2
3import sys
4
5from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
6from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
7from AthExHelloWorld.HelloWorldConfig import HelloWorldCfg
8from AthenaConfiguration.MainServicesConfig import MainServicesCfg
9
10# force no legacy job properties
11from AthenaCommon import JobProperties
12JobProperties.jobPropertiesDisallowed = True
13
14
15def 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())