Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:20:46

0001 #ifndef __l1microgmtmatchquallut_h
0002 #define __l1microgmtmatchquallut_h
0003 
0004 #include "MicroGMTLUT.h"
0005 #include "MicroGMTConfiguration.h"
0006 
0007 #include "FWCore/Framework/interface/Frameworkfwd.h"
0008 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0009 
0010 namespace l1t {
0011   enum cancel_t {
0012     bmtf_bmtf,
0013     omtf_bmtf_pos,
0014     omtf_emtf_pos,
0015     omtf_omtf_pos,
0016     emtf_emtf_pos,
0017     omtf_bmtf_neg,
0018     omtf_emtf_neg,
0019     omtf_omtf_neg,
0020     emtf_emtf_neg
0021   };
0022 
0023   class MicroGMTMatchQualLUT : public MicroGMTLUT {
0024   public:
0025     MicroGMTMatchQualLUT() : MicroGMTLUT(){};
0026     explicit MicroGMTMatchQualLUT(l1t::LUT* lut) : MicroGMTLUT(lut){};
0027     ~MicroGMTMatchQualLUT() override{};
0028 
0029     virtual int lookup(int etaFine, int dEta, int dPhi) const = 0;
0030 
0031     int getDeltaEtaWidth() const { return m_dEtaRedInWidth; }
0032     int getDeltaPhiWidth() const { return m_dPhiRedInWidth; }
0033 
0034   protected:
0035     int m_dEtaRedMask;
0036     int m_dPhiRedMask;
0037     int m_dEtaRedInWidth;
0038     int m_dPhiRedInWidth;
0039 
0040     double m_etaScale;
0041     double m_phiScale;
0042 
0043     double m_maxDR;
0044     double m_fEta;
0045     double m_fPhi;
0046 
0047     cancel_t m_cancelType;
0048   };
0049 
0050   // LUT class for LUTs without eta fine bit, the eta fine bit in the lookup function is ignored
0051   class MicroGMTMatchQualSimpleLUT : public MicroGMTMatchQualLUT {
0052   public:
0053     MicroGMTMatchQualSimpleLUT(){};
0054     explicit MicroGMTMatchQualSimpleLUT(
0055         const std::string&, const double maxDR, const double fEta, const double fPhi, cancel_t cancelType);
0056     explicit MicroGMTMatchQualSimpleLUT(l1t::LUT* lut, cancel_t cancelType);
0057     ~MicroGMTMatchQualSimpleLUT() override{};
0058 
0059     int lookup(int etaFine, int dEta, int dPhi) const override;
0060     int lookupPacked(int in) const override;
0061     int hashInput(int dEta, int dPhi) const;
0062     void unHashInput(int input, int& dEta, int& dPhi) const;
0063   };
0064 
0065   // LUT class for LUTs with eta fine bit
0066   class MicroGMTMatchQualFineLUT : public MicroGMTMatchQualLUT {
0067   public:
0068     MicroGMTMatchQualFineLUT(){};
0069     explicit MicroGMTMatchQualFineLUT(const std::string&,
0070                                       const double maxDR,
0071                                       const double fEta,
0072                                       const double fEtaCoarse,
0073                                       const double fPhi,
0074                                       cancel_t cancelType);
0075     explicit MicroGMTMatchQualFineLUT(l1t::LUT* lut, cancel_t cancelType);
0076     ~MicroGMTMatchQualFineLUT() override{};
0077 
0078     int lookup(int etaFine, int dEta, int dPhi) const override;
0079     int lookupPacked(int in) const override;
0080     int hashInput(int etaFine, int dEta, int dPhi) const;
0081     void unHashInput(int input, int& etaFine, int& dEta, int& dPhi) const;
0082 
0083   private:
0084     int m_etaFineMask;
0085     double m_fEtaCoarse;
0086   };
0087 }  // namespace l1t
0088 #endif /* defined(__l1microgmtmatchquallut_h) */