示例#1
0
        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 = {}
        settings['Title'] = src
示例#2
0
        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]:
                    nm = x
示例#3
0
            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': {
                                   'DrawStyle': 'PZSAME'
                               }
                           })
        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