CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups 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 
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 reset()
reset muon candidate
Definition: L1MuGMTCand.cc:81
bool operator!=(const L1MuGMTExtendedCand &) const
unequal operator
std::ostream & operator<<(std::ostream &out, const ALILine &li)
Definition: ALILine.cc:167
unsigned int rank() const
get rank
bool empty() const
is it an empty muon candidate?
Definition: L1MuGMTCand.h:61
bool operator==(const L1MuGMTExtendedCand &) const
equal operator
~L1MuGMTExtendedCand() override
destructor
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:90
unsigned getDTCSCIndex() const
get index of contributing DT/CSC muon
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
bool isFwd() const
get forward bit (true=forward, false=barrel)
void print() const
print parameters of muon candidate
Definition: L1MuGMTCand.cc:144
void print() const
print parameters of muon candidate