| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Member Functions | Public Attributes | Static Public Attributes | List of all members
GaudiPython.Bindings.AppMgr Class Reference
Inheritance diagram for GaudiPython.Bindings.AppMgr:
[legend]
Collaboration diagram for GaudiPython.Bindings.AppMgr:
[legend]

## Public Member Functions
def | __new__ (cls, args, kwargs)
def | __reset__ (self)
def | __init__ (self, outputlevel=-1, joboptions=None, selfoptions={}, dllname=None, factname=None)
def | state (self)
def | FSMState (self)
def | targetFSMState (self)
def | service (self, name, interface=None)
def | declSvcType (self, svcname, svctype)
def | createSvc (self, name)
def | services (self)
def | algorithm (self, name, createIf=False)
def | algorithms (self)
def | tool (self, name)
def | property (self, name)
def | datasvc (self, name)
def | evtsvc (self)
def | detsvc (self)
def | filerecordsvc (self)
def | evtsel (self)
def | histsvc (self, name='HistogramDataSvc')
def | ntuplesvc (self, name='NTupleSvc')
def | partsvc (self)
def | toolsvc (self, name='ToolSvc')
def | optSvc (self, name='JobOptionsSvc')
def | readOptions (self, file)
def | addAlgorithm (self, alg)
def | setAlgorithms (self, algs)
def | removeAlgorithm (self, alg)
def | printAlgsSequences (self)
def | config (self, args)
def | configure (self)
def | start (self)
def | terminate (self)
def | run (self, n)
def | executeEvent (self)
def | execute (self)
def | runSelectedEvents (self, pfn, events)
def | exit (self)
def | __del__ (self)
| Custom destructor to ensure that the application is correctly finalized when exiting from python. More...
Public Member Functions inherited from GaudiPython.Bindings.iService
def | __init__ (self, name, isvc=None)
def | retrieveInterface (self)
def | isValid (self)
Public Member Functions inherited from GaudiPython.Bindings.iProperty
def | __init__ (self, name, ip=None)
def | getInterface (self)
def | retrieveInterface (self)
def | __call_interface_method__ (self, ifname, method, args)
def | __setattr__ (self, name, value)
def | __getattr__ (self, name)
def | properties (self)
def | name (self)

## Public Attributes
| JobOptionsType
| OutputLevel
| topAlg

## Static Public Attributes
| evtSvc = evtsvc
| histSvc = histsvc
| ntupleSvc = ntuplesvc
| evtSel = evtsel
| detSvc = detsvc
| toolSvc = toolsvc
| partSvc = partsvc
Static Public Attributes inherited from GaudiPython.Bindings.iService
| initialize = lambdaself:self.__call_interface_method__("_isvc","initialize")
| start = lambdaself:self.__call_interface_method__("_isvc","start")
| stop = lambdaself:self.__call_interface_method__("_isvc","stop")
| finalize = lambdaself:self.__call_interface_method__("_isvc","finalize")
| reinitialize = lambdaself:self.__call_interface_method__("_isvc","reinitialize")
| restart = lambdaself:self.__call_interface_method__("_isvc","restart")

## Detailed Description

Definition at line 662 of file Bindings.py.

## Constructor & Destructor Documentation

def GaudiPython.Bindings.AppMgr.__init__ | ( |  | self,
|  |  | outputlevel = `-1`,
|  |  | joboptions = `None`,
|  |  | selfoptions = `{}`,
|  |  | dllname = `None`,
|  |  | factname = `None`
| ) |  |

Definition at line 684 of file Bindings.py.

684 dllname = None, factname = None) :
685 global _gaudi
686 if _gaudi : return
687 # Protection against multiple calls to exit() if the finalization fails
688 self.__dict__['_exit_called'] = False
689 # keep the Gaudi namespace around (so it is still available during atexit shutdown)...
690 self.__dict__['_gaudi_ns'] = Gaudi
691 try:
692 from GaudiKernel.Proxy.Configurable import expandvars
693 except ImportError:
694 # pass-through implementation if expandvars is not defined (AthenaCommon)
695 expandvars = lambda data : data
696 if dllname and factname:
697 self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr(dllname,factname)
698 elif dllname:
699 self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr(dllname)
700 else:
701 self.__dict__['_appmgr'] = gbl.Gaudi.createApplicationMgr()
702 self.__dict__['_svcloc'] = gbl.Gaudi.svcLocator()
703 self.__dict__['_algmgr'] = InterfaceCast(gbl.IAlgManager)(self._appmgr)
704 self.__dict__['_evtpro'] = InterfaceCast(gbl.IEventProcessor)(self._appmgr)
705 self.__dict__['_svcmgr'] = InterfaceCast(gbl.ISvcManager)(self._appmgr)
706 self.__dict__['pyalgorithms'] = []
707 iService.__init__(self, 'ApplicationMgr', self._appmgr )
708 #------python specific initialization-------------------------------------
709 if self.FSMState() < Gaudi.StateMachine.CONFIGURED : # Not yet configured
710 self.JobOptionsType = 'NONE'
711 if joboptions :
712 from GaudiKernel.ProcessJobOptions import importOptions
713 importOptions(joboptions)
714 # Ensure that the ConfigurableUser instances have been applied
715 import GaudiKernel.Proxy.Configurable
716 if hasattr(GaudiKernel.Proxy.Configurable, "applyConfigurableUsers"):
717 GaudiKernel.Proxy.Configurable.applyConfigurableUsers()
718 # This is the default and could be overridden with "selfopts"
719 self.OutputLevel = 3
720 selfprops = Configurable.allConfigurables.get('ApplicationMgr',{})
721 if selfprops : selfprops = expandvars(selfprops.getValuedProperties())
722 for p,v in selfprops.items() : setattr(self, p, v)
723 for p,v in selfoptions.items() : setattr(self, p, v)
724 # Override job options
725 if outputlevel != -1 : self.OutputLevel = outputlevel
726 self.configure()
727 #---MessageSvc------------------------------------------------------------
728 ms = self.service('MessageSvc')
729 if 'MessageSvc' in Configurable.allConfigurables:
730 msprops = Configurable.allConfigurables['MessageSvc']
731 ms = self.service('MessageSvc')
732 if hasattr(msprops,"getValuedProperties"):
733 msprops = expandvars(msprops.getValuedProperties())
734 for p,v in msprops.items():
735 setattr(ms, p, v)
736 if outputlevel != -1 : ms.OutputLevel = outputlevel
737 #---JobOptions------------------------------------------------------------
738 self.__dict__['_optsvc'] = InterfaceCast(gbl.IJobOptionsSvc)(Helper.service(self._svcloc,'JobOptionsSvc'))
739 #------Configurables initialization (part2)-------------------------------
740 mkStringProperty = gbl.GaudiPython.Helpers.mkStringProperty
741 for n in getNeededConfigurables():
742 c = Configurable.allConfigurables[n]
743 if n in ['ApplicationMgr','MessageSvc'] : continue # These are already done---
744 for p, v in c.getValuedProperties().items() :
745 v = expandvars(v)
746 # Note: AthenaCommon.Configurable does not have Configurable.PropertyReference
747 if hasattr(Configurable,"PropertyReference") and type(v) == Configurable.PropertyReference:
748 # this is done in "getFullName", but the exception is ignored,
749 # so we do it again to get it
750 v = v.__resolve__()
751 if type(v) == str : v = '"%s"' % v # need double quotes
752 elif type(v) == long: v = '%d' % v # prevent pending 'L'
753 self._optsvc.addPropertyToCatalogue(n, mkStringProperty(p,str(v)))
754 if hasattr(Configurable,"_configurationLocked"):
755 Configurable._configurationLocked = True
756
757 # Ensure that the exit method is called when exiting from Python
758 import atexit
759 atexit.register(self.exit)
760
761 #---Hack to avoid bad interactions with the ROOT exit handler
762 # Look for an exit handler installed by ROOT
763 root_handler_installed = False
764 for h in atexit._exithandlers:
765 func = h[0]
766 if hasattr(func, "__module__") and func.__module__ == "ROOT":
767 root_handler_installed = True
768 break
769
770 # If the handler is not yet installed, let's install our private version
771 # that detects that the ROOT exit handler is installed and add our own
772 # after it to ensure it is called before.
773 if not root_handler_installed:
774 orig_register = atexit.register
775 def register(func, *targs, **kargs):
776 orig_register(func, *targs, **kargs)
777 if hasattr(func, "__module__") and func.__module__ == "ROOT":
778 orig_register(self.exit)
779 # we do not need to remove out handler from the list because
780 # it can be safely called more than once
781 register.__doc__ = (orig_register.__doc__ +
782 "\nNote: version hacked by GaudiPython to work " +
783 "around a problem with the ROOT exit handler")
784 atexit.register = register
785
GaudiPython.Bindings.AppMgr.FSMState
def FSMState(self)
Definition: Bindings.py:787
GaudiPython.Bindings.InterfaceCast
Definition: Bindings.py:86
GaudiPython.Bindings.AppMgr.JobOptionsType
JobOptionsType
Definition: Bindings.py:710
GaudiKernel.Proxy.getNeededConfigurables
getNeededConfigurables
Definition: Proxy.py:19
GaudiPython.Bindings.AppMgr.exit
def exit(self)
Definition: Bindings.py:1011
GaudiKernel.ProcessJobOptions
Definition: ProcessJobOptions.py:1
GaudiPython.Bindings.AppMgr.service
def service(self, name, interface=None)
Definition: Bindings.py:789
gaudirun.type
type
Definition: gaudirun.py:125
GaudiKernel.ProcessJobOptions.importOptions
def importOptions(optsfile)
Definition: ProcessJobOptions.py:432
GaudiPython.Bindings.AppMgr.OutputLevel
OutputLevel
Definition: Bindings.py:719
GaudiPython.Bindings.AppMgr.configure
def configure(self)
Definition: Bindings.py:964
GaudiKernel.Configurable.expandvars
def expandvars(data)
Definition: Configurable.py:34

def GaudiPython.Bindings.AppMgr.__del__ | ( |  | self | ) |

Custom destructor to ensure that the application is correctly finalized when exiting from python.

Definition at line 1024 of file Bindings.py.

1024 def __del__(self):
1025 self.exit()
GaudiPython.Bindings.AppMgr.exit
def exit(self)
Definition: Bindings.py:1011
GaudiPython.Bindings.AppMgr.__del__
def __del__(self)
Custom destructor to ensure that the application is correctly finalized when exiting from python...
Definition: Bindings.py:1024

## Member Function Documentation

def GaudiPython.Bindings.AppMgr.__new__ | ( |  | cls,
|  |  | args,
|  |  | kwargs
| ) |  |

Definition at line 663 of file Bindings.py.

663 def __new__ ( cls, *args, **kwargs ):
664 global _gaudi
665 if not _gaudi :
666 newobj = object.__new__( cls )
667 cls.__init__(newobj, *args, **kwargs)
668 _gaudi = newobj
669 return _gaudi
GaudiPython.Bindings.iProperty.__init__
def __init__(self, name, ip=None)
Definition: Bindings.py:188
GaudiPython.Bindings.AppMgr.__new__
def __new__(cls, args, kwargs)
Definition: Bindings.py:663

def GaudiPython.Bindings.AppMgr.__reset__ | ( |  | self | ) |

Definition at line 670 of file Bindings.py.

670 def __reset__(self):
671 global _gaudi
672 # Stop, Finalize and Terminate the current AppMgr
673 self.exit()
674 # release interfaces
675 self._evtpro.release()
676 self._svcloc.release()
677 self._appmgr.release()
678 # Reset the C++ globals
679 gbl.Gaudi.setInstance(makeNullPointer('ISvcLocator'))
680 gbl.Gaudi.setInstance(makeNullPointer('IAppMgrUI'))
681 # Reset the Python global
682 _gaudi = None
GaudiPython.Bindings.AppMgr.__reset__
def __reset__(self)
Definition: Bindings.py:670
GaudiPython.Bindings.AppMgr.exit
def exit(self)
Definition: Bindings.py:1011
GaudiPython.Bindings.makeNullPointer
makeNullPointer
Definition: Bindings.py:79

def GaudiPython.Bindings.AppMgr.addAlgorithm | ( |  | self,
|  |  | alg
| ) |  |

    Add an Algorithm to the list of Top algorithms. It can be either a instance of
        an Algorithm class or it name

Definition at line 849 of file Bindings.py.

849 def addAlgorithm(self, alg) :
850 """ Add an Algorithm to the list of Top algorithms. It can be either a instance of
851 an Algorithm class or it name """
852 if type(alg) is str :
853 self.topAlg += [alg]
854 else :
855 self.pyalgorithms.append(alg)
856 setOwnership(alg,0)
857 if self.targetFSMState() >= Gaudi.StateMachine.INITIALIZED :
858 alg.sysInitialize()
859 if self.targetFSMState() == Gaudi.StateMachine.RUNNING :
860 alg.sysStart()
861 self.topAlg += [alg.name()]
GaudiPython.Bindings.AppMgr.targetFSMState
def targetFSMState(self)
Definition: Bindings.py:788
gaudirun.type
type
Definition: gaudirun.py:125
GaudiPython.Bindings.AppMgr.addAlgorithm
def addAlgorithm(self, alg)
Definition: Bindings.py:849
GaudiPython.Bindings.setOwnership
setOwnership
Definition: Bindings.py:80
GaudiPython.Bindings.AppMgr.topAlg
topAlg
Definition: Bindings.py:876

def GaudiPython.Bindings.AppMgr.algorithm | ( |  | self,
|  |  | name,
|  |  | createIf = `False`
| ) |  |

Definition at line 802 of file Bindings.py.

802 def algorithm(self, name , createIf = False ) :
803 alg = Helper.algorithm( self._algmgr, name , createIf )
804 if not alg : return iAlgorithm ( name , alg )
805 else : return iAlgorithm ( alg.name() , alg )
GaudiPython.Bindings.AppMgr.algorithm
def algorithm(self, name, createIf=False)
Definition: Bindings.py:802

def GaudiPython.Bindings.AppMgr.algorithms | ( |  | self | ) |

Definition at line 806 of file Bindings.py.

806 def algorithms(self) :
807 l = self._algmgr.getAlgorithms()
808 return [a.name() for a in l]
GaudiPython.Bindings.AppMgr.algorithms
def algorithms(self)
Definition: Bindings.py:806

def GaudiPython.Bindings.AppMgr.config | ( |  | self,
|  |  | args
| ) |  |

    Simple utility to perform the configuration of Gaudi application.
    It reads the set of input job-options files, and set few
    additional parameters 'options' through the usage of temporary *.opts file
    Usage:
    gaudi.config( files   = [ '$GAUSSOPTS/Gauss.opts'                     ,
                      '$DECFILESROOT/options/10022_010.0GeV.opts' ] ,
          options = [ 'EventSelector.PrintFreq   =   5  '         ] )

Definition at line 904 of file Bindings.py.

904 def config ( self, **args ):
905 """
906 Simple utility to perform the configuration of Gaudi application.
907 It reads the set of input job-options files, and set few
908 additional parameters 'options' through the usage of temporary *.opts file
909 Usage:
910 gaudi.config( files = [ '$GAUSSOPTS/Gauss.opts' ,
911 '$DECFILESROOT/options/10022_010.0GeV.opts' ] ,
912 options = [ 'EventSelector.PrintFreq = 5 ' ] )
913 """
914 files = args.get('files',[])
915 for file in files :
916 sc = self.readOptions(file)
917 if sc.isFailure() :
918 raise RuntimeError , ' Unable to read file "' + file +'" '
919 options = args.get('options',None)
920 if options :
921 import tempfile
922 tmpfilename = tempfile.mktemp()
923 tmpfile = open( tmpfilename, 'w' )
924 tmpfile.write ( '#pragma print on \n' )
925 tmpfile.write ( '/// File "' + tmpfilename+'" generated by GaudiPython \n\n' )
926 for opt in options :
927 if type(options) is dict :
928 tmpfile.write( ' \t ' + opt + ' = '+ options[opt]+ ' ; // added by GaudiPython \n' )
929 else :
930 tmpfile.write( ' \t ' + opt + ' ; // added by GaudiPython \n' )
931 tmpfile.write ( '/// End of file "' + tmpfilename+'" generated by GaudiPython \n\n' )
932 tmpfile.close()
933 sc = self.readOptions( tmpfilename )
934 if sc.isFailure() :
935 raise RuntimeError , ' Unable to read file "' + tmpfilename +'" '
936 os.remove( tmpfilename )
937 # We need to make sure that the options are taken by the ApplicationMgr
938 if self.FSMState() != Gaudi.StateMachine.OFFLINE : # The state is already configured, so we need to do something....
939
940 ## get job-options-service, @see class iJobOptSvc
941 jos = self.optSvc()
942
943 ## list of all libraries
944 _dlls = jos.getProperty ( self.name() , 'DLLs' )
945 ## take care about libraries : APPEND if not done yet
946 if _dlls :
947 libs = [ l for l in _dlls if not l in self.DLLs ]
948 if libs : self.DLLs += libs
949
950 ## all external services
951 _svcs = jos.getProperty ( self.name() , 'ExtSvc' )
952 ## take care about services : APPEND if not done yet
953 if _svcs :
954 svcs = [ s for s in _svcs if not s in self.ExtSvc ]
955 if svcs : self.ExtSvc += svcs
956
957 ## get all properties
958 props = jos.getProperties ( self.name() )
959 ## finally treat all other properties (presumably scalar properties)
960 for key in props :
961 if 'DLLS' == key or 'EXTSVC' == key : continue
962 self.__setattr__( key , props[key] )
963 return SUCCESS # RETURN
GaudiPython.Bindings.AppMgr.FSMState
def FSMState(self)
Definition: Bindings.py:787
GaudiPython.Bindings.iProperty.name
def name(self)
Definition: Bindings.py:289
gaudirun.type
type
Definition: gaudirun.py:125
GaudiPython.Bindings.AppMgr.config
def config(self, args)
Definition: Bindings.py:904
GaudiPython.Bindings.AppMgr.optSvc
def optSvc(self, name='JobOptionsSvc')
Definition: Bindings.py:844
GaudiPython.Bindings.AppMgr.readOptions
def readOptions(self, file)
Definition: Bindings.py:847
GaudiPython.Bindings.iProperty.__setattr__
def __setattr__(self, name, value)
Definition: Bindings.py:204

def GaudiPython.Bindings.AppMgr.configure | ( |  | self | ) |

Definition at line 964 of file Bindings.py.

964 def configure(self) :
965 return self._appmgr.configure()
GaudiPython.Bindings.AppMgr.configure
def configure(self)
Definition: Bindings.py:964

def GaudiPython.Bindings.AppMgr.createSvc | ( |  | self,
|  |  | name
| ) |  |

Definition at line 797 of file Bindings.py.

797 def createSvc(self, name ) :
798 return Helper.service( self._svcloc, name, True )
GaudiPython.Bindings.AppMgr.createSvc
def createSvc(self, name)
Definition: Bindings.py:797

def GaudiPython.Bindings.AppMgr.datasvc | ( |  | self,
|  |  | name
| ) |  |

Definition at line 815 of file Bindings.py.

815 def datasvc(self, name) :
816 if self.state() == Gaudi.StateMachine.CONFIGURED : self.initialize()
817 svc = Helper.service( self._svcloc, name )
818 return iDataSvc(name, svc)
GaudiPython.Bindings.iDataSvc
Definition: Bindings.py:357
GaudiPython.Bindings.AppMgr.state
def state(self)
Definition: Bindings.py:786
GaudiPython.Bindings.iService.initialize
initialize
Definition: Bindings.py:302
GaudiPython.Bindings.AppMgr.datasvc
def datasvc(self, name)
Definition: Bindings.py:815

def GaudiPython.Bindings.AppMgr.declSvcType | ( |  | self,
|  |  | svcname,
|  |  | svctype
| ) |  |

Definition at line 795 of file Bindings.py.

795 def declSvcType(self, svcname, svctype ) :
796 self._svcmgr.declareSvcType(svcname, svctype)
GaudiPython.Bindings.AppMgr.declSvcType
def declSvcType(self, svcname, svctype)
Definition: Bindings.py:795

def GaudiPython.Bindings.AppMgr.detsvc | ( |  | self | ) |

Definition at line 821 of file Bindings.py.

821 def detsvc(self) :
822 return self.datasvc('DetectorDataSvc')
GaudiPython.Bindings.AppMgr.detsvc
def detsvc(self)
Definition: Bindings.py:821
GaudiPython.Bindings.AppMgr.datasvc
def datasvc(self, name)
Definition: Bindings.py:815

def GaudiPython.Bindings.AppMgr.evtsel | ( |  | self | ) |

Definition at line 825 of file Bindings.py.

825 def evtsel(self):
826 if self.state() == Gaudi.StateMachine.CONFIGURED : self.initialize()
827 if not hasattr(self,'_evtsel') : self.__dict__['_evtsel'] = iEventSelector()
828 return self._evtsel
GaudiPython.Bindings.AppMgr.state
def state(self)
Definition: Bindings.py:786
GaudiPython.Bindings.iService.initialize
initialize
Definition: Bindings.py:302
GaudiPython.Bindings.AppMgr.evtsel
def evtsel(self)
Definition: Bindings.py:825
GaudiPython.Bindings.iEventSelector
Definition: Bindings.py:647

def GaudiPython.Bindings.AppMgr.evtsvc | ( |  | self | ) |

Definition at line 819 of file Bindings.py.

819 def evtsvc(self) :
820 return self.datasvc('EventDataSvc')
GaudiPython.Bindings.AppMgr.datasvc
def datasvc(self, name)
Definition: Bindings.py:815
GaudiPython.Bindings.AppMgr.evtsvc
def evtsvc(self)
Definition: Bindings.py:819

def GaudiPython.Bindings.AppMgr.execute | ( |  | self | ) |

Definition at line 982 of file Bindings.py.

982 def execute(self) :
983 return self._evtpro.executeEvent()
GaudiPython.Bindings.AppMgr.execute
def execute(self)
Definition: Bindings.py:982

def GaudiPython.Bindings.AppMgr.executeEvent | ( |  | self | ) |

Definition at line 980 of file Bindings.py.

980 def executeEvent(self) :
981 return self._evtpro.executeEvent()
GaudiPython.Bindings.AppMgr.executeEvent
def executeEvent(self)
Definition: Bindings.py:980

def GaudiPython.Bindings.AppMgr.exit | ( |  | self | ) |

Definition at line 1011 of file Bindings.py.

1011 def exit(self):
1012 # Protection against multiple calls to exit() if the finalization fails
1013 if not self._exit_called:
1014 self.__dict__['_exit_called'] = True
1015 Gaudi = self._gaudi_ns
1016 if self.FSMState() == Gaudi.StateMachine.RUNNING:
1017 self._appmgr.stop().ignore()
1018 if self.FSMState() == Gaudi.StateMachine.INITIALIZED:
1019 self._appmgr.finalize().ignore()
1020 if self.FSMState() == Gaudi.StateMachine.CONFIGURED:
1021 self._appmgr.terminate()
1022 return SUCCESS
GaudiPython.Bindings.AppMgr.FSMState
def FSMState(self)
Definition: Bindings.py:787
GaudiPython.Bindings.AppMgr.exit
def exit(self)
Definition: Bindings.py:1011

def GaudiPython.Bindings.AppMgr.filerecordsvc | ( |  | self | ) |

Definition at line 823 of file Bindings.py.

823 def filerecordsvc(self) :
824 return self.datasvc('FileRecordDataSvc')
GaudiPython.Bindings.AppMgr.filerecordsvc
def filerecordsvc(self)
Definition: Bindings.py:823
GaudiPython.Bindings.AppMgr.datasvc
def datasvc(self, name)
Definition: Bindings.py:815

def GaudiPython.Bindings.AppMgr.FSMState | ( |  | self | ) |

Definition at line 787 of file Bindings.py.

787 def FSMState(self) : return self._isvc.FSMState()
GaudiPython.Bindings.AppMgr.FSMState
def FSMState(self)
Definition: Bindings.py:787

def GaudiPython.Bindings.AppMgr.histsvc | ( |  | self,
|  |  | name = `'HistogramDataSvc'`
| ) |  |

Definition at line 829 of file Bindings.py.

829 def histsvc(self, name='HistogramDataSvc') :
830 svc = Helper.service( self._svcloc, name )
831 return iHistogramSvc(name, svc)
GaudiPython.Bindings.AppMgr.histsvc
def histsvc(self, name='HistogramDataSvc')
Definition: Bindings.py:829
GaudiPython.Bindings.iHistogramSvc
Definition: Bindings.py:482

def GaudiPython.Bindings.AppMgr.ntuplesvc | ( |  | self,
|  |  | name = `'NTupleSvc'`
| ) |  |

Definition at line 832 of file Bindings.py.

832 def ntuplesvc(self, name='NTupleSvc') :
833 if name not in self.ExtSvc : self.ExtSvc += [name]
834 # if self.HistogramPersistency == 'NONE' : self.HistogramPersistency = 'ROOT'
835 svc = Helper.service( self._svcloc, name, True )
836 return iNTupleSvc(name, svc)
GaudiPython.Bindings.AppMgr.ntuplesvc
def ntuplesvc(self, name='NTupleSvc')
Definition: Bindings.py:832
GaudiPython.Bindings.iNTupleSvc
Definition: Bindings.py:551

def GaudiPython.Bindings.AppMgr.optSvc | ( |  | self,
|  |  | name = `'JobOptionsSvc'`
| ) |  |

Definition at line 844 of file Bindings.py.

844 def optSvc (self, name='JobOptionsSvc') :
845 svc = Helper.service( self._svcloc, name, True )
846 return iJobOptSvc(name, svc)
GaudiPython.Bindings.iJobOptSvc
Definition: Bindings.py:608
GaudiPython.Bindings.AppMgr.optSvc
def optSvc(self, name='JobOptionsSvc')
Definition: Bindings.py:844

def GaudiPython.Bindings.AppMgr.partsvc | ( |  | self | ) |

Definition at line 837 of file Bindings.py.

837 def partsvc(self ) :
838 if self.FSMState() == Gaudi.StateMachine.CONFIGURED : self.initialize()
839 svc = Helper.service( self._svcloc, 'ParticlePropertySvc' )
840 return InterfaceCast(gbl.IParticlePropertySvc)(svc)
GaudiPython.Bindings.AppMgr.FSMState
def FSMState(self)
Definition: Bindings.py:787
GaudiPython.Bindings.InterfaceCast
Definition: Bindings.py:86
GaudiPython.Bindings.iService.initialize
initialize
Definition: Bindings.py:302
GaudiPython.Bindings.AppMgr.partsvc
def partsvc(self)
Definition: Bindings.py:837

def GaudiPython.Bindings.AppMgr.printAlgsSequences | ( |  | self | ) |

    Print the sequence of Algorithms.

Definition at line 888 of file Bindings.py.

888 def printAlgsSequences(self):
889 """
890 Print the sequence of Algorithms.
891 """
892 def printAlgo( algName, appMgr, prefix = ' ') :
893 print prefix + algName
894 alg = appMgr.algorithm( algName.split( "/" )[ -1 ] )
895 prop = alg.properties()
896 if prop.has_key( "Members" ) :
897 subs = prop[ "Members" ].value()
898 for i in subs : printAlgo( i.strip( '"' ), appMgr, prefix + " " )
899 mp = self.properties()
900 prefix = 'ApplicationMgr SUCCESS '
901 print prefix + "****************************** Algorithm Sequence ****************************"
902 for i in mp["TopAlg"].value(): printAlgo( i, self, prefix )
903 print prefix + "******************************************************************************"
GaudiPython.Bindings.AppMgr.printAlgsSequences
def printAlgsSequences(self)
Definition: Bindings.py:888
GaudiPython.Bindings.iProperty.properties
def properties(self)
Definition: Bindings.py:271

def GaudiPython.Bindings.AppMgr.property | ( |  | self,
|  |  | name
| ) |  |

Definition at line 811 of file Bindings.py.

811 def property( self , name ) :
812 if name in self.algorithms() : return self.algorithm( name )
813 elif name in self.services() : return self.service(name )
814 else : return iProperty( name )
GaudiPython.Bindings.AppMgr.services
def services(self)
Definition: Bindings.py:799
GaudiPython.Bindings.AppMgr.service
def service(self, name, interface=None)
Definition: Bindings.py:789
GaudiPython.Bindings.AppMgr.algorithm
def algorithm(self, name, createIf=False)
Definition: Bindings.py:802
GaudiPython.Bindings.iProperty
Definition: Bindings.py:186
GaudiPython.Bindings.AppMgr.algorithms
def algorithms(self)
Definition: Bindings.py:806
GaudiPython.Bindings.AppMgr.property
def property(self, name)
Definition: Bindings.py:811

def GaudiPython.Bindings.AppMgr.readOptions | ( |  | self,
|  |  | file
| ) |  |

Definition at line 847 of file Bindings.py.

847 def readOptions(self, file) :
848 return self._optsvc.readOptions(file)
GaudiPython.Bindings.AppMgr.readOptions
def readOptions(self, file)
Definition: Bindings.py:847

def GaudiPython.Bindings.AppMgr.removeAlgorithm | ( |  | self,
|  |  | alg
| ) |  |

    Remove an Algorithm to the list of Top algorithms. It can be either a instance of
        an Algorithm class or it name

Definition at line 877 of file Bindings.py.

877 def removeAlgorithm(self, alg) :
878 """ Remove an Algorithm to the list of Top algorithms. It can be either a instance of
879 an Algorithm class or it name """
880 tmp = self.topAlg
881 if type(alg) is str :
882 tmp.remove(alg)
883 else :
884 tmp.remove(alg.name())
885 self.pyalgorithms.remove(alg)
886 setOwnership(alg,1)
887 self.topAlg = tmp
GaudiPython.Bindings.AppMgr.removeAlgorithm
def removeAlgorithm(self, alg)
Definition: Bindings.py:877
gaudirun.type
type
Definition: gaudirun.py:125
GaudiPython.Bindings.setOwnership
setOwnership
Definition: Bindings.py:80
GaudiPython.Bindings.AppMgr.topAlg
topAlg
Definition: Bindings.py:876

def GaudiPython.Bindings.AppMgr.run | ( |  | self,
|  |  | n
| ) |  |

Definition at line 970 of file Bindings.py.

970 def run(self, n) :
971 if self.FSMState() == Gaudi.StateMachine.CONFIGURED :
972 sc = self.initialize()
973 if sc.isFailure() or self.ReturnCode != 0:
974 return sc
975 if self.FSMState() == Gaudi.StateMachine.INITIALIZED :
976 sc = self.start()
977 if sc.isFailure() or self.ReturnCode != 0:
978 return sc
979 return self._evtpro.executeRun(n)
GaudiPython.Bindings.AppMgr.FSMState
def FSMState(self)
Definition: Bindings.py:787
GaudiPython.Bindings.iService.initialize
initialize
Definition: Bindings.py:302
GaudiPython.Bindings.iService.start
start
Definition: Bindings.py:303
GaudiPython.Bindings.AppMgr.run
def run(self, n)
Definition: Bindings.py:970

def GaudiPython.Bindings.AppMgr.runSelectedEvents | ( |  | self,
|  |  | pfn,
|  |  | events
| ) |  |

Definition at line 984 of file Bindings.py.

984 def runSelectedEvents(self, pfn, events):
985 if self.FSMState() == Gaudi.StateMachine.CONFIGURED :
986 sc = self.initialize()
987 if sc.isFailure(): return sc
988 if self.FSMState() == Gaudi.StateMachine.INITIALIZED :
989 sc = self.start()
990 if sc.isFailure(): return sc
991 #--- Access a number of services ----
992 if not hasattr(self,'_perssvc'): self.__dict__['_perssvc'] = self.service('EventPersistencySvc','IAddressCreator')
993 if not hasattr(self,'_filecat'): self.__dict__['_filecat'] = self.service('FileCatalog','Gaudi::IFileCatalog')
994 if not hasattr(self,'_evtmgr'): self.__dict__['_evtmgr'] = self.service('EventDataSvc','IDataManagerSvc')
995 #--- Get FID from PFN and number of events in file
996 if pfn.find('PFN:') == 0: pfn = pfn[4:]
997 fid, maxevt = _getFIDandEvents(pfn)
998 #--- Add FID into catalog if needed ---
999 if not self._filecat.existsFID(fid) : self._filecat.registerPFN(fid, pfn, '')
1000 #--- Loop over events
1001 if type(events) is not list : events = (events,)
1002 for evt in events :
1003 #--- Create POOL Address from Generic Address
1004 gadd = gbl.GenericAddress(0x02, 1, fid, '/Event', 0, evt)
1005 oadd = makeNullPointer('IOpaqueAddress')
1006 self._perssvc.createAddress(gadd.svcType(),gadd.clID(),gadd.par(),gadd.ipar(),oadd)
1007 #--- Clear TES, set root and run all algorithms
1008 self._evtmgr.clearStore()
1009 self._evtmgr.setRoot('/Event',oadd)
1010 self._evtpro.executeEvent()
GaudiPython.Bindings.AppMgr.FSMState
def FSMState(self)
Definition: Bindings.py:787
GaudiPython.Bindings.AppMgr.runSelectedEvents
def runSelectedEvents(self, pfn, events)
Definition: Bindings.py:984
GaudiPython.Bindings._getFIDandEvents
def _getFIDandEvents(pfn)
Definition: Bindings.py:1035
GaudiPython.Bindings.iService.initialize
initialize
Definition: Bindings.py:302
GaudiPython.Bindings.AppMgr.service
def service(self, name, interface=None)
Definition: Bindings.py:789
GaudiPython.Bindings.makeNullPointer
makeNullPointer
Definition: Bindings.py:79
gaudirun.type
type
Definition: gaudirun.py:125
GaudiPython.Bindings.iService.start
start
Definition: Bindings.py:303

def GaudiPython.Bindings.AppMgr.service | ( |  | self,
|  |  | name,
|  |  | interface = `None`
| ) |  |

Definition at line 789 of file Bindings.py.

789 def service(self, name, interface = None) :
790 svc = Helper.service( self._svcloc, name )
791 if interface :
792 return InterfaceCast(interface)(svc)
793 else :
794 return iService(name, svc )
GaudiPython.Bindings.InterfaceCast
Definition: Bindings.py:86
GaudiPython.Bindings.AppMgr.service
def service(self, name, interface=None)
Definition: Bindings.py:789
GaudiPython.Bindings.iService
Definition: Bindings.py:293

def GaudiPython.Bindings.AppMgr.services | ( |  | self | ) |

Definition at line 799 of file Bindings.py.

799 def services(self) :
800 l = self._svcloc.getServices()
801 return [s.name() for s in l]
GaudiPython.Bindings.AppMgr.services
def services(self)
Definition: Bindings.py:799

def GaudiPython.Bindings.AppMgr.setAlgorithms | ( |  | self,
|  |  | algs
| ) |  |

    Set the list of Top Algorithms.
        It can be an individual of a list of algorithms names or instances

Definition at line 862 of file Bindings.py.

862 def setAlgorithms(self, algs) :
863 """ Set the list of Top Algorithms.
864 It can be an individual of a list of algorithms names or instances """
865 if type(algs) is not list : algs = [algs]
866 names = []
867 for alg in algs :
868 if type(alg) is str : names.append(alg)
869 else :
870 self.pyalgorithms.append(alg)
871 if self.targetFSMState() >= Gaudi.StateMachine.INITIALIZED :
872 alg.sysInitialize()
873 if self.targetFSMState() == Gaudi.StateMachine.RUNNING :
874 alg.sysStart()
875 names.append(alg.name())
876 self.topAlg = names
GaudiPython.Bindings.AppMgr.setAlgorithms
def setAlgorithms(self, algs)
Definition: Bindings.py:862
GaudiPython.Bindings.AppMgr.targetFSMState
def targetFSMState(self)
Definition: Bindings.py:788
gaudirun.type
type
Definition: gaudirun.py:125
GaudiPython.Bindings.AppMgr.topAlg
topAlg
Definition: Bindings.py:876

def GaudiPython.Bindings.AppMgr.start | ( |  | self | ) |

Definition at line 966 of file Bindings.py.

966 def start(self) :
967 return self._appmgr.start()
GaudiPython.Bindings.AppMgr.start
def start(self)
Definition: Bindings.py:966

def GaudiPython.Bindings.AppMgr.state | ( |  | self | ) |

Definition at line 786 of file Bindings.py.

786 def state(self) : return self._isvc.FSMState()
GaudiPython.Bindings.AppMgr.state
def state(self)
Definition: Bindings.py:786

def GaudiPython.Bindings.AppMgr.targetFSMState | ( |  | self | ) |

Definition at line 788 of file Bindings.py.

788 def targetFSMState(self) : return self._isvc.targetFSMState()
GaudiPython.Bindings.AppMgr.targetFSMState
def targetFSMState(self)
Definition: Bindings.py:788

def GaudiPython.Bindings.AppMgr.terminate | ( |  | self | ) |

Definition at line 968 of file Bindings.py.

968 def terminate(self):
969 return self._appmgr.terminate()
GaudiPython.Bindings.AppMgr.terminate
def terminate(self)
Definition: Bindings.py:968

def GaudiPython.Bindings.AppMgr.tool | ( |  | self,
|  |  | name
| ) |  |

Definition at line 809 of file Bindings.py.

809 def tool(self, name ) :
810 return iAlgTool(name)
GaudiPython.Bindings.AppMgr.tool
def tool(self, name)
Definition: Bindings.py:809
GaudiPython.Bindings.iAlgTool
Definition: Bindings.py:338

def GaudiPython.Bindings.AppMgr.toolsvc | ( |  | self,
|  |  | name = `'ToolSvc'`
| ) |  |

Definition at line 841 of file Bindings.py.

841 def toolsvc(self, name='ToolSvc') :
842 svc = Helper.service( self._svcloc, name, True )
843 return iToolSvc(name, svc)
GaudiPython.Bindings.AppMgr.toolsvc
def toolsvc(self, name='ToolSvc')
Definition: Bindings.py:841
GaudiPython.Bindings.iToolSvc
Definition: Bindings.py:575

## Member Data Documentation

GaudiPython.Bindings.AppMgr.detSvc = detsvc
| static

Definition at line 1030 of file Bindings.py.

GaudiPython.Bindings.AppMgr.evtSel = evtsel
| static

Definition at line 1029 of file Bindings.py.

GaudiPython.Bindings.AppMgr.evtSvc = evtsvc
| static

Definition at line 1026 of file Bindings.py.

GaudiPython.Bindings.AppMgr.histSvc = histsvc
| static

Definition at line 1027 of file Bindings.py.

GaudiPython.Bindings.AppMgr.JobOptionsType

Definition at line 710 of file Bindings.py.

GaudiPython.Bindings.AppMgr.ntupleSvc = ntuplesvc
| static

Definition at line 1028 of file Bindings.py.

GaudiPython.Bindings.AppMgr.OutputLevel

Definition at line 719 of file Bindings.py.

GaudiPython.Bindings.AppMgr.partSvc = partsvc
| static

Definition at line 1032 of file Bindings.py.

GaudiPython.Bindings.AppMgr.toolSvc = toolsvc
| static

Definition at line 1031 of file Bindings.py.

GaudiPython.Bindings.AppMgr.topAlg

Definition at line 876 of file Bindings.py.

The documentation for this class was generated from the following file:

- GaudiPython/python/GaudiPython/Bindings.py