ATLAS Offline Software
NswCondAlgTest.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 def NSWCondAlgTest(flags,alg_name="NSWCondTestAlg", **kwargs):
4  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5  result = ComponentAccumulator()
6  from AthenaConfiguration.ComponentFactory import CompFactory
7  from MuonConfig.MuonCondAlgConfig import NswCalibDbAlgCfg
8  result.merge(NswCalibDbAlgCfg(flags))
9  the_alg = CompFactory.NswCondTestAlg(alg_name, **kwargs)
10  result.addEventAlgo(the_alg, primary=True)
11  return result
12 
13 
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.add_argument("--isMC", action = 'store_true', default=False)
22  parser.set_defaults(inputFile=[])
23  args = parser.parse_args()
24 
25  mcInputFile = "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/UnitTestInput/Run3MC.ESD.pool.root"
26  dataInputFile = "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/UnitTestInput/Run3Data.ESD.pool.root"
27 
28  if(not args.inputFile):
29  if(args.isMC):
30  args.inputFile = [mcInputFile]
31  else:
32  args.inputFile = [dataInputFile]
33 
34 
35  flags = initConfigFlags()
36  flags.Concurrency.NumThreads = args.threads
37  flags.Concurrency.NumConcurrentEvents = args.threads # Might change this later, but good enough for the moment.
38  flags.Output.ESDFileName = args.output
39  flags.Input.Files = args.inputFile
40  flags.Muon.Calib.applyMmT0Correction = not args.isMC
41  flags.lock()
42 
43  cfg = setupServicesCfg(flags)
44  msgService = cfg.getService('MessageSvc')
45  msgService.Format = "S:%s E:%e % F%128W%S%7W%R%T %0W%M"
46 
47  cfg.merge(NSWCondAlgTest(flags, LogName = args.LogName, isMC = flags.Input.isMC))
48  cfg.printConfig(withDetails=True, summariseProps=True)
49 
50  flags.dump()
51 
52  sc = cfg.run(1)
53  if not sc.isSuccess():
54  import sys
55  sys.exit("Execution failed")
56 
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.NswCalibDbAlgCfg
def NswCalibDbAlgCfg(flags, **kwargs)
Definition: MuonCondAlgConfig.py:184
python.NswCondAlgTest.NSWCondAlgTest
def NSWCondAlgTest(flags, alg_name="NSWCondTestAlg", **kwargs)
Definition: NswCondAlgTest.py:3
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
if
if(febId1==febId2)
Definition: LArRodBlockPhysicsV0.cxx:569