Example #1
0
    # The pull plot should have a special range.
    pullPlot.GetYaxis().SetRangeUser(-5, 5)

    # Each plot is saved individually.
    yieldCanvas = r.TCanvas('%s_yield_canvas' % (keyName),
                            '%s_yield_canvas' % (keyName), 2500, 1000)
    errorCanvas = r.TCanvas('%s_error_canvas' % (keyName),
                            '%s_error_canvas' % (keyName), 2500, 1000)
    pullCanvas = r.TCanvas('%s_pull_canvas' % (keyName),
                           '%s_pull_canvas' % (keyName), 2500, 1000)

    # Draw the plots onto the canvases.
    yieldCanvas.cd()
    yieldPlot.Draw()
    utils.InsertText("", [], 0.15, 0.15)
    yieldCanvas.SaveAs('%s/%s%s_yield.png' % (plotDirectory, prefix, keyName))

    errorCanvas.cd()
    errorPlot.Draw()
    utils.InsertText("", [], 0.15, 0.15)
    errorCanvas.SaveAs('%s/%s%s_error.png' % (plotDirectory, prefix, keyName))

    pullCanvas.cd()
    pullPlot.Draw()
    utils.InsertText("", [], 0.15, 0.15)
    pullCanvas.SaveAs('%s/%s%s_pull.png' % (plotDirectory, prefix, keyName))
    pass

# Close the output file.
outFile.Close()
Example #2
0
    zcuts.append(zcut)
    zcutTxtFile.write("%f\t%f\n" % (massF, zcut))
    outFile.cd()
    zVtx_h.Write()
    pass
zcutTxtFile.close()

utils.SetStyle()
zcuts_g = r.TGraph(len(masses), np.array(masses), np.array(zcuts))
zcuts_g.SetName("zcuts_g")
zcuts_g.SetTitle(";m_{A'} [MeV];z_{cut} [mm]")
zcuts_g.Write()

outFile.Close()
exit(0)

canv = r.TCanvas("canv", "canv", 1400, 1000)
canv.cd()
massResScaled_ge.SetMinimum(0.0)
massResScaled_ge.SetMaximum(15.0)
massResScaled_ge.Draw("ape")
massRes_ge.Draw("pesame")
fitFunc.Draw("same")
utils.InsertText()
canv.SaveAs("massRes.png")

massRes_ge.Write()
massResScaled_ge.Write()

outFile.Close()