16 const int lL[2][12] = {{5, 15, 26, 8, 24, 41, 11, 33, 56, 0, 0, 0}, {3, 9, 16, 7, 21, 36, 11, 33, 56, 16, 48, 81}};
25 int oldModule =
tt->pxbModule(
id);
26 int oldLadder =
tt->pxbLadder(
id);
29 int module = oldModule - 4;
36 if (module < 0 &&
ladder < 0)
38 else if (module > 0 &&
ladder < 0)
40 else if (module < 0 && ladder > 0)
42 else if (module > 0 &&
ladder > 0)
64 int oldModule = cmssw_numbering.
module() - 4;
67 int oldLadder = cmssw_numbering.
ladder();
73 oldLadder = 4 - oldLadder;
74 else if (oldLadder >= 4 && oldLadder <= 9)
75 oldLadder = 3 - oldLadder;
76 else if (oldLadder >= 10)
77 oldLadder = 16 - oldLadder;
80 oldLadder = 8 - oldLadder;
81 else if (oldLadder >= 8 && oldLadder <= 21)
82 oldLadder = 7 - oldLadder;
83 else if (oldLadder >= 22)
84 oldLadder = 36 - oldLadder;
87 oldLadder = 12 - oldLadder;
88 else if (oldLadder >= 12 && oldLadder <= 33)
89 oldLadder = 11 - oldLadder;
90 else if (oldLadder >= 34)
91 oldLadder = 56 - oldLadder;
94 oldLadder = 17 - oldLadder;
95 else if (oldLadder >= 17 && oldLadder <= 48)
96 oldLadder = 16 - oldLadder;
97 else if (oldLadder >= 49)
98 oldLadder = 81 - oldLadder;
105 oldLadder = 6 - oldLadder;
106 else if (oldLadder >= 6 && oldLadder <= 15)
107 oldLadder = 5 - oldLadder;
108 else if (oldLadder >= 16)
109 oldLadder = 26 - oldLadder;
112 oldLadder = 9 - oldLadder;
113 else if (oldLadder >= 9 && oldLadder <= 24)
114 oldLadder = 8 - oldLadder;
115 else if (oldLadder >= 25)
116 oldLadder = 41 - oldLadder;
119 oldLadder = 12 - oldLadder;
120 else if (oldLadder >= 12 && oldLadder <= 33)
121 oldLadder = 11 - oldLadder;
122 else if (oldLadder >= 34)
123 oldLadder = 56 - oldLadder;
130 if (oldModule < 0 && oldLadder < 0)
132 else if (oldModule > 0 && oldLadder < 0)
134 else if (oldModule < 0 && oldLadder > 0)
136 else if (oldModule > 0 && oldLadder > 0)
158 if (oldLadder <= lL[ind][0])
159 ladder = (lL[ind][0] + 1) - oldLadder;
160 else if (oldLadder >= (lL[ind][0] + 1) && oldLadder <= lL[ind][1])
161 ladder = lL[ind][0] - oldLadder;
162 else if (oldLadder >= (lL[ind][1] + 1))
163 ladder = lL[ind][2] - oldLadder;
166 if (oldLadder <= lL[ind][3])
167 ladder = (lL[ind][3] + 1) - oldLadder;
168 else if (oldLadder >= (lL[ind][3] + 1) && oldLadder <= lL[ind][4])
169 ladder = lL[ind][3] - oldLadder;
170 else if (oldLadder >= (lL[ind][4] + 1))
171 ladder = lL[ind][5] - oldLadder;
174 if (oldLadder <= lL[ind][6])
175 ladder = (lL[ind][6] + 1) - oldLadder;
176 else if (oldLadder >= (lL[ind][6] + 1) && oldLadder <= lL[ind][7])
177 ladder = lL[ind][6] - oldLadder;
178 else if (oldLadder >= (lL[ind][7] + 1))
179 ladder = lL[ind][8] - oldLadder;
182 if (oldLadder <= lL[ind][9])
183 ladder = (lL[ind][9] + 1) - oldLadder;
184 else if (oldLadder >= (lL[ind][9] + 1) && oldLadder <= lL[ind][10])
185 ladder = lL[ind][9] - oldLadder;
186 else if (oldLadder >= (lL[ind][10] + 1))
187 ladder = lL[ind][11] - oldLadder;
199 if ((
name.substr(0, 5) !=
"BPix_") || (
name.find(
"_B") == string::npos) || (
name.find(
"_LYR") == string::npos) ||
200 (
name.find(
"_LDR") == string::npos) || (
name.find(
"_MOD") == string::npos)) {
202 <<
"Bad name string in PixelBarrelName::PixelBarrelName(std::string): " <<
name;
207 if (
name.find(
"_ROC") != string::npos)
211 string shellString =
name.substr(
name.find(
"_B") + 2,
name.find(
"_SEC") -
name.find(
"_B") - 2);
212 if (shellString ==
"mO")
214 else if (shellString ==
"mI")
216 else if (shellString ==
"pO")
218 else if (shellString ==
"pI")
222 <<
"Unable to determine shell in PixelBarrelName::PixelBarrelName(std::string): " <<
name;
226 string layerString =
name.substr(
name.find(
"_LYR") + 4,
name.find(
"_LDR") -
name.find(
"_LYR") - 4);
227 if (layerString ==
"1")
229 else if (layerString ==
"2")
231 else if (layerString ==
"3")
233 else if (
phase1 && layerString ==
"4")
237 <<
"Unable to determine layer in PixelBarrelName::PixelBarrelName(std::string): " <<
name;
241 string ladderString =
name.substr(
name.find(
"_LDR") + 4,
name.find(
"_MOD") -
name.find(
"_LDR") - 4);
245 if (ladderString.substr(ladderString.size() - 1, 1) ==
"F") {
246 int ladderNum = atoi(ladderString.substr(0, ladderString.size() - 1).c_str());
247 if (
theLayer == 1 && ladderNum >= 1 && ladderNum <= 6)
249 else if (
theLayer == 2 && ladderNum >= 1 && ladderNum <= 14)
251 else if (
theLayer == 3 && ladderNum >= 1 && ladderNum <= 22)
253 else if (
theLayer == 4 && ladderNum >= 1 && ladderNum <= 32)
257 <<
"Unable to determine ladder in PixelBarrelNameUpgrade::PixelBarrelName(std::string): " <<
name;
262 <<
"Unable to determine ladder in PixelBarrelNameUpgrade::PixelBarrelName(std::string): " <<
name;
267 if (ladderString ==
"1H")
269 else if (ladderString ==
"10H" &&
theLayer == 1)
271 else if (ladderString ==
"16H" &&
theLayer == 2)
273 else if (ladderString ==
"22H" &&
theLayer == 3)
275 else if (ladderString.substr(ladderString.size() - 1, 1) ==
"F") {
276 int ladderNum = atoi(ladderString.substr(0, ladderString.size() - 1).c_str());
277 if (
theLayer == 1 && ladderNum > 1 && ladderNum < 10)
279 else if (
theLayer == 2 && ladderNum > 1 && ladderNum < 16)
281 else if (
theLayer == 3 && ladderNum > 1 && ladderNum < 22)
285 <<
"Unable to determine ladder in PixelBarrelName::PixelBarrelName(std::string): " <<
name;
290 <<
"Unable to determine ladder in PixelBarrelName::PixelBarrelName(std::string): " <<
name;
295 string moduleString =
name.substr(
name.find(
"_MOD") + 4,
name.size() -
name.find(
"_MOD") - 4);
296 if (moduleString ==
"1")
298 else if (moduleString ==
"2")
300 else if (moduleString ==
"3")
302 else if (moduleString ==
"4")
306 <<
"Unable to determine module in PixelBarrelName::PixelBarrelName(std::string): " <<
name;
703 bool halfModule =
false;
732 std::ostringstream stm;
763 ladder = tmpLadder + lL[ind][0];
765 ladder = tmpLadder + lL[ind][3];
767 ladder = tmpLadder + lL[ind][6];
769 ladder = tmpLadder + lL[ind][9];
773 if (tmpLadder <= lL[ind][0])
774 ladder = (lL[ind][0] + 1) - tmpLadder;
776 ladder = lL[ind][2] - tmpLadder;
777 }
else if (
layer == 2) {
778 if (tmpLadder <= lL[ind][3])
779 ladder = (lL[ind][3] + 1) - tmpLadder;
781 ladder = lL[ind][5] - tmpLadder;
782 }
else if (
layer == 3) {
783 if (tmpLadder <= lL[ind][6])
784 ladder = (lL[ind][6] + 1) - tmpLadder;
786 ladder = lL[ind][8] - tmpLadder;
787 }
else if (
layer == 4) {
788 if (tmpLadder <= lL[ind][9])
789 ladder = (lL[ind][9] + 1) - tmpLadder;
791 ladder = lL[ind][11] - tmpLadder;
798 module = tmpModule + 4;
800 module = 5 - tmpModule;
836 else if (tmpLadder <= 6)
838 }
else if (
layer == 2) {
841 else if (tmpLadder <= 14)
843 }
else if (
layer == 3) {
846 else if (tmpLadder <= 22)
848 }
else if (
layer == 4) {
851 else if (tmpLadder <= 32)
868 else if (tmpLadder <= 10)
870 }
else if (
layer == 2) {
873 else if (tmpLadder <= 16)
875 }
else if (
layer == 3) {
878 else if (tmpLadder <= 22)
888 module = tmpModule + 4;
890 module = 5 - tmpModule;