ATLAS Offline Software
Loading...
Searching...
No Matches
testGeoModel Namespace Reference

Classes

class  MuonPhaseIITestDefaults

Functions

 SetupArgParser ()
 GeoModelMdtTestCfg (flags, name="GeoModelMdtTest", **kwargs)
 GeoModelRpcTestCfg (flags, name="GeoModelRpcTest", **kwargs)
 GeoModelTgcTestCfg (flags, name="GeoModelTgcTest", **kwargs)
 GeoModelMmTestCfg (flags, name="GeoModelMmTest", **kwargs)
 GeoModelsTgcTestCfg (flags, name="GeoModelsTgcTest", **kwargs)
 GeoModelCscTestCfg (flags, name="GeoModelCscTest", **kwargs)
 setupServicesCfg (flags)
 GeoModelMdtTestCfg (flags, name="GeoModelMdtTest", localMezzanineJSON="", localCablingJSON="", **kwargs)
 NswGeoPlottingAlgCfg (flags, name="NswGeoPlotting", **kwargs)
 configureDefaultTagsCfg (flags)
 setupGeoR4TestCfg (args, flags=None)
 executeTest (cfg)

Variables

 args = SetupArgParser().parse_args()
 flags = initConfigFlags()
 NumThreads
 NumConcurrentEvents
 Files
 AtlasVersion
 GlobalTag
 ShowDataDeps
 ShowDataFlow
 MaxEvents
 evaluate
 cfg = SetupMuonStandaloneCA(flags)
int chambToTest = 0 else []
 chambToExclude = args.excludedChambers
 checkGeo
 Ensure consistent translation of the geometry.
 dumpGeo
 setVerbose

Function Documentation

◆ configureDefaultTagsCfg()

testGeoModel.configureDefaultTagsCfg ( flags)

Definition at line 137 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

137def configureDefaultTagsCfg(flags):
138 from AthenaCommon.Logging import logging
139 log = logging.getLogger('GeometryConfiguration')
140
141 if not flags.GeoModel.SQLiteDB:
142 raise ValueError("Default tag configuration only works for SQLite")
143
144 from AthenaConfiguration.TestDefaults import defaultGeometryTags
145 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
146 from AthenaConfiguration.Enums import LHCPeriod
147 if flags.GeoModel.Run == LHCPeriod.Run3:
148 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
149 elif flags.GeoModel.Run == LHCPeriod.Run4:
150 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN4
151 else:
152 raise ValueError(f"Invalid run period {flags.GeoModel.Run}")
153 from MuonConfig.MuonConfigUtils import configureCondTag
154 configureCondTag(flags)
155
156 log.info(f"Setup {flags.GeoModel.AtlasVersion} geometry loading {flags.GeoModel.SQLiteDBFullPath}")
157 log.info(f"Use conditions tag {flags.IOVDb.GlobalTag}")
158
159

◆ executeTest()

testGeoModel.executeTest ( cfg)

Definition at line 268 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

268def executeTest(cfg):
269 cfg.printConfig(withDetails=True, summariseProps=True)
270 if not cfg.run().isSuccess(): exit(1)
271

◆ GeoModelCscTestCfg()

testGeoModel.GeoModelCscTestCfg ( flags,
name = "GeoModelCscTest",
** kwargs )

Definition at line 71 of file MuonDetDescr/MuonGeoModelTest/python/testGeoModel.py.

71def GeoModelCscTestCfg(flags, name = "GeoModelCscTest", **kwargs):
72 result = ComponentAccumulator()
73 if not flags.Detector.GeometryCSC: return result
74 the_alg = CompFactory.MuonGM.GeoModelCscTest(name, **kwargs)
75 result.addEventAlgo(the_alg)
76 return result
77

◆ GeoModelMdtTestCfg() [1/2]

testGeoModel.GeoModelMdtTestCfg ( flags,
name = "GeoModelMdtTest",
** kwargs )

Definition at line 35 of file MuonDetDescr/MuonGeoModelTest/python/testGeoModel.py.

35def GeoModelMdtTestCfg(flags, name = "GeoModelMdtTest", **kwargs):
36 result = ComponentAccumulator()
37 if not flags.Detector.GeometryMDT: return result
38 from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
39 result.merge(MDTCablingConfigCfg(flags))
40 the_alg = CompFactory.MuonGM.GeoModelMdtTest(name, **kwargs)
41 result.addEventAlgo(the_alg)
42 return result
43

◆ GeoModelMdtTestCfg() [2/2]

testGeoModel.GeoModelMdtTestCfg ( flags,
name = "GeoModelMdtTest",
localMezzanineJSON = "",
localCablingJSON = "",
** kwargs )

Definition at line 94 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

94def GeoModelMdtTestCfg(flags, name = "GeoModelMdtTest", localMezzanineJSON="", localCablingJSON="",**kwargs):
95 result = ComponentAccumulator()
96 from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
97 result.merge(MDTCablingConfigCfg(flags,MezzanineJSON=localMezzanineJSON, CablingJSON=localCablingJSON))
98 the_alg = CompFactory.MuonGMR4.GeoModelMdtTest(name, **kwargs)
99 result.addEventAlgo(the_alg, primary = True)
100 return result
101

◆ GeoModelMmTestCfg()

testGeoModel.GeoModelMmTestCfg ( flags,
name = "GeoModelMmTest",
** kwargs )

Definition at line 57 of file MuonDetDescr/MuonGeoModelTest/python/testGeoModel.py.

57def GeoModelMmTestCfg(flags,name = "GeoModelMmTest", **kwargs):
58 result = ComponentAccumulator()
59 if not flags.Detector.GeometryMM: return result
60 the_alg = CompFactory.MuonGM.GeoModelMmTest(name, **kwargs)
61 result.addEventAlgo(the_alg)
62 return result
63

◆ GeoModelRpcTestCfg()

testGeoModel.GeoModelRpcTestCfg ( flags,
name = "GeoModelRpcTest",
** kwargs )

Definition at line 44 of file MuonDetDescr/MuonGeoModelTest/python/testGeoModel.py.

44def GeoModelRpcTestCfg(flags,name = "GeoModelRpcTest", **kwargs):
45 result = ComponentAccumulator()
46 if not flags.Detector.GeometryRPC: return result
47 the_alg = CompFactory.MuonGM.GeoModelRpcTest(name, **kwargs)
48 result.addEventAlgo(the_alg)
49 return result
50

◆ GeoModelsTgcTestCfg()

testGeoModel.GeoModelsTgcTestCfg ( flags,
name = "GeoModelsTgcTest",
** kwargs )

Definition at line 64 of file MuonDetDescr/MuonGeoModelTest/python/testGeoModel.py.

64def GeoModelsTgcTestCfg(flags, name = "GeoModelsTgcTest", **kwargs):
65 result = ComponentAccumulator()
66 if not flags.Detector.GeometrysTGC: return result
67 the_alg = CompFactory.MuonGM.GeoModelsTgcTest(name, **kwargs)
68 result.addEventAlgo(the_alg)
69 return result
70

◆ GeoModelTgcTestCfg()

testGeoModel.GeoModelTgcTestCfg ( flags,
name = "GeoModelTgcTest",
** kwargs )

Definition at line 51 of file MuonDetDescr/MuonGeoModelTest/python/testGeoModel.py.

51def GeoModelTgcTestCfg(flags,name = "GeoModelTgcTest", **kwargs):
52 result = ComponentAccumulator()
53 if not flags.Detector.GeometryTGC: return result
54 the_alg = CompFactory.MuonGM.GeoModelTgcTest(name, **kwargs)
55 result.addEventAlgo(the_alg)
56 return result

◆ NswGeoPlottingAlgCfg()

testGeoModel.NswGeoPlottingAlgCfg ( flags,
name = "NswGeoPlotting",
** kwargs )

Definition at line 126 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

126def NswGeoPlottingAlgCfg(flags, name="NswGeoPlotting", **kwargs):
127 result = ComponentAccumulator()
128 kwargs.setdefault("TestActsSurface", True)
129 kwargs.setdefault("plotTgc", flags.Detector.GeometryTGC)
130 kwargs.setdefault("plotStgc", flags.Detector.GeometrysTGC)
131 kwargs.setdefault("plotMm", flags.Detector.GeometryMM)
132
133 the_alg = CompFactory.MuonGMR4.NswGeoPlottingAlg(name, **kwargs)
134 result.addEventAlgo(the_alg, primary = True)
135 return result
136

◆ SetupArgParser()

testGeoModel.SetupArgParser ( )

Definition at line 6 of file MuonDetDescr/MuonGeoModelTest/python/testGeoModel.py.

6def SetupArgParser():
7 from AthenaConfiguration.TestDefaults import defaultConditionsTags, defaultGeometryTags, defaultTestFiles
8
9 from argparse import ArgumentParser
10
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)
31
32 return parser
33
34

◆ setupGeoR4TestCfg()

testGeoModel.setupGeoR4TestCfg ( args,
flags = None )

Definition at line 160 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

160def setupGeoR4TestCfg(args, flags = None):
161
162 if flags is None:
163 from AthenaConfiguration.AllConfigFlags import initConfigFlags
164 flags = initConfigFlags()
165 flags.Concurrency.NumThreads = args.threads
166 flags.Concurrency.NumConcurrentEvents = args.threads
167 flags.Exec.MaxEvents = args.nEvents
168 flags.Exec.SkipEvents = args.skipEvents
169 from os import path, system, listdir
170 flags.Input.Files = []
171
173 for fileArg in args.inputFile:
174 if path.isdir(fileArg):
175 flags.Input.Files += [ "{dir}/{file}".format(dir=fileArg, file=y) for y in listdir(fileArg) ]
176 else:
177 if fileArg[fileArg.rfind(".")+1 :]not in ["txt", "conf"]:
178 flags.Input.Files+=[fileArg]
179 else:
180 with open(fileArg) as inStream:
181 flags.Input.Files+=[ line.strip() for line in inStream if line[0]!='#']
182
183 flags.Exec.FPE= 500
184 flags.Exec.EventPrintoutInterval = 500
185
186 if args.defaultGeoFile == "RUN3":
187 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R3
188 elif args.defaultGeoFile == "RUN4":
189 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R4
190 elif args.defaultGeoFile == "RUN3MSOnly":
191 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R3MSOnly
192 elif args.defaultGeoFile == "RUN4MSOnly":
193 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R4MSOnly
194 elif args.defaultGeoFile == "ITkR3MS":
195 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_ITk_R3MS
196 elif args.geoModelFile.startswith("root://"):
197 if not path.exists("Geometry/{geoTag}.db".format(geoTag=args.geoTag)):
198 print ("Copy geometry file from EOS {source}".format(source = args.geoModelFile))
199 system("mkdir Geometry/")
200 system("xrdcp {source} Geometry/{geoTag}.db".format(source = args.geoModelFile,
201 geoTag=args.geoTag))
202
203 args.geoModelFile = "Geometry/{geoTag}.db".format(geoTag=args.geoTag)
204 else:
205 flags.GeoModel.SQLiteDBFullPath = args.geoModelFile
206
207 flags.GeoModel.SQLiteDB = True
208 configureDefaultTagsCfg(flags)
209
210 flags.Detector.GeometryBpipe = False
211
212 flags.Detector.GeometryBCM = False
213 flags.Detector.GeometryPixel = False
214 flags.Detector.GeometrySCT = False
215 flags.Detector.GeometryTRT = False
216
217 flags.Detector.GeometryPLR = False
218 flags.Detector.GeometryBCMPrime = False
219 flags.Detector.GeometryITkPixel = False
220 flags.Detector.GeometryITkStrip = False
221
222 flags.Detector.GeometryHGTD = False
223
224 flags.Detector.GeometryLAr = False
225 flags.Detector.GeometryTile = False
226 flags.Detector.GeometryMBTS = False
227 flags.Detector.GeometryCalo = False
228
229 flags.Detector.GeometryCSC = False
230 if args.noSTGC:
231 flags.Detector.GeometrysTGC = False
232 if args.noMM:
233 flags.Detector.GeometryMM = False
234 if args.noTgc:
235 flags.Detector.GeometryTGC = False
236 if args.noRpc:
237 flags.Detector.GeometryRPC = False
238 if args.noMdt:
239 flags.Detector.GeometryMDT = False
240
241 flags.Acts.TrackingGeometry.UseBlueprint = True
242
243 flags.Scheduler.CheckDependencies = True
244 flags.Scheduler.ShowDataDeps = True
245 flags.Scheduler.ShowDataFlow = True
246 flags.Scheduler.ShowControlFlow = True
247 flags.Scheduler.EnableVerboseViews = True
248 flags.Scheduler.AutoLoadUnmetDependencies = True
249 #flags.PerfMon.doFullMonMT = True
250 flags.lock()
251 flags.dump(evaluate = True)
252 cfg = setupServicesCfg(flags)
253
254 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
255 cfg.merge(MuonGeoModelCfg(flags))
256
257 if not flags.Muon.usePhaseIIGeoSetup:
258 print ("WARNING: New Muon plugin is not part of the Geometry file {geoDBFile}".format(geoDBFile=args.geoModelFile))
259 else:
260 from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
261 cfg.merge(ActsGeometryContextAlgCfg(flags))
262
263 cfg.getService("MessageSvc").verboseLimit = 10000000
264 cfg.getService("MessageSvc").debugLimit = 10000000
265
266 return flags, cfg
267

◆ setupServicesCfg()

testGeoModel.setupServicesCfg ( flags)

Definition at line 76 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

76def setupServicesCfg(flags):
77 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
78 result = MainServicesCfg(flags)
79
80 from AthenaConfiguration.Enums import Format
81 if flags.Input.Format is Format.POOL:
82 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
83 result.merge(PoolReadCfg(flags))
84 elif flags.Input.Format == Format.BS:
85 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
86 result.merge(ByteStreamReadCfg(flags))
87
88 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
89 result.merge(PerfMonMTSvcCfg(flags))
90 from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg
91 result.merge(MuonIdHelperSvcCfg(flags))
92 return result
93

Variable Documentation

◆ args

testGeoModel.args = SetupArgParser().parse_args()

◆ AtlasVersion

testGeoModel.AtlasVersion

◆ cfg

testGeoModel.cfg = SetupMuonStandaloneCA(flags)

◆ chambToExclude

testGeoModel.chambToExclude = args.excludedChambers

◆ chambToTest

int testGeoModel.chambToTest = 0 else []

◆ checkGeo

testGeoModel.checkGeo

Ensure consistent translation of the geometry.

Definition at line 282 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

◆ dumpGeo

testGeoModel.dumpGeo

◆ evaluate

testGeoModel.evaluate

◆ Files

testGeoModel.Files

◆ flags

testGeoModel.flags = initConfigFlags()

◆ GlobalTag

testGeoModel.GlobalTag

◆ MaxEvents

testGeoModel.MaxEvents

◆ NumConcurrentEvents

testGeoModel.NumConcurrentEvents

◆ NumThreads

testGeoModel.NumThreads

◆ setVerbose

testGeoModel.setVerbose

◆ ShowDataDeps

testGeoModel.ShowDataDeps

◆ ShowDataFlow

testGeoModel.ShowDataFlow