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

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

◆ executeTest()

testGeoModel.executeTest ( cfg)

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

265def executeTest(cfg):
266 cfg.printConfig(withDetails=True, summariseProps=True)
267 if not cfg.run().isSuccess(): exit(1)
268

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

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

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

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

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

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

◆ setupServicesCfg()

testGeoModel.setupServicesCfg ( flags)

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

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

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