The Gaudi Framework  v36r16 (ea80daf8)
Aida2RootEx Namespace Reference

Classes

class  Aida2RootEx1
 
class  Aida2RootEx2
 

Functions

def configure (gaudi=None)
 
def useScript (histos)
 

Variables

 __author__
 
 paths
 
 gaudi
 

Function Documentation

◆ configure()

def Aida2RootEx.configure (   gaudi = None)
the main configuration method

Definition at line 126 of file Aida2RootEx.py.

126 def configure(gaudi=None):
127  """the main configuration method"""
128 
129  if not gaudi:
130  from GaudiPython.Bindings import AppMgr
131 
132  gaudi = AppMgr()
133 
134  # reuse the previous example
135  import HistoEx2
136 
137  HistoEx2.configure(gaudi)
138 
139  hsvc = gaudi.service("HistogramPersistencySvc")
140  hsvc.OutputFile = "aida2rootex.root"
141 
142  # create the algorithms
143  alg1 = Aida2RootEx1()
144  alg2 = Aida2RootEx2()
145  # append them to the list of Top-Level algorithms
146  gaudi.addAlgorithm(alg1)
147  gaudi.addAlgorithm(alg2)
148 
149  return SUCCESS
150 
151 
152 # =============================================================================
153 # The third way to convert AIDA histograms into ROOT
154 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
155 # @date 2007-01-24

◆ useScript()

def Aida2RootEx.useScript (   histos)

Definition at line 156 of file Aida2RootEx.py.

156 def useScript(histos):
157  "the third way to convert AIDA histograms into ROOT"
158 
159  from GaudiPython.Bindings import AppMgr
160 
161  g = AppMgr()
162 
163  hsvc = g.histsvc()
164 
165  i = 0
166  for histo in histos:
167  root = hsvc.getAsROOT(histo)
168  if not root:
169  print("ERROR in access the histogram '%s' " % histo)
170  continue
171  canvas = ROOT.TCanvas("canvas_%d" % i, histo, 250, 250)
172  root.Draw()
173  name = histo.replace("/", "_")
174  name = name.replace("\\", "_")
175  name = name.replace('"', "_")
176  name = name.replace("'", "_")
177  name = name.replace("'", "_")
178  name = name.replace(" ", "_")
179  name = name.replace(os.sep, "_") + ".png"
180  if os.path.exists(name):
181  # strictly speaking, it is not needed, but avoids a message on the stderr
182  os.remove(name)
183  canvas.Print(name)
184  print("The file name is '%s'" % name)
185  i += 1
186 
187 
188 # =============================================================================
189 
190 # =============================================================================
191 # The actual job execution
192 # =============================================================================

Variable Documentation

◆ __author__

Aida2RootEx.__author__
private

Definition at line 23 of file Aida2RootEx.py.

◆ gaudi

Aida2RootEx.gaudi

Definition at line 198 of file Aida2RootEx.py.

◆ paths

Aida2RootEx.paths

Definition at line 37 of file Aida2RootEx.py.

Aida2RootEx.configure
def configure(gaudi=None)
Definition: Aida2RootEx.py:126
GaudiPython.Bindings
Definition: Bindings.py:1
HistoEx2.configure
def configure(gaudi=None)
Definition: HistoEx2.py:63
Aida2RootEx.useScript
def useScript(histos)
Definition: Aida2RootEx.py:156