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
00010
00011
00012
00013
00029
00030
00031
00032
00033
00034
00035
00036 #include <iostream>
00037
00038
00039
00040 class PFEnergyCalibration
00041 {
00042 public:
00043 PFEnergyCalibration();
00044
00045 ~PFEnergyCalibration();
00046
00047
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
00067 void energyEmHad(double t, double& e, double&h, double eta, double phi) const;
00068
00069
00070 void initializeCalibrationFunctions();
00071
00072
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
00083 const PerformancePayloadFromTFormula *pfCalibrations;
00084
00085
00086 TF1* faBarrel;
00087 TF1* fbBarrel;
00088 TF1* fcBarrel;
00089 TF1* faEtaBarrel;
00090 TF1* fbEtaBarrel;
00091
00092
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
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
00131 double threshE, threshH;
00132
00133 };
00134
00135 #endif
00136
00137