Gaudi Framework, version v23r0

Home   Generated: Mon Jan 30 2012

GaudiPython::GaudiAlgs::GaudiAlgo Class Reference

the base class for all algorithm Python-image of C++ clkass GaudiAlgorithm More...

Inheritance diagram for GaudiPython::GaudiAlgs::GaudiAlgo:
Inheritance graph
[legend]
Collaboration diagram for GaudiPython::GaudiAlgs::GaudiAlgo:
Collaboration graph
[legend]

List of all members.


Detailed Description

the base class for all algorithm Python-image of C++ clkass GaudiAlgorithm

*******************************************************************************
*                                                * 'Physisics do not like it, *
*                                                *  physisics do not need it, *
*                                                *  physisics do not use  it' *
*                                                * ****************************
*  Usage:                                                                     *
*                                                                             *
*  from GaudiPython.GaudiAlgs   import GaudiAlgo, SUCCESS                     *
*                                                                             *
*  class MyClass(GaudiAlgo) :                                                 *
*       ' My specific Algorithm, derived from GaudiAlgo base class '          *
*       def __init__( self , name , **args ) :                                *
*            'Constructor from algorithm instance name & parameters'          *
*             #invoke the constructor of base class                           *
*             GaudiAlgo.__init__(self , name , **args )                       *
*                                                                             *
*       def initialize ( self ) :                                             *
*           'Algorithm initialization'                                        *
*           # initialize the base class                                       *
*           status = GaudiAlgo.initialize( self )                             *
*           if status.isFailure() : return status                             *
*                                                                             *
*           # locate the services and tools                                   *
*                                                                             *
*           # locate some tool:                                               *
*           extrapolator = self.tool(ITrExtrapolator,'TrExtrapolator')        *
*                                                                             *
*           # locate the service                                              *
*           rndmSvc = self.svc(IRndmGenSvc, 'RndmGenSvc')                     *
*                                                                             *
*           return SUCCESS                                                    *
*                                                                             *
*                                                                             *
*       def execute ( self ) :                                                *
*            'Major method (from IAlgorithm interface)'                       *
*                                                                             *
*           # get some data from Transient Event Store                        *
*           tracks = self.get('/Event/Rec/Tracks')                            *
*                                                                             *
*           # use counters                                                    *
*           c1 = self.counter('#Tracks')                                      *
*           c2 = self.counter('No Tracks')                                    *
*           if tracks.empty :                                                 *
*              c2+=1                                                          *
*           c1 += tracks->size()                                              *
*                                                                             *
*           if 1000 < tracks.size() :                                         *
*                return self.Error('The event is *VERY* busy')                *
*                                                                             *
*           return SUCCESS                                                    *
*                                                                             *
*******************************************************************************

Usage:

  from GauidPython.GaudiAlgs   import GaudiAlgo, SUCCESS

  class MyClass(GaudiAlgo) :
       """
       My specific Algorithm, derived from GaudiAlgo base class
       """
       def __init__( self , name , **args ) :
           """
           Constructor from algorithm instance name & parameters'
           """
           #invoke the constructor of base class
           GaudiAlgo.__init__(self , name , **args )

       def initialize ( self ) :
           'Algorithm initialization'
           # initialize the base class
           status = GaudiAlgo.initialize( self )
           if status.isFailure() : return status

           # locate the services and tools

           # locate some tool:
           extrapolator = self.tool(ITrExtrapolator,'TrExtrapolator')

           # locate the service
           rndmSvc = self.svc(IRndmGenSvc, 'RndmGenSvc')

           return SUCCESS


       def execute ( self ) :
            'Major method (from IAlgorithm interface)'

           # get some data from Transient Event Store
           tracks = self.get('/Event/Rec/Tracks')

           # use counters
           c1 = self.counter('#Tracks')
           c2 = self.counter('No Tracks')
           if tracks.empty :
              c2+=1
           c1 += tracks->size()

           if 1000 < tracks.size() :
                return self.Error('The event is *VERY* busy')

           return SUCCESS
See also:
GaudiAlgorithm
Author:
Vanya BELYAEV ibelyaev@physics.syr.edu
Date:
2006-11-26

Definition at line 534 of file GaudiAlgs.py.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Defines

Generated at Mon Jan 30 2012 13:53:34 for Gaudi Framework, version v23r0 by Doxygen version 1.7.2 written by Dimitri van Heesch, © 1997-2004