ATLAS Offline Software
MuonGeoDB.py
Go to the documentation of this file.
1 # Copyright (C) 2002-2024 CERN for the benefit of the ATLAS collaboration
2 
3 def InitializeGeometryParameters(dbGeomCursor):
4  """Read muon geometry parameters
5 
6  dbGeomCursor: AtlasGeoDBInterface instance
7  """
8  dbId, dbSwitches, dbParam = dbGeomCursor.GetCurrentLeafContent("MuonSwitches")
9  params = {"Layout" : "UNDEFINED",
10  "HasCSC" : False,
11  "HasSTGC" : True,
12  "HasMM" : True,
13  "HasMDT": True,
14  "HasRPC": True,
15  "HasTGC": True,
16  "useR4Plugin": False}
17 
18  if len(dbId)>0:
19  key=dbId[0]
20  if "LAYOUTNAME" in dbParam:
21  params["Layout"] = dbSwitches[key][dbParam.index("LAYOUTNAME")]
22  if "HASCSC" in dbParam:
23  params["HasCSC"] = (dbSwitches[key][dbParam.index("HASCSC")] != 0)
24  if "HASSTGC" in dbParam:
25  params["HasSTGC"] = (dbSwitches[key][dbParam.index("HASSTGC")] !=0)
26  if "HASMM" in dbParam:
27  params["HasMM"] = (dbSwitches[key][dbParam.index("HASMM")] != 0)
28 
29  return params
30 
32  """Read muon geometry parameters from SQLite
33 
34  sqliteDbReader: AtlasGeoDBInterface_SQLite instance
35  """
36  dbData = sqliteDbReader.GetData("MuonSwitches")
37  params = {"Layout" : "UNDEFINED",
38  "HasCSC" : False,
39  "HasSTGC" : True,
40  "HasMM" : True,
41  "HasMDT": True,
42  "HasRPC": True,
43  "HasTGC": True,
44  "useR4Plugin": False}
45 
46  if dbData:
47  if "LAYOUTNAME" in dbData[0].keys():
48  params["Layout"] = dbData[0]["LAYOUTNAME"]
49  if "hasCsc" in dbData[0].keys():
50  params["HasCSC"] = (dbData[0]["hasCsc"] != 0)
51  if "hasSTGC" in dbData[0].keys():
52  params["HasSTGC"] = (dbData[0]["hasSTGC"] !=0)
53  if "hasMM" in dbData[0].keys():
54  params["HasMM"] = (dbData[0]["hasMM"] != 0)
55  if "hasMdt" in dbData[0].keys():
56  params["HasMDT"] = (dbData[0]["hasMdt"] != 0)
57  if "hasRpc" in dbData[0].keys():
58  params["HasRPC"] = (dbData[0]["hasRpc"] != 0)
59  if "hasTgc" in dbData[0].keys():
60  params["HasTGC"] = (dbData[0]["hasTgc"] != 0)
61  if "isMuonR4Plugin" in dbData[0].keys():
62  params["useR4Plugin"] = (dbData[0]["isMuonR4Plugin"] != 0)
63  return params
MuonGeoDB.InitializeGeometryParameters
def InitializeGeometryParameters(dbGeomCursor)
Definition: MuonGeoDB.py:3
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798
MuonGeoDB.InitializeGeometryParameters_SQLite
def InitializeGeometryParameters_SQLite(sqliteDbReader)
Definition: MuonGeoDB.py:31