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
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& operator=(const L1MuGMTExtendedCand&) = default;
0059
0060
0061 ~L1MuGMTExtendedCand() override;
0062
0063
0064 void reset();
0065
0066
0067
0068
0069
0070
0071 unsigned int rank() const { return m_rank; }
0072
0073
0074 unsigned getDTCSCIndex() const { return readDataField(IDXDTCSC_START, IDXDTCSC_LENGTH); }
0075
0076
0077 unsigned getRPCIndex() const { return readDataField(IDXRPC_START, IDXRPC_LENGTH); }
0078
0079
0080 bool isFwd() const { return readDataField(FWDBIT_START, FWDBIT_LENGTH) == 1; }
0081
0082
0083 bool isRPC() const { return readDataField(ISRPCBIT_START, ISRPCBIT_LENGTH) == 1; }
0084
0085
0086 void setRank(unsigned int rank) { m_rank = rank; }
0087
0088
0089
0090
0091 unsigned int detector() const;
0092
0093
0094
0095
0096
0097
0098 void setDTCSCIndex(unsigned int idxdtcsc) { writeDataField(IDXDTCSC_START, IDXDTCSC_LENGTH, idxdtcsc); }
0099
0100
0101 void setRPCIndex(unsigned int idxrpc) { writeDataField(IDXRPC_START, IDXRPC_LENGTH, idxrpc); }
0102
0103
0104 void setFwdBit(unsigned int fwdbit) { writeDataField(FWDBIT_START, FWDBIT_LENGTH, fwdbit); }
0105
0106
0107 void setRPCBit(unsigned int rpcbit) { writeDataField(ISRPCBIT_START, ISRPCBIT_LENGTH, rpcbit); }
0108
0109
0110 bool operator==(const L1MuGMTExtendedCand&) const;
0111
0112
0113 bool operator!=(const L1MuGMTExtendedCand&) const;
0114
0115
0116 void print() const;
0117
0118
0119 friend std::ostream& operator<<(std::ostream&, const L1MuGMTExtendedCand&);
0120
0121
0122 static bool compareRank(const L1MuGMTExtendedCand* first, const L1MuGMTExtendedCand* second) {
0123 unsigned int rank_f = (first) ? first->rank() : 0;
0124 unsigned int rank_s = (second) ? second->rank() : 0;
0125 return rank_f > rank_s;
0126 }
0127
0128
0129 static bool rankRef(const L1MuGMTExtendedCand& first, const L1MuGMTExtendedCand& second) {
0130 unsigned int rank_f = first.rank();
0131 unsigned int rank_s = second.rank();
0132 return rank_f > rank_s;
0133 }
0134
0135 private:
0136 unsigned int m_rank;
0137
0138 enum { IDXDTCSC_START = 26 };
0139 enum { IDXDTCSC_LENGTH = 2 };
0140 enum { IDXRPC_START = 28 };
0141 enum { IDXRPC_LENGTH = 2 };
0142 enum { FWDBIT_START = 30 };
0143 enum { FWDBIT_LENGTH = 1 };
0144 enum { ISRPCBIT_START = 31 };
0145 enum { ISRPCBIT_LENGTH = 1 };
0146 };
0147
0148 #endif