ATLAS Offline Software
Loading...
Searching...
No Matches
MdtCondExtraction.py
Go to the documentation of this file.
1# Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2from AthenaConfiguration.ComponentFactory import CompFactory
3from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
4
5def 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
11if __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")
MdtCondJsonDumpAlgCfg(flags, name="MdtCondJsonDumpAlg", **kwargs)