| The Gaudi Framework v32r1 (f65d50dc)

Public Types | Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Gaudi::Algorithm Class Reference

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

`#include <Gaudi/Algorithm.h>`

Inheritance diagram for Gaudi::Algorithm:
[legend]
Collaboration diagram for Gaudi::Algorithm:
[legend]

## Public Types
typedef Gaudi::PluginService::Factory< IAlgorithm *(const std::string &, ISvcLocator *)> | Factory
Public Types inherited from extends< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >, IDataHandleHolder >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
| Algorithm (const std::string &name, ISvcLocator *svcloc, const std::string &version=PACKAGE_VERSION)
| Constructor. More...
StatusCode | sysStart () override
| Reinitialization method invoked by the framework. More...
StatusCode | sysInitialize () override
| Initialization method invoked by the framework. More...
StatusCode | sysReinitialize () override
| Reinitialization method invoked by the framework. More...
StatusCode | sysRestart () override
| Restart method invoked by the framework. More...
StatusCode | sysExecute (const EventContext &ctx) override
| The actions to be performed by the algorithm on an event. More...
StatusCode | sysStop () override
| System stop. More...
StatusCode | sysFinalize () override
| System finalization. More...
StatusCode | sysBeginRun () override
| beginRun method invoked by the framework. More...
StatusCode | sysEndRun () override
| endRun method invoked by the framework. More...
const std::string & | name () const override
| The identifying name of the algorithm object. More...
const Gaudi::StringKey & | nameKey () const override
const std::string & | type () const override
| The type of the algorithm object. More...
void | setType (const std::string &type) override
const std::string & | version () const override
unsigned int | index () const override
StatusCode | configure () override
| Dummy implementation of IStateful::configure() method. More...
StatusCode | terminate () override
| Dummy implementation of IStateful::terminate() method. More...
StatusCode | initialize () override
| the default (empty) implementation of IStateful::initialize() method More...
StatusCode | start () override
| the default (empty) implementation of IStateful::start() method More...
StatusCode | stop () override
| the default (empty) implementation of IStateful::stop() method More...
StatusCode | finalize () override
| the default (empty) implementation of IStateful::finalize() method More...
StatusCode | reinitialize () override
| the default (empty) implementation of IStateful::reinitialize() method More...
StatusCode | restart () override
| the default (empty) implementation of IStateful::restart() method More...
Gaudi::StateMachine::State | FSMState () const override
| returns the current state of the algorithm More...
Gaudi::StateMachine::State | targetFSMState () const override
| returns the state the algorithm will be in after the ongoing transition More...
StatusCode | beginRun () override
| Algorithm begin run. More...
StatusCode | endRun () override
| Algorithm end run. This method is called at the end of the event loop. More...
bool | isEnabled () const override
| Is this algorithm enabled or disabled? More...
bool | isSequence () const override
| Are we a Sequence? More...
unsigned int | errorCount () const
| Get the number of failures of the algorithm. More...
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. More...
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. More...
SmartIF< IService > | service (const std::string &name, const bool createIf=true, const bool quiet=false) const
| Return a pointer to the service identified by name (or "type/name") More...
template<class T >
SmartIF< T > | service (const std::string &name, bool createIf=true, bool quiet=false) const
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
SmartIF< IChronoStatSvc > & | chronoSvc () const
| The standard Chrono & Stat service, Return a pointer to the service if present. More...
SmartIF< IChronoStatSvc > & | chronoStatService () const
SmartIF< IDataProviderSvc > & | detSvc () const
| The standard detector data service. More...
SmartIF< IDataProviderSvc > & | detDataService () const
SmartIF< IConversionSvc > & | detCnvSvc () const
| The standard detector data persistency conversion service. More...
SmartIF< IConversionSvc > & | detDataCnvService () const
SmartIF< IDataProviderSvc > & | eventSvc () const
| The standard event data service. More...
SmartIF< IDataProviderSvc > & | evtSvc () const
| shortcut for method eventSvc More...
SmartIF< IDataProviderSvc > & | eventDataService () const
SmartIF< IConversionSvc > & | eventCnvSvc () const
| The standard event data persistency conversion service. More...
SmartIF< IConversionSvc > & | eventDataCnvService () const
SmartIF< IHistogramSvc > & | histoSvc () const
| The standard histogram service. More...
SmartIF< IHistogramSvc > & | histogramDataService () const
SmartIF< INTupleSvc > & | ntupleSvc () const
| The standard N tuple service. More...
SmartIF< INTupleSvc > & | ntupleService () const
SmartIF< IRndmGenSvc > & | randSvc () const
| The standard RandomGen service, Return a pointer to the service if present. More...
SmartIF< IToolSvc > & | toolSvc () const
| The standard ToolSvc service, Return a pointer to the service if present. More...
SmartIF< IExceptionSvc > & | exceptionSvc () const
| Get the exception Service. More...
SmartIF< IAlgContextSvc > & | contextSvc () const
| get Algorithm Context Service More...
SmartIF< ITimelineSvc > & | timelineSvc () const
SmartIF< ISvcLocator > & | serviceLocator () const override
| The standard service locator. More...
SmartIF< ISvcLocator > & | svcLoc () const
| shortcut for method serviceLocator More...
SmartIF< IHiveWhiteBoard > & | whiteboard () const
SmartIF< IAlgExecStateSvc > & | algExecStateSvc () const
bool | registerContext () const
| register for Algorithm Context Service? More...
StatusCode | setProperties ()
| Set the algorithm's properties. More...
template<class T >
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
template<class T >
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
SmartIF< IMonitorSvc > & | monitorSvc () const
| Access the monitor service. More...
template<class T >
void | declareInfo (const std::string &name, const T &var, const std::string &desc) const
| Declare monitoring information. More...
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) More...
void | acceptDHVisitor (IDataHandleVisitor *) const override
void | registerTool (IAlgTool *tool) const
void | deregisterTool (IAlgTool *tool) const
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, bool createIf=true)
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
template<class T >
void | addToolsArray (ToolHandleArray< T > &hndlArr)
const std::vector< IAlgTool * > & | tools () const
bool | isIOBound () const
void | setIOBound (bool value)
unsigned int | cardinality () const override
| Return the cardinality. More...
const std::vector< std::string > & | neededResources () const override
AlgExecState & | execState (const EventContext &ctx) const override
| reference to AlgExecState of Alg More...
std::ostream & | toControlFlowExpression (std::ostream &os) const override
| Produce string represention of the control flow expression. More...
Public Member Functions inherited from DataHandleHolderBase< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > > >
std::vector< Gaudi::DataHandle * > | inputHandles () const override
std::vector< Gaudi::DataHandle * > | outputHandles () const override
virtual const DataObjIDColl & | extraInputDeps () const override
virtual const DataObjIDColl & | extraOutputDeps () const override
void | declare (Gaudi::DataHandle &handle) override
void | renounce (Gaudi::DataHandle &handle) override
const DataObjIDColl & | inputDataObjs () const override
const DataObjIDColl & | outputDataObjs () const override
void | addDependency (const DataObjID &id, const Gaudi::DataHandle::Mode &mode) override
Public Member Functions inherited from extends< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >, IDataHandleHolder >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
Public Member Functions inherited from CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >
void | declareCounter (const std::string &tag, Gaudi::Accumulators::PrintableCounter &r)
const Gaudi::Accumulators::PrintableCounter * | findCounter (const std::string &tag) const
void | forEachCounter (Callable &&f) const
int | nCounters () const
std::size_t | nOfCountersToBePrinted ()
void | clearCounters ()
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
| PropertyHolder ()=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...

## Public Attributes
friend | AlgorithmManager

## Protected Member Functions
std::vector< IAlgTool * > & | tools ()
bool | isInitialized () const override
| Has the Algorithm already been initialized? More...
bool | isFinalized () const override
| Has the Algorithm already been finalized? More...
void | setIndex (const unsigned int &idx) override
| set instantiation index of Alg More...
bool | isReEntrant () const override
Protected Member Functions inherited from DataHandleHolderBase< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > > >
void | initDataHandleHolder ()
| initializes all handles - called by the sysInitialize method of any descendant of this More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Protected Attributes
std::unique_ptr< IDataHandleVisitor > | m_updateDataHandles
| Hook for for derived classes to provide a custom visitor for data handles. More...
Protected Attributes inherited from DataHandleHolderBase< CounterHolder< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > > >
DataObjIDColl | m_inputDataObjs
DataObjIDColl | m_outputDataObjs

## Private Member Functions
void | initToolHandles () const
unsigned int | maxErrors () const
template<typename IFace >
SmartIF< IFace > & | get_svc_ (SmartIF< IFace > &p, const char *service_name) const
StatusCode | service_i (const std::string &svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
| implementation of service method More...
StatusCode | service_i (const std::string &svcType, const std::string &svcName, const InterfaceID &iid, void **ppSvc) const
| Algorithm (const Algorithm &a)=delete
| Private Copy constructor: NO COPY ALLOWED. More...
Algorithm & | operator= (const Algorithm &rhs)=delete
| Private assignment operator: NO ASSIGNMENT ALLOWED. More...

## Private Attributes
Gaudi::StringKey | m_name
| Algorithm's name for identification. More...
std::string | m_type
| Algorithm's type. More...
std::string | m_version
| Algorithm's version. More...
unsigned int | m_index = 0
| Algorithm's index. More...
std::vector< IAlgTool * > | m_tools
std::vector< BaseToolHandle * > | m_toolHandles
std::vector< GaudiHandleArrayBase * > | m_toolHandleArrays
SmartIF< IMessageSvc > | m_MS
| Message service. More...
SmartIF< IDataProviderSvc > | m_EDS
| Event data service. More...
SmartIF< IHiveWhiteBoard > | m_WB
| Event data service (whiteboard) More...
SmartIF< IConversionSvc > | m_ECS
| Event conversion service. More...
SmartIF< IDataProviderSvc > | m_DDS
| Detector data service. More...
SmartIF< IConversionSvc > | m_DCS
| Detector conversion service. More...
SmartIF< IHistogramSvc > | m_HDS
| Histogram data service. More...
SmartIF< INTupleSvc > | m_NTS
| N tuple service. More...
SmartIF< IChronoStatSvc > | m_CSS
| Chrono & Stat Service. More...
SmartIF< IRndmGenSvc > | m_RGS
| Random Number Generator Service. More...
SmartIF< IExceptionSvc > | m_EXS
| Exception Handler Service. More...
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...
SmartIF< IToolSvc > | m_ptoolSvc
| ToolSvc Service. More...
SmartIF< IMonitorSvc > | m_pMonitorSvc
| Online Monitoring Service. More...
SmartIF< IAlgContextSvc > | m_contextSvc
| Algorithm Context Service. More...
SmartIF< ITimelineSvc > | m_timelineSvc
| Timeline Service. More...
SmartIF< IAlgExecStateSvc > | m_aess
| Alg execution state mgr. More...
SmartIF< ISvcLocator > | m_pSvcLocator
| Pointer to service locator service. More...
Gaudi::Property< int > | m_outputLevel
Gaudi::Property< bool > | m_isEnabled {this, "Enable", true, "should the algorithm be executed or not"}
Gaudi::Property< unsigned int > | m_errorMax {this, "ErrorMax", 1, " max number of errors"}
Gaudi::Property< bool > | m_auditInit
Gaudi::Property< bool > | m_auditorInitialize
Gaudi::Property< bool > | m_auditorReinitialize
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", m_auditInit.value(), "trigger auditor on restart()"}
Gaudi::Property< bool > | m_auditorExecute {this, "AuditExecute", m_auditInit.value(), "trigger auditor on execute()"}
Gaudi::Property< bool > | m_auditorFinalize
Gaudi::Property< bool > | m_auditorBeginRun
Gaudi::Property< bool > | m_auditorEndRun {this, "AuditEndRun", m_auditInit.value(), "trigger auditor on endRun()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", m_auditInit.value(), "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", m_auditInit.value(), "trigger auditor on stop()"}
Gaudi::Property< bool > | m_doTimeline {this, "Timeline", true, "send events to TimelineSvc"}
Gaudi::Property< std::string > | m_monitorSvcName
Gaudi::Property< bool > | m_registerContext
Gaudi::Property< int > | m_cardinality {this, "Cardinality", 0, "how many clones to create - 0 means algo is reentrant"}
Gaudi::Property< std::vector< std::string > > | m_neededResources
Gaudi::Property< bool > | m_isIOBound
Gaudi::Property< bool > | m_filterCircDeps
bool | m_toolHandlesInit = false
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::CONFIGURED
| flag indicating whether ToolHandle tools have been added to m_tools More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::CONFIGURED
| Algorithm has been initialized flag. More...
bool | m_isFinalized
| Algorithm has been finalized flag. More...
bool | m_beginRunCalled
| temporary flags to check if derived class's begin/endRun methods called More...
bool | m_endRunCalled

## 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 initialize() and afterwards (see the Gaudi user guide).

Author
  Paul Maley
  Pere Mato
  David Quarrie

Date
  1998

Definition at line 79 of file Algorithm.h.

## Member Typedef Documentation

## ◆ Factory

typedef Gaudi::PluginService::Factory<IAlgorithm*( const std::string&, ISvcLocator* )> Gaudi::Algorithm::Factory

Definition at line 84 of file Algorithm.h.

## Constructor & Destructor Documentation

## ◆ Algorithm() [1/2]

Gaudi::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

Definition at line 48 of file Algorithm.cpp.

51 {
52 PyErr_Print();

## ◆ Algorithm() [2/2]

Gaudi::Algorithm::Algorithm | ( | const Algorithm & | a | ) |
| private delete

Private Copy constructor: NO COPY ALLOWED.

## Member Function Documentation

## ◆ acceptDHVisitor()

void Gaudi::Algorithm::acceptDHVisitor | ( | IDataHandleVisitor * | vis | ) | const
| override

Definition at line 194 of file Algorithm.cpp.

## ◆ addToolsArray()

template<class T >

void Gaudi::Algorithm::addToolsArray | ( | ToolHandleArray< T > & | hndlArr | ) |
| inline

Definition at line 424 of file Algorithm.h.

424 {
425 m_toolHandleArrays.push_back( &hndlArr );
426 }
std::vector::push_back
T push_back(T... args)
Gaudi::Algorithm::m_toolHandleArrays
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
Definition: Algorithm.h:486

## ◆ algExecStateSvc()

SmartIF< IAlgExecStateSvc > & Gaudi::Algorithm::algExecStateSvc | ( |  | ) | const

Definition at line 673 of file Algorithm.cpp.

## ◆ auditorSvc()

SmartIF< IAuditorSvc > & Gaudi::Algorithm::auditorSvc | ( |  | ) | const

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

Definition at line 674 of file Algorithm.cpp.

## ◆ beginRun()

StatusCode Gaudi::Algorithm::beginRun | ( |  | ) |
| override

Algorithm begin run.

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

Definition at line 380 of file Algorithm.cpp.

## ◆ cardinality()

unsigned int Gaudi::Algorithm::cardinality | ( |  | ) | const
| inline override

Return the cardinality.

Definition at line 450 of file Algorithm.h.

450 { return m_cardinality; }
Gaudi::Algorithm::m_cardinality
Gaudi::Property< int > m_cardinality
Definition: Algorithm.h:551

## ◆ chronoStatService()

SmartIF<IChronoStatSvc>& Gaudi::Algorithm::chronoStatService | ( |  | ) | const
| inline

Definition at line 242 of file Algorithm.h.

242 {
243 return chronoSvc();
244 }
Gaudi::Algorithm::chronoSvc
SmartIF< IChronoStatSvc > & chronoSvc() const
The standard Chrono & Stat service, Return a pointer to the service if present.
Definition: Algorithm.cpp:675

## ◆ chronoSvc()

SmartIF< IChronoStatSvc > & Gaudi::Algorithm::chronoSvc | ( |  | ) | const

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

Definition at line 675 of file Algorithm.cpp.

## ◆ configure()

StatusCode Gaudi::Algorithm::configure | ( |  | ) |
| inline override

Dummy implementation of IStateful::configure() method.

Definition at line 175 of file Algorithm.h.

175 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ contextSvc()

SmartIF< IAlgContextSvc > & Gaudi::Algorithm::contextSvc | ( |  | ) | const

get Algorithm Context Service

Definition at line 685 of file Algorithm.cpp.

## ◆ declareInfo() [1/2]

template<class T >

void Gaudi::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 378 of file Algorithm.h.

378 {
379 IMonitorSvc* mS = monitorSvc().get();
380 if ( mS ) mS->declareInfo( name, var, desc, this );
381 }
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
Gaudi::Algorithm::monitorSvc
SmartIF< IMonitorSvc > & monitorSvc() const
Access the monitor service.
Definition: Algorithm.h:364
IMonitorSvc
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
Definition: IMonitorSvc.h:23
IMonitorSvc::declareInfo
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:645

## ◆ declareInfo() [2/2]

void Gaudi::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 390 of file Algorithm.h.

391 {
392 IMonitorSvc* mS = monitorSvc().get();
393 if ( mS ) mS->declareInfo( name, format, var, size, desc, this );
394 }
details::size
constexpr auto size(const T &, Args &&...) noexcept
Definition: AnyDataWrapper.h:14
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:109
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:76
Gaudi::Algorithm::monitorSvc
SmartIF< IMonitorSvc > & monitorSvc() const
Access the monitor service.
Definition: Algorithm.h:364
IMonitorSvc
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
Definition: IMonitorSvc.h:23
IMonitorSvc::declareInfo
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:645

## ◆ declareProperty() [1/2]

template<class T >

Gaudi::Details::PropertyBase* Gaudi::Algorithm::declareProperty | ( | const std::string & | name,
|  | ToolHandle< T > & | hndl,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Definition at line 338 of file Algorithm.h.

339 {
340 this->declareTool( hndl, hndl.typeAndName() ).ignore();
341 return PropertyHolderImpl::declareProperty( name, hndl, doc );
342 }
ToolHandle::typeAndName
std::string typeAndName() const override
Definition: ToolHandle.h:260
Gaudi::Algorithm::declareTool
StatusCode declareTool(ToolHandle< T > &handle, bool createIf=true)
Definition: Algorithm.h:404
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:645

## ◆ declareProperty() [2/2]

template<class T >

Gaudi::Details::PropertyBase* Gaudi::Algorithm::declareProperty | ( | const std::string & | name,
|  | ToolHandleArray< T > & | hndlArr,
|  | const std::string & | doc = `"none"`
| ) |  |
| inline

Definition at line 348 of file Algorithm.h.

349 {
350 addToolsArray( hndlArr );
351 return PropertyHolderImpl::declareProperty( name, hndlArr, doc );
352 }
Gaudi::Algorithm::addToolsArray
void addToolsArray(ToolHandleArray< T > &hndlArr)
Definition: Algorithm.h:424
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:645

## ◆ declareTool() [1/2]

template<class T >

StatusCode Gaudi::Algorithm::declareTool | ( | ToolHandle< T > & | handle,
|  | bool | createIf = `true`
| ) |  |
| inline

Definition at line 404 of file Algorithm.h.

404 {
405 return this->declareTool( handle, handle.typeAndName(), createIf );
406 }
ToolHandle::typeAndName
std::string typeAndName() const override
Definition: ToolHandle.h:260
Gaudi::Algorithm::declareTool
StatusCode declareTool(ToolHandle< T > &handle, bool createIf=true)
Definition: Algorithm.h:404

## ◆ declareTool() [2/2]

template<class T >

StatusCode Gaudi::Algorithm::declareTool | ( | ToolHandle< T > & | handle,
|  | std::string | toolTypeAndName,
|  | bool | createIf = `true`
| ) |  |
| inline

Definition at line 409 of file Algorithm.h.

409 {
410
411 StatusCode sc = handle.initialize( toolTypeAndName, handle.isPublic() ? nullptr : this, createIf );
412 if ( UNLIKELY( !sc ) ) {
413 throw GaudiException{std::string{"Cannot create handle for "} + ( handle.isPublic() ? "public" : "private" ) +
414 " tool " + toolTypeAndName,
415 name(), sc};
416 }
417
418 m_toolHandles.push_back( &handle );
419
420 return sc;
421 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
std::string
STL class.
std::vector::push_back
T push_back(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
ToolHandleInfo::isPublic
bool isPublic() const noexcept
Definition: ToolHandle.h:40
ToolHandle::initialize
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:200
Gaudi::Algorithm::m_toolHandles
std::vector< BaseToolHandle * > m_toolHandles
Definition: Algorithm.h:485
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:645

## ◆ deregisterTool()

void Gaudi::Algorithm::deregisterTool | ( | IAlgTool * | tool | ) | const

Definition at line 813 of file Algorithm.cpp.

## ◆ detCnvSvc()

SmartIF< IConversionSvc > & Gaudi::Algorithm::detCnvSvc | ( |  | ) | const

The standard detector data persistency conversion service.

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

Definition at line 677 of file Algorithm.cpp.

## ◆ detDataCnvService()

SmartIF<IConversionSvc>& Gaudi::Algorithm::detDataCnvService | ( |  | ) | const
| inline

Definition at line 256 of file Algorithm.h.

256 {
257 return detCnvSvc();
258 }
Gaudi::Algorithm::detCnvSvc
SmartIF< IConversionSvc > & detCnvSvc() const
The standard detector data persistency conversion service.
Definition: Algorithm.cpp:677

## ◆ detDataService()

SmartIF<IDataProviderSvc>& Gaudi::Algorithm::detDataService | ( |  | ) | const
| inline

Definition at line 250 of file Algorithm.h.

250 { return detSvc(); }
Gaudi::Algorithm::detSvc
SmartIF< IDataProviderSvc > & detSvc() const
The standard detector data service.
Definition: Algorithm.cpp:676

## ◆ detSvc()

SmartIF< IDataProviderSvc > & Gaudi::Algorithm::detSvc | ( |  | ) | const

The standard detector data service.

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

Definition at line 676 of file Algorithm.cpp.

## ◆ endRun()

StatusCode Gaudi::Algorithm::endRun | ( |  | ) |
| override

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

Definition at line 432 of file Algorithm.cpp.

## ◆ errorCount()

unsigned int Gaudi::Algorithm::errorCount | ( |  | ) | const

Get the number of failures of the algorithm.

Definition at line 827 of file Algorithm.cpp.

## ◆ eventCnvSvc()

SmartIF< IConversionSvc > & Gaudi::Algorithm::eventCnvSvc | ( |  | ) | const

The standard event data persistency conversion service.

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

Definition at line 679 of file Algorithm.cpp.

## ◆ eventDataCnvService()

SmartIF<IConversionSvc>& Gaudi::Algorithm::eventDataCnvService | ( |  | ) | const
| inline

Definition at line 274 of file Algorithm.h.

274 {
275 return eventCnvSvc();
276 }
Gaudi::Algorithm::eventCnvSvc
SmartIF< IConversionSvc > & eventCnvSvc() const
The standard event data persistency conversion service.
Definition: Algorithm.cpp:679

## ◆ eventDataService()

SmartIF<IDataProviderSvc>& Gaudi::Algorithm::eventDataService | ( |  | ) | const
| inline

Definition at line 266 of file Algorithm.h.

266 {
267 return eventSvc();
268 }
Gaudi::Algorithm::eventSvc
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Definition: Algorithm.cpp:678

## ◆ eventSvc()

SmartIF< IDataProviderSvc > & Gaudi::Algorithm::eventSvc | ( |  | ) | const

The standard event data service.

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

Definition at line 678 of file Algorithm.cpp.

## ◆ evtSvc()

SmartIF<IDataProviderSvc>& Gaudi::Algorithm::evtSvc | ( |  | ) | const
| inline

shortcut for method eventSvc

Definition at line 265 of file Algorithm.h.

265 { return eventSvc(); }
Gaudi::Algorithm::eventSvc
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Definition: Algorithm.cpp:678

## ◆ exceptionSvc()

SmartIF< IExceptionSvc > & Gaudi::Algorithm::exceptionSvc | ( |  | ) | const

Get the exception Service.

Definition at line 684 of file Algorithm.cpp.

## ◆ execState()

AlgExecState & Gaudi::Algorithm::execState | ( | const EventContext & | ctx | ) | const
| override

reference to AlgExecState of Alg

Definition at line 657 of file Algorithm.cpp.

## ◆ finalize()

StatusCode Gaudi::Algorithm::finalize | ( |  | ) |
| inline override

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

Definition at line 186 of file Algorithm.h.

186 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ FSMState()

Gaudi::StateMachine::State Gaudi::Algorithm::FSMState | ( |  | ) | const
| inline override

returns the current state of the algorithm

Definition at line 192 of file Algorithm.h.

192 { return m_state; }
Gaudi::Algorithm::m_state
Gaudi::StateMachine::State m_state
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Algorithm.h:564

## ◆ get_svc_()

template<typename IFace >

SmartIF< IFace > & Gaudi::Algorithm::get_svc_ | ( | SmartIF< IFace > & | p,
|  | const char * | service_name
| ) |  | const
| private

Definition at line 662 of file Algorithm.cpp.

## ◆ histogramDataService()

SmartIF<IHistogramSvc>& Gaudi::Algorithm::histogramDataService | ( |  | ) | const
| inline

Definition at line 282 of file Algorithm.h.

282 {
283 return histoSvc();
284 }
Gaudi::Algorithm::histoSvc
SmartIF< IHistogramSvc > & histoSvc() const
The standard histogram service.
Definition: Algorithm.cpp:680

## ◆ histoSvc()

SmartIF< IHistogramSvc > & Gaudi::Algorithm::histoSvc | ( |  | ) | const

The standard histogram service.

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

Definition at line 680 of file Algorithm.cpp.

## ◆ index()

unsigned int Gaudi::Algorithm::index | ( |  | ) | const
| override

Definition at line 651 of file Algorithm.cpp.

## ◆ initialize()

StatusCode Gaudi::Algorithm::initialize | ( |  | ) |
| inline override

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

Definition at line 180 of file Algorithm.h.

180 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ initToolHandles()

void Gaudi::Algorithm::initToolHandles | ( |  | ) | const
| private

Definition at line 706 of file Algorithm.cpp.

## ◆ isEnabled()

bool Gaudi::Algorithm::isEnabled | ( |  | ) | const
| override

Is this algorithm enabled or disabled?

Definition at line 655 of file Algorithm.cpp.

## ◆ isFinalized()

bool Gaudi::Algorithm::isFinalized | ( |  | ) | const
| inline override protected

Has the Algorithm already been finalized?

Definition at line 459 of file Algorithm.h.

459 { return Gaudi::StateMachine::CONFIGURED == m_state; }
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
Gaudi::Algorithm::m_state
Gaudi::StateMachine::State m_state
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Algorithm.h:564

## ◆ isInitialized()

bool Gaudi::Algorithm::isInitialized | ( |  | ) | const
| inline override protected

Has the Algorithm already been initialized?

Definition at line 456 of file Algorithm.h.

456 { return Gaudi::StateMachine::INITIALIZED == m_state; }
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
Gaudi::Algorithm::m_state
Gaudi::StateMachine::State m_state
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Algorithm.h:564

## ◆ isIOBound()

bool Gaudi::Algorithm::isIOBound | ( |  | ) | const
| inline

Definition at line 431 of file Algorithm.h.

431 { return m_isIOBound; }
Gaudi::Algorithm::m_isIOBound
Gaudi::Property< bool > m_isIOBound
Definition: Algorithm.h:555

## ◆ isReEntrant()

bool Gaudi::Algorithm::isReEntrant | ( |  | ) | const
| inline override protected

Definition at line 475 of file Algorithm.h.

475 { return true; }

## ◆ isSequence()

bool Gaudi::Algorithm::isSequence | ( |  | ) | const
| inline override

Are we a Sequence?

Definition at line 208 of file Algorithm.h.

208 { return false; }

## ◆ maxErrors()

unsigned int Gaudi::Algorithm::maxErrors | ( |  | ) | const
| inline private

Definition at line 472 of file Algorithm.h.

472 { return m_errorMax; }
Gaudi::Algorithm::m_errorMax
Gaudi::Property< unsigned int > m_errorMax
Definition: Algorithm.h:525

## ◆ monitorSvc()

SmartIF<IMonitorSvc>& Gaudi::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 364 of file Algorithm.h.

364 {
365 // If not already located try to locate it without forcing a creation
366 if ( !m_pMonitorSvc ) {
367 m_pMonitorSvc = service( m_monitorSvcName, false, true ); // do not create and be quiet
368 }
369 return m_pMonitorSvc;
370 }
Gaudi::Algorithm::service
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.
Definition: Algorithm.h:215
Gaudi::Algorithm::m_monitorSvcName
Gaudi::Property< std::string > m_monitorSvcName
Definition: Algorithm.h:545
Gaudi::Algorithm::m_pMonitorSvc
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: Algorithm.h:505

## ◆ name()

const std::string & Gaudi::Algorithm::name | ( |  | ) | const
| override

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.

Definition at line 645 of file Algorithm.cpp.

## ◆ nameKey()

const Gaudi::StringKey & Gaudi::Algorithm::nameKey | ( |  | ) | const
| override

Definition at line 647 of file Algorithm.cpp.

## ◆ neededResources()

const std::vector<std::string>& Gaudi::Algorithm::neededResources | ( |  | ) | const
| inline override

Definition at line 452 of file Algorithm.h.

452 { return m_neededResources; }
Gaudi::Algorithm::m_neededResources
Gaudi::Property< std::vector< std::string > > m_neededResources
Definition: Algorithm.h:552

## ◆ ntupleService()

SmartIF<INTupleSvc>& Gaudi::Algorithm::ntupleService | ( |  | ) | const
| inline

Definition at line 290 of file Algorithm.h.

290 { return ntupleSvc(); }
Gaudi::Algorithm::ntupleSvc
SmartIF< INTupleSvc > & ntupleSvc() const
The standard N tuple service.
Definition: Algorithm.cpp:681

## ◆ ntupleSvc()

SmartIF< INTupleSvc > & Gaudi::Algorithm::ntupleSvc | ( |  | ) | const

The standard N tuple service.

Returns a pointer to the N tuple service if present.

Definition at line 681 of file Algorithm.cpp.

## ◆ operator=()

Algorithm& Gaudi::Algorithm::operator= | ( | const Algorithm & | rhs | ) |
| private delete

Private assignment operator: NO ASSIGNMENT ALLOWED.

## ◆ randSvc()

SmartIF< IRndmGenSvc > & Gaudi::Algorithm::randSvc | ( |  | ) | const

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

Definition at line 682 of file Algorithm.cpp.

## ◆ registerContext()

bool Gaudi::Algorithm::registerContext | ( |  | ) | const
| inline

register for Algorithm Context Service?

Definition at line 322 of file Algorithm.h.

322 { return m_registerContext; }
Gaudi::Algorithm::m_registerContext
Gaudi::Property< bool > m_registerContext
Definition: Algorithm.h:548

## ◆ registerTool()

void Gaudi::Algorithm::registerTool | ( | IAlgTool * | tool | ) | const

Definition at line 808 of file Algorithm.cpp.

## ◆ reinitialize()

StatusCode Gaudi::Algorithm::reinitialize | ( |  | ) |
| override

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

Definition at line 610 of file Algorithm.cpp.

## ◆ restart()

StatusCode Gaudi::Algorithm::restart | ( |  | ) |
| override

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

Definition at line 630 of file Algorithm.cpp.

## ◆ service() [1/4]

template<class T >

StatusCode Gaudi::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 215 of file Algorithm.h.

215 {
216 return service_i( name, createIf, T::interfaceID(), (void**)&psvc );
217 }
Gaudi::Algorithm::service_i
StatusCode service_i(const std::string &svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of service method
Definition: Algorithm.cpp:791
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:645

## ◆ service() [2/4]

template<class T >

StatusCode Gaudi::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 221 of file Algorithm.h.

221 {
222 return service_i( svcType, svcName, T::interfaceID(), reinterpret_cast<void**>( &psvc ) );
223 }
Gaudi::Algorithm::service_i
StatusCode service_i(const std::string &svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of service method
Definition: Algorithm.cpp:791

## ◆ service() [3/4]

SmartIF< IService > Gaudi::Algorithm::service | ( | const std::string & | name,
|  | const bool | createIf = `true`,
|  | const bool | quiet = `false`
| ) |  | const

Return a pointer to the service identified by name (or "type/name")

Definition at line 803 of file Algorithm.cpp.

## ◆ service() [4/4]

template<class T >

SmartIF<T> Gaudi::Algorithm::service | ( | const std::string & | name,
|  | bool | createIf = `true`,
|  | bool | quiet = `false`
| ) |  | const
| inline

Definition at line 229 of file Algorithm.h.

229 {
230 return service( name, createIf, quiet ).as<T>();
231 }
Gaudi::Algorithm::service
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.
Definition: Algorithm.h:215
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:645

## ◆ service_i() [1/2]

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

implementation of service method

Protected Member Functions.

Definition at line 791 of file Algorithm.cpp.

## ◆ service_i() [2/2]

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

Definition at line 797 of file Algorithm.cpp.

## ◆ serviceLocator()

SmartIF< ISvcLocator > & Gaudi::Algorithm::serviceLocator | ( |  | ) | const
| override

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.

Definition at line 689 of file Algorithm.cpp.

## ◆ setIndex()

void Gaudi::Algorithm::setIndex | ( | const unsigned int & | idx | ) |
| override protected

set instantiation index of Alg

Definition at line 653 of file Algorithm.cpp.

## ◆ setIOBound()

void Gaudi::Algorithm::setIOBound | ( | bool | value | ) |
| inline

Definition at line 433 of file Algorithm.h.

433 { m_isIOBound = value; }
Gaudi::Algorithm::m_isIOBound
Gaudi::Property< bool > m_isIOBound
Definition: Algorithm.h:555

## ◆ setProperties()

StatusCode Gaudi::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.

Definition at line 694 of file Algorithm.cpp.

## ◆ setType()

void Gaudi::Algorithm::setType | ( | const std::string & | type | ) |
| inline override

Definition at line 168 of file Algorithm.h.

168 { m_type = type; } // BH, TODO: move to proper place
Gaudi::Algorithm::type
const std::string & type() const override
The type of the algorithm object.
Definition: Algorithm.h:167
Gaudi::Algorithm::m_type
std::string m_type
Algorithm's type.
Definition: Algorithm.h:479

## ◆ start()

StatusCode Gaudi::Algorithm::start | ( |  | ) |
| inline override

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

Definition at line 182 of file Algorithm.h.

182 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ stop()

StatusCode Gaudi::Algorithm::stop | ( |  | ) |
| inline override

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

Definition at line 184 of file Algorithm.h.

184 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ svcLoc()

SmartIF<ISvcLocator>& Gaudi::Algorithm::svcLoc | ( |  | ) | const
| inline

shortcut for method serviceLocator

Definition at line 315 of file Algorithm.h.

315 { return serviceLocator(); }
Gaudi::Algorithm::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Algorithm.cpp:689

## ◆ sysBeginRun()

StatusCode Gaudi::Algorithm::sysBeginRun | ( |  | ) |
| override

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.

Definition at line 334 of file Algorithm.cpp.

## ◆ sysEndRun()

StatusCode Gaudi::Algorithm::sysEndRun | ( |  | ) |
| override

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.

Definition at line 387 of file Algorithm.cpp.

## ◆ sysExecute()

StatusCode Gaudi::Algorithm::sysExecute | ( | const EventContext & | ctx | ) |
| override

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.

Definition at line 438 of file Algorithm.cpp.

## ◆ sysFinalize()

StatusCode Gaudi::Algorithm::sysFinalize | ( |  | ) |
| override

System finalization.

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

Definition at line 558 of file Algorithm.cpp.

## ◆ sysInitialize()

StatusCode Gaudi::Algorithm::sysInitialize | ( |  | ) |
| override

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.

Definition at line 55 of file Algorithm.cpp.

55 {
56 std::string msg( " call_python_method unexpected type from '" );
57 msg += method;
58 msg += "().getCode()' ";
59 PyErr_SetString( PyExc_TypeError, msg.c_str() );
60 PyErr_Print();
61 }
62 // release used objects
63 Py_XDECREF( c );
64 Py_XDECREF( r );
65 //
66 return sc;
67 }
68 // ============================================================================
69
70 // ============================================================================
75 // ============================================================================
76 GaudiPython::PyAlgorithm::PyAlgorithm( PyObject* self, const std::string& name )
77 : Algorithm( name, Gaudi::svcLocator() ), m_self( self ) {
78 // The owner of the Algorithm is Python (as creator) therefore
79 // it should not be deleted by Gaudi (added an extra addRef()).
80 addRef();
81 addRef();
82 }
83 // ============================================================================
84
85 // ============================================================================
86 StatusCode GaudiPython::PyAlgorithm::initialize() { return GaudiPython::call_python_method( m_self, "initialize" ); }
87 // ============================================================================
88 StatusCode GaudiPython::PyAlgorithm::start() { return GaudiPython::call_python_method( m_self, "start" ); }
89 // ============================================================================
90 StatusCode GaudiPython::PyAlgorithm::execute() { return GaudiPython::call_python_method( m_self, "execute" ); }
91 // ============================================================================
92 StatusCode GaudiPython::PyAlgorithm::stop() { return GaudiPython::call_python_method( m_self, "stop" ); }
93 // ============================================================================
94 StatusCode GaudiPython::PyAlgorithm::finalize() { return GaudiPython::call_python_method( m_self, "finalize" ); }
95
96 StatusCode GaudiPython::PyAlgorithm::beginRun() { return GaudiPython::call_python_method( m_self, "beginRun" ); }
97 StatusCode GaudiPython::PyAlgorithm::endRun() { return GaudiPython::call_python_method( m_self, "endRun" ); }
GaudiPython::PyAlgorithm::finalize
StatusCode finalize() override
Definition: Algorithm.cpp:94
GaudiPython::PyAlgorithm::execute
StatusCode execute() override
Definition: Algorithm.cpp:90
gaudirun.c
c
Definition: gaudirun.py:487
GaudiPython::PyAlgorithm::endRun
StatusCode endRun() override
Definition: Algorithm.cpp:97
std::string
STL class.
GaudiPython::PyAlgorithm::initialize
StatusCode initialize() override
Definition: Algorithm.cpp:86
Gaudi::svcLocator
GAUDI_API ISvcLocator * svcLocator()
implements< IConverter >::addRef
unsigned long addRef() override
Reference Interface instance.
Definition: implements.h:38
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
GaudiPython::PyAlgorithm::stop
StatusCode stop() override
Definition: Algorithm.cpp:92
Algorithm
Alias for backward compatibility.
Definition: Algorithm.h:56
CommonMessagingBase::msg
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:113
GaudiPython::PyAlgorithm::beginRun
StatusCode beginRun() override
Definition: Algorithm.cpp:96
GaudiPython::PyAlgorithm::start
StatusCode start() override
Definition: Algorithm.cpp:88
GaudiPython::call_python_method
GAUDI_API StatusCode call_python_method(PyObject *self, const char *method)
call the python method
Definition: Algorithm.cpp:28
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1
GaudiPython::PyAlgorithm::PyAlgorithm
PyAlgorithm(PyObject *self, const std::string &name)
constructor
Definition: Algorithm.cpp:76
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:645

## ◆ sysReinitialize()

StatusCode Gaudi::Algorithm::sysReinitialize | ( |  | ) |
| override

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.

Definition at line 246 of file Algorithm.cpp.

## ◆ sysRestart()

StatusCode Gaudi::Algorithm::sysRestart | ( |  | ) |
| override

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.

Definition at line 292 of file Algorithm.cpp.

## ◆ sysStart()

StatusCode Gaudi::Algorithm::sysStart | ( |  | ) |
| override

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.

Definition at line 202 of file Algorithm.cpp.

## ◆ sysStop()

StatusCode Gaudi::Algorithm::sysStop | ( |  | ) |
| override

System stop.

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

Definition at line 514 of file Algorithm.cpp.

## ◆ targetFSMState()

Gaudi::StateMachine::State Gaudi::Algorithm::targetFSMState | ( |  | ) | const
| inline override

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

Definition at line 194 of file Algorithm.h.

194 { return m_targetState; }
Gaudi::Algorithm::m_targetState
Gaudi::StateMachine::State m_targetState
Algorithm has been initialized flag.
Definition: Algorithm.h:565

## ◆ terminate()

StatusCode Gaudi::Algorithm::terminate | ( |  | ) |
| inline override

Dummy implementation of IStateful::terminate() method.

Definition at line 177 of file Algorithm.h.

177 { return StatusCode::SUCCESS; }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85

## ◆ timelineSvc()

SmartIF< ITimelineSvc > & Gaudi::Algorithm::timelineSvc | ( |  | ) | const

Definition at line 686 of file Algorithm.cpp.

## ◆ toControlFlowExpression()

std::ostream & Gaudi::Algorithm::toControlFlowExpression | ( | std::ostream & | os | ) | const
| override

Produce string represention of the control flow expression.

Definition at line 823 of file Algorithm.cpp.

## ◆ tools() [1/2]

const std::vector< IAlgTool * > & Gaudi::Algorithm::tools | ( |  | ) | const

Definition at line 777 of file Algorithm.cpp.

## ◆ tools() [2/2]

std::vector< IAlgTool * > & Gaudi::Algorithm::tools | ( |  | ) |
| protected

Definition at line 782 of file Algorithm.cpp.

## ◆ toolSvc()

SmartIF< IToolSvc > & Gaudi::Algorithm::toolSvc | ( |  | ) | const

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

Definition at line 683 of file Algorithm.cpp.

## ◆ type()

const std::string& Gaudi::Algorithm::type | ( |  | ) | const
| inline override

The type of the algorithm object.

Definition at line 167 of file Algorithm.h.

167 { return m_type; }
Gaudi::Algorithm::m_type
std::string m_type
Algorithm's type.
Definition: Algorithm.h:479

## ◆ version()

const std::string & Gaudi::Algorithm::version | ( |  | ) | const
| override

Definition at line 649 of file Algorithm.cpp.

## ◆ whiteboard()

SmartIF< IHiveWhiteBoard > & Gaudi::Algorithm::whiteboard | ( |  | ) | const

Definition at line 687 of file Algorithm.cpp.

## Member Data Documentation

## ◆ AlgorithmManager

friend Gaudi::Algorithm::AlgorithmManager

Definition at line 86 of file Algorithm.h.

## ◆ m_aess

SmartIF<IAlgExecStateSvc> Gaudi::Algorithm::m_aess
| mutable private

Alg execution state mgr.

Definition at line 509 of file Algorithm.h.

## ◆ m_auditInit

Gaudi::Property<bool> Gaudi::Algorithm::m_auditInit
| private

Initial value:
{this, "AuditAlgorithms", Details::getDefaultAuditorValue( m_pSvcLocator ),
" unused"}

Definition at line 527 of file Algorithm.h.

## ◆ m_auditorBeginRun

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorBeginRun
| private

Initial value:
{this, "AuditBeginRun", m_auditInit.value(),
"trigger auditor on beginRun()"}

Definition at line 537 of file Algorithm.h.

## ◆ m_auditorEndRun

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorEndRun {this, "AuditEndRun", m_auditInit.value(), "trigger auditor on endRun()"}
| private

Definition at line 539 of file Algorithm.h.

## ◆ m_auditorExecute

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorExecute {this, "AuditExecute", m_auditInit.value(), "trigger auditor on execute()"}
| private

Definition at line 534 of file Algorithm.h.

## ◆ m_auditorFinalize

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorFinalize
| private

Initial value:
{this, "AuditFinalize", m_auditInit.value(),
"trigger auditor on finalize()"}

Definition at line 535 of file Algorithm.h.

## ◆ m_auditorInitialize

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorInitialize
| private

Initial value:
{this, "AuditInitialize", m_auditInit.value(),
"trigger auditor on initialize()"}

Definition at line 529 of file Algorithm.h.

## ◆ m_auditorReinitialize

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorReinitialize
| private

Initial value:
{this, "AuditReinitialize", m_auditInit.value(),
"trigger auditor on reinitialize()"}

Definition at line 531 of file Algorithm.h.

## ◆ m_auditorRestart

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorRestart {this, "AuditRestart", m_auditInit.value(), "trigger auditor on restart()"}
| private

Definition at line 533 of file Algorithm.h.

## ◆ m_auditorStart

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorStart {this, "AuditStart", m_auditInit.value(), "trigger auditor on start()"}
| private

Definition at line 540 of file Algorithm.h.

## ◆ m_auditorStop

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorStop {this, "AuditStop", m_auditInit.value(), "trigger auditor on stop()"}
| private

Definition at line 541 of file Algorithm.h.

## ◆ m_beginRunCalled

bool Gaudi::Algorithm::m_beginRunCalled
| private

temporary flags to check if derived class's begin/endRun methods called

Definition at line 569 of file Algorithm.h.

## ◆ m_cardinality

Gaudi::Property<int> Gaudi::Algorithm::m_cardinality {this, "Cardinality", 0, "how many clones to create - 0 means algo is reentrant"}
| private

Definition at line 551 of file Algorithm.h.

## ◆ m_contextSvc

SmartIF<IAlgContextSvc> Gaudi::Algorithm::m_contextSvc
| mutable private

Algorithm Context Service.

Definition at line 506 of file Algorithm.h.

## ◆ m_CSS

SmartIF<IChronoStatSvc> Gaudi::Algorithm::m_CSS
| mutable private

Chrono & Stat Service.

Definition at line 500 of file Algorithm.h.

## ◆ m_DCS

SmartIF<IConversionSvc> Gaudi::Algorithm::m_DCS
| mutable private

Detector conversion service.

Definition at line 497 of file Algorithm.h.

## ◆ m_DDS

SmartIF<IDataProviderSvc> Gaudi::Algorithm::m_DDS
| mutable private

Detector data service.

Definition at line 496 of file Algorithm.h.

## ◆ m_doTimeline

Gaudi::Property<bool> Gaudi::Algorithm::m_doTimeline {this, "Timeline", true, "send events to TimelineSvc"}
| private

Definition at line 543 of file Algorithm.h.

## ◆ m_ECS

SmartIF<IConversionSvc> Gaudi::Algorithm::m_ECS
| mutable private

Event conversion service.

Definition at line 495 of file Algorithm.h.

## ◆ m_EDS

SmartIF<IDataProviderSvc> Gaudi::Algorithm::m_EDS
| mutable private

Event data service.

Definition at line 493 of file Algorithm.h.

## ◆ m_endRunCalled

bool Gaudi::Algorithm::m_endRunCalled
| private

Definition at line 570 of file Algorithm.h.

## ◆ m_errorMax

Gaudi::Property<unsigned int> Gaudi::Algorithm::m_errorMax {this, "ErrorMax", 1, " max number of errors"}
| private

Definition at line 525 of file Algorithm.h.

## ◆ m_EXS

SmartIF<IExceptionSvc> Gaudi::Algorithm::m_EXS
| mutable private

Exception Handler Service.

Definition at line 502 of file Algorithm.h.

## ◆ m_filterCircDeps

Gaudi::Property<bool> Gaudi::Algorithm::m_filterCircDeps
| private

Initial value:
{this, "FilterCircularDependencies", true,
"filter out circular data dependencies"}

Definition at line 559 of file Algorithm.h.

## ◆ m_HDS

SmartIF<IHistogramSvc> Gaudi::Algorithm::m_HDS
| mutable private

Histogram data service.

Definition at line 498 of file Algorithm.h.

## ◆ m_index

unsigned int Gaudi::Algorithm::m_index = 0
| private

Algorithm's index.

Definition at line 481 of file Algorithm.h.

## ◆ m_isEnabled

Gaudi::Property<bool> Gaudi::Algorithm::m_isEnabled {this, "Enable", true, "should the algorithm be executed or not"}
| private

Definition at line 523 of file Algorithm.h.

## ◆ m_isFinalized

bool Gaudi::Algorithm::m_isFinalized
| private

Algorithm has been finalized flag.

Definition at line 566 of file Algorithm.h.

## ◆ m_isIOBound

Gaudi::Property<bool> Gaudi::Algorithm::m_isIOBound
| private

Initial value:
{this, "IsIOBound", false,
"if the algorithm is I/O-bound (in the broad sense of Von Neumann bottleneck)"}

Definition at line 555 of file Algorithm.h.

## ◆ m_monitorSvcName

Gaudi::Property<std::string> Gaudi::Algorithm::m_monitorSvcName
| private

Initial value:
{this, "MonitorService", "MonitorSvc",
"name to use for Monitor Service"}

Definition at line 545 of file Algorithm.h.

## ◆ m_MS

SmartIF<IMessageSvc> Gaudi::Algorithm::m_MS
| mutable private

Message service.

Definition at line 492 of file Algorithm.h.

## ◆ m_name

Gaudi::StringKey Gaudi::Algorithm::m_name
| private

Algorithm's name for identification.

Definition at line 478 of file Algorithm.h.

## ◆ m_neededResources

Gaudi::Property<std::vector<std::string> > Gaudi::Algorithm::m_neededResources
| private

Initial value:
{
this, "NeededResources", {}, "named resources needed during event looping"}

Definition at line 552 of file Algorithm.h.

## ◆ m_NTS

SmartIF<INTupleSvc> Gaudi::Algorithm::m_NTS
| mutable private

N tuple service.

Definition at line 499 of file Algorithm.h.

## ◆ m_outputLevel

Gaudi::Property<int> Gaudi::Algorithm::m_outputLevel
| private

Initial value:
{
this, "OutputLevel", MSG::NIL,
[this]( Gaudi::Details::PropertyBase& ) { this->updateMsgStreamOutputLevel( this->m_outputLevel ); },
"output level"}

Definition at line 519 of file Algorithm.h.

## ◆ m_pAuditorSvc

SmartIF<IAuditorSvc> Gaudi::Algorithm::m_pAuditorSvc
| mutable private

Auditor Service.

Definition at line 503 of file Algorithm.h.

## ◆ m_pMonitorSvc

SmartIF<IMonitorSvc> Gaudi::Algorithm::m_pMonitorSvc
| mutable private

Online Monitoring Service.

Definition at line 505 of file Algorithm.h.

## ◆ m_pSvcLocator

SmartIF<ISvcLocator> Gaudi::Algorithm::m_pSvcLocator
| private

Pointer to service locator service.

Definition at line 511 of file Algorithm.h.

## ◆ m_ptoolSvc

SmartIF<IToolSvc> Gaudi::Algorithm::m_ptoolSvc
| mutable private

ToolSvc Service.

Definition at line 504 of file Algorithm.h.

## ◆ m_registerContext

Gaudi::Property<bool> Gaudi::Algorithm::m_registerContext
| private

Initial value:
{this, "RegisterForContextService", false,
"flag to enforce the registration for Algorithm Context Service"}

Definition at line 548 of file Algorithm.h.

## ◆ m_RGS

SmartIF<IRndmGenSvc> Gaudi::Algorithm::m_RGS
| mutable private

Random Number Generator Service.

Definition at line 501 of file Algorithm.h.

## ◆ m_state

Gaudi::StateMachine::State Gaudi::Algorithm::m_state = Gaudi::StateMachine::CONFIGURED
| private

flag indicating whether ToolHandle tools have been added to m_tools

Algorithm has been initialized flag

Definition at line 564 of file Algorithm.h.

## ◆ m_targetState

Gaudi::StateMachine::State Gaudi::Algorithm::m_targetState = Gaudi::StateMachine::CONFIGURED
| private

Algorithm has been initialized flag.

Definition at line 565 of file Algorithm.h.

## ◆ m_timelineSvc

SmartIF<ITimelineSvc> Gaudi::Algorithm::m_timelineSvc
| mutable private

Timeline Service.

Definition at line 508 of file Algorithm.h.

## ◆ m_toolHandleArrays

std::vector<GaudiHandleArrayBase*> Gaudi::Algorithm::m_toolHandleArrays
| mutable private

Definition at line 486 of file Algorithm.h.

## ◆ m_toolHandles

std::vector<BaseToolHandle*> Gaudi::Algorithm::m_toolHandles
| mutable private

Definition at line 485 of file Algorithm.h.

## ◆ m_toolHandlesInit

bool Gaudi::Algorithm::m_toolHandlesInit = false
| mutable private

Definition at line 562 of file Algorithm.h.

## ◆ m_tools

std::vector<IAlgTool*> Gaudi::Algorithm::m_tools
| mutable private

Definition at line 484 of file Algorithm.h.

## ◆ m_type

std::string Gaudi::Algorithm::m_type
| private

Algorithm's type.

Definition at line 479 of file Algorithm.h.

## ◆ m_updateDataHandles

std::unique_ptr<IDataHandleVisitor> Gaudi::Algorithm::m_updateDataHandles
| protected

Hook for for derived classes to provide a custom visitor for data handles.

Definition at line 515 of file Algorithm.h.

## ◆ m_version

std::string Gaudi::Algorithm::m_version
| private

Algorithm's version.

Definition at line 480 of file Algorithm.h.

## ◆ m_WB

SmartIF<IHiveWhiteBoard> Gaudi::Algorithm::m_WB
| mutable private

Event data service (whiteboard)

Definition at line 494 of file Algorithm.h.

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

- GaudiKernel/Gaudi/Algorithm.h
- GaudiPython/src/Lib/Algorithm.cpp