CMS 3D CMS Logo

L1MuGMTLFSortRankPtQLUT.cc
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
3 // Class: L1MuGMTLFSortRankPtQLUT
4 //
5 //
6 //
7 // Author :
8 // H. Sakulin HEPHY Vienna
9 //
10 // Migrated to CMSSW:
11 // I. Mikulec
12 //
13 //--------------------------------------------------
14 
15 //-----------------------
16 // This Class's Header --
17 //-----------------------
19 
20 //---------------
21 // C++ Headers --
22 //---------------
23 
24 //-------------------------------
25 // Collaborating Class Headers --
26 //-------------------------------
27 
28 //-------------------
29 // InitParameters --
30 //-------------------
31 
33 }
34 
35 //--------------------------------------------------------------------------------
36 // Sort Rank LUT, Pt-q part
37 //
38 // This LUT determines the dependency of the sort rank on Pt and Quality.
39 // It gives the main contrubution to the over-all sort rank
40 //
41 // Inputs: Pt(5 bit) and Quality(3 bit)
42 // Outputs: Rank contribution 7-bit
43 //
44 //
45 //--------------------------------------------------------------------------------
46 
47 unsigned L1MuGMTLFSortRankPtQLUT::TheLookupFunction (int idx, unsigned q, unsigned pt) const {
48  // idx is DT, BRPC, CSC, FRPC
49  // INPUTS: q(3) pt(5)
50  // OUTPUTS: rank_ptq(7)
51  int isRPC = idx % 2;
52  // int isFWD = idx / 2;
53 
54  unsigned int quality = q; // DT has: 1..7
55  if ( isRPC ) quality = q*2 + 1; // RPC has: 0,1,2,3
56  if ( idx==2 ) quality = q*3 - 2; // CSC has: 1,2,3
57 
58  if (quality > 7) quality = 7;
59 
60  unsigned int rank_ptq = 3*pt + quality*5;
61 
62  if (rank_ptq > 127) rank_ptq = 127;
63  return rank_ptq;
64 }
65 
66 
67 
68 
69 
70 
71 
72 
73 
74 
75 
76 
77 
78 
79 
80 
81 
82 
83 
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
bool isRPC(GeomDetEnumerators::SubDetector m)
unsigned TheLookupFunction(int idx, unsigned q, unsigned pt) const
The lookup function - here the functionality of the LUT is implemented.