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 }
L1MuGMTExtendedCand::isFwd
bool isFwd() const
get forward bit (true=forward, false=barrel)
Definition: L1MuGMTExtendedCand.h:77
alignBH_cfg.fixed
fixed
Definition: alignBH_cfg.py:54
L1MuGMTExtendedCand::operator!=
bool operator!=(const L1MuGMTExtendedCand &) const
unequal operator
Definition: L1MuGMTExtendedCand.cc:98
MessageLogger.h
L1MuGMTExtendedCand
Definition: L1MuGMTExtendedCand.h:46
amptDefaultParameters_cff.mu
mu
Definition: amptDefaultParameters_cff.py:16
L1MuGMTExtendedCand::print
void print() const
print parameters of muon candidate
Definition: L1MuGMTExtendedCand.cc:109
L1MuGMTCand::print
void print() const
print parameters of muon candidate
Definition: L1MuGMTCand.cc:144
L1MuGMTCand
Definition: L1MuGMTCand.h:39
L1MuGMTExtendedCand::getDTCSCIndex
unsigned getDTCSCIndex() const
get index of contributing DT/CSC muon
Definition: L1MuGMTExtendedCand.h:71
L1MuGMTExtendedCand::getRPCIndex
unsigned getRPCIndex() const
get index of contributing RPC muon
Definition: L1MuGMTExtendedCand.h:74
simKBmtfDigis_cfi.bx
bx
Definition: simKBmtfDigis_cfi.py:55
L1MuGMTCand::reset
void reset()
reset muon candidate
Definition: L1MuGMTCand.cc:81
alignCSCRings.s
s
Definition: alignCSCRings.py:92
L1MuGMTCand::quality
unsigned int quality() const
get quality
Definition: L1MuGMTCand.h:90
L1MuGMTExtendedCand::m_rank
unsigned int m_rank
Definition: L1MuGMTExtendedCand.h:133
L1MuGMTExtendedCand::operator==
bool operator==(const L1MuGMTExtendedCand &) const
equal operator
Definition: L1MuGMTExtendedCand.cc:87
L1MuGMTExtendedCand::rank
unsigned int rank() const
get rank
Definition: L1MuGMTExtendedCand.h:68
cand
Definition: decayParser.h:34
edm::LogVerbatim
Definition: MessageLogger.h:297
L1MuGMTExtendedCand::L1MuGMTExtendedCand
L1MuGMTExtendedCand()
constructor
Definition: L1MuGMTExtendedCand.cc:47
operator<<
ostream & operator<<(ostream &s, const L1MuGMTExtendedCand &id)
Definition: L1MuGMTExtendedCand.cc:124
L1MuGMTExtendedCand::~L1MuGMTExtendedCand
~L1MuGMTExtendedCand() override
destructor
Definition: L1MuGMTExtendedCand.cc:56
L1MuGMTCand::empty
bool empty() const
is it an empty muon candidate?
Definition: L1MuGMTCand.h:61
std
Definition: JetResolutionObject.h:76
relativeConstraints.empty
bool empty
Definition: relativeConstraints.py:46
L1MuGMTExtendedCand::reset
void reset()
reset muon candidate
Definition: L1MuGMTExtendedCand.cc:65
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1MuGMTExtendedCand::detector
unsigned int detector() const
Definition: L1MuGMTExtendedCand.cc:77
L1MuGMTExtendedCand::isRPC
bool isRPC() const
get RPC bit (true=RPC, false = DT/CSC or matched)
Definition: L1MuGMTExtendedCand.h:80
L1MuGMTExtendedCand.h