CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
L1MuGMTSortRankUnit.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTSortRankUnit
4 //
5 // Description: GMT Sort Rank Unit
6 //
7 //
8 //
9 // Author :
10 // H. Sakulin HEPHY Vienna
11 //
12 // Migrated to CMSSW:
13 // I. Mikulec
14 //
15 //--------------------------------------------------
16 
17 //-----------------------
18 // This Class's Header --
19 //-----------------------
20 
22 
23 //---------------
24 // C++ Headers --
25 //---------------
26 
27 //-------------------------------
28 // Collaborating Class Headers --
29 //-------------------------------
36 
37 
38 //---------------------------------
39 // class L1MuGMTSortRankUnit
40 //---------------------------------
41 
43 
44  if ( muon == 0 || muon->empty() ) return 0;
45 
46  unsigned lut_idx= muon->type_idx();
47 
48  // obtain inputs as coded in HW
49  unsigned eta = muon->eta_packed();
50  unsigned q = muon->quality_packed();
51  unsigned pt = muon->pt_packed();
52  unsigned phi = muon->phi_packed();
53 
54  // lookup eta-q
56  unsigned rank_etaq = etaq_lut->SpecificLookup_rank_etaq (lut_idx, eta, q);
57 
58  // lookup pt-q
60  unsigned rank_ptq = ptq_lut->SpecificLookup_rank_ptq (lut_idx, q, pt);
61 
62  // lookup etaphi
64  unsigned rank_etaphi = etaphi_lut->SpecificLookup_rank_etaphi (lut_idx, eta, phi);
65 
66  // combine
68  unsigned rank = combine_lut->SpecificLookup_sort_rank (lut_idx, rank_etaq, rank_ptq, rank_etaphi);
69 
70  return rank;
71 }
72 
74 
75  if ( muon == 0 || muon->empty() ) return 0;
76 
77  unsigned lut_idx= muon->type_idx();
78 
79  // obtain inputs as coded in HW
80  unsigned eta = muon->eta_packed();
81  unsigned q = muon->quality_packed();
82 
83  // lookup eta-q
85  return etaq_lut->SpecificLookup_vlq (lut_idx, eta, q);
86 }
87 
89 
90  if ( muon == 0 || muon->empty() ) return 1;
91 
92  unsigned lut_idx= muon->type_idx();
93 
94  // obtain inputs as coded in HW
95  unsigned eta = muon->eta_packed();
96  unsigned phi = muon->phi_packed();
97 
98  // lookup eta-q
100 
101  return etaphi_lut->SpecificLookup_rank_etaphi (lut_idx, eta, phi) == 3;
102 }
unsigned SpecificLookup_rank_ptq(int idx, unsigned q, unsigned pt) const
specific lookup function for rank_ptq
static L1MuGMTLFSortRankEtaPhiLUT * getLFSortRankEtaPhiLUT()
unsigned SpecificLookup_rank_etaphi(int idx, unsigned eta, unsigned phi) const
specific lookup function for rank_etaphi
static bool isDisabled(const L1MuRegionalCand *)
Diable bit.
virtual bool empty() const
return empty flag
unsigned SpecificLookup_rank_etaq(int idx, unsigned eta, unsigned q) const
specific lookup function for rank_etaq
static unsigned getVeryLowQualityLevel(const L1MuRegionalCand *)
Very low quality bits.
static L1MuGMTLFSortRankCombineLUT * getLFSortRankCombineLUT()
static L1MuGMTLFSortRankPtQLUT * getLFSortRankPtQLUT()
unsigned eta_packed() const
return eta packed as in hardware
static unsigned sort_rank(const L1MuRegionalCand *)
Sort Rank Table.
unsigned SpecificLookup_vlq(int idx, unsigned eta, unsigned q) const
specific lookup function for vlq
static L1MuGMTLFSortRankEtaQLUT * getLFSortRankEtaQLUT()
unsigned SpecificLookup_sort_rank(int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const
specific lookup function for sort_rank
unsigned int quality_packed() const
return quality packed as in hardware
unsigned pt_packed() const
return pt packed as in hardware
unsigned type_idx() const
return type: 0 DT, 1 bRPC, 2 CSC, 3 fRPC
unsigned phi_packed() const
return phi packed as in hardware