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 // $Date: 2007/04/02 15:44:10 $
9 // $Revision: 1.3 $
10 //
11 // Author :
12 // H. Sakulin HEPHY Vienna
13 //
14 // Migrated to CMSSW:
15 // I. Mikulec
16 //
17 //--------------------------------------------------
18 
19 //-----------------------
20 // This Class's Header --
21 //-----------------------
22 
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 
29 #include <iostream>
30 #include <iomanip>
31 #include <cmath>
32 
33 //-------------------------------
34 // Collaborating Class Headers --
35 //-------------------------------
36 
38 
39 using namespace std;
40 
41 //---------------------------------
42 // class L1MuGMTExtendedCand
43 //---------------------------------
44 
45 //----------------
46 // Constructors --
47 //----------------
48 
50 }
51 
53  L1MuGMTCand(mu), m_rank(mu.m_rank){
54 }
55 
56 L1MuGMTExtendedCand::L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx) : L1MuGMTCand (data, bx), m_rank(rank) {
57 
58 }
59 
60 //--------------
61 // Destructor --
62 //--------------
64 
65  reset();
66 
67 }
68 
69 
70 //--------------
71 // Operations --
72 //--------------
73 
74 //
75 // reset Muon Track Candidate
76 //
78 
80  m_rank = 0;
81 
82 }
83 
84 //
85 // return detector index
86 // 1 RPC, 2 DT, 3 DT/RPC, 4 CSC, 5 CSC/RPC
87 //
88 // supported for backward compatibility only
89 //
90 
91 unsigned int L1MuGMTExtendedCand::detector() const {
92 
93  if (quality() == 7) // matched ?
94  return isFwd() ? 5 : 3;
95  else
96  return isRPC() ? 1 : ( isFwd()? 4 : 2);
97 
98 }
99 
100 
101 //
102 // Equal operator
103 //
105 
106  if ( (L1MuGMTCand const&) *this != cand ) return false;
107  if ( m_rank != m_rank ) return false;
108  return true;
109 
110 }
111 
112 
113 //
114 // Unequal operator
115 //
117 
118  if ( (L1MuGMTCand const&) *this != cand ) return true;
119  if ( m_rank != cand.m_rank ) return true;
120  return false;
121 
122 }
123 
124 
125 //
126 // print parameters of track candidate
127 //
129 
131  if ( !empty() ) {
132  edm::LogVerbatim("GMT_Candidate_info")
133  << setiosflags(ios::right | ios::adjustfield | ios::showpoint | ios::fixed)
134  << "rank = " << setw(3) << rank() << " "
135  << "idxdtcsc = " << setw(1) << getDTCSCIndex() << " "
136  << "idxrpc = " << setw(1) << getRPCIndex() << " "
137  << "isFwd = " << setw(1) << isFwd() << " "
138  << "isRPC = " << setw(1) << isRPC() << endl;
139  }
140 
141 }
142 
143 
144 //
145 // output stream operator for track candidate
146 //
147 ostream& operator<<(ostream& s, const L1MuGMTExtendedCand& id) {
148 
149  if ( !id.empty() ) {
150  s << ( (L1MuGMTCand const &) id ) <<
151  setiosflags(ios::showpoint | ios::fixed)
152  << "rank = " << setw(3) << id.rank() << " "
153  << "idxdtcsc = " << setw(1) << id.getDTCSCIndex() << " "
154  << "idxrpc = " << setw(1) << id.getRPCIndex() << " "
155  << "isFwd = " << setw(1) << id.isFwd() << " "
156  << "isRPC = " << setw(1) << id.isRPC() ;
157  }
158  return s;
159 
160 }
161 
162 
163 
164 
165 
166 
167 
168 
169 
170 
void reset()
reset muon candidate
Definition: L1MuGMTCand.cc:89
bool operator!=(const L1MuGMTExtendedCand &) const
unequal operator
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:187
unsigned int rank() const
get rank
bool empty() const
is it an empty muon candidate?
Definition: L1MuGMTCand.h:66
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:23
unsigned int quality() const
get quality
Definition: L1MuGMTCand.h:95
unsigned getDTCSCIndex() const
get index of contributing DT/CSC muon
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual ~L1MuGMTExtendedCand()
destructor
bool isFwd() const
get forward bit (true=forward, false=barrel)
void print() const
print parameters of muon candidate
Definition: L1MuGMTCand.cc:167
void print() const
print parameters of muon candidate