The Gaudi Framework  v36r1 (3e2fb5a8)
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 114 of file Aida2RootEx.py.

114 def configure(gaudi=None):
115  """ the main configuration method """
116 
117  if not gaudi:
118  from GaudiPython.Bindings import AppMgr
119  gaudi = AppMgr()
120 
121  # reuse the previous example
122  import HistoEx2
123  HistoEx2.configure(gaudi)
124 
125  # create the algorithms
126  alg1 = Aida2RootEx1()
127  alg2 = Aida2RootEx2()
128  # append them to the list of Top-Level algorithms
129  gaudi.addAlgorithm(alg1)
130  gaudi.addAlgorithm(alg2)
131 
132  return SUCCESS
133 
134 
135 # =============================================================================
136 # The third way to convert AIDA histograms into ROOT
137 # @author Vanya BELYAEV ibelyaev@physics.syr.edu
138 # @date 2007-01-24

◆ useScript()

def Aida2RootEx.useScript (   histos)

Definition at line 139 of file Aida2RootEx.py.

139 def useScript(histos):
140  " the third way to convert AIDA histograms into ROOT "
141 
142  from GaudiPython.Bindings import AppMgr
143  g = AppMgr()
144 
145  hsvc = g.histsvc()
146 
147  i = 0
148  for histo in histos:
149  root = hsvc.getAsROOT(histo)
150  if not root:
151  print("ERROR in access the histogram '%s' " % histo)
152  continue
153  canvas = ROOT.TCanvas('canvas_%d' % i, histo, 250, 250)
154  root.Draw()
155  name = histo.replace('/', '_')
156  name = name.replace('\\', '_')
157  name = name.replace('"', '_')
158  name = name.replace("'", '_')
159  name = name.replace("'", '_')
160  name = name.replace(" ", '_')
161  name = name.replace(os.sep, '_') + '.png'
162  if os.path.exists(name):
163  # strictly speaking, it is not needed, but avoids a message on the stderr
164  os.remove(name)
165  canvas.Print(name)
166  print("The file name is '%s'" % name)
167  i += 1
168 
169 
170 # =============================================================================
171 
172 # =============================================================================
173 # The actual job execution
174 # =============================================================================

Variable Documentation

◆ __author__

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

Definition at line 22 of file Aida2RootEx.py.

◆ gaudi

Aida2RootEx.gaudi = AppMgr()

Definition at line 180 of file Aida2RootEx.py.

◆ paths

tuple Aida2RootEx.paths
Initial value:
1 = ('HistoEx/ 1D histo ', 'HistoEx/ 2D histo ', 'HistoEx/ 3D histo ',
2  'HistoEx1/ 1D histo ', 'HistoEx1/ 2D histo ', 'HistoEx1/ 3D histo ',
3  'HistoEx2/ x vs y ', 'HistoEx2/ x vs y+3x ',
4  'HistoEx2/ x vs y-3x ', 'HistoEx2/ x vs y (profile)',
5  'HistoEx2/ x vs y+3x (profile)', 'HistoEx2/ x vs y-3x (profile)')

Definition at line 34 of file Aida2RootEx.py.

Aida2RootEx.configure
def configure(gaudi=None)
Definition: Aida2RootEx.py:114
GaudiPython.Bindings
Definition: Bindings.py:1
HistoEx2.configure
def configure(gaudi=None)
Definition: HistoEx2.py:66
Aida2RootEx.useScript
def useScript(histos)
Definition: Aida2RootEx.py:139