CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/RecoEcal/EgammaCoreTools/plugins/EcalClusterEnergyUncertaintyObjectSpecific.cc

Go to the documentation of this file.
00001 #include "RecoEcal/EgammaCoreTools/plugins/EcalClusterEnergyUncertaintyObjectSpecific.h"
00002 #include "TMath.h"
00003 
00004 float EcalClusterEnergyUncertaintyObjectSpecific::getValue( const reco::SuperCluster & superCluster, const int mode ) const
00005 {
00006         checkInit();
00007 
00008         // mode  = 0 returns electron energy uncertainty 
00009 
00010         float en = superCluster.energy();
00011         float eta = fabs(superCluster.eta()); 
00012         float et = en/cosh(eta); 
00013         float brem = superCluster.phiWidth()/superCluster.etaWidth(); 
00014 
00015         
00016         const int nBinsEta=6;
00017         const float EtaBins[nBinsEta+1] = {0.0, 0.7, 1.15, 1.44, 1.56, 2.0, 2.5};
00018 
00019         const int nBinsBrem=6;
00020         const float BremBins  [nBinsBrem+1]= {0.8, 1.0, 2.0, 3.0, 4.0, 5.0, 10.0};
00021 
00022         float par0[nBinsEta][nBinsBrem];
00023         float par1[nBinsEta][nBinsBrem];
00024         float par2[nBinsEta][nBinsBrem];
00025         float par3[nBinsEta][nBinsBrem];
00026 
00027         par0[0][0]=0.00640519;
00028         par1[0][0]=0.257578;
00029         par2[0][0]=1.72437;
00030         par3[0][0]=4.04686e-06;
00031 
00032         par0[0][1]=0.00709569;
00033         par1[0][1]=0.279844;
00034         par2[0][1]=1.13789;
00035         par3[0][1]=1.16239e-05;
00036 
00037         par0[0][2]=0.0075544;
00038         par1[0][2]=0.341346;
00039         par2[0][2]=0.513396;
00040         par3[0][2]=2.90054e-06;
00041 
00042         par0[0][3]=0.00659365;
00043         par1[0][3]=0.517649;
00044         par2[0][3]=-3.1847;
00045         par3[0][3]=7.37152e-07;
00046 
00047         par0[0][4]=0.00771696;
00048         par1[0][4]=0.492897;
00049         par2[0][4]=-1.42222;
00050         par3[0][4]=0.000358677;
00051 
00052         par0[0][5]=0.00561532;
00053         par1[0][5]=0.655138;
00054         par2[0][5]=-3.29839;
00055         par3[0][5]=6.25898e-07;
00056 
00057         par0[1][0]=0.00273646;
00058         par1[1][0]=0.714568;
00059         par2[1][0]=-4.82956;
00060         par3[1][0]=4.45878e-07;
00061 
00062         par0[1][1]=0.00679797;
00063         par1[1][1]=0.472856;
00064         par2[1][1]=-0.281699;
00065         par3[1][1]=5.46479e-05;
00066 
00067         par0[1][2]=0.00845532;
00068         par1[1][2]=0.611624;
00069         par2[1][2]=-1.10104;
00070         par3[1][2]=1.16803e-05;
00071 
00072         par0[1][3]=0.00831068;
00073         par1[1][3]=0.853653;
00074         par2[1][3]=-4.23761;
00075         par3[1][3]=2.61247e-05;
00076 
00077         par0[1][4]=0.00845457;
00078         par1[1][4]=0.984985;
00079         par2[1][4]=-5.19548;
00080         par3[1][4]=2.05044e-07;
00081 
00082         par0[1][5]=0.0110227;
00083         par1[1][5]=1.00356;
00084         par2[1][5]=-4.31936;
00085         par3[1][5]=0.14384;
00086         
00087         par0[2][0]=-0.00192618;
00088         par1[2][0]=1.69986;
00089         par2[2][0]=-16.4355;
00090         par3[2][0]=1.94946e-06;
00091         
00092         par0[2][1]=0.0067622;
00093         par1[2][1]=0.792209;
00094         par2[2][1]=-1.18521;
00095         par3[2][1]=0.066577;
00096 
00097         par0[2][2]=0.00761595;
00098         par1[2][2]=1.03058;
00099         par2[2][2]=-4.17237;
00100         par3[2][2]=0.168543;
00101 
00102         par0[2][3]=0.0119179;
00103         par1[2][3]=0.910145;
00104         par2[2][3]=-2.14122;
00105         par3[2][3]=0.00342264;
00106         
00107         par0[2][4]=0.0139921;
00108         par1[2][4]=1.01488;
00109         par2[2][4]=-2.46637;
00110         par3[2][4]=0.0458434;
00111 
00112         par0[2][5]=0.013724;
00113         par1[2][5]=1.49078;
00114         par2[2][5]=-6.60661;
00115         par3[2][5]=0.297821;
00116         
00117         par0[3][0]=-0.00197909;
00118         par1[3][0]=4.40696;
00119         par2[3][0]=-4.88737;
00120         par3[3][0]=4.99999;
00121         
00122         par0[3][1]=0.0340196;
00123         par1[3][1]=3.86278;
00124         par2[3][1]=-10.899;
00125         par3[3][1]=0.130098;
00126         
00127         par0[3][2]=0.0102397;
00128         par1[3][2]=8.99643;
00129         par2[3][2]=-31.5122;
00130         par3[3][2]=0.00118335;
00131         
00132         par0[3][3]=0.0110891;
00133         par1[3][3]=8.01794;
00134         par2[3][3]=-21.9038;
00135         par3[3][3]=0.000245975;
00136         
00137         par0[3][4]=0.0328931;
00138         par1[3][4]=4.73441;
00139         par2[3][4]=-12.1148;
00140         par3[3][4]=3.01721e-05;
00141         
00142         par0[3][5]=0.0395614;
00143         par1[3][5]=3.54327;
00144         par2[3][5]=-12.6514;
00145         par3[3][5]=0.119761;
00146         
00147         par0[4][0]=0.0121809;
00148         par1[4][0]=0.965608;
00149         par2[4][0]=-4.19667;
00150         par3[4][0]=0.129896;
00151         
00152         par0[4][1]=0.0168951;
00153         par1[4][1]=1.0218;
00154         par2[4][1]=-4.03078;
00155         par3[4][1]=0.374291;
00156         
00157         par0[4][2]=0.0213549;
00158         par1[4][2]=1.29613;
00159         par2[4][2]=-4.89024;
00160         par3[4][2]=0.0297165;
00161         
00162         par0[4][3]=0.0262602;
00163         par1[4][3]=1.41674;
00164         par2[4][3]=-5.94928;
00165         par3[4][3]=0.19298;
00166         
00167         par0[4][4]=0.0334892;
00168         par1[4][4]=1.48572;
00169         par2[4][4]=-5.3175;
00170         par3[4][4]=0.0157013;
00171         
00172         par0[4][5]=0.0347093;
00173         par1[4][5]=1.63127;
00174         par2[4][5]=-7.27426;
00175         par3[4][5]=0.201164;
00176 
00177         par0[5][0]=0.0185321;
00178         par1[5][0]=0.255205;
00179         par2[5][0]=1.56798;
00180         par3[5][0]=5.07655e-11;
00181 
00182         par0[5][1]=0.0182718;
00183         par1[5][1]=0.459086;
00184         par2[5][1]=-0.48198;
00185         par3[5][1]=0.00114946;
00186         
00187         par0[5][2]=0.0175505;
00188         par1[5][2]=0.92848;
00189         par2[5][2]=-4.52737;
00190         par3[5][2]=0.154827;
00191 
00192         par0[5][3]=0.0233833;
00193         par1[5][3]=0.804105;
00194         par2[5][3]=-3.75131;
00195         par3[5][3]=2.84172;
00196 
00197         par0[5][4]=0.0334892;
00198         par1[5][4]=1.48572;
00199         par2[5][4]=-5.3175;
00200         par3[5][4]=0.0157013;
00201 
00202         par0[5][5]=0.0347093;
00203         par1[5][5]=1.63127;
00204         par2[5][5]=-7.27426;
00205         par3[5][5]=0.201164;
00206         
00207         
00208         int iEtaSl = -1;                                                                         
00209         for (int iEta = 0; iEta < nBinsEta; ++iEta){                                                                         
00210           if ( EtaBins[iEta] <= TMath::Abs(eta) && TMath::Abs(eta) <EtaBins[iEta+1] ){                   
00211             iEtaSl = iEta;                                                                                                                                       
00212           }                                                                                                                                                                      
00213         }
00214         
00215         
00216         int iBremSl = -1;                                                                        
00217         for (int iBrem = 0; iBrem < nBinsBrem; ++iBrem){                                                                         
00218           if ( BremBins[iBrem] <= brem && brem <BremBins[iBrem+1] ){                     
00219             iBremSl = iBrem;                                                                                                                                     
00220           }                                                                                                                                                                      
00221         }
00222         
00223         if (TMath::Abs(eta)>2.5) iEtaSl = nBinsEta-1;
00224         if (brem<BremBins[0]) iBremSl = 0;
00225         if (brem>BremBins[nBinsBrem-1]) iBremSl = nBinsBrem-1;
00226         
00227         float uncertainty = 0;
00228         if (et<=5) uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl]/(5-par2[iEtaSl][iBremSl]) + par3[iEtaSl][iBremSl]/((5-par2[iEtaSl][iBremSl])*(5-par2[iEtaSl][iBremSl]));
00229         if (et>=200) uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl]/(200-par2[iEtaSl][iBremSl]) + par3[iEtaSl][iBremSl]/((200-par2[iEtaSl][iBremSl])*(200-par2[iEtaSl][iBremSl]));
00230         
00231         if (et>5 && et<200) uncertainty = par0[iEtaSl][iBremSl] + par1[iEtaSl][iBremSl]/(et-par2[iEtaSl][iBremSl]) + par3[iEtaSl][iBremSl]/((et-par2[iEtaSl][iBremSl])*(et-par2[iEtaSl][iBremSl]));
00232  
00233         
00234         return (uncertainty*en);  
00235         
00236 
00237 }
00238 
00239 #include "RecoEcal/EgammaCoreTools/interface/EcalClusterFunctionFactory.h"
00240 DEFINE_EDM_PLUGIN( EcalClusterFunctionFactory, EcalClusterEnergyUncertaintyObjectSpecific, "EcalClusterEnergyUncertaintyObjectSpecific");