CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_2_7_hltpatch2/src/CondFormats/RPCObjects/src/ChamberLocationSpec.cc

Go to the documentation of this file.
00001 #include "CondFormats/RPCObjects/interface/ChamberLocationSpec.h"
00002 #include <sstream>
00003 
00004 std::string ChamberLocationSpec::print( int depth ) const
00005 {
00006   std::ostringstream str;
00007   std::string subsVal[5]={"--","-","0","+","++"}; // -2,-1,0,1,2
00008   std::string febZVal[3]={"-z","+z"};         // 0,1
00009   std::string febZRVal[3]={"N/A","IN","OUT"};     // 0,1,2
00010   std::string boeVal[2]={"Endcap","Barrel"};      // 0,1
00011   if (depth >=0) {
00012     str  << " ChamberLocationSpec: " << std::endl
00013          << " --->DiskOrWheel: " << diskOrWheel
00014          << " Layer: " << layer
00015          << " Sector: " << sector
00016          << " Subsector: " << subsVal[subsector+2]
00017          << " ChamberLocationName: " << chamberLocationName()
00018          << " FebZOrnt: " << febZVal[int(febZOrnt)]
00019          << " FebZRadOrnt: " << febZRVal[int(febZRadOrnt)]
00020          << " BarrelOrEndcap: " << boeVal[int(barrelOrEndcap)];
00021   }
00022   return str.str();
00023 }
00024 
00025 std::string ChamberLocationSpec::chamberLocationName() const {
00026   std::ostringstream ocln;
00027   std::string cln;
00028   if (barrelOrEndcap == 1) {
00029     std::string layerVal[6]={"RB1in","RB1out","RB2in","RB2out","RB3","RB4"};
00030     std::string prefix="W";
00031     if (diskOrWheel > 0) prefix="W+";
00032     std::string subsVal[5]={"--","-","","+","++"};
00033     ocln << prefix<<diskOrWheel<<"/"<<layerVal[layer-1]<<"/"<<sector<<subsVal[subsector+2];
00034   } else {
00035     std::string prefix="RE";
00036     if (diskOrWheel > 0) prefix="RE+";
00037     ocln << prefix<<diskOrWheel<<"/"<<layer<<"/"<<sector;
00038   }
00039   cln=ocln.str();
00040   return cln;
00041 }
00042