ATLAS Offline Software
MdtMezzExtraction.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 def MdtCablMezzAlgCfg(flags, name = "MdtCablMezzAlg", **kwargs):
4  from AthenaConfiguration.ComponentFactory import CompFactory
5  from MuonCondTest.MdtCablingTester import setupServicesCfg
6  result = setupServicesCfg(flags)
7  from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
8  result.merge(MDTCablingConfigCfg(flags))
9  event_algo = CompFactory.MdtCablingJsonDumpAlg(name,**kwargs)
10  result.addEventAlgo(event_algo, primary = True)
11  return result
12 
13 if __name__ == "__main__":
14  from AthenaConfiguration.AllConfigFlags import initConfigFlags
15  from MuonCondTest.MdtCablingTester import SetupArgParser
16  parser = SetupArgParser()
17  parser.set_defaults(output="SummaryFile.txt")
18  parser.set_defaults(mezzMap="MezzMapping.json")
19  parser.set_defaults(cablingMap="MdtCabling.json")
20 
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.GeoModel.AtlasVersion = args.geometry
28  flags.IOVDb.GlobalTag = args.conditionsTag
29  flags.lock()
30 
31  cfg = MdtCablMezzAlgCfg(flags,
32  SummaryFile=args.output,
33  OutMezzanineJSON=args.mezzMap,
34  OutCablingJSON=args.cablingMap)
35  cfg.printConfig(withDetails=True, summariseProps=True)
36  flags.dump()
37 
38  sc = cfg.run(1)
39  if not sc.isSuccess():
40  import sys
41  sys.exit("Execution failed")
42 
43 
python.MdtCablingTester.setupServicesCfg
def setupServicesCfg(flags)
Definition: MdtCablingTester.py:17
MdtMezzExtraction.MdtCablMezzAlgCfg
def MdtCablMezzAlgCfg(flags, name="MdtCablMezzAlg", **kwargs)
Definition: MdtMezzExtraction.py:3
python.MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
python.MuonCablingConfig.MDTCablingConfigCfg
def MDTCablingConfigCfg(flags, name="MuonMDT_CablingAlg", **kwargs)
Definition: MuonCablingConfig.py:100
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19