22 int oldModule = cmssw_numbering.
module() -4;
if (oldModule<=0) oldModule--;
24 int oldLadder = cmssw_numbering.
ladder();
26 if (oldLadder <= 5) oldLadder = 6-oldLadder;
27 else if (oldLadder >= 6 && oldLadder <= 15 ) oldLadder = 5-oldLadder;
28 else if (oldLadder >= 16) oldLadder = 26-oldLadder;
31 if (oldLadder <= 8) oldLadder = 9-oldLadder;
32 else if (oldLadder >= 9 && oldLadder <= 24) oldLadder = 8-oldLadder;
33 else if (oldLadder >= 25) oldLadder = 41-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;
44 if (oldModule < 0 && oldLadder < 0)
thePart =
mO;
45 else if (oldModule > 0 && oldLadder < 0)
thePart =
pO;
46 else if (oldModule < 0 && oldLadder > 0)
thePart =
mI;
47 else if (oldModule > 0 && oldLadder > 0)
thePart =
pI;
65 theModule(0), theLadder(0) {
70 if ( (name.substr(0, 5) !=
"BPix_") ||
71 (name.find(
"_B") == string::npos) ||
72 (name.find(
"_LYR") == string::npos) ||
73 (name.find(
"_LDR") == string::npos) ||
74 (name.find(
"_MOD") == string::npos) ) {
76 <<
"Bad name string in PixelBarrelName::PixelBarrelName(std::string): "
82 if (name.find(
"_ROC") != string::npos)
83 name = name.substr(0, name.find(
"_ROC"));
86 string shellString = name.substr(name.find(
"_B")+2, name.find(
"_SEC")-name.find(
"_B")-2);
88 else if (shellString ==
"mI")
thePart =
mI;
89 else if (shellString ==
"pO")
thePart =
pO;
90 else if (shellString ==
"pI")
thePart =
pI;
93 <<
"Unable to determine shell in PixelBarrelName::PixelBarrelName(std::string): "
98 string layerString = name.substr(name.find(
"_LYR")+4, name.find(
"_LDR")-name.find(
"_LYR")-4);
99 if (layerString ==
"1")
theLayer = 1;
100 else if (layerString ==
"2")
theLayer = 2;
101 else if (layerString ==
"3")
theLayer = 3;
104 <<
"Unable to determine layer in PixelBarrelName::PixelBarrelName(std::string): "
109 string ladderString = name.substr(name.find(
"_LDR")+4, name.find(
"_MOD")-name.find(
"_LDR")-4);
114 else if (ladderString.substr(ladderString.size()-1, 1) ==
"F") {
115 int ladderNum = atoi(ladderString.substr(0, ladderString.size() -1).c_str());
117 else if (
theLayer == 2 && ladderNum > 1 && ladderNum < 16)
theLadder = ladderNum;
118 else if (
theLayer == 3 && ladderNum > 1 && ladderNum < 22)
theLadder = ladderNum;
121 <<
"Unable to determine ladder in PixelBarrelName::PixelBarrelName(std::string): "
127 <<
"Unable to determine ladder in PixelBarrelName::PixelBarrelName(std::string): "
132 string moduleString = name.substr(name.find(
"_MOD")+4, name.size()-name.find(
"_MOD")-4);
134 else if (moduleString ==
"2")
theModule = 2;
135 else if (moduleString ==
"3")
theModule = 3;
136 else if (moduleString ==
"4")
theModule = 4;
139 <<
"Unable to determine module in PixelBarrelName::PixelBarrelName(std::string): "
150 case 1 :
case 2: {sector = 1;
break;}
151 case 3 : {sector = 2;
break;}
152 case 4 : {sector = 3;
break;}
153 case 5 : {sector = 4;
break;}
154 case 6 : {sector = 5;
break;}
155 case 7 : {sector = 6;
break;}
156 case 8 : {sector = 7;
break;}
157 case 9 :
case 10:{sector = 8;
break;}
162 case 1 :
case 2: {sector = 1;
break;}
163 case 3 :
case 4: {sector = 2;
break;}
164 case 5 :
case 6: {sector = 3;
break;}
165 case 7 :
case 8: {sector = 4;
break;}
166 case 9 :
case 10: {sector = 5;
break;}
167 case 11 :
case 12: {sector = 6;
break;}
168 case 13 :
case 14: {sector = 7;
break;}
169 case 15 :
case 16: {sector = 8;
break;}
174 case 1 :
case 2:
case 3: {sector = 1;
break;}
175 case 4 :
case 5:
case 6: {sector = 2;
break;}
176 case 7 :
case 8:
case 9: {sector = 3;
break;}
177 case 10 :
case 11: {sector = 4;
break;}
178 case 12 :
case 13: {sector = 5;
break;}
179 case 14 :
case 15:
case 16: {sector = 6;
break;}
180 case 17 :
case 18:
case 19: {sector = 7;
break;}
181 case 20 :
case 21:
case 22: {sector = 8;
break;}
191 bool halfModule =
false;
218 std::ostringstream stm;
241 outer = (shell ==
mO) || (shell ==
pO);
244 ladder = tmpLadder + 5;
246 ladder = tmpLadder + 8;
248 ladder = tmpLadder + 11;
252 if (tmpLadder <= 5) ladder = 6 - tmpLadder;
253 else if (tmpLadder <= 10) ladder = 26 - tmpLadder;
255 else if (layer == 2) {
256 if (tmpLadder <= 8) ladder = 9 - tmpLadder;
257 else if (tmpLadder <= 16) ladder = 41 - tmpLadder;
259 else if (layer == 3) {
260 if (tmpLadder <= 11) ladder = 12 - tmpLadder;
261 else if (tmpLadder <= 22) ladder = 56 - tmpLadder;
267 if (shell ==
pO || shell ==
pI)
268 module = tmpModule + 4;
270 module = 5 - tmpModule;
272 return PXBDetId(layer, ladder, module);
283 default: out <<
"unknown";
int moduleName() const
module id (index in z)
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
virtual bool operator==(const PixelModuleName &) const
check equality of modules from datamemebers
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
PixelBarrelName(const DetId &)
ctor from DetId
PXBDetId getDetId()
return the DetId
virtual PixelModuleName::ModuleType moduleType() const
module Type