CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_7/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.13 2012/11/14 06:53:53 slava77 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   double energyEm(const reco::PFCluster& clusterEcal,
00053                   double ePS1,  double ePS2,
00054                   bool crackCorrection = true);
00055 
00056   double energyEm(const reco::PFCluster& clusterEcal,
00057                   std::vector<double> &EclustersPS1,
00058                   std::vector<double> &EclustersPS2,
00059                   double &ps1,double&ps2,
00060                   bool crackCorrection=true);
00061   double energyEm(const reco::PFCluster& clusterEcal,
00062                   double ePS1, double ePS2,
00063                   double &ps1,double&ps2,
00064                   bool crackCorrection=true);
00065 
00066   // ECAL+HCAL (abc) calibration, with E and eta dependent coefficients, for hadrons
00067   void energyEmHad(double t, double& e, double&h, double eta, double phi) const;
00068   
00069   // Initialize default E- and eta-dependent coefficient functional form
00070   void initializeCalibrationFunctions();
00071 
00072   // Set the run-dependent calibration functions from the global tag
00073   void setCalibrationFunctions(const PerformancePayloadFromTFormula *thePFCal) {
00074     pfCalibrations = thePFCal;
00075   }
00076 
00077   friend std::ostream& operator<<(std::ostream& out, 
00078                                   const PFEnergyCalibration& calib);
00079 
00080  protected:
00081 
00082   // Calibration functions from global tag
00083   const PerformancePayloadFromTFormula *pfCalibrations;
00084   
00085   // Barrel calibration (eta 0.00 -> 1.48)
00086   TF1* faBarrel;
00087   TF1* fbBarrel; 
00088   TF1* fcBarrel; 
00089   TF1* faEtaBarrel; 
00090   TF1* fbEtaBarrel; 
00091 
00092   // Endcap calibration (eta 1.48 -> 3.xx)
00093   TF1* faEndcap;
00094   TF1* fbEndcap; 
00095   TF1* fcEndcap; 
00096   TF1* faEtaEndcap; 
00097   TF1* fbEtaEndcap; 
00098 
00099  private:
00100   
00101   double minimum(double a,double b);
00102   double dCrackPhi(double phi, double eta);
00103   double CorrPhi(double phi, double eta);
00104   double CorrEta(double eta);
00105   double CorrBarrel(double E, double eta);
00106   double Alpha(double eta);
00107   double Beta(double E, double eta);
00108   double Gamma(double etaEcal);
00109   double EcorrBarrel(double E, double eta, double phi, bool crackCorrection=true);
00110   double EcorrZoneBeforePS(double E, double eta);
00111   double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal);
00112   double EcorrPS(double eEcal,double ePS1,double ePS2,double etaEcal,double&, double&);
00113   double EcorrPS_ePSNil(double eEcal,double eta);
00114   double EcorrZoneAfterPS(double E, double eta);
00115   double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,bool crackCorrection=true);
00116   double Ecorr(double eEcal,double ePS1,double ePS2,double eta,double phi,double&,double&,bool crackCorrection=true);
00117 
00118   // The calibration functions
00119   double aBarrel(double x) const;
00120   double bBarrel(double x) const;
00121   double cBarrel(double x) const;
00122   double aEtaBarrel(double x) const;
00123   double bEtaBarrel(double x) const; 
00124   double aEndcap(double x) const;
00125   double bEndcap(double x) const;
00126   double cEndcap(double x) const;
00127   double aEtaEndcap(double x) const; 
00128   double bEtaEndcap(double x) const;
00129 
00130   // Threshold correction (offset)
00131   double threshE, threshH;
00132 
00133 };
00134 
00135 #endif
00136 
00137