ATLAS Offline Software
MdtCondExtraction.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 from AthenaConfiguration.ComponentFactory import CompFactory
3 from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4 
5 def MdtCondJsonDumpAlgCfg(flags, name="MdtCondJsonDumpAlg", **kwargs):
6  result = ComponentAccumulator()
7  the_alg = CompFactory.MdtCondJsonDumpAlg(name, **kwargs)
8  result.addEventAlgo(the_alg, primary = True)
9  return result
10 
11 if __name__ == "__main__":
12  from AthenaConfiguration.AllConfigFlags import initConfigFlags
13  from MuonCondTest.MdtCablingTester import SetupArgParser
14  parser = SetupArgParser()
15 
16  args = parser.parse_args()
17  flags = initConfigFlags()
18  flags.Concurrency.NumThreads = args.threads
19  flags.Concurrency.NumConcurrentEvents = args.threads # Might change this later, but good enough for the moment.
20  flags.Output.ESDFileName = args.output
21  flags.Input.Files = args.inputFile
22  flags.IOVDb.GlobalTag = args.conditionsTag
23  flags.lock()
24 
25  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
26  cfg = MainServicesCfg(flags)
27 
28  from AthenaConfiguration.Enums import Format
29  if flags.Input.Format == Format.POOL:
30  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
31  cfg.merge(PoolReadCfg(flags))
32  elif flags.Input.Format == Format.BS:
33  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
34  cfg.merge(ByteStreamReadCfg(flags))
35 
36  from MuonConfig.MuonCondAlgConfig import MdtCondDbAlgCfg
37  cfg.merge(MdtCondDbAlgCfg(flags))
38  cfg.merge(MdtCondJsonDumpAlgCfg(flags))
39 
40  from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg
41  cfg.merge(MuonIdHelperSvcCfg(flags))
42 
43 
44  cfg.printConfig(withDetails=True, summariseProps=True)
45  flags.dump()
46 
47  sc = cfg.run(1)
48  if not sc.isSuccess():
49  import sys
50  sys.exit("Execution failed")
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.MuonCondAlgConfig.MdtCondDbAlgCfg
def MdtCondDbAlgCfg(flags, **kwargs)
Definition: MuonCondAlgConfig.py:13
python.MuonGeometryConfig.MuonIdHelperSvcCfg
def MuonIdHelperSvcCfg(flags)
Definition: MuonGeometryConfig.py:15
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
MdtCondExtraction.MdtCondJsonDumpAlgCfg
def MdtCondJsonDumpAlgCfg(flags, name="MdtCondJsonDumpAlg", **kwargs)
Definition: MdtCondExtraction.py:5
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69