CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_1/src/TrackingTools/TrackAssociator/src/TAMuonChamberMatch.cc

Go to the documentation of this file.
00001 #include "TrackingTools/TrackAssociator/interface/TAMuonChamberMatch.h"
00002 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
00003 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
00004 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
00005 #include <sstream>
00006 
00007 int TAMuonChamberMatch::station() const {
00008         int muonSubdetId = id.subdetId();
00009 
00010         if(muonSubdetId==1) {//DT
00011                 DTChamberId segId(id.rawId());
00012                 return segId.station();
00013         }
00014         if(muonSubdetId==2) {//CSC
00015                 CSCDetId segId(id.rawId());
00016                 return segId.station();
00017         }
00018         if(muonSubdetId==3) {//RPC
00019                 RPCDetId segId(id.rawId());
00020                 return segId.station();
00021         }
00022 
00023         return -1;
00024 }
00025 
00026 std::string TAMuonChamberMatch::info() const {
00027    int muonSubdetId = id.subdetId();
00028    std::ostringstream oss;
00029 
00030    if(muonSubdetId==1) {//DT
00031       DTChamberId segId(id.rawId());
00032       oss << "DT chamber (wheel, station, sector): "
00033         << segId.wheel() << ", "
00034         << segId.station() << ", "
00035         << segId.sector();
00036    }
00037         
00038    if(muonSubdetId==2) {//CSC
00039       CSCDetId segId(id.rawId());
00040       oss << "CSC chamber (endcap, station, ring, chamber, layer): "
00041         << segId.endcap() << ", "
00042         << segId.station() << ", "
00043         << segId.ring() << ", "
00044         << segId.chamber() << ", "
00045         << segId.layer();
00046    }
00047    if(muonSubdetId==3) {//RPC
00048       // RPCDetId segId(id.rawId());
00049       oss << "RPC chamber";
00050    }
00051 
00052    return oss.str();
00053 }