| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Algorithm Class Reference

Base class from which all concrete algorithm classes should be derived. More...

#include <GaudiKernel/Algorithm.h>

Inheritance diagram for Algorithm:

[legend]
Collaboration diagram for Algorithm:
[legend]
List of all members.

Public Types

 SUCCESS = 1
 Normal successful completion.
 NO_INTERFACE
 Requested interface is not available.
 VERSMISMATCH
 Requested interface version is incompatible.
 LAST_ERROR
 Last error.
enum  Status { SUCCESS = 1, NO_INTERFACE, VERSMISMATCH, LAST_ERROR }
 Return status. More...

Public Member Functions

 Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
 Constructor.
virtual ~Algorithm ()
 Destructor.
virtual StatusCode sysStart ()
 Reinitialization method invoked by the framework.
virtual StatusCode sysInitialize ()
 Initialization method invoked by the framework.
virtual StatusCode sysReinitialize ()
 Reinitialization method invoked by the framework.
virtual StatusCode sysRestart ()
 Restart method invoked by the framework.
virtual StatusCode sysExecute ()
 The actions to be performed by the algorithm on an event.
virtual StatusCode sysStop ()
 System stop.
virtual StatusCode sysFinalize ()
 System finalization.
virtual StatusCode sysBeginRun ()
 beginRun method invoked by the framework.
virtual StatusCode sysEndRun ()
 endRun method invoked by the framework.
virtual const std::string & name () const
 The identifying name of the algorithm object.
virtual const std::string & version () const
 The version of the algorithm.
virtual StatusCode configure ()
 Dummy implementation of IStateful::configure() method.
virtual StatusCode terminate ()
 Dummy implementation of IStateful::terminate() method.
virtual StatusCode initialize ()
 the default (empty) implementation of IStateful::initialize() method
virtual StatusCode start ()
 the default (empty) implementation of IStateful::start() method
virtual StatusCode stop ()
 the default (empty) implementation of IStateful::stop() method
virtual StatusCode finalize ()
 the default (empty) implementation of IStateful::finalize() method
virtual StatusCode reinitialize ()
 the default (empty) implementation of IStateful::reinitialize() method
virtual StatusCode restart ()
 the default (empty) implementation of IStateful::restart() method
virtual bool isExecuted () const
 Has this algorithm been executed since the last reset?
virtual void setExecuted (bool state)
 Set the executed flag to the specified state.
virtual void resetExecuted ()
 Reset the executed state of the Algorithm for the duration of the current event.
virtual StatusCode beginRun ()
 Algorithm begin run.
virtual StatusCode endRun ()
 Algorithm end run. This method is called at the end of the event loop.
virtual Gaudi::StateMachine::State FSMState () const
 returns the current state of the algorithm
virtual Gaudi::StateMachine::State targetFSMState () const
 returns the state the algorithm will be in after the ongoing transition
virtual bool isEnabled () const
 Is this algorithm enabled or disabled?
virtual bool filterPassed () const
 Did this algorithm pass or fail its filter criterion for the last event?
virtual void setFilterPassed (bool state)
 Set the filter passed flag to the specified state.
template<class T>
StatusCode service (const std::string &name, T *&psvc, bool createIf=true) const
 Access a service by name, creating it if it doesn't already exist.
template<class T>
StatusCode service (const std::string &svcType, const std::string &svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist.
void setOutputLevel (int level)
 Set the outputlevel for current algorithm.
IAuditorSvcauditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.
IChronoStatSvcchronoSvc () const
 The standard Chrono & Stat service, Return a pointer to the service if present.
IChronoStatSvcchronoStatService () const
 Obsoleted name, kept due to the backwards compatibility.
IDataProviderSvcdetSvc () const
 The standard detector data service.
IDataProviderSvcdetDataService () const
 Obsoleted name, kept due to the backwards compatibility.
IConversionSvcdetCnvSvc () const
 The standard detector data persistency conversion service.
IConversionSvcdetDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility.
IDataProviderSvceventSvc () const
 The standard event data service.
IDataProviderSvcevtSvc () const
 shortcut for method eventSvc
IDataProviderSvceventDataService () const
 Obsoleted name, kept due to the backwards compatibility.
IConversionSvceventCnvSvc () const
 The standard event data persistency conversion service.
IConversionSvceventDataCnvService () const
 Obsoleted name, kept due to the backwards compatibility.
IHistogramSvchistoSvc () const
 The standard histogram service.
IHistogramSvchistogramDataService () const
 Obsoleted name, kept due to the backwards compatibility.
IMessageSvcmsgSvc () const
 The standard message service.
IMessageSvcmessageService () const
 Obsoleted name, kept due to the backwards compatibility.
INTupleSvcntupleSvc () const
 The standard N tuple service.
INTupleSvcntupleService () const
 Obsoleted name, kept due to the backwards compatibility.
IRndmGenSvcrandSvc () const
 The standard RandomGen service, Return a pointer to the service if present.
IToolSvctoolSvc () const
 The standard ToolSvc service, Return a pointer to the service if present.
IExceptionSvcexceptionSvc () const
 Get the exception Service.
ISvcLocatorserviceLocator () const
 The standard service locator.
ISvcLocatorsvcLoc () const
 shortcut for method serviceLocator
StatusCode createSubAlgorithm (const std::string &type, const std::string &name, Algorithm *&pSubAlg)
 Create a sub algorithm.
std::vector< Algorithm * > * subAlgorithms () const
 List of sub-algorithms. Returns a pointer to a vector of (sub) Algorithms.
virtual StatusCode setProperty (const Property &p)
 Implementation of IProperty::setProperty.
virtual StatusCode setProperty (const std::string &s)
 Implementation of IProperty::setProperty.
virtual StatusCode setProperty (const std::string &n, const std::string &v)
 Implementation of IProperty::setProperty.
virtual StatusCode getProperty (Property *p) const
 Implementation of IProperty::getProperty.
virtual const PropertygetProperty (const std::string &name) const
 Implementation of IProperty::getProperty.
virtual StatusCode getProperty (const std::string &n, std::string &v) const
 Implementation of IProperty::getProperty.
virtual const std::vector<
Property * > & 
getProperties () const
 Implementation of IProperty::getProperties.
StatusCode setProperties ()
 Set the algorithm's properties.
template<class T>
PropertydeclareProperty (const std::string &name, T &property, const std::string &doc="none") const
 Declare the named property.
PropertydeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
 Declare remote named properties.
IMonitorSvcmonitorSvc () const
 Access the monitor service.
template<class T>
void declareInfo (const std::string &name, const T &var, const std::string &desc) const
 Declare monitoring information.
void declareInfo (const std::string &name, const std::string &format, const void *var, int size, const std::string &desc) const
 Declare monitoring information (special case).
unsigned long addRef ()
 Methods for IInterface::addRef().
unsigned long release ()
 Methods for IInterface::release().
StatusCode queryInterface (const InterfaceID &riid, void **)
 Methods for IInterface::queryInterface().
template<class TYPE>
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
virtual StatusCode execute ()=0
 The action to be performed by the algorithm on an event.

Static Public Member Functions

static const InterfaceIDinterfaceID ()
 Retrieve interface ID.
static const InterfaceIDinterfaceID ()
 Retrieve interface ID.
static const InterfaceIDinterfaceID ()
 Retrieve interface ID.

Protected Member Functions

bool isInitialized () const
 Has the Algorithm already been initialized?
bool isFinalized () const
 Has the Algorithm already been finalized?
int outputLevel () const
 retrieve the Algorithm output level
IntegerPropertyoutputLevelProperty ()
 Accessor for the Message level property.
void initOutputLevel (Property &prop)
 callback for output level property

Private Member Functions

StatusCode service_i (const std::string &svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
 implementation of service method
StatusCode service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppSvc) const
 Algorithm (const Algorithm &a)
 Private Copy constructor: NO COPY ALLOWED.
Algorithmoperator= (const Algorithm &rhs)
 Private asignment operator: NO ASSIGNMENT ALLOWED.

Private Attributes

long m_refCount
 Counter for references to Algorithm.
std::string m_name
 Algorithm's name for identification.
std::string m_version
 Algorithm's version.
std::vector< Algorithm * > * m_subAlgms
 Sub algorithms.
IMessageSvcm_MS
 Message service.
IDataProviderSvcm_EDS
 Event data service.
IConversionSvcm_ECS
 Event conversion service.
IDataProviderSvcm_DDS
 Detector data service.
IConversionSvcm_DCS
 Detector conversion service.
IHistogramSvcm_HDS
 Histogram data service.
INTupleSvcm_NTS
 N tuple service.
IChronoStatSvcm_CSS
 Chrono & Stat Service.
IRndmGenSvcm_RGS
 Random Number Generator Service.
IExceptionSvcm_EXS
 Exception Handler Service.
IAuditorSvcm_pAuditorSvc
 Auditor Service.
IToolSvcm_ptoolSvc
 ToolSvc Service.
IMonitorSvcm_pMonitorSvc
 Online Monitoring Service.
std::string m_monitorSvcName
 Name to use for Monitor Service.
ISvcLocatorm_pSvcLocator
 Pointer to service locator service.
PropertyMgrm_propertyMgr
 For management of properties.
IntegerProperty m_outputLevel
 Algorithm output level.
int m_errorMax
 Algorithm Max number of errors.
int m_errorCount
 Algorithm error counter.
BooleanProperty m_auditInit
 global flag for auditors
bool m_auditorInitialize
 flag for auditors in "initialize()"
bool m_auditorReinitialize
 flag for auditors in "Reinitialize()"
bool m_auditorRestart
 flag for auditors in "Restart()"
bool m_auditorExecute
 flag for auditors in "execute()"
bool m_auditorFinalize
 flag for auditors in "finalize()"
bool m_auditorBeginRun
 flag for auditors in "beginRun()"
bool m_auditorEndRun
 flag for auditors in "endRun()"
bool m_auditorStart
 flag for auditors in "initialize()"
bool m_auditorStop
 flag for auditors in "Reinitialize()"
bool m_filterPassed
 Filter passed flag.
bool m_isEnabled
 Algorithm is enabled flag.
bool m_isExecuted
 Algorithm is executed flag.
Gaudi::StateMachine::State m_state
 Algorithm has been initialized flag.
Gaudi::StateMachine::State m_targetState
 Algorithm has been initialized flag.
bool m_isFinalized
 Algorithm has been finalized flag.

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

Definition at line 61 of file Algorithm.h.


Member Enumeration Documentation

enum IInterface::Status [inherited]

Return status.

Enumerator:
SUCCESS  Normal successful completion.
NO_INTERFACE  Requested interface is not available.
VERSMISMATCH  Requested interface version is incompatible.
LAST_ERROR  Last error.

Reimplemented in IConversionSvc, IConverter, and IDataProviderSvc.

Definition at line 113 of file IInterface.h.

00113                 {
00115     SUCCESS = 1,
00117     NO_INTERFACE,
00119     VERSMISMATCH,
00121     LAST_ERROR
00122   };


Constructor & Destructor Documentation

Algorithm::Algorithm ( const std::string &  name,
ISvcLocator svcloc,
const std::string &  version = PACKAGE_VERSION 
)

Constructor.

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

virtual Algorithm::~Algorithm (  )  [virtual]

Destructor.

Algorithm::Algorithm ( const Algorithm a  )  [private]

Private Copy constructor: NO COPY ALLOWED.


Member Function Documentation

virtual StatusCode Algorithm::sysStart (  )  [virtual]

Reinitialization method invoked by the framework.

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

Implements 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.

Implements IAlgorithm.

virtual StatusCode Algorithm::sysReinitialize (  )  [virtual]

Reinitialization method invoked by the framework.

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

Implements IAlgorithm.

virtual StatusCode Algorithm::sysRestart (  )  [virtual]

Restart method invoked by the framework.

It will in turn invoke the restart() method of the derived algorithm, and of any sub-algorithms which it creates.

Implements IAlgorithm.

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.

Implements IAlgorithm.

virtual StatusCode Algorithm::sysStop (  )  [virtual]

System stop.

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

Implements 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.

Implements IAlgorithm.

virtual StatusCode Algorithm::sysBeginRun (  )  [virtual]

beginRun method invoked by the framework.

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

Implements IAlgorithm.

virtual StatusCode Algorithm::sysEndRun (  )  [virtual]

endRun method invoked by the framework.

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

Implements IAlgorithm.

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.

Implements INamedInterface.

virtual const std::string& Algorithm::version (  )  const [virtual]

The version of the algorithm.

Implements IAlgorithm.

virtual StatusCode Algorithm::configure (  )  [inline, virtual]

Dummy implementation of IStateful::configure() method.

Implements IAlgorithm.

Definition at line 149 of file Algorithm.h.

00149 { return StatusCode::SUCCESS ; }

virtual StatusCode Algorithm::terminate (  )  [inline, virtual]

Dummy implementation of IStateful::terminate() method.

Implements IAlgorithm.

Definition at line 151 of file Algorithm.h.

00151 { return StatusCode::SUCCESS ; }

virtual StatusCode Algorithm::initialize (  )  [inline, virtual]

the default (empty) implementation of IStateful::initialize() method

Implements IAlgorithm.

Definition at line 154 of file Algorithm.h.

00154 { return StatusCode::SUCCESS ; }

virtual StatusCode Algorithm::start (  )  [inline, virtual]

the default (empty) implementation of IStateful::start() method

Implements IAlgorithm.

Definition at line 156 of file Algorithm.h.

00156 { return StatusCode::SUCCESS ; }

virtual StatusCode Algorithm::stop (  )  [inline, virtual]

the default (empty) implementation of IStateful::stop() method

Implements IAlgorithm.

Definition at line 158 of file Algorithm.h.

00158 { return StatusCode::SUCCESS ; }

virtual StatusCode Algorithm::finalize (  )  [inline, virtual]

the default (empty) implementation of IStateful::finalize() method

Implements IAlgorithm.

Definition at line 160 of file Algorithm.h.

00160 { return StatusCode::SUCCESS ; }

virtual StatusCode Algorithm::reinitialize (  )  [virtual]

the default (empty) implementation of IStateful::reinitialize() method

Implements IAlgorithm.

virtual StatusCode Algorithm::restart (  )  [virtual]

the default (empty) implementation of IStateful::restart() method

Implements IAlgorithm.

virtual bool Algorithm::isExecuted (  )  const [virtual]

Has this algorithm been executed since the last reset?

Implements IAlgorithm.

virtual void Algorithm::setExecuted ( bool  state  )  [virtual]

Set the executed flag to the specified state.

Implements IAlgorithm.

virtual void Algorithm::resetExecuted (  )  [virtual]

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

Implements IAlgorithm.

virtual StatusCode Algorithm::beginRun (  )  [virtual]

Algorithm begin run.

This method is called at the beginning of the event loop.

Implements IAlgorithm.

virtual StatusCode Algorithm::endRun (  )  [virtual]

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

Implements IAlgorithm.

virtual Gaudi::StateMachine::State Algorithm::FSMState (  )  const [inline, virtual]

returns the current state of the algorithm

Implements IAlgorithm.

Definition at line 187 of file Algorithm.h.

00187 { return m_state; }

virtual Gaudi::StateMachine::State Algorithm::targetFSMState (  )  const [inline, virtual]

returns the state the algorithm will be in after the ongoing transition

Implements IStateful.

Definition at line 190 of file Algorithm.h.

00190 { return m_targetState; }

virtual bool Algorithm::isEnabled (  )  const [virtual]

Is this algorithm enabled or disabled?

Implements IAlgorithm.

virtual bool Algorithm::filterPassed (  )  const [virtual]

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

Implements IAlgorithm.

virtual void Algorithm::setFilterPassed ( bool  state  )  [virtual]

Set the filter passed flag to the specified state.

Implements IAlgorithm.

template<class T>
StatusCode Algorithm::service ( const std::string &  name,
T *&  psvc,
bool  createIf = true 
) const [inline]

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

Definition at line 204 of file Algorithm.h.

00204                                                                   {
00205     return service_i(name, createIf, T::interfaceID(), (void**)&psvc);
00206   }

template<class T>
StatusCode Algorithm::service ( const std::string &  svcType,
const std::string &  svcName,
T *&  psvc 
) const [inline]

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

Definition at line 210 of file Algorithm.h.

00211                                       {
00212     return service_i(svcType, svcName, T::interfaceID(), (void**)&psvc);
00213   }

void Algorithm::setOutputLevel ( int  level  ) 

Set the outputlevel for current algorithm.

IAuditorSvc* Algorithm::auditorSvc (  )  const

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

IChronoStatSvc* Algorithm::chronoSvc (  )  const

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

IChronoStatSvc* Algorithm::chronoStatService (  )  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.

IDataProviderSvc* Algorithm::detDataService (  )  const

Obsoleted name, kept due to the backwards compatibility.

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::eventSvc (  )  const

The standard event data service.

May not be invoked before sysInitialize() has been invoked.

IDataProviderSvc* Algorithm::evtSvc (  )  const [inline]

shortcut for method eventSvc

Definition at line 251 of file Algorithm.h.

00251 { return eventSvc() ; }

IDataProviderSvc* Algorithm::eventDataService (  )  const

Obsoleted name, kept due to the backwards compatibility.

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.

IHistogramSvc* Algorithm::histoSvc (  )  const

The standard histogram service.

May not be invoked before sysInitialize() has been invoked.

IHistogramSvc* Algorithm::histogramDataService (  )  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.

IMessageSvc* Algorithm::messageService (  )  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.

INTupleSvc* Algorithm::ntupleService (  )  const

Obsoleted name, kept due to the backwards compatibility.

IRndmGenSvc* Algorithm::randSvc (  )  const

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

IToolSvc* Algorithm::toolSvc (  )  const

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

IExceptionSvc* Algorithm::exceptionSvc (  )  const

Get the exception Service.

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.

ISvcLocator* Algorithm::svcLoc (  )  const [inline]

shortcut for method serviceLocator

Definition at line 310 of file Algorithm.h.

00310 { return serviceLocator() ; }

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

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

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

virtual StatusCode Algorithm::setProperty ( const Property p  )  [virtual]

Implementation of IProperty::setProperty.

Implements IProperty.

virtual StatusCode Algorithm::setProperty ( const std::string &  s  )  [virtual]

Implementation of IProperty::setProperty.

Implements IProperty.

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

Implementation of IProperty::setProperty.

Implements IProperty.

virtual StatusCode Algorithm::getProperty ( Property p  )  const [virtual]

Implementation of IProperty::getProperty.

Implements IProperty.

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

Implementation of IProperty::getProperty.

Implements IProperty.

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

Implementation of IProperty::getProperty.

Implements IProperty.

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

Implementation of IProperty::getProperties.

Implements IProperty.

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.

template<class T>
Property* Algorithm::declareProperty ( const std::string &  name,
T &  property,
const std::string &  doc = "none" 
) const [inline]

Declare the named property.

  MyAlg ( const std::string& name , 
          ISvcLocator*       pSvc ) 
     : Algorithm ( name , pSvc ) 
     , m_property1   ( ... )
     , m_property2   ( ... )
   {
     // declare the property 
     declareProperty( "Property1" , m_property1 , "Doc fro property #1" ) ;

     // declare the property and attach the handler  to it
     declareProperty( "Property2" , m_property2 , "Doc for property #2" ) 
        -> declareUpdateHandler( &MyAlg::handler_2 ) ;
  
   }

See also:
PropertyMgr

PropertyMgr::declareProperty

Parameters:
name the property name
proeprty the property itself,
doc the documentation string
Returns:
the actual property objects

Definition at line 385 of file Algorithm.h.

00388   {
00389     return m_propertyMgr->declareProperty(name, property, doc);
00390   }

Property* Algorithm::declareRemoteProperty ( const std::string &  name,
IProperty rsvc,
const std::string &  rname = "" 
) const [inline]

Declare remote named properties.

Definition at line 394 of file Algorithm.h.

00397   { 
00398     return m_propertyMgr -> declareRemoteProperty ( name , rsvc , rname );
00399   }

IMonitorSvc* Algorithm::monitorSvc (  )  const [inline]

Access the monitor service.

Attention:
Note that this method will return a NULL pointer if no monitor service is configured to be present. You must take this possibility into account when using the pointer
Returns:
Pointer to the Monitor service
Return values:
NULL No monitor service is present
non-NULL A monitor service is present and available to be used

Definition at line 410 of file Algorithm.h.

00411   {
00412     // If not already located try to locate it without forcing a creation
00413     if ( !m_pMonitorSvc ){
00414       service_i( m_monitorSvcName, false, 
00415                  IMonitorSvc::interfaceID(), pp_cast<void>(&m_pMonitorSvc) );
00416     }
00417     return m_pMonitorSvc;
00418   }

template<class T>
void Algorithm::declareInfo ( const std::string &  name,
const T &  var,
const std::string &  desc 
) const [inline]

Declare monitoring information.

Parameters:
name Monitoring information name known to the external system
var Monitoring Listener address (the item to monitor...)
desc Textual description of the information being monitored

Definition at line 426 of file Algorithm.h.

00429   {
00430     IMonitorSvc* mS = monitorSvc();
00431     if ( mS ) mS->declareInfo(name, var, desc, this);
00432   }

void Algorithm::declareInfo ( const std::string &  name,
const std::string &  format,
const void *  var,
int  size,
const std::string &  desc 
) const [inline]

Declare monitoring information (special case).

Parameters:
name Monitoring information name known to the external system
format Format information
var Monitoring Listener address
size Monitoring Listener address size
desc Textual description of the information being monitored

Definition at line 441 of file Algorithm.h.

00446   {
00447     IMonitorSvc* mS = monitorSvc();
00448     if ( mS ) mS->declareInfo(name, format, var, size, desc, this);
00449   }

unsigned long Algorithm::addRef (  )  [virtual]

Methods for IInterface::addRef().

Implements IInterface.

unsigned long Algorithm::release (  )  [virtual]

Methods for IInterface::release().

Implements IInterface.

StatusCode Algorithm::queryInterface ( const InterfaceID riid,
void **   
) [virtual]

Methods for IInterface::queryInterface().

Implements IInterface.

template<class TYPE>
StatusCode Algorithm::setProperty ( const std::string &  name,
const TYPE &  value 
) [inline]

set the property form the value

  std::vector<double> data = ... ;
 
  setProperty( "Data" , data ) ;
 
  std::map<std::string,double> cuts = ... ;
  setProperty( "Cuts" , cuts ) ;

  std::map<std::string,std::string> dict = ... ;
  setProperty( "Dictionary" , dict ) ;

Note: the interface IProperty allows setting of the properties either directly from other properties or from strings only

This is very convinient in resetting of the default properties in the derived classes. E.g. without this method one needs to convert everything into strings to use IProperty::setProperty

    setProperty ( "OutputLevel" , "1"    ) ;
    setProperty ( "Enable"      , "True" ) ;
    setProperty ( "ErrorMax"    , "10"   ) ;

For simple cases it is more or less ok, but for complicated properties it is just ugly..

Parameters:
name name of the property
value value of the property
See also:
Gaudi::Utils::setProperty
Author:
Vanya BELYAEV ibelyaev@physics.syr.edu
Date:
2007-05-13

Definition at line 503 of file Algorithm.h.

00505   { return Gaudi::Utils::setProperty ( m_propertyMgr , name , value ) ; }

bool Algorithm::isInitialized (  )  const [inline, protected, virtual]

Has the Algorithm already been initialized?

Implements IAlgorithm.

Definition at line 510 of file Algorithm.h.

bool Algorithm::isFinalized (  )  const [inline, protected, virtual]

Has the Algorithm already been finalized?

Implements IAlgorithm.

Definition at line 513 of file Algorithm.h.

int Algorithm::outputLevel (  )  const [inline, protected]

retrieve the Algorithm output level

Definition at line 516 of file Algorithm.h.

00516 { return (int)m_outputLevel ; }

IntegerProperty& Algorithm::outputLevelProperty (  )  [inline, protected]

Accessor for the Message level property.

Definition at line 519 of file Algorithm.h.

00519 { return m_outputLevel; }

void Algorithm::initOutputLevel ( Property prop  )  [protected]

callback for output level property

StatusCode Algorithm::service_i ( const std::string &  svcName,
bool  createIf,
const InterfaceID iid,
void **  ppSvc 
) const [private]

implementation of service method

StatusCode Algorithm::service_i ( const std::string &  svcType,
const std::string &  svcName,
const InterfaceID iid,
void **  ppSvc 
) const [private]

Algorithm& Algorithm::operator= ( const Algorithm rhs  )  [private]

Private asignment operator: NO ASSIGNMENT ALLOWED.

static const InterfaceID& IAlgorithm::interfaceID (  )  [inline, static, inherited]

Retrieve interface ID.

Reimplemented from INamedInterface.

Definition at line 25 of file IAlgorithm.h.

00025 { return IID_IAlgorithm; }

virtual StatusCode IAlgorithm::execute (  )  [pure virtual, inherited]

The action to be performed by the algorithm on an event.

This method is invoked once per event for top level algorithms by the application manager.

static const InterfaceID& IProperty::interfaceID (  )  [inline, static, inherited]

Retrieve interface ID.

Reimplemented from IInterface.

Definition at line 28 of file IProperty.h.

00028 { return IID_IProperty; }

static const InterfaceID& IStateful::interfaceID (  )  [inline, static, inherited]

Retrieve interface ID.

Reimplemented from IInterface.

Definition at line 23 of file IStateful.h.

00023 { return IID_IStateful; }


Member Data Documentation

long Algorithm::m_refCount [private]

Counter for references to Algorithm.

Definition at line 527 of file Algorithm.h.

std::string Algorithm::m_name [private]

Algorithm's name for identification.

Definition at line 528 of file Algorithm.h.

std::string Algorithm::m_version [private]

Algorithm's version.

Definition at line 529 of file Algorithm.h.

std::vector<Algorithm *>* Algorithm::m_subAlgms [private]

Sub algorithms.

Definition at line 530 of file Algorithm.h.

IMessageSvc* Algorithm::m_MS [mutable, private]

Message service.

Definition at line 532 of file Algorithm.h.

IDataProviderSvc* Algorithm::m_EDS [mutable, private]

Event data service.

Definition at line 533 of file Algorithm.h.

IConversionSvc* Algorithm::m_ECS [mutable, private]

Event conversion service.

Definition at line 534 of file Algorithm.h.

IDataProviderSvc* Algorithm::m_DDS [mutable, private]

Detector data service.

Definition at line 535 of file Algorithm.h.

IConversionSvc* Algorithm::m_DCS [mutable, private]

Detector conversion service.

Definition at line 536 of file Algorithm.h.

IHistogramSvc* Algorithm::m_HDS [mutable, private]

Histogram data service.

Definition at line 537 of file Algorithm.h.

INTupleSvc* Algorithm::m_NTS [mutable, private]

N tuple service.

Definition at line 538 of file Algorithm.h.

IChronoStatSvc* Algorithm::m_CSS [mutable, private]

Chrono & Stat Service.

Definition at line 540 of file Algorithm.h.

IRndmGenSvc* Algorithm::m_RGS [mutable, private]

Random Number Generator Service.

Definition at line 541 of file Algorithm.h.

IExceptionSvc* Algorithm::m_EXS [mutable, private]

Exception Handler Service.

Definition at line 542 of file Algorithm.h.

IAuditorSvc* Algorithm::m_pAuditorSvc [mutable, private]

Auditor Service.

Definition at line 543 of file Algorithm.h.

IToolSvc* Algorithm::m_ptoolSvc [mutable, private]

ToolSvc Service.

Definition at line 544 of file Algorithm.h.

IMonitorSvc* Algorithm::m_pMonitorSvc [mutable, private]

Online Monitoring Service.

Definition at line 545 of file Algorithm.h.

std::string Algorithm::m_monitorSvcName [private]

Name to use for Monitor Service.

Definition at line 546 of file Algorithm.h.

ISvcLocator* Algorithm::m_pSvcLocator [private]

Pointer to service locator service.

Definition at line 547 of file Algorithm.h.

PropertyMgr* Algorithm::m_propertyMgr [private]

For management of properties.

Definition at line 548 of file Algorithm.h.

IntegerProperty Algorithm::m_outputLevel [private]

Algorithm output level.

Definition at line 549 of file Algorithm.h.

int Algorithm::m_errorMax [private]

Algorithm Max number of errors.

Definition at line 550 of file Algorithm.h.

int Algorithm::m_errorCount [private]

Algorithm error counter.

Definition at line 551 of file Algorithm.h.

BooleanProperty Algorithm::m_auditInit [private]

global flag for auditors

Definition at line 552 of file Algorithm.h.

bool Algorithm::m_auditorInitialize [private]

flag for auditors in "initialize()"

Definition at line 553 of file Algorithm.h.

bool Algorithm::m_auditorReinitialize [private]

flag for auditors in "Reinitialize()"

Definition at line 554 of file Algorithm.h.

bool Algorithm::m_auditorRestart [private]

flag for auditors in "Restart()"

Definition at line 555 of file Algorithm.h.

bool Algorithm::m_auditorExecute [private]

flag for auditors in "execute()"

Definition at line 556 of file Algorithm.h.

bool Algorithm::m_auditorFinalize [private]

flag for auditors in "finalize()"

Definition at line 557 of file Algorithm.h.

bool Algorithm::m_auditorBeginRun [private]

flag for auditors in "beginRun()"

Definition at line 558 of file Algorithm.h.

bool Algorithm::m_auditorEndRun [private]

flag for auditors in "endRun()"

Definition at line 559 of file Algorithm.h.

bool Algorithm::m_auditorStart [private]

flag for auditors in "initialize()"

Definition at line 560 of file Algorithm.h.

bool Algorithm::m_auditorStop [private]

flag for auditors in "Reinitialize()"

Definition at line 561 of file Algorithm.h.

bool Algorithm::m_filterPassed [private]

Filter passed flag.

Definition at line 562 of file Algorithm.h.

bool Algorithm::m_isEnabled [private]

Algorithm is enabled flag.

Definition at line 563 of file Algorithm.h.

bool Algorithm::m_isExecuted [private]

Algorithm is executed flag.

Definition at line 564 of file Algorithm.h.

Gaudi::StateMachine::State Algorithm::m_state [private]

Algorithm has been initialized flag.

Definition at line 565 of file Algorithm.h.

Gaudi::StateMachine::State Algorithm::m_targetState [private]

Algorithm has been initialized flag.

Definition at line 566 of file Algorithm.h.

bool Algorithm::m_isFinalized [private]

Algorithm has been finalized flag.

Definition at line 567 of file Algorithm.h.


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 19:57:05 2011 for GaudiKernel by doxygen 1.4.7