CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC4_patch1/src/L1Trigger/RegionalCaloTrigger/interface/L1RCTLookupTables.h

Go to the documentation of this file.
00001 #ifndef L1RCTLookupTables_h
00002 #define L1RCTLookupTables_h
00003 
00004 class L1RCTParameters;
00005 struct L1RCTChannelMask;
00006 struct L1RCTNoisyChannelMask;
00007 class L1CaloEcalScale;
00008 class L1CaloHcalScale;
00009 class L1CaloEtScale;
00010 
00011 class L1RCTLookupTables {
00012  
00013  public:
00014 
00015   // constructor
00016 
00017   L1RCTLookupTables() : rctParameters_(0), channelMask_(0), ecalScale_(0), hcalScale_(0), etScale_(0) {}
00018   
00019   // this needs to be refreshed every event -- constructor inits to zero
00020   // to indicate that it cannot be used -- if this set function is
00021   // called, lookup after that call will use it.
00022   void setRCTParameters(const L1RCTParameters* rctParameters)
00023     {
00024       rctParameters_ = rctParameters;
00025     }
00026   // ditto for channel mask
00027   void setChannelMask(const L1RCTChannelMask* channelMask)
00028     {
00029       channelMask_ = channelMask;
00030     }
00031   void setNoisyChannelMask(const L1RCTNoisyChannelMask* channelMask)
00032     {
00033       noisyChannelMask_ = channelMask;
00034     }
00035 
00036   // ditto for hcal TPG scale
00037   void setHcalScale(const L1CaloHcalScale* hcalScale)
00038     {
00039       hcalScale_ = hcalScale;
00040     }
00041   // ditto for caloEtScale
00042   void setL1CaloEtScale(const L1CaloEtScale* etScale)
00043     {
00044       etScale_ = etScale;
00045     }
00046   // ditto for ecal TPG Scale
00047   void setEcalScale(const L1CaloEcalScale* ecalScale)
00048     {
00049       ecalScale_ = ecalScale;
00050     }
00051 
00052   const L1RCTParameters* rctParameters() const {return rctParameters_;}
00053   
00054   unsigned int lookup(unsigned short ecalInput,
00055                       unsigned short hcalInput,
00056                       unsigned short fgbit,
00057                       unsigned short crtNo,
00058                       unsigned short crdNo,
00059                       unsigned short twrNo
00060                       ) const;
00061 
00062   unsigned int lookup(unsigned short hfInput, 
00063                       unsigned short crtNo,
00064                       unsigned short crdNo,
00065                       unsigned short twrNo
00066                       ) const;
00067 
00068   unsigned int emRank(unsigned short energy) const;
00069   unsigned int eGammaETCode(float ecal, float hcal, int iAbsEta) const;
00070   unsigned int jetMETETCode(float ecal, float hcal, int iAbsEta) const;
00071   bool hOeFGVetoBit(float ecal, float hcal, bool fgbit) const;
00072   bool activityBit(float ecal, float hcal) const;
00073 
00074  private:
00075 
00076   // helper functions
00077 
00078   float convertEcal(unsigned short ecal, unsigned short iAbsEta, short sign) const;  
00079   float convertHcal(unsigned short hcal, unsigned short iAbsEta, short sign) const;
00080   unsigned long convertToInteger(float et, float lsb, int precision) const;
00081 
00082   const L1RCTParameters* rctParameters_;
00083   const L1RCTChannelMask* channelMask_;
00084   const L1RCTNoisyChannelMask* noisyChannelMask_;
00085   const L1CaloEcalScale* ecalScale_;
00086   const L1CaloHcalScale* hcalScale_;
00087   const L1CaloEtScale* etScale_;
00088 
00089 };
00090 #endif