test
CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 }
49 
51  L1MuGMTCand(mu), m_rank(mu.m_rank){
52 }
53 
54 L1MuGMTExtendedCand::L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx) : L1MuGMTCand (data, bx), m_rank(rank) {
55 
56 }
57 
58 //--------------
59 // Destructor --
60 //--------------
62 
63  reset();
64 
65 }
66 
67 
68 //--------------
69 // Operations --
70 //--------------
71 
72 //
73 // reset Muon Track Candidate
74 //
76 
78  m_rank = 0;
79 
80 }
81 
82 //
83 // return detector index
84 // 1 RPC, 2 DT, 3 DT/RPC, 4 CSC, 5 CSC/RPC
85 //
86 // supported for backward compatibility only
87 //
88 
89 unsigned int L1MuGMTExtendedCand::detector() const {
90 
91  if (quality() == 7) // matched ?
92  return isFwd() ? 5 : 3;
93  else
94  return isRPC() ? 1 : ( isFwd()? 4 : 2);
95 
96 }
97 
98 
99 //
100 // Equal operator
101 //
103 
104  if ( (L1MuGMTCand const&) *this != cand ) return false;
105  if ( m_rank != m_rank ) return false;
106  return true;
107 
108 }
109 
110 
111 //
112 // Unequal operator
113 //
115 
116  if ( (L1MuGMTCand const&) *this != cand ) return true;
117  if ( m_rank != cand.m_rank ) return true;
118  return false;
119 
120 }
121 
122 
123 //
124 // print parameters of track candidate
125 //
127 
129  if ( !empty() ) {
130  edm::LogVerbatim("GMT_Candidate_info")
131  << setiosflags(ios::right | ios::adjustfield | ios::showpoint | ios::fixed)
132  << "rank = " << setw(3) << rank() << " "
133  << "idxdtcsc = " << setw(1) << getDTCSCIndex() << " "
134  << "idxrpc = " << setw(1) << getRPCIndex() << " "
135  << "isFwd = " << setw(1) << isFwd() << " "
136  << "isRPC = " << setw(1) << isRPC() << endl;
137  }
138 
139 }
140 
141 
142 //
143 // output stream operator for track candidate
144 //
145 ostream& operator<<(ostream& s, const L1MuGMTExtendedCand& id) {
146 
147  if ( !id.empty() ) {
148  s << ( (L1MuGMTCand const &) id ) <<
149  setiosflags(ios::showpoint | ios::fixed)
150  << "rank = " << setw(3) << id.rank() << " "
151  << "idxdtcsc = " << setw(1) << id.getDTCSCIndex() << " "
152  << "idxrpc = " << setw(1) << id.getRPCIndex() << " "
153  << "isFwd = " << setw(1) << id.isFwd() << " "
154  << "isRPC = " << setw(1) << id.isRPC() ;
155  }
156  return s;
157 
158 }
159 
160 
161 
162 
163 
164 
165 
166 
167 
168 
void reset()
reset muon candidate
Definition: L1MuGMTCand.cc:87
bool operator!=(const L1MuGMTExtendedCand &) const
unequal operator
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:188
unsigned int rank() const
get rank
bool empty() const
is it an empty muon candidate?
Definition: L1MuGMTCand.h:64
bool operator==(const L1MuGMTExtendedCand &) const
equal operator
unsigned int detector() const
bool isRPC() const
get RPC bit (true=RPC, false = DT/CSC or matched)
void reset()
reset muon candidate
unsigned getRPCIndex() const
get index of contributing RPC muon
L1MuGMTExtendedCand()
constructor
const int mu
Definition: Constants.h:22
unsigned int quality() const
get quality
Definition: L1MuGMTCand.h:93
unsigned getDTCSCIndex() const
get index of contributing DT/CSC muon
virtual ~L1MuGMTExtendedCand()
destructor
bool isFwd() const
get forward bit (true=forward, false=barrel)
void print() const
print parameters of muon candidate
Definition: L1MuGMTCand.cc:165
void print() const
print parameters of muon candidate