CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/DataFormats/SiStripDetId/src/TOBDetId.cc

Go to the documentation of this file.
00001 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00002 
00003 TOBDetId::TOBDetId() : SiStripDetId() {
00004 }
00005 TOBDetId::TOBDetId(uint32_t rawid) : SiStripDetId(rawid) {
00006 }
00007 TOBDetId::TOBDetId(const DetId& id) : SiStripDetId(id.rawId()) {
00008 }
00009 
00010 bool TOBDetId::isDoubleSide() const {
00011   // Double Side: only layers 1 and 2
00012   if( this->glued() == 0 && ( this->layer() == 1 || this->layer() == 2 ) ) {
00013     return true;
00014   } else {
00015     return false;
00016   }
00017 }
00018 
00019 std::ostream& operator<<(std::ostream& os,const TOBDetId& id) {
00020   unsigned int              theLayer  = id.layer();
00021   std::vector<unsigned int> theRod    = id.rod();
00022   unsigned int              theModule = id.module();
00023   std::string side;
00024   std::string part;
00025   side = (theRod[0] == 1 ) ? "-" : "+";
00026   std::string type;
00027   type = (id.stereo() == 0) ? "r-phi" : "stereo";
00028   type = (id.glued() == 0) ? type : type+" glued";
00029   type = (id.isDoubleSide()) ? "double side" : type;
00030   return os << "TOB" << side
00031             << " Layer " << theLayer
00032             << " Rod " << theRod[1]
00033             << " Module " << theModule << " " << type
00034             << " (" << id.rawId() << ")";
00035 }
00036