void muidll1eff() { gStyle->SetOptFit(11); gStyle->SetOptStat(0); double low = 0.8; double high = 1.0; double binwidth = 0.01; int nbins = (int) ((high - low)/binwidth + 0.5); nbins++; double hlow = low - binwidth/2; double hhigh = high + binwidth/2; cout << " nbins " << nbins << " hlow " << hlow << " hhigh " << hhigh << endl; TH1F *h3 = new TH1F("h3","3 and 4, out of 5",nbins,hlow,hhigh); TH1F *h4 = new TH1F("h4","3 and 4, out of 5",nbins,hlow,hhigh); for (int i = 0; iFill(eff, result3); h4->Fill(eff, result4); } // draw h3->GetXaxis()->SetTitle("MUID 2-pack eff."); h3->SetLineColor(4); h3->SetMarkerColor(4); h3->SetMarkerStyle(3); h4->SetLineColor(2); h4->SetMarkerColor(2); h4->SetMarkerStyle(30); h3->Draw("p"); h4->Draw("p same"); TLegend *leg = new TLegend(0.6,0.2,0.8,0.4); leg->AddEntry("h3","3 out of 5","p"); leg->AddEntry("h4","4 out of 5","p"); leg->Draw(); c1->Modified(); c1->SaveAs("muidll1eff.gif"); h3->Clone("h3_clone"); h3_clone->SetTitle("Eff. diff: for 3 - 4"); h3_clone->Add(h4,-1); h3_clone->SetLineColor(1); h3_clone->GetXaxis()->SetTitle("MUID 2-pack eff."); h3_clone->Draw(); c1->SaveAs("muidll1eff_diff.gif"); }