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")
56 f = ROOT.TFile.Open(FILENAME)
58 f
"{component}/{histogram}"
59 for component
in [
"Alg",
"Alg/Tool"]
for histogram
in
60 [
"Top",
"Group/First",
"Group/Second",
"Group/SubGroup/Third"]
63 assert h, f
"missing histogram {name}"
65 except AssertionError
as err:
66 causes.append(str(err))
69 except Exception
as err:
70 causes.append(
"failure reading histogram file")
71 result[
"python_exception"] = result.Quote(format_exc())