CMS 3D CMS Logo

L1MuGMTMIAUPhiPro1LUT.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_L1MuGMTMIAUPhiPro1LUT_h
19 #define L1TriggerGlobalMuonTrigger_L1MuGMTMIAUPhiPro1LUT_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:
41 
44  : L1MuGMTLUT("MIAUPhiPro1",
45  "MIP_DT MIP_BRPC ISO_DT ISO_BRPC MIP_CSC MIP_FRPC ISO_CSC ISO_FRPC",
46  "phi_fine(3) eta(4) pt(5) charge(1)",
47  "cphi_fine(1) cphi_ofs(3)",
48  11,
49  false) {
51  };
52 
54  ~L1MuGMTMIAUPhiPro1LUT() override {}
55 
57  unsigned SpecificLookup_cphi_fine(int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const {
58  std::vector<unsigned> addr(4);
59  addr[0] = phi_fine;
60  addr[1] = eta;
61  addr[2] = pt;
62  addr[3] = charge;
63  return Lookup(idx, addr)[0];
64  };
65 
67  unsigned SpecificLookup_cphi_ofs(int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const {
68  std::vector<unsigned> addr(4);
69  addr[0] = phi_fine;
70  addr[1] = eta;
71  addr[2] = pt;
72  addr[3] = charge;
73  return Lookup(idx, addr)[1];
74  };
75 
77  unsigned SpecificLookup(int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const {
78  std::vector<unsigned> addr(4);
79  addr[0] = phi_fine;
80  addr[1] = eta;
81  addr[2] = pt;
82  addr[3] = charge;
83  return LookupPacked(idx, addr);
84  };
85 
87 
88  unsigned LookupFunctionPacked(int idx, unsigned address) const override {
89  std::vector<unsigned> addr = u2vec(address, m_Inputs);
90  return TheLookupFunction(idx, addr[0], addr[1], addr[2], addr[3]);
91  };
92 
93 private:
95  void InitParameters();
96 
98  unsigned TheLookupFunction(int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const;
99 
101  float m_calo_align; // angle between nominal phi=0 and start of calo region 0
102 };
103 #endif
unsigned LookupFunctionPacked(int idx, unsigned address) const override
access to lookup function with packed input and output
unsigned SpecificLookup(int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const
specific lookup function for entire output field
unsigned LookupPacked(int idx, unsigned) const
Definition: L1MuGMTLUT.h:272
unsigned SpecificLookup_cphi_ofs(int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const
specific lookup function for cphi_ofs
void InitParameters()
Initialize scales, configuration parameters, alignment constants, ...
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
L1MuGMTMIAUPhiPro1LUT()
constuctor using function-lookup
unsigned TheLookupFunction(int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const
The lookup function - here the functionality of the LUT is implemented.
float m_calo_align
Private data members (LUT parameters);.
unsigned SpecificLookup_cphi_fine(int idx, unsigned phi_fine, unsigned eta, unsigned pt, unsigned charge) const
specific lookup function for cphi_fine
~L1MuGMTMIAUPhiPro1LUT() override
destructor