CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch13/src/RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibration.h

Go to the documentation of this file.
00001 #ifndef RecoParticleFlow_PFClusterTools_PFEnergyCalibration_h
00002 #define RecoParticleFlow_PFClusterTools_PFEnergyCalibration_h 
00003 
00004 #include "DataFormats/ParticleFlowReco/interface/PFCluster.h"
00005 
00006 class TF1;
00007 
00008 // -*- C++ -*-
00009 //
00010 // Package:    PFClusterTools
00011 // Class:      PFEnergyCalibration
00012 // 
00028 //
00029 // Original Author:  Christian Veelken
00030 //         Created:  Tue Aug  8 16:26:18 CDT 2006
00031 // $Id: PFEnergyCalibration.h,v 1.11 2009/10/27 17:13:26 beaudett Exp $
00032 //
00033 //
00034 
00035 #include <iostream>
00036 
00037 //#include "FWCore/ParameterSet/interface/ParameterSet.h"
00038 
00039 class PFEnergyCalibration 
00040 {
00041  public:
00042   PFEnergyCalibration(); // default constructor;
00043                          // needed by PFRootEvent
00044 
00045   PFEnergyCalibration( double e_slope,
00046                        double e_offset, 
00047                        double eh_eslope,
00048                        double eh_hslope,
00049                        double eh_offset,
00050                        double h_slope,
00051                        double h_offset,
00052                        double h_damping,
00053                        unsigned newCalib = 0);
00054 
00055   ~PFEnergyCalibration();
00056 
00057   // ecal calibration
00058   double energyEm(double uncalibratedEnergyECAL, 
00059                   double eta=0, double phi=0) const;
00060   
00061   double energyEm(const reco::PFCluster& clusterEcal,
00062                   std::vector<double> &EclustersPS1,
00063                   std::vector<double> &EclustersPS2,
00064                   bool crackCorrection = true);
00065 
00066   double energyEm(const reco::PFCluster& clusterEcal,
00067                   std::vector<double> &EclustersPS1,
00068                   std::vector<double> &EclustersPS2,
00069                   double &ps1,double&ps2,
00070                   bool crackCorrection=true);
00071 
00072   // HCAL only calibration
00073   double energyHad(double uncalibratedEnergyHCAL, 
00074                    double eta=0, double phi=0) const;
00075   
00076   
00077   // ECAL+HCAL (abc) calibration
00078   double energyEmHad(double uncalibratedEnergyECAL, 
00079                      double uncalibratedEnergyHCAL, 
00080                      double eta=0, double phi=0) const;
00081 
00082   // ECAL+HCAL (abc-alpha-beta) calibration, with E and eta dependent coefficients
00083   void energyEmHad(double t, double& e, double&h, double eta, double phi) const;
00084   
00085   // set calibration parameters for energy deposits of electrons and photons in ECAL; this member function is needed by PFRootEvent
00086   void setCalibrationParametersEm(double paramECAL_slope, 
00087                                   double paramECAL_offset);
00088 
00089   // Initialize E- and eta-dependent coefficient functional form
00090   void initializeCalibrationFunctions();
00091 
00092   double paramECAL_slope() const {return  paramECAL_slope_;} 
00093 
00094   double paramECAL_offset() const {return paramECAL_offset_;} 
00095 
00096   double paramECALplusHCAL_slopeECAL() const {
00097     return paramECALplusHCAL_slopeECAL_;
00098   } 
00099 
00100   double paramECALplusHCAL_slopeHCAL() const {
00101     return paramECALplusHCAL_slopeHCAL_;
00102   } 
00103 
00104   double paramECALplusHCAL_offset() const {return paramECALplusHCAL_offset_;} 
00105 
00106   double paramHCAL_slope() const {return paramHCAL_slope_;} 
00107   double paramHCAL_offset() const {return paramHCAL_offset_;} 
00108   double paramHCAL_damping() const {return paramHCAL_damping_;} 
00109 
00110   
00111   friend std::ostream& operator<<(std::ostream& out, 
00112                                   const PFEnergyCalibration& calib);
00113 
00114  protected:
00115   double paramECAL_slope_;
00116   double paramECAL_offset_;
00117   
00118   double paramECALplusHCAL_slopeECAL_;
00119   double paramECALplusHCAL_slopeHCAL_;
00120   double paramECALplusHCAL_offset_;
00121   
00122   double paramHCAL_slope_;
00123   double paramHCAL_offset_;
00124   double paramHCAL_damping_;
00125 
00126  private:
00127   
00128   double minimum(double a,double b);
00129   double dCrackPhi(double phi, double eta);
00130   double CorrPhi(double phi, double eta);
00131   double CorrEta(double eta);
00132   double CorrBarrel(double E, double eta);
00133   double Alpha(double eta);
00134   double Beta(double E, double eta);
00135   double Gamma(double etaEcal);
00136   double EcorrBarrel(double E, double eta, double phi, bool crackCorrection=true);
00137   double EcorrZoneBeforePS(double E, double eta);
00138   double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal);
00139   double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal,double&, double&);
00140   double EcorrPS_ePSNil(double eEcal,double eta);
00141   double EcorrZoneAfterPS(double E, double eta);
00142   double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,bool crackCorrection=true);
00143   double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,double&,double&,bool crackCorrection=true);
00144 
00145   // Barrel calibration (eta 0.00 -> 1.48)
00146   TF1* faBarrel;
00147   TF1* fbBarrel; 
00148   TF1* fcBarrel; 
00149   TF1* faEtaBarrel; 
00150   TF1* fbEtaBarrel; 
00151 
00152   // Endcap calibration (eta 1.48 -> 3.xx)
00153   TF1* faEndcap;
00154   TF1* fbEndcap; 
00155   TF1* fcEndcap; 
00156   TF1* faEtaEndcap; 
00157   TF1* fbEtaEndcap; 
00158 
00159   // Threshold correction (offset)
00160   double threshE, threshH;
00161 
00162 };
00163 
00164 #endif
00165 
00166