Esempio n. 1
0
                           type=str,
                           default="m_{H} (GeV)",
                           help="x-axis title.  Default: '%(default)s'")

    args = parser.parse_args()

    import FinalStateAnalysis.Utilities.styling as styling

    import FinalStateAnalysis.StatTools.limitplot as limitplot
    import ROOT

    all_files = []
    for file in args.data:
        all_files.extend(glob.glob(file))

    limit_data = limitplot.get_limit_info(all_files)

    key = (args.method, args.label)

    canvas = ROOT.TCanvas("c", "c", args.cx, args.cy)
    canvas.SetRightMargin(0.05)
    canvas.SetLeftMargin(1.1 * canvas.GetLeftMargin())

    xmin = min(limit_data[key].keys())
    xmax = max(limit_data[key].keys())

    if args.maxx > 0:
        xmax = args.maxx

    frame = ROOT.TH1F("frame", "frame", 1, xmin, xmax)
Esempio n. 2
0
import ROOT
import sys

if __name__ == "__main__":
    parser = argparse.ArgumentParser()
    parser.add_argument("data", nargs="+", help="JSON files with limit data")
    parser.add_argument("--method", type=str, default="cls", help="Limit method to use.  Default: cls")
    parser.add_argument("--label", type=str, default="", help="Limit label to use.  Default: None")

    args = parser.parse_args()

    all_files = []
    for file in args.data:
        all_files.extend(glob.glob(file))

    limit_data = limitplot.get_limit_info(all_files)

    key = (args.method, args.label)

    sys.stdout.write(
        " & ".join(["Mass", "-2$\\sigma$", "-1$\\sigma$", "Expected", "+1$\\sigma$", "+2$\\sigma$", "Observed"])
        + "\\\\\n"
    )
    sys.stdout.write("\hline\n")

    template = (
        " & ".join(
            ["{mass:0.0f} \\GeV", "{-2:5.1f}", "{-1:5.1f}", "{exp:5.1f}", "{+1:5.1f}", "{+2:5.1f}", "{obs:5.1f}"]
        )
        + "\\\\\n"
    )
Esempio n. 3
0
    import ROOT
    import FinalStateAnalysis.StatTools.limitplot as limitplot
    import FinalStateAnalysis.Utilities.styling as styling

    print args.plot1, args.plot4

    plots_to_comp = []

    key = (args.method, args.label)
    xmin = 1e9
    xmax = -1e9

    for plot in [args.plot1, args.plot2, args.plot3, args.plot4]:
        if plot:
            the_glob, title, type, color = tuple(plot)
            limit_data = limitplot.get_limit_info(glob.glob(the_glob))
            tgraph = asrootpy(limitplot.build_line(limit_data, key, type))
            print tgraph
            tgraph.SetLineColor(color)
            plots_to_comp.append((tgraph, title))
            xmin = min(min(limit_data[key].keys()), xmin)
            xmax = max(max(limit_data[key].keys()), xmax)

    canvas = ROOT.TCanvas("c", "c", args.cx, args.cy)

    if args.maxx > 0:
        xmax = args.maxx

    frame = ROOT.TH1F("frame", "frame", 1, xmin, xmax)

    frame.Draw()