#include #include #include "Rtypes.h" #include "AtlasUtils.h" // #ifndef __CINT__ #include "AtlasStyle.C" // #endif #include "TCanvas.h" #include "TFile.h" #include "TROOT.h" #include "TH1F.h" #include "TRandom.h" #include "TGraphErrors.h" using namespace std; void plot() { #ifdef __CINT__ gROOT->LoadMacro("AtlasUtils.C"); #endif SetAtlasStyle(); TFile * file = TFile::Open("TPout_test_CombComb_staco_L1MU10.root"); TFile * fileMC = TFile::Open("TPout_test_CombComb_staco_EFMU10.root"); //TFile *outfile= new TFile("prova.root", "RECREATE"); ///////////////DATA TH1F * h_probes_pass_all =(TH1F*) file->Get("hptmsselall"); TH1F * h_probes_all =(TH1F*) file->Get("hptmsall"); TH1F * h_probes_pass =(TH1F*) file->Get("hptmsselb"); TH1F * h_probes =(TH1F*) file->Get("hptmsb"); TH1F * h_probes_pass_ec =(TH1F*) file->Get("hptmssele"); TH1F * h_probes_ec =(TH1F*) file->Get("hptmse"); TGraphAsymmErrors* heff_all = new TGraphAsymmErrors(); heff_all->BayesDivide(h_probes_pass_all,h_probes_all); TGraphAsymmErrors* heff = new TGraphAsymmErrors(); heff->BayesDivide(h_probes_pass,h_probes); TGraphAsymmErrors* heffE = new TGraphAsymmErrors(); heffE->BayesDivide(h_probes_pass_ec,h_probes_ec); ////////////////MC TH1F * h_probes_pass_allMC =(TH1F*) fileMC->Get("hptmsselall"); TH1F * h_probes_allMC =(TH1F*) fileMC->Get("hptmsall"); TH1F * h_probes_passMC =(TH1F*) fileMC->Get("hptmsselb"); TH1F * h_probesMC =(TH1F*) fileMC->Get("hptmsb"); TH1F * h_probes_pass_ecMC =(TH1F*) fileMC->Get("hptmssele"); TH1F * h_probes_ecMC =(TH1F*) fileMC->Get("hptmse"); TGraphAsymmErrors* heff_allMC = new TGraphAsymmErrors(); heff_allMC->BayesDivide(h_probes_pass_allMC,h_probes_allMC); TGraphAsymmErrors* heffMC = new TGraphAsymmErrors(); heffMC->BayesDivide(h_probes_passMC,h_probesMC); TGraphAsymmErrors* heffEMC = new TGraphAsymmErrors(); heffEMC->BayesDivide(h_probes_pass_ecMC,h_probes_ecMC); // ///////////////////// TCanvas *c3 = new TCanvas("c3","",10,10,700,500); TH1F *hr = c3->DrawFrame(0.,0.,50.,1.1); hr->GetXaxis()->SetTitle("#font[42]{p_{T} (GeV)}"); hr->GetYaxis()->SetTitle("efficiency ALL"); //c1->Divide(1,2); // c1->cd(1); file->cd(); heff_all->SetLineColor(1); heff_all->SetMarkerColor(1); heff_all->SetFillColor(3); heff_all->SetMarkerStyle(20); heff_all->SetFillStyle(3001); heff_all->Draw("P"); heff_allMC->SetLineColor(2); heff_allMC->SetMarkerColor(2); heff_allMC->SetFillColor(3); heff_allMC->SetMarkerStyle(22); heff_allMC->SetFillStyle(3001); heff_allMC->Draw("P"); myMarkerText(0.7, 0.40,1,20, "MC 1LMU10 ",1.0); myMarkerText(0.7, 0.35,2,22, "MC EFMU10",1.0); c3->Print("efficienzaplot/efficienzapt_ALL_Data-MC.pdf"); // ////////// TCanvas *c1 = new TCanvas("c1","",10,10,700,500); TH1F *hr = c1->DrawFrame(0.,0.,50.,1.1); hr->GetXaxis()->SetTitle("#font[42]{p_{T} (GeV)}"); hr->GetYaxis()->SetTitle("efficiency BARREL"); heff->SetLineColor(1); heff->SetMarkerColor(1); heff->SetFillColor(3); heff->SetMarkerStyle(20); heff->SetFillStyle(3001); heff->Draw("P"); //fileMC->cd(); heffMC->SetLineColor(2); heffMC->SetMarkerColor(2); heffMC->SetFillColor(3); heffMC->SetMarkerStyle(22); heffMC->SetFillStyle(3001); heffMC->Draw("P"); myMarkerText(0.7, 0.40,1,20, "MC L1MU10",1.0); myMarkerText(0.7, 0.35,2,22, "MC EFMU10",1.0); c1->Print("efficienzaplot/efficienzapt_barrel_Data-MC.pdf"); /////ENDCAP TCanvas *c2 = new TCanvas("c2","",10,10,700,500); TH1F *hr = c2->DrawFrame(0.,0.,50.,1.1); hr->GetXaxis()->SetTitle("#font[42]{p_{T} (GeV)}"); hr->GetYaxis()->SetTitle("efficiency ENDCAP"); //file->cd(); heffE->SetLineColor(1); heffE->SetMarkerColor(1); heffE->SetFillColor(3); heffE->SetMarkerStyle(20); heffE->SetFillStyle(3001); heffE->Draw("P"); //fileMC->cd(); heffEMC->SetLineColor(2); heffEMC->SetMarkerColor(2); heffEMC->SetFillColor(3); heffEMC->SetMarkerStyle(22); heffEMC->SetFillStyle(3001); heffEMC->Draw("P"); myMarkerText(0.7, 0.40,1,20, "MC L1MU10",1.0); myMarkerText(0.7, 0.35,2,22, "MC EFMU10",1.0); c2->Print("efficienzaplot/efficienzapt_endcap_Data-MC.pdf"); /* outfile->cd(); heff->Write("heffB"); heffE->Write("heffE"); heff_all->Write("heffAll"); outfile->Write(); outfile->Close(); */ }