12 from traceback
import format_exc
14 FILENAME = f
"{__name__}.root"
15 FILENAMEJSON = f
"{__name__}.json"
20 import GaudiConfig2.Configurables.Gaudi.Tests.Histograms.Directories
as D
26 Alg = D.HistoGroupsAlg
27 algs.append(Alg(
"Alg"))
29 svcs.append(C.Gaudi.Histograming.Sink.Root(FileName=FILENAME))
30 svcs.append(C.Gaudi.Monitoring.JSONSink(FileName=FILENAMEJSON))
31 svcs.append(C.Gaudi.Monitoring.MessageSvcSink())
37 yield C.ApplicationMgr(
45 if os.path.exists(FILENAME):
50 result[
"root_output_file"] = FILENAME
52 if not os.path.exists(FILENAME):
53 causes.append(
"missing histogram file")
59 f = ROOT.TFile.Open(FILENAME)
61 f
"{component}/{histogram}"
62 for component
in [
"Alg",
"Alg/Tool"]
67 "Group/SubGroup/Third",
71 assert h, f
"missing histogram {name}"
73 except AssertionError
as err:
74 causes.append(str(err))
78 causes.append(
"failure reading histogram file")
79 result[
"python_exception"] = result.Quote(format_exc())