3def InitializeGeometryParameters(dbGeomCursor):
4 """Read geometry parameters for Pixel
5
6 dbGeomCursor: AtlasGeoDBInterface instance
7 """
8
9
10
11 dbId, dbSwitches, dbParam = dbGeomCursor.GetCurrentLeafContent("PixelSwitches")
12
13 params = {"VersionName" : "UNDEFINED",
14 "Layout" : "UNDEFINED",
15 "DBM" : False }
16
17 if dbId:
18 key = dbId[0]
19 if "VERSIONNAME" in dbParam:
20 params["VersionName"] = dbSwitches[key][dbParam.index("VERSIONNAME")]
21 if "LAYOUT" in dbParam :
22 params["Layout"] = dbSwitches[key][dbParam.index("LAYOUT")]
23 if "BUILDDBM" in dbParam :
24 params["DBM"] = (dbSwitches[key][dbParam.index("BUILDDBM")] != 0)
25
26
27
28
29 params["IBL"] = (params["Layout"] == "IBL")
30 params["IBLlayout"] = "noIBL"
31
32 if params["IBL"]:
33 dbId, dbLayers, dbParam = dbGeomCursor.GetCurrentLeafContent("PixelLayer")
34 IBLStaveIndex = -1
35 IBLgeoLayout = -1
36
37 if dbId:
38 key = dbId[0]
39 if "STAVEINDEX" in dbParam and dbLayers[key][dbParam.index("STAVEINDEX")] not in ["NULL", None]:
40 IBLStaveIndex = int(dbLayers[key][dbParam.index("STAVEINDEX")])
41
42 if IBLStaveIndex > -1:
43 dbId, dbStaves, dbParam = dbGeomCursor.GetCurrentLeafContent("PixelStave")
44
45 if dbId and IBLStaveIndex <= len(dbStaves.keys()):
46 key = dbId[IBLStaveIndex]
47 if "LAYOUT" in dbParam and dbStaves[key][dbParam.index("LAYOUT")] not in ["NULL", None]:
48 IBLgeoLayout = int(dbStaves[key][dbParam.index("LAYOUT")])
49 if IBLgeoLayout in [3,4] : params["IBLlayout"] = "planar"
50 elif IBLgeoLayout in [5] : params["IBLlayout"] = "3D"
51
52 return params
53