CMS 3D CMS Logo

/data/git/CMSSW_5_3_11_patch5/src/DataFormats/SiStripDetId/src/TECDetId.cc

Go to the documentation of this file.
00001 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00002 
00003 #include <iostream>
00004 
00005 TECDetId::TECDetId() : SiStripDetId() {
00006 }
00007 
00008 TECDetId::TECDetId(uint32_t rawid) : SiStripDetId(rawid) {
00009 }
00010 TECDetId::TECDetId(const DetId& id) : SiStripDetId(id.rawId()){
00011 }
00012 
00013 
00014 bool TECDetId::isDoubleSide() const {
00015   // Double Side: only rings 1, 2 and 5
00016   if( this->glued() == 0 && ( this->ring() == 1 || this->ring() == 2 || this->ring() == 5 ) ) {
00017     return true;
00018   } else {
00019     return false;
00020   }
00021 }
00022 
00023 std::ostream& operator<<(std::ostream& os,const TECDetId& id) {
00024   unsigned int              theWheel  = id.wheel();
00025   unsigned int              theModule = id.module();
00026   std::vector<unsigned int> thePetal  = id.petal();
00027   unsigned int              theRing   = id.ring();
00028   std::string side;
00029   std::string petal;
00030   side  = (id.side() == 1 ) ? "-" : "+";
00031   petal = (thePetal[0] == 1 ) ? "back" : "front";
00032   std::string type;
00033   type = (id.stereo() == 0) ? "r-phi" : "stereo";
00034   type = (id.glued() == 0) ? type : type+" glued";
00035   type = (id.isDoubleSide()) ? "double side" : type;
00036   return os << "TEC" << side
00037             << " Wheel " << theWheel
00038             << " Petal " << thePetal[1] << " " << petal
00039             << " Ring " << theRing
00040             << " Module " << theModule << " " << type
00041             << " (" << id.rawId() << ")";
00042 }