File indexing completed on 2024-04-06 12:04:27
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTExtendedCand.h"
0022
0023
0024
0025
0026
0027 #include <iostream>
0028 #include <iomanip>
0029 #include <cmath>
0030
0031
0032
0033
0034
0035 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0036
0037 using namespace std;
0038
0039
0040
0041
0042
0043
0044
0045
0046
0047 L1MuGMTExtendedCand::L1MuGMTExtendedCand() : L1MuGMTCand(), m_rank(0) {}
0048
0049 L1MuGMTExtendedCand::L1MuGMTExtendedCand(const L1MuGMTExtendedCand& mu) : L1MuGMTCand(mu), m_rank(mu.m_rank) {}
0050
0051 L1MuGMTExtendedCand::L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx) : L1MuGMTCand(data, bx), m_rank(rank) {}
0052
0053
0054
0055
0056 L1MuGMTExtendedCand::~L1MuGMTExtendedCand() { reset(); }
0057
0058
0059
0060
0061
0062
0063
0064
0065 void L1MuGMTExtendedCand::reset() {
0066 L1MuGMTCand::reset();
0067 m_rank = 0;
0068 }
0069
0070
0071
0072
0073
0074
0075
0076
0077 unsigned int L1MuGMTExtendedCand::detector() const {
0078 if (quality() == 7)
0079 return isFwd() ? 5 : 3;
0080 else
0081 return isRPC() ? 1 : (isFwd() ? 4 : 2);
0082 }
0083
0084
0085
0086
0087 bool L1MuGMTExtendedCand::operator==(const L1MuGMTExtendedCand& cand) const {
0088 if ((L1MuGMTCand const&)*this != cand)
0089 return false;
0090 if (m_rank != cand.m_rank)
0091 return false;
0092 return true;
0093 }
0094
0095
0096
0097
0098 bool L1MuGMTExtendedCand::operator!=(const L1MuGMTExtendedCand& cand) const {
0099 if ((L1MuGMTCand const&)*this != cand)
0100 return true;
0101 if (m_rank != cand.m_rank)
0102 return true;
0103 return false;
0104 }
0105
0106
0107
0108
0109 void L1MuGMTExtendedCand::print() const {
0110 L1MuGMTCand::print();
0111 if (!empty()) {
0112 edm::LogVerbatim("GMT_Candidate_info") << setiosflags(ios::right | ios::adjustfield | ios::showpoint | ios::fixed)
0113 << "rank = " << setw(3) << rank() << " "
0114 << "idxdtcsc = " << setw(1) << getDTCSCIndex() << " "
0115 << "idxrpc = " << setw(1) << getRPCIndex() << " "
0116 << "isFwd = " << setw(1) << isFwd() << " "
0117 << "isRPC = " << setw(1) << isRPC() << endl;
0118 }
0119 }
0120
0121
0122
0123
0124 ostream& operator<<(ostream& s, const L1MuGMTExtendedCand& id) {
0125 if (!id.empty()) {
0126 s << ((L1MuGMTCand const&)id) << setiosflags(ios::showpoint | ios::fixed) << "rank = " << setw(3) << id.rank()
0127 << " "
0128 << "idxdtcsc = " << setw(1) << id.getDTCSCIndex() << " "
0129 << "idxrpc = " << setw(1) << id.getRPCIndex() << " "
0130 << "isFwd = " << setw(1) << id.isFwd() << " "
0131 << "isRPC = " << setw(1) << id.isRPC();
0132 }
0133 return s;
0134 }