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

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

◆ executeTest()

testGeoModel.executeTest ( cfg)

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

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

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

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

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

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

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

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

◆ setupServicesCfg()

testGeoModel.setupServicesCfg ( flags)

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

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

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