49def check(causes, result):
50 result["root_output_file"] = FILENAME
51
52 if not os.path.exists(FILENAME):
53 causes.append("missing histogram file")
54 return False
55
56 try:
57 import ROOT
58
59 f = ROOT.TFile.Open(FILENAME)
60 for name in [
61 f"{component}/{histogram}"
62 for component in ["Alg", "Alg/Tool"]
63 for histogram in [
64 "Top",
65 "Group/First",
66 "Group/Second",
67 "Group/SubGroup/Third",
68 ]
69 ]:
70 h = f.Get(name)
71 assert h, f"missing histogram {name}"
72
73 except AssertionError as err:
74 causes.append(str(err))
75 return False
76
77 except Exception:
78 causes.append("failure reading histogram file")
79 result["python_exception"] = result.Quote(format_exc())
80 return False
81
82 return True