3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags
9 from argparse
import ArgumentParser
11 parser = ArgumentParser()
12 parser.add_argument(
"--threads", type=int, help=
"number of threads", default=1)
13 parser.add_argument(
"--inputFile",
"-i", default=[
15 "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/EVGEN_ParticleGun_FourMuon_Pt10to500.root"
17 help=
"Input file to run on ", nargs=
"+")
18 parser.add_argument(
"--geoTag", default=defaultGeometryTags.RUN3, help=
"Geometry tag to use", choices=[defaultGeometryTags.RUN2_BEST_KNOWLEDGE ,
19 defaultGeometryTags.RUN3])
20 parser.add_argument(
"--condTag", default=defaultConditionsTags.RUN3_MC, help=
"Conditions tag to use",
21 choices=[defaultConditionsTags.RUN3_MC,
22 defaultConditionsTags.RUN3_DATA,
23 defaultConditionsTags.RUN2_DATA,
24 defaultConditionsTags.RUN2_MC])
25 parser.add_argument(
"--chambers", default=[
"all"
26 ], nargs=
"+", help=
"Chambers to check. If string is all, all chambers will be checked")
27 parser.add_argument(
"--excludedChambers", default=[], nargs=
"+", help=
"Chambers to exclude. If string contains 'none', all chambers will be checked. Note: adding a chamber to --excludedChambers will overwrite it being in --chambers.")
28 parser.add_argument(
"--outRootFile", default=
"LegacyGeoModelDump.root", help=
"Output ROOT file to dump the geomerty")
29 parser.add_argument(
"--noMdt", help=
"Disable the Mdts from the geometry", action=
'store_true', default =
False)
30 parser.add_argument(
"--noRpc", help=
"Disable the Rpcs from the geometry", action=
'store_true', default =
False)
31 parser.add_argument(
"--noTgc", help=
"Disable the Tgcs from the geometry", action=
'store_true', default =
False)
32 parser.add_argument(
"--noMM", help=
"Disable the MMs from the geometry", action=
'store_true', default =
False)
33 parser.add_argument(
"--noSTGC", help=
"Disable the sTgcs from the geometry", action=
'store_true', default =
False)
40 if not flags.Detector.GeometryMDT:
return result
41 from MuonConfig.MuonCablingConfig
import MDTCablingConfigCfg
43 the_alg = CompFactory.MuonGM.GeoModelMdtTest(name, **kwargs)
44 result.addEventAlgo(the_alg)
49 if not flags.Detector.GeometryRPC:
return result
50 the_alg = CompFactory.MuonGM.GeoModelRpcTest(name, **kwargs)
51 result.addEventAlgo(the_alg)
56 if not flags.Detector.GeometryTGC:
return result
57 the_alg = CompFactory.MuonGM.GeoModelTgcTest(name, **kwargs)
58 result.addEventAlgo(the_alg)
62 if not flags.Detector.GeometryMM:
return result
63 the_alg = CompFactory.MuonGM.GeoModelMmTest(name, **kwargs)
64 result.addEventAlgo(the_alg)
69 if not flags.Detector.GeometrysTGC:
return result
70 the_alg = CompFactory.MuonGM.GeoModelsTgcTest(name, **kwargs)
71 result.addEventAlgo(the_alg)
76 if not flags.Detector.GeometryCSC:
return result
77 the_alg = CompFactory.MuonGM.GeoModelCscTest(name, **kwargs)
78 result.addEventAlgo(the_alg)
81 if __name__==
"__main__":
82 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
86 flags.Concurrency.NumThreads = args.threads
87 flags.Concurrency.NumConcurrentEvents = args.threads
88 flags.Input.Files = args.inputFile
89 flags.GeoModel.AtlasVersion = args.geoTag
90 flags.IOVDb.GlobalTag = args.condTag
91 flags.Scheduler.ShowDataDeps =
True
92 flags.Scheduler.ShowDataFlow =
True
94 from MuonCondTest.MdtCablingTester
import setupServicesCfg
96 from MuonGeoModelTestR4.testGeoModel
import setupHistSvcCfg
99 chambToTest = args.chambers
if len([x
for x
in args.chambers
if x ==
"all"]) ==0
else []
100 chambToExclude = args.excludedChambers
102 cfg.merge(
GeoModelMdtTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"B" or ch[0] ==
"E"],
103 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"B" or ch[0] ==
"E"]))
105 cfg.merge(
GeoModelRpcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"B"],
106 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"B"]))
108 cfg.merge(
GeoModelTgcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"T"],
109 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"T"],
110 ReadoutXML=
"TgcStripStructure.xml"))
113 cfg.merge(
GeoModelMmTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"M"],
114 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"M"]))
117 cfg.merge(
GeoModelsTgcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"S"],
118 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"S"]))
122 cfg.printConfig(withDetails=
True, summariseProps=
True)
123 flags.dump(evaluate =
True)
124 if not cfg.run(1).isSuccess():
125 print(
"Execution failed")