ATLAS Offline Software
RDOtoRDO_TRIG_Skeleton.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 from PyJobTransforms.TransformUtils import processPreExec, processPreInclude, processPostExec, processPostInclude
4 from TriggerJobOpts import runHLT
5 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
6 
7 from AthenaCommon.Logging import logging
8 log = logging.getLogger('RDOtoRDO_TRIG')
9 
10 # force no legacy job properties
11 from AthenaCommon import JobProperties
12 JobProperties.jobPropertiesDisallowed = True
13 
14 
15 def configureFlags(runArgs):
16  # some basic settings here...
17  from AthenaConfiguration.AllConfigFlags import initConfigFlags
18  flags = initConfigFlags()
19  from PyJobTransforms.CommonRunArgsToFlags import commonRunArgsToFlags
20  commonRunArgsToFlags(runArgs, flags)
21 
22  # Set standard flags for HLT jobs
23  runHLT.set_flags(flags)
24 
25  # Input
26  if hasattr(runArgs, 'inputRDOFile'):
27  flags.Input.Files = runArgs.inputRDOFile
28 
29  # Output
30  if hasattr(runArgs, 'outputRDO_TRIGFile'):
31  flags.Output.RDOFileName = runArgs.outputRDO_TRIGFile
32  log.info("---------- Configured RDO_TRIG output")
33 
34  from RecJobTransforms.RecoConfigFlags import recoRunArgsToFlags
35  recoRunArgsToFlags(runArgs, flags)
36 
37  from AthenaConfiguration.Enums import ProductionStep
38  flags.Common.ProductionStep=ProductionStep.Reconstruction
39 
40  # Setup perfmon flags from runargs
41  from PerfMonComps.PerfMonConfigHelpers import setPerfmonFlagsFromRunArgs
42  setPerfmonFlagsFromRunArgs(flags, runArgs)
43 
44  # process pre-include/exec
45  processPreInclude(runArgs, flags)
46  processPreExec(runArgs, flags)
47 
48  # To respect --athenaopts
49  flags.fillFromArgs()
50 
51  # Lock flags
52  flags.lock()
53 
54  return flags
55 
56 
57 
58 def fromRunArgs(runArgs):
59 
60  import time
61  timeStart = time.time()
62 
63  flags = configureFlags(runArgs)
64 
65  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
66  cfg = MainServicesCfg(flags)
67  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
68  cfg.merge(PoolReadCfg(flags))
69  cfg.merge( runHLT.runHLTCfg(flags) )
70  cfg.merge( PerfMonMTSvcCfg(flags) )
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 RDOtoRDO_TRIG_skeleton in %d seconds", timeFinal - timeStart)
86 
87  import sys
88  sys.exit(sc.isFailure())
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.RecoConfigFlags.recoRunArgsToFlags
def recoRunArgsToFlags(runArgs, flags)
Definition: RecoConfigFlags.py:196
python.TransformUtils.processPreInclude
def processPreInclude(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:62
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
python.RDOtoRDO_TRIG_Skeleton.fromRunArgs
def fromRunArgs(runArgs)
Definition: RDOtoRDO_TRIG_Skeleton.py:58
python.PerfMonConfigHelpers.setPerfmonFlagsFromRunArgs
def setPerfmonFlagsFromRunArgs(flags, runArgs)
Definition: PerfMonConfigHelpers.py:3
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
Constants
some useful constants -------------------------------------------------—
python.CommonRunArgsToFlags.commonRunArgsToFlags
def commonRunArgsToFlags(runArgs, configFlags)
Definition: CommonRunArgsToFlags.py:12
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69
python.RDOtoRDO_TRIG_Skeleton.configureFlags
def configureFlags(runArgs)
Definition: RDOtoRDO_TRIG_Skeleton.py:15