ATLAS Offline Software
MdtCondTester.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 def MdtConditionsTestCfg(flags, name="MdtConditionsTest", **kwargs):
4  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5  result = ComponentAccumulator()
6  from AthenaConfiguration.ComponentFactory import CompFactory
7  from MuonConfig.MuonCondAlgConfig import MdtCondDbAlgCfg
8  result.merge(MdtCondDbAlgCfg(flags))
9  from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg
10  result.merge(MuonIdHelperSvcCfg(flags))
11  the_alg = CompFactory.MdtConditionsTestAlg(name, **kwargs)
12  result.addEventAlgo(the_alg, primary = True)
13  return result
14 if __name__ == "__main__":
15  from AthenaConfiguration.AllConfigFlags import initConfigFlags
16  from MuonCondTest.MdtCablingTester import SetupArgParser, setupServicesCfg
17 
18  parser = SetupArgParser()
19  parser.add_argument("--LogName", default="LogFile",
20  help="If the test is run multiple times to ensure reproducibility, then the dump of the test can be resteered")
21  parser.set_defaults(inputFile=["/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/UnitTestInput/Run3MC.ESD.pool.root"])
22  args = parser.parse_args()
23 
24  flags = initConfigFlags()
25  flags.Concurrency.NumThreads = args.threads
26  flags.Concurrency.NumConcurrentEvents = args.threads # Might change this later, but good enough for the moment.
27  flags.Output.ESDFileName = args.output
28  flags.Input.Files = args.inputFile
29  flags.lock()
30 
31  cfg = setupServicesCfg(flags)
32  msgService = cfg.getService('MessageSvc')
33  msgService.Format = "S:%s E:%e % F%128W%S%7W%R%T %0W%M"
34 
35  cfg.merge(MdtConditionsTestCfg(flags, LogName = args.LogName))
36  cfg.printConfig(withDetails=True, summariseProps=True)
37 
38  flags.dump()
39 
40  sc = cfg.run(1)
41  if not sc.isSuccess():
42  import sys
43  sys.exit("Execution failed")
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
python.MdtCablingTester.setupServicesCfg
def setupServicesCfg(flags)
Definition: MdtCablingTester.py:17
python.MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
python.MuonCondAlgConfig.MdtCondDbAlgCfg
def MdtCondDbAlgCfg(flags, **kwargs)
Definition: MuonCondAlgConfig.py:13
python.MuonGeometryConfig.MuonIdHelperSvcCfg
def MuonIdHelperSvcCfg(flags)
Definition: MuonGeometryConfig.py:15
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.MdtCondTester.MdtConditionsTestCfg
def MdtConditionsTestCfg(flags, name="MdtConditionsTest", **kwargs)
Definition: MdtCondTester.py:3