Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:51

0001 #ifndef L1GCTHTMISSLUT_H_
0002 #define L1GCTHTMISSLUT_H_
0003 
0004 #include "L1Trigger/GlobalCaloTrigger/interface/L1GctLut.h"
0005 
0006 #include <vector>
0007 
0008 /*!
0009  * \author Greg Heath
0010  * \date September 2008
0011  */
0012 
0013 /*! \class L1GctHtMissLut
0014  * \brief LUT for conversion of Ht components x and y to magnitude and angle
0015  *
0016  */
0017 
0018 class L1CaloEtScale;
0019 
0020 class L1GctHtMissLut : public L1GctLut<16, 12>
0021 
0022 {
0023 public:
0024   static constexpr int kHxOrHyMissComponentNBits = 8, kHtMissMagnitudeNBits = 7, kHtMissAngleNBits = 5;
0025 
0026   // Definitions.
0027   static const int NAddress, NData;
0028 
0029   /// Constructor for use with emulator
0030   L1GctHtMissLut(const L1CaloEtScale* const scale, const double lsb);
0031   /// Default constructor
0032   L1GctHtMissLut();
0033   /// Copy constructor
0034   L1GctHtMissLut(const L1GctHtMissLut& lut);
0035   /// Destructor
0036   ~L1GctHtMissLut() override;
0037 
0038   /// Overload = operator
0039   L1GctHtMissLut operator=(const L1GctHtMissLut& lut);
0040 
0041   /// Overload << operator
0042   friend std::ostream& operator<<(std::ostream& os, const L1GctHtMissLut& lut);
0043 
0044   /// Set the functions
0045   void setEtScale(const L1CaloEtScale* const fn) {
0046     m_etScale = fn;
0047     if (fn != nullptr) {
0048       m_setupOk = true;
0049     }
0050   }
0051   void setExEyLsb(const double lsb) { m_componentLsb = lsb; }
0052 
0053   /// Return the Lut functions and parameters
0054   const L1CaloEtScale* etScale() const { return m_etScale; }
0055   const double componentLsb() const { return m_componentLsb; }
0056 
0057   /// Get thresholds
0058   std::vector<double> getThresholdsGeV() const;
0059   std::vector<unsigned> getThresholdsGct() const;
0060 
0061 protected:
0062   uint16_t value(const uint16_t lutAddress) const override;
0063 
0064 private:
0065   const L1CaloEtScale* m_etScale;
0066 
0067   double m_componentLsb;
0068 };
0069 
0070 std::ostream& operator<<(std::ostream& os, const L1GctHtMissLut& lut);
0071 
0072 #endif /*L1GCTHTMISSLUT_H_*/