Main Page   Namespace List   Class Hierarchy   Compound List   File List   Namespace Members   Compound Members   File Members  

Algorithm Class Reference

#include <GaudiKernel/Algorithm.h>

Inheritance diagram for Algorithm:

Inheritance graph
[legend]
Collaboration diagram for Algorithm:

Collaboration graph
[legend]
List of all members.

Public Methods

 Algorithm (const std::string &name, ISvcLocator *svcloc)
virtual ~Algorithm ()
 Destructor. More...

virtual StatusCode sysInitialize ()
virtual StatusCode sysExecute ()
virtual StatusCode sysFinalize ()
virtual const std::string & name () const
virtual bool isExecuted () const
 Has this algorithm been executed since the last reset? More...

virtual StatusCode setExecuted (bool state)
 Set the executed flag to the specified state. More...

virtual StatusCode resetExecuted ()
 Reset the executed state of the Algorithm for the duration of the current event. More...

virtual StatusCode beginRun ()
 Algorithm begin run. This method is called at the beginning of the event loop. More...

virtual StatusCode endRun ()
 Algorithm end run. This method is called at the end of the event loop. More...

virtual bool isEnabled () const
 Is this algorithm enabled or disabled? More...

virtual bool filterPassed () const
 Did this algorithm pass or fail its filter criterion for the last event? More...

virtual StatusCode setFilterPassed (bool state)
 Set the filter passed flag to the specified state. More...

template<class T> StatusCode service (const std::string &name, T *&svc, bool createIf=false) const
void setOutputLevel (int level)
 Set the outputlevel for current algorithm. More...

IAuditorSvc * auditorSvc () const
IChronoStatSvc * chronoSvc () const
 The standard Chrono & Stat service, Return a pointer to the service if present. More...

IChronoStatSvc * chronoStatService () const
 Obsoleted name, kept due to the backwards compatibility. More...

IDataProviderSvc * detSvc () const
IDataProviderSvc * detDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...

IConversionSvc * detCnvSvc () const
IConversionSvc * detDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...

IDataProviderSvc * eventSvc () const
IDataProviderSvc * eventDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...

IConversionSvc * eventCnvSvc () const
IConversionSvc * eventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility. More...

IHistogramSvc * histoSvc () const
IHistogramSvc * histogramDataService () const
 Obsoleted name, kept due to the backwards compatibility. More...

IMessageSvc * msgSvc () const
IMessageSvc * messageService () const
 Obsoleted name, kept due to the backwards compatibility. More...

INTupleSvc * ntupleSvc () const
INTupleSvc * ntupleService () const
 Obsoleted name, kept due to the backwards compatibility. More...

IRndmGenSvc * randSvc () const
 The standard RandomGen service, Return a pointer to the service if present. More...

ISvcLocator * serviceLocator () const
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
std::vector< Algorithm *> * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms. More...

virtual StatusCode setProperty (const Property &p)
 Implementation of IProperty::setProperty. More...

virtual StatusCode setProperty (std::istream &s)
 Implementation of IProperty::setProperty. More...

virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty. More...

virtual StatusCode getProperty (Property *p) const
 Implementation of IProperty::getProperty. More...

virtual const Property & getProperty (const std::string &name) const
 Implementation of IProperty::getProperty. More...

virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty. More...

virtual const std::vector<
Property *> & 
getProperties () const
 Implementation of IProperty::getProperties. More...

StatusCode setProperties ()
template<class T> StatusCode declareProperty (const std::string &name, T &property) const
 Declare named properties. More...

StatusCode declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties. More...

unsigned long addRef ()
 Methods for IInterface::addRef(). More...

unsigned long release ()
 Methods for IInterface::release(). More...

StatusCode queryInterface (const IID &riid, void **)
 Methods for IInterface::queryInterface(). More...


Protected Methods

bool isInitialized () const
 Has the Algorithm already been initialized? More...

void setInitialized ()
 Set the Algorithm initialized state. More...

bool isFinalized () const
 Has the Algorithm already been finalized? More...

void setFinalized ()
 Set the Algorithm finalized state. More...


Detailed Description

Base class from which all concrete algorithm classes should be derived. In order for a concrete algorithm class to do anything useful the methods initialize(), execute() and finalize() should be overridden. The base class provides utility methods for accessing standard services (event data service etc.); for declaring properties which may be configured by the job options service; and for creating sub algorithms. The only base class functionality which may be used in the constructor of a concrete algorithm is the declaration of member variables as properties. All other functionality, i.e. the use of services and the creation of sub-algorithms, may be used only in initialise() and afterwards (see the Gaudi user guide).

Author:
Paul Maley , Pere Mato , David Quarrie
Date:
1998


Constructor & Destructor Documentation

Algorithm::Algorithm const std::string &    name,
ISvcLocator *    svcloc
 

Constructor

Parameters:
name  The algorithm object's name
svcloc  A pointer to a service location service

virtual Algorithm::~Algorithm   [virtual]
 

Destructor.


Member Function Documentation

unsigned long Algorithm::addRef   [virtual]
 

Methods for IInterface::addRef().

Reimplemented from IInterface.

IAuditorSvc* Algorithm::auditorSvc   const
 

The standard auditor service.May not be invoked before sysInitialize() has been invoked.

virtual StatusCode Algorithm::beginRun   [virtual]
 

Algorithm begin run. This method is called at the beginning of the event loop.

Reimplemented from IAlgorithm.

IChronoStatSvc* Algorithm::chronoStatService   const
 

Obsoleted name, kept due to the backwards compatibility.

IChronoStatSvc* Algorithm::chronoSvc   const
 

The standard Chrono & Stat service, Return a pointer to the service if present.

StatusCode Algorithm::createSubAlgorithm const std::string &    type,
const std::string &    name,
Algorithm *&    pSubAlg
 

Create a sub algorithm. A call to this method creates a child algorithm object. Note that the returned pointer is to Algorithm (as opposed to IAlgorithm), and thus the methods of IProperty are also available for the direct setting of the sub-algorithm's properties. Using this mechanism instead of creating daughter algorithms directly via the new operator is prefered since then the framework may take care of all of the necessary book-keeping.

Parameters:
type  The concrete algorithm class of the sub algorithm
name  The name to be given to the sub algorithm
pSubAlg  Set to point to the newly created algorithm object

template<class T>
StatusCode Algorithm::declareProperty const std::string &    name,
T &    property
const [inline]
 

Declare named properties.

StatusCode Algorithm::declareRemoteProperty const std::string &    name,
IProperty   rsvc,
const std::string &    rname = ""
const [inline]
 

Declare remote named properties.

IConversionSvc* Algorithm::detCnvSvc   const
 

The standard detector data persistency conversion service.May not be invoked before sysInitialize() has been invoked.

IConversionSvc* Algorithm::detDataCnvService   const
 

Obsoleted name, kept due to the backwards compatibility.

IDataProviderSvc* Algorithm::detDataService   const
 

Obsoleted name, kept due to the backwards compatibility.

IDataProviderSvc* Algorithm::detSvc   const
 

The standard detector data service. May not be invoked before sysInitialize() has been invoked.

virtual StatusCode Algorithm::endRun   [virtual]
 

Algorithm end run. This method is called at the end of the event loop.

Reimplemented from IAlgorithm.

IConversionSvc* Algorithm::eventCnvSvc   const
 

The standard event data persistency conversion service.May not be invoked before sysInitialize() has been invoked.

IConversionSvc* Algorithm::eventDataCnvService   const
 

Obsoleted name, kept due to the backwards compatibility.

IDataProviderSvc* Algorithm::eventDataService   const
 

Obsoleted name, kept due to the backwards compatibility.

IDataProviderSvc* Algorithm::eventSvc   const
 

The standard event data service. May not be invoked before sysInitialize() has been invoked.

virtual bool Algorithm::filterPassed   const [virtual]
 

Did this algorithm pass or fail its filter criterion for the last event?

virtual const std::vector<Property*>& Algorithm::getProperties   const [virtual]
 

Implementation of IProperty::getProperties.

Reimplemented from IProperty.

virtual StatusCode Algorithm::getProperty const std::string &    n,
std::string &    v
const [virtual]
 

Implementation of IProperty::getProperty.

Reimplemented from IProperty.

virtual const Property& Algorithm::getProperty const std::string &    name const [virtual]
 

Implementation of IProperty::getProperty.

Reimplemented from IProperty.

virtual StatusCode Algorithm::getProperty Property *    p const [virtual]
 

Implementation of IProperty::getProperty.

Reimplemented from IProperty.

IHistogramSvc* Algorithm::histogramDataService   const
 

Obsoleted name, kept due to the backwards compatibility.

IHistogramSvc* Algorithm::histoSvc   const
 

The standard histogram service. May not be invoked before sysInitialize() has been invoked.

virtual bool Algorithm::isEnabled   const [virtual]
 

Is this algorithm enabled or disabled?

virtual bool Algorithm::isExecuted   const [virtual]
 

Has this algorithm been executed since the last reset?

bool Algorithm::isFinalized   const [protected]
 

Has the Algorithm already been finalized?

bool Algorithm::isInitialized   const [protected]
 

Has the Algorithm already been initialized?

IMessageSvc* Algorithm::messageService   const
 

Obsoleted name, kept due to the backwards compatibility.

IMessageSvc* Algorithm::msgSvc   const
 

The standard message service. Returns a pointer to the standard message service. May not be invoked before sysInitialize() has been invoked.

virtual const std::string& Algorithm::name   const [virtual]
 

The identifying name of the algorithm object. This is the name of a particular instantiation of an algorithm object as opposed to the name of the algorithm itself, e.g. "LinearTrackFit" may be the name of a concrete algorithm class, whereas "ApproxTrackFit" and "BestTrackFit" may be two instantiations of the class configured to find tracks with different fit criteria.

Reimplemented from IAlgorithm.

INTupleSvc* Algorithm::ntupleService   const
 

Obsoleted name, kept due to the backwards compatibility.

INTupleSvc* Algorithm::ntupleSvc   const
 

The standard N tuple service. Returns a pointer to the N tuple service if present.

StatusCode Algorithm::queryInterface const IID   riid,
void **   
 

Methods for IInterface::queryInterface().

IRndmGenSvc* Algorithm::randSvc   const
 

The standard RandomGen service, Return a pointer to the service if present.

unsigned long Algorithm::release   [virtual]
 

Methods for IInterface::release().

Reimplemented from IInterface.

virtual StatusCode Algorithm::resetExecuted   [virtual]
 

Reset the executed state of the Algorithm for the duration of the current event.

Reimplemented from IAlgorithm.

template<class T>
StatusCode Algorithm::service const std::string &    name,
T *&    svc,
bool    createIf = false
const [inline]
 

Access a service by name, creating it if it doesn't already exist.

ISvcLocator* Algorithm::serviceLocator   const
 

The standard service locator. Returns a pointer to the service locator service. This service may be used by an algorithm to request any services it requires in addition to those provided by default.

virtual StatusCode Algorithm::setExecuted bool    state [virtual]
 

Set the executed flag to the specified state.

virtual StatusCode Algorithm::setFilterPassed bool    state [virtual]
 

Set the filter passed flag to the specified state.

void Algorithm::setFinalized   [protected]
 

Set the Algorithm finalized state.

void Algorithm::setInitialized   [protected]
 

Set the Algorithm initialized state.

void Algorithm::setOutputLevel int    level
 

Set the outputlevel for current algorithm.

StatusCode Algorithm::setProperties  
 

Set the algorithm's properties. This method requests the job options service to set the values of any declared properties. The method is invoked from within sysInitialize() by the framework and does not need to be explicitly called by a concrete algorithm.

virtual StatusCode Algorithm::setProperty const std::string &    n,
const std::string &    v
[virtual]
 

Implementation of IProperty::setProperty.

Reimplemented from IProperty.

virtual StatusCode Algorithm::setProperty std::istream &    s [virtual]
 

Implementation of IProperty::setProperty.

Reimplemented from IProperty.

virtual StatusCode Algorithm::setProperty const Property &    p [virtual]
 

Implementation of IProperty::setProperty.

Reimplemented from IProperty.

std::vector<Algorithm*>* Algorithm::subAlgorithms   const
 

List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.

virtual StatusCode Algorithm::sysExecute   [virtual]
 

The actions to be performed by the algorithm on an event. This method is invoked once per event for top level algorithms by the application manager. This method invokes execute() method. For sub-algorithms either the sysExecute() method or execute() method must be EXPLICITLY invoked by the parent algorithm.

Reimplemented from IAlgorithm.

virtual StatusCode Algorithm::sysFinalize   [virtual]
 

System finalization. This method invokes the finalize() method of a concrete algorithm and the finalize() methods of all of that algorithm's sub algorithms.

Reimplemented from IAlgorithm.

virtual StatusCode Algorithm::sysInitialize   [virtual]
 

Initialization method invoked by the framework. This method is responsible for any bookkeeping of initialization required by the framework itself. It will in turn invoke the initialize() method of the derived algorithm, and of any sub-algorithms which it creates.

Reimplemented from IAlgorithm.


The documentation for this class was generated from the following file:
Generated on Mon Feb 4 15:55:55 2002 for Atlfast by doxygen1.2.13.1 written by Dimitri van Heesch, © 1997-2001