ATLAS Offline Software
Loading...
Searching...
No Matches
NswCondAlgTest.py
Go to the documentation of this file.
1# Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
2
3def 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, processThresholds=True))
9 the_alg = CompFactory.NswCondTestAlg(alg_name, **kwargs)
10 result.addEventAlgo(the_alg, primary=True)
11 return result
12
13
14if __name__ == "__main__":
15 from AthenaConfiguration.AllConfigFlags import initConfigFlags
16 from MuonCondTest.MdtCablingTester import SetupArgParser
17 from AthenaConfiguration.TestDefaults import defaultTestFiles
18 from MuonConfig.MuonConfigUtils import executeTest, SetupMuonStandaloneCA, configureCondTag
19
20 parser = SetupArgParser()
21 parser.add_argument("--LogName", default="LogFile",
22 help="If the test is run multiple times to ensure reproducibility, then the dump of the test can be resteered")
23 parser.add_argument("--isMC", action = 'store_true', default=False)
24 parser.set_defaults(inputFile=[])
25 args = parser.parse_args()
26
27 flags = initConfigFlags()
28 flags.Input.Files = defaultTestFiles.ESD_RUN3_MC if args.isMC else defaultTestFiles.ESD_RUN3_DATA22
29
30 flags.Concurrency.NumThreads = 1
31 flags.Concurrency.NumConcurrentEvents = 1
32 flags.Exec.MaxEvents = 1
33 flags.Muon.Calib.applyMmT0Correction = not args.isMC
34 configureCondTag(flags)
35 flags.lock()
36
37 cfg = SetupMuonStandaloneCA(flags)
38 cfg.merge(NSWCondAlgTest(flags, LogName = args.LogName, isMC = flags.Input.isMC))
39 executeTest(cfg)
NSWCondAlgTest(flags, alg_name="NSWCondTestAlg", **kwargs)