ATLAS Offline Software
TgcCondTester.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2023 CERN for the benefit of the ATLAS collaboration
2 
3 def TgcCondDbTestAlgCfg(flags, name="TgcCondDbTestAlg", **kwargs):
4  from AthenaConfiguration.ComponentAccumulator import ComponentAccumulator
5  result = ComponentAccumulator()
6  from AthenaConfiguration.ComponentFactory import CompFactory
7  the_alg = CompFactory.TgcCondDbTestAlg(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
13  from AthenaConfiguration.TestDefaults import defaultTestFiles
14  from MuonConfig.MuonConfigUtils import executeTest, SetupMuonStandaloneCA, configureCondTag
15 
16 
17  parser = SetupArgParser()
18  parser.add_argument("--jsonFile", default="TGC_Digitization_2016deadChamber.json",
19  help="If the test is run multiple times to ensure reproducibility, then the dump of the test can be resteered")
20  parser.set_defaults(inputFile=defaultTestFiles.ESD_RUN2_MC)
21  args = parser.parse_args()
22 
23  flags = initConfigFlags()
24  flags.Concurrency.NumThreads = 1
25  flags.Concurrency.NumConcurrentEvents = 1 # Might change this later, but good enough for the moment.
26  flags.Exec.MaxEvents = 1
27  flags.Output.ESDFileName = args.output
28  flags.Input.Files = args.inputFile
29  configureCondTag(flags)
30  flags.lock()
31 
32  cfg = SetupMuonStandaloneCA(flags)
33  from MuonConfig.MuonCondAlgConfig import TgcCondDbAlgCfg
34  cfg.merge(TgcCondDbAlgCfg(flags, readFromJSON = args.jsonFile))
35  cfg.merge(TgcCondDbTestAlgCfg(flags))
36  executeTest(cfg)
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
MuonCondAlgConfig.TgcCondDbAlgCfg
def TgcCondDbAlgCfg(flags, name="TgcCondDbAlg", **kwargs)
Definition: MuonCondAlgConfig.py:127
MdtCablingTester.SetupArgParser
def SetupArgParser()
Definition: MdtCablingTester.py:3
TgcCondTester.TgcCondDbTestAlgCfg
def TgcCondDbTestAlgCfg(flags, name="TgcCondDbTestAlg", **kwargs)
Definition: TgcCondTester.py:3
MuonConfigUtils.executeTest
def executeTest(cfg)
Definition: MuonConfigUtils.py:15
MuonConfigUtils.configureCondTag
def configureCondTag(flags)
Definition: MuonConfigUtils.py:19
MuonConfigUtils.SetupMuonStandaloneCA
def SetupMuonStandaloneCA(flags)
Definition: MuonConfigUtils.py:79
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19