| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

GaudiPython::Bindings Namespace Reference


Classes

class  InterfaceCast
class  Interface
class  PropertyEntry
class  iProperty
class  iService
class  iAlgorithm
class  iAlgTool
class  iDataSvc
class  iHistogramSvc
class  iNTupleSvc
class  iToolSvc
class  iJobOptSvc
class  iEventSelector
class  AppMgr
class  CallbackStreamBuf
class  PyAlgorithm

Functions

def deprecation
def loaddict
def getClass
def getComponentProperties
def _copyFactoriesFromList
def _atexit_

Variables

list __all__
tuple gbl = PyCintex.makeNamespace('')
 Gaudi = gbl.Gaudi
 _gaudi = None
 Helper = gbl.GaudiPython.Helper
tuple StringProperty = gbl.SimpleProperty('string','BoundedVerifier<string>')
tuple StringPropertyRef = gbl.SimplePropertyRef('string','NullVerifier<string>')
 GaudiHandleProperty = gbl.GaudiHandleProperty
 GaudiHandleArrayProperty = gbl.GaudiHandleArrayProperty
 DataObject = gbl.DataObject
tuple SUCCESS = gbl.StatusCode( gbl.StatusCode.SUCCESS, True )
tuple FAILURE = gbl.StatusCode( gbl.StatusCode.FAILURE, True )
tuple toArray = lambdatyp:getattr(Helper,"toArray")
tuple toArray = lambdatyp:getattr(Helper,"toArray<%s>"%typ)
 ROOT = PyCintex.libPyROOT
 makeNullPointer = PyCintex.libPyROOT.MakeNullPointer
 makeClass = PyCintex.libPyROOT.MakeRootClass
 setOwnership = PyCintex.libPyROOT.SetOwnership
 _CallbackStreamBufBase = gbl.GaudiPython.CallbackStreamBuf
 _PyAlgorithm = gbl.GaudiPython.PyAlgorithm

Function Documentation

def GaudiPython::Bindings::deprecation (   message  ) 

Definition at line 61 of file Bindings.py.

00061                         :
00062   warnings.warn('GaudiPython: '+ message, DeprecationWarning, stacklevel=3)
00063 
00064 #----InterfaceCast class ----------------------------------------------------------------
class InterfaceCast(object) :

def GaudiPython::Bindings::loaddict (   dict  ) 

Load a LCG dictionary using various mechanisms

Definition at line 87 of file Bindings.py.

00087                    :
00088   """ Load a LCG dictionary using various mechanisms"""
00089   if Helper.loadDynamicLib(dict) == 1 : return
00090   else :
00091     try: 
00092       PyCintex.loadDict(dict)
00093     except: 
00094       raise ImportError, 'Error loading dictionary library'
00095 
00096 #---get a class (by loading modules if needed)--------------------------------------------
def getClass( name , libs = [] ) :

def GaudiPython::Bindings::getClass (   name,
  libs = [] 
)

Function to retrieve a certain C++ class by name and to load dictionary if requested 

Usage:

from gaudimodule import getClass 
# one knows that class is already loaded 
AppMgr     = getClass( 'ApplicationMgr'           )
# one knows where to look for class, if not loaded yet  
MCParticle = getClass( 'MCParticle' , 'EventDict' )
# one knows where to look for class, if not loaded yet 
Vertex     = getClass( 'Vertex' , ['EventDict', 'PhysEventDict'] )

Definition at line 97 of file Bindings.py.

00097                                  :
00098     """ 
00099     Function to retrieve a certain C++ class by name and to load dictionary if requested 
00100 
00101     Usage:
00102 
00103     from gaudimodule import getClass 
00104     # one knows that class is already loaded 
00105     AppMgr     = getClass( 'ApplicationMgr'           )
00106     # one knows where to look for class, if not loaded yet  
00107     MCParticle = getClass( 'MCParticle' , 'EventDict' )
00108     # one knows where to look for class, if not loaded yet 
00109     Vertex     = getClass( 'Vertex' , ['EventDict', 'PhysEventDict'] )
00110     """
00111     # see if class is already loaded
00112     if hasattr( gbl , name )  : return getattr( gbl , name )   
00113     # try to load dictionaries and  look for the required class
00114     if type(libs) is not list : libs = [libs]
00115     for lib in libs :
00116       loaddict( lib )
00117       if hasattr( gbl , name ) : return getattr( gbl , name )
00118     # return None ( or raise exception? I do not know...  )
00119     return None
00120 
00121 #----PropertyEntry class---------------------------------------------------------------------
class PropertyEntry(object) :

def GaudiPython::Bindings::getComponentProperties (   name  ) 

Get all the properties of a component as a Python dictionary. 
    The component is instantiated using the component library

Definition at line 859 of file Bindings.py.

00859                                   :
00860   """ Get all the properties of a component as a Python dictionary. 
00861       The component is instantiated using the component library
00862   """
00863   properties = {}
00864   if name == 'GaudiSvc' :
00865     if Helper.loadDynamicLib(name) != 1 :
00866       raise ImportError,  'Error loading component library '+ name
00867     factorylist = gbl.FactoryTable.instance().getEntries()
00868     factories = _copyFactoriesFromList(factorylist)
00869     g = AppMgr(outputlevel=7)     
00870   else :
00871     g = AppMgr(outputlevel=7) 
00872     if Helper.loadDynamicLib(name) != 1 :
00873       raise ImportError,  'Error loading component library '+ name
00874     factorylist = gbl.FactoryTable.instance().getEntries()
00875     factories = _copyFactoriesFromList(factorylist)
00876   svcloc    = gbl.Gaudi.svcLocator()
00877   dummysvc  = gbl.Service('DummySvc',svcloc)
00878   for factory in factories :
00879     if    InterfaceCast(gbl.IAlgFactory)(factory) : ctype = 'Algorithm'
00880     elif  InterfaceCast(gbl.ISvcFactory)(factory) : ctype = 'Service'
00881     elif  InterfaceCast(gbl.IToolFactory)(factory) : ctype = 'AlgTool'
00882     elif  factory.ident() == 'ApplicationMgr' :  ctype = 'ApplicationMgr'
00883     else :  ctype = 'Unknown'
00884     cname = factory.ident().split()[-1]
00885     if ctype in ('Algorithm','Service', 'AlgTool', 'ApplicationMgr') :
00886       try :
00887         if ctype == 'AlgTool' :
00888           obj = factory.instantiate(dummysvc)
00889         else :
00890           obj = factory.instantiate(svcloc)
00891       except RuntimeError, text :
00892         print 'Error instantiating', cname, ' from ', name
00893         print text
00894         continue
00895       prop = iProperty('dummy', obj)
00896       properties[cname] = [ctype, prop.properties()]
00897       try:  obj.release()
00898       except: pass
00899   return properties
00900 
def _copyFactoriesFromList(factories) :

def GaudiPython::Bindings::_copyFactoriesFromList (   factories  )  [private]

Definition at line 901 of file Bindings.py.

00901                                       :
00902   result = []
00903   for i in range(factories.size()) :
00904     factory = factories.front()
00905     result.append(factory)
00906     factories.pop_front()
00907   for factory in result :
00908     factories.push_back(factory)
00909   return result
00910 
00911 #----CallbackStreamBuf----------------------------------------------------------------
00912 #    Used for redirecting C++ messages to python
_CallbackStreamBufBase = gbl.GaudiPython.CallbackStreamBuf

def GaudiPython::Bindings::_atexit_ (  )  [private]

Definition at line 949 of file Bindings.py.

00949                :
00950   if _gaudi :
00951     state = _gaudi.FSMState()
00952     if state in [ Gaudi.StateMachine.CONFIGURED, Gaudi.StateMachine.INITIALIZED,
00953                   Gaudi.StateMachine.RUNNING ]:
00954         _gaudi.exit()
00955 atexit.register( _atexit_ )
00956   
00957 #----Enable tab completion------------------------------------------------------------
00958 try:
00959   import rlcompleter,readline    
00960   readline.parse_and_bind("tab: complete")
00961 except:
00962   pass
00963 


Variable Documentation

list GaudiPython::Bindings::__all__ [static]

Initial value:

[ 'gbl','InterfaceCast', 'Interface', 'PropertyEntry',
            'AppMgr', 'PyAlgorithm', 'CallbackStreamBuf',
            'iAlgorithm', 'iDataSvc', 'iHistogramSvc','iNTupleSvc','iService', 'iAlgTool', 'Helper', 
            'SUCCESS', 'FAILURE', 'toArray',
            'ROOT', 'makeNullPointer', 'makeClass', 'setOwnership',
            'getClass', 'loaddict', 'deprecation' ]

Definition at line 11 of file Bindings.py.

tuple GaudiPython::Bindings::gbl = PyCintex.makeNamespace('') [static]

Definition at line 26 of file Bindings.py.

GaudiPython::Bindings::Gaudi = gbl.Gaudi [static]

Definition at line 27 of file Bindings.py.

GaudiPython::Bindings::_gaudi = None [static]

Definition at line 29 of file Bindings.py.

GaudiPython::Bindings::Helper = gbl.GaudiPython.Helper [static]

Definition at line 33 of file Bindings.py.

tuple GaudiPython::Bindings::StringProperty = gbl.SimpleProperty('string','BoundedVerifier<string>') [static]

Definition at line 34 of file Bindings.py.

tuple GaudiPython::Bindings::StringPropertyRef = gbl.SimplePropertyRef('string','NullVerifier<string>') [static]

Definition at line 35 of file Bindings.py.

GaudiPython::Bindings::GaudiHandleProperty = gbl.GaudiHandleProperty [static]

Definition at line 36 of file Bindings.py.

GaudiPython::Bindings::GaudiHandleArrayProperty = gbl.GaudiHandleArrayProperty [static]

Definition at line 37 of file Bindings.py.

GaudiPython::Bindings::DataObject = gbl.DataObject [static]

Definition at line 38 of file Bindings.py.

tuple GaudiPython::Bindings::SUCCESS = gbl.StatusCode( gbl.StatusCode.SUCCESS, True ) [static]

Definition at line 39 of file Bindings.py.

tuple GaudiPython::Bindings::FAILURE = gbl.StatusCode( gbl.StatusCode.FAILURE, True ) [static]

Definition at line 40 of file Bindings.py.

tuple GaudiPython::Bindings::toArray = lambdatyp:getattr(Helper,"toArray") [static]

Definition at line 50 of file Bindings.py.

tuple GaudiPython::Bindings::toArray = lambdatyp:getattr(Helper,"toArray<%s>"%typ) [static]

Definition at line 53 of file Bindings.py.

GaudiPython::Bindings::ROOT = PyCintex.libPyROOT [static]

Definition at line 56 of file Bindings.py.

GaudiPython::Bindings::makeNullPointer = PyCintex.libPyROOT.MakeNullPointer [static]

Definition at line 57 of file Bindings.py.

GaudiPython::Bindings::makeClass = PyCintex.libPyROOT.MakeRootClass [static]

Definition at line 58 of file Bindings.py.

GaudiPython::Bindings::setOwnership = PyCintex.libPyROOT.SetOwnership [static]

Definition at line 59 of file Bindings.py.

GaudiPython::Bindings::_CallbackStreamBufBase = gbl.GaudiPython.CallbackStreamBuf [static]

Definition at line 913 of file Bindings.py.

GaudiPython::Bindings::_PyAlgorithm = gbl.GaudiPython.PyAlgorithm [static]

Definition at line 925 of file Bindings.py.

| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:58:57 2011 for GaudiPython by doxygen 1.4.7