Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:31:36

0001 #include "TrackingTools/TrackAssociator/interface/TAMuonChamberMatch.h"
0002 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0003 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0004 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
0005 #include "DataFormats/MuonDetId/interface/GEMDetId.h"
0006 #include "DataFormats/MuonDetId/interface/ME0DetId.h"
0007 #include <sstream>
0008 
0009 int TAMuonChamberMatch::station() const {
0010   int muonSubdetId = id.subdetId();
0011 
0012   if (muonSubdetId == 1) {  //DT
0013     DTChamberId segId(id.rawId());
0014     return segId.station();
0015   }
0016   if (muonSubdetId == 2) {  //CSC
0017     CSCDetId segId(id.rawId());
0018     return segId.station();
0019   }
0020   if (muonSubdetId == 3) {  //RPC
0021     RPCDetId segId(id.rawId());
0022     return segId.station();
0023   }
0024   if (muonSubdetId == 4) {  //GEM
0025     GEMDetId segId(id.rawId());
0026     return segId.station();
0027   }
0028   if (muonSubdetId == 5) {  //ME0
0029     ME0DetId segId(id.rawId());
0030     return segId.station();
0031   }
0032 
0033   return -1;
0034 }
0035 
0036 std::string TAMuonChamberMatch::info() const {
0037   int muonSubdetId = id.subdetId();
0038   std::ostringstream oss;
0039 
0040   if (muonSubdetId == 1) {  //DT
0041     DTChamberId segId(id.rawId());
0042     oss << "DT chamber (wheel, station, sector): " << segId.wheel() << ", " << segId.station() << ", "
0043         << segId.sector();
0044   }
0045 
0046   if (muonSubdetId == 2) {  //CSC
0047     CSCDetId segId(id.rawId());
0048     oss << "CSC chamber (endcap, station, ring, chamber, layer): " << segId.endcap() << ", " << segId.station() << ", "
0049         << segId.ring() << ", " << segId.chamber() << ", " << segId.layer();
0050   }
0051   if (muonSubdetId == 3) {  //RPC
0052     // RPCDetId segId(id.rawId());
0053     oss << "RPC chamber";
0054   }
0055   if (muonSubdetId == 4) {  //GEM
0056     // GEMDetId segId(id.rawId());
0057     oss << "GEM chamber";
0058   }
0059   if (muonSubdetId == 5) {  //ME0
0060     // ME0DetId segId(id.rawId());
0061     oss << "ME0 chamber";
0062   }
0063 
0064   return oss.str();
0065 }