ATLAS Offline Software
TRTCalibSkeleton.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 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 TRT_CalibAlgs.TRTCalibrationMgrConfig import CalibConfig, TRT_CalibrationMgrCfg, TRT_StrawStatusCfg
8 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
9 
10 def fromRunArgs(runArgs):
11 
12  from AthenaConfiguration.AllConfigFlags import initConfigFlags
13  flags=initConfigFlags()
14 
15  commonRunArgsToFlags(runArgs, flags)
16 
17  processPreInclude(runArgs, flags)
18  processPreExec(runArgs, flags)
19 
20  flags.Input.Files=runArgs.inputRAWFile
21  flags.Output.HISTFileName=runArgs.outputNTUP_TRTCALIBFile
22 
23  #Importing flags - Switching off detector parts and monitoring
24  CalibConfig(flags)
25 
26  # To respect --athenaopts
27  flags.fillFromArgs()
28 
29  # Reason why we need to clone and replace: https://gitlab.cern.ch/atlas/athena/-/merge_requests/68616#note_7614858
30  flags = flags.cloneAndReplace(
31  "Tracking.ActiveConfig",
32  f"Tracking.{flags.Tracking.PrimaryPassConfig.value}Pass",
33  # Keep original flags as some of the subsequent passes use
34  # lambda functions relying on them
35  keepOriginal=True)
36 
37  flags.lock()
38 
39  cfg=MainServicesCfg(flags)
40 
41  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
42  cfg.merge(ByteStreamReadCfg(flags))
43 
44  from InDetConfig.TrackRecoConfig import InDetTrackRecoCfg
45  cfg.merge(InDetTrackRecoCfg(flags))
46 
47  cfg.merge(TRT_CalibrationMgrCfg(flags))
48  cfg.merge(TRT_StrawStatusCfg(flags))
49 
50  processPostInclude(runArgs, flags, cfg)
51  processPostExec(runArgs, flags, cfg)
52 
53  sc = cfg.run()
54  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.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.TransformUtils.processPreInclude
def processPreInclude(runArgs, flags)
Definition: Tools/PyJobTransforms/python/TransformUtils.py:62
TRTCalibrationMgrConfig.TRT_StrawStatusCfg
def TRT_StrawStatusCfg(flags, name='InDet_TRT_StrawStatus', **kwargs)
Definition: TRTCalibrationMgrConfig.py:84
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:256
python.CommonRunArgsToFlags.commonRunArgsToFlags
def commonRunArgsToFlags(runArgs, configFlags)
Definition: CommonRunArgsToFlags.py:12
TRTCalibSkeleton.fromRunArgs
def fromRunArgs(runArgs)
Definition: TRTCalibSkeleton.py:10
python.TrackRecoConfig.InDetTrackRecoCfg
def InDetTrackRecoCfg(flags)
Main ID tracking config #####################.
Definition: TrackRecoConfig.py:777
TRTCalibrationMgrConfig.CalibConfig
def CalibConfig(flags)
Definition: TRTCalibrationMgrConfig.py:101
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
TRTCalibrationMgrConfig.TRT_CalibrationMgrCfg
def TRT_CalibrationMgrCfg(flags, name='TRT_CalibrationMgr', calibconstants='', **kwargs)
Definition: TRTCalibrationMgrConfig.py:41