17 int oldModule = cmssw_numbering.
module() - 4;
21 int oldLadder = cmssw_numbering.
ladder();
25 oldLadder = 4 - oldLadder;
26 else if (oldLadder >= 4 && oldLadder <= 9)
27 oldLadder = 3 - oldLadder;
28 else if (oldLadder >= 10)
29 oldLadder = 16 - oldLadder;
32 oldLadder = 8 - oldLadder;
33 else if (oldLadder >= 8 && oldLadder <= 21)
34 oldLadder = 7 - oldLadder;
35 else if (oldLadder >= 22)
36 oldLadder = 36 - oldLadder;
39 oldLadder = 12 - oldLadder;
40 else if (oldLadder >= 12 && oldLadder <= 33)
41 oldLadder = 11 - oldLadder;
42 else if (oldLadder >= 34)
43 oldLadder = 56 - oldLadder;
46 oldLadder = 17 - oldLadder;
47 else if (oldLadder >= 17 && oldLadder <= 48)
48 oldLadder = 16 - oldLadder;
49 else if (oldLadder >= 49)
50 oldLadder = 81 - oldLadder;
56 if (oldModule < 0 && oldLadder < 0)
58 else if (oldModule > 0 && oldLadder < 0)
60 else if (oldModule < 0 && oldLadder > 0)
62 else if (oldModule > 0 && oldLadder > 0)
80 std::cout <<
"NAME=" << name << std::endl;
84 if ((name.substr(0, 5) !=
"BPix_") || (name.find(
"_B") == string::npos) || (name.find(
"_LYR") == string::npos) ||
85 (name.find(
"_LDR") == string::npos) || (name.find(
"_MOD") == string::npos)) {
87 <<
"Bad name string in PixelBarrelNameUpgrade::PixelBarrelName(std::string): " <<
name;
92 if (name.find(
"_ROC") != string::npos)
93 name = name.substr(0, name.find(
"_ROC"));
96 string shellString = name.substr(name.find(
"_B") + 2, name.find(
"_SEC") - name.find(
"_B") - 2);
97 if (shellString ==
"mO")
99 else if (shellString ==
"mI")
101 else if (shellString ==
"pO")
103 else if (shellString ==
"pI")
107 <<
"Unable to determine shell in PixelBarrelNameUpgrade::PixelBarrelName(std::string): " <<
name;
111 string layerString = name.substr(name.find(
"_LYR") + 4, name.find(
"_LDR") - name.find(
"_LYR") - 4);
112 if (layerString ==
"1")
114 else if (layerString ==
"2")
116 else if (layerString ==
"3")
118 else if (layerString ==
"4")
122 <<
"Unable to determine layer in PixelBarrelNameUpgrade::PixelBarrelName(std::string): " <<
name;
126 string ladderString = name.substr(name.find(
"_LDR") + 4, name.find(
"_MOD") - name.find(
"_LDR") - 4);
127 if (ladderString.substr(ladderString.size() - 1, 1) ==
"F") {
128 int ladderNum = atoi(ladderString.substr(0, ladderString.size() - 1).c_str());
129 if (
theLayer == 1 && ladderNum >= 1 && ladderNum <= 6)
131 else if (
theLayer == 2 && ladderNum >= 1 && ladderNum <= 14)
133 else if (
theLayer == 3 && ladderNum >= 1 && ladderNum <= 22)
135 else if (
theLayer == 4 && ladderNum >= 1 && ladderNum <= 32)
139 <<
"Unable to determine ladder in PixelBarrelNameUpgrade::PixelBarrelName(std::string): " <<
name;
144 <<
"Unable to determine ladder in PixelBarrelNameUpgrade::PixelBarrelName(std::string): " <<
name;
148 string moduleString = name.substr(name.find(
"_MOD") + 4, name.size() - name.find(
"_MOD") - 4);
149 if (moduleString ==
"1")
151 else if (moduleString ==
"2")
153 else if (moduleString ==
"3")
155 else if (moduleString ==
"4")
159 <<
"Unable to determine module in PixelBarrelNameUpgrade::PixelBarrelName(std::string): " <<
name;
354 bool halfModule =
false;
376 std::ostringstream stm;
410 outer = (shell ==
mO) || (shell ==
pO);
413 ladder = tmpLadder + 3;
415 ladder = tmpLadder + 7;
417 ladder = tmpLadder + 11;
419 ladder = tmpLadder + 16;
424 ladder = 4 - tmpLadder;
425 else if (tmpLadder <= 6)
426 ladder = 16 - tmpLadder;
428 else if (layer == 2) {
430 ladder = 8 - tmpLadder;
431 else if (tmpLadder <= 14)
432 ladder = 36 - tmpLadder;
434 else if (layer == 3) {
436 ladder = 12 - tmpLadder;
437 else if (tmpLadder <= 22)
438 ladder = 56 - tmpLadder;
440 else if (layer == 4) {
442 ladder = 17 - tmpLadder;
443 else if (tmpLadder <= 32)
444 ladder = 81 - tmpLadder;
450 if (shell ==
pO || shell ==
pI)
451 module = tmpModule + 4;
453 module = 5 - tmpModule;
455 return PXBDetId(layer, ladder, module);
bool operator==(const PixelModuleName &) const override
check equality of modules from datamemebers
int sectorName() const
sector id
PixelBarrelNameUpgrade(const DetId &)
ctor from DetId
std::ostream & operator<<(std::ostream &out, const PixelBarrelNameUpgrade::Shell &t)
bool isHalfModule() const
full or half module
unsigned int ladder() const
ladder id
unsigned int layer() const
layer id
PXBDetId getDetId()
return the DetId
unsigned int module() const
det id
Abs< T >::type abs(const T &t)
std::string name() const override
from base class
virtual bool isBarrel() const
true for barrel modules
int ladderName() const
ladder id (index in phi)
PixelModuleName::ModuleType moduleType() const override
module Type
int moduleName() const
module id (index in z)
int layerName() const
layer id