{ gROOT->Reset(); gStyle->SetOptStat("mr"); TFile f("histos.root"); TH1D *plot_h1_SMbackground_logpdfsproduct_quinter=(TH1D*)f.Get("h1_SMbackground_logpdfsproduct_quinter"); TH1D *plot_h1_SMbackground_logpdfsproduct_quinter_withOSrecditaus=(TH1D*)f.Get("h1_SMbackground_logpdfsproduct_quinter_withOSrecditaus"); TH1D *plot_h1_SMbackground_logpdfsproduct_quinter_div=new TH1D("h1_SMbackground_logpdfsproduct_quinter_div","h1_SMbackground_logpdfsproduct_quinter_div",25,0.,25.); h1_SMbackground_logpdfsproduct_quinter_div->Divide(plot_h1_SMbackground_logpdfsproduct_quinter_withOSrecditaus,plot_h1_SMbackground_logpdfsproduct_quinter,1.,1.,"b"); /* for (int xbin=0;xbinGetNbinsX();xbin++) { double N1=plot_h1_SMbackground_logpdfsproduct_quinter_withOSrecditaus->GetBinContent(xbin+1); double N2=plot_h1_SMbackground_logpdfsproduct_quinter->GetBinContent(xbin+1)-plot_h1_SMbackground_logpdfsproduct_quinter_withOSrecditaus->GetBinContent(xbin+1); if (N1!=0. && N2!=0.){ double error=(double)h1_SMbackground_logpdfsproduct_quinter_div->GetBinContent(xbin+1)*(1.-(double)h1_SMbackground_logpdfsproduct_quinter_div->GetBinContent(xbin+1))*sqrt((N1+N2)/(N1*N2)); h1_SMbackground_logpdfsproduct_quinter_div->SetBinError(xbin+1,error); } } */ TH1D *plot_h1_combined_logpdfsproduct_quinter=(TH1D*)f.Get("h1_combined_logpdfsproduct_quinter"); TH1D *plot_h1_combined_logpdfsproduct_quinter_withOSrecditaus=(TH1D*)f.Get("h1_combined_logpdfsproduct_quinter_withOSrecditaus"); TH1D *plot_h1_combined_logpdfsproduct_quinter_div=new TH1D("h1_combined_logpdfsproduct_quinter_div","h1_combined_logpdfsproduct_quinter_div",25,0.,25.); h1_combined_logpdfsproduct_quinter_div->Divide(plot_h1_combined_logpdfsproduct_quinter_withOSrecditaus,plot_h1_combined_logpdfsproduct_quinter,1.,1.,"b"); /* for (int xbin=0;xbinGetNbinsX();xbin++) { double N1=plot_h1_combined_logpdfsproduct_quinter_withOSrecditaus->GetBinContent(xbin+1); double N2=plot_h1_combined_logpdfsproduct_quinter->GetBinContent(xbin+1)-plot_h1_combined_logpdfsproduct_quinter_withOSrecditaus->GetBinContent(xbin+1); if (N1!=0. && N2!=0.){ double error=(double)h1_combined_logpdfsproduct_quinter_div->GetBinContent(xbin+1)*(1.-(double)h1_combined_logpdfsproduct_quinter_div->GetBinContent(xbin+1))*sqrt((N1+N2)/(N1*N2)); h1_combined_logpdfsproduct_quinter_div->SetBinError(xbin+1,error); } } */ TCanvas c1("c1","",600,600); h1_SMbackground_logpdfsproduct_quinter_div->SetMarkerStyle(21); h1_SMbackground_logpdfsproduct_quinter_div->SetMarkerSize(0.5); h1_SMbackground_logpdfsproduct_quinter_div->GetYaxis()->SetRangeUser(0,.01); h1_SMbackground_logpdfsproduct_quinter_div->Draw(); c1->Print("h1_SMbackground_logpdfsproduct_quinter_div.eps"); TCanvas c2("c2","",600,600); h1_combined_logpdfsproduct_quinter_div->SetMarkerStyle(21); h1_combined_logpdfsproduct_quinter_div->SetMarkerSize(0.5); h1_combined_logpdfsproduct_quinter_div->GetYaxis()->SetRangeUser(0,.01); h1_combined_logpdfsproduct_quinter_div->Draw(); c2->Print("h1_combined_logpdfsproduct_quinter_div.eps"); }