ATLAS Offline Software
LArGeoDB.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 versionname, layout and dbm from LArSwitches table
5 
6  dbGeomCursor: AtlasGeoDBInterface instance
7  """
8 
9  dbId, dbSwitches, dbParam = dbGeomCursor.GetCurrentLeafContent("LArSwitches")
10  params = {"Sagging" : None,
11  "BarrelOn" : None,
12  "EndcapOn" : None,
13  "FCal_GeoType" : "UNDEFINED",
14  "DetAbs" : None,
15  "DetAbs_EC" : None}
16 
17  if len(dbId)>0:
18  key=dbId[0]
19  if "SAGGING" in dbParam:
20  params["Sagging"] = dbSwitches[key][dbParam.index("SAGGING")]
21  if "BARREL_ON" in dbParam:
22  params["BarrelOn"] = dbSwitches[key][dbParam.index("BARREL_ON")]
23  if "ENDCAP_ON" in dbParam :
24  params["EndcapOn"] = dbSwitches[key][dbParam.index("ENDCAP_ON")]
25  if "DETAILED_ABSORBER" in dbParam :
26  params["DetAbs"] = dbSwitches[key][dbParam.index("DETAILED_ABSORBER")]
27  if "DETAILED_ABSORBER_EC" in dbParam :
28  params["DetAbs_EC"] = dbSwitches[key][dbParam.index("DETAILED_ABSORBER_EC")]
29  if "FCAL_GEOTYPE" in dbParam :
30  params["FCal_GeoType"] = dbSwitches[key][dbParam.index("FCAL_GEOTYPE")]
31 
32  return params
33 
35  """Read versionname, layout and dbm from LArSwitches table in SQLite
36 
37  sqliteDbReader: AtlasGeoDBInterface_SQLite instance
38  """
39 
40  dbData = sqliteDbReader.GetData("LArSwitches")
41  params = {"Sagging" : None,
42  "BarrelOn" : None,
43  "EndcapOn" : None,
44  "FCal_GeoType" : "UNDEFINED",
45  "DetAbs" : None,
46  "DetAbs_EC" : None}
47 
48  if dbData:
49  if "SAGGING" in dbData[0].keys():
50  params["Sagging"] = dbData[0]["SAGGING"]
51  if "BARREL_ON" in dbData[0].keys():
52  params["BarrelOn"] = dbData[0]["BARREL_ON"]
53  if "ENDCAP_ON" in dbData[0].keys():
54  params["EndcapOn"] = dbData[0]["ENDCAP_ON"]
55  if "DETAILED_ABSORBER" in dbData[0].keys():
56  params["DetAbs"] = dbData[0]["DETAILED_ABSORBER"]
57  if "DETAILED_ABSORBER_EC" in dbData[0].keys():
58  params["DetAbs_EC"] = dbData[0]["DETAILED_ABSORBER_EC"]
59  if "FCAL_GEOTYPE" in dbData[0].keys():
60  params["FCal_GeoType"] = dbData[0]["FCAL_GEOTYPE"]
61 
62  return params
LArGeoDB.InitializeGeometryParameters
def InitializeGeometryParameters(dbGeomCursor)
Definition: LArGeoDB.py:3
LArGeoDB.InitializeGeometryParameters_SQLite
def InitializeGeometryParameters_SQLite(sqliteDbReader)
Definition: LArGeoDB.py:34
python.Bindings.keys
keys
Definition: Control/AthenaPython/python/Bindings.py:798