CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_1_8_patch9/src/JetMETCorrections/Utilities/src/SingleParticleJetResponse.cc

Go to the documentation of this file.
00001 #include "JetMETCorrections/Utilities/interface/SingleParticleJetResponse.h"
00002 
00003 using namespace std;
00004 
00005 SingleParticleJetResponse::SingleParticleJetResponse() {}
00006 
00007 vector<double> SingleParticleJetResponse::response(double echar, double energycluster, int algo) const 
00008 {
00009   vector<double> response;
00010   double recal=0,rhcal=0;
00011   
00012  // threshold on energy of track
00013   double e_thEC_hint;
00014   double e_thHC_hint;
00015   double e_thHC1_mip;
00016   double e_thHC2_mip;
00017 
00018   // parameters for Ecal responces with interaction in Ecal
00019   double PAR1_EC_hint;
00020   double PAR2_EC_hint;
00021   double PAR3_EC_hint;
00022   double PAR4_EC_hint;
00023 
00024   // parameters for Hcal responces with interaction in Ecal
00025   double PAR1_HC_hint;
00026   double PAR2_HC_hint;
00027   double PAR3_HC_hint;
00028   double PAR4_HC_hint;
00029 
00030   // parameters for Hcal responces without interaction in Ecal (MIP)
00031   double PAR1_HC_mip;
00032   double PAR2_HC_mip;
00033   double PAR3_HC_mip;
00034   double PAR4_HC_mip;
00035   double PAR5_HC_mip;
00036 
00037   if (algo == 0) 
00038     {
00039       if(energycluster>0.5) 
00040         {
00041           double epiecal=1.6/(1+0.6*0.11*log(0.4*echar));
00042           double epihcal=1.39/(1+0.39*0.11*log(0.6*echar));
00043           recal=0.4*echar/epiecal;
00044           rhcal=0.6*echar/epihcal;
00045         } 
00046       else 
00047         {
00048           double epihcal=1.39/(1+0.39*0.11*log(echar));
00049           rhcal=echar/epihcal;
00050           recal=energycluster;
00051         } // interact or not 
00052     }
00053   
00054   else if (algo == 1) // ORCA_6 
00055     {
00056       // threshold on energy of track
00057       e_thHC_hint = 65.;
00058       e_thHC1_mip = 14.;
00059       e_thHC2_mip = 54.;
00060       
00061       // parameters for Ecal responses with interaction in Ecal
00062       PAR1_EC_hint = 3.2181;
00063       PAR2_EC_hint = 4.8399;
00064       
00065       // parameters for Hcal responses with interaction in Ecal
00066       PAR1_HC_hint = 0.2496;
00067       PAR2_HC_hint =-1.1673;
00068       PAR3_HC_hint = 0.7506;
00069       
00070       // parameters for Hcal responses without interaction in Ecal (MIP)
00071       PAR1_HC_mip  = 0.4108;
00072       PAR2_HC_mip  =-0.3474;
00073       PAR3_HC_mip  = 0.0293;
00074       PAR4_HC_mip  = 0.8388;
00075       PAR5_HC_mip  = 1.0520;
00076       
00077       if(energycluster>0.5) 
00078         {
00079           double fecal_hint = PAR1_EC_hint/(sqrt(echar) + PAR2_EC_hint);
00080           recal = echar*fecal_hint;
00081           
00082           if(echar <= e_thHC_hint) 
00083             {
00084               double fhcal_hint = PAR1_HC_hint * (log(echar) + PAR2_HC_hint);
00085               rhcal=echar*fhcal_hint;
00086             } 
00087           else 
00088             {
00089               rhcal =echar* PAR3_HC_hint;
00090             } // hcal response, interact=1
00091           
00092           // MIP, interact=0
00093         } 
00094       else 
00095         {
00096           recal=energycluster;
00097           if(echar <= e_thHC1_mip) 
00098             {
00099               double fhcal_mip = PAR1_HC_mip * (log(echar) + PAR2_HC_mip);
00100               rhcal=echar*fhcal_mip;
00101             } 
00102           else if (echar > e_thHC1_mip && echar <= e_thHC2_mip) 
00103             {
00104               double fhcal_mip = PAR3_HC_mip * sqrt(echar) + PAR4_HC_mip;
00105               rhcal=echar*fhcal_mip;
00106             } 
00107           else 
00108             {
00109               rhcal=echar*PAR5_HC_mip;
00110             } // hcal response, MIP
00111           
00112         } // interact or not
00113     }
00114   
00115   else if (algo == 2) // cmsim133
00116     {
00117       // threshold on energy of track
00118       e_thEC_hint = 0.1;
00119       e_thHC_hint = 1000.;
00120       e_thHC1_mip = 15.5;
00121       e_thHC2_mip = 58.;
00122       
00123       // parameters for Ecal responses with interaction in Ecal
00124       PAR1_EC_hint = -0.99228E-01;
00125       PAR2_EC_hint = -8.2298;
00126       PAR3_EC_hint = -0.82878E-03;
00127       PAR4_EC_hint = 0.41902;
00128       
00129       // parameters for Hcal responses with interaction in Ecal
00130       PAR1_HC_hint = 0.90693E-01;
00131       PAR2_HC_hint = 0.86861E-01;
00132       PAR3_HC_hint = 0.089524;
00133       PAR4_HC_hint = 0.65067;
00134       
00135       // parameters for Hcal responses without interaction in Ecal (MIP)
00136       PAR1_HC_mip  = 0.29538;
00137       PAR2_HC_mip  = -0.12289;
00138       PAR3_HC_mip  = 0.14940E-01;
00139       PAR4_HC_mip  = 0.73503;
00140       PAR5_HC_mip  = 0.84801;    
00141 
00142      
00143       if(energycluster>0.5) 
00144         {
00145           
00146           if(echar <= e_thEC_hint) 
00147             {
00148               double fecal_hint = PAR1_EC_hint * (echar + PAR2_EC_hint);
00149               recal = echar*fecal_hint;
00150             }
00151           else 
00152             {
00153               double fecal_hint = PAR3_EC_hint * echar + PAR4_EC_hint;
00154               recal = echar*fecal_hint;
00155             }
00156 
00157           if(echar <= e_thHC_hint) 
00158             {
00159               double fhcal_hint = PAR1_HC_hint * (log(echar) + PAR2_HC_hint);
00160               rhcal=echar*fhcal_hint;
00161             }
00162           else 
00163             {
00164               double fhcal_hint = PAR3_HC_hint * (log(echar) + PAR4_HC_hint);
00165               rhcal=echar*fhcal_hint;
00166             } // hcal response, interact=1
00167           
00168           // MIP, interact=0
00169         }
00170       else 
00171         {
00172           recal=energycluster;
00173           if(echar <= e_thHC1_mip) 
00174             {
00175               double fhcal_mip = PAR1_HC_mip * (log(echar) + PAR2_HC_mip);
00176               rhcal=echar*fhcal_mip;
00177             } 
00178           else if (echar > e_thHC1_mip && echar <= e_thHC2_mip) 
00179             {
00180               double fhcal_mip = PAR3_HC_mip * sqrt(echar) + PAR4_HC_mip;
00181               rhcal=echar*fhcal_mip;
00182             } 
00183           else 
00184             {
00185               rhcal=echar*PAR5_HC_mip;
00186             } // hcal response, MIP
00187       
00188         } // interact or not
00189     }
00190 
00191   else if (algo == 3) // OSCAR_3_6_0
00192     {
00193       // threshold on energy of track
00194       e_thEC_hint = 1000.;
00195       e_thHC_hint = 0.5;
00196       e_thHC1_mip = 12.;
00197       e_thHC2_mip = 30.;
00198 
00199       // parameters for Ecal responses with interaction in Ecal
00200       PAR1_EC_hint = -0.54951E-03;
00201       PAR2_EC_hint = 0.42609;
00202       PAR3_EC_hint = -2.8831;
00203       PAR4_EC_hint = 0.33487;
00204       
00205       // parameters for Hcal responses with interaction in Ecal
00206       PAR1_HC_hint = -0.028222;
00207       PAR2_HC_hint = 0.43868;
00208       PAR3_HC_hint = 0.12144;
00209       PAR4_HC_hint = -0.63474;
00210 
00211       // parameters for Hcal responses without interaction in Ecal (MIP)
00212       PAR1_HC_mip  = 0.86455E-01;
00213       PAR2_HC_mip  = -0.36659;
00214       PAR3_HC_mip  = 0.60879E-01;
00215       PAR4_HC_mip  = 0.64219;
00216       PAR5_HC_mip  = 0.96800;
00217      
00218       if(energycluster>0.5) 
00219         {
00220           if(echar <= e_thEC_hint) 
00221             {
00222               double fecal_hint = PAR1_EC_hint * (echar) + PAR2_EC_hint;
00223               recal = echar*fecal_hint;
00224             }
00225           else 
00226             {
00227               double fecal_hint = PAR3_EC_hint/(-echar) + PAR4_EC_hint;
00228               recal = echar*fecal_hint;
00229             }
00230 
00231           if(echar <= e_thHC_hint) 
00232             {
00233               double fhcal_hint = PAR1_HC_hint * echar + PAR2_HC_hint;
00234               rhcal=echar*fhcal_hint;
00235             }
00236           else 
00237             {
00238               double fhcal_hint = PAR3_HC_hint * (log(echar) + PAR4_HC_hint);
00239               rhcal=echar*fhcal_hint;
00240             } // hcal response, interact=1
00241           
00242           // MIP, interact=0
00243         }
00244       else 
00245         {
00246           recal=energycluster;
00247           if(echar <= e_thHC1_mip) 
00248             {
00249               double fhcal_mip = PAR1_HC_mip * (echar + PAR2_HC_mip);
00250               rhcal=echar*fhcal_mip;
00251             } 
00252           else if (echar > e_thHC1_mip && echar <= e_thHC2_mip) 
00253             {
00254               double fhcal_mip = PAR3_HC_mip * sqrt(echar) + PAR4_HC_mip;
00255               rhcal=echar*fhcal_mip;
00256             } else 
00257             {
00258               rhcal=echar*PAR5_HC_mip;
00259             } // hcal response, MIP
00260           
00261         } // interact or not
00262     }
00263   
00264   response.push_back(recal);
00265   response.push_back(rhcal);
00266   return response;
00267 }