Back to home page

Project CMSSW displayed by LXR

 
 

    


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

0001 #ifndef L1GCTJETFINDERPARAMS_H_
0002 #define L1GCTJETFINDERPARAMS_H_
0003 
0004 #include "CondFormats/Serialization/interface/Serializable.h"
0005 
0006 #include <vector>
0007 #include <cstdint>
0008 #include <iosfwd>
0009 
0010 class L1GctJetFinderParams {
0011 public:
0012   static const unsigned NUMBER_ETA_VALUES;     ///< Number of eta bins used in correction
0013   static const unsigned N_CENTRAL_ETA_VALUES;  ///< Number of eta bins used in correction
0014 
0015   L1GctJetFinderParams();
0016 
0017   L1GctJetFinderParams(double rgnEtLsb,
0018                        double htLsb,
0019                        double cJetSeed,
0020                        double fJetSeed,
0021                        double tJetSeed,
0022                        double tauIsoEtThresh,
0023                        double htJetEtThresh,
0024                        double mhtJetEtThresh,
0025                        unsigned etaBoundary,
0026                        unsigned corrType,
0027                        const std::vector<std::vector<double> >& jetCorrCoeffs,
0028                        const std::vector<std::vector<double> >& tauCorrCoeffs,
0029                        bool convertToEnergy,
0030                        const std::vector<double>& energyConvCoeffs);
0031 
0032   ~L1GctJetFinderParams();
0033 
0034   // get methods
0035   double getRgnEtLsbGeV() const { return rgnEtLsb_; }
0036   double getHtLsbGeV() const { return htLsb_; }
0037   double getCenJetEtSeedGeV() const { return cenJetEtSeed_; }
0038   double getForJetEtSeedGeV() const { return forJetEtSeed_; }
0039   double getTauJetEtSeedGeV() const { return tauJetEtSeed_; }
0040   double getTauIsoEtThresholdGeV() const { return tauIsoEtThreshold_; }
0041   double getHtJetEtThresholdGeV() const { return htJetEtThreshold_; }
0042   double getMHtJetEtThresholdGeV() const { return mhtJetEtThreshold_; }
0043   unsigned getCenForJetEtaBoundary() const { return cenForJetEtaBoundary_; }
0044   bool getConvertToEnergy() const { return convertToEnergy_; }
0045 
0046   // get integers
0047   unsigned getCenJetEtSeedGct() const { return static_cast<unsigned>(cenJetEtSeed_ / rgnEtLsb_); }
0048   unsigned getForJetEtSeedGct() const { return static_cast<unsigned>(forJetEtSeed_ / rgnEtLsb_); }
0049   unsigned getTauJetEtSeedGct() const { return static_cast<unsigned>(tauJetEtSeed_ / rgnEtLsb_); }
0050   unsigned getTauIsoEtThresholdGct() const { return static_cast<unsigned>(tauIsoEtThreshold_ / rgnEtLsb_); }
0051   unsigned getHtJetEtThresholdGct() const { return static_cast<unsigned>(htJetEtThreshold_ / htLsb_); }
0052   unsigned getMHtJetEtThresholdGct() const { return static_cast<unsigned>(mhtJetEtThreshold_ / htLsb_); }
0053 
0054   // set methods
0055   void setRegionEtLsb(const double rgnEtLsb);
0056   void setSlidingWindowParams(const double cJetSeed,
0057                               const double fJetSeed,
0058                               const double tJetSeed,
0059                               const unsigned etaBoundary);
0060   void setJetEtCalibrationParams(const unsigned corrType,
0061                                  const std::vector<std::vector<double> >& jetCorrCoeffs,
0062                                  const std::vector<std::vector<double> >& tauCorrCoeffs);
0063   void setJetEtConvertToEnergyOn(const std::vector<double>& energyConvCoeffs);
0064   void setJetEtConvertToEnergyOff();
0065   void setHtSumParams(const double htLsb, const double htJetEtThresh, const double mhtJetEtThresh);
0066   void setTauAlgorithmParams(const double tauIsoEtThresh);
0067   void setParams(const double rgnEtLsb,
0068                  const double htLsb,
0069                  const double cJetSeed,
0070                  const double fJetSeed,
0071                  const double tJetSeed,
0072                  const double tauIsoEtThresh,
0073                  const double htJetEtThresh,
0074                  const double mhtJetEtThresh,
0075                  const unsigned etaBoundary,
0076                  const unsigned corrType,
0077                  const std::vector<std::vector<double> >& jetCorrCoeffs,
0078                  const std::vector<std::vector<double> >& tauCorrCoeffs);
0079 
0080   // correct jet Et
0081   /// Eta takes a value from 0-10, corresponding to jet regions running from eta=0.0 to eta=5.0
0082   double correctedEtGeV(const double et, const unsigned eta, const bool tauVeto) const;
0083 
0084   /// Convert the corrected Et value to a linear Et for Ht summing
0085   uint16_t correctedEtGct(const double correctedEt) const;
0086 
0087   /// Access to jet Et calibration parameters
0088   unsigned getCorrType() const { return corrType_; }
0089   const std::vector<std::vector<double> >& getJetCorrCoeffs() const { return jetCorrCoeffs_; }
0090   const std::vector<std::vector<double> >& getTauCorrCoeffs() const { return tauCorrCoeffs_; }
0091 
0092 private:
0093   // correct the et
0094   double correctionFunction(const double Et, const std::vector<double>& coeffs) const;
0095 
0096   // different jet correction functions
0097   double findCorrectedEt(const double Et, const std::vector<double>& coeffs) const;
0098   double powerSeriesCorrect(const double Et, const std::vector<double>& coeffs) const;
0099   double orcaStyleCorrect(const double Et, const std::vector<double>& coeffs) const;
0100   double simpleCorrect(const double Et, const std::vector<double>& coeffs) const;
0101   double piecewiseCubicCorrect(const double Et, const std::vector<double>& coeffs) const;
0102   double pfCorrect(const double Et, const std::vector<double>& coeffs) const;
0103 
0104 private:
0105   // internal scale LSBs
0106   double rgnEtLsb_;
0107   double htLsb_;
0108 
0109   // parameters
0110   double cenJetEtSeed_;
0111   double forJetEtSeed_;
0112   double tauJetEtSeed_;
0113   double tauIsoEtThreshold_;
0114   double htJetEtThreshold_;
0115   double mhtJetEtThreshold_;
0116   unsigned cenForJetEtaBoundary_;
0117 
0118   // jet Et corrections
0119   unsigned corrType_;
0120   std::vector<std::vector<double> > jetCorrCoeffs_;
0121   std::vector<std::vector<double> > tauCorrCoeffs_;
0122 
0123   // convert Et to E
0124   bool convertToEnergy_;
0125   std::vector<double> energyConversionCoeffs_;
0126 
0127   COND_SERIALIZABLE;
0128 };
0129 
0130 /// Overload << operator
0131 std::ostream& operator<<(std::ostream& os, const L1GctJetFinderParams& fn);
0132 
0133 #endif /*L1GCTJETPARAMS_H_*/