21 int oldModule = cmssw_numbering.
module() -4;
if (oldModule<=0) oldModule--;
23 int oldLadder = cmssw_numbering.
ladder();
26 if (oldLadder <= 3) oldLadder = 4-oldLadder;
27 else if (oldLadder >= 4 && oldLadder <= 9 ) oldLadder = 3-oldLadder;
28 else if (oldLadder >= 10) oldLadder = 16-oldLadder;
31 if (oldLadder <= 7) oldLadder = 8-oldLadder;
32 else if (oldLadder >= 8 && oldLadder <= 21) oldLadder = 7-oldLadder;
33 else if (oldLadder >= 22) oldLadder = 36-oldLadder;
36 if (oldLadder <= 11) oldLadder = 12-oldLadder;
37 else if (oldLadder >= 12 && oldLadder <= 33) oldLadder = 11-oldLadder;
38 else if (oldLadder >= 34) oldLadder = 56-oldLadder;
41 if (oldLadder <= 16) oldLadder = 17-oldLadder;
42 else if (oldLadder >= 17 && oldLadder <= 48) oldLadder = 16-oldLadder;
43 else if (oldLadder >= 49) oldLadder = 81-oldLadder;
49 if (oldModule < 0 && oldLadder < 0)
thePart =
mO;
50 else if (oldModule > 0 && oldLadder < 0)
thePart =
pO;
51 else if (oldModule < 0 && oldLadder > 0)
thePart =
mI;
52 else if (oldModule > 0 && oldLadder > 0)
thePart =
pI;
71 theModule(0), theLadder(0) {
76 if ( (name.substr(0, 5) !=
"BPix_") ||
77 (name.find(
"_B") == string::npos) ||
78 (name.find(
"_LYR") == string::npos) ||
79 (name.find(
"_LDR") == string::npos) ||
80 (name.find(
"_MOD") == string::npos) ) {
82 <<
"Bad name string in PixelBarrelNameUpgrade::PixelBarrelName(std::string): "
88 if (name.find(
"_ROC") != string::npos)
89 name = name.substr(0, name.find(
"_ROC"));
92 string shellString = name.substr(name.find(
"_B")+2, name.find(
"_SEC")-name.find(
"_B")-2);
94 else if (shellString ==
"mI")
thePart =
mI;
95 else if (shellString ==
"pO")
thePart =
pO;
96 else if (shellString ==
"pI")
thePart =
pI;
99 <<
"Unable to determine shell in PixelBarrelNameUpgrade::PixelBarrelName(std::string): "
104 string layerString = name.substr(name.find(
"_LYR")+4, name.find(
"_LDR")-name.find(
"_LYR")-4);
105 if (layerString ==
"1")
theLayer = 1;
106 else if (layerString ==
"2")
theLayer = 2;
107 else if (layerString ==
"3")
theLayer = 3;
108 else if (layerString ==
"4")
theLayer = 4;
111 <<
"Unable to determine layer in PixelBarrelNameUpgrade::PixelBarrelName(std::string): "
116 string ladderString = name.substr(name.find(
"_LDR")+4, name.find(
"_MOD")-name.find(
"_LDR")-4);
117 if (ladderString.substr(ladderString.size()-1, 1) ==
"F") {
118 int ladderNum = atoi(ladderString.substr(0, ladderString.size() -1).c_str());
120 else if (
theLayer == 2 && ladderNum >= 1 && ladderNum <= 14)
theLadder = ladderNum;
121 else if (
theLayer == 3 && ladderNum >= 1 && ladderNum <= 22)
theLadder = ladderNum;
122 else if (
theLayer == 4 && ladderNum >= 1 && ladderNum <= 32)
theLadder = ladderNum;
125 <<
"Unable to determine ladder in PixelBarrelNameUpgrade::PixelBarrelName(std::string): "
131 <<
"Unable to determine ladder in PixelBarrelNameUpgrade::PixelBarrelName(std::string): "
136 string moduleString = name.substr(name.find(
"_MOD")+4, name.size()-name.find(
"_MOD")-4);
138 else if (moduleString ==
"2")
theModule = 2;
139 else if (moduleString ==
"3")
theModule = 3;
140 else if (moduleString ==
"4")
theModule = 4;
143 <<
"Unable to determine module in PixelBarrelNameUpgrade::PixelBarrelName(std::string): "
155 case 1 : {sector = 1;
break;}
156 case 2 : {sector = 2;
break;}
157 case 3 : {sector = 3;
break;}
158 case 4 : {sector = 6;
break;}
159 case 5 : {sector = 7;
break;}
160 case 6 : {sector = 8;
break;}
165 case 1 :
case 2: {sector = 1;
break;}
166 case 3 :
case 4: {sector = 2;
break;}
167 case 5 :
case 6: {sector = 3;
break;}
168 case 7 : {sector = 4;
break;}
169 case 8 : {sector = 5;
break;}
170 case 9 :
case 10: {sector = 6;
break;}
171 case 11 :
case 12: {sector = 7;
break;}
172 case 13 :
case 14: {sector = 8;
break;}
177 case 1 :
case 2:
case 3: {sector = 1;
break;}
178 case 4 :
case 5:
case 6: {sector = 2;
break;}
179 case 7 :
case 8:
case 9: {sector = 3;
break;}
180 case 10 :
case 11: {sector = 4;
break;}
181 case 12 :
case 13: {sector = 5;
break;}
182 case 14 :
case 15:
case 16: {sector = 6;
break;}
183 case 17 :
case 18:
case 19: {sector = 7;
break;}
184 case 20 :
case 21:
case 22: {sector = 8;
break;}
190 case 1 :
case 2:
case 3:
case 4: {sector = 1;
break;}
191 case 5 :
case 6:
case 7:
case 8: {sector = 2;
break;}
192 case 9 :
case 10:
case 11:
case 12: {sector = 3;
break;}
193 case 13 :
case 14:
case 15:
case 16: {sector = 4;
break;}
194 case 17 :
case 18:
case 19:
case 20: {sector = 5;
break;}
195 case 21 :
case 22:
case 23:
case 24: {sector = 6;
break;}
196 case 25 :
case 26:
case 27:
case 28: {sector = 7;
break;}
197 case 29 :
case 30:
case 31:
case 32: {sector = 8;
break;}
211 bool halfModule =
false;
242 std::ostringstream stm;
277 outer = (shell ==
mO) || (shell ==
pO);
280 ladder = tmpLadder + 3;
282 ladder = tmpLadder + 7;
284 ladder = tmpLadder + 11;
286 ladder = tmpLadder + 16;
290 if (tmpLadder <= 3) ladder = 4 - tmpLadder;
291 else if (tmpLadder <= 6) ladder = 16 - tmpLadder;
293 else if (layer == 2) {
294 if (tmpLadder <= 7) ladder = 8 - tmpLadder;
295 else if (tmpLadder <= 14) ladder = 36 - tmpLadder;
297 else if (layer == 3) {
298 if (tmpLadder <= 11) ladder = 12 - tmpLadder;
299 else if (tmpLadder <= 22) ladder = 56 - tmpLadder;
301 else if (layer == 4) {
302 if (tmpLadder <= 16) ladder = 17 - tmpLadder;
303 else if (tmpLadder <= 32) ladder = 81 - tmpLadder;
309 if (shell ==
pO || shell ==
pI)
310 module = tmpModule + 4;
312 module = 5 - tmpModule;
314 return PXBDetId(layer, ladder, module);
327 default: out <<
"unknown";
int sectorName() const
sector id
PixelBarrelNameUpgrade(const DetId &)
ctor from DetId
bool isHalfModule() const
full or half module
virtual std::string name() const
from base class
unsigned int ladder() const
ladder id
std::ostream & operator<<(std::ostream &out, const ALILine &li)
unsigned int layer() const
layer id
PXBDetId getDetId()
return the DetId
unsigned int module() const
det id
Abs< T >::type abs(const T &t)
virtual PixelModuleName::ModuleType moduleType() const
module Type
virtual bool isBarrel() const
true for barrel modules
int ladderName() const
ladder id (index in phi)
virtual bool operator==(const PixelModuleName &) const
check equality of modules from datamemebers
int moduleName() const
module id (index in z)
int layerName() const
layer id