Пример #1
0
    h_data.GetYaxis().SetTitleSize(0.045)
    h_data.GetXaxis().SetLabelSize(0)  #
    #h_data.GetXaxis().SetTitle("")
    h_data.GetXaxis().SetTitleOffset(5.0)
    hs.Draw("histsame")
    hs_Hct.SetLineWidth(2)
    hs_Hut.SetLineWidth(2)
    hs_stHct.SetLineWidth(2)
    hs_stHut.SetLineWidth(2)
    hs_Hct.Draw("hist same")
    hs_Hut.Draw("hist same")
    hs_stHct.Draw("hist same")
    hs_stHut.Draw("hist same")
    h_data.Draw("psame")
    h_data.Draw("AXIS P SAME")
    h4 = hs.Clone("h4")
    ROOT.SetOwnership(h4, True)

    l.AddEntry(h_data, "Data", "P")
    l.Draw()
    label = TPaveText()
    label.SetX1NDC(gStyle.GetPadLeftMargin())
    label.SetY1NDC(1.0 - gStyle.GetPadTopMargin())
    label.SetX2NDC(1.0 - gStyle.GetPadRightMargin() + 0.03)
    label.SetY2NDC(1.0)
    label.SetTextFont(62)
    label.AddText(
        "Work in Progress        CMS, 35.9 fb^{-1} at #sqrt{s} = 13 TeV")
    label.SetFillStyle(0)
    label.SetBorderSize(0)
    label.SetTextSize(0.05)
Пример #2
0
    legend = TLegend(0.13, 0.41, 0.25, 0.88)
    legend.AddEntry(None, "#bf{mean[GeV] / sigma[GeV] / ratio}", "")
    while r < 7:
        legend.AddEntry(h[r], h[r].GetName(), "f[r]")
        result[r] = (height[r], mean[r], rms[r])
        legend_text[r] = "#bf{%-.3f/%-.3f/%-.3f}" % (
            result[r][1], result[r][2], ratio(result[r][2], result[r][1]))
        legend.AddEntry(None, legend_text[r], "")
        r = r + 1
    legend.SetBorderSize(0)
    legend.SetTextFont(42)
    legend.SetTextSize(0.03)
    legend.SetTextColor(1)
    legend.Draw("SAME")
    t = TLatex()
    t.SetNDC()
    t.SetTextSize(14)
    t.SetTextFont(43)
    t.SetTextAlign(13)
    t.DrawLatex(0.73, 0.85, "#it{#bf{ATLAS} Simulation Internal}")
    t.Draw()
    c2.Print("plot_histo_and_fit.pdf")


# done function

# to run explicitly
plot_histo(hs.Clone())
plot_fit(h, xmin, xmax, height, mean, rms)
plot_histo_and_fit(hs, f)