CMS 3D CMS Logo

L1MuGMTLFMergeRankCombineLUT.h
Go to the documentation of this file.
1 //-------------------------------------------------
2 //
10 //
11 // Author :
12 // H. Sakulin HEPHY Vienna
13 //
14 // Migrated to CMSSW:
15 // I. Mikulec
16 //
17 //--------------------------------------------------
18 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTLFMergeRankCombineLUT_h
19 #define L1TriggerGlobalMuonTrigger_L1MuGMTLFMergeRankCombineLUT_h
20 
21 //---------------
22 // C++ Headers --
23 //---------------
24 
25 
26 //----------------------
27 // Base Class Headers --
28 //----------------------
30 
31 //------------------------------------
32 // Collaborating Class Declarations --
33 //------------------------------------
34 
35 // ---------------------
36 // -- Class Interface --
37 // ---------------------
38 
39 
41 
42  public:
43  enum {DT, BRPC, CSC, FRPC};
44 
46  L1MuGMTLFMergeRankCombineLUT() : L1MuGMTLUT("LFMergeRankCombine",
47  "DT BRPC CSC FRPC",
48  "rank_etaq(7) rank_ptq(2) rank_etaphi(1)",
49  "merge_rank(8)", 9, false) {
51  } ;
52 
55 
57  unsigned SpecificLookup_merge_rank (int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const {
58  std::vector<unsigned> addr(3);
59  addr[0] = rank_etaq;
60  addr[1] = rank_ptq;
61  addr[2] = rank_etaphi;
62  return Lookup(idx, addr) [0];
63  };
64 
66  unsigned SpecificLookup (int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const {
67  std::vector<unsigned> addr(3);
68  addr[0] = rank_etaq;
69  addr[1] = rank_ptq;
70  addr[2] = rank_etaphi;
71  return LookupPacked(idx, addr);
72  };
73 
74 
75 
77 
78  virtual unsigned LookupFunctionPacked (int idx, unsigned address) const {
79  std::vector<unsigned> addr = u2vec(address, m_Inputs);
80  return TheLookupFunction(idx ,addr[0] ,addr[1] ,addr[2]);
81 
82  };
83 
84  private:
86  void InitParameters();
87 
89  unsigned TheLookupFunction (int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const;
90 
92 };
93 #endif
94 
95 
96 
97 
98 
99 
100 
101 
102 
103 
104 
105 
106 
107 
108 
109 
110 
111 
112 
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -> vector)
Definition: L1MuGMTLUT.h:115
unsigned TheLookupFunction(int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const
The lookup function - here the functionality of the LUT is implemented.
unsigned SpecificLookup_merge_rank(int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const
specific lookup function for merge_rank
virtual ~L1MuGMTLFMergeRankCombineLUT()
destructor
std::vector< port > m_Inputs
Definition: L1MuGMTLUT.h:201
L1MuGMTLFMergeRankCombineLUT()
constuctor using function-lookup
unsigned SpecificLookup(int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const
specific lookup function for entire output field
std::vector< unsigned > u2vec(unsigned value, const std::vector< port > &widths) const
generate composite address or value from compact unsigned
Definition: L1MuGMTLUT.h:239
virtual unsigned LookupFunctionPacked(int idx, unsigned address) const
access to lookup function with packed input and output
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:260
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...