3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from argparse
import ArgumentParser
9 parser = ArgumentParser()
10 parser.add_argument(
"--threads", type=int, help=
"number of threads", default=1)
11 parser.add_argument(
"--inputFile",
"-i", default=[
13 "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/EVGEN_ParticleGun_FourMuon_Pt10to500.root"
15 help=
"Input file to run on ", nargs=
"+")
16 parser.add_argument(
"--geoTag", default=
"ATLAS-R3S-2021-03-02-00", help=
"Geometry tag to use", choices=[
"ATLAS-R2-2016-01-02-01",
17 "ATLAS-R3S-2021-03-02-00"])
18 parser.add_argument(
"--condTag", default=
"OFLCOND-MC23-SDR-RUN3-02", help=
"Conditions tag to use",
19 choices=[
"OFLCOND-MC16-SDR-RUN2-11",
20 "OFLCOND-MC23-SDR-RUN3-02",
21 "CONDBR2-BLKPA-2023-02",
22 "CONDBR2-BLKPA-RUN2-11"])
23 parser.add_argument(
"--chambers", default=[
"all"
24 ], nargs=
"+", help=
"Chambers to check. If string is all, all chambers will be checked")
25 parser.add_argument(
"--outRootFile", default=
"LegacyGeoModelDump.root", help=
"Output ROOT file to dump the geomerty")
26 parser.add_argument(
"--noMdt", help=
"Disable the Mdts from the geometry", action=
'store_true', default =
False)
27 parser.add_argument(
"--noRpc", help=
"Disable the Rpcs from the geometry", action=
'store_true', default =
False)
28 parser.add_argument(
"--noTgc", help=
"Disable the Tgcs from the geometry", action=
'store_true', default =
False)
29 parser.add_argument(
"--noMM", help=
"Disable the MMs from the geometry", action=
'store_true', default =
False)
30 parser.add_argument(
"--noSTGC", help=
"Disable the sTgcs from the geometry", action=
'store_true', default =
False)
36 if len(out_file) == 0:
return result
37 histSvc = CompFactory.THistSvc(Output=[
"GEOMODELTESTER DATAFILE='{out_file}', OPT='RECREATE'".
format(out_file = out_file)])
38 result.addService(histSvc, primary=
True)
43 if not flags.Detector.GeometryMDT:
return result
44 from MuonConfig.MuonCablingConfig
import MDTCablingConfigCfg
46 the_alg = CompFactory.MuonGM.GeoModelMdtTest(name, **kwargs)
47 result.addEventAlgo(the_alg)
52 if not flags.Detector.GeometryRPC:
return result
53 the_alg = CompFactory.MuonGM.GeoModelRpcTest(name, **kwargs)
54 result.addEventAlgo(the_alg)
59 if not flags.Detector.GeometryTGC:
return result
60 the_alg = CompFactory.MuonGM.GeoModelTgcTest(name, **kwargs)
61 result.addEventAlgo(the_alg)
65 if not flags.Detector.GeometryMM:
return result
66 the_alg = CompFactory.MuonGM.GeoModelMmTest(name, **kwargs)
67 result.addEventAlgo(the_alg)
72 if not flags.Detector.GeometrysTGC:
return result
73 the_alg = CompFactory.MuonGM.GeoModelsTgcTest(name, **kwargs)
74 result.addEventAlgo(the_alg)
79 if not flags.Detector.GeometryCSC:
return result
80 the_alg = CompFactory.MuonGM.GeoModelCscTest(name, **kwargs)
81 result.addEventAlgo(the_alg)
84 if __name__==
"__main__":
85 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
89 flags.Concurrency.NumThreads = args.threads
90 flags.Concurrency.NumConcurrentEvents = args.threads
91 flags.Input.Files = args.inputFile
92 flags.GeoModel.AtlasVersion = args.geoTag
93 flags.IOVDb.GlobalTag = args.condTag
94 flags.Scheduler.ShowDataDeps =
True
95 flags.Scheduler.ShowDataFlow =
True
97 from MuonCondTest.MdtCablingTester
import setupServicesCfg
99 cfg.merge(
setupHistSvc(flags, out_file = args.outRootFile))
101 chambToTest = args.chambers
if len([x
for x
in args.chambers
if x ==
"all"]) ==0
else []
103 cfg.merge(
GeoModelMdtTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"B" or ch[0] ==
"E"],
104 dumpSurfaces =
False ))
106 cfg.merge(
GeoModelRpcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"B"]))
108 cfg.merge(
GeoModelTgcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"T"],
109 ReadoutXML=
"TgcStripStructure.xml"))
112 cfg.merge(
GeoModelMmTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"M"]))
115 cfg.merge(
GeoModelsTgcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"S"]))
119 cfg.printConfig(withDetails=
True, summariseProps=
True)
120 flags.dump(evaluate =
True)
121 if not cfg.run(1).isSuccess():
122 print(
"Execution failed")