The Gaudi Framework  master (f31105fd)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
directories Namespace Reference

Functions

def config ()
 
def check (causes, result)
 

Variables

 FILENAME
 
 FILENAMEJSON
 

Function Documentation

◆ check()

def directories.check (   causes,
  result 
)

Definition at line 49 of file directories.py.

49 def 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

◆ config()

def directories.config ( )

Definition at line 18 of file directories.py.

18 def config():
19  import GaudiConfig2.Configurables as C
20  import GaudiConfig2.Configurables.Gaudi.Tests.Histograms.Directories as D
21 
22  algs = []
23  tools = []
24  svcs = []
25 
26  Alg = D.HistoGroupsAlg
27  algs.append(Alg("Alg"))
28 
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())
32 
33  yield from algs
34  yield from tools
35  yield from svcs
36 
37  yield C.ApplicationMgr(
38  EvtMax=5,
39  EvtSel="NONE",
40  TopAlg=algs,
41  ExtSvc=svcs,
42  )
43 
44  # make sure the histogram file is not already there
45  if os.path.exists(FILENAME):
46  os.remove(FILENAME)
47 
48 

Variable Documentation

◆ FILENAME

directories.FILENAME

Definition at line 14 of file directories.py.

◆ FILENAMEJSON

directories.FILENAMEJSON

Definition at line 15 of file directories.py.

directories.check
def check(causes, result)
Definition: directories.py:49
GaudiConfig2.Configurables
Definition: Configurables.py:1
directories.config
def config()
Definition: directories.py:18