ATLAS Offline Software
Loading...
Searching...
No Matches
RDOtoBS_Skeleton.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
4
5from AthenaCommon.Logging import logging
6log = logging.getLogger('RDOtoBS')
7
8# force no legacy job properties
9from AthenaCommon import JobProperties
10JobProperties.jobPropertiesDisallowed = True
11
12
13def configureFlags(runArgs):
14 # some basic settings here...
15 from AthenaConfiguration.AllConfigFlags import initConfigFlags
16 flags = initConfigFlags()
17 from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
18 commonRunArgsToFlags(runArgs, flags)
19
20 # Input
21 if hasattr(runArgs, 'inputRDOFile'):
22 flags.Input.Files = runArgs.inputRDOFile
23
24 # Output
25 if hasattr(runArgs, 'outputBSFile'):
26 flags.Output.BSFileName = runArgs.outputBSFile
27
28 flags.Output.doWriteBS=True
29
30 from RecJobTransforms.RecoConfigFlags import recoRunArgsToFlags
31 recoRunArgsToFlags(runArgs, flags)
32
33 from AthenaConfiguration.Enums import ProductionStep
34 flags.Common.ProductionStep=ProductionStep.Reconstruction
35
36 # Setup perfmon flags from runargs
37 from PerfMonComps.PerfMonConfigHelpers import setPerfmonFlagsFromRunArgs
38 setPerfmonFlagsFromRunArgs(flags, runArgs)
39
40 # process pre-include/exec
41 processPreInclude(runArgs, flags)
42 processPreExec(runArgs, flags)
43
44 # To respect --athenaopts
45 flags.fillFromArgs()
46
47 # Lock flags
48 flags.lock()
49
50 return flags
51
52
53def fromRunArgs(runArgs):
54
55 import time
56 timeStart = time.time()
57
58 flags = configureFlags(runArgs)
59
60 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
61 cfg = MainServicesCfg(flags)
62 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
63 cfg.merge(PoolReadCfg(flags))
64
65 from RecJobTransforms.RDOtoBS_Steering import RDOtoBS_Steering
66 cfg.merge(RDOtoBS_Steering(flags))
67
68 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamWriteCfg
69 cfg.merge(ByteStreamWriteCfg(flags))
70
71
72 # Post-include
73 processPostInclude(runArgs, flags, cfg)
74
75 # Post-exec
76 processPostExec(runArgs, flags, cfg)
77
78 from AthenaCommon.Constants import INFO
79 if flags.Exec.OutputLevel <= INFO:
80 cfg.printConfig()
81
82 # Run the final accumulator
83 sc = cfg.run()
84 timeFinal = time.time()
85 log.info("Run RDOtoBS_skeleton in %d seconds", timeFinal - timeStart)
86
87 import sys
88 sys.exit(sc.isFailure())