/afs/hep.man.ac.uk/u/markowen/ATLAS/SFrameProof/2011EPS/topUtils/src/electron_WZ_SF_EPS.h

00001 // copied from PhysicsAnalysis/TopPhys/TopPhysUtils/TopElectronSFUtils/trunk/electron_SF_EPS.h on 21 June 2011 at 3pm UK time
00002 #ifndef electron_WZ_SF_EPS_h
00003 #define electron_WZ_SF_EPS_h
00004 
00005 /****************************************************************************
00006  * electron_SF_EPS.h                                                        *
00007  *                                                                          *
00008  * Simple functions which return data/MC scale factors                      *
00009  * given a electron's eta                                                                                                       *
00010  * Also functions for corresponding uncertainties.                          *
00011  *                                                                          *
00012  * double ele_ID_SF(double et, double ET)                                   *
00013  * double ele_ID_SF_err(double eta, double ET)                                  *
00014  * double ele_reco_SF();                                                    *
00015  * double ele_reco_SF_err();                                                    *
00016  * double ele_recoID_SF(double eta, double ET);                             *
00017  * double ele_recoID_SF_err(double eta, double ET);                             *
00018  * double ele_trigger_SF();                                                 *
00019  * double ele_trigger_SF_err();                                                 *
00020  *                                                                          *
00021  * History                                                                  *
00022  *         26 Jan 2011 -- created by S. Caughron                            *   
00023  *         05 May 2011 -- updated for pLHC                                  *   
00024  *         14 May 2011 -- more pLHC updates                                 *   
00025  *         20 Jun 2011 -- updated for EPS                                   *   
00026  ***************************************************************************/
00027 
00028 #include <iostream>
00029 
00030 // forward declaration of functions
00031 
00032 double ele_WZ_trigger_SF(double eta);
00033 double ele_WZ_trigger_SF_err(double eta);
00034 
00035 
00036 // For trigger SFs
00037 double ele_WZ_trigger_SF(double eta)
00038 {
00039 
00040     double ele_eta = eta;
00041     int etaI=-1;
00042 
00043     const double etabins[18] = {-2.47,-2.37,-2.01,-1.81,-1.37,
00044                                                             -1.15,-0.8,-0.6,-0.1,0,0.1,0.6,0.8,1.15,
00045                                                             1.52,1.81,2.01,2.37};
00046 
00047         const double SFmatrix[18] = {0.9655, 0.9739, 0.9842, 0.9867, 0.9970, 0.9896,
00048                                                                  0.9847, 0.9930, 0.9912, 0.9928, 0.9923, 0.9971,
00049                                                                  0.9915, 0.9957, 0.9982, 0.9782, 0.9786, 0.9790};
00050                                                                    
00051         const double etamax = 2.47;
00052         const double etacrack[2] = {1.37,1.52};
00053 
00054     if ( fabs(ele_eta) > etamax || (fabs(ele_eta) > etacrack[0] && fabs(ele_eta) < etacrack[1]) )  // check forward, crack regions
00055 
00056         return 1.0;       
00057 
00058     else {           
00059         
00060         for (int i=17; i>=0; i--){    // find eta index
00061             if ( ele_eta > etabins[i] ) {
00062                 etaI = i;
00063                 break;
00064             }
00065         }
00066 
00067         return SFmatrix[etaI];
00068 
00069     } //else
00070 
00071     return 0;
00072 
00073 }
00074 
00075 // For trigger SF uncertainties (symmetric)
00076 double ele_WZ_trigger_SF_err(double eta)
00077 {
00078 
00079     double ele_eta = eta;
00080     int etaI=-1;
00081 
00082     const double etabins[18] = {-2.47,-2.37,-2.01,-1.81,-1.37,
00083                                                             -1.15,-0.8,-0.6,-0.1,0,0.1,0.6,0.8,1.15,
00084                                                             1.52,1.81,2.01,2.37};
00085 
00086         const double errmatrix[18] = {0.0065, 0.0059, 0.0043, 0.0043, 0.0058, 0.0046,
00087                                                                  0.0052, 0.0040, 0.0042, 0.0041, 0.0040, 0.0041,
00088                                                                  0.0046, 0.0041, 0.0043, 0.0067, 0.0043, 0.0098};
00089                                                                    
00090         const double etamax = 2.47;
00091         const double etacrack[2] = {1.37,1.52};
00092 
00093     if ( fabs(ele_eta) > etamax || (fabs(ele_eta) > etacrack[0] && fabs(ele_eta) < etacrack[1]) )  // check forward, crack regions
00094 
00095         return 1.0;       
00096 
00097     else {           
00098         
00099         for (int i=17; i>=0; i--){    // find eta index
00100             if ( ele_eta > etabins[i] ) {
00101                 etaI = i;
00102                 break;
00103             }
00104         }
00105 
00106         return errmatrix[etaI];
00107 
00108     } //else
00109 
00110     return 0;
00111 
00112 }
00113 
00114 #endif

Generated on Thu Jun 30 11:40:04 2011 for manTreeSFrame by  doxygen 1.4.7