CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
MuonStub.cc
Go to the documentation of this file.
1 /*
2  * MuonStub.cpp
3  *
4  * Created on: Dec 21, 2018
5  * Author: kbunkow
6  */
8 
13 
14 #include <iomanip>
15 
17 
19 
20 std::ostream &operator<<(std::ostream &out, const MuonStub &stub) {
21  out << "MuonStub: ";
22  out << " logicLayer: " << std::setw(2) << stub.logicLayer << " type: " << std::setw(2) << stub.type
23  << " roll: " << std::setw(1) << 0 << " phiHw: " << std::setw(5)
24  << stub.phiHw //<<" ("<<std::setw(8)<<stub.phi<<")"
25  << " phiBHw: " << std::setw(4) << stub.phiBHw << " etaHw: " << std::setw(4)
26  << stub.etaHw //<<" ("<<std::setw(8)<<stub.eta<<")"
27  << " etaSigmaHw: " << std::setw(3) << stub.etaSigmaHw << " qualityHw: " << std::setw(2) << stub.qualityHw << " "
28  << " bx: " << std::setw(1) << stub.bx << " "
29  << " timing: " << std::setw(2) << stub.timing << " "
30  << " detId: " << std::setw(9) << stub.detId << " ";
31 
32  DetId detId(stub.detId);
33  if (detId.det() != DetId::Muon) {
34  //std::cout << "PROBLEM: hit in unknown Det, detID: "<<detId.det()<<std::endl;
35  return out;
36  }
37 
38  switch (detId.subdetId()) {
39  case MuonSubdetId::RPC: {
40  RPCDetId rpcId(stub.detId);
41  if (rpcId.region() != 0 && abs(rpcId.station()) >= 3 && rpcId.ring() == 1)
42  out << " iRPC " << rpcId;
43  else
44  out << " RPC " << rpcId;
45  break;
46  }
47  case MuonSubdetId::DT: {
48  DTChamberId dtId(stub.detId);
49  out << " DT " << dtId;
50  break;
51  }
52  case MuonSubdetId::CSC: {
53  CSCDetId cscId(stub.detId);
54  out << " CSC " << cscId;
55  break;
56  }
57  }
58 
59  return out;
60 }
int timing
Definition: MuonStub.h:49
int detId
Definition: MuonStub.h:56
Type type
Definition: MuonStub.h:37
virtual ~MuonStub()
Definition: MuonStub.cc:18
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
int qualityHw
error of the eta measurement
Definition: MuonStub.h:46
int phiBHw
Definition: MuonStub.h:40
int ring() const
Definition: RPCDetId.h:59
int etaSigmaHw
Definition: MuonStub.h:45
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector&#39;s numbering enum) ...
Definition: DetId.h:48
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
int etaHw
Definition: MuonStub.h:44
Definition: DetId.h:17
static constexpr int RPC
Definition: MuonSubdetId.h:13
int bx
Definition: MuonStub.h:48
MuonStub()
Definition: MuonStub.cc:16
unsigned int logicLayer
Definition: MuonStub.h:52
int phiHw
Definition: MuonStub.h:39
static constexpr int DT
Definition: MuonSubdetId.h:11
static constexpr int CSC
Definition: MuonSubdetId.h:12
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
int region() const
Region id: 0 for Barrel, +/-1 For +/- Endcap.
Definition: RPCDetId.h:53
int station() const
Definition: RPCDetId.h:78