The Gaudi Framework  master (37c0b60a)
axes_labels Namespace Reference

Functions

def config ()
 
def check (causes, result)
 

Variables

 FILENAME
 
 FILENAMEJSON
 

Function Documentation

◆ check()

def axes_labels.check (   causes,
  result 
)

Definition at line 47 of file axes_labels.py.

47 def check(causes, result):
48  result["root_output_file"] = FILENAME
49 
50  if not os.path.exists(FILENAME):
51  causes.append("missing histogram file")
52  return False
53 
54  try:
55  import ROOT
56 
57  f = ROOT.TFile.Open(FILENAME)
58  h = f.Get("HistoAlgo/hist")
59  axis = h.GetXaxis()
60  labels = list(axis.GetLabels())
61  expected = ["a", "b", "c", "d", "e"]
62  if labels != expected:
63  causes.append("wrong axis labels")
64  result["expected_labels"] = ", ".join(repr(l) for l in expected)
65  result["found_labels"] = ", ".join(repr(l) for l in labels)
66  return False
67 
68  except Exception:
69  causes.append("failure reading histogram file")
70  result["python_exception"] = result.Quote(format_exc())
71  return False
72 
73  return True

◆ config()

def axes_labels.config ( )

Definition at line 18 of file axes_labels.py.

18 def config():
19  import GaudiConfig2.Configurables as C
20  import GaudiConfig2.Configurables.Gaudi.Tests.Histograms.AxesLabels as T
21 
22  algs = []
23  svcs = []
24 
25  HistoAlgo = T.HistWithLabelsAlg
26  algs.append(HistoAlgo("HistoAlgo"))
27 
28  svcs.append(C.Gaudi.Histograming.Sink.Root(FileName=FILENAME))
29  svcs.append(C.Gaudi.Monitoring.JSONSink(FileName=FILENAMEJSON))
30  svcs.append(C.Gaudi.Monitoring.MessageSvcSink())
31 
32  yield from algs
33  yield from svcs
34 
35  yield C.ApplicationMgr(
36  EvtMax=5,
37  EvtSel="NONE",
38  TopAlg=algs,
39  ExtSvc=svcs,
40  )
41 
42  # make sure the histogram file is not already there
43  if os.path.exists(FILENAME):
44  os.remove(FILENAME)
45 
46 

Variable Documentation

◆ FILENAME

axes_labels.FILENAME

Definition at line 14 of file axes_labels.py.

◆ FILENAMEJSON

axes_labels.FILENAMEJSON

Definition at line 15 of file axes_labels.py.

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