File indexing completed on 2023-10-25 09:40:06
0001 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0002 #include "FWCore/Utilities/interface/Exception.h"
0003 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
0004 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0005 #include <sstream>
0006
0007 TrackerTopology::TrackerTopology(const PixelBarrelValues &pxb,
0008 const PixelEndcapValues &pxf,
0009 const TECValues &tecv,
0010 const TIBValues &tibv,
0011 const TIDValues &tidv,
0012 const TOBValues &tobv)
0013 : pbVals_(pxb),
0014 pfVals_(pxf),
0015 tobVals_(tobv),
0016 tibVals_(tibv),
0017 tidVals_(tidv),
0018 tecVals_(tecv),
0019 bits_per_field{[PBModule] = {pbVals_.moduleStartBit_, pbVals_.moduleMask_, PixelSubdetector::PixelBarrel},
0020 [PBLadder] = {pbVals_.ladderStartBit_, pbVals_.ladderMask_, PixelSubdetector::PixelBarrel},
0021 [PBLayer] = {pbVals_.layerStartBit_, pbVals_.layerMask_, PixelSubdetector::PixelBarrel},
0022 [PFModule] = {pfVals_.moduleStartBit_, pfVals_.moduleMask_, PixelSubdetector::PixelEndcap},
0023 [PFPanel] = {pfVals_.panelStartBit_, pfVals_.panelMask_, PixelSubdetector::PixelEndcap},
0024 [PFBlade] = {pfVals_.bladeStartBit_, pfVals_.bladeMask_, PixelSubdetector::PixelEndcap},
0025 [PFDisk] = {pfVals_.diskStartBit_, pfVals_.diskMask_, PixelSubdetector::PixelEndcap},
0026 [PFSide] = {pfVals_.sideStartBit_, pfVals_.sideMask_, PixelSubdetector::PixelEndcap}} {}
0027
0028 unsigned int TrackerTopology::side(const DetId &id) const {
0029 uint32_t subdet = id.subdetId();
0030 if (subdet == PixelSubdetector::PixelBarrel)
0031 return 0;
0032 if (subdet == PixelSubdetector::PixelEndcap)
0033 return pxfSide(id);
0034 if (subdet == SiStripSubdetector::TIB)
0035 return 0;
0036 if (subdet == SiStripSubdetector::TID)
0037 return tidSide(id);
0038 if (subdet == SiStripSubdetector::TOB)
0039 return 0;
0040 if (subdet == SiStripSubdetector::TEC)
0041 return tecSide(id);
0042
0043 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::side";
0044 return 0;
0045 }
0046
0047 unsigned int TrackerTopology::layer(const DetId &id) const {
0048 uint32_t subdet = id.subdetId();
0049 if (subdet == PixelSubdetector::PixelBarrel)
0050 return pxbLayer(id);
0051 if (subdet == PixelSubdetector::PixelEndcap)
0052 return pxfDisk(id);
0053 if (subdet == SiStripSubdetector::TIB)
0054 return tibLayer(id);
0055 if (subdet == SiStripSubdetector::TID)
0056 return tidWheel(id);
0057 if (subdet == SiStripSubdetector::TOB)
0058 return tobLayer(id);
0059 if (subdet == SiStripSubdetector::TEC)
0060 return tecWheel(id);
0061
0062 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::layer";
0063 return 0;
0064 }
0065
0066 unsigned int TrackerTopology::module(const DetId &id) const {
0067 uint32_t subdet = id.subdetId();
0068 if (subdet == PixelSubdetector::PixelBarrel)
0069 return pxbModule(id);
0070 if (subdet == PixelSubdetector::PixelEndcap)
0071 return pxfModule(id);
0072 if (subdet == SiStripSubdetector::TIB)
0073 return tibModule(id);
0074 if (subdet == SiStripSubdetector::TID)
0075 return tidModule(id);
0076 if (subdet == SiStripSubdetector::TOB)
0077 return tobModule(id);
0078 if (subdet == SiStripSubdetector::TEC)
0079 return tecModule(id);
0080
0081 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::module";
0082 return 0;
0083 }
0084
0085 uint32_t TrackerTopology::glued(const DetId &id) const {
0086 uint32_t subdet = id.subdetId();
0087 if (subdet == PixelSubdetector::PixelBarrel)
0088 return 0;
0089 if (subdet == PixelSubdetector::PixelEndcap)
0090 return 0;
0091 if (subdet == SiStripSubdetector::TIB)
0092 return tibGlued(id);
0093 if (subdet == SiStripSubdetector::TID)
0094 return tidGlued(id);
0095 if (subdet == SiStripSubdetector::TOB)
0096 return tobGlued(id);
0097 if (subdet == SiStripSubdetector::TEC)
0098 return tecGlued(id);
0099
0100 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::glued";
0101 return 0;
0102 }
0103
0104 uint32_t TrackerTopology::stack(const DetId &id) const {
0105 uint32_t subdet = id.subdetId();
0106 if (subdet == PixelSubdetector::PixelBarrel)
0107 return 0;
0108 if (subdet == PixelSubdetector::PixelEndcap)
0109 return 0;
0110 if (subdet == SiStripSubdetector::TIB)
0111 return tibStack(id);
0112 if (subdet == SiStripSubdetector::TID)
0113 return tidStack(id);
0114 if (subdet == SiStripSubdetector::TOB)
0115 return tobStack(id);
0116 if (subdet == SiStripSubdetector::TEC)
0117 return tecStack(id);
0118
0119 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::stack";
0120 }
0121
0122 uint32_t TrackerTopology::doubleSensor(const DetId &id) const {
0123 uint32_t subdet = id.subdetId();
0124 if (subdet == PixelSubdetector::PixelBarrel)
0125 return pixDouble(id);
0126 if (subdet == PixelSubdetector::PixelEndcap)
0127 return 0;
0128 if (subdet == SiStripSubdetector::TIB)
0129 return 0;
0130 if (subdet == SiStripSubdetector::TID)
0131 return 0;
0132 if (subdet == SiStripSubdetector::TOB)
0133 return 0;
0134 if (subdet == SiStripSubdetector::TEC)
0135 return 0;
0136
0137 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::stack";
0138 }
0139
0140 uint32_t TrackerTopology::first(const DetId &id) const {
0141 uint32_t subdet = id.subdetId();
0142 if (subdet == PixelSubdetector::PixelBarrel)
0143 return pixFirst(id);
0144 if (subdet == PixelSubdetector::PixelEndcap)
0145 return 0;
0146 if (subdet == SiStripSubdetector::TIB)
0147 return 0;
0148 if (subdet == SiStripSubdetector::TID)
0149 return 0;
0150 if (subdet == SiStripSubdetector::TOB)
0151 return 0;
0152 if (subdet == SiStripSubdetector::TEC)
0153 return 0;
0154
0155 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::doubleSens";
0156 }
0157
0158 uint32_t TrackerTopology::second(const DetId &id) const {
0159 uint32_t subdet = id.subdetId();
0160 if (subdet == PixelSubdetector::PixelBarrel)
0161 return pixSecond(id);
0162 if (subdet == PixelSubdetector::PixelEndcap)
0163 return 0;
0164 if (subdet == SiStripSubdetector::TIB)
0165 return 0;
0166 if (subdet == SiStripSubdetector::TID)
0167 return 0;
0168 if (subdet == SiStripSubdetector::TOB)
0169 return 0;
0170 if (subdet == SiStripSubdetector::TEC)
0171 return 0;
0172
0173 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::doubleSensor";
0174 }
0175
0176 uint32_t TrackerTopology::lower(const DetId &id) const {
0177 uint32_t subdet = id.subdetId();
0178 if (subdet == PixelSubdetector::PixelBarrel)
0179 return 0;
0180 if (subdet == PixelSubdetector::PixelEndcap)
0181 return 0;
0182 if (subdet == SiStripSubdetector::TIB)
0183 return tibLower(id);
0184 if (subdet == SiStripSubdetector::TID)
0185 return tidLower(id);
0186 if (subdet == SiStripSubdetector::TOB)
0187 return tobLower(id);
0188 if (subdet == SiStripSubdetector::TEC)
0189 return tecLower(id);
0190
0191 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::lower";
0192 }
0193
0194 uint32_t TrackerTopology::upper(const DetId &id) const {
0195 uint32_t subdet = id.subdetId();
0196 if (subdet == PixelSubdetector::PixelBarrel)
0197 return 0;
0198 if (subdet == PixelSubdetector::PixelEndcap)
0199 return 0;
0200 if (subdet == SiStripSubdetector::TIB)
0201 return tibUpper(id);
0202 if (subdet == SiStripSubdetector::TID)
0203 return tidUpper(id);
0204 if (subdet == SiStripSubdetector::TOB)
0205 return tobUpper(id);
0206 if (subdet == SiStripSubdetector::TEC)
0207 return tecUpper(id);
0208
0209 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::upper";
0210 }
0211
0212 bool TrackerTopology::isStereo(const DetId &id) const {
0213 uint32_t subdet = id.subdetId();
0214 if (subdet == PixelSubdetector::PixelBarrel)
0215 return false;
0216 if (subdet == PixelSubdetector::PixelEndcap)
0217 return false;
0218 if (subdet == SiStripSubdetector::TIB)
0219 return tibStereo(id) != 0;
0220 if (subdet == SiStripSubdetector::TID)
0221 return tidStereo(id) != 0;
0222 if (subdet == SiStripSubdetector::TOB)
0223 return tobStereo(id) != 0;
0224 if (subdet == SiStripSubdetector::TEC)
0225 return tecStereo(id) != 0;
0226
0227 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::isStereo";
0228 return false;
0229 }
0230
0231 bool TrackerTopology::isRPhi(const DetId &id) const {
0232 uint32_t subdet = id.subdetId();
0233 if (subdet == PixelSubdetector::PixelBarrel)
0234 return false;
0235 if (subdet == PixelSubdetector::PixelEndcap)
0236 return false;
0237 if (subdet == SiStripSubdetector::TIB)
0238 return tibRPhi(id) != 0;
0239 if (subdet == SiStripSubdetector::TID)
0240 return tidRPhi(id) != 0;
0241 if (subdet == SiStripSubdetector::TOB)
0242 return tobRPhi(id) != 0;
0243 if (subdet == SiStripSubdetector::TEC)
0244 return tecRPhi(id) != 0;
0245
0246 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::isRPhi";
0247 return false;
0248 }
0249
0250 bool TrackerTopology::isDoubleSens(const DetId &id) const {
0251 uint32_t subdet = id.subdetId();
0252 if (subdet == PixelSubdetector::PixelBarrel)
0253 return pixDouble(id) != 0;
0254 if (subdet == PixelSubdetector::PixelEndcap)
0255 return false;
0256 if (subdet == SiStripSubdetector::TIB)
0257 return false;
0258 if (subdet == SiStripSubdetector::TID)
0259 return false;
0260 if (subdet == SiStripSubdetector::TOB)
0261 return false;
0262 if (subdet == SiStripSubdetector::TEC)
0263 return false;
0264
0265 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::isDoubleSens";
0266 return false;
0267 }
0268
0269 bool TrackerTopology::isLower(const DetId &id) const {
0270 uint32_t subdet = id.subdetId();
0271 if (subdet == PixelSubdetector::PixelBarrel)
0272 return false;
0273 if (subdet == PixelSubdetector::PixelEndcap)
0274 return false;
0275 if (subdet == SiStripSubdetector::TIB)
0276 return tibLower(id) != 0;
0277 if (subdet == SiStripSubdetector::TID)
0278 return tidLower(id) != 0;
0279 if (subdet == SiStripSubdetector::TOB)
0280 return tobLower(id) != 0;
0281 if (subdet == SiStripSubdetector::TEC)
0282 return tecLower(id) != 0;
0283
0284 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::isLower";
0285 return false;
0286 }
0287
0288 bool TrackerTopology::isUpper(const DetId &id) const {
0289 uint32_t subdet = id.subdetId();
0290 if (subdet == PixelSubdetector::PixelBarrel)
0291 return false;
0292 if (subdet == PixelSubdetector::PixelEndcap)
0293 return false;
0294 if (subdet == SiStripSubdetector::TIB)
0295 return tibUpper(id) != 0;
0296 if (subdet == SiStripSubdetector::TID)
0297 return tidUpper(id) != 0;
0298 if (subdet == SiStripSubdetector::TOB)
0299 return tobUpper(id) != 0;
0300 if (subdet == SiStripSubdetector::TEC)
0301 return tecUpper(id) != 0;
0302
0303 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::isUpper";
0304 return false;
0305 }
0306
0307 bool TrackerTopology::isFirst(const DetId &id) const {
0308 uint32_t subdet = id.subdetId();
0309 if (subdet == PixelSubdetector::PixelBarrel)
0310 return pixFirst(id) != 0;
0311 if (subdet == PixelSubdetector::PixelEndcap)
0312 return false;
0313 if (subdet == SiStripSubdetector::TIB)
0314 return false;
0315 if (subdet == SiStripSubdetector::TID)
0316 return false;
0317 if (subdet == SiStripSubdetector::TOB)
0318 return false;
0319 if (subdet == SiStripSubdetector::TEC)
0320 return false;
0321
0322 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::isFirst";
0323 return false;
0324 }
0325
0326 bool TrackerTopology::isSecond(const DetId &id) const {
0327 uint32_t subdet = id.subdetId();
0328 if (subdet == PixelSubdetector::PixelBarrel)
0329 return pixSecond(id) != 0;
0330 if (subdet == PixelSubdetector::PixelEndcap)
0331 return false;
0332 if (subdet == SiStripSubdetector::TIB)
0333 return false;
0334 if (subdet == SiStripSubdetector::TID)
0335 return false;
0336 if (subdet == SiStripSubdetector::TOB)
0337 return false;
0338 if (subdet == SiStripSubdetector::TEC)
0339 return false;
0340
0341 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::isSecond";
0342 return false;
0343 }
0344
0345 DetId TrackerTopology::partnerDetId(const DetId &id) const {
0346 uint32_t subdet = id.subdetId();
0347 if (subdet == PixelSubdetector::PixelBarrel)
0348 return pixPartnerDetId(id);
0349 if (subdet == PixelSubdetector::PixelEndcap)
0350 return 0;
0351 if (subdet == SiStripSubdetector::TIB)
0352 return tibPartnerDetId(id);
0353 if (subdet == SiStripSubdetector::TID)
0354 return tidPartnerDetId(id);
0355 if (subdet == SiStripSubdetector::TOB)
0356 return tobPartnerDetId(id);
0357 if (subdet == SiStripSubdetector::TEC)
0358 return tecPartnerDetId(id);
0359
0360 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::partnerDetId";
0361 return 0;
0362 }
0363
0364 std::string TrackerTopology::print(DetId id) const {
0365 uint32_t subdet = id.subdetId();
0366 std::stringstream strstr;
0367
0368 if (subdet == PixelSubdetector::PixelBarrel) {
0369 unsigned int theLayer = pxbLayer(id);
0370 unsigned int theLadder = pxbLadder(id);
0371 unsigned int theModule = pxbModule(id);
0372 std::string typeUpgrade;
0373 typeUpgrade = (isFirst(id)) ? "first" : typeUpgrade;
0374 typeUpgrade = (isSecond(id)) ? "second" : typeUpgrade;
0375 typeUpgrade = (isFirst(id) || isSecond(id)) ? typeUpgrade + " double" : "module";
0376 strstr << "PixelBarrel"
0377 << " Layer " << theLayer << " Ladder " << theLadder;
0378 strstr << " Module for phase0 " << theModule;
0379 strstr << " Module for phase2 " << theModule << " " << typeUpgrade;
0380 strstr << " (" << id.rawId() << ")";
0381 return strstr.str();
0382 }
0383
0384 if (subdet == PixelSubdetector::PixelEndcap) {
0385 unsigned int theSide = pxfSide(id);
0386 unsigned int theDisk = pxfDisk(id);
0387 unsigned int theBlade = pxfBlade(id);
0388 unsigned int thePanel = pxfPanel(id);
0389 unsigned int theModule = pxfModule(id);
0390 std::string side = (pxfSide(id) == 1) ? "-" : "+";
0391 strstr << "PixelEndcap"
0392 << " Side " << theSide << side << " Disk " << theDisk << " Blade " << theBlade << " Panel " << thePanel
0393 << " Module " << theModule;
0394 strstr << " (" << id.rawId() << ")";
0395 return strstr.str();
0396 }
0397
0398 if (subdet == SiStripSubdetector::TIB) {
0399 unsigned int theLayer = tibLayer(id);
0400 std::vector<unsigned int> theString = tibStringInfo(id);
0401 unsigned int theModule = tibModule(id);
0402 std::string side;
0403 std::string part;
0404 side = (theString[0] == 1) ? "-" : "+";
0405 part = (theString[1] == 1) ? "int" : "ext";
0406 std::string type;
0407 type = (isStereo(id)) ? "stereo" : type;
0408 type = (isRPhi(id)) ? "r-phi" : type;
0409 type = (isStereo(id) || isRPhi(id)) ? type + " glued" : "module";
0410 std::string typeUpgrade;
0411 typeUpgrade = (isLower(id)) ? "lower" : typeUpgrade;
0412 typeUpgrade = (isUpper(id)) ? "upper" : typeUpgrade;
0413 typeUpgrade = (isUpper(id) || isLower(id)) ? typeUpgrade + " stack" : "module";
0414 strstr << "TIB" << side << " Layer " << theLayer << " " << part << " String " << theString[2];
0415 strstr << " Module for phase0 " << theModule << " " << type;
0416 strstr << " Module for phase2 " << theModule << " " << typeUpgrade;
0417 strstr << " (" << id.rawId() << ")";
0418 return strstr.str();
0419 }
0420
0421 if (subdet == SiStripSubdetector::TID) {
0422 unsigned int theSide = tidSide(id);
0423 unsigned int theWheel = tidWheel(id);
0424 unsigned int theRing = tidRing(id);
0425 std::vector<unsigned int> theModule = tidModuleInfo(id);
0426 std::string side;
0427 std::string part;
0428 side = (tidSide(id) == 1) ? "-" : "+";
0429 part = (theModule[0] == 1) ? "back" : "front";
0430 std::string type;
0431 type = (isStereo(id)) ? "stereo" : type;
0432 type = (isRPhi(id)) ? "r-phi" : type;
0433 type = (isStereo(id) || isRPhi(id)) ? type + " glued" : "module";
0434 std::string typeUpgrade;
0435 typeUpgrade = (isLower(id)) ? "lower" : typeUpgrade;
0436 typeUpgrade = (isUpper(id)) ? "upper" : typeUpgrade;
0437 typeUpgrade = (isUpper(id) || isLower(id)) ? typeUpgrade + " stack" : "module";
0438 strstr << "TID"
0439 << " Side " << theSide << side << " Wheel " << theWheel << " Ring " << theRing << " " << part;
0440 strstr << " Module for phase0 " << theModule[1] << " " << type;
0441 strstr << " Module for phase2 " << theModule[1] << " " << typeUpgrade;
0442 strstr << " (" << id.rawId() << ")";
0443 return strstr.str();
0444 }
0445
0446 if (subdet == SiStripSubdetector::TOB) {
0447 unsigned int theLayer = tobLayer(id);
0448 std::vector<unsigned int> theRod = tobRodInfo(id);
0449 unsigned int theModule = tobModule(id);
0450 std::string side;
0451 std::string part;
0452 side = (((theRod[0] == 1) ? "-" : ((theRod[0] == 2) ? "+" : (theRod[0] == 3) ? "0" : "")));
0453
0454
0455 std::string type;
0456 type = (isStereo(id)) ? "stereo" : type;
0457 type = (isRPhi(id)) ? "r-phi" : type;
0458 type = (isStereo(id) || isRPhi(id)) ? type + " glued" : "module";
0459 std::string typeUpgrade;
0460 typeUpgrade = (isLower(id)) ? "lower" : typeUpgrade;
0461 typeUpgrade = (isUpper(id)) ? "upper" : typeUpgrade;
0462 typeUpgrade = (isUpper(id) || isLower(id)) ? typeUpgrade + " stack" : "module";
0463 strstr << "TOB" << side << " Layer " << theLayer << " Rod " << theRod[1];
0464 strstr << " Module for phase0 " << theModule << " " << type;
0465 strstr << " Module for phase2 " << theModule << " " << typeUpgrade;
0466 strstr << " (" << id.rawId() << ")";
0467 return strstr.str();
0468 }
0469
0470 if (subdet == SiStripSubdetector::TEC) {
0471 unsigned int theSide = tecSide(id);
0472 unsigned int theWheel = tecWheel(id);
0473 unsigned int theModule = tecModule(id);
0474 std::vector<unsigned int> thePetal = tecPetalInfo(id);
0475 unsigned int theRing = tecRing(id);
0476 std::string side;
0477 std::string petal;
0478 side = (tecSide(id) == 1) ? "-" : "+";
0479 petal = (thePetal[0] == 1) ? "back" : "front";
0480 std::string type;
0481 type = (isStereo(id)) ? "stereo" : type;
0482 type = (isRPhi(id)) ? "r-phi" : type;
0483 type = (isStereo(id) || isRPhi(id)) ? type + " glued" : "module";
0484 std::string typeUpgrade;
0485 typeUpgrade = (isLower(id)) ? "lower" : typeUpgrade;
0486 typeUpgrade = (isUpper(id)) ? "upper" : typeUpgrade;
0487 typeUpgrade = (isUpper(id) || isLower(id)) ? typeUpgrade + " stack" : "module";
0488 strstr << "TEC"
0489 << " Side " << theSide << side << " Wheel " << theWheel << " Petal " << thePetal[1] << " " << petal
0490 << " Ring " << theRing;
0491 strstr << " Module for phase0 " << theModule << " " << type;
0492 strstr << " Module for phase2 " << theModule << " " << typeUpgrade;
0493 strstr << " (" << id.rawId() << ")";
0494
0495 return strstr.str();
0496 }
0497
0498 throw cms::Exception("Invalid DetId") << "Unsupported DetId in TrackerTopology::module";
0499 return strstr.str();
0500 }
0501
0502 SiStripModuleGeometry TrackerTopology::moduleGeometry(const DetId &id) const {
0503 switch (id.subdetId()) {
0504 case SiStripSubdetector::TIB:
0505 return tibLayer(id) < 3 ? SiStripModuleGeometry::IB1 : SiStripModuleGeometry::IB2;
0506 case SiStripSubdetector::TOB:
0507 return tobLayer(id) < 5 ? SiStripModuleGeometry::OB2 : SiStripModuleGeometry::OB1;
0508 case SiStripSubdetector::TID:
0509 switch (tidRing(id)) {
0510 case 1:
0511 return SiStripModuleGeometry::W1A;
0512 case 2:
0513 return SiStripModuleGeometry::W2A;
0514 case 3:
0515 return SiStripModuleGeometry::W3A;
0516 }
0517 return SiStripModuleGeometry::UNKNOWNGEOMETRY;
0518 case SiStripSubdetector::TEC:
0519 switch (tecRing(id)) {
0520 case 1:
0521 return SiStripModuleGeometry::W1B;
0522 case 2:
0523 return SiStripModuleGeometry::W2B;
0524 case 3:
0525 return SiStripModuleGeometry::W3B;
0526 case 4:
0527 return SiStripModuleGeometry::W4;
0528
0529 case 5:
0530 return SiStripModuleGeometry::W5;
0531 case 6:
0532 return SiStripModuleGeometry::W6;
0533 case 7:
0534 return SiStripModuleGeometry::W7;
0535 }
0536 }
0537 return SiStripModuleGeometry::UNKNOWNGEOMETRY;
0538 }
0539 int TrackerTopology::getOTLayerNumber(const DetId &id) const {
0540 int layer = -1;
0541
0542 if (id.det() == DetId::Tracker) {
0543 if (id.subdetId() == SiStripSubdetector::TOB) {
0544 layer = tobLayer(id);
0545 } else if (id.subdetId() == SiStripSubdetector::TID) {
0546 layer = 100 * tidSide(id) + tidWheel(id);
0547 } else {
0548 edm::LogInfo("TrackerTopology") << ">>> Invalid subdetId() ";
0549 }
0550 }
0551 return layer;
0552 }
0553
0554 int TrackerTopology::getITPixelLayerNumber(const DetId &id) const {
0555 int layer = -1;
0556
0557 if (id.det() == DetId::Tracker) {
0558 if (id.subdetId() == PixelSubdetector::PixelBarrel) {
0559 layer = pxbLayer(id);
0560 } else if (id.subdetId() == PixelSubdetector::PixelEndcap) {
0561 layer = 100 * pxfSide(id) + pxfDisk(id);
0562 } else {
0563 edm::LogInfo("TrackerTopology") << ">>> Invalid subdetId() ";
0564 }
0565 }
0566 return layer;
0567 }