Gaudi Framework, version v23r0

Home   Generated: Mon Jan 30 2012

GaudiPython::GaudiAlgs::TupleAlgo Class Reference

The base class for easy manupulations with N-Tuples. More...

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

List of all members.


Detailed Description

The base class for easy manupulations with N-Tuples.

*******************************************************************************
*                                                * 'Physisics do not like it, *
*                                                *  physisics do not need it, *
*                                                *  physisics do not use  it' *
*                                                * ****************************
*  Usage:                                                                     *
*                                                                             *
*  from GaudiPython.GaudiAlgs import TupleAlgo, SUCCESS                       *
*                                                                             *
*  class MyClass(TupleAlgo) :                                                 *
*       ' My specific Algorithm, derived from TupleAlgo base class '          *
*       def __init__( self , name , **args ) :                                *
*            'Constructor from algorithm instance name & parameters'          *
*             #invoke the constructor of base class                           *
*             TupleAlgo.__init__(self , name , **args )                       *
*                                                                             *
*       def execute ( self ) :                                                *
*            'Major method (from IAlgorithm interface)'                       *
*                                                                             *
*           # get some data from Transient Event Store                        *
*           tracks = self.get('/Event/Rec/Tracks')                            *
*                                                                             *
*           tup = self.nTuple('My N-Tuple')                                   *
*                                                                             *
*           for track in tracks :                                             *
*                                                                             *
*                 pt   = track.pt   ()                                        *
*                 p    = track.p    ()                                        *
*                 chi2 = track.chi2 ()                                        *
*                                                                             *
*                 #fill N-tuple:                                              *
*                 tup.column ( 'pt'   ,  pt   )                               *
*                 tup.column ( 'p'    ,  p    )                               *
*                 tup.column ( 'chi2' ,  chi2 )                               *
*                 #commit the row                                             *
*                 tup.write  ()                                               *
*                                                                             *
*           return SUCCESS                                                    *
*                                                                             *
*******************************************************************************

Usage:

  from GaudiPython.GaudiAlgs import TupleAlgo, SUCCESS

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

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

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

           tup = self.nTuple('My N-Tuple')

           for track in tracks :

                 pt   = track.pt   ()
                 p    = track.p    ()
                 chi2 = track.chi2 ()

                 #fill N-tuple:
                 tup.column ( 'pt'   ,  pt   )
                 tup.column ( 'p'    ,  p    )
                 tup.column ( 'chi2' ,  chi2 )
                 #commit the row
                 tup.write  ()

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

Definition at line 770 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