12 from traceback
import format_exc
14 FILENAME = f
"{__name__}.root"
19 import GaudiConfig2.Configurables.Gaudi.Tests.Histograms.Directories
as D
25 Alg = D.HistoGroupsAlg
26 algs.append(Alg(
"Alg"))
28 svcs.append(C.Gaudi.Histograming.Sink.Root(FileName=FILENAME))
29 svcs.append(C.Gaudi.Monitoring.MessageSvcSink())
35 yield C.ApplicationMgr(
43 if os.path.exists(FILENAME):
48 result[
"root_output_file"] = FILENAME
50 if not os.path.exists(FILENAME):
51 causes.append(
"missing histogram file")
57 f = ROOT.TFile.Open(FILENAME)
59 f
"{component}/{histogram}"
60 for component
in [
"Alg",
"Alg/Tool"]
65 "Group/SubGroup/Third",
69 assert h, f
"missing histogram {name}"
71 except AssertionError
as err:
72 causes.append(str(err))
75 except Exception
as err:
76 causes.append(
"failure reading histogram file")
77 result[
"python_exception"] = result.Quote(format_exc())