File indexing completed on 2023-03-17 10:50:16
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021
0022 #ifndef DataFormatsL1GlobalMuonTrigger_L1MuGMTExtendedCand_h
0023 #define DataFormatsL1GlobalMuonTrigger_L1MuGMTExtendedCand_h
0024
0025
0026
0027
0028
0029 #include <iosfwd>
0030 #include <string>
0031
0032
0033
0034
0035
0036 #include "DataFormats/L1GlobalMuonTrigger/interface/L1MuGMTCand.h"
0037
0038
0039
0040
0041
0042
0043
0044
0045
0046 class L1MuGMTExtendedCand : public L1MuGMTCand {
0047 public:
0048
0049 L1MuGMTExtendedCand();
0050
0051
0052 L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx = 0);
0053
0054
0055 L1MuGMTExtendedCand(const L1MuGMTExtendedCand&);
0056
0057
0058 ~L1MuGMTExtendedCand() override;
0059
0060
0061 void reset();
0062
0063
0064
0065
0066
0067
0068 unsigned int rank() const { return m_rank; }
0069
0070
0071 unsigned getDTCSCIndex() const { return readDataField(IDXDTCSC_START, IDXDTCSC_LENGTH); }
0072
0073
0074 unsigned getRPCIndex() const { return readDataField(IDXRPC_START, IDXRPC_LENGTH); }
0075
0076
0077 bool isFwd() const { return readDataField(FWDBIT_START, FWDBIT_LENGTH) == 1; }
0078
0079
0080 bool isRPC() const { return readDataField(ISRPCBIT_START, ISRPCBIT_LENGTH) == 1; }
0081
0082
0083 void setRank(unsigned int rank) { m_rank = rank; }
0084
0085
0086
0087
0088 unsigned int detector() const;
0089
0090
0091
0092
0093
0094
0095 void setDTCSCIndex(unsigned int idxdtcsc) { writeDataField(IDXDTCSC_START, IDXDTCSC_LENGTH, idxdtcsc); }
0096
0097
0098 void setRPCIndex(unsigned int idxrpc) { writeDataField(IDXRPC_START, IDXRPC_LENGTH, idxrpc); }
0099
0100
0101 void setFwdBit(unsigned int fwdbit) { writeDataField(FWDBIT_START, FWDBIT_LENGTH, fwdbit); }
0102
0103
0104 void setRPCBit(unsigned int rpcbit) { writeDataField(ISRPCBIT_START, ISRPCBIT_LENGTH, rpcbit); }
0105
0106
0107 bool operator==(const L1MuGMTExtendedCand&) const;
0108
0109
0110 bool operator!=(const L1MuGMTExtendedCand&) const;
0111
0112
0113 void print() const;
0114
0115
0116 friend std::ostream& operator<<(std::ostream&, const L1MuGMTExtendedCand&);
0117
0118
0119 static bool compareRank(const L1MuGMTExtendedCand* first, const L1MuGMTExtendedCand* second) {
0120 unsigned int rank_f = (first) ? first->rank() : 0;
0121 unsigned int rank_s = (second) ? second->rank() : 0;
0122 return rank_f > rank_s;
0123 }
0124
0125
0126 static bool rankRef(const L1MuGMTExtendedCand& first, const L1MuGMTExtendedCand& second) {
0127 unsigned int rank_f = first.rank();
0128 unsigned int rank_s = second.rank();
0129 return rank_f > rank_s;
0130 }
0131
0132 private:
0133 unsigned int m_rank;
0134
0135 enum { IDXDTCSC_START = 26 };
0136 enum { IDXDTCSC_LENGTH = 2 };
0137 enum { IDXRPC_START = 28 };
0138 enum { IDXRPC_LENGTH = 2 };
0139 enum { FWDBIT_START = 30 };
0140 enum { FWDBIT_LENGTH = 1 };
0141 enum { ISRPCBIT_START = 31 };
0142 enum { ISRPCBIT_LENGTH = 1 };
0143 };
0144
0145 #endif