The Gaudi Framework  v36r7 (7f57a304)
Aida2RootEx Namespace Reference

Classes

class  Aida2RootEx1
 
class  Aida2RootEx2
 

Functions

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

Variables

string __author__ = "Vanya BELYAEV ibelyaev@phys.syr.edu"
 
tuple paths
 
 gaudi = AppMgr()
 

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  # create the algorithms
140  alg1 = Aida2RootEx1()
141  alg2 = Aida2RootEx2()
142  # append them to the list of Top-Level algorithms
143  gaudi.addAlgorithm(alg1)
144  gaudi.addAlgorithm(alg2)
145 
146  return SUCCESS
147 
148 
149 # =============================================================================
150 # The third way to convert AIDA histograms into ROOT
151 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
152 # @date 2007-01-24

◆ useScript()

def Aida2RootEx.useScript (   histos)

Definition at line 153 of file Aida2RootEx.py.

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

Variable Documentation

◆ __author__

string Aida2RootEx.__author__ = "Vanya BELYAEV ibelyaev@phys.syr.edu"
private

Definition at line 23 of file Aida2RootEx.py.

◆ gaudi

Aida2RootEx.gaudi = AppMgr()

Definition at line 195 of file Aida2RootEx.py.

◆ paths

tuple Aida2RootEx.paths
Initial value:
1 = (
2  "HistoEx/ 1D histo ",
3  "HistoEx/ 2D histo ",
4  "HistoEx/ 3D histo ",
5  "HistoEx1/ 1D histo ",
6  "HistoEx1/ 2D histo ",
7  "HistoEx1/ 3D histo ",
8  "HistoEx2/ x vs y ",
9  "HistoEx2/ x vs y+3x ",
10  "HistoEx2/ x vs y-3x ",
11  "HistoEx2/ x vs y (profile)",
12  "HistoEx2/ x vs y+3x (profile)",
13  "HistoEx2/ x vs y-3x (profile)",
14 )

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:67
Aida2RootEx.useScript
def useScript(histos)
Definition: Aida2RootEx.py:153