{ TFile * file = TFile::Open("../DimuonStudy-root/TPout_GHI_efmu4efmu4_CombComb_staco_ALL.root"); TFile * fileMC = TFile::Open("../DimuonStudy-root/TPout_GHI_efmu4efmu4_CombComb_staco_MC.root"); TFile * file0 = TFile::Open("../DimuonStudy-root/PlotsEffJpsi_Data.root"); TFile * file0MC = TFile::Open("../DimuonStudy-root/PlotsEffJpsi_MC_Weight_new.root"); // TFile * file3 = TFile::Open("../TPout_EF_EFMu6EFMu10_new_CombComb.root"); TFile *outfile= new TFile("prova.root", "RECREATE"); /* file->cd(); TGraphAsymmErrors* heff = new TGraphAsymmErrors(); heff->BayesDivide(h_pt_num_ba,h_pt_den_ba); TGraphAsymmErrors* heffE = new TGraphAsymmErrors(); heffE->BayesDivide(h_pt_num_ec,h_pt_den_ec); */ 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.,22.,1.1); hr->GetXaxis()->SetTitle("#font[42]{p_{T} (GeV)}"); hr->GetYaxis()->SetTitle("efficiency"); //c1->Divide(1,2); // c1->cd(1); heff_allMC->SetLineColor(2); heff_allMC->SetMarkerColor(2); heff_allMC->SetFillColor(2); heff_allMC->SetMarkerStyle(24); heff_allMC->SetFillStyle(3001); heff_allMC->Draw("e3"); file->cd(); heff_all->SetLineColor(2); heff_all->SetMarkerColor(2); heff_all->SetFillColor(3); heff_all->SetMarkerStyle(24); heff_all->SetFillStyle(3001); heff_all->Draw("P"); file0MC->cd(); NoJpsiEff_ptTrig_All->SetLineColor(4); NoJpsiEff_ptTrig_All->SetMarkerColor(4); NoJpsiEff_ptTrig_All->SetMarkerStyle(22); NoJpsiEff_ptTrig_All->SetFillStyle(3001); NoJpsiEff_ptTrig_All->SetFillColor(4); NoJpsiEff_ptTrig_All->Draw("e3"); file0->cd(); Eff_ptTrig_All->SetLineColor(4); Eff_ptTrig_All->SetMarkerColor(4); Eff_ptTrig_All->SetMarkerStyle(22); Eff_ptTrig_All->Draw("P"); TLegend *tleg = new TLegend(0.55,0.25,0.9,0.35); tleg->SetFillColor(0); tleg->AddEntry(heff_allMC,"MC: efmu4","F"); tleg->AddEntry(heff_all,"DATA G-H-I: efmu4","pl"); file0MC->cd(); tleg->AddEntry(NoJpsiEff_ptTrig_All,"MC: Eff_ptTrig_All","F"); file0->cd(); tleg->AddEntry(Eff_ptTrig_All,"DATA G-H-I:Eff_ptTrig_All","pl"); tleg->Draw(); c3->Print("TurnOn_efmu4-dimu_periodGHI_ALL_data-MC.eps"); ////////////////////////// ////////// TCanvas *c1 = new TCanvas("c1","",10,10,700,500); TH1F *hr = c1->DrawFrame(0.,0.,22.,1.1); hr->GetXaxis()->SetTitle("#font[42]{p_{T} (GeV)}"); hr->GetYaxis()->SetTitle("efficiency"); heffMC->SetLineColor(2); heffMC->SetMarkerColor(2); heffMC->SetFillColor(2); heffMC->SetMarkerStyle(24); heffMC->SetFillStyle(3001); heffMC->Draw("e3"); file->cd(); heff->SetLineColor(2); heff->SetMarkerColor(2); heff->SetFillColor(3); heff->SetMarkerStyle(24); heff->SetFillStyle(3001); heff->Draw("P"); file0MC->cd(); NoJpsiEff_ptTrig_Barrel->SetLineColor(4); NoJpsiEff_ptTrig_Barrel->SetMarkerColor(4); NoJpsiEff_ptTrig_Barrel->SetMarkerStyle(22); NoJpsiEff_ptTrig_Barrel->SetFillStyle(3001); NoJpsiEff_ptTrig_Barrel->SetFillColor(4); NoJpsiEff_ptTrig_Barrel->Draw("e3"); file0->cd(); Eff_ptTrig_Barrel->SetLineColor(4); Eff_ptTrig_Barrel->SetMarkerColor(4); Eff_ptTrig_Barrel->SetMarkerStyle(22); Eff_ptTrig_Barrel->Draw("P"); TLegend *tleg = new TLegend(0.55,0.25,0.9,0.35); tleg->SetFillColor(0); tleg->AddEntry(heffMC,"MC: efmu4","F"); tleg->AddEntry(heff,"DATA G-H-I: efmu4","pl"); file0MC->cd(); tleg->AddEntry(NoJpsiEff_ptTrig_Barrel,"MC: Eff_ptTrig_All","F"); file0->cd(); tleg->AddEntry(Eff_ptTrig_Barrel,"DATA G-H-I:Eff_ptTrig_All","pl"); tleg->Draw(); c1->Print("TurnOn_efmu4-dimu_periodGHI_barrel_data-MC.eps"); /////ENDCAP TCanvas *c2 = new TCanvas("c2","",10,10,700,500); TH1F *hr = c2->DrawFrame(0.,0.,22.,1.1); hr->GetXaxis()->SetTitle("#font[42]{p_{T} (GeV)}"); hr->GetYaxis()->SetTitle("efficiency"); heffEMC->SetLineColor(2); heffEMC->SetMarkerColor(2); heffEMC->SetFillColor(2); heffEMC->SetMarkerStyle(24); heffEMC->SetFillStyle(3001); heffEMC->Draw("e3"); file->cd(); heffE->SetLineColor(2); heffE->SetMarkerColor(2); heffE->SetFillColor(3); heffE->SetMarkerStyle(24); heffE->SetFillStyle(3001); heffE->Draw("P"); file0MC->cd(); NoJpsiEff_ptTrig_Endcap->SetLineColor(4); NoJpsiEff_ptTrig_Endcap->SetMarkerColor(4); NoJpsiEff_ptTrig_Endcap->SetMarkerStyle(22); NoJpsiEff_ptTrig_Endcap->SetFillColor(4); NoJpsiEff_ptTrig_Endcap->SetFillStyle(3001); NoJpsiEff_ptTrig_Endcap->Draw("e3"); file0->cd(); Eff_ptTrig_Endcap->SetLineColor(4); Eff_ptTrig_Endcap->SetMarkerColor(4); Eff_ptTrig_Endcap->SetMarkerStyle(22); Eff_ptTrig_Endcap->Draw("P"); TLegend *tleg = new TLegend(0.55,0.25,0.9,0.35); tleg->SetFillColor(0); tleg->AddEntry(heffEMC,"MC: efmu4","F"); tleg->AddEntry(heffE,"DATA G-H-I: efmu4","pl"); file0MC->cd(); tleg->AddEntry(NoJpsiEff_ptTrig_Endcap,"MC: Eff_ptTrig_All","F"); file0->cd(); tleg->AddEntry(Eff_ptTrig_Endcap,"DATA G-H-I:Eff_ptTrig_All","pl"); tleg->Draw(); c2->Print("TurnOn_efmu4-dimu_periodGHI_endcap_data-MC.eps"); outfile->cd(); heff->Write("heffB"); heffE->Write("heffE"); heff_all->Write("heffAll"); outfile->Write(); outfile->Close(); }