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 // Base Class Headers --
27 //----------------------
29 
30 //------------------------------------
31 // Collaborating Class Declarations --
32 //------------------------------------
33 
34 // ---------------------
35 // -- Class Interface --
36 // ---------------------
37 
39 public:
40  enum { DT, BRPC, CSC, FRPC };
41 
44  : L1MuGMTLUT("LFMergeRankCombine",
45  "DT BRPC CSC FRPC",
46  "rank_etaq(7) rank_ptq(2) rank_etaphi(1)",
47  "merge_rank(8)",
48  9,
49  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 
75 
76  unsigned LookupFunctionPacked(int idx, unsigned address) const override {
77  std::vector<unsigned> addr = u2vec(address, m_Inputs);
78  return TheLookupFunction(idx, addr[0], addr[1], addr[2]);
79  };
80 
81 private:
83  void InitParameters();
84 
86  unsigned TheLookupFunction(int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const;
87 
89 };
90 #endif
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:272
unsigned SpecificLookup_merge_rank(int idx, unsigned rank_etaq, unsigned rank_ptq, unsigned rank_etaphi) const
specific lookup function for merge_rank
std::vector< unsigned > u2vec(unsigned value, const std::vector< port > &widths) const
generate composite address or value from compact unsigned
Definition: L1MuGMTLUT.h:251
std::vector< unsigned > Lookup(int idx, const std::vector< unsigned > &address) const
additional lookup function (std::vector -> vector)
Definition: L1MuGMTLUT.h:121
std::vector< port > m_Inputs
Definition: L1MuGMTLUT.h:214
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.
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
~L1MuGMTLFMergeRankCombineLUT() override
destructor
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
unsigned LookupFunctionPacked(int idx, unsigned address) const override
access to lookup function with packed input and output