{ gStyle->SetOptFit(1); gStyle->SetStatY(0.95); gStyle->SetStatX(0.90); gStyle->SetStatW(0.2); gStyle->SetStatH(0.15); gStyle->SetFitFormat("2.2e"); TH1F *histo = new TH1F(); histo->SetDefaultSumw2(); TFile *histo_file = new TFile("histos.root"); histo = (TH1F*)histo_file->Get("h_e2L_R07_fakerate_pt")->Clone(); /// histo->Divide(histo_file.Get("h_e1L_R13_fakerate_pt")->Clone()); histo->SetMarkerStyle(21); histo->SetMarkerSize(1.5); TCanvas *cP = new TCanvas("canvas","canvas",700,600); cP->SetRightMargin(0.1); cP->SetFillColor(kWhite); cP->SetTopMargin(0.05); cP->SetBottomMargin(0.20); TF1 *f1 = new TF1("f1","pol0",0,100); histo->Draw("pe"); histo->Fit("f1","S","same",25,100); f1->SetLineColor(kRed+1); f1->Draw("same"); histo->SetMaximum(2); histo->GetYaxis()->SetTitle("Ratio 2L/1L"); histo->GetYaxis()->CenterTitle(); }