This class ised to convert cell hash to cell name
Definition at line 10 of file TileCellTools.py.
◆ __init__()
def python.TileCellTools.TileCellHashMgr.__init__ |
( |
|
self, |
|
|
|
geometry = 'Default' , |
|
|
|
cabling = 'RUN2' |
|
) |
| |
Definition at line 15 of file TileCellTools.py.
15 def __init__(self, geometry='Default', cabling='RUN2'):
18 self._geometry=geometry
20 if geometry ==
"UpgradeABC":
22 [
"A-1",
"A-2",
"A-3",
"B-1",
"C-1",
"A-4",
"A-5",
"A-6",
"A-7",
"B-2",
"C-2",
"A-8",
"A-9",
"D-1",
"A-10",
"A-11",
"B-3",
"C-3",
"A-12",
"A-13",
"A-14",
"A-15",
"B-4",
"C-4",
23 "A-16",
"A-17",
"D-2",
"A-18",
"A-19",
"B-5",
"C-5",
"A-20",
"A-21",
"A-22",
"A-23",
"B-6",
"C-6",
"A-24",
"A-25",
"D-3",
"A-26",
"A-27",
"B-7",
"C-7",
"A-28",
"A-29",
"A-30",
24 "A-31",
"B-8",
"C-8",
"A-32",
"A-33",
"A-34",
"A-35",
"B-9",
"A-36",
"A-37",
"A-38",
"A-39",
"A-40"],
25 [
"A+1",
"D*0",
"A+2",
"A+3",
"B+1",
"C+1",
"A+4",
"A+5",
"A+6",
"A+7",
"B+2",
"C+2",
"A+8",
"A+9",
"D+1",
"A+10",
"A+11",
"B+3",
"C+3",
"A+12",
"A+13",
"A+14",
"A+15",
"B+4",
"C+4",
26 "A+16",
"A+17",
"D+2",
"A+18",
"A+19",
"B+5",
"C+5",
"A+20",
"A+21",
"A+22",
"A+23",
"B+6",
"C+6",
"A+24",
"A+25",
"D+3",
"A+26",
"A+27",
"B+7",
"C+7",
"A+28",
"A+29",
"A+30",
27 "A+31",
"B+8",
"C+8",
"A+32",
"A+33",
"A+34",
"A+35",
"B+9",
"A+36",
"A+37",
"A+38",
"A+39",
"A+40"],
28 [
"D-5",
"A-42",
"B-11",
"A-44",
"A-45",
"A-46",
"A-47",
"B-12",
"A-48",
"A-49",
"D-6",
"A-50",
"A-51",
"B-13",
"A-52",
"A-53",
"A-54",
"A-55",
"B-14",
"A-56",
"A-57",
"A-58",
"A-59",
"B-15",
29 "A-60",
"A-61",
"A-62",
"A-63",
"A-64"],
30 [
"D+5",
"A+42",
"B+11",
"A+44",
"A+45",
"A+46",
"A+47",
"B+12",
"A+48",
"A+49",
"D+6",
"A+50",
"A+51",
"B+13",
"A+52",
"A+53",
"A+54",
"A+55",
"B+14",
"A+56",
"A+57",
"A+58",
"A+59",
"B+15",
31 "A+60",
"A+61",
"A+62",
"A+63",
"A+64"],
32 [
"D-4",
"C-10",
"E-1",
"E-2",
"E-3",
"E-4",
"spD-4",
"spC-10",
"spD-40",
"spE-1",
"mbE-1",
"e4E-1"],
33 [
"D+4",
"C+10",
"E+1",
"E+2",
"E+3",
"E+4",
"spD+4",
"spC+10",
"spD+40",
"spE+1",
"mbE+1",
"e4E+1"]
35 self._nCellsModule = [60,61,29,29,6,6]
37 elif geometry ==
"UpgradeBC":
39 [
"A-1",
"B-1",
"C-1",
"A-2",
"B-2",
"C-2",
"A-3",
"B-3",
"C-3",
"D-1",
"A-4",
"B-4",
"C-4",
"A-5",
"B-5",
"C-5",
"D-2",
"A-6",
"B-6",
"C-6",
"A-7",
"B-7",
"C-7",
40 "D-3",
"A-8",
"B-8",
"C-8",
"A-9",
"B-9",
"A-10"],
41 [
"A+1",
"B+1",
"C+1",
"D*0",
"A+2",
"B+2",
"C+2",
"A+3",
"B+3",
"C+3",
"D+1",
"A+4",
"B+4",
"C+4",
"A+5",
"B+5",
"C+5",
"D+2",
"A+6",
"B+6",
"C+6",
"A+7",
"B+7",
"C+7",
42 "D+3",
"A+8",
"B+8",
"C+8",
"A+9",
"B+9",
"A+10"],
43 [
"B-11",
"D-5",
"A-12",
"B-12",
"A-13",
"B-13",
"D-6",
"A-14",
"B-14",
"A-15",
"B-15",
"A-16"],
44 [
"B+11",
"D+5",
"A+12",
"B+12",
"A+13",
"B+13",
"D+6",
"A+14",
"B+14",
"A+15",
"B+15",
"A+16"],
45 [
"D-4",
"C-10",
"E-1",
"E-2",
"E-3",
"E-4",
"spD-4",
"spC-10",
"spD-40",
"spE-1",
"mbE-1",
"e4E-1"],
46 [
"D+4",
"C+10",
"E+1",
"E+2",
"E+3",
"E+4",
"spD+4",
"spC+10",
"spD+40",
"spE+1",
"mbE+1",
"e4E+1"]
48 self._nCellsModule = [30,31,12,12,6,6]
50 elif geometry ==
"UpgradeA":
52 [
"A-1",
"A-2",
"A-3",
"B-1",
"A-4",
"A-5",
"A-6",
"A-7",
"B-2",
"A-8",
"A-9",
"D-1",
"A-10",
"A-11",
"B-3",
"A-12",
"A-13",
"A-14",
"A-15",
"B-4",
"A-16",
"A-17",
"D-2",
"A-18",
53 "A-19",
"B-5",
"A-20",
"A-21",
"A-22",
"A-23",
"B-6",
"A-24",
"A-25",
"D-3",
"A-26",
"A-27",
"B-7",
"A-28",
"A-29",
"A-30",
"A-31",
"B-8",
"A-32",
"A-33",
"A-34",
54 "A-35",
"B-9",
"A-36",
"A-37",
"A-38",
"A-39",
"A-40"],
55 [
"A+1",
"D*0",
"A+2",
"A+3",
"B+1",
"A+4",
"A+5",
"A+6",
"A+7",
"B+2",
"A+8",
"A+9",
"D+1",
"A+10",
"A+11",
"B+3",
"A+12",
"A+13",
"A+14",
"A+15",
"B+4",
"A+16",
"A+17",
"D+2",
"A+18",
56 "A+19",
"B+5",
"A+20",
"A+21",
"A+22",
"A+23",
"B+6",
"A+24",
"A+25",
"D+3",
"A+26",
"A+27",
"B+7",
"A+28",
"A+29",
"A+30",
"A+31",
"B+8",
"A+32",
"A+33",
"A+34",
57 "A+35",
"B+9",
"A+36",
"A+37",
"A+38",
"A+39",
"A+40"],
58 [
"D-5",
"A-42",
"B-11",
"A-44",
"A-45",
"A-46",
"A-47",
"B-12",
"A-48",
"A-49",
"D-6",
"A-50",
"A-51",
"B-13",
"A-52",
"A-53",
"A-54",
"A-55",
"B-14",
"A-56",
"A-57",
"A-58",
"A-59",
"B-15",
59 "A-60",
"A-61",
"A-62",
"A-63",
"A-64"],
60 [
"D+5",
"A+42",
"B+11",
"A+44",
"A+45",
"A+46",
"A+47",
"B+12",
"A+48",
"A+49",
"D+6",
"A+50",
"A+51",
"B+13",
"A+52",
"A+53",
"A+54",
"A+55",
"B+14",
"A+56",
"A+57",
"A+58",
"A+59",
"B+15",
61 "A+60",
"A+61",
"A+62",
"A+63",
"A+64"],
62 [
"D-4",
"C-10",
"E-1",
"E-2",
"E-3",
"E-4",
"spD-4",
"spC-10",
"spD-40",
"spE-1",
"mbE-1",
"e4E-1"],
63 [
"D+4",
"C+10",
"E+1",
"E+2",
"E+3",
"E+4",
"spD+4",
"spC+10",
"spD+40",
"spE+1",
"mbE+1",
"e4E+1"]
65 self._nCellsModule = [52,53,29,29,6,6]
68 self._geometry=
"Default"
70 [
"A-1",
"B-1",
"A-2",
"B-2",
"A-3",
"B-3",
"D-1",
"A-4",
"B-4",
"A-5",
"B-5",
"D-2",
"A-6",
"B-6",
"A-7",
"B-7",
"D-3",
"A-8",
"B-8",
"A-9",
"B-9",
"A-10"],
71 [
"A+1",
"B+1",
"D*0",
"A+2",
"B+2",
"A+3",
"B+3",
"D+1",
"A+4",
"B+4",
"A+5",
"B+5",
"D+2",
"A+6",
"B+6",
"A+7",
"B+7",
"D+3",
"A+8",
"B+8",
"A+9",
"B+9",
"A+10"],
72 [
"B-11",
"D-5",
"A-12",
"B-12",
"A-13",
"B-13",
"D-6",
"A-14",
"B-14",
"A-15",
"B-15",
"A-16"],
73 [
"B+11",
"D+5",
"A+12",
"B+12",
"A+13",
"B+13",
"D+6",
"A+14",
"B+14",
"A+15",
"B+15",
"A+16"],
74 [
"D-4",
"C-10",
"E-1",
"E-2",
"E-3",
"E-4",
"spD-4",
"spC-10",
"spD-40",
"spE-1",
"mbE-1",
"e4E-1"],
75 [
"D+4",
"C+10",
"E+1",
"E+2",
"E+3",
"E+4",
"spD+4",
"spC+10",
"spD+40",
"spE+1",
"mbE+1",
"e4E+1"]
77 self._nCellsModule = [22,23,12,12,6,6]
79 self._partNames=[
"LBC",
"LBA",
"EBC",
"EBA",
"EBC",
"EBA"]
81 self._nCellsPart = [0]
84 self._nHashMax+=self._nCellsModule[p]*self._nModules
85 self._nCellsPart.
append(self._nHashMax)
◆ cellName()
def python.TileCellTools.TileCellHashMgr.cellName |
( |
|
self, |
|
|
|
hash |
|
) |
| |
return cell name for given hash
Definition at line 145 of file TileCellTools.py.
147 return cell name for given hash
149 if hash>=self._nHashMax
or hash<0:
152 part=bisect.bisect(self._nCellsPart,hash)-1
153 module=(hash-self._nCellsPart[part])//self._nCellsModule[part]+1
154 index=(hash-self._nCellsPart[part])%self._nCellsModule[part]
156 if index==0
and ((part==4
and module==18)
or (part==5
and module==15)):
158 if index==0
and (module>=15
and module<=18):
160 if index==1
and ((module>=39
and module<=42)
or (module>=55
and module<=58)):
162 if index==2
and (self._cabling==
'RUN2' or self._cabling==
'RUN2a' or self._cabling==
'RUN3'):
163 if part==4
and (self._cabling==
'RUN2' or self._cabling==
'RUN2a'):
164 if module==28
or module==29
or module==31
or module==32
or module==35
or module==34
or module==38
or module==37:
166 if module==7
or module==8
or module==25
or module==24
or module==44
or module==43
or module==53
or module==54:
168 if self._cabling==
'RUN2a' or self._cabling==
'RUN3':
170 if module==4
or module==3
or module==21
or module==20
or module==47
or module==46
or module==60
or module==59:
173 if module==4
or module==3
or module==18
or module==19
or module==47
or module==46
or module==60
or module==59:
176 return self._cellNames[part][index]
◆ getGeometry()
def python.TileCellTools.TileCellHashMgr.getGeometry |
( |
|
self | ) |
|
return geometry name
Definition at line 88 of file TileCellTools.py.
88 def getGeometry(self):
◆ getHashMax()
def python.TileCellTools.TileCellHashMgr.getHashMax |
( |
|
self | ) |
|
◆ getNames()
def python.TileCellTools.TileCellHashMgr.getNames |
( |
|
self, |
|
|
|
hash |
|
) |
| |
return module name and cell name for given hash
Definition at line 102 of file TileCellTools.py.
102 def getNames(self, hash):
104 return module name and cell name for given hash
106 if hash>=self._nHashMax
or hash<0:
109 part=bisect.bisect(self._nCellsPart,hash)-1
110 module=(hash-self._nCellsPart[part])//self._nCellsModule[part]+1
111 modName=
"%s%02d" % (self._partNames[part],module)
112 index=(hash-self._nCellsPart[part])%self._nCellsModule[part]
114 if index==0
and ((part==4
and module==18)
or (part==5
and module==15)):
116 if index==0
and (module==14
or module==15
or module==18
or module==19):
118 if index==1
and ((module>=39
and module<=42)
or (module>=55
and module<=58)):
120 if index==2
and (self._cabling==
'RUN2' or self._cabling==
'RUN2a' or self._cabling==
'RUN3'):
121 if part==4
and (self._cabling==
'RUN2' or self._cabling==
'RUN2a'):
122 if module==28
or module==31
or module==35
or module==38:
124 if module==29
or module==32
or module==34
or module==37:
126 if module==7
or module==25
or module==44
or module==53:
128 if module==8
or module==24
or module==43
or module==54:
130 if self._cabling==
'RUN2a' or self._cabling==
'RUN3':
132 if module==4
or module==21
or module==47
or module==60:
134 if module==3
or module==20
or module==46
or module==59:
137 if module==4
or module==18
or module==47
or module==60:
139 if module==3
or module==19
or module==46
or module==59:
142 return (modName,self._cellNames[part][index])
◆ moduleName()
def python.TileCellTools.TileCellHashMgr.moduleName |
( |
|
self, |
|
|
|
hash |
|
) |
| |
return module name for given hash
Definition at line 179 of file TileCellTools.py.
179 def moduleName(self, hash):
181 return module name for given hash
183 if hash>=self._nHashMax
or hash<0:
186 part=bisect.bisect(self._nCellsPart,hash)-1
187 module=(hash-self._nCellsPart[part])//self._nCellsModule[part]+1
188 modName=
"%s%02d" % (self._partNames[part],module)
◆ _cabling
python.TileCellTools.TileCellHashMgr._cabling |
|
private |
◆ _cellNames
python.TileCellTools.TileCellHashMgr._cellNames |
|
private |
◆ _geometry
python.TileCellTools.TileCellHashMgr._geometry |
|
private |
◆ _nCellsModule
python.TileCellTools.TileCellHashMgr._nCellsModule |
|
private |
◆ _nCellsPart
python.TileCellTools.TileCellHashMgr._nCellsPart |
|
private |
◆ _nHashMax
python.TileCellTools.TileCellHashMgr._nHashMax |
|
private |
◆ _nModules
python.TileCellTools.TileCellHashMgr._nModules |
|
private |
◆ _partNames
python.TileCellTools.TileCellHashMgr._partNames |
|
private |
The documentation for this class was generated from the following file: