4 from array
import array
11 f = ROOT.TFile(args.input)
12 hist = f.Get(args.hist)
15 hstack = ROOT.THStack()
16 canvas = ROOT.TCanvas(
"canvas",
"Canvas", 250,100,700,500)
19 __getattr__ = dict.get
22 for i,(low,high)
in enumerate(
zip(args.lows, args.highs)):
23 this_args = ArgDict({
"y_min": low,
"y_max": high,
"projectionX":
True})
33 hstack.Draw(
"NOSTACK HIST")
34 legend = ROOT.gPad.BuildLegend(*(args.legend_position + [
""]))
35 if args.title
is not None:
36 hstack.SetTitle(args.title)
46 if __name__ ==
"__main__":
47 parser = argparse.ArgumentParser()
52 parser.add_argument(
"-t" ,
"--title", default=
None)
53 parser.add_argument(
"-hn",
"--hist", required=
True)
54 parser.add_argument(
"-ls",
"--lows", nargs=
"+", type=float)
55 parser.add_argument(
"-hs",
"--highs", nargs=
"+", type=float)
56 parser.add_argument(
"-n",
"--names", type=util.comma_separated)
57 parser.add_argument(
"-lp",
"--legend_position", default=[0.75,0.75,0.95,0.95], type=util.legend_position)
58 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.