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

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

◆ executeTest()

testGeoModel.executeTest ( cfg)

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

273def executeTest(cfg):
274 cfg.printConfig(withDetails=True, summariseProps=True)
275 if not cfg.run().isSuccess(): exit(1)
276

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

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

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

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

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

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

◆ setupServicesCfg()

testGeoModel.setupServicesCfg ( flags)

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

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

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