Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:22:15

0001 //-------------------------------------------------
0002 //
0003 /** \class L1MuGMTLFSortRankEtaPhiLUT
0004  *
0005  *   LFSortRankEtaPhi look-up table
0006  *          
0007  *   this class was automatically generated by 
0008  *     L1MuGMTLUT::MakeSubClass()  
0009 */
0010 //
0011 //   Author :
0012 //   H. Sakulin            HEPHY Vienna
0013 //
0014 //   Migrated to CMSSW:
0015 //   I. Mikulec
0016 //
0017 //--------------------------------------------------
0018 #ifndef L1TriggerGlobalMuonTrigger_L1MuGMTLFSortRankEtaPhiLUT_h
0019 #define L1TriggerGlobalMuonTrigger_L1MuGMTLFSortRankEtaPhiLUT_h
0020 
0021 //---------------
0022 // C++ Headers --
0023 //---------------
0024 
0025 //----------------------
0026 // Base Class Headers --
0027 //----------------------
0028 #include "L1Trigger/GlobalMuonTrigger/src/L1MuGMTLUT.h"
0029 
0030 //------------------------------------
0031 // Collaborating Class Declarations --
0032 //------------------------------------
0033 
0034 //              ---------------------
0035 //              -- Class Interface --
0036 //              ---------------------
0037 
0038 class L1MuGMTLFSortRankEtaPhiLUT : public L1MuGMTLUT {
0039 public:
0040   enum { DT, BRPC, CSC, FRPC };
0041 
0042   /// constuctor using function-lookup
0043   L1MuGMTLFSortRankEtaPhiLUT()
0044       : L1MuGMTLUT("LFSortRankEtaPhi", "DT BRPC CSC FRPC", "eta(6) phi(8)", "rank_etaphi(2)", 11, false) {
0045     InitParameters();
0046   };
0047 
0048   /// destructor
0049   ~L1MuGMTLFSortRankEtaPhiLUT() override{};
0050 
0051   /// specific lookup function for rank_etaphi
0052   unsigned SpecificLookup_rank_etaphi(int idx, unsigned eta, unsigned phi) const {
0053     std::vector<unsigned> addr(2);
0054     addr[0] = eta;
0055     addr[1] = phi;
0056     return Lookup(idx, addr)[0];
0057   };
0058 
0059   /// specific lookup function for entire output field
0060   unsigned SpecificLookup(int idx, unsigned eta, unsigned phi) const {
0061     std::vector<unsigned> addr(2);
0062     addr[0] = eta;
0063     addr[1] = phi;
0064     return LookupPacked(idx, addr);
0065   };
0066 
0067   /// access to lookup function with packed input and output
0068 
0069   unsigned LookupFunctionPacked(int idx, unsigned address) const override {
0070     std::vector<unsigned> addr = u2vec(address, m_Inputs);
0071     return TheLookupFunction(idx, addr[0], addr[1]);
0072   };
0073 
0074 private:
0075   /// Initialize scales, configuration parameters, alignment constants, ...
0076   void InitParameters();
0077 
0078   /// The lookup function - here the functionality of the LUT is implemented
0079   unsigned TheLookupFunction(int idx, unsigned eta, unsigned phi) const;
0080 
0081   /// Private data members (LUT parameters);
0082 };
0083 #endif