3 import Validation.RecoTrack.plotting.plotting
as plotting
7 h.SetDirectory(tdirectory)
10 h.SetMarkerStyle(markerStyle)
11 h.SetMarkerColor(color)
16 def draw(name, histos, styles, legendLabels=[],
17 xtitle=
None, ytitle=
None,
19 legendDx=0, legendDy=0, legendDw=0, legendDh=0,
20 xmin=
None, ymin=0, xmax=
None, ymax=
None, xlog=
False, ylog=
False,
21 xgrid=
True, ygrid=
True,
22 ratio=
False, ratioYmin=0.5, ratioYmax=1.5, ratioYTitle=plotting._ratioYTitle
30 height =
int(height*ratioFactor)
38 ratioBounds = (bounds[0], ratioYmin, bounds[2], ratioYmax)
39 frame =
plotting.FrameRatio(c, bounds, ratioBounds, ratioFactor, ratioYTitle=ratioYTitle, **args)
44 if xtitle
is not None:
45 frame.setXTitle(xtitle)
46 if ytitle
is not None:
47 frame.setYTitle(ytitle)
56 for h, st
in zip(histos, styles):
58 h.Draw(drawOpt+
" same")
68 if len(legendLabels) > 0:
69 if len(legendLabels) != len(histos):
70 raise Exception(
"Got %d histos but %d legend labels" % (len(histos), len(legendLabels)))
84 legend = ROOT.TLegend(lx1, ly1, lx2, ly2)
85 legend.SetLineColor(1)
86 legend.SetLineWidth(1)
87 legend.SetLineStyle(1)
88 legend.SetFillColor(0)
89 legend.SetMargin(0.07)
90 legend.SetBorderSize(0)
92 for h, l
in zip(histos, legendLabels):
93 legend.AddEntry(h, l,
"L")
101 c.SaveAs(name+
".png")
102 c.SaveAs(name+
".pdf")
def _findBounds(th1s, ylog, xmin=None, xmax=None, ymin=None, ymax=None)
def applyStyle(h, color, markerStyle)
def _calculateRatios(histos, ratioUncertainty=False)
OutputIterator zip(InputIterator1 first1, InputIterator1 last1, InputIterator2 first2, InputIterator2 last2, OutputIterator result, Compare comp)
def saveHistograms(tdirectory, histos)
def draw(name, histos, styles, legendLabels=[], xtitle=None, ytitle=None, drawOpt="HIST", legendDx=0, legendDy=0, legendDw=0, legendDh=0, xmin=None, ymin=0, xmax=None, ymax=None, xlog=False, ylog=False, xgrid=True, ygrid=True, ratio=False, ratioYmin=0.5, ratioYmax=1.5, ratioYTitle=plotting._ratioYTitle)
def _modifyPadForRatio(pad, ratioFactor)
def _createCanvas(name, width, height)