Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:19:24

0001 #include "Settings.h"
0002 void DrawL2(int etabin)
0003 {
0004   gROOT->SetStyle("Plain");
0005   gStyle->SetOptStat(0000);
0006   gStyle->SetOptFit(000); 
0007   gStyle->SetPalette(1);
0008   if (etabin<0 || etabin>=NETA)
0009     {
0010       cout<<"Eta bin must be >=0 and <"<<NETA<<endl;
0011       break;
0012     }
0013   TPaveText *pave = new TPaveText(0.3,0.7,0.5,0.85,"NDC");  
0014   pave->AddText(Version);
0015   pave->AddText(Algorithm);
0016   pave->SetLineColor(0);
0017   pave->SetBorderSize(0);
0018   pave->SetFillColor(0);
0019   pave->SetBorderSize(0);
0020   TGraphErrors *g_EtaCorrection;
0021   TGraph *g_L2Correction;
0022   TCanvas *c_Resp;
0023   TCanvas *c_L2Cor;
0024   TF1 *L2Fit;
0025   TF1 *CorFit;
0026   TFile *rel_f;
0027   char filename[100],name[100];
0028   rel_f = new TFile(L2OutputROOTFilename,"r");
0029   if (!rel_f->IsOpen()) break;
0030   /////////////////////////////// Correction /////////////////////////
0031   sprintf(name,"EtaCorrection");
0032   c_Cor = new TCanvas(name,name,900,700);
0033   sprintf(name,"Correction_EtaBin%d",etabin);
0034   g_EtaCorrection = (TGraphErrors*)rel_f->Get(name);
0035   sprintf(name,"Correction%d",etabin);      
0036   CorFit = (TF1*)g_EtaCorrection->GetFunction(name); 
0037   if (CorFit->GetXmax()>200) 
0038     gPad->SetLogx();
0039   CorFit->SetLineColor(2);
0040   g_EtaCorrection->GetXaxis()->SetTitle("Uncorrected jet p_{T} (GeV)");
0041   g_EtaCorrection->GetYaxis()->SetTitle("Absolute Correction"); 
0042   sprintf(name,"%1.3f<#eta<%1.3f",eta_boundaries[etabin],eta_boundaries[etabin+1]);
0043   g_EtaCorrection->SetTitle(name); 
0044   g_EtaCorrection->SetMarkerStyle(20);
0045   g_EtaCorrection->Draw("AP"); 
0046   pave->Draw();
0047   
0048   /////////////////////////////// L2 correction ///////////////////////// 
0049   sprintf(name,"L2Correction");
0050   c_L2Cor = new TCanvas(name,name,900,700);
0051   sprintf(name,"L2Correction_EtaBin%d",etabin);
0052   g_L2Correction = (TGraph*)rel_f->Get(name);
0053   sprintf(name,"L2Correction%d",etabin);      
0054   L2Fit = (TF1*)g_L2Correction->GetFunction(name);
0055   if (L2Fit->GetXmax()>200) 
0056     gPad->SetLogx(); 
0057   g_L2Correction->SetMinimum(0.3);
0058   g_L2Correction->SetMaximum(1.4);
0059   g_L2Correction->GetXaxis()->SetTitle("Uncorrected jet p_{T} (GeV)");
0060   g_L2Correction->GetYaxis()->SetTitle("Relative Correction");  
0061   sprintf(name,"%1.3f<#eta<%1.3f",eta_boundaries[etabin],eta_boundaries[etabin+1]);
0062   g_L2Correction->SetTitle(name); 
0063   g_L2Correction->Draw("AP");
0064   g_L2Correction->SetMarkerStyle(20);
0065   L2Fit->SetLineColor(2);
0066   pave->Draw();
0067 }
0068 
0069