CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTExtendedCand.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
13 //
14 // $Date $
15 // $Revision $
16 //
17 // Author :
18 // H. Sakulin HEPHY Vienna
19 //
20 // Migrated to CMSSW:
21 // I. Mikulec
22 //
23 //--------------------------------------------------
24 #ifndef DataFormatsL1GlobalMuonTrigger_L1MuGMTExtendedCand_h
25 #define DataFormatsL1GlobalMuonTrigger_L1MuGMTExtendedCand_h
26 
27 //---------------
28 // C++ Headers --
29 //---------------
30 
31 #include <iosfwd>
32 #include <functional>
33 #include <string>
34 
35 //----------------------
36 // Base Class Headers --
37 //----------------------
38 
40 
41 //------------------------------------
42 // Collaborating Class Declarations --
43 //------------------------------------
44 
45 // ---------------------
46 // -- Class Interface --
47 // ---------------------
48 
50 
51  public:
54 
56  L1MuGMTExtendedCand(unsigned data, unsigned rank, int bx=0);
57 
60 
62  virtual ~L1MuGMTExtendedCand();
63 
65  void reset();
66 
67  //
68  // Getters
69  //
70 
72  unsigned int rank() const { return m_rank; }
73 
75  unsigned getDTCSCIndex() const {
77  }
78 
80  unsigned getRPCIndex() const {
82  }
83 
85  bool isFwd() const { return readDataField( FWDBIT_START, FWDBIT_LENGTH) == 1; }
86 
88  bool isRPC() const { return readDataField( ISRPCBIT_START, ISRPCBIT_LENGTH) == 1; }
89 
91  void setRank(unsigned int rank) { m_rank = rank; }
92 
96  unsigned int detector() const ;
97 
98  //
99  // Setters
100  //
101 
103  void setDTCSCIndex(unsigned int idxdtcsc) {
105  }
106 
108  void setRPCIndex(unsigned int idxrpc) { writeDataField( IDXRPC_START, IDXRPC_LENGTH, idxrpc); }
109 
111  void setFwdBit(unsigned int fwdbit) { writeDataField( FWDBIT_START, FWDBIT_LENGTH, fwdbit); }
112 
114  void setRPCBit(unsigned int rpcbit) { writeDataField( ISRPCBIT_START, ISRPCBIT_LENGTH, rpcbit); }
115 
117  bool operator==(const L1MuGMTExtendedCand&) const;
118 
120  bool operator!=(const L1MuGMTExtendedCand&) const;
121 
123  void print() const;
124 
126  friend std::ostream& operator<<(std::ostream&, const L1MuGMTExtendedCand&);
127 
129  class Rank : std::binary_function< const L1MuGMTExtendedCand*, const L1MuGMTExtendedCand*, bool> {
130  public :
132  unsigned int rank_f = (first) ? first->rank(): 0;
133  unsigned int rank_s = (second) ? second->rank() : 0;
134  return rank_f > rank_s;
135  }
136  };
137 
139  class RankRef : std::binary_function< const L1MuGMTExtendedCand&, const L1MuGMTExtendedCand&, bool> {
140  public :
142  unsigned int rank_f = first.rank();
143  unsigned int rank_s = second.rank();
144  return rank_f > rank_s;
145  }
146  };
147 
148  private:
149  unsigned int m_rank;
150 
151  enum { IDXDTCSC_START=26}; enum { IDXDTCSC_LENGTH = 2}; // Bit 26:27 DT/CSC muon index
152  enum { IDXRPC_START=28}; enum { IDXRPC_LENGTH = 2}; // Bit 28:29 RPC muon index
153  enum { FWDBIT_START=30}; enum { FWDBIT_LENGTH = 1}; // Bit 30 fwd bit
154  enum { ISRPCBIT_START=31}; enum { ISRPCBIT_LENGTH = 1}; // Bit 31 isRPC bit
155 };
156 
157 #endif
void writeDataField(unsigned start, unsigned count, unsigned value)
Definition: L1MuGMTCand.h:240
define a rank for muon candidates
bool operator!=(const L1MuGMTExtendedCand &) const
unequal operator
void setDTCSCIndex(unsigned int idxdtcsc)
set index of contributing DT/CSC muon
unsigned readDataField(unsigned start, unsigned count) const
Definition: L1MuGMTCand.h:235
unsigned int rank() const
get rank
bool operator()(const L1MuGMTExtendedCand *first, const L1MuGMTExtendedCand *second) const
U second(std::pair< T, U > const &p)
bool operator==(const L1MuGMTExtendedCand &) const
equal operator
unsigned int detector() const
int bx() const
get bunch crossing identifier
Definition: L1MuGMTCand.h:122
bool isRPC() const
get RPC bit (true=RPC, false = DT/CSC or matched)
void setFwdBit(unsigned int fwdbit)
set forward bit (1=forward, 0=barrel)
friend std::ostream & operator<<(std::ostream &, const L1MuGMTExtendedCand &)
output stream operator
void reset()
reset muon candidate
unsigned getRPCIndex() const
get index of contributing RPC muon
L1MuGMTExtendedCand()
constructor
bool first
Definition: L1TdeRCT.cc:94
unsigned getDTCSCIndex() const
get index of contributing DT/CSC muon
void setRPCBit(unsigned int rpcbit)
set RPC bit (1=RPC, 0=DT/CSC or matched)
void setRank(unsigned int rank)
set rank
char data[epos_bytes_allocation]
Definition: EPOS_Wrapper.h:82
virtual ~L1MuGMTExtendedCand()
destructor
bool operator()(const L1MuGMTExtendedCand &first, const L1MuGMTExtendedCand &second) const
bool isFwd() const
get forward bit (true=forward, false=barrel)
void setRPCIndex(unsigned int idxrpc)
set index of contributing RPC muon
void print() const
print parameters of muon candidate
define a rank for muon candidates