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}};
23 :
PixelModuleName(
true), thePart(mO), theLayer(0), theModule(0), theLadder(0), phase1(phase) {
29 int module = oldModule - 4;
36 if (module < 0 && ladder < 0)
38 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)
208 name = name.substr(0, name.find(
"_ROC"));
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;
760 outer = (shell ==
mO) || (shell ==
pO);
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;
797 if (shell ==
pO || shell ==
pI)
798 module = tmpModule + 4;
800 module = 5 - tmpModule;
819 outer = (shell ==
mO) || (shell ==
pO);
825 ladder = tmpLadder + 3;
827 ladder = tmpLadder + 7;
829 ladder = tmpLadder + 11;
831 ladder = tmpLadder + 16;
835 ladder = 4 - tmpLadder;
836 else if (tmpLadder <= 6)
837 ladder = 16 - tmpLadder;
838 }
else if (layer == 2) {
840 ladder = 8 - tmpLadder;
841 else if (tmpLadder <= 14)
842 ladder = 36 - tmpLadder;
843 }
else if (layer == 3) {
845 ladder = 12 - tmpLadder;
846 else if (tmpLadder <= 22)
847 ladder = 56 - tmpLadder;
848 }
else if (layer == 4) {
850 ladder = 17 - tmpLadder;
851 else if (tmpLadder <= 32)
852 ladder = 81 - tmpLadder;
859 ladder = tmpLadder + 5;
861 ladder = tmpLadder + 8;
863 ladder = tmpLadder + 11;
867 ladder = 6 - tmpLadder;
868 else if (tmpLadder <= 10)
869 ladder = 26 - tmpLadder;
870 }
else if (layer == 2) {
872 ladder = 9 - tmpLadder;
873 else if (tmpLadder <= 16)
874 ladder = 41 - tmpLadder;
875 }
else if (layer == 3) {
877 ladder = 12 - tmpLadder;
878 else if (tmpLadder <= 22)
879 ladder = 56 - tmpLadder;
887 if (shell ==
pO || shell ==
pI)
888 module = tmpModule + 4;
890 module = 5 - tmpModule;
892 return PXBDetId(layer, ladder, module);
int moduleName() const
module id (index in z)
int convertLadderNumber(int oldLadder)
bool operator==(const PixelModuleName &) const override
check equality of modules from datamemebers
unsigned int pxbLadder(const DetId &id) const
unsigned int pxbModule(const DetId &id) const
unsigned int ladder() const
ladder id
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)
std::string name() const override
from base class
std::ostream & operator<<(std::ostream &out, const PixelBarrelName::Shell &t)
unsigned int pxbLayer(const DetId &id) const
virtual bool isBarrel() const
true for barrel modules
int ladderName() const
ladder id (index in phi)
int layerName() const
layer id
PixelBarrelName(const DetId &, const TrackerTopology *tt, bool phase=false)
ctor from DetId
DetId pxbDetId(uint32_t layer, uint32_t ladder, uint32_t module) const
PXBDetId getDetId()
return the DetId
PixelModuleName::ModuleType moduleType() const override
module Type