• Main Page
  • Namespaces
  • Classes
  • Files
  • File List
  • File Members

/Users/jmonk/Physics/ForIA/src/AnalysisTools/EnergyRescaler.cxx

Go to the documentation of this file.
00001 
00002 #include "ForIA/AnalysisTools/EnergyRescaler.hh"
00003 
00004 #include <vector>
00005 #include <iostream>
00006 #include <fstream>
00007 
00008 #include <string>
00009 #include <cstdlib>
00010 #include <iomanip>
00011 #include <cmath>
00012 #include <cctype>
00013 
00014 
00015 using namespace std;
00016 
00017 
00019 EnergyRescaler::EnergyRescaler()
00020 {
00021 
00022    //default seed
00023    SetRandomSeed();
00024   
00025 }
00026 
00027 
00028 //destructor
00029 EnergyRescaler::~EnergyRescaler()
00030 {
00031 
00032 
00033 }
00034 
00035 void EnergyRescaler::SetRandomSeed( unsigned seed){
00036 
00037    m_random3.SetSeed(seed);
00038 
00039 }
00040 
00041   
00042 bool EnergyRescaler::readCalibConstants(std::string fname)
00043 { 
00044 
00045    
00046    if( corrVec.size()) {
00047       std::cout<<" WARNING having already  "<<corrVec.size()<<"  corrections "<<std::endl;
00048       corrVec.clear();
00049 
00050    }
00051 
00052    
00053    std::ifstream infile; 
00054   
00055    infile.open(fname.c_str()); 
00056 
00057 
00058    if(!infile.good()) 
00059    { 
00060       cout<<"CANT OPEN CUT FILE " << fname <<" GOING TO EXIT"<<endl; 
00061       exit(1); 
00062    }     
00063    
00064    std::cout<<"READING FILE  "<< fname<<std::endl;
00065 
00066    calibMap myMap;
00067 
00068 
00069    while( !infile.eof() )
00070    {
00071 
00072       double eta=-10.,etaErr=-10.,  phi=-10., phiErr=-10., alpha=-100., err=-100.;
00073 
00074      
00075 
00076       infile >>eta>>etaErr>>phi>> phiErr>>alpha>>err;
00077       if( !infile.good()  ) break; 
00078 
00079       myMap.eta= eta;
00080       myMap.etaBinSize =etaErr;
00081       myMap.phi = phi;
00082       myMap.phiBinSize = phiErr;
00083       myMap.alpha = alpha;
00084       myMap.alphaErr = err;
00085      
00086       corrVec.push_back(myMap);
00087 
00088 
00089    }
00090   
00091 
00092 
00093    return true; 
00094 } 
00095  
00096 
00097 double EnergyRescaler::applyEnergyCorrection(double eta, double phi, double energy, double et,  int value, std::string ptype)
00098 { 
00099  
00101    //if(corr_version!="2010")return energy;
00102 
00103    double corrEnergy=-999.0;
00104    
00105    if(corrVec.size()==0)
00106    {
00107       std::cout<<"NO CORRECTIONS EXISTS, PLEASE EITHER SUPPLY A CORRECTION FILE OR USE THE DEFAULT CORRECTIONS"<<std::endl;
00108    }
00109 
00110    for (unsigned int i=0; i< corrVec.size(); i++)
00111    {
00112 
00113       if( 
00114          eta>=( corrVec.at(i).eta - corrVec.at(i).etaBinSize/2.) && eta< ( corrVec.at(i).eta+corrVec.at(i).etaBinSize/2.)  &&
00115          phi>=( corrVec.at(i).phi - corrVec.at(i).phiBinSize/2.) && phi< ( corrVec.at(i).phi+corrVec.at(i).phiBinSize/2.) 
00116          ) 
00117       { 
00118 
00119          
00120         
00121          for(std::string::iterator p = ptype.begin(); ptype.end() != p; ++p)
00122          *p = toupper(*p);
00123 
00124 
00125          double er_up=-99,er_do=0; 
00126          double scale=0.;
00127 
00128 
00129          switch (value)
00130          {
00131             default:
00132             {
00133                scale=corrVec.at(i).alpha;
00134                break;
00135             }
00136             case NOMINAL:
00137             {
00138                scale=corrVec.at(i).alpha;
00139              
00140                break;
00141             }
00142             case ERR_UP:
00143             {
00144                scale=corrVec.at(i).alpha;
00145                getError(eta,et, er_up, er_do, ptype);
00146                scale+=er_do;
00147              
00148                break;
00149             }
00150             case ERR_DOWN:
00151             {
00152                scale=corrVec.at(i).alpha;
00153                getError(eta,et, er_up, er_do, ptype);
00154                scale+=er_up;
00155             
00156                break;
00157             }
00158          }
00159 
00160         
00161 
00162          corrEnergy =  energy/(1.+ scale);
00163 
00164          // std::cout<<" eta : "<<eta <<" uncorrected energy : "<<    energy <<" corr energy : "<< corrEnergy<<" scale : "<< corrVec.at(i).alpha <<endl;
00165          break;
00166       }
00167    }
00168 
00169    if( corrEnergy==-999.)return energy;
00170    else return corrEnergy;
00171 
00172 } 
00173 
00174 
00175 
00176 double EnergyRescaler::getSmearingCorrection(double eta, double energy, int value, bool mc_withCT, std::string corr_version)
00177 {
00178   //=====================================
00179   //bins definition:
00180   //=====================================
00181   static const int nbins=6;
00182   static double boundaries[nbins+1]={0,0.6,1.37,1.52,2.47,3.2,4.9};
00183   
00184   //===================================== 
00185   //default MC parameters
00186   //=====================================
00187   static  double Smc[nbins]={0.10,0.15,0.20,0.15,0.30,0.30};
00188   static  double Smc_er=0.;
00189   static  double Cmc=0.007;
00190 
00191   //=====================================
00192   //constant term measured in data 
00193   //=====================================
00194   //2010 
00195   static  double Cdata_nominal[nbins]={0.};
00196   static  double Cdata_erup[nbins]={0.};
00197   static  double Cdata_erdo[nbins]={0.};
00198 
00199   static double Cdata_nominal_2011[nbins]={0.011,0.011,0.018,0.018,0.06,0.02};  
00200   static double Cdata_erup_2011[nbins]={0.005,0.005,0.006,0.006,0.02,0.02};  
00201   static double Cdata_erdo_2011[nbins]={0.006,0.006,0.006,0.006,0.02,0.024}; 
00202   
00203   static double Cdata_nominal_2010[nbins]={0.011,0.011,0.018,0.018,0.04,0.02};
00204   static double Cdata_erup_2010[nbins]={0.005,0.005,0.006,0.006,0.011,0.010};
00205   static double Cdata_erdo_2010[nbins]={0.006,0.006,0.006,0.006,0.011,0.016}; 
00206 
00207   
00208   if(corr_version!="2010"){
00209  
00210      for(int i=0; i<nbins; i++){
00211         Cdata_nominal[i]= Cdata_nominal_2011[i];
00212         Cdata_erup[i]=Cdata_erup_2011[i];
00213         Cdata_erdo[i]=Cdata_erdo_2011[i];
00214      }
00215 
00216 
00217   }else{
00218      for(int i=0; i<nbins; i++){
00219      Cdata_nominal[i]= Cdata_nominal_2010[i];
00220      Cdata_erup[i]= Cdata_erup_2010[i];
00221      Cdata_erdo[i]= Cdata_erdo_2010[i];
00222      }
00223   }
00224 
00225  
00226 //  for(int i=0;i<nbins;i++)cout<<"nom : "<< Cdata_nominal[i]<<"  "<<Cdata_erup[i]<<"  "<< Cdata_erdo[i]<<endl;
00227 
00228   //=====================================
00229   //compute Cdata +/- error  and select the eta bin
00230   //=====================================
00231   double Cdata_do[nbins];
00232   double Cdata_up[nbins];
00233   int bin =-1;
00234   for(int i=0;i<nbins;i++)
00235     {
00236       if(fabs(eta)>boundaries[i] && fabs(eta)<boundaries[i+1])
00237         {
00238           bin=i;
00239         }
00240       Cdata_do[i]=Cdata_nominal[i]-Cdata_erdo[i];
00241       Cdata_up[i]=Cdata_nominal[i]+Cdata_erup[i];
00242     }
00243 
00244   //=====================================
00245   //choose which value to use
00246   //=====================================
00247   double* Cdata;
00248   switch (value)
00249     {
00250     default:
00251       {
00252         Cdata=Cdata_nominal;
00253         break;
00254       }
00255     case NOMINAL:
00256       {
00257         Cdata=Cdata_nominal;
00258         break;
00259       }
00260     case ERR_UP:
00261       {
00262         Cdata=Cdata_up;
00263         break;
00264       }
00265     case ERR_DOWN:
00266       {
00267         Cdata=Cdata_do;
00268         break;
00269       }
00270     }
00271 
00272   //=====================================
00273   //Smearing procedure
00274   //=====================================
00275 
00276   double sigma2 = std::pow(Cdata[bin]*energy,2) + std::pow(Smc[bin]*(1+Smc_er)*std::sqrt(energy),2) - std::pow(Smc[bin]*std::sqrt(energy),2);  
00277   if (mc_withCT==true) sigma2= sigma2-std::pow(Cmc*energy,2);
00278   
00279   //Smearing procedure for Ashfaq
00280   //  Smc_er=0.2;
00281   //sigma2=std::pow(Smc[bin]*(1+Smc_er)*std::sqrt(energy),2) - std::pow(Smc[bin]*std::sqrt(energy),2);
00282 
00283   if(sigma2<=0) return 1;
00284   
00285   double sigma = sqrt(sigma2);
00286   //double DeltaE0 = gRandom->Gaus(0,sigma);
00287   double DeltaE0 = m_random3.Gaus(0,sigma);
00288 
00289   double cor0=(energy+DeltaE0)/energy;
00290   
00291   return cor0;
00292   
00293 }
00294 
00295 
00296 void EnergyRescaler::getError(double cl_eta,double cl_et, double &er_up, double &er_do, std::string ptype,bool withXMAT,bool withPS)
00297 {
00298   // Quick and dirty
00299   // Need to optimized
00300 
00301   er_up=-1;
00302   er_do=-1;
00303 
00304   static const int nbins=8;
00305   static double boundaries[nbins+1]={0,0.6,1.00,1.37,1.52,1.8,2.47,3.2,4.9};
00306 
00307   //systematics 
00308   static double stat[nbins]               ={0.0010, 0.0020, 0.0020, 777, 0.0020, 0.0020, 0.005, 0.01};
00309   static double sys_mcclosure[nbins]      ={0.0010, 0.0010, 0.0010, 777, 0.0010, 0.0010, 0.002, 0.002};
00310   static double sys_comparison[nbins]     ={0.0010, 0.0010, 0.0010, 777, 0.0010, 0.0010, 0.01, 0.008}; 
00311   static double sys_pileup[nbins]         ={0.0010, 0.0010, 0.0010, 777, 0.0010, 0.0010, 0.001, 0.001}; //check forward? 
00312   static double sys_medium2tight_up[nbins]={0.0010, 0.0010, 0.0010, 777, 0.0020, 0.0020, 0,0};
00313   static double sys_loose2tight_forward[nbins]    ={0.0000, 0.0000, 0.0000, 777, 0.0000, 0.0000, 0.012, 0.01};
00314 
00315   static double sys_masscut[nbins]        ={0.0010, 0.0010, 0.0010, 777, 0.0020, 0.0020, 0.002, 0.006};
00316   static double sys_elecLin[nbins]        ={0.0010, 0.0010, 0.0010, 777, 0.0010, 0.0010, 0.001, 0.001};//forward?
00317   static double sys_xtalkE1[nbins]        ={0.0010, 0.0010, 0.0010, 777, 0.0010, 0.0010, 0.001, 0.001};//forward?
00318   static double sys_lowpt  [nbins]        ={0.0100, 0.0100, 0.0100, 777, 0.0100, 0.0100, 0.01,  0.01};
00319   static double sys_HV     [nbins]        ={0.0000, 0.0000, 0.0000, 777, 0.0000, 0.0000, 0.006, 0.008};
00320 
00321   static double PS_B[nbins]={-0.00025312, -0.0011569, -0.00211677, 777, -0.00175762*2, 000, 000, 000};
00322 //  static double PS_A[nbins]={ 0.00187341, 0.00840421,  0.016034  , 777,   0.0127718*2, 000, 000, 000};
00323 
00324   //Material electron
00325  
00326   static double elec_XMAT_a[nbins] = {-0.0083,  -0.013, -0.025, 777, -0.023, -0.019, -0.042, -0.014  };
00327   static double elec_XMAT_b[nbins] = {-0.055, -0.019, -0.014, 777, -0.026, -0.019, -0.041, -0.016};
00328   static double elec_XMAT_MAX[nbins]={  0.003,  0.008,  0.015,  777,   0.010,   0.01  ,0.01, 0.01};  
00329 
00330  //Material photon
00331   static double pho_XMAT_MAX[nbins]={  0.003,  0.005,  0.010,  777,   0.010,   0.01  ,0, 0.} ;
00332  static double pho_PS_shift[nbins] ={  0.001,  0.002,  0.003,  777,   0.002*2,   0.000  ,0, 0.} ;
00333 
00334   int bin =-1;
00335   for(int i=0;i<nbins;i++)
00336     {
00337       if(fabs(cl_eta)>=boundaries[i] && fabs(cl_eta)<boundaries[i+1])
00338         {
00339           bin=i;
00340           break;
00341         }
00342     }
00343   if(bin==-1) return;
00344 
00345   //==================================
00346   //crack region
00347   //==================================
00348   if(bin==3)
00349     { 
00350       er_up=0.05;
00351       er_do=-0.05;
00352       return;
00353     }
00354 
00355   //==================================
00356   //PS
00357   //==================================
00358   double PS_up=0,PS_do=0;
00359   
00360   if(withPS==true)
00361     {          
00362       if(abs(cl_eta)<1.8)
00363         {
00364           double shift=0;
00365           if(ptype=="UNCONVERTED_PHOTON" || ptype =="CONVERTED_PHOTON")
00366             {
00367           shift=pho_PS_shift[bin];
00368             }
00369           double PS=PS_B[bin]*(log(cl_et)-log(40))-shift;
00370           if(PS>=0)
00371             {
00372               PS_up=PS;
00373               PS_do=-PS;
00374             }
00375           else
00376             {
00377               PS_up=-PS;
00378               PS_do=PS;
00379             }
00380         }
00381       
00382     }
00383   
00384 
00385   //==================================
00386   //material
00387   //==================================
00388   double XMat_up = 0;
00389   double XMat_do = 0;
00390   
00391   if(withXMAT==true)
00392     {
00393       
00394       if(ptype=="ELECTRON")
00395         {
00396           double xmat= 0;
00397 
00398           //      cout<<elec_XMAT_a[bin]<<" "<<elec_XMAT_b[bin] <<endl;
00399           xmat= elec_XMAT_a[bin]*exp(cl_et* elec_XMAT_b[bin])+elec_XMAT_MAX[bin];
00400           //alpha = a * exp(Pt * b) + c
00401           
00402           if(xmat>0)
00403             {
00404               XMat_up=xmat;
00405             }
00406           else  XMat_do=xmat;
00407 
00408 //        if(XMat_up>elec_XMAT_MAX[bin])
00409 //          XMat_up=elec_XMAT_MAX[bin]; 
00410           
00411         }
00412 
00413 
00414 
00415       
00416       else if(ptype=="UNCONVERTED_PHOTON" || ptype =="CONVERTED_PHOTON")
00417         //else if(ptype=="PHOTON")
00418         {      
00419           XMat_up=pho_XMAT_MAX[bin];
00420           XMat_do=0;
00421           //      cout<<XMat_up<<endl;
00422         }                 
00423     }
00424   //==================================
00425   //lowpt
00426   //==================================
00427   double lowpt=0;
00428   if(cl_et<20)
00429     {
00430       lowpt =sys_lowpt[bin]/(10-20)*(cl_et-20);
00431     }
00432 
00433   er_up= sqrt(stat[bin]*stat[bin]+
00434               sys_mcclosure[bin]*sys_mcclosure[bin]+
00435               sys_comparison[bin]*sys_comparison[bin]+
00436               sys_pileup[bin]*sys_pileup[bin]+
00437               sys_medium2tight_up[bin]*sys_medium2tight_up[bin]+
00438               sys_loose2tight_forward[bin]*sys_loose2tight_forward[bin]+
00439               sys_masscut[bin]*sys_masscut[bin]+
00440               sys_HV[bin]*sys_HV[bin]+
00441               sys_elecLin[bin]*sys_elecLin[bin]+
00442               sys_xtalkE1[bin]*sys_xtalkE1[bin]+
00443               PS_up*PS_up+
00444               XMat_up*XMat_up+
00445               lowpt*lowpt);
00446   
00447   er_do= -sqrt(stat[bin]*stat[bin]+
00448                sys_mcclosure[bin]*sys_mcclosure[bin]+
00449                sys_comparison[bin]*sys_comparison[bin]+
00450                sys_pileup[bin]*sys_pileup[bin]+
00451                sys_loose2tight_forward[bin]*sys_loose2tight_forward[bin]+
00452                sys_masscut[bin]*sys_masscut[bin]+
00453                sys_HV[bin]*sys_HV[bin]+
00454                sys_elecLin[bin]*sys_elecLin[bin]+
00455                sys_xtalkE1[bin]*sys_xtalkE1[bin]+
00456                PS_do*PS_do+
00457                XMat_do*XMat_do+
00458                lowpt*lowpt);
00459   //   er_up=XMat_up;
00460   //   er_do=XMat_do;
00461   
00462   return;
00463 }
00464 
00465 
00466 
00467 
00468 
00470 bool  EnergyRescaler::useDefaultCalibConstants( std::string corr_vers)
00471 {
00472    
00473    corr_version=corr_vers;
00474 
00475    //if(corr_version!="2010")return true;
00476 
00477    const int netaBins=58;
00478    const int nphiBins=58;
00479    
00481    const int netaBinsFor2011=32;
00482    const int nphiBinsFor2011=32;
00483    
00484   
00485    double m_2pi = 2.*acos(-1.); 
00486    //cout<<" pi : "<<acos(-1.)<<"  M_PI : "<<M_PI<<" 2pi : "<<m_2pi<<endl;
00487    
00488 
00489   
00490 
00491    if( corrVec.size()) {
00492       std::cout<<" WARNING having already  "<<corrVec.size()<<"  corrections "<<std::endl;
00493       corrVec.clear();
00494 
00495    }
00496    
00497 
00498    
00499 
00500   
00501    double eta_tmp[netaBins]={   
00502       -4.45, -3.60, -3.00, -2.65, -2.435, -2.35, -2.25, -2.15, -2.05, -1.95, -1.85,     -1.75,  -1.65,
00503       -1.56, -1.445,    -1.335, -1.25, -1.15,   -1.05,  -0.95,  -0.85,  -0.75,  -0.65,  -0.55,  -0.45,  -0.35,
00504       -0.25, -0.15,     -0.05,  0.05,  0.15,    0.25,   0.35,   0.45,   0.55,   0.65,   0.75,   0.85,   0.95,
00505        1.05, 1.15,      1.25,   1.335, 1.445,   1.56,   1.65,   1.75,   1.85,   1.95,   2.05,   2.15,   2.25,
00506        2.35,    2.435,   2.65,  3.00,   3.60,   4.45
00507          };
00508    
00509 
00510    
00511 
00512 
00513     double etaBinWidth_tmp[netaBins]= {
00514        0.9, 0.8, 0.4, 0.3, 0.07,        0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.08,   0.15,   0.07,   0.1,    0.1,    0.1,            0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,            0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.1,    0.07,   0.15,   0.08,   0.1,    0.1,    0.1,    0.1,            0.1,    0.1,    0.1,    0.1,    0.07,    0.3,   0.4,    0.8,    0.9 };
00515 
00516    
00517     
00518 
00519    
00520     double phi_tmp[nphiBins]={
00521         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0,        0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00522         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,0, 0, 0, 0, 0, 0, 0, 0, 0,  0, 0 };
00523 
00524     double phiBinWidth_tmp[nphiBins]={
00525        m_2pi, m_2pi, m_2pi, m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,
00526        m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi, m_2pi,m_2pi,m_2pi,m_2pi,
00527        m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi, m_2pi,
00528        m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,
00529        m_2pi,m_2pi, m_2pi,m_2pi,m_2pi,m_2pi,m_2pi, m_2pi, m_2pi, m_2pi, m_2pi, m_2pi };
00530 
00531 
00532     
00533     double alpha_tmp[netaBins]= {
00534     0.046962, 0.044332, -0.007777,-0.045341, -0.053683,-0.005040,0.003357,0.003830,0.016857,0.012810,
00535     0.008882,-0.016864,-0.021280,-0.011215,-0.008958,-0.010248, 0.005199,0.007815,-0.000701,0.003837,0.003222,
00536     -0.004017,-0.005908,-0.009560,-0.005382,-0.012158,-0.005060,-0.008274, -0.006701,-0.002734,-0.012920, 
00537     -0.010972,-0.006823,-0.007234,-0.002612,-0.004301,0.001580,-0.001986,-0.001306,0.005748, 0.002906, 
00538     0.001381,-0.001584,0.000799,-0.002511,-0.030902,-0.016416,-0.004976,0.002408,0.018706,-0.004309,-0.002673,
00539     -0.001735,-0.050173, -0.034703,     -0.003296,      0.047351,       0.028374
00540    };
00541 
00542    
00543 
00544    
00545 
00546    double alphaError_tmp[netaBins]={ 
00547       0.019646, 0.011500, 0.008761, 0.009514, 0.008341,0.006345,0.005522,0.005089,0.005387,0.005861,
00548       0.005821,0.005119,0.006227,0.009148,0.003920,0.004309,0.002929,  0.003882,0.004054,0.003716,0.003673,
00549       0.003832,0.003275,0.002075,0.004004,0.002497,0.003182,0.002512,0.003974,0.002302, 0.003670,0.003322,
00550       0.003978,0.002164,0.001984,0.002093,0.002372,0.003843,0.004138,0.004277,0.003003,0.004690,0.005480,
00551       0.006306, 0.007338,0.005939,0.004472,0.004535,0.005453,0.008538,0.004554,0.003382,0.005504,0.007577,
00552       0.010095, 0.009122,       0.013400,       0.02588
00553    };
00554 
00555 
00557    double etaFor2011_tmp[netaBinsFor2011]={ 
00558       -4.05,    -3.00,  -2.65,  -2.385, -2.2,   -2.00,  -1.8,   -1.61,  -1.445, -1.285, -1.1,   -0.9,   -0.7,   -0.5,   -0.3,   -0.1,   0.1,    0.3,    0.5,    0.7,    0.9,    1.1,    1.285,  1.445,  1.61,   1.8,    2.0,    2.2,    2.385,  2.65,   3.0,    4.05
00559    };
00560 
00561     double etaBinWidthFor2011_tmp[netaBinsFor2011]= {
00562        1.7,     0.4,    0.3,  0.17,     0.2,    0.2,    0.2,    0.18,   0.15,   0.17,   0.2,    0.2,    0.2,    0.2,    0.2,    0.2,    0.2,    0.2,    0.2,    0.2,    0.2,    0.2,    0.17,   0.15,   0.18,   0.2,    0.2,    0.2,    0.17,   0.3,    0.4,    1.7
00563     };
00564 
00565     double phiFor2011_tmp[nphiBinsFor2011]={
00566        0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
00567         0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
00568         };
00569 
00570     double phiBinWidthFor2011_tmp[nphiBinsFor2011]={
00571        m_2pi, m_2pi, m_2pi, m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,
00572        m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi, m_2pi, m_2pi, m_2pi, m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,
00573        m_2pi,m_2pi,m_2pi,m_2pi,m_2pi,m_2pi
00574        };
00575 
00576 
00577     
00578     double alphaFor2011_tmp[netaBinsFor2011]= {
00579        0.01767670,
00580        0.01193680,
00581        0.02863680,
00582        -0.00182836,
00583        0.00379822,
00584        0.00949851,
00585        0.00388223,
00586        -0.00630638,
00587        -0.01459190,
00588        0.00191748,
00589        0.00120518,
00590        -0.00116847,
00591        0.00316491,
00592        0.00534383,
00593        -0.00259050,
00594        -0.00303995,
00595        -0.00114055,
00596        -0.00152093,
00597        0.00346042,
00598        0.00316020,
00599        -6.51986e-05,
00600        0.00237845,
00601        0.00391017,
00602        -0.01056940,
00603        -0.01190480,
00604        -0.00177316,
00605        -0.00101658,
00606        -0.00430559,
00607        -0.01101630,
00608        0.01681920,
00609        0.01459770,
00610        0.00328200
00611        
00612     };
00613    
00614 
00615     double alphaErrorFor2011_tmp[netaBinsFor2011]={ 
00616       0.00365611,
00617       0.00269144,
00618       0.00253709,
00619       0.00124745,
00620       0.00094802,
00621       0.00094137,
00622       0.00097271,
00623       0.00130736,
00624       0.00170269,
00625       0.00091738,
00626       0.00076709,
00627       0.00072777,
00628       0.00067059,
00629       0.00063910,
00630       0.00064532,
00631       0.00063576,
00632       0.00066304,
00633       0.00064027,
00634       0.00066183,
00635       0.00068352,
00636       0.00075179,
00637       0.00080414,
00638       0.00093506,
00639       0.00167934,
00640       0.00131510,
00641       0.00097932,
00642       0.00095425,
00643       0.00097240,
00644       0.00127444,
00645       0.00258217,
00646       0.00265290,
00647       0.00360700
00648 
00649    };
00650 
00651 
00652 
00653 
00654     calibMap myMap;
00655     
00656     if(corr_version!="2010"){
00657        
00658        for(int i=0; i<netaBinsFor2011; i++){
00659 
00660           //for(int j=0; j<nphiBins; j++){///this should be a 2d array finally
00661           //}
00662 
00663           myMap.eta= etaFor2011_tmp[i];
00664           myMap.etaBinSize =etaBinWidthFor2011_tmp[i];
00665           myMap.alpha = alphaFor2011_tmp[i];
00666           myMap.phi = phiFor2011_tmp[i];
00667           myMap.phiBinSize = phiBinWidthFor2011_tmp[i];
00668           myMap.alphaErr = alphaErrorFor2011_tmp[i];
00669 
00670           corrVec.push_back(myMap);
00671 
00672        }
00673         
00674 
00675     }else{
00676 
00677        
00678        for(int i=0; i<netaBins; i++){
00679 
00680           //for(int j=0; j<nphiBins; j++){///this should be a 2d array finally
00681           //}
00682 
00683           myMap.eta= eta_tmp[i];
00684           myMap.etaBinSize =etaBinWidth_tmp[i];
00685           myMap.alpha = alpha_tmp[i];
00686           myMap.phi = phi_tmp[i];
00687           myMap.phiBinSize = phiBinWidth_tmp[i];
00688           myMap.alphaErr = alphaError_tmp[i];
00689 
00690           corrVec.push_back(myMap);
00691 
00692        }
00693 
00694 
00695     }//if-else
00696 
00697 
00698    return true;
00699 }
00700 
00701 
00702 
00703 bool EnergyRescaler::printMap()
00704 {
00705 
00706    for (unsigned int i=0; i< corrVec.size(); i++)
00707    {
00708       std::cout<<"eta :  "<< corrVec.at(i).eta <<
00709          " etaErr : " <<corrVec.at(i).etaBinSize<<
00710          " phi    :  "<<corrVec.at(i).phi<<
00711          " phiErr :  "<<corrVec.at(i).phiBinSize<<
00712          " alpha  :  "<<corrVec.at(i).alpha<<
00713          " alphaErr : "<<corrVec.at(i).alphaErr<<endl;
00714    }
00715 
00716 
00717    return true;
00718 
00719 }
00720 
00721 
00722 
00723 

Generated on Mon Jul 30 2012 16:56:35 for ForIA by  doxygen 1.7.2