ATLAS Offline Software
Loading...
Searching...
No Matches
DumpABLines.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 MuonABLineJsonDumpAlgCfg(flags, name = "MuonABLineJsonDumpAlg", **kwargs):
6 result = ComponentAccumulator()
7 event_algo = CompFactory.MuonABLineJsonDumpAlg(name,**kwargs)
8 result.addEventAlgo(event_algo, primary = True)
9 return result
10
11if __name__ == "__main__":
12 from AthenaConfiguration.AllConfigFlags import initConfigFlags
13 from MuonCondTest.MdtCablingTester import SetupArgParser
14 from AthenaConfiguration.TestDefaults import defaultTestFiles
15 parser = SetupArgParser()
16 parser.set_defaults(output="ForkLiftTruckDrivingIsFun.json")
17 parser.set_defaults(inputFile = defaultTestFiles.ESD_RUN3_DATA22)
18 parser.add_argument("--alignJsonFile",
19 help="External JSON file parsed to the Alignment algorithm",
20 default="")
21 args = parser.parse_args()
22 flags = initConfigFlags()
23 flags.Concurrency.NumThreads = args.threads
24 flags.Concurrency.NumConcurrentEvents = args.threads # Might change this later, but good enough for the moment.
25 flags.Output.ESDFileName = args.output
26 flags.Input.Files = args.inputFile
27 flags.lock()
28
29 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
30 cfg = MainServicesCfg(flags)
31
32 from AthenaConfiguration.Enums import Format
33 if flags.Input.Format == Format.POOL:
34 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
35 cfg.merge(PoolReadCfg(flags))
36 elif flags.Input.Format == Format.BS:
37 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
38 cfg.merge(ByteStreamReadCfg(flags))
39
40 from MuonConfig.MuonGeometryConfig import MuonAlignmentCondAlgCfg
41 cfg.merge(MuonAlignmentCondAlgCfg(flags, readFromJSON = args.alignJsonFile))
42 from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg
43 cfg.merge(MuonIdHelperSvcCfg(flags))
44
45 cfg.merge(MuonABLineJsonDumpAlgCfg(flags, OutFile=args.output))
46 cfg.printConfig(withDetails=True, summariseProps=True)
47 flags.dump()
48
49 sc = cfg.run(1)
50 if not sc.isSuccess():
51 import sys
52 sys.exit("Execution failed")
53
54
MuonABLineJsonDumpAlgCfg(flags, name="MuonABLineJsonDumpAlg", **kwargs)
Definition DumpABLines.py:5