CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/src/Geometry/MuonNumbering/src/MuonSubDetector.cc

Go to the documentation of this file.
00001 #include "Geometry/MuonNumbering/interface/MuonSubDetector.h"
00002 #include <iostream>
00003 
00004 
00005 MuonSubDetector::MuonSubDetector(std::string name) 
00006   : detectorName(name) {
00007   if (name=="MuonDTHits") {
00008     detector=barrel;
00009   } else if (name=="MuonCSCHits") {
00010     detector=endcap;
00011   } else if (name=="MuonRPCHits") {
00012     detector=rpc;
00013   } else if (name=="MuonGEMHits") {
00014     detector=gem;
00015   } else {
00016     std::cout << "MuonSubDetector::MuonSubDetector does not recognize ";
00017     std::cout << name <<std::endl;
00018     detector=nodef;
00019   } 
00020 }
00021 
00022 bool MuonSubDetector::isBarrel(){
00023   return (detector==barrel);
00024 }
00025 
00026 bool MuonSubDetector::isEndcap(){
00027   return (detector==endcap);
00028 }
00029 
00030 bool MuonSubDetector::isRpc(){
00031   return (detector==rpc);
00032 }
00033 
00034 bool MuonSubDetector::isGem(){
00035   return (detector==gem);
00036 }
00037 
00038 std::string MuonSubDetector::name(){
00039   return detectorName;
00040 }
00041 
00042 std::string MuonSubDetector::suIdName(){
00043   if (detector==barrel) {
00044     return "MuonHitsBarrel";
00045   } else if (detector==endcap) {
00046     return "MuonHitsEndcap";
00047   } else if (detector==rpc) {
00048     return "MuonHitsRPC";
00049   } else if (detector==gem) {
00050     return "MuonHitsGEM";
00051   } else {
00052     return "";
00053   }
00054 }