14 canvas = ROOT.TCanvas(
"canvas",
"Canvas", 250,100,700,500)
17 for i, (base_histo,cut_histo)
in enumerate(
zip(base_histos,cut_histos)):
18 ratio = cut_histo.Clone()
19 ratio.Divide(base_histo)
27 all_histos.append(ratio)
33 legend = ROOT.gPad.BuildLegend(*(args.legend_position + [
""]))
34 if args.title
is not None:
35 all_histos[0].SetTitle(args.title)
41 if __name__ ==
"__main__":
42 parser = argparse.ArgumentParser()
46 parser.add_argument(
"-b",
"--base_histos", type=util.comma_separated, required=
True)
47 parser.add_argument(
"-c",
"--cut_histos", type=util.comma_separated, required=
True)
48 parser.add_argument(
"-t" ,
"--title", default=
None)
49 parser.add_argument(
"-n",
"--names", default=
None, type=util.comma_separated)
50 parser.add_argument(
"-lp",
"--legend_position", default=[0.75,0.75,0.95,0.95], type=util.legend_position)
51 main(parser.parse_args())
auto enumerate(Iterables &&...iterables)
Range-for loop helper tracking the number of iteration.
auto zip(Iterables &&...iterables)
Range-for loop helper iterating across many collections at the same time.