Ejemplo n.º 1
0
    for i, x in enumerate(args.auto_style.split(',')):
        iline[x] = i + 1

# Process each input argument
for src in args.input:
    splitsrc = src.split(':')
    file = splitsrc[0]
    # limit.json => Draw as full obs + exp limit band
    if len(splitsrc) == 1:
        graph_sets.append(
            plot.StandardLimitsFromJSONFile(file, args.show.split(',')))
        if axis is None:
            axis = plot.CreateAxisHists(len(pads), graph_sets[-1].values()[0],
                                        True)
            DrawAxisHists(pads, axis, pads[0])
        plot.StyleLimitBand(graph_sets[-1])
        plot.DrawLimitBand(pads[0], graph_sets[-1], legend=legend)
        pads[0].RedrawAxis()
        pads[0].RedrawAxis('g')
        pads[0].GetFrame().Draw()

    # limit.json:X => Draw a single graph for entry X in the json file
    # 'limit.json:X:Title="Blah",LineColor=4,...' =>
    # as before but also apply style options to TGraph
    elif len(splitsrc) >= 2:
        settings = {}
        settings['Title'] = src
        if args.auto_style is not None:
            nm = 'default'
            for x in icol.keys():
                if x in splitsrc[1]:
Ejemplo n.º 2
0
    'exp0': {'LineWidth': 2, 'LineColor': ROOT.TColor.GetColor('#9e0142')},
    'exp1': {'FillColor': ROOT.TColor.GetColor('#55b748')},
    'exp2': {'FillColor': ROOT.TColor.GetColor('#fdbf11')}
}

# Process each input argument
for src in args.input:
    splitsrc = src.split(':')
    file = splitsrc[0]
    # limit.json => Draw as full obs + exp limit band
    if len(splitsrc) == 1:
        graph_sets.append(plot.StandardLimitsFromJSONFile(file, args.show.split(',')))
        if axis is None:
            axis = plot.CreateAxisHists(len(pads), graph_sets[-1].values()[0], True)
            DrawAxisHists(pads, axis, pads[0])
        plot.StyleLimitBand(graph_sets[-1], overwrite_style_dict=_styleDict)
        plot.DrawLimitBand(pads[0], graph_sets[-1], legend=legend)
        pads[0].RedrawAxis()
        pads[0].RedrawAxis('g')
        pads[0].GetFrame().Draw()

    # limit.json:X => Draw a single graph for entry X in the json file
    # 'limit.json:X:Title="Blah",LineColor=4,...' =>
    # as before but also apply style options to TGraph
    elif len(splitsrc) >= 2:
        settings = {}
        settings['Title'] = src
        if args.auto_style is not None:
            nm = 'default'
            for x in icol.keys():
                if x in splitsrc[1]:
Ejemplo n.º 3
0
            newgr.GetEYlow()[i] = gr.GetEYlow()[i]
            newgr.GetEYhigh()[i] = gr.GetEYhigh()[i]
        else:
            newgr.GetEYlow()[i] = 0.
            newgr.GetEYhigh()[i] = 0.
        newgr.GetEXlow()[i] = 0.5
        newgr.GetEXhigh()[i] = 0.5
        newgr.GetX()[i] = gr.GetX()[i]
        newgr.GetY()[i] = gr.GetY()[i]
    graphs[name] = newgr

axis = ROOT.TH1F('axis', '', 4, 0, 4)
pads[0].cd()
axis.Draw('AXIS')

plot.StyleLimitBand(graphs)
DrawLimitBand(pads[0], graphs, legend=legend)
legend.Draw()

y_min, y_max = (plot.GetPadYMin(pads[0]), plot.GetPadYMax(pads[0]))
plot.FixBothRanges(pads[0], 0, 0, y_max, 0.10)

axis.GetYaxis().SetTitle('95%% CL upper limit on %s' % '#mu_{ttH}')

labels = [
    'Combined', '#splitline{H#rightarrowleptons}{#scale[0.8]{ HIG-15-008}}',
    '#splitline{   H#rightarrowbb}{#scale[0.8]{ HIG-16-004}}',
    '#splitline{   H#rightarrow#gamma#gamma}{#scale[0.8]{HIG-15-005}}'
]
# labels = ['Combined', 'H#rightarrowleptons', 'H#rightarrowbb', 'H#rightarrow#gamma#gamma']
for i in xrange(len(labels)):
Ejemplo n.º 4
0
    for i, x in enumerate(args.auto_style.split(',')):
        iline[x] = i+1

# Process each input argument
has_band = False
for src in args.input:
    splitsrc = src.split(':')
    file = splitsrc[0]
    # limit.json => Draw as full obs + exp limit band
    if len(splitsrc) == 1:
        graph_sets.append(plot.StandardLimitsFromJSONFile(file, args.show.split(',')))
        if axis is None:
            axis = plot.CreateAxisHists(len(pads), graph_sets[-1].values()[0], True)
            DrawAxisHists(pads, axis, pads[0])
        if args.higgs_bg or args.higgs_injected:
            plot.StyleLimitBand(graph_sets[-1],overwrite_style_dict=style_dict["style"])
            plot.DrawLimitBand(pads[0], graph_sets[-1], legend=legend,legend_overwrite=style_dict["legend"])
        else:
            plot.StyleLimitBand(graph_sets[-1])
            plot.DrawLimitBand(pads[0], graph_sets[-1],legend=legend)
        pads[0].RedrawAxis()
        pads[0].RedrawAxis('g')
        pads[0].GetFrame().Draw()
        has_band = True  # useful to know later if we want to do style settings
                         # based on whether or not the expected band has been drawn

    # limit.json:X => Draw a single graph for entry X in the json file 
    # 'limit.json:X:Title="Blah",LineColor=4,...' =>
    # as before but also apply style options to TGraph
    elif len(splitsrc) >= 2:
        settings = {}
Ejemplo n.º 5
0
for src in args.input:
    splitsrc = src.split(':')
    file = splitsrc[0]
    # limit.json => Draw as full obs + exp limit band
    if len(splitsrc) == 1:
        graph_sets.append(
            plot.StandardLimitsFromJSONFile(file, args.show.split(',')))
        for gr_name in graph_sets[-1]:
            graph_sets[-1][gr_name] = AdjustGraph(graph_sets[-1][gr_name],
                                                  pt_bins)
        if axis is None:
            axis = plot.CreateAxisHists(len(pads), graph_sets[-1].values()[0],
                                        True)
            DrawAxisHists(pads, axis, pads[0], pt_bins)
        plot.StyleLimitBand(graph_sets[-1],
                            overwrite_style_dict={'exp0': {
                                'MarkerSize': 0
                            }})
        plot.DrawLimitBand(pads[0],
                           graph_sets[-1],
                           legend=legend,
                           legend_overwrite={
                               'exp2': {
                                   'DrawStyle': '2SAME'
                               },
                               'exp1': {
                                   'DrawStyle': '2SAME'
                               },
                               'obs': {
                                   'DrawStyle': 'PZSAME'
                               },
                               'exp0': {