CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_2_9_HLT1_bphpatch4/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 #include "CondFormats/PhysicsToolsObjects/interface/PerformancePayloadFromTFormula.h"
00006 
00007 class TF1;
00008 
00009 // -*- C++ -*-
00010 //
00011 // Package:    PFClusterTools
00012 // Class:      PFEnergyCalibration
00013 // 
00029 //
00030 // Original Author:  Christian Veelken
00031 //         Created:  Tue Aug  8 16:26:18 CDT 2006
00032 // $Id: PFEnergyCalibration.h,v 1.12 2011/02/24 14:16:30 pjanot Exp $
00033 //
00034 //
00035 
00036 #include <iostream>
00037 
00038 //#include "FWCore/ParameterSet/interface/ParameterSet.h"
00039 
00040 class PFEnergyCalibration 
00041 {
00042  public:
00043   PFEnergyCalibration(); 
00044 
00045   ~PFEnergyCalibration();
00046 
00047   // ecal calibration for photons
00048   double energyEm(const reco::PFCluster& clusterEcal,
00049                   std::vector<double> &EclustersPS1,
00050                   std::vector<double> &EclustersPS2,
00051                   bool crackCorrection = true);
00052 
00053   double energyEm(const reco::PFCluster& clusterEcal,
00054                   std::vector<double> &EclustersPS1,
00055                   std::vector<double> &EclustersPS2,
00056                   double &ps1,double&ps2,
00057                   bool crackCorrection=true);
00058 
00059   // ECAL+HCAL (abc) calibration, with E and eta dependent coefficients, for hadrons
00060   void energyEmHad(double t, double& e, double&h, double eta, double phi) const;
00061   
00062   // Initialize default E- and eta-dependent coefficient functional form
00063   void initializeCalibrationFunctions();
00064 
00065   // Set the run-dependent calibration functions from the global tag
00066   void setCalibrationFunctions(const PerformancePayloadFromTFormula *thePFCal) {
00067     pfCalibrations = thePFCal;
00068   }
00069 
00070   friend std::ostream& operator<<(std::ostream& out, 
00071                                   const PFEnergyCalibration& calib);
00072 
00073  protected:
00074 
00075   // Calibration functions from global tag
00076   const PerformancePayloadFromTFormula *pfCalibrations;
00077   
00078   // Barrel calibration (eta 0.00 -> 1.48)
00079   TF1* faBarrel;
00080   TF1* fbBarrel; 
00081   TF1* fcBarrel; 
00082   TF1* faEtaBarrel; 
00083   TF1* fbEtaBarrel; 
00084 
00085   // Endcap calibration (eta 1.48 -> 3.xx)
00086   TF1* faEndcap;
00087   TF1* fbEndcap; 
00088   TF1* fcEndcap; 
00089   TF1* faEtaEndcap; 
00090   TF1* fbEtaEndcap; 
00091 
00092  private:
00093   
00094   double minimum(double a,double b);
00095   double dCrackPhi(double phi, double eta);
00096   double CorrPhi(double phi, double eta);
00097   double CorrEta(double eta);
00098   double CorrBarrel(double E, double eta);
00099   double Alpha(double eta);
00100   double Beta(double E, double eta);
00101   double Gamma(double etaEcal);
00102   double EcorrBarrel(double E, double eta, double phi, bool crackCorrection=true);
00103   double EcorrZoneBeforePS(double E, double eta);
00104   double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal);
00105   double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal,double&, double&);
00106   double EcorrPS_ePSNil(double eEcal,double eta);
00107   double EcorrZoneAfterPS(double E, double eta);
00108   double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,bool crackCorrection=true);
00109   double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,double&,double&,bool crackCorrection=true);
00110 
00111   // The calibration functions
00112   double aBarrel(double x) const;
00113   double bBarrel(double x) const;
00114   double cBarrel(double x) const;
00115   double aEtaBarrel(double x) const;
00116   double bEtaBarrel(double x) const; 
00117   double aEndcap(double x) const;
00118   double bEndcap(double x) const;
00119   double cEndcap(double x) const;
00120   double aEtaEndcap(double x) const; 
00121   double bEtaEndcap(double x) const;
00122 
00123   // Threshold correction (offset)
00124   double threshE, threshH;
00125 
00126 };
00127 
00128 #endif
00129 
00130