Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-09-02 03:45:49

0001 #ifndef L1GCTHFETSUMSLUT_H_
0002 #define L1GCTHFETSUMSLUT_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 L1GctHfEtSumsLut
0014  * \brief LUT for compression of HF Et sum to output format
0015  *
0016  */
0017 
0018 class L1CaloEtScale;
0019 
0020 class L1GctHfEtSumsLut : public L1GctLut<8, 3>
0021 
0022 {
0023 public:
0024   enum hfLutType {
0025     bitCountPosEtaRing1,
0026     bitCountPosEtaRing2,
0027     bitCountNegEtaRing1,
0028     bitCountNegEtaRing2,
0029     etSumPosEtaRing1,
0030     etSumPosEtaRing2,
0031     etSumNegEtaRing1,
0032     etSumNegEtaRing2,
0033     numberOfLutTypes
0034   };
0035 
0036   // Definitions.
0037   static const int NAddress, NData;
0038 
0039   /// Constructor for use with emulator - which type of Lut?
0040   L1GctHfEtSumsLut(const L1GctHfEtSumsLut::hfLutType& type, const L1CaloEtScale* const scale);
0041   /// Constructor for use with emulator - which type of Lut?
0042   L1GctHfEtSumsLut(const L1GctHfEtSumsLut::hfLutType& type);
0043   /// Default constructor
0044   L1GctHfEtSumsLut();
0045   /// Copy constructor
0046   L1GctHfEtSumsLut(const L1GctHfEtSumsLut& lut);
0047   /// Destructor
0048   ~L1GctHfEtSumsLut() override;
0049 
0050   /// Overload = operator
0051   L1GctHfEtSumsLut operator=(const L1GctHfEtSumsLut& lut);
0052 
0053   /// Overload << operator
0054   friend std::ostream& operator<<(std::ostream& os, const L1GctHfEtSumsLut& lut);
0055 
0056   /// Set the function
0057   void setFunction(const L1CaloEtScale* const fn) {
0058     if (fn != nullptr) {
0059       m_lutFunction = fn;
0060       m_setupOk = true;
0061     }
0062   }
0063 
0064   /// Return the type of Lut
0065   L1GctHfEtSumsLut::hfLutType lutType() const { return m_lutType; }
0066 
0067   /// Return the Lut function
0068   const L1CaloEtScale* lutFunction() const { return m_lutFunction; }
0069 
0070   /// Get thresholds
0071   std::vector<double> getThresholdsGeV() const;
0072   std::vector<unsigned> getThresholdsGct() const;
0073 
0074 protected:
0075   uint16_t value(const uint16_t lutAddress) const override;
0076 
0077 private:
0078   const L1CaloEtScale* m_lutFunction;
0079   L1GctHfEtSumsLut::hfLutType m_lutType;
0080 };
0081 
0082 std::ostream& operator<<(std::ostream& os, const L1GctHfEtSumsLut& lut);
0083 
0084 #endif /*L1GCTHFETSUMSLUT_H_*/