CMS 3D CMS Logo

L1MuGMTExtendedCand.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
13 //
14 //
15 // Author :
16 // H. Sakulin HEPHY Vienna
17 //
18 // Migrated to CMSSW:
19 // I. Mikulec
20 //
21 //--------------------------------------------------
22 #ifndef DataFormatsL1GlobalMuonTrigger_L1MuGMTExtendedCand_h
23 #define DataFormatsL1GlobalMuonTrigger_L1MuGMTExtendedCand_h
24 
25 //---------------
26 // C++ Headers --
27 //---------------
28 
29 #include <iosfwd>
30 #include <string>
31 
32 //----------------------
33 // Base Class Headers --
34 //----------------------
35 
37 
38 //------------------------------------
39 // Collaborating Class Declarations --
40 //------------------------------------
41 
42 // ---------------------
43 // -- Class Interface --
44 // ---------------------
45 
47 public:
50 
52  L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx = 0);
53 
56 
58  ~L1MuGMTExtendedCand() override;
59 
61  void reset();
62 
63  //
64  // Getters
65  //
66 
68  unsigned int rank() const { return m_rank; }
69 
72 
74  unsigned getRPCIndex() const { return readDataField(IDXRPC_START, IDXRPC_LENGTH); }
75 
77  bool isFwd() const { return readDataField(FWDBIT_START, FWDBIT_LENGTH) == 1; }
78 
80  bool isRPC() const { return readDataField(ISRPCBIT_START, ISRPCBIT_LENGTH) == 1; }
81 
83  void setRank(unsigned int rank) { m_rank = rank; }
84 
88  unsigned int detector() const;
89 
90  //
91  // Setters
92  //
93 
95  void setDTCSCIndex(unsigned int idxdtcsc) { writeDataField(IDXDTCSC_START, IDXDTCSC_LENGTH, idxdtcsc); }
96 
98  void setRPCIndex(unsigned int idxrpc) { writeDataField(IDXRPC_START, IDXRPC_LENGTH, idxrpc); }
99 
101  void setFwdBit(unsigned int fwdbit) { writeDataField(FWDBIT_START, FWDBIT_LENGTH, fwdbit); }
102 
104  void setRPCBit(unsigned int rpcbit) { writeDataField(ISRPCBIT_START, ISRPCBIT_LENGTH, rpcbit); }
105 
107  bool operator==(const L1MuGMTExtendedCand&) const;
108 
110  bool operator!=(const L1MuGMTExtendedCand&) const;
111 
113  void print() const;
114 
116  friend std::ostream& operator<<(std::ostream&, const L1MuGMTExtendedCand&);
117 
120  unsigned int rank_f = (first) ? first->rank() : 0;
121  unsigned int rank_s = (second) ? second->rank() : 0;
122  return rank_f > rank_s;
123  }
124 
127  unsigned int rank_f = first.rank();
128  unsigned int rank_s = second.rank();
129  return rank_f > rank_s;
130  }
131 
132 private:
133  unsigned int m_rank;
134 
135  enum { IDXDTCSC_START = 26 };
136  enum { IDXDTCSC_LENGTH = 2 }; // Bit 26:27 DT/CSC muon index
137  enum { IDXRPC_START = 28 };
138  enum { IDXRPC_LENGTH = 2 }; // Bit 28:29 RPC muon index
139  enum { FWDBIT_START = 30 };
140  enum { FWDBIT_LENGTH = 1 }; // Bit 30 fwd bit
141  enum { ISRPCBIT_START = 31 };
142  enum { ISRPCBIT_LENGTH = 1 }; // Bit 31 isRPC bit
143 };
144 
145 #endif
L1MuGMTExtendedCand::operator<<
friend std::ostream & operator<<(std::ostream &, const L1MuGMTExtendedCand &)
output stream operator
L1MuGMTExtendedCand::isFwd
bool isFwd() const
get forward bit (true=forward, false=barrel)
Definition: L1MuGMTExtendedCand.h:77
L1MuGMTExtendedCand::operator!=
bool operator!=(const L1MuGMTExtendedCand &) const
unequal operator
Definition: L1MuGMTExtendedCand.cc:98
L1MuGMTExtendedCand
Definition: L1MuGMTExtendedCand.h:46
L1MuGMTExtendedCand::setDTCSCIndex
void setDTCSCIndex(unsigned int idxdtcsc)
set index of contributing DT/CSC muon
Definition: L1MuGMTExtendedCand.h:95
L1MuGMTExtendedCand::print
void print() const
print parameters of muon candidate
Definition: L1MuGMTExtendedCand.cc:109
edm::second
U second(std::pair< T, U > const &p)
Definition: ParameterSet.cc:222
L1MuGMTExtendedCand::FWDBIT_LENGTH
Definition: L1MuGMTExtendedCand.h:140
L1MuGMTExtendedCand::IDXDTCSC_START
Definition: L1MuGMTExtendedCand.h:135
L1MuGMTExtendedCand::rankRef
static bool rankRef(const L1MuGMTExtendedCand &first, const L1MuGMTExtendedCand &second)
define a rank for muon candidates
Definition: L1MuGMTExtendedCand.h:126
L1MuGMTExtendedCand::ISRPCBIT_LENGTH
Definition: L1MuGMTExtendedCand.h:142
L1MuGMTExtendedCand::setRPCIndex
void setRPCIndex(unsigned int idxrpc)
set index of contributing RPC muon
Definition: L1MuGMTExtendedCand.h:98
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
L1MuGMTCand::bx
int bx() const
get bunch crossing identifier
Definition: L1MuGMTCand.h:117
L1MuGMTExtendedCand::ISRPCBIT_START
Definition: L1MuGMTExtendedCand.h:141
L1MuGMTExtendedCand::IDXRPC_START
Definition: L1MuGMTExtendedCand.h:137
L1MuGMTCand::readDataField
unsigned readDataField(unsigned start, unsigned count) const
Definition: L1MuGMTCand.h:235
L1MuGMTExtendedCand::compareRank
static bool compareRank(const L1MuGMTExtendedCand *first, const L1MuGMTExtendedCand *second)
define a rank for muon candidates
Definition: L1MuGMTExtendedCand.h:119
L1MuGMTExtendedCand::m_rank
unsigned int m_rank
Definition: L1MuGMTExtendedCand.h:133
first
auto first
Definition: CAHitNtupletGeneratorKernelsImpl.h:112
L1MuGMTExtendedCand::operator==
bool operator==(const L1MuGMTExtendedCand &) const
equal operator
Definition: L1MuGMTExtendedCand.cc:87
L1MuGMTExtendedCand::IDXDTCSC_LENGTH
Definition: L1MuGMTExtendedCand.h:136
L1MuGMTExtendedCand::rank
unsigned int rank() const
get rank
Definition: L1MuGMTExtendedCand.h:68
L1MuGMTExtendedCand::IDXRPC_LENGTH
Definition: L1MuGMTExtendedCand.h:138
L1MuGMTExtendedCand::L1MuGMTExtendedCand
L1MuGMTExtendedCand()
constructor
Definition: L1MuGMTExtendedCand.cc:47
L1MuGMTExtendedCand::setRank
void setRank(unsigned int rank)
set rank
Definition: L1MuGMTExtendedCand.h:83
L1MuGMTExtendedCand::FWDBIT_START
Definition: L1MuGMTExtendedCand.h:139
L1MuGMTExtendedCand::~L1MuGMTExtendedCand
~L1MuGMTExtendedCand() override
destructor
Definition: L1MuGMTExtendedCand.cc:56
L1MuGMTCand.h
L1MuGMTExtendedCand::reset
void reset()
reset muon candidate
Definition: L1MuGMTExtendedCand.cc:65
data
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:79
L1MuGMTExtendedCand::setRPCBit
void setRPCBit(unsigned int rpcbit)
set RPC bit (1=RPC, 0=DT/CSC or matched)
Definition: L1MuGMTExtendedCand.h:104
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
L1MuGMTCand::writeDataField
void writeDataField(unsigned start, unsigned count, unsigned value)
Definition: L1MuGMTCand.h:240
L1MuGMTExtendedCand::setFwdBit
void setFwdBit(unsigned int fwdbit)
set forward bit (1=forward, 0=barrel)
Definition: L1MuGMTExtendedCand.h:101