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="", doPlots=True, **kwargs)
 GeoModelRpcTestCfg (flags, name="GeoModelRpcTest", doPlots=True, **kwargs)
 NswGeoPlottingAlgCfg (flags, name="NswGeoPlotting", **kwargs)
 configureDefaultTagsCfg (flags)
 setupGeoR4TestCfg (args, flags=None)

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 173 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

173def configureDefaultTagsCfg(flags):
174 from AthenaCommon.Logging import logging
175 log = logging.getLogger('GeometryConfiguration')
176
177 if not flags.GeoModel.SQLiteDB:
178 raise ValueError("Default tag configuration only works for SQLite")
179
180 from AthenaConfiguration.TestDefaults import defaultGeometryTags
181 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN2
182 from AthenaConfiguration.Enums import LHCPeriod
183 if flags.GeoModel.Run == LHCPeriod.Run3:
184 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN3
185 elif flags.GeoModel.Run == LHCPeriod.Run4:
186 flags.GeoModel.AtlasVersion = defaultGeometryTags.RUN4
187 else:
188 raise ValueError(f"Invalid run period {flags.GeoModel.Run}")
189 from MuonConfig.MuonConfigUtils import configureCondTag
190 configureCondTag(flags)
191
192 log.info(f"Setup {flags.GeoModel.AtlasVersion} geometry loading {flags.GeoModel.SQLiteDBFullPath}")
193 log.info(f"Use conditions tag {flags.IOVDb.GlobalTag}")
194
195

◆ 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 = "",
doPlots = True,
** kwargs )

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

125def GeoModelMdtTestCfg(flags, name = "GeoModelMdtTest", localMezzanineJSON="", localCablingJSON="", doPlots=True,**kwargs):
126 result = ComponentAccumulator()
127 from MuonConfig.MuonCablingConfig import MDTCablingConfigCfg
128 result.merge(MDTCablingConfigCfg(flags,MezzanineJSON=localMezzanineJSON, CablingJSON=localCablingJSON))
129 if not doPlots:
130 kwargs["visualizeTubes"] = False
131 kwargs["visualizeStaggering"] = False
132 the_alg = CompFactory.MuonGMR4.GeoModelMdtTest(name, **kwargs)
133 result.addEventAlgo(the_alg, primary = True)
134 return result
135

◆ 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() [1/2]

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

◆ GeoModelRpcTestCfg() [2/2]

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

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

136def GeoModelRpcTestCfg(flags, name = "GeoModelRpcTest", doPlots=True,**kwargs):
137 result = ComponentAccumulator()
138 if not doPlots:
139 kwargs["visualizePlanes"] = False
140 the_alg = CompFactory.MuonGMR4.GeoModelRpcTest(name, **kwargs)
141 result.addEventAlgo(the_alg, primary = True)
142 return result
143

◆ 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 162 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

162def NswGeoPlottingAlgCfg(flags, name="NswGeoPlotting", **kwargs):
163 result = ComponentAccumulator()
164 kwargs.setdefault("TestActsSurface", True)
165 kwargs.setdefault("plotTgc", flags.Detector.GeometryTGC)
166 kwargs.setdefault("plotStgc", flags.Detector.GeometrysTGC)
167 kwargs.setdefault("plotMm", flags.Detector.GeometryMM)
168
169 the_alg = CompFactory.MuonGMR4.NswGeoPlottingAlg(name, **kwargs)
170 result.addEventAlgo(the_alg, primary = True)
171 return result
172

◆ 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 196 of file MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py.

196def setupGeoR4TestCfg(args, flags = None):
197
198 if flags is None:
199 from AthenaConfiguration.AllConfigFlags import initConfigFlags
200 flags = initConfigFlags()
201 flags.Concurrency.NumThreads = args.threads
202 flags.Concurrency.NumConcurrentEvents = args.threads
203 flags.Exec.MaxEvents = args.nEvents
204 flags.Exec.SkipEvents = args.skipEvents
205 from os import path, system, listdir
206 flags.Input.Files = []
207
209 for fileArg in args.inputFile:
210 if path.isdir(fileArg):
211 flags.Input.Files += [ "{dir}/{file}".format(dir=fileArg, file=y) for y in listdir(fileArg) ]
212 else:
213 if fileArg[fileArg.rfind(".")+1 :]not in ["txt", "conf"]:
214 flags.Input.Files+=[fileArg]
215 else:
216 with open(fileArg) as inStream:
217 #Check if the input is a string of comma separated files, and if it is, split it into a list
218 if isinstance(inStream, str) and "," in inStream:
219 flags.Input.Files += inStream.split(",")
220 else:
221 flags.Input.Files+=[ line.strip() for line in inStream if line[0]!='#']
222
223 flags.Exec.FPE= 500
224 flags.Exec.EventPrintoutInterval = 500
225
226 if args.defaultGeoFile == "RUN3":
227 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R3
228 elif args.defaultGeoFile == "RUN4":
229 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R4
230 elif args.defaultGeoFile == "RUN3MSOnly":
231 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R3MSOnly
232 elif args.defaultGeoFile == "RUN4MSOnly":
233 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_R4MSOnly
234 elif args.defaultGeoFile == "ITkR3MS":
235 flags.GeoModel.SQLiteDBFullPath = MuonPhaseIITestDefaults.GEODB_ITk_R3MS
236 elif args.geoModelFile.startswith("root://"):
237 if not path.exists("Geometry/{geoTag}.db".format(geoTag=args.geoTag)):
238 print ("Copy geometry file from EOS {source}".format(source = args.geoModelFile))
239 system("mkdir Geometry/")
240 system("xrdcp {source} Geometry/{geoTag}.db".format(source = args.geoModelFile,
241 geoTag=args.geoTag))
242
243 args.geoModelFile = "Geometry/{geoTag}.db".format(geoTag=args.geoTag)
244 else:
245 flags.GeoModel.SQLiteDBFullPath = args.geoModelFile
246
247 flags.GeoModel.SQLiteDB = True
248 configureDefaultTagsCfg(flags)
249
250 if args.passiveMaterialMaps:
251 flags.Muon.trackGeometryMaterialMap = args.passiveMaterialMaps
252
253 flags.Detector.GeometryBpipe = False
254
255 flags.Detector.GeometryBCM = False
256 flags.Detector.GeometryPixel = False
257 flags.Detector.GeometrySCT = False
258 flags.Detector.GeometryTRT = False
259
260 flags.Detector.GeometryPLR = False
261 flags.Detector.GeometryBCMPrime = False
262 flags.Detector.GeometryITkPixel = False
263 flags.Detector.GeometryITkStrip = False
264
265 flags.Detector.GeometryHGTD = False
266
267 flags.Detector.GeometryLAr = False
268 flags.Detector.GeometryTile = False
269 flags.Detector.GeometryMBTS = False
270 flags.Detector.GeometryCalo = False
271
272 flags.Detector.GeometryCSC = False
273 if args.noSTGC:
274 flags.Detector.GeometrysTGC = False
275 if args.noMM:
276 flags.Detector.GeometryMM = False
277 if args.noTgc:
278 flags.Detector.GeometryTGC = False
279 if args.noRpc:
280 flags.Detector.GeometryRPC = False
281 if args.noMdt:
282 flags.Detector.GeometryMDT = False
283
284 try:
285 flags.Acts.TrackingGeometry.UseBlueprint = True
286 except AttributeError: pass
287 flags.Scheduler.CheckDependencies = True
288 flags.Scheduler.ShowDataDeps = True
289 flags.Scheduler.ShowDataFlow = True
290 flags.Scheduler.ShowControlFlow = True
291 flags.Scheduler.EnableVerboseViews = True
292 flags.Scheduler.AutoLoadUnmetDependencies = True
293 #flags.PerfMon.doFullMonMT = True
294 flags.lock()
295 flags.dump(evaluate = True)
296 cfg = setupServicesCfg(flags)
297
298 from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
299 cfg.merge(MuonGeoModelCfg(flags))
300
301 if not flags.Muon.usePhaseIIGeoSetup:
302 print ("WARNING: New Muon plugin is not part of the Geometry file {geoDBFile}".format(geoDBFile=args.geoModelFile))
303 else:
304 from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
305 cfg.merge(ActsGeometryContextAlgCfg(flags))
306
307 cfg.getService("MessageSvc").verboseLimit = 10000000
308 cfg.getService("MessageSvc").debugLimit = 10000000
309 cfg.getService("MessageSvc").errorLimit = 10000000
310
311 return flags, cfg
312
313

◆ setupServicesCfg()

testGeoModel.setupServicesCfg ( flags)

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

107def setupServicesCfg(flags):
108 from AthenaConfiguration.MainServicesConfig import MainServicesCfg
109 result = MainServicesCfg(flags)
110
111 from AthenaConfiguration.Enums import Format
112 if flags.Input.Format is Format.POOL:
113 from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
114 result.merge(PoolReadCfg(flags))
115 elif flags.Input.Format == Format.BS:
116 from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
117 result.merge(ByteStreamReadCfg(flags))
118
119 from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
120 result.merge(PerfMonMTSvcCfg(flags))
121 from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg
122 result.merge(MuonIdHelperSvcCfg(flags))
123 return result
124

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 324 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