331 """ provides the new mapping for the feet and elevator region
332 The numbers can be found in doc/roi_map_R2.pdf
338 if sectorId
in [23,24,55,56]:
342 etaMap = { 23 : [ [0,1,2,3,5,7], [4,6,8,9,10,11],
range(12,20) + [21,23], [20,22] +
range(24,28) ],
343 24 : [ [0,1,2,3,4,6], [5,7,8,9,10,11],
range(12,20) + [20,22], [21,23] +
range(24,28) ] }
344 etaMap[55] = etaMap[24]
345 etaMap[56] = etaMap[23]
347 for ec, tt
in enumerate(etaMap[sectorId]):
353 if sectorId
in [23,55]:
354 if roiId
in [2,3,6,7,10,11,18,19,22,23,27]:
356 if roiId
in [0,1,4,5,8,9,12,13,14,15,16,17,20,21,25]:
358 elif sectorId
in [24,56]:
359 if roiId
in [0,1,4,5,8,9,12,13,14,15,16,17,20,21,24]:
361 if roiId
in [2,3,6,7,10,11,18,19,22,23,26]:
365 if roiId == 27: phicode = 2
366 elif roiId == 25: phicode = 3
368 if roiId == 24: phicode = 4
369 elif roiId == 26: phicode = 5
371 if roiId == 24: phicode = 3
372 elif roiId == 26: phicode = 2
374 if roiId == 27: phicode = 5
375 elif roiId == 25: phicode = 4
379 elif [21,22,25,26,53,54,57,58]:
383 etaMap = { 21 : [
range(0,8),
range(8,16) + [17,19], [16,18] +
range(20,32) ],
385 etaMap[25] = etaMap[21]
386 etaMap[26] = etaMap[22]
387 etaMap[53] = etaMap[22]
388 etaMap[54] = etaMap[21]
389 etaMap[57] = etaMap[53]
390 etaMap[58] = etaMap[54]
392 for ec, tt
in enumerate(etaMap[sectorId]):
398 if sectorId
in [21,53]:
399 if roiId
in [2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31]:
401 elif roiId
in [0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29]:
403 elif sectorId
in [22,54]:
404 if roiId
in [0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29]:
406 elif roiId
in [2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31]:
408 elif sectorId
in [25,57]:
409 if roiId
in [2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31]:
411 elif roiId
in [0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29]:
413 elif sectorId
in [26,58]:
414 if roiId
in [0,1,4,5,8,9,12,13,16,17,20,21,24,25,28,29]:
416 elif roiId
in [2,3,6,7,10,11,14,15,18,19,22,23,26,27,30,31]:
420 raise RuntimeError(
"No etacode for SL %i and ROI %i" % (sectorId, roiId))
422 raise RuntimeError(
"No phicode for SL %i and ROI %i" % (sectorId, roiId))
424 return (etacode,phicode)