{ TFile * file = TFile::Open("../DimuonStudy-root/TPout_GHI_efmu4efmu4_CombComb_staco_ALL.root"); TFile * file0 = TFile::Open("../DimuonStudy-root/PlotsEffJpsi_Data.root"); TFile * file0MC = TFile::Open("../DimuonStudy-root/PlotsEffJpsi_MC_Weight_new.root"); TFile *outfile= new TFile("Efmu4TurnOn_eta.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); ///////////////////// TCanvas *c3 = new TCanvas("c3","",10,10,700,500); TH1F *hr = c3->DrawFrame(0,0,1.5,1.1); hr->GetXaxis()->SetTitle("#font[42]{#DeltaR}"); hr->GetYaxis()->SetTitle("efficiency"); file0MC->cd(); NoJpsiEff_DeltaR_All->SetLineColor(2); NoJpsiEff_DeltaR_All->SetMarkerStyle(20); NoJpsiEff_DeltaR_All->SetMarkerColor(2); NoJpsiEff_DeltaR_All->SetFillStyle(3001); NoJpsiEff_DeltaR_All->SetFillColor(4); NoJpsiEff_DeltaR_All->Draw("P"); file0->cd(); Eff_DeltaR_All->SetLineColor(4); Eff_DeltaR_All->SetMarkerColor(4); Eff_DeltaR_All->SetMarkerStyle(22); Eff_DeltaR_All->Draw("P"); // TLegend *tleg = new TLegend(0.55,0.25,0.9,0.35); // tleg->SetFillColor(0); // tleg->AddEntry(Eff_DeltaR_All,"Eff_DeltaR_All","pl"); // tleg->Draw(); c3->Print("TurnOn_DimuDeltaR_periodGHI_ALL_data-MCnew.eps"); ////////// TCanvas *c1 = new TCanvas("c1","",10,10,700,500); TH1F *hr = c1->DrawFrame(0,0,1.5,1.1); hr->GetXaxis()->SetTitle("#font[42]{#DeltaR}"); hr->GetYaxis()->SetTitle("efficiency"); file0MC->cd(); NoJpsiEff_DeltaR_Barrel->SetLineColor(2); NoJpsiEff_DeltaR_Barrel->SetMarkerStyle(20); NoJpsiEff_DeltaR_Barrel->SetMarkerColor(2); NoJpsiEff_DeltaR_Barrel->SetFillStyle(3001); NoJpsiEff_DeltaR_Barrel->SetFillColor(4); NoJpsiEff_DeltaR_Barrel->Draw("P"); file0->cd(); Eff_DeltaR_Barrel->SetLineColor(4); Eff_DeltaR_Barrel->SetMarkerColor(4); Eff_DeltaR_Barrel->SetMarkerStyle(22); Eff_DeltaR_Barrel->Draw("P"); // TLegend *tleg = new TLegend(0.55,0.25,0.9,0.35); // tleg->SetFillColor(0); // tleg->AddEntry(Eff_DeltaR_Barrel,"Eff_DeltaR_Barrel","pl"); // tleg->Draw(); c1->Print("TurnOn_DimuDeltaR_periodGHI_barrel_data-MCnew.eps"); /////ENDCAP TCanvas *c2 = new TCanvas("c2","",10,10,700,500); TH1F *hr = c2->DrawFrame(0,0,1.5,1.1); hr->GetXaxis()->SetTitle("#font[42]{#DeltaR}"); hr->GetYaxis()->SetTitle("efficiency"); file0MC->cd(); NoJpsiEff_DeltaR_Endcap->SetLineColor(2); NoJpsiEff_DeltaR_Endcap->SetMarkerStyle(20); NoJpsiEff_DeltaR_Endcap->SetMarkerColor(2); NoJpsiEff_DeltaR_Endcap->SetFillStyle(3001); NoJpsiEff_DeltaR_Endcap->SetFillColor(4); NoJpsiEff_DeltaR_Endcap->Draw("P"); file0->cd(); Eff_DeltaR_Endcap->SetLineColor(4); Eff_DeltaR_Endcap->SetMarkerColor(4); Eff_DeltaR_Endcap->SetMarkerStyle(22); Eff_DeltaR_Endcap->Draw("P"); // TLegend *tleg = new TLegend(0.55,0.25,0.9,0.35); // tleg->SetFillColor(0); // tleg->AddEntry(Eff_DeltaR_Endcap,"Eff_DeltaR_Endcap","pl"); // tleg->Draw(); c2->Print("TurnOn_DimuDeltaR_periodGHI_endcap_data-MCnew.eps"); outfile->cd(); heff->Write("heffB"); heffE->Write("heffE"); heff_all->Write("heffAll"); outfile->Write(); outfile->Close(); }