16 const int lL[2][12] ={{5,15,26, 8,24,41,11,33,56, 0, 0, 0},
17 {3, 9,16, 7,21,36,11,33,56,16,48,81}};
25 theModule(0), theLadder(0), phase1(phase) {
28 int oldModule = tt->
pxbModule(
id) -4;
if (oldModule<=0) oldModule--;
38 if (oldModule < 0 && ladder < 0)
thePart =
mO;
39 else if (oldModule > 0 && ladder < 0)
thePart =
pO;
40 else if (oldModule < 0 && ladder > 0)
thePart =
mI;
41 else if (oldModule > 0 && ladder > 0)
thePart =
pI;
58 theModule(0), theLadder(0), phase1(phase) {
65 int oldModule = cmssw_numbering.
module() -4;
if (oldModule<=0) oldModule--;
67 int oldLadder = cmssw_numbering.
ladder();
72 if (oldLadder <= 3) oldLadder = 4-oldLadder;
73 else if (oldLadder >= 4 && oldLadder <= 9 ) oldLadder = 3-oldLadder;
74 else if (oldLadder >= 10) oldLadder = 16-oldLadder;
77 if (oldLadder <= 7) oldLadder = 8-oldLadder;
78 else if (oldLadder >= 8 && oldLadder <= 21) oldLadder = 7-oldLadder;
79 else if (oldLadder >= 22) oldLadder = 36-oldLadder;
82 if (oldLadder <= 11) oldLadder = 12-oldLadder;
83 else if (oldLadder >= 12 && oldLadder <= 33) oldLadder = 11-oldLadder;
84 else if (oldLadder >= 34) oldLadder = 56-oldLadder;
87 if (oldLadder <= 16) oldLadder = 17-oldLadder;
88 else if (oldLadder >= 17 && oldLadder <= 48) oldLadder = 16-oldLadder;
89 else if (oldLadder >= 49) oldLadder = 81-oldLadder;
95 if (oldLadder <= 5) oldLadder = 6-oldLadder;
96 else if (oldLadder >= 6 && oldLadder <= 15 ) oldLadder = 5-oldLadder;
97 else if (oldLadder >= 16) oldLadder = 26-oldLadder;
100 if (oldLadder <= 8) oldLadder = 9-oldLadder;
101 else if (oldLadder >= 9 && oldLadder <= 24) oldLadder = 8-oldLadder;
102 else if (oldLadder >= 25) oldLadder = 41-oldLadder;
105 if (oldLadder <= 11) oldLadder = 12-oldLadder;
106 else if (oldLadder >= 12 && oldLadder <= 33) oldLadder = 11-oldLadder;
107 else if (oldLadder >= 34) oldLadder = 56-oldLadder;
114 if (oldModule < 0 && oldLadder < 0)
thePart =
mO;
115 else if (oldModule > 0 && oldLadder < 0)
thePart =
pO;
116 else if (oldModule < 0 && oldLadder > 0)
thePart =
mI;
117 else if (oldModule > 0 && oldLadder > 0)
thePart =
pI;
140 if (oldLadder <= lL[ind][0] )
141 ladder =(lL[ind][0]+1)-oldLadder;
142 else if (oldLadder >= (lL[ind][0]+1) && oldLadder <= lL[ind][1])
143 ladder = lL[ind][0]-oldLadder;
144 else if (oldLadder >= (lL[ind][1]+1) )
145 ladder = lL[ind][2]-oldLadder;
149 if (oldLadder <= lL[ind][3])
150 ladder =(lL[ind][3]+1)-oldLadder;
151 else if (oldLadder >= (lL[ind][3]+1) && oldLadder <= lL[ind][4])
152 ladder = lL[ind][3]-oldLadder;
153 else if (oldLadder >= (lL[ind][4]+1))
154 ladder = lL[ind][5]-oldLadder;
158 if (oldLadder <= lL[ind][6])
159 ladder = (lL[ind][6]+1)-oldLadder;
160 else if (oldLadder >= (lL[ind][6]+1) && oldLadder <= lL[ind][7])
161 ladder = lL[ind][6]-oldLadder;
162 else if (oldLadder >= (lL[ind][7]+1))
163 ladder = lL[ind][8]-oldLadder;
167 if (oldLadder <= lL[ind][9])
168 ladder =(lL[ind][9]+1)-oldLadder;
169 else if (oldLadder >= (lL[ind][9]+1) && oldLadder <= lL[ind][10])
170 ladder = lL[ind][9]-oldLadder;
171 else if (oldLadder >= (lL[ind][10]+1))
172 ladder = lL[ind][11]-oldLadder;
182 theModule(0), theLadder(0), phase1(phase) {
187 if ( (name.substr(0, 5) !=
"BPix_") ||
188 (name.find(
"_B") == string::npos) ||
189 (name.find(
"_LYR") == string::npos) ||
190 (name.find(
"_LDR") == string::npos) ||
191 (name.find(
"_MOD") == string::npos) ) {
193 <<
"Bad name string in PixelBarrelName::PixelBarrelName(std::string): "
199 if (name.find(
"_ROC") != string::npos)
200 name = name.substr(0, name.find(
"_ROC"));
203 string shellString = name.substr(name.find(
"_B")+2, name.find(
"_SEC")-name.find(
"_B")-2);
205 else if (shellString ==
"mI")
thePart =
mI;
206 else if (shellString ==
"pO")
thePart =
pO;
207 else if (shellString ==
"pI")
thePart =
pI;
210 <<
"Unable to determine shell in PixelBarrelName::PixelBarrelName(std::string): "
215 string layerString = name.substr(name.find(
"_LYR")+4, name.find(
"_LDR")-name.find(
"_LYR")-4);
216 if (layerString ==
"1")
theLayer = 1;
217 else if (layerString ==
"2")
theLayer = 2;
218 else if (layerString ==
"3")
theLayer = 3;
222 <<
"Unable to determine layer in PixelBarrelName::PixelBarrelName(std::string): "
227 string ladderString = name.substr(name.find(
"_LDR")+4, name.find(
"_MOD")-name.find(
"_LDR")-4);
231 if (ladderString.substr(ladderString.size()-1, 1) ==
"F") {
232 int ladderNum = atoi(ladderString.substr(0, ladderString.size() -1).c_str());
234 else if (
theLayer == 2 && ladderNum >= 1 && ladderNum <= 14)
theLadder = ladderNum;
235 else if (
theLayer == 3 && ladderNum >= 1 && ladderNum <= 22)
theLadder = ladderNum;
236 else if (
theLayer == 4 && ladderNum >= 1 && ladderNum <= 32)
theLadder = ladderNum;
239 <<
"Unable to determine ladder in PixelBarrelNameUpgrade::PixelBarrelName(std::string): "
245 <<
"Unable to determine ladder in PixelBarrelNameUpgrade::PixelBarrelName(std::string): "
256 else if (ladderString.substr(ladderString.size()-1, 1) ==
"F") {
257 int ladderNum = atoi(ladderString.substr(0, ladderString.size() -1).c_str());
259 else if (
theLayer == 2 && ladderNum > 1 && ladderNum < 16)
theLadder = ladderNum;
260 else if (
theLayer == 3 && ladderNum > 1 && ladderNum < 22)
theLadder = ladderNum;
263 <<
"Unable to determine ladder in PixelBarrelName::PixelBarrelName(std::string): "
269 <<
"Unable to determine ladder in PixelBarrelName::PixelBarrelName(std::string): "
275 string moduleString = name.substr(name.find(
"_MOD")+4, name.size()-name.find(
"_MOD")-4);
277 else if (moduleString ==
"2")
theModule = 2;
278 else if (moduleString ==
"3")
theModule = 3;
279 else if (moduleString ==
"4")
theModule = 4;
282 <<
"Unable to determine module in PixelBarrelName::PixelBarrelName(std::string): "
296 case 1 : {sector = 1;
break;}
297 case 2 : {sector = 2;
break;}
298 case 3 : {sector = 3;
break;}
299 case 4 : {sector = 6;
break;}
300 case 5 : {sector = 7;
break;}
301 case 6 : {sector = 8;
break;}
307 case 1 :
case 2: {sector = 1;
break;}
308 case 3 : {sector = 2;
break;}
309 case 4 : {sector = 3;
break;}
310 case 5 : {sector = 4;
break;}
311 case 6 : {sector = 5;
break;}
312 case 7 : {sector = 6;
break;}
313 case 8 : {sector = 7;
break;}
314 case 9 :
case 10:{sector = 8;
break;}
323 case 1 :
case 2: {sector = 1;
break;}
324 case 3 :
case 4: {sector = 2;
break;}
325 case 5 :
case 6: {sector = 3;
break;}
326 case 7 : {sector = 4;
break;}
327 case 8 : {sector = 5;
break;}
328 case 9 :
case 10: {sector = 6;
break;}
329 case 11 :
case 12: {sector = 7;
break;}
330 case 13 :
case 14: {sector = 8;
break;}
336 case 1 :
case 2: {sector = 1;
break;}
337 case 3 :
case 4: {sector = 2;
break;}
338 case 5 :
case 6: {sector = 3;
break;}
339 case 7 :
case 8: {sector = 4;
break;}
340 case 9 :
case 10: {sector = 5;
break;}
341 case 11 :
case 12: {sector = 6;
break;}
342 case 13 :
case 14: {sector = 7;
break;}
343 case 15 :
case 16: {sector = 8;
break;}
352 case 1 :
case 2:
case 3: {sector = 1;
break;}
353 case 4 :
case 5:
case 6: {sector = 2;
break;}
354 case 7 :
case 8:
case 9: {sector = 3;
break;}
355 case 10 :
case 11: {sector = 4;
break;}
356 case 12 :
case 13: {sector = 5;
break;}
357 case 14 :
case 15:
case 16: {sector = 6;
break;}
358 case 17 :
case 18:
case 19: {sector = 7;
break;}
359 case 20 :
case 21:
case 22: {sector = 8;
break;}
365 case 1 :
case 2:
case 3: {sector = 1;
break;}
366 case 4 :
case 5:
case 6: {sector = 2;
break;}
367 case 7 :
case 8:
case 9: {sector = 3;
break;}
368 case 10 :
case 11: {sector = 4;
break;}
369 case 12 :
case 13: {sector = 5;
break;}
370 case 14 :
case 15:
case 16: {sector = 6;
break;}
371 case 17 :
case 18:
case 19: {sector = 7;
break;}
372 case 20 :
case 21:
case 22: {sector = 8;
break;}
381 case 1 :
case 2:
case 3:
case 4: {sector = 1;
break;}
382 case 5 :
case 6:
case 7:
case 8: {sector = 2;
break;}
383 case 9 :
case 10:
case 11:
case 12: {sector = 3;
break;}
384 case 13 :
case 14:
case 15:
case 16: {sector = 4;
break;}
385 case 17 :
case 18:
case 19:
case 20: {sector = 5;
break;}
386 case 21 :
case 22:
case 23:
case 24: {sector = 6;
break;}
387 case 25 :
case 26:
case 27:
case 28: {sector = 7;
break;}
388 case 29 :
case 30:
case 31:
case 32: {sector = 8;
break;}
401 bool halfModule =
false;
431 std::ostringstream stm;
455 outer = (shell ==
mO) || (shell ==
pO);
458 ladder = tmpLadder + lL[ind][0];
460 ladder = tmpLadder + lL[ind][3];
462 ladder = tmpLadder + lL[ind][6];
464 ladder = tmpLadder + lL[ind][9];
468 if (tmpLadder <= lL[ind][0]) ladder = (lL[ind][0]+1) - tmpLadder;
469 else ladder = lL[ind][2] - tmpLadder;
470 }
else if (layer == 2) {
471 if (tmpLadder <= lL[ind][3]) ladder = (lL[ind][3]+1) - tmpLadder;
472 else ladder = lL[ind][5] - tmpLadder;
473 }
else if (layer == 3) {
474 if (tmpLadder <= lL[ind][6]) ladder = (lL[ind][6]+1) - tmpLadder;
475 else ladder = lL[ind][8] - tmpLadder;
476 }
else if (layer == 4) {
477 if (tmpLadder <= lL[ind][9]) ladder = (lL[ind][9]+1) - tmpLadder;
478 else ladder = lL[ind][11] - tmpLadder;
484 if (shell ==
pO || shell ==
pI)
485 module = tmpModule + 4;
487 module = 5 - tmpModule;
507 outer = (shell ==
mO) || (shell ==
pO);
513 ladder = tmpLadder + 3;
515 ladder = tmpLadder + 7;
517 ladder = tmpLadder + 11;
519 ladder = tmpLadder + 16;
522 if (tmpLadder <= 3) ladder = 4 - tmpLadder;
523 else if (tmpLadder <= 6) ladder = 16 - tmpLadder;
524 }
else if (layer == 2) {
525 if (tmpLadder <= 7) ladder = 8 - tmpLadder;
526 else if (tmpLadder <= 14) ladder = 36 - tmpLadder;
527 }
else if (layer == 3) {
528 if (tmpLadder <= 11) ladder = 12 - tmpLadder;
529 else if (tmpLadder <= 22) ladder = 56 - tmpLadder;
530 }
else if (layer == 4) {
531 if (tmpLadder <= 16) ladder = 17 - tmpLadder;
532 else if (tmpLadder <= 32) ladder = 81 - tmpLadder;
539 ladder = tmpLadder + 5;
541 ladder = tmpLadder + 8;
543 ladder = tmpLadder + 11;
546 if (tmpLadder <= 5) ladder = 6 - tmpLadder;
547 else if (tmpLadder <= 10) ladder = 26 - tmpLadder;
548 }
else if (layer == 2) {
549 if (tmpLadder <= 8) ladder = 9 - tmpLadder;
550 else if (tmpLadder <= 16) ladder = 41 - tmpLadder;
551 }
else if (layer == 3) {
552 if (tmpLadder <= 11) ladder = 12 - tmpLadder;
553 else if (tmpLadder <= 22) ladder = 56 - tmpLadder;
562 if (shell ==
pO || shell ==
pI)
563 module = tmpModule + 4;
565 module = 5 - tmpModule;
567 return PXBDetId(layer, ladder, module);
577 default: out <<
"unknown";
PixelBarrelName(const DetId &, bool phase=false)
ctor from DetId
int moduleName() const
module id (index in z)
int convertLadderNumber(int oldLadder)
unsigned int pxbLadder(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
unsigned int ladder() const
ladder id
std::ostream & operator<<(std::ostream &out, const ALILine &li)
unsigned int layer() const
layer id
bool isHalfModule() const
full or half module
int sectorName() const
sector id
unsigned int module() const
det id
Abs< T >::type abs(const T &t)
virtual bool operator==(const PixelModuleName &) const
check equality of modules from datamemebers
unsigned int pxbLayer(const DetId &id) const
virtual bool isBarrel() const
true for barrel modules
int ladderName() const
ladder id (index in phi)
virtual std::string name() const
from base class
int layerName() const
layer id
DetId pxbDetId(uint32_t layer, uint32_t ladder, uint32_t module) const
PXBDetId getDetId()
return the DetId
virtual PixelModuleName::ModuleType moduleType() const
module Type