Gaudi Framework, version v23r5

Home   Generated: Wed Nov 28 2012
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members
GaudiPython.GaudiAlgs.HistoAlgo Class Reference

The base class for easy histogramming. More...

Inheritance diagram for GaudiPython.GaudiAlgs.HistoAlgo:
Inheritance graph
[legend]
Collaboration diagram for GaudiPython.GaudiAlgs.HistoAlgo:
Collaboration graph
[legend]

Additional Inherited Members

- Public Member Functions inherited from GaudiPython.Bindings.iAlgorithm
def __init__
 
def retrieveInterface
 
- Static Public Attributes inherited from GaudiPython.Bindings.iAlgorithm
tuple initialize lambdaself:self.__call_interface_method__("_ialg","initialize")
 
tuple start lambdaself:self.__call_interface_method__("_ialg","start")
 
tuple execute lambdaself:self.__call_interface_method__("_ialg","execute")
 
tuple stop lambdaself:self.__call_interface_method__("_ialg","stop")
 
tuple finalize lambdaself:self.__call_interface_method__("_ialg","finalize")
 
tuple reinitialize lambdaself:self.__call_interface_method__("_ialg","reinitialize")
 
tuple restart lambdaself:self.__call_interface_method__("_ialg","restart")
 
tuple sysInitialize lambdaself:self.__call_interface_method__("_ialg","sysInitialize")
 
tuple sysStart lambdaself:self.__call_interface_method__("_ialg","sysStart")
 
tuple sysExecute lambdaself:self.__call_interface_method__("_ialg","sysExecute")
 
tuple sysStop lambdaself:self.__call_interface_method__("_ialg","sysStop")
 
tuple sysFinalize lambdaself:self.__call_interface_method__("_ialg","sysFinalize")
 
tuple sysReinitialize lambdaself:self.__call_interface_method__("_ialg","sysReinitialize")
 
tuple sysRestart lambdaself:self.__call_interface_method__("_ialg","sysRestart")
 

Detailed Description

The base class for easy histogramming.

*******************************************************************************
*                                                * 'Physisics do not like it, *
*                                                *  physisics do not need it, *
*                                                *  physisics do not use  it' *
*                                                * ****************************
*  Usage:                                                                     *
*                                                                             *
*  from GaudiPython.GaudiAlgs import HistoAlgo, SUCCESS                       *
*                                                                             *
*  class MyClass(HistoAlgo) :                                                 *
*       ' My specific Algorithm, derived from GaudiAlgo base class '          *
*       def __init__( self , name , **args ) :                                *
*            'Constructor from algorithm instance name'                       *
*             #invoke the constructor of base class                           *
*             HistoAlgo.__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')                            *
*                                                                             *
*           self.plot1D ( tracks->size() , '#tracks' , 0 , 100 )              *
*                                                                             *
*           return SUCCESS                                                    *
*                                                                             *
* Alternatively the histogram  could be booked in advance:                    *
*                                                                             *
*  class MyClass(HistoAlgo) :                                                 *
*       ' My specific Algorithm, derived from GaudiAlgo base class '          *
*       def __init__( self , name ) :                                         *
*            'Constructor from algorithm instance name'                       *
*             #invoke the constructor of base class                           *
*             HistoAlgo.__init__(self , name )                                *
*                                                                             *
*       def initialize ( self ) :                                             *
*           'Algorithm initialization'                                        *
*           # initialize the base class                                       *
*           status = HistoAlgo.initialize( self )                             *
*           if status.isFailure() : return status                             *
*                                                                             *
*           # book the histogram                                              *
*           self.h1 = selff.book1D ( '#tracks' , 0 , 100 )                    *
*                                                                             *
*           return SUCCESS                                                    *
*                                                                             *
*                                                                             *
*       def execute ( self ) :                                                *
*            'Major method (from IAlgorithm interface)'                       *
*                                                                             *
*           # get some data from Transient Event Store                        *
*           tracks = self.get('/Event/Rec/Tracks')                            *
*                                                                             *
*           # fill the histogram                                              *
*           self.h1.fill ( tracks->size() )                                   *
*                                                                             *
*           return SUCCESS                                                    *
*                                                                             *
*******************************************************************************

Usage:

1 from GaudiPython.GaudiAlgs import HistoAlgo, SUCCESS
2 
3 class MyClass(HistoAlgo) :
4  ' My specific Algorithm, derived from GaudiAlgo base class '
5  def __init__( self , name , **args ) :
6  'Constructor from algorithm instance name & parameters'
7  #invoke the constructor of base class
8  HistoAlgo.__init__(self , name , **args )
9 
10  def execute ( self ) :
11  'Major method (from IAlgorithm interface)'
12 
13  # get some data from Transient Event Store
14  tracks = self.get('/Event/Rec/Tracks')
15 
16  self.plot1D ( tracks->size() , '#tracks' , 0 , 100 )
17 
18  return SUCCESS

Alternatively the histogram could be booked in advance:

1 class MyClass(HistoAlgo) :
2  ' My specific Algorithm, derived from GaudiAlgo base class '
3  def __init__( self , name ) :
4  'Constructor from algorithm instance name'
5  #invoke the constructor of base class
6  HistoAlgo.__init__(self , name )
7 
8  def initialize ( self ) :
9  'Algorithm initialization'
10  # initialize the base class
11  status = HistoAlgo.initialize( self )
12  if status.isFailure() : return status
13 
14  # book the histogram
15  self.h1 = selff.book1D ( '#tracks' , 0 , 100 )
16 
17  return SUCCESS
18 
19 
20  def execute ( self ) :
21  'Major method (from IAlgorithm interface)'
22 
23  # get some data from Transient Event Store
24  tracks = self.get('/Event/Rec/Tracks')
25 
26  # fill the histogram
27  self.h1.fill ( tracks->size() )
28 
29  return SUCCESS
See Also
GaudiHistoAlg
Author
Vanya BELYAEV ibely.nosp@m.aev@.nosp@m.physi.nosp@m.cs.s.nosp@m.yr.ed.nosp@m.u
Date
2006-11-26

Definition at line 677 of file GaudiAlgs.py.


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

Generated at Wed Nov 28 2012 12:17:40 for Gaudi Framework, version v23r5 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004