3 from AthenaConfiguration.ComponentAccumulator
import ComponentAccumulator
4 from AthenaConfiguration.ComponentFactory
import CompFactory
7 from AthenaConfiguration.TestDefaults
import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
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=defaultTestFiles.EVNT,
14 help=
"Input file to run on ", nargs=
"+")
15 parser.add_argument(
"--geoTag", default=defaultGeometryTags.RUN3, help=
"Geometry tag to use", choices=[defaultGeometryTags.RUN2_BEST_KNOWLEDGE ,
16 defaultGeometryTags.RUN3])
17 parser.add_argument(
"--condTag", default=defaultConditionsTags.RUN3_MC, help=
"Conditions tag to use",
18 choices=[defaultConditionsTags.RUN3_MC,
19 defaultConditionsTags.RUN3_DATA,
20 defaultConditionsTags.RUN2_DATA,
21 defaultConditionsTags.RUN2_MC])
22 parser.add_argument(
"--chambers", default=[
"all"
23 ], nargs=
"+", help=
"Chambers to check. If string is all, all chambers will be checked")
24 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.")
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)
37 if not flags.Detector.GeometryMDT:
return result
38 from MuonConfig.MuonCablingConfig
import MDTCablingConfigCfg
40 the_alg = CompFactory.MuonGM.GeoModelMdtTest(name, **kwargs)
41 result.addEventAlgo(the_alg)
46 if not flags.Detector.GeometryRPC:
return result
47 the_alg = CompFactory.MuonGM.GeoModelRpcTest(name, **kwargs)
48 result.addEventAlgo(the_alg)
53 if not flags.Detector.GeometryTGC:
return result
54 the_alg = CompFactory.MuonGM.GeoModelTgcTest(name, **kwargs)
55 result.addEventAlgo(the_alg)
59 if not flags.Detector.GeometryMM:
return result
60 the_alg = CompFactory.MuonGM.GeoModelMmTest(name, **kwargs)
61 result.addEventAlgo(the_alg)
66 if not flags.Detector.GeometrysTGC:
return result
67 the_alg = CompFactory.MuonGM.GeoModelsTgcTest(name, **kwargs)
68 result.addEventAlgo(the_alg)
73 if not flags.Detector.GeometryCSC:
return result
74 the_alg = CompFactory.MuonGM.GeoModelCscTest(name, **kwargs)
75 result.addEventAlgo(the_alg)
78 if __name__==
"__main__":
79 from AthenaConfiguration.AllConfigFlags
import initConfigFlags
83 flags.Concurrency.NumThreads = args.threads
84 flags.Concurrency.NumConcurrentEvents = args.threads
85 flags.Input.Files = args.inputFile
86 flags.GeoModel.AtlasVersion = args.geoTag
87 flags.IOVDb.GlobalTag = args.condTag
88 flags.Scheduler.ShowDataDeps =
True
89 flags.Scheduler.ShowDataFlow =
True
90 flags.Exec.MaxEvents = 1
92 flags.dump(evaluate =
True)
94 from MuonConfig.MuonConfigUtils
import executeTest, setupHistSvcCfg, SetupMuonStandaloneCA
96 cfg.merge(
setupHistSvcCfg(flags, outFile = args.outRootFile, outStream=
"GEOMODELTESTER"))
98 chambToTest = args.chambers
if len([x
for x
in args.chambers
if x ==
"all"]) ==0
else []
99 chambToExclude = args.excludedChambers
101 cfg.merge(
GeoModelMdtTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"B" or ch[0] ==
"E"],
102 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"B" or ch[0] ==
"E"]))
104 cfg.merge(
GeoModelRpcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"B"],
105 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"B"]))
107 cfg.merge(
GeoModelTgcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"T"],
108 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"T"],
109 ReadoutXML=
"TgcStripStructure.xml"))
112 cfg.merge(
GeoModelMmTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"M"],
113 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"M"]))
116 cfg.merge(
GeoModelsTgcTestCfg(flags, TestStations = [ch
for ch
in chambToTest
if ch[0] ==
"S"],
117 ExcludeStations = [ch
for ch
in chambToExclude
if ch[0] ==
"S"]))