Go to the documentation of this file.00001 #include "RecoParticleFlow/PFClusterTools/interface/PFSCEnergyCalibration.h"
00002 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00003 #include <vector>
00004
00005 using namespace std;
00006
00007 PFSCEnergyCalibration::PFSCEnergyCalibration() {}
00008
00009
00010 PFSCEnergyCalibration::PFSCEnergyCalibration(std::vector<double>& barrelCorr,
00011 std::vector<double>& endcapCorr):
00012 barrelCorr_(barrelCorr),
00013 endcapCorr_(endcapCorr)
00014 {
00015
00016
00017
00018 bool log = false;
00019
00020
00021 if(barrelCorr_.size() != 11)
00022 edm::LogError("PFSCEnergyCalibration")<<" wrong size input paramter: calibPFSCEle_barrel read = "
00023 << barrelCorr_.size() << " expected = 11" << endl;
00024
00025
00026 if(endcapCorr_.size() != 9)
00027 edm::LogError("PFSCEnergyCalibration")<<" wrong size input parameter: calibPFSCEle_endcap read = "
00028 << endcapCorr_.size() << " expected = 8" << endl;
00029
00030
00031 if(log)
00032 cout << " ****** THE BARREL SC CORRECTIONS ******* " << barrelCorr_.size() << endl;
00033 for(unsigned int ip = 0; ip< barrelCorr_.size(); ip++){
00034 bb[ip] = barrelCorr_[ip];
00035 if(log)
00036 cout << " bb[" << ip << "] " << " = " << bb[ip] << endl;
00037 }
00038
00039 if(log)
00040 cout << " ****** THE ENCCAP SC CORRECTIONS ******* " << endcapCorr_.size() << endl;
00041 for(unsigned int ip = 0; ip< endcapCorr_.size(); ip++){
00042 cc[ip] = endcapCorr_[ip];
00043 if(log)
00044 cout << " cc[" << ip << "] " << " = " << cc[ip] << endl;
00045 }
00046 }
00047 PFSCEnergyCalibration::~PFSCEnergyCalibration() {}
00048
00049
00050 double PFSCEnergyCalibration::SCCorrEtEtaBarrel(double et, double eta) {
00051 double fCorr = 0;
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075 double temp_et = et;
00076
00077 if(temp_et < 2)
00078 temp_et = 2;
00079
00080
00081 double d0 = 15.0;
00082 double d1 = -0.00181;
00083 double d2 = 1.081;
00084
00085 double p0 = bb[0] + bb[1]/(temp_et + bb[2]) - bb[3]/(temp_et) ;
00086 double p1 = bb[4] + bb[5]/(bb[6] + temp_et);
00087
00088
00089
00090
00091 double p2 = bb[7] + bb[8]*temp_et + bb[9]*temp_et*temp_et + bb[10]*temp_et*temp_et*temp_et;
00092
00093 if(temp_et > 130) {
00094 double y = 130;
00095 p2 = bb[7] + bb[8]*y + bb[9]*y*y + bb[10]*y*y*y;
00096 }
00097
00098
00099
00100
00101
00102 fCorr = p0 + p1*atan(d0*(d2 - fabs(eta))) + d1*fabs(eta);
00103
00104 return et/fCorr;
00105 }
00106
00107 double PFSCEnergyCalibration::SCCorrEtEtaEndcap(double et, double eta) {
00108 double fCorr = 0;
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120
00121
00122
00123
00124
00125
00126
00127 double temp_et = et;
00128
00129 if(temp_et < 2)
00130 temp_et = 2;
00131
00132 double p0 = cc[0] + cc[1]/(cc[2] + temp_et);
00133 double p1 = cc[3] + cc[4]/(cc[5] + temp_et);
00134 double p2 = cc[6] + cc[7]/(cc[8] + temp_et);
00135
00136
00137 fCorr = p0 + p1*fabs(eta) + p2*eta*eta;
00138
00139 return et/fCorr;
00140 }
00141