20 ROOT.gStyle.SetOptStat(0)
21 f = ROOT.TFile(filepath)
22 for key in f.Get("Hough/Images").GetListOfKeys():
23 if key.GetClassName() == "TH2I":
24 c = ROOT.TCanvas("c1","c1",800,600)
25 h = key.ReadObj()
26 h.Draw("COLZ")
27
28
29
30
31
32 boxes = []
33 for x in range(1, h.GetNbinsX() + 1):
34 for y in range(1, h.GetNbinsY() + 1):
35 if h.GetBinError(x, y) >= 100:
36 b = ROOT.TBox(h.GetXaxis().GetBinLowEdge(x),
37 h.GetYaxis().GetBinLowEdge(y),
38 h.GetXaxis().GetBinWidth(x) + h.GetXaxis().GetBinLowEdge(x),
39 h.GetYaxis().GetBinWidth(y) + h.GetYaxis().GetBinLowEdge(y))
40 b.SetFillColor(ROOT.kRed + int(h.GetBinError(x, y)) - 100)
41 b.Draw()
42 boxes.append(b)
43
44 c.Print(h.GetName() + ".png")
45
46