Beispiel #1
0
def make_qqplots(ux, uy):
    xyplot = uy.xvar.frame()
    xyplot.SetTitle('')
    xycorr = QQCorrector(ux.xvar, ux.xpdf, uy.xvar, uy.xpdf)
    xycorr.SetName('y')
    ux.data.addColumn(xycorr)
    uy.data.plotOn(xyplot, roo.LineColor(uy.color), roo.MarkerColor(uy.color))
    uy.xpdf.plotOn(xyplot, roo.LineColor(uy.color))
    ux.data.plotOn(xyplot, roo.LineColor(ux.color), roo.MarkerColor(ux.color))

    yxplot = ux.xvar.frame()
    yxplot.SetTitle('')
    yxcorr = QQCorrector(uy.xvar, uy.xpdf, ux.xvar, ux.xpdf)
    yxcorr.SetName('x')
    uy.data.addColumn(yxcorr)
    ux.data.plotOn(yxplot, roo.LineColor(ux.color), roo.MarkerColor(ux.color))
    ux.xpdf.plotOn(yxplot, roo.LineColor(ux.color))
    uy.data.plotOn(yxplot, roo.LineColor(uy.color), roo.MarkerColor(uy.color))

    canvases.next('qqxy')
    xyplot.Draw()

    canvases.next('qqyx')
    yxplot.Draw()

    return xyplot, yxplot
Beispiel #2
0
g2 = w.factory('BreitWigner::g2(y[-5, 7], m2[1], s2[1.2])')

#______________________________________________________________________________
xplot = w.var('x').frame()
g1.plotOn(xplot)
canvases.next('g1_x').SetGrid()
xplot.Draw()

#______________________________________________________________________________
yplot = w.var('y').frame()
g2.plotOn(yplot)
canvases.next('g2_y').SetGrid()
yplot.Draw()

#______________________________________________________________________________
qq12 = QQCorrector(w.var('x'), g1, w.var('y'), g2, 1e-4)
plot12 = w.var('x').frame()
plot12.SetTitle('')
plot12.GetXaxis().SetTitle('Raw x')
plot12.GetYaxis().SetTitle('Corrected x')
qq12.plotOn(plot12)
canvases.next('qq12').SetGrid()
plot12.Draw()

#______________________________________________________________________________
plot12v2 = qq12.get_correction_plot()
canvases.next('qq12v2').SetGrid()
plot12v2.Draw()

#______________________________________________________________________________
## Persist the corrector in a file as RooHistFunc