9 "Unpack numeric MuonId and convert to station Phi phi eta, and the reverse. Accept numeric id, online(hardware), or offline (software) name for initialization. Will throw TubeIdError exception if id format is not known. There are no methods to produce online format name strings, only offline."
15 __stationRe =
'(?P<station>[BE][IEMO][MESLRFG])'
16 __mlRe =
'[-_]{0,1}(?P<ml>[12]){0,1}[-_]{0,1}(?P<ly>[1234]){0,1}[-_]{0,1}(?P<tb>[1-9][0-9]{0,2}){0,1}'
19 online_re = re.compile(__stationRe +
'(?P<eta>[0-8][AC])(?P<phi>[0-1][0-9])' + __mlRe)
20 offline_re = re.compile(__stationRe +
'_(?P<phi>[1-8])_(?P<eta>\\-*[0-8])_{0,1}' + __mlRe)
21 numeric_re = re.compile(
'[0-9]{7,9}')
30 def __init__(self, iid=None, setUnusedBits=True):
38 if (idmatch
is not None):
40 idgroups = idmatch.groupdict(1)
41 self.
InitByParam(idgroups[
'station'], idgroups[
'phi'], idgroups[
'eta'],idgroups[
'ml'],idgroups[
'ly'],idgroups[
'tb'])
44 if(idmatch
is not None):
45 idgroups = idmatch.groupdict(1)
46 swid = self.
mapToOffline(idgroups[
'station'],idgroups[
'phi'], idgroups[
'eta'],idgroups[
'ml'],idgroups[
'ly'],idgroups[
'tb'])
47 self.
InitByParam(swid[
'station'],swid[
'phi'], swid[
'eta'], swid[
'ml'],swid[
'ly'],swid[
'tb'])
49 raise MdtIdError(
"MDT id format does not match any known type")
127 swconv[
'station'] = station
135 swconv[
'eta'] =
int(etasign + eta[0])
137 swconv[
'ml'] =
int(ml)
138 swconv[
'ly'] =
int(ly)
139 swconv[
'tb'] =
int(tb)
145 if isinstance(station, str):
160 __kMdtMultilayerMask = 1
161 __kMdtMultilayerShift = 9
162 __kMdtMultilayerMin = 1
164 __kMdtTubeLayerMask = 3
165 __kMdtTubeLayerShift = 7
166 __kMdtTubeLayerMin = 1
172 __kStationNameMask = 63
173 __kStationNameShift = 24
174 __kStationNameMin = 1
176 __kStationEtaMask = 31
177 __kStationEtaShift = 19
178 __kStationEtaMin = -8
180 __kStationPhiMask = 63
181 __kStationPhiShift = 13
186 __kStationNameStrings = [
"BIL",
"BIS",
"BML",
"BMS",
"BOL",
"BOS",
"BEE",
"BIR",
"BMF",
"BOF",
"BOG",
"BME",
"BIM",
"EIC",
"EIL",
"EEL",
"EES",
"EMC",
"EML",
"EMS",
"EOC",
"EOL",
"EOS",
"EIS",
"T1F",
"T1E",
"T2F",
"T2E",
"T3F",
"T3E",
"T4F",
"T4E",
"CSS",
"CSL",
"BMG" ]
188 __kStationNameStringsMap = {
"BIL" : 0,
"BIS" : 1,
"BML" : 2,
"BMS" : 3,
"BOL" : 4,
"BOS" : 5,
"BEE" : 6,
"BIR" : 7,
"BMF" : 8,
"BOF" : 9,
"BOG" : 10,
"BME" : 11,
"BIM" : 12,
"EIC" : 13,
"EIL" : 14,
"EEL" : 15,
"EES" : 16,
"EMC" : 17,
"EML" : 18,
"EMS" : 19,
"EOC" : 20,
"EOL" : 21,
"EOS" : 22,
"EIS" : 23,
"T1F" : 24,
"T1E" : 25,
"T2F" : 26,
"T2E" : 27,
"T3F" : 28,
"T3E" : 29,
"T4F" : 30,
"T4E" : 31,
"CSS" : 32,
"CSL" : 33,
"BMG" : 34 }
193 __hardwareStationMaps = {
"BOE" :
"BOL" }
194 __BOFMAP = {1:1, 3:2, 5:3, 7:4}
195 __BOGMAP = {0:0, 2:1, 4:2, 6:3, 8:4}
197 __hardwareEtaMaps = {
198 "EEL" : { 5 : { 2:1 } },
199 "BML" : { 13 : { 5:4, 6:5 } },
200 "BOE" : { 13: { 3:7 } },
201 "BME" : { 13 : { 4:1 } },
202 "BOF" : { 12 : __BOFMAP, 14 : __BOFMAP },
203 "BOG" : { 12 : __BOGMAP, 14 : __BOGMAP }
205 __hardwareSideMap = {
"A":
"",
"C":
"-"}