Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:21:11

0001 /*
0002  * MuonStub.cpp
0003  *
0004  *  Created on: Dec 21, 2018
0005  *      Author: kbunkow
0006  */
0007 #include "L1Trigger/L1TMuonOverlapPhase1/interface/MuonStub.h"
0008 
0009 #include "DataFormats/MuonDetId/interface/CSCDetId.h"
0010 #include "DataFormats/MuonDetId/interface/RPCDetId.h"
0011 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
0012 #include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
0013 
0014 #include <iomanip>
0015 
0016 MuonStub::MuonStub() {}
0017 
0018 MuonStub::~MuonStub() {}
0019 
0020 std::ostream &operator<<(std::ostream &out, const MuonStub &stub) {
0021   out << "MuonStub: ";
0022   out << " logicLayer: " << std::setw(2) << stub.logicLayer << " type: " << std::setw(2) << stub.type
0023       << " roll: " << std::setw(1) << 0 << " phiHw: " << std::setw(5)
0024       << stub.phiHw  //<<" ("<<std::setw(8)<<stub.phi<<")"
0025       << " phiBHw: " << std::setw(4) << stub.phiBHw << " etaHw: " << std::setw(4)
0026       << stub.etaHw  //<<" ("<<std::setw(8)<<stub.eta<<")"
0027       << " r: " << std::setw(3) << stub.r << " qualityHw: " << std::setw(2) << stub.qualityHw << " "
0028       << " bx: " << std::setw(1) << stub.bx << " "
0029       << " timing: " << std::setw(2) << stub.timing << " "
0030       << " detId: " << std::setw(9) << stub.detId << " ";
0031 
0032   DetId detId(stub.detId);
0033   if (detId.det() != DetId::Muon) {
0034     //std::cout << "PROBLEM: hit in unknown Det, detID: "<<detId.det()<<std::endl;
0035     return out;
0036   }
0037 
0038   switch (detId.subdetId()) {
0039     case MuonSubdetId::RPC: {
0040       RPCDetId rpcId(stub.detId);
0041       if (rpcId.region() != 0 && abs(rpcId.station()) >= 3 && rpcId.ring() == 1)
0042         out << " iRPC " << rpcId;
0043       else
0044         out << " RPC  " << rpcId;
0045       break;
0046     }
0047     case MuonSubdetId::DT: {
0048       DTChamberId dtId(stub.detId);
0049       out << " DT   " << dtId;
0050       break;
0051     }
0052     case MuonSubdetId::CSC: {
0053       CSCDetId cscId(stub.detId);
0054       out << " CSC  " << cscId;
0055       break;
0056     }
0057   }
0058 
0059   return out;
0060 }