CMS 3D CMS Logo

L1MuGMTExtendedCand.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTExtendedCand
4 //
5 // Description: L1 Global Muon Trigger Candidate
6 //
7 //
8 //
9 // Author :
10 // H. Sakulin HEPHY Vienna
11 //
12 // Migrated to CMSSW:
13 // I. Mikulec
14 //
15 //--------------------------------------------------
16 
17 //-----------------------
18 // This Class's Header --
19 //-----------------------
20 
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 
27 #include <iostream>
28 #include <iomanip>
29 #include <cmath>
30 
31 //-------------------------------
32 // Collaborating Class Headers --
33 //-------------------------------
34 
36 
37 using namespace std;
38 
39 //---------------------------------
40 // class L1MuGMTExtendedCand
41 //---------------------------------
42 
43 //----------------
44 // Constructors --
45 //----------------
46 
48 
50 
51 L1MuGMTExtendedCand::L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx) : L1MuGMTCand(data, bx), m_rank(rank) {}
52 
53 //--------------
54 // Destructor --
55 //--------------
57 
58 //--------------
59 // Operations --
60 //--------------
61 
62 //
63 // reset Muon Track Candidate
64 //
67  m_rank = 0;
68 }
69 
70 //
71 // return detector index
72 // 1 RPC, 2 DT, 3 DT/RPC, 4 CSC, 5 CSC/RPC
73 //
74 // supported for backward compatibility only
75 //
76 
77 unsigned int L1MuGMTExtendedCand::detector() const {
78  if (quality() == 7) // matched ?
79  return isFwd() ? 5 : 3;
80  else
81  return isRPC() ? 1 : (isFwd() ? 4 : 2);
82 }
83 
84 //
85 // Equal operator
86 //
88  if ((L1MuGMTCand const&)*this != cand)
89  return false;
90  if (m_rank != cand.m_rank)
91  return false;
92  return true;
93 }
94 
95 //
96 // Unequal operator
97 //
99  if ((L1MuGMTCand const&)*this != cand)
100  return true;
101  if (m_rank != cand.m_rank)
102  return true;
103  return false;
104 }
105 
106 //
107 // print parameters of track candidate
108 //
111  if (!empty()) {
112  edm::LogVerbatim("GMT_Candidate_info") << setiosflags(ios::right | ios::adjustfield | ios::showpoint | ios::fixed)
113  << "rank = " << setw(3) << rank() << " "
114  << "idxdtcsc = " << setw(1) << getDTCSCIndex() << " "
115  << "idxrpc = " << setw(1) << getRPCIndex() << " "
116  << "isFwd = " << setw(1) << isFwd() << " "
117  << "isRPC = " << setw(1) << isRPC() << endl;
118  }
119 }
120 
121 //
122 // output stream operator for track candidate
123 //
124 ostream& operator<<(ostream& s, const L1MuGMTExtendedCand& id) {
125  if (!id.empty()) {
126  s << ((L1MuGMTCand const&)id) << setiosflags(ios::showpoint | ios::fixed) << "rank = " << setw(3) << id.rank()
127  << " "
128  << "idxdtcsc = " << setw(1) << id.getDTCSCIndex() << " "
129  << "idxrpc = " << setw(1) << id.getRPCIndex() << " "
130  << "isFwd = " << setw(1) << id.isFwd() << " "
131  << "isRPC = " << setw(1) << id.isRPC();
132  }
133  return s;
134 }
Log< level::Info, true > LogVerbatim
void print() const
print parameters of muon candidate
Definition: L1MuGMTCand.cc:144
bool operator==(const L1MuGMTExtendedCand &) const
equal operator
void reset()
reset muon candidate
Definition: L1MuGMTCand.cc:81
unsigned getRPCIndex() const
get index of contributing RPC muon
ostream & operator<<(ostream &s, const L1MuGMTExtendedCand &id)
unsigned int quality() const
get quality
Definition: L1MuGMTCand.h:90
~L1MuGMTExtendedCand() override
destructor
void print() const
print parameters of muon candidate
void reset()
reset muon candidate
L1MuGMTExtendedCand()
constructor
unsigned int detector() const
bool isRPC() const
get RPC bit (true=RPC, false = DT/CSC or matched)
bool empty() const
is it an empty muon candidate?
Definition: L1MuGMTCand.h:61
unsigned int rank() const
get rank
bool operator!=(const L1MuGMTExtendedCand &) const
unequal operator
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:80
bool isFwd() const
get forward bit (true=forward, false=barrel)
unsigned getDTCSCIndex() const
get index of contributing DT/CSC muon