14 if args.make_percentages:
15 if isinstance(hist, ROOT.TH2D):
16 for i
in range(1, hist.GetNbinsX()+1):
17 this_norm = hist.Integral(i, i, 1, hist.GetNbinsY())
18 for j
in range(1, hist.GetNbinsY()+1):
20 hist.SetBinContent(i, j, 0)
22 hist.SetBinContent(i, j, hist.GetBinContent(i, j) / this_norm)
24 for k
in range(1, hist.GetNbinsZ()+1):
25 for i
in range(1, hist.GetNbinsX()+1):
26 this_norm = hist.Integral(i, i, 1, hist.GetNbinsY(), k, k)
27 for j
in range(1, hist.GetNbinsY()+1):
29 hist.SetBinContent(i, j, k, 0)
31 hist.SetBinContent(i, j, k, hist.GetBinContent(i, j, k) / this_norm)
37 canvas = ROOT.TCanvas(
"canvas",
"Canvas", 250,100,700,500)
39 if args.drawstr
is not None:
40 drawstr = args.drawstr
41 elif isinstance(hist, ROOT.TH2D):
46 ROOT.gStyle.SetPaintTextFormat(
"1.3f")
47 elif isinstance(hist, ROOT.TH1D):
49 elif isinstance(hist, ROOT.TGraph):
53 hist2.SetLineColor(ROOT.kRed)
55 hist2.SetMarkerSize(1)
56 hist2.SetMarkerStyle(21)
57 hist2.SetMarkerColor(ROOT.kRed)
59 if args.title
is not None:
60 hist.SetTitle(args.title)