CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/Geometry/MuonNumbering/src/MuonSimHitNumberingScheme.cc

Go to the documentation of this file.
00001 #include "Geometry/MuonNumbering/interface/MuonSimHitNumberingScheme.h"
00002 #include "Geometry/MuonNumbering/interface/DTNumberingScheme.h"
00003 #include "Geometry/MuonNumbering/interface/CSCNumberingScheme.h"
00004 #include "Geometry/MuonNumbering/interface/RPCNumberingScheme.h"
00005 #include "Geometry/MuonNumbering/interface/MuonBaseNumber.h"
00006 #include "Geometry/MuonNumbering/interface/MuonSubDetector.h"
00007 
00008 //#define LOCAL_DEBUG
00009 
00010 MuonSimHitNumberingScheme::MuonSimHitNumberingScheme(MuonSubDetector* d, const DDCompactView& cpv) {
00011   theDetector=d;
00012   if (theDetector->isBarrel()) {
00013     theNumbering=new DTNumberingScheme(cpv);
00014   } else if (theDetector->isEndcap()) {
00015     theNumbering=new CSCNumberingScheme(cpv);
00016   } else if (theDetector->isRpc()) {
00017     theNumbering=new RPCNumberingScheme(cpv);
00018   } 
00019 }
00020 
00021 MuonSimHitNumberingScheme::~MuonSimHitNumberingScheme() {
00022   delete theNumbering;
00023 }
00024 
00025 int MuonSimHitNumberingScheme::baseNumberToUnitNumber(const MuonBaseNumber num) {
00026   if (theNumbering) {
00027     return theNumbering->baseNumberToUnitNumber(num);
00028   } else {
00029     return 0;
00030   }
00031 }
00032