CMS 3D CMS Logo

L1GctJetEtCalibrationFunction.h

Go to the documentation of this file.
00001 #ifndef L1GCTJETETCALIBRATIONFUNCTION_H_
00002 #define L1GCTJETETCALIBRATIONFUNCTION_H_
00003 
00004 #include <boost/cstdint.hpp> //for uint16_t
00005 
00006 #include <vector>
00007 #include <string>
00008 
00034 class L1GctJetEtCalibrationFunction
00035 {
00036 public:
00037   enum CorrectionFunctionType { POWER_SERIES_CORRECTION,
00038                                 ORCA_STYLE_CORRECTION,
00039                                 PIECEWISE_CUBIC_CORRECTION,
00040                                 NO_CORRECTION };
00041 
00042   static const unsigned NUMBER_ETA_VALUES;     
00043   static const unsigned N_CENTRAL_ETA_VALUES;  
00044 
00045   L1GctJetEtCalibrationFunction();
00046   ~L1GctJetEtCalibrationFunction();
00047 
00049   void setParams(const double& htScale, const double& threshold,
00050                  const std::vector< std::vector<double> >& jetCalibFunc,
00051                  const std::vector< std::vector<double> >& tauCalibFunc );
00052 
00054   void setCorrectionFunctionType(const CorrectionFunctionType cft) { m_corrFunType = cft;
00055                                                                    }
00056 
00058   void setConversionToEnergyOn(const std::vector<double>& conversionFunc);
00059   void setConversionToEnergyOff();
00060                                                                    
00062   friend std::ostream& operator << (std::ostream& os, const L1GctJetEtCalibrationFunction& fn);
00063   
00066   double correctedEt(const double et, const unsigned eta, const bool tauVeto) const;
00067   
00069   uint16_t calibratedEt(const double correctedEt) const;
00070 
00073   double getHtScaleLSB() const { return m_htScaleLSB; }
00074 
00077   double getThreshold() const { return m_threshold; }
00078 
00079 
00080 private:
00081 
00082   // CONVERSION FUNCTIONS
00084   double findCorrectedEt       (const double Et, const std::vector<double>& coeffs) const;
00085   double powerSeriesCorrect    (const double Et, const std::vector<double>& coeffs) const;
00086   double orcaStyleCorrect      (const double Et, const std::vector<double>& coeffs) const;
00087   double piecewiseCubicCorrect (const double Et, const std::vector<double>& coeffs) const;
00088   
00090   uint16_t rank(const double Et) const;
00091 
00092   // PARAMETERS FOR THE CONVERSION
00094   CorrectionFunctionType m_corrFunType; 
00095 
00096   bool m_convertToEnergy;
00097 
00099   double m_htScaleLSB;
00100   double m_threshold;
00101 
00103   std::vector< std::vector<double> > m_jetCalibFunc;
00104   std::vector< std::vector<double> > m_tauCalibFunc;
00105 
00106   std::vector<double> m_energyConversion;
00107 
00108 };
00109 
00110 std::ostream& operator << (std::ostream& os, const L1GctJetEtCalibrationFunction& fn);
00111 
00112 #endif /*L1GCTJETETCALIBRATIONFUNCTION_H_*/

Generated on Tue Jun 9 17:26:37 2009 for CMSSW by  doxygen 1.5.4