ATLAS Offline Software
Functions | Variables
python.testGeoModel Namespace Reference

Functions

def geoModelFileDefault (useR4Layout=False)
 
def SetupArgParser ()
 
def setupServicesCfg (flags)
 
def setupHistSvcCfg (flags, outFile="MdtGeoDump.root", outStream="GEOMODELTESTER")
 
def GeoModelMdtTestCfg (flags, name="GeoModelMdtTest", **kwargs)
 
def GeoModelRpcTestCfg (flags, name="GeoModelRpcTest", **kwargs)
 
def GeoModelTgcTestCfg (flags, name="GeoModelTgcTest", **kwargs)
 
def GeoModelsTgcTestCfg (flags, name="GeoModelsTgcTest", **kwargs)
 
def GeoModelMmTestCfg (flags, name="GeoModelMmTest", **kwargs)
 
def NswGeoPlottingAlgCfg (flags, name="NswGeoPlotting", **kwargs)
 
def setupGeoR4TestCfg (args, flags=None)
 
def executeTest (cfg)
 

Variables

def args = SetupArgParser().parse_args()
 
 flags
 
 cfg
 
def chambToTest = 0 else []
 
list chambToExclude = [] if "none" in args.excludedChambers else args.excludedChambers
 
 checkGeo
 
 setVerbose
 

Function Documentation

◆ executeTest()

def python.testGeoModel.executeTest (   cfg)

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

192 def executeTest(cfg):
193 
194  cfg.printConfig(withDetails=True, summariseProps=True)
195  if not cfg.run().isSuccess(): exit(1)
196 

◆ geoModelFileDefault()

def python.testGeoModel.geoModelFileDefault (   useR4Layout = False)

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

5 def geoModelFileDefault(useR4Layout = False):
6  # If this is changed, remember to also test with other dependent tests
7  # e.g. run ctest with ActsEventCnv
8  if useR4Layout:
9  return "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/ATLAS-R4-MUONTEST.db"
10  return "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/ATLAS-R3-MUONTEST_v3.db"
11 

◆ GeoModelMdtTestCfg()

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

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

66 def GeoModelMdtTestCfg(flags, name = "GeoModelMdtTest", **kwargs):
67  result = ComponentAccumulator()
68  the_alg = CompFactory.MuonGMR4.GeoModelMdtTest(name, **kwargs)
69  result.addEventAlgo(the_alg, primary = True)
70  return result
71 

◆ GeoModelMmTestCfg()

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

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

90 def GeoModelMmTestCfg(flags, name = "GeoModelMmTest", **kwargs):
91  result = ComponentAccumulator()
92  the_alg = CompFactory.MuonGMR4.GeoModelMmTest(name, **kwargs)
93  result.addEventAlgo(the_alg, primary = True)
94  return result
95 

◆ GeoModelRpcTestCfg()

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

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

72 def GeoModelRpcTestCfg(flags, name = "GeoModelRpcTest", **kwargs):
73  result = ComponentAccumulator()
74  the_alg = CompFactory.MuonGMR4.GeoModelRpcTest(name, **kwargs)
75  result.addEventAlgo(the_alg, primary = True)
76  return result
77 

◆ GeoModelsTgcTestCfg()

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

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

84 def GeoModelsTgcTestCfg(flags, name = "GeoModelsTgcTest", **kwargs):
85  result = ComponentAccumulator()
86  the_alg = CompFactory.MuonGMR4.GeoModelsTgcTest(name, **kwargs)
87  result.addEventAlgo(the_alg, primary = True)
88  return result
89 

◆ GeoModelTgcTestCfg()

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

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

78 def GeoModelTgcTestCfg(flags, name = "GeoModelTgcTest", **kwargs):
79  result = ComponentAccumulator()
80  the_alg = CompFactory.MuonGMR4.GeoModelTgcTest(name, **kwargs)
81  result.addEventAlgo(the_alg, primary = True)
82  return result
83 

◆ NswGeoPlottingAlgCfg()

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

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

96 def NswGeoPlottingAlgCfg(flags, name="NswGeoPlotting", **kwargs):
97  result = ComponentAccumulator()
98  kwargs.setdefault("TestActsSurface", False)
99  the_alg = CompFactory.MuonGMR4.NswGeoPlottingAlg(name, **kwargs)
100  result.addEventAlgo(the_alg, primary = True)
101  return result
102 

◆ SetupArgParser()

def python.testGeoModel.SetupArgParser ( )

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

12 def SetupArgParser():
13  from argparse import ArgumentParser
14 
15  parser = ArgumentParser()
16  parser.add_argument("--threads", type=int, help="number of threads", default=1)
17  parser.add_argument("--geoTag", default="ATLAS-R3S-2021-03-02-00", help="Geometry tag to use", choices=["ATLAS-R3S-2021-03-02-00",
18  "ATLAS-P2-RUN4-01-00-00"])
19  parser.add_argument("--condTag", default="OFLCOND-MC23-SDR-RUN3-07", help="Conditions tag to use",
20  choices= ["OFLCOND-MC23-SDR-RUN3-07", "CONDBR2-BLKPA-2023-03", "OFLCOND-MC21-SDR-RUN4-01"])
21  parser.add_argument("--inputFile", "-i", default=[
22  #"/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/Tier0ChainTests/TCT_Run3/data22_13p6TeV.00431493.physics_Main.daq.RAW._lb0525._SFO-16._0001.data"
23  "/cvmfs/atlas-nightlies.cern.ch/repo/data/data-art/MuonRecRTT/EVGEN_ParticleGun_FourMuon_Pt10to500.root"
24  ],
25  help="Input file to run on ", nargs="+")
26  parser.add_argument("--geoModelFile", default = geoModelFileDefault(), help="GeoModel SqLite file containing the muon geometry.")
27  parser.add_argument("--chambers", default=["all"], nargs="+", help="Chambers to check. If string is all, all chambers will be checked")
28  parser.add_argument("--excludedChambers", default=["none"], 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.")
29  parser.add_argument("--outRootFile", default="NewGeoModelDump.root", help="Output ROOT file to dump the geomerty")
30  parser.add_argument("--nEvents", help="Number of events to run", type = int ,default = 1)
31  parser.add_argument("--skipEvents", help="Number of events to skip", type = int, default = 0)
32  parser.add_argument("--noMdt", help="Disable the Mdts from the geometry", action='store_true', default = False)
33  parser.add_argument("--noRpc", help="Disable the Rpcs from the geometry", action='store_true', default = False)
34  parser.add_argument("--noTgc", help="Disable the Tgcs from the geometry", action='store_true', default = False)
35  parser.add_argument("--noMM", help="Disable the MMs from the geometry", action='store_true', default = False)
36  parser.add_argument("--noSTGC", help="Disable the sTgcs from the geometry", action='store_true', default = False)
37  parser.add_argument("--eventPrintoutLevel", type=int, help="Interval of event heartbeat printouts from the loop manager", default = 1)
38  return parser
39 

◆ setupGeoR4TestCfg()

def python.testGeoModel.setupGeoR4TestCfg (   args,
  flags = None 
)

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

103 def setupGeoR4TestCfg(args, flags = None):
104 
105  if flags is None:
106  from AthenaConfiguration.AllConfigFlags import initConfigFlags
107  flags = initConfigFlags()
108  flags.Concurrency.NumThreads = args.threads
109  flags.Concurrency.NumConcurrentEvents = args.threads
110  flags.Exec.MaxEvents = args.nEvents
111  flags.Exec.SkipEvents = args.skipEvents
112  flags.Input.isMC = args.condTag.find("OFLCOND") != -1
113  from os import path, system, listdir
114  inFiles = [x for x in args.inputFile if not path.isdir(x)] + \
115  [ "{dir}/{file}".format(dir=x, file=y) for x in args.inputFile if path.isdir(x) for y in listdir(x) ]
116  flags.Input.Files = inFiles
117  flags.Exec.FPE= 500
118  flags.Exec.EventPrintoutInterval = args.eventPrintoutLevel
119 
120  if args.geoModelFile.startswith("root://"):
121  if not path.exists("Geometry/{geoTag}.db".format(geoTag=args.geoTag)):
122  print ("Copy geometry file from EOS {source}".format(source = args.geoModelFile))
123  system("mkdir Geometry/")
124  system("xrdcp {source} Geometry/{geoTag}.db".format(source = args.geoModelFile,
125  geoTag=args.geoTag))
126 
127  args.geoModelFile = "Geometry/{geoTag}.db".format(geoTag=args.geoTag)
128  print ("Use geometry file: {geoFile}".format(geoFile = args.geoModelFile))
129  flags.GeoModel.AtlasVersion = args.geoTag
130  flags.IOVDb.GlobalTag = args.condTag
131  flags.GeoModel.SQLiteDB = True
132  flags.GeoModel.SQLiteDBFullPath = args.geoModelFile
133 
134  flags.Detector.GeometryBpipe = False
135 
136  flags.Detector.GeometryBCM = False
137  flags.Detector.GeometryPixel = False
138  flags.Detector.GeometrySCT = False
139  flags.Detector.GeometryTRT = False
140 
141  flags.Detector.GeometryPLR = False
142  flags.Detector.GeometryBCMPrime = False
143  flags.Detector.GeometryITkPixel = False
144  flags.Detector.GeometryITkStrip = False
145 
146  flags.Detector.GeometryHGTD = False
147 
148  flags.Detector.GeometryLAr = False
149  flags.Detector.GeometryTile = False
150  flags.Detector.GeometryMBTS = False
151  flags.Detector.GeometryCalo = False
152 
153  flags.Detector.GeometryCSC = False
154  if args.noSTGC:
155  flags.Detector.GeometrysTGC = False
156  if args.noMM:
157  flags.Detector.GeometryMM = False
158  if args.noTgc:
159  flags.Detector.GeometryTGC = False
160  if args.noRpc:
161  flags.Detector.GeometryRPC = False
162  if args.noMdt:
163  flags.Detector.GeometryMDT = False
164 
165  flags.Scheduler.CheckDependencies = True
166  flags.Scheduler.ShowDataDeps = True
167  flags.Scheduler.ShowDataFlow = True
168  flags.Scheduler.ShowControlFlow = True
169  flags.Scheduler.EnableVerboseViews = True
170  flags.Scheduler.AutoLoadUnmetDependencies = True
171  #flags.PerfMon.doFullMonMT = True
172 
173  flags.lock()
174  flags.dump(evaluate = True)
175  if not flags.Muon.usePhaseIIGeoSetup:
176  print ("Please make sure that the file you're testing contains the Muon R4 geometry")
177  exit(1)
178 
179  cfg = setupServicesCfg(flags)
180 
181  from MuonConfig.MuonGeometryConfig import MuonGeoModelCfg
182  cfg.merge(MuonGeoModelCfg(flags))
183 
184  from ActsAlignmentAlgs.AlignmentAlgsConfig import ActsGeometryContextAlgCfg
185  cfg.merge(ActsGeometryContextAlgCfg(flags))
186 
187  cfg.getService("MessageSvc").verboseLimit = 10000000
188  cfg.getService("MessageSvc").debugLimit = 10000000
189 
190  return flags, cfg
191 

◆ setupHistSvcCfg()

def python.testGeoModel.setupHistSvcCfg (   flags,
  outFile = "MdtGeoDump.root",
  outStream = "GEOMODELTESTER" 
)

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

58 def setupHistSvcCfg(flags, outFile="MdtGeoDump.root", outStream="GEOMODELTESTER"):
59  result = ComponentAccumulator()
60  if len(outFile) == 0: return result
61  histSvc = CompFactory.THistSvc(Output=[f"{outStream} DATAFILE='{outFile}', OPT='RECREATE'"])
62  result.addService(histSvc, primary=True)
63  return result
64 
65 

◆ setupServicesCfg()

def python.testGeoModel.setupServicesCfg (   flags)

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

40 def setupServicesCfg(flags):
41  from AthenaConfiguration.MainServicesConfig import MainServicesCfg
42  result = MainServicesCfg(flags)
43 
44  from AthenaConfiguration.Enums import Format
45  if flags.Input.Format is Format.POOL:
46  from AthenaPoolCnvSvc.PoolReadConfig import PoolReadCfg
47  result.merge(PoolReadCfg(flags))
48  elif flags.Input.Format == Format.BS:
49  from ByteStreamCnvSvc.ByteStreamConfig import ByteStreamReadCfg
50  result.merge(ByteStreamReadCfg(flags))
51 
52  from PerfMonComps.PerfMonCompsConfig import PerfMonMTSvcCfg
53  result.merge(PerfMonMTSvcCfg(flags))
54  from MuonConfig.MuonGeometryConfig import MuonIdHelperSvcCfg
55  result.merge(MuonIdHelperSvcCfg(flags))
56  return result
57 

Variable Documentation

◆ args

def python.testGeoModel.args = SetupArgParser().parse_args()

◆ cfg

python.testGeoModel.cfg

◆ chambToExclude

list python.testGeoModel.chambToExclude = [] if "none" in args.excludedChambers else args.excludedChambers

◆ chambToTest

def python.testGeoModel.chambToTest = 0 else []

◆ checkGeo

python.testGeoModel.checkGeo

◆ flags

python.testGeoModel.flags

◆ setVerbose

python.testGeoModel.setVerbose
python.testGeoModel.GeoModelMdtTestCfg
def GeoModelMdtTestCfg(flags, name="GeoModelMdtTest", **kwargs)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:66
python.JetAnalysisCommon.ComponentAccumulator
ComponentAccumulator
Definition: JetAnalysisCommon.py:302
vtune_athena.format
format
Definition: vtune_athena.py:14
python.dummyaccess.listdir
def listdir(dirname)
Definition: dummyaccess.py:6
python.ByteStreamConfig.ByteStreamReadCfg
def ByteStreamReadCfg(flags, type_names=None)
Definition: Event/ByteStreamCnvSvc/python/ByteStreamConfig.py:25
python.PerfMonCompsConfig.PerfMonMTSvcCfg
def PerfMonMTSvcCfg(flags, **kwargs)
A minimal new-style configuration for PerfMonMTSvc.
Definition: PerfMonCompsConfig.py:10
python.testGeoModel.setupServicesCfg
def setupServicesCfg(flags)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:40
python.testGeoModel.geoModelFileDefault
def geoModelFileDefault(useR4Layout=False)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:5
python.testGeoModel.setupHistSvcCfg
def setupHistSvcCfg(flags, outFile="MdtGeoDump.root", outStream="GEOMODELTESTER")
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:58
python.MuonGeometryConfig.MuonIdHelperSvcCfg
def MuonIdHelperSvcCfg(flags)
Definition: MuonGeometryConfig.py:15
python.testGeoModel.executeTest
def executeTest(cfg)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:192
python.testGeoModel.GeoModelTgcTestCfg
def GeoModelTgcTestCfg(flags, name="GeoModelTgcTest", **kwargs)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:78
python.testGeoModel.setupGeoR4TestCfg
def setupGeoR4TestCfg(args, flags=None)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:103
AlignmentAlgsConfig.ActsGeometryContextAlgCfg
def ActsGeometryContextAlgCfg(flags, name="GeometryContextAlg", **kwargs)
Setup the Geometry context algorithm.
Definition: AlignmentAlgsConfig.py:125
python.MainServicesConfig.MainServicesCfg
def MainServicesCfg(flags, LoopMgr='AthenaEventLoopMgr')
Definition: MainServicesConfig.py:260
python.testGeoModel.SetupArgParser
def SetupArgParser()
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:12
calibdata.exit
exit
Definition: calibdata.py:236
python.testGeoModel.NswGeoPlottingAlgCfg
def NswGeoPlottingAlgCfg(flags, name="NswGeoPlotting", **kwargs)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:96
python.testGeoModel.GeoModelRpcTestCfg
def GeoModelRpcTestCfg(flags, name="GeoModelRpcTest", **kwargs)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:72
python.testGeoModel.GeoModelsTgcTestCfg
def GeoModelsTgcTestCfg(flags, name="GeoModelsTgcTest", **kwargs)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:84
python.MuonGeometryConfig.MuonGeoModelCfg
def MuonGeoModelCfg(flags)
Definition: MuonGeometryConfig.py:28
python.AllConfigFlags.initConfigFlags
def initConfigFlags()
Definition: AllConfigFlags.py:19
python.testGeoModel.GeoModelMmTestCfg
def GeoModelMmTestCfg(flags, name="GeoModelMmTest", **kwargs)
Definition: MuonPhaseII/MuonDetDescr/MuonGeoModelTestR4/python/testGeoModel.py:90
python.PoolReadConfig.PoolReadCfg
def PoolReadCfg(flags)
Definition: PoolReadConfig.py:69