#include <GaudiKernel/Algorithm.h>
Inheritance diagram for Algorithm:
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. | |
IAuditorSvc * | auditorSvc () const |
The standard auditor service.May not be invoked before sysInitialize() has been invoked. | |
IChronoStatSvc * | chronoSvc () const |
The standard Chrono & Stat service, Return a pointer to the service if present. | |
IChronoStatSvc * | chronoStatService () const |
Obsoleted name, kept due to the backwards compatibility. | |
IDataProviderSvc * | detSvc () const |
The standard detector data service. | |
IDataProviderSvc * | detDataService () const |
Obsoleted name, kept due to the backwards compatibility. | |
IConversionSvc * | detCnvSvc () const |
The standard detector data persistency conversion service. | |
IConversionSvc * | detDataCnvService () const |
Obsoleted name, kept due to the backwards compatibility. | |
IDataProviderSvc * | eventSvc () const |
The standard event data service. | |
IDataProviderSvc * | evtSvc () const |
shortcut for method eventSvc | |
IDataProviderSvc * | eventDataService () const |
Obsoleted name, kept due to the backwards compatibility. | |
IConversionSvc * | eventCnvSvc () const |
The standard event data persistency conversion service. | |
IConversionSvc * | eventDataCnvService () const |
Obsoleted name, kept due to the backwards compatibility. | |
IHistogramSvc * | histoSvc () const |
The standard histogram service. | |
IHistogramSvc * | histogramDataService () const |
Obsoleted name, kept due to the backwards compatibility. | |
IMessageSvc * | msgSvc () const |
The standard message service. | |
IMessageSvc * | messageService () const |
Obsoleted name, kept due to the backwards compatibility. | |
INTupleSvc * | ntupleSvc () const |
The standard N tuple service. | |
INTupleSvc * | ntupleService () const |
Obsoleted name, kept due to the backwards compatibility. | |
IRndmGenSvc * | randSvc () const |
The standard RandomGen service, Return a pointer to the service if present. | |
IToolSvc * | toolSvc () const |
The standard ToolSvc service, Return a pointer to the service if present. | |
IExceptionSvc * | exceptionSvc () const |
Get the exception Service. | |
ISvcLocator * | serviceLocator () const |
The standard service locator. | |
ISvcLocator * | svcLoc () 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 Property & | getProperty (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> | |
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const |
Declare the named property. | |
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const |
Declare remote named properties. | |
IMonitorSvc * | monitorSvc () 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 InterfaceID & | interfaceID () |
Retrieve interface ID. | |
static const InterfaceID & | interfaceID () |
Retrieve interface ID. | |
static const InterfaceID & | interfaceID () |
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 | |
IntegerProperty & | outputLevelProperty () |
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. | |
Algorithm & | operator= (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. | |
IMessageSvc * | m_MS |
Message service. | |
IDataProviderSvc * | m_EDS |
Event data service. | |
IConversionSvc * | m_ECS |
Event conversion service. | |
IDataProviderSvc * | m_DDS |
Detector data service. | |
IConversionSvc * | m_DCS |
Detector conversion service. | |
IHistogramSvc * | m_HDS |
Histogram data service. | |
INTupleSvc * | m_NTS |
N tuple service. | |
IChronoStatSvc * | m_CSS |
Chrono & Stat Service. | |
IRndmGenSvc * | m_RGS |
Random Number Generator Service. | |
IExceptionSvc * | m_EXS |
Exception Handler Service. | |
IAuditorSvc * | m_pAuditorSvc |
Auditor Service. | |
IToolSvc * | m_ptoolSvc |
ToolSvc Service. | |
IMonitorSvc * | m_pMonitorSvc |
Online Monitoring Service. | |
std::string | m_monitorSvcName |
Name to use for Monitor Service. | |
ISvcLocator * | m_pSvcLocator |
Pointer to service locator service. | |
PropertyMgr * | m_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. |
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).
Pere Mato
David Quarrie
Definition at line 61 of file Algorithm.h.
enum IInterface::Status [inherited] |
Return status.
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 };
Algorithm::Algorithm | ( | const std::string & | name, | |
ISvcLocator * | svcloc, | |||
const std::string & | version = PACKAGE_VERSION | |||
) |
Constructor.
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.
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] |
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] |
virtual StatusCode Algorithm::restart | ( | ) | [virtual] |
virtual bool Algorithm::isExecuted | ( | ) | const [virtual] |
virtual void Algorithm::setExecuted | ( | bool | state | ) | [virtual] |
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] |
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] |
virtual bool Algorithm::filterPassed | ( | ) | const [virtual] |
virtual void Algorithm::setFilterPassed | ( | bool | state | ) | [virtual] |
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.
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 |
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.
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] |
virtual StatusCode Algorithm::setProperty | ( | const std::string & | s | ) | [virtual] |
virtual StatusCode Algorithm::setProperty | ( | const std::string & | n, | |
const std::string & | v | |||
) | [virtual] |
virtual StatusCode Algorithm::getProperty | ( | Property * | p | ) | const [virtual] |
virtual const Property& Algorithm::getProperty | ( | const std::string & | name | ) | const [virtual] |
virtual StatusCode Algorithm::getProperty | ( | const std::string & | n, | |
std::string & | v | |||
) | const [virtual] |
virtual const std::vector<Property*>& Algorithm::getProperties | ( | ) | const [virtual] |
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.
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 ) ; }
name | the property name | |
proeprty | the property itself, | |
doc | the documentation string |
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.
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 }
void Algorithm::declareInfo | ( | const std::string & | name, | |
const T & | var, | |||
const std::string & | desc | |||
) | const [inline] |
Declare monitoring information.
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).
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] |
unsigned long Algorithm::release | ( | ) | [virtual] |
StatusCode Algorithm::queryInterface | ( | const InterfaceID & | riid, | |
void ** | ||||
) | [virtual] |
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..
name | name of the property | |
value | value of the property |
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.
00510 { return Gaudi::StateMachine::INITIALIZED == m_state; }
bool Algorithm::isFinalized | ( | ) | const [inline, protected, virtual] |
Has the Algorithm already been finalized?
Implements IAlgorithm.
Definition at line 513 of file Algorithm.h.
00513 { return Gaudi::StateMachine::CONFIGURED == m_state; }
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] |
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; }
long Algorithm::m_refCount [private] |
std::string Algorithm::m_name [private] |
std::string Algorithm::m_version [private] |
std::vector<Algorithm *>* Algorithm::m_subAlgms [private] |
IMessageSvc* Algorithm::m_MS [mutable, private] |
IDataProviderSvc* Algorithm::m_EDS [mutable, private] |
IConversionSvc* Algorithm::m_ECS [mutable, private] |
IDataProviderSvc* Algorithm::m_DDS [mutable, private] |
IConversionSvc* Algorithm::m_DCS [mutable, private] |
IHistogramSvc* Algorithm::m_HDS [mutable, private] |
INTupleSvc* Algorithm::m_NTS [mutable, private] |
IChronoStatSvc* Algorithm::m_CSS [mutable, private] |
IRndmGenSvc* Algorithm::m_RGS [mutable, private] |
IExceptionSvc* Algorithm::m_EXS [mutable, private] |
IAuditorSvc* Algorithm::m_pAuditorSvc [mutable, private] |
IToolSvc* Algorithm::m_ptoolSvc [mutable, private] |
IMonitorSvc* Algorithm::m_pMonitorSvc [mutable, private] |
std::string Algorithm::m_monitorSvcName [private] |
ISvcLocator* Algorithm::m_pSvcLocator [private] |
PropertyMgr* Algorithm::m_propertyMgr [private] |
IntegerProperty Algorithm::m_outputLevel [private] |
int Algorithm::m_errorMax [private] |
int Algorithm::m_errorCount [private] |
BooleanProperty Algorithm::m_auditInit [private] |
bool Algorithm::m_auditorInitialize [private] |
bool Algorithm::m_auditorReinitialize [private] |
bool Algorithm::m_auditorRestart [private] |
bool Algorithm::m_auditorExecute [private] |
bool Algorithm::m_auditorFinalize [private] |
bool Algorithm::m_auditorBeginRun [private] |
bool Algorithm::m_auditorEndRun [private] |
bool Algorithm::m_auditorStart [private] |
bool Algorithm::m_auditorStop [private] |
bool Algorithm::m_filterPassed [private] |
bool Algorithm::m_isEnabled [private] |
bool Algorithm::m_isExecuted [private] |
Gaudi::StateMachine::State Algorithm::m_state [private] |
bool Algorithm::m_isFinalized [private] |