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