Example #1
0
                g_check.SetPoint(g_check_i, cboxes.index(pbox) + 0.5, float(i) + 0.5)
                g_check_i += 1
        imp = pdata[p][POI]
        g_impacts_hi.SetPointError(i, 0, imp[2] - imp[1], 0.5, 0.5)
        g_impacts_lo.SetPointError(i, imp[1] - imp[0], 0, 0.5, 0.5)
        max_impact = max(
            max_impact, abs(imp[1] - imp[0]), abs(imp[2] - imp[1]))
        col = colors.get(tp, 2)
        if args.color_groups is not None and len(pdata[p]['groups']) == 1:
            col = color_groups.get(pdata[p]['groups'][0], 1)
        h_pulls.GetYaxis().SetBinLabel(
            i + 1, ('#color[%i]{%s}'% (col, Translate(pdata[p]['name'], translate))))

    # Style and draw the pulls histo
    if externalPullDef:
        plot.Set(h_pulls.GetXaxis(), TitleSize=0.04, LabelSize=0.03, Title=CP.returnTitle(args.pullDef))
    else:
        plot.Set(h_pulls.GetXaxis(), TitleSize=0.04, LabelSize=0.03, Title='(#hat{#theta}-#theta_{0})/#Delta#theta')

    plot.Set(h_pulls.GetYaxis(), LabelSize=0.021, TickLength=0.0)
    h_pulls.GetYaxis().LabelsOption('v')
    h_pulls.Draw()

    for i in redo_boxes:
        newbox = boxes[i].Clone()
        newbox.Clear()
        newbox.SetY1(newbox.GetY1()+0.005)
        newbox.SetY2(newbox.GetY2()-0.005)
        newbox.SetX1(ROOT.gStyle.GetPadLeftMargin()+0.001)
        newbox.SetX2(0.7-0.001)
        newbox.Draw()
        col = colors.get(tp, 2)
        if args.color_groups is not None and len(pdata[p]['groups']) >= 1:
            for p_grp in pdata[p]['groups']:
                if p_grp in color_groups:
                    col = color_groups[p_grp]
                    break
        h_pulls.GetYaxis().SetBinLabel(
            i + 1,
            ('#color[%i]{%s}' % (col, Translate(pdata[p]['name'], translate))))

    # Style and draw the pulls histo
    if externalPullDef:
        plot.Set(h_pulls.GetXaxis(),
                 TitleSize=0.04,
                 LabelSize=0.03,
                 Title=CP.returnTitle(args.pullDef))
    else:
        plot.Set(h_pulls.GetXaxis(),
                 TitleSize=0.04,
                 LabelSize=0.03,
                 Title='(#hat{#theta}-#theta_{0})/#Delta#theta')

    plot.Set(h_pulls.GetYaxis(), LabelSize=args.label_size, TickLength=0.0)
    h_pulls.GetYaxis().LabelsOption('v')
    h_pulls.Draw()

    for i in redo_boxes:
        newbox = boxes[i].Clone()
        newbox.Clear()
        newbox.SetY1(newbox.GetY1() + 0.005)
        newbox.SetY2(newbox.GetY2() - 0.005)