47def check(causes, result):
48 result["root_output_file"] = FILENAME
49
50 if not os.path.exists(FILENAME):
51 causes.append("missing histogram file")
52 return False
53
54 try:
55 import ROOT
56
57 f = ROOT.TFile.Open(FILENAME)
58 h = f.Get("HistoAlgo/hist")
59 axis = h.GetXaxis()
60 labels = list(axis.GetLabels())
61 expected = ["a", "b", "c", "d", "e"]
62 if labels != expected:
63 causes.append("wrong axis labels")
64 result["expected_labels"] = ", ".join(repr(l) for l in expected)
65 result["found_labels"] = ", ".join(repr(l) for l in labels)
66 return False
67
68 except Exception:
69 causes.append("failure reading histogram file")
70 result["python_exception"] = result.Quote(format_exc())
71 return False
72
73 return True