The Gaudi Framework  master (37c0b60a)
Gaudi::Algorithm Class Reference

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

#include </builds/gaudi/Gaudi/GaudiKernel/include/Gaudi/Algorithm.h>

Inheritance diagram for Gaudi::Algorithm:
Collaboration diagram for Gaudi::Algorithm:

Public Types

typedef Gaudi::PluginService::Factory< IAlgorithm *(const std::string &, ISvcLocator *)> Factory
 
- Public Types inherited from extends< 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 (std::string name, ISvcLocator *svcloc, 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...
 
const std::stringname () const override
 The identifying name of the algorithm object. More...
 
const Gaudi::StringKeynameKey () const override
 
const std::stringtype () const override
 The type of the algorithm object. More...
 
void setType (std::string type) override
 
const std::stringversion () 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...
 
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 (std::string_view 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 (std::string_view svcType, std::string_view svcName, T *&psvc) const
 Access a service by name and type, creating it if it doesn't already exist. More...
 
SmartIF< IServiceservice (std::string_view 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 (std::string_view 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< IDataProviderSvc > & detSvc () const
 The standard detector data service. More...
 
SmartIF< IConversionSvc > & detCnvSvc () const
 The standard detector data persistency conversion service. More...
 
SmartIF< IDataProviderSvc > & eventSvc () const
 The standard event data service. More...
 
SmartIF< IDataProviderSvc > & evtSvc () const
 shortcut for method eventSvc More...
 
SmartIF< IConversionSvc > & eventCnvSvc () const
 The standard event data persistency conversion service. More...
 
SmartIF< IHistogramSvc > & histoSvc () const
 The standard histogram service. More...
 
SmartIF< INTupleSvc > & ntupleSvc () const
 The standard N tuple service. More...
 
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...
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T >
Gaudi::Details::PropertyBasedeclareProperty (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, const std::string &toolTypeAndName, bool createIf=true)
 
template<class T >
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
bool isAsynchronous () const
 
void setAsynchronous (bool value)
 
unsigned int cardinality () const override
 Return the cardinality. More...
 
const std::vector< std::string > & neededResources () const override
 
AlgExecStateexecState (const EventContext &ctx) const override
 reference to AlgExecState of Alg More...
 
std::ostreamtoControlFlowExpression (std::ostream &os) const override
 Produce string represention of the control flow expression. More...
 
- Public Member Functions inherited from DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >
std::vector< Gaudi::DataHandle * > inputHandles () const override
 
std::vector< Gaudi::DataHandle * > outputHandles () const override
 
virtual const DataObjIDCollextraInputDeps () const override
 
virtual const DataObjIDCollextraOutputDeps () const override
 
void declare (Gaudi::DataHandle &handle) override
 
void renounce (Gaudi::DataHandle &handle) override
 
bool renounceInput (const DataObjID &id) override
 
const DataObjIDCollinputDataObjs () const override
 
const DataObjIDColloutputDataObjs () const override
 
void addDependency (const DataObjID &id, const Gaudi::DataHandle::Mode &mode) override
 
- Public Member Functions inherited from extends< 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::stringgetInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property. More...
 
Gaudi::Details::PropertyBasedeclareProperty (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::PropertyBasedeclareProperty (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::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property. More...
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name More...
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string More...
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property. More...
 
virtual StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p)=0
 Set the property from a property with a different name. More...
 
virtual StatusCode setProperty (const std::string &s)=0
 Set the property by string. More...
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals. More...
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string. More...
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value More...
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation More...
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property More...
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name More...
 
StatusCode getProperty (std::string_view 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 (std::string_view name) const override
 Return true if we have a property with the given name. More...
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected More...
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (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...
 

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< 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 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< IDataHandleVisitorm_updateDataHandles
 Hook for for derived classes to provide a custom visitor for data handles. More...
 
- Protected Attributes inherited from DataHandleHolderBase< 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 (std::string_view svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
 implementation of legacy service method More...
 
StatusCode service_i (std::string_view svcType, std::string_view svcName, const InterfaceID &iid, void **ppSvc) const
 
 Algorithm (const Algorithm &)=delete
 delete copy constructor: NO COPY ALLOWED More...
 
Algorithmoperator= (const Algorithm &)=delete
 delete 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< IMessageSvcm_MS
 Message service. More...
 
SmartIF< IDataProviderSvcm_EDS
 Event data service. More...
 
SmartIF< IHiveWhiteBoardm_WB
 Event data service (whiteboard) More...
 
SmartIF< IConversionSvcm_ECS
 Event conversion service. More...
 
SmartIF< IDataProviderSvcm_DDS
 Detector data service. More...
 
SmartIF< IConversionSvcm_DCS
 Detector conversion service. More...
 
SmartIF< IHistogramSvcm_HDS
 Histogram data service. More...
 
SmartIF< INTupleSvcm_NTS
 N tuple service. More...
 
SmartIF< IChronoStatSvcm_CSS
 Chrono & Stat Service. More...
 
SmartIF< IRndmGenSvcm_RGS
 Random Number Generator Service. More...
 
SmartIF< IExceptionSvcm_EXS
 Exception Handler Service. More...
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service. More...
 
SmartIF< IToolSvcm_ptoolSvc
 ToolSvc Service. More...
 
SmartIF< IMonitorSvcm_pMonitorSvc
 Online Monitoring Service. More...
 
SmartIF< IAlgContextSvcm_contextSvc
 Algorithm Context Service. More...
 
SmartIF< ITimelineSvcm_timelineSvc
 Timeline Service. More...
 
SmartIF< IAlgExecStateSvcm_aess
 Alg execution state mgr. More...
 
SmartIF< ISvcLocatorm_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, "[[deprecated]] 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_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::stringm_monitorSvcName
 
Gaudi::Property< bool > m_registerContext
 
Gaudi::Property< int > m_cardinality
 
Gaudi::Property< std::vector< std::string > > m_neededResources
 
Gaudi::Property< bool > m_asynchronous
 
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...
 

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 88 of file Algorithm.h.

Member Typedef Documentation

◆ Factory

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

Definition at line 93 of file Algorithm.h.

Constructor & Destructor Documentation

◆ Algorithm() [1/2]

Gaudi::Algorithm::Algorithm ( std::string  name,
ISvcLocator svcloc,
std::string  version = PACKAGE_VERSION 
)
inline

Constructor.

Parameters
nameThe algorithm object's name
svclocA pointer to a service location service

Definition at line 101 of file Algorithm.h.

102  : m_name( std::move( name ) )
103  , m_version( std::move( version ) ) // incremented by AlgResourcePool
104  , m_pSvcLocator( svcloc ) {}

◆ Algorithm() [2/2]

Gaudi::Algorithm::Algorithm ( const Algorithm )
privatedelete

delete copy constructor: NO COPY ALLOWED

Member Function Documentation

◆ acceptDHVisitor()

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

Definition at line 186 of file Algorithm.cpp.

186  {
187  vis->visit( this );
188 
189  // loop through tools
190  for ( auto tool : tools() ) vis->visit( dynamic_cast<AlgTool*>( tool ) );
191  }

◆ addToolsArray()

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

Definition at line 389 of file Algorithm.h.

389  {
390  m_toolHandleArrays.push_back( &hndlArr );
391  }

◆ algExecStateSvc()

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

Definition at line 554 of file Algorithm.cpp.

554 { return get_svc_( m_aess, "AlgExecStateSvc" ); }

◆ auditorSvc()

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

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

Definition at line 555 of file Algorithm.cpp.

555 { return get_svc_( m_pAuditorSvc, "AuditorSvc" ); }

◆ cardinality()

unsigned int Gaudi::Algorithm::cardinality ( ) const
inlineoverride

Return the cardinality.

Definition at line 415 of file Algorithm.h.

415 { return m_cardinality; }

◆ chronoSvc()

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

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

Definition at line 556 of file Algorithm.cpp.

556 { return get_svc_( m_CSS, "ChronoStatSvc" ); }

◆ configure()

StatusCode Gaudi::Algorithm::configure ( )
inlineoverride

Dummy implementation of IStateful::configure() method.

Definition at line 173 of file Algorithm.h.

173 { return StatusCode::SUCCESS; }

◆ contextSvc()

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

get Algorithm Context Service

Definition at line 566 of file Algorithm.cpp.

566 { return get_svc_( m_contextSvc, "AlgContextSvc" ); }

◆ declareInfo() [1/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
nameMonitoring information name known to the external system
formatFormat information
varMonitoring Listener address
sizeMonitoring Listener address size
descTextual description of the information being monitored

Definition at line 356 of file Algorithm.h.

357  {
358  IMonitorSvc* mS = monitorSvc().get();
359  if ( mS ) mS->declareInfo( name, format, var, size, desc, this );
360  }

◆ declareInfo() [2/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
nameMonitoring information name known to the external system
varMonitoring Listener address (the item to monitor...)
descTextual description of the information being monitored

Definition at line 344 of file Algorithm.h.

344  {
345  IMonitorSvc* mS = monitorSvc().get();
346  if ( mS ) mS->declareInfo( name, var, desc, this );
347  }

◆ 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 304 of file Algorithm.h.

305  {
306  this->declareTool( hndl, hndl.typeAndName() ).ignore();
307  return PropertyHolderImpl::declareProperty( name, hndl, doc );
308  }

◆ 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 314 of file Algorithm.h.

315  {
316  addToolsArray( hndlArr );
317  return PropertyHolderImpl::declareProperty( name, hndlArr, doc );
318  }

◆ declareTool() [1/2]

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

Definition at line 369 of file Algorithm.h.

369  {
370  return this->declareTool( handle, handle.typeAndName(), createIf );
371  }

◆ declareTool() [2/2]

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

Definition at line 374 of file Algorithm.h.

374  {
375 
376  StatusCode sc = handle.initialize( toolTypeAndName, handle.isPublic() ? nullptr : this, createIf );
377  if ( !sc ) {
378  throw GaudiException{ std::string{ "Cannot create handle for " } +
379  ( handle.isPublic() ? "public" : "private" ) + " tool " + toolTypeAndName,
380  name(), sc };
381  }
382 
383  m_toolHandles.push_back( &handle );
384 
385  return sc;
386  }

◆ deregisterTool()

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

Definition at line 651 of file Algorithm.cpp.

651  {
653  if ( it != m_tools.end() ) {
654  if ( msgLevel( MSG::DEBUG ) ) debug() << "De-Registering tool " << tool->name() << endmsg;
655  m_tools.erase( it );
656  } else {
657  if ( msgLevel( MSG::DEBUG ) ) debug() << "Could not de-register tool " << tool->name() << endmsg;
658  }
659  }

◆ 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 558 of file Algorithm.cpp.

558 { return get_svc_( m_DCS, "DetectorPersistencySvc" ); }

◆ detSvc()

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

The standard detector data service.

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

Definition at line 557 of file Algorithm.cpp.

557 { return get_svc_( m_DDS, "DetectorDataSvc" ); }

◆ errorCount()

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

Get the number of failures of the algorithm.

Definition at line 665 of file Algorithm.cpp.

665 { return m_aess->algErrorCount( static_cast<const IAlgorithm*>( this ) ); }

◆ 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 560 of file Algorithm.cpp.

560 { return get_svc_( m_ECS, "EventPersistencySvc" ); }

◆ eventSvc()

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

The standard event data service.

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

Definition at line 559 of file Algorithm.cpp.

559 { return get_svc_( m_EDS, "EventDataSvc" ); }

◆ evtSvc()

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

shortcut for method eventSvc

Definition at line 250 of file Algorithm.h.

250 { return eventSvc(); }

◆ exceptionSvc()

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

Get the exception Service.

Definition at line 565 of file Algorithm.cpp.

565 { return get_svc_( m_EXS, "ExceptionSvc" ); }

◆ execState()

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

reference to AlgExecState of Alg

Definition at line 538 of file Algorithm.cpp.

538  {
539  return algExecStateSvc()->algExecState( const_cast<IAlgorithm*>( (const IAlgorithm*)this ), ctx );
540  }

◆ finalize()

StatusCode Gaudi::Algorithm::finalize ( )
inlineoverride

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

Definition at line 184 of file Algorithm.h.

184 { return StatusCode::SUCCESS; }

◆ FSMState()

Gaudi::StateMachine::State Gaudi::Algorithm::FSMState ( ) const
inlineoverride

returns the current state of the algorithm

Definition at line 190 of file Algorithm.h.

190 { return m_state; }

◆ get_svc_()

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

Definition at line 543 of file Algorithm.cpp.

543  {
544  if ( !p ) {
545  p = this->service( service_name );
546  if ( !p ) {
547  throw GaudiException( "Service [" + std::string{ service_name } + "] not found", this->name(),
549  }
550  }
551  return p;
552  }

◆ histoSvc()

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

The standard histogram service.

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

Definition at line 561 of file Algorithm.cpp.

561 { return get_svc_( m_HDS, "HistogramDataSvc" ); }

◆ index()

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

Definition at line 532 of file Algorithm.cpp.

532 { return m_index; }

◆ initialize()

StatusCode Gaudi::Algorithm::initialize ( )
inlineoverride

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

Definition at line 178 of file Algorithm.h.

178 { return StatusCode::SUCCESS; }

◆ initToolHandles()

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

Definition at line 574 of file Algorithm.cpp.

574  {
575 
576  auto init_one = [&]( BaseToolHandle* th ) {
577  if ( !th->isEnabled() ) {
578  if ( msgLevel( MSG::DEBUG ) && !th->typeAndName().empty() )
579  debug() << "ToolHandle " << th->typeAndName() << " not used" << endmsg;
580  return;
581  }
582  if ( !th->get() ) {
583  auto sc = th->retrieve();
584  if ( sc.isFailure() ) {
585  throw GaudiException( "Failed to retrieve tool " + th->typeAndName(), this->name(), StatusCode::FAILURE );
586  }
587  }
588  auto tool = th->get();
589  if ( msgLevel( MSG::DEBUG ) )
590  debug() << "Adding " << ( th->isPublic() ? "public" : "private" ) << " ToolHandle tool " << tool->name() << " ("
591  << tool->type() << ")" << endmsg;
593  };
594 
595  for ( auto thArr : m_toolHandleArrays ) {
596  if ( msgLevel( MSG::DEBUG ) )
597  debug() << "Registering all Tools in ToolHandleArray " << thArr->propertyName() << endmsg;
598  // Iterate over its tools:
599  for ( auto toolHandle : thArr->getBaseArray() ) {
600  BaseToolHandle* bth = dynamic_cast<BaseToolHandle*>( toolHandle );
601  if ( bth ) {
602  init_one( bth );
603  } else {
604  error() << "Error retrieving ToolHandle " << toolHandle->typeAndName() << " in ToolHandleArray "
605  << thArr->propertyName() << ". Not registered" << endmsg;
606  }
607  }
608  }
609 
610  for ( BaseToolHandle* th : m_toolHandles ) init_one( th );
611 
612  m_toolHandlesInit = true;
613  }

◆ isAsynchronous()

bool Gaudi::Algorithm::isAsynchronous ( ) const
inline

Definition at line 396 of file Algorithm.h.

396 { return m_asynchronous; }

◆ isEnabled()

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

Is this algorithm enabled or disabled?

Definition at line 536 of file Algorithm.cpp.

536 { return m_isEnabled; }

◆ isFinalized()

bool Gaudi::Algorithm::isFinalized ( ) const
inlineoverrideprotected

Has the Algorithm already been finalized?

Definition at line 424 of file Algorithm.h.

◆ isInitialized()

bool Gaudi::Algorithm::isInitialized ( ) const
inlineoverrideprotected

Has the Algorithm already been initialized?

Definition at line 421 of file Algorithm.h.

◆ isReEntrant()

bool Gaudi::Algorithm::isReEntrant ( ) const
inlineoverrideprotected

Definition at line 440 of file Algorithm.h.

440 { return true; }

◆ isSequence()

bool Gaudi::Algorithm::isSequence ( ) const
inlineoverride

Are we a Sequence?

Definition at line 198 of file Algorithm.h.

198 { return false; }

◆ maxErrors()

unsigned int Gaudi::Algorithm::maxErrors ( ) const
inlineprivate

Definition at line 437 of file Algorithm.h.

437 { return m_errorMax; }

◆ 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
NULLNo monitor service is present
non-NULLA monitor service is present and available to be used

Definition at line 330 of file Algorithm.h.

330  {
331  // If not already located try to locate it without forcing a creation
332  if ( !m_pMonitorSvc ) {
333  m_pMonitorSvc = service( m_monitorSvcName, false, true ); // do not create and be quiet
334  }
335  return m_pMonitorSvc;
336  }

◆ 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 526 of file Algorithm.cpp.

526 { return m_name.str(); }

◆ nameKey()

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

Definition at line 528 of file Algorithm.cpp.

528 { return m_name; }

◆ neededResources()

const std::vector<std::string>& Gaudi::Algorithm::neededResources ( ) const
inlineoverride

Definition at line 417 of file Algorithm.h.

417 { return m_neededResources; }

◆ 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 562 of file Algorithm.cpp.

562 { return get_svc_( m_NTS, "NTupleSvc" ); }

◆ operator=()

Algorithm& Gaudi::Algorithm::operator= ( const Algorithm )
privatedelete

delete 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 563 of file Algorithm.cpp.

563 { return get_svc_( m_RGS, "RndmGenSvc" ); }

◆ registerContext()

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

register for Algorithm Context Service?

Definition at line 297 of file Algorithm.h.

297 { return m_registerContext; }

◆ registerTool()

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

Definition at line 646 of file Algorithm.cpp.

646  {
647  if ( msgLevel( MSG::DEBUG ) ) { debug() << "Registering tool " << tool->name() << endmsg; }
649  }

◆ reinitialize()

StatusCode Gaudi::Algorithm::reinitialize ( )
override

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

Definition at line 491 of file Algorithm.cpp.

491  {
492  /* @TODO
493  * MCl 2008-10-23: the implementation of reinitialize as finalize+initialize
494  * is causing too many problems
495  *
496  // Default implementation is finalize+initialize
497  StatusCode sc = finalize();
498  if (sc.isFailure()) {
499  error() << "reinitialize(): cannot be finalized" << endmsg;
500  return sc;
501  }
502  sc = initialize();
503  if (sc.isFailure()) {
504  error() << "reinitialize(): cannot be initialized" << endmsg;
505  return sc;
506  }
507  */
508  return StatusCode::SUCCESS;
509  }

◆ restart()

StatusCode Gaudi::Algorithm::restart ( )
override

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

Definition at line 511 of file Algorithm.cpp.

511  {
512  // Default implementation is stop+start
513  StatusCode sc = stop();
514  if ( sc.isFailure() ) {
515  error() << "restart(): cannot be stopped" << endmsg;
516  return sc;
517  }
518  sc = start();
519  if ( sc.isFailure() ) {
520  error() << "restart(): cannot be started" << endmsg;
521  return sc;
522  }
523  return StatusCode::SUCCESS;
524  }

◆ service() [1/4]

template<class T >
SmartIF<T> Gaudi::Algorithm::service ( std::string_view  name,
bool  createIf = true,
bool  quiet = false 
) const
inline

Definition at line 221 of file Algorithm.h.

221  {
222  return service( name, createIf, quiet ).as<T>();
223  }

◆ service() [2/4]

SmartIF< IService > Gaudi::Algorithm::service ( std::string_view  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 641 of file Algorithm.cpp.

641  {
642  const ServiceLocatorHelper helper( *serviceLocator(), *this );
643  return helper.service( name, quiet, createIf );
644  }

◆ service() [3/4]

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

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

Definition at line 206 of file Algorithm.h.

206  {
207  return service_i( name, createIf, T::interfaceID(), (void**)&psvc );
208  }

◆ service() [4/4]

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

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

Definition at line 213 of file Algorithm.h.

213  {
214  return service_i( svcType, svcName, T::interfaceID(), reinterpret_cast<void**>( &psvc ) );
215  }

◆ service_i() [1/2]

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

implementation of legacy service method

Protected Member Functions.

Definition at line 629 of file Algorithm.cpp.

630  {
631  const ServiceLocatorHelper helper( *serviceLocator(), *this );
632  return helper.getService( svcName, createIf, iid, ppSvc );
633  }

◆ service_i() [2/2]

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

Definition at line 635 of file Algorithm.cpp.

636  {
637  const ServiceLocatorHelper helper( *serviceLocator(), *this );
638  return helper.createService( svcType, svcName, iid, ppSvc );
639  }

◆ 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 570 of file Algorithm.cpp.

570  {
571  return *const_cast<SmartIF<ISvcLocator>*>( &m_pSvcLocator );
572  }

◆ setAsynchronous()

void Gaudi::Algorithm::setAsynchronous ( bool  value)
inline

Definition at line 398 of file Algorithm.h.

398 { m_asynchronous = value; }

◆ setIndex()

void Gaudi::Algorithm::setIndex ( const unsigned int &  idx)
overrideprotected

set instantiation index of Alg

Definition at line 534 of file Algorithm.cpp.

534 { m_index = idx; }

◆ setType()

void Gaudi::Algorithm::setType ( std::string  type)
inlineoverride

Definition at line 166 of file Algorithm.h.

166 { m_type = std::move( type ); } // BH, TODO: move to proper place

◆ start()

StatusCode Gaudi::Algorithm::start ( )
inlineoverride

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

Definition at line 180 of file Algorithm.h.

180 { return StatusCode::SUCCESS; }

◆ stop()

StatusCode Gaudi::Algorithm::stop ( )
inlineoverride

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

Definition at line 182 of file Algorithm.h.

182 { return StatusCode::SUCCESS; }

◆ svcLoc()

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

shortcut for method serviceLocator

Definition at line 290 of file Algorithm.h.

290 { return serviceLocator(); }

◆ 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 325 of file Algorithm.cpp.

325  {
326  if ( !isEnabled() ) {
327  if ( msgLevel( MSG::VERBOSE ) ) { verbose() << ".sysExecute(): is not enabled. Skip execution" << endmsg; }
328  return StatusCode::SUCCESS;
329  }
330 
331  AlgExecState& algState = execState( ctx );
332  algState.setState( AlgExecState::State::Executing );
333  StatusCode status;
334 
335  // Should performance profile be performed ?
336  // invoke execute() method of Algorithm class
337  // and catch all uncaught exceptions
338 
339  // lock the context service
340  Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr, ctx );
341 
342  Gaudi::Guards::AuditorGuard guard( this,
343  // check if we want to audit the initialize
344  ( m_auditorExecute ) ? auditorSvc().get() : nullptr, IAuditor::Execute, status );
345 
346  try {
347  ITimelineSvc::TimelineRecorder timelineRecoder;
348  if ( m_doTimeline ) { timelineRecoder = timelineSvc()->getRecorder( name(), ctx ); }
349 
350  status = execute( ctx );
351 
353  algState.setFilterPassed( false );
354  } else if ( status.isFailure() ) {
355  status = exceptionSvc()->handleErr( *this, status );
356  }
357 
358  } catch ( const GaudiException& Exception ) {
359 
360  if ( Exception.code() == StatusCode::FAILURE ) {
361  fatal();
362  } else {
363  error() << " Recoverable";
364  }
365 
366  msgStream() << " Exception with tag=" << Exception.tag() << " is caught " << endmsg;
367 
368  error() << Exception << endmsg;
369 
370  // Stat stat( chronoSvc() , Exception.tag() ) ;
371  status = exceptionSvc()->handle( *this, Exception );
372  } catch ( const std::exception& Exception ) {
373 
374  fatal() << "Standard std::exception is caught in " << __func__ << endmsg;
375  error() << Exception.what() << endmsg;
376  // Stat stat( chronoSvc() , "*std::exception*" ) ;
377  status = exceptionSvc()->handle( *this, Exception );
378  } catch ( ... ) {
379 
380  fatal() << "UNKNOWN Exception is caught " << endmsg;
381  // Stat stat( chronoSvc() , "*UNKNOWN Exception*" ) ;
382 
383  status = exceptionSvc()->handle( *this );
384  }
385 
386  if ( status.isFailure() ) {
387  // Increment the error count
388  unsigned int nerr = m_aess->incrementErrorCount( this );
389  // Check if maximum is exeeded
390  if ( nerr < m_errorMax ) {
391  warning() << "Continuing from error (cnt=" << nerr << ", max=" << m_errorMax << ")" << endmsg;
392  // convert to success
393  status = StatusCode::SUCCESS;
394  } else {
395  error() << "Maximum number of errors (" << m_errorMax << ") reached." << endmsg;
396  }
397  }
398 
399  algState.setState( AlgExecState::State::Done, status );
400 
401  return status;
402  }

◆ 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 449 of file Algorithm.cpp.

449  {
450 
451  // Bypass the finalialization if the algorithm hasn't been initilized.
453 
455 
456  // lock the context service
457  Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr );
458 
460  // Invoke finalize() method of the derived class inside a try/catch clause
461  try {
462  { // limit the scope of the guard
463  Gaudi::Guards::AuditorGuard guard( this,
464  // check if we want to audit the initialize
465  ( m_auditorFinalize ) ? auditorSvc().get() : nullptr, IAuditor::Finalize );
466  // Invoke the finalize() method of the derived class
467  sc = finalize();
468  }
469  if ( sc.isSuccess() ) {
470  // Indicate that this Algorithm has been finalized to prevent duplicate attempts
472  }
473  } catch ( const GaudiException& Exception ) {
474  fatal() << " Exception with tag=" << Exception.tag() << " is caught " << endmsg;
475  error() << Exception << endmsg;
476  Stat stat( chronoSvc(), Exception.tag() );
477  sc = StatusCode::FAILURE;
478  } catch ( const std::exception& Exception ) {
479  fatal() << "Standard std::exception is caught in " << __func__ << endmsg;
480  error() << Exception.what() << endmsg;
481  Stat stat( chronoSvc(), "*std::exception*" );
482  sc = StatusCode::FAILURE;
483  } catch ( ... ) {
484  fatal() << "UNKNOWN Exception is caught " << endmsg;
485  Stat stat( chronoSvc(), "*UNKNOWN Exception*" );
486  sc = StatusCode::FAILURE;
487  }
488  return sc;
489  }

◆ 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 56 of file Algorithm.cpp.

56  {
57 
58  // Bypass the initialization if the algorithm
59  // has already been initialized.
61 
62  // this initializes the messaging, in case property update handlers need to print
63  // and update the property value bypassing the update handler
65 
66  // Set the Algorithm's properties
67  bindPropertiesTo( serviceLocator()->getOptsSvc() );
68 
69  // Bypass the initialization if the algorithm is disabled.
70  // Need to do this after setProperties.
71  if ( !isEnabled() ) return StatusCode::SUCCESS;
72 
74 
75  // TODO: (MCl) where should we do this? initialize or start?
76  // Reset Error count
77  // m_errorCount = 0;
78 
79  // lock the context service
80  Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr );
81 
82  // Get WhiteBoard interface if implemented by EventDataSvc
83  m_WB = service( "EventDataSvc" );
84 
85  // check whether timeline should be done
86  m_doTimeline = timelineSvc()->isEnabled();
87 
88  StatusCode sc;
89  // Invoke initialize() method of the derived class inside a try/catch clause
90  try {
91 
92  { // limit the scope of the guard
93  Gaudi::Guards::AuditorGuard guard( this,
94  // check if we want to audit the initialize
95  ( m_auditorInitialize ) ? auditorSvc().get() : nullptr,
97  // Invoke the initialize() method of the derived class
98  sc = initialize();
99  }
100 
101  if ( sc.isSuccess() ) {
102  // Update the state.
104  }
105  } catch ( const GaudiException& Exception ) {
106  fatal() << " Exception with tag=" << Exception.tag() << " is caught " << endmsg;
107  error() << Exception << endmsg;
108  Stat stat( chronoSvc(), Exception.tag() );
109  sc = StatusCode::FAILURE;
110  } catch ( const std::exception& Exception ) {
111  fatal() << "Standard std::exception is caught in " << __func__ << endmsg;
112  error() << Exception.what() << endmsg;
113  Stat stat( chronoSvc(), "*std::exception*" );
114  sc = StatusCode::FAILURE;
115  } catch ( ... ) {
116  fatal() << "UNKNOWN Exception is caught " << endmsg;
117  Stat stat( chronoSvc(), "*UNKNOWN Exception*" );
118  sc = StatusCode::FAILURE;
119  }
120 
121  algExecStateSvc()->addAlg( this );
122 
123  //
125  //
126 
127  // ignore this step if we're a Sequence
128  if ( this->isSequence() ) { return sc; }
129 
130  if ( msgLevel( MSG::DEBUG ) ) {
131  debug() << "input handles: " << inputHandles().size() << endmsg;
132  debug() << "output handles: " << outputHandles().size() << endmsg;
133  }
134 
135  // check for explicit circular data dependencies in declared handles
137  for ( auto& h : outputHandles() ) {
138  if ( !h->objKey().empty() ) out.emplace( h->fullKey() );
139  }
140  for ( auto& h : inputHandles() ) {
141  if ( !h->objKey().empty() && out.find( h->fullKey() ) != out.end() ) {
142  // TODO: this case leads to a segfault as the SC, seemingly, is not propagated up properly
143  error() << "Explicit circular data dependency detected for id " << h->fullKey() << endmsg;
144  sc = StatusCode::FAILURE;
145  }
146  }
147 
148  if ( !sc ) return sc;
149 
151 
152  // visit all sub-algs and tools, build full set. First initialize ToolHandles if needed
153  try {
155  } catch ( const GaudiException& Exception ) {
156  error() << "Failing initializing ToolHandles : " << Exception << endmsg;
157  return StatusCode::FAILURE;
158  }
160  acceptDHVisitor( &avis );
161 
162  // check for implicit circular data deps from child Algs/AlgTools
163  for ( auto& h : m_outputDataObjs ) {
164  auto i = m_inputDataObjs.find( h );
165  if ( i != m_inputDataObjs.end() ) {
166  if ( m_filterCircDeps ) {
167  warning() << "Implicit circular data dependency detected for id " << h << endmsg;
168  m_inputDataObjs.erase( i );
169  } else {
170  error() << "Implicit circular data dependency detected for id " << h << endmsg;
171  sc = StatusCode::FAILURE;
172  }
173  }
174  }
175 
176  if ( !sc ) return sc;
177 
178  if ( msgLevel( MSG::DEBUG ) && !avis.empty() ) { debug() << "data dependencies:" << avis << endmsg; }
179 
180  // initialize handles
182 
183  return sc;
184  }

◆ 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 238 of file Algorithm.cpp.

238  {
239 
240  // Bypass the initialization if the algorithm is disabled.
241  if ( !isEnabled() ) return StatusCode::SUCCESS;
242 
243  // Check that the current status is the correct one.
245  error() << "sysReinitialize(): cannot reinitialize algorithm not initialized" << endmsg;
246  return StatusCode::FAILURE;
247  }
248 
249  // Reset Error count
250  // m_errorCount = 0; // done during start
251 
252  // lock the context service
253  Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr );
254 
256  // Invoke reinitialize() method of the derived class inside a try/catch clause
257  try {
258  Gaudi::Guards::AuditorGuard guard( this,
259  // check if we want to audit the initialize
260  ( m_auditorReinitialize ) ? auditorSvc().get() : nullptr,
262  // Invoke the reinitialize() method of the derived class
263  sc = reinitialize();
264  } catch ( const GaudiException& Exception ) {
265  fatal() << "sysReinitialize(): Exception with tag=" << Exception.tag() << " is caught" << endmsg;
266  error() << Exception << endmsg;
267  Stat stat( chronoSvc(), Exception.tag() );
268  sc = StatusCode::FAILURE;
269  } catch ( const std::exception& Exception ) {
270  fatal() << "sysReinitialize(): Standard std::exception is caught" << endmsg;
271  error() << Exception.what() << endmsg;
272  Stat stat( chronoSvc(), "*std::exception*" );
273  sc = StatusCode::FAILURE;
274  } catch ( ... ) {
275  fatal() << "sysReinitialize(): UNKNOWN Exception is caught" << endmsg;
276  Stat stat( chronoSvc(), "*UNKNOWN Exception*" );
277  sc = StatusCode::FAILURE;
278  }
279 
280  return sc;
281  }

◆ 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 284 of file Algorithm.cpp.

284  {
285 
286  // Bypass the initialization if the algorithm is disabled.
287  if ( !isEnabled() ) return StatusCode::SUCCESS;
288 
289  // Check that the current status is the correct one.
291  error() << "sysRestart(): cannot restart algorithm not started" << endmsg;
292  return StatusCode::FAILURE;
293  }
294 
295  // lock the context service
296  Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr );
297 
299  // Invoke reinitialize() method of the derived class inside a try/catch clause
300  try {
301  Gaudi::Guards::AuditorGuard guard( this,
302  // check if we want to audit the initialize
303  ( m_auditorRestart ) ? auditorSvc().get() : nullptr, IAuditor::ReStart );
304  // Invoke the reinitialize() method of the derived class
305  sc = restart();
306  } catch ( const GaudiException& Exception ) {
307  fatal() << "sysRestart(): Exception with tag=" << Exception.tag() << " is caught" << endmsg;
308  error() << Exception << endmsg;
309  Stat stat( chronoSvc(), Exception.tag() );
310  sc = StatusCode::FAILURE;
311  } catch ( const std::exception& Exception ) {
312  fatal() << "sysRestart(): Standard std::exception is caught" << endmsg;
313  error() << Exception.what() << endmsg;
314  Stat stat( chronoSvc(), "*std::exception*" );
315  sc = StatusCode::FAILURE;
316  } catch ( ... ) {
317  fatal() << "sysRestart(): UNKNOWN Exception is caught" << endmsg;
318  Stat stat( chronoSvc(), "*UNKNOWN Exception*" );
319  sc = StatusCode::FAILURE;
320  }
321 
322  return sc;
323  }

◆ 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 194 of file Algorithm.cpp.

194  {
195 
196  // Bypass the startup if already running or disabled.
198 
200 
201  // lock the context service
202  Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr );
203 
205  // Invoke start() method of the derived class inside a try/catch clause
206  try {
207  { // limit the scope of the guard
208  Gaudi::Guards::AuditorGuard guard( this,
209  // check if we want to audit the initialize
210  ( m_auditorStart ) ? auditorSvc().get() : nullptr, IAuditor::Start );
211  // Invoke the start() method of the derived class
212  sc = start();
213  }
214  if ( sc.isSuccess() ) {
215  // Update the state.
217  }
218  } catch ( const GaudiException& Exception ) {
219  fatal() << "in sysStart(): exception with tag=" << Exception.tag() << " is caught" << endmsg;
220  error() << Exception << endmsg;
221  Stat stat( chronoSvc(), Exception.tag() );
222  sc = StatusCode::FAILURE;
223  } catch ( const std::exception& Exception ) {
224  fatal() << "in sysStart(): standard std::exception is caught" << endmsg;
225  error() << Exception.what() << endmsg;
226  Stat stat( chronoSvc(), "*std::exception*" );
227  sc = StatusCode::FAILURE;
228  } catch ( ... ) {
229  fatal() << "in sysStart(): UNKNOWN Exception is caught" << endmsg;
230  Stat stat( chronoSvc(), "*UNKNOWN Exception*" );
231  sc = StatusCode::FAILURE;
232  }
233 
234  return sc;
235  }

◆ 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 405 of file Algorithm.cpp.

405  {
406 
407  // Bypass the startup if already running or disabled.
409 
411 
412  // lock the context service
413  Gaudi::Utils::AlgContext cnt( this, registerContext() ? contextSvc().get() : nullptr );
414 
416  // Invoke stop() method of the derived class inside a try/catch clause
417  try {
418  { // limit the scope of the guard
419  Gaudi::Guards::AuditorGuard guard( this,
420  // check if we want to audit the initialize
421  ( m_auditorStop ) ? auditorSvc().get() : nullptr, IAuditor::Stop );
422 
423  // Invoke the stop() method of the derived class
424  sc = stop();
425  }
426  if ( sc.isSuccess() ) {
427  // Update the state.
429  }
430  } catch ( const GaudiException& Exception ) {
431  fatal() << "in sysStop(): exception with tag=" << Exception.tag() << " is caught" << endmsg;
432  error() << Exception << endmsg;
433  Stat stat( chronoSvc(), Exception.tag() );
434  sc = StatusCode::FAILURE;
435  } catch ( const std::exception& Exception ) {
436  fatal() << "in sysStop(): standard std::exception is caught" << endmsg;
437  error() << Exception.what() << endmsg;
438  Stat stat( chronoSvc(), "*std::exception*" );
439  sc = StatusCode::FAILURE;
440  } catch ( ... ) {
441  fatal() << "in sysStop(): UNKNOWN Exception is caught" << endmsg;
442  Stat stat( chronoSvc(), "*UNKNOWN Exception*" );
443  sc = StatusCode::FAILURE;
444  }
445 
446  return sc;
447  }

◆ targetFSMState()

Gaudi::StateMachine::State Gaudi::Algorithm::targetFSMState ( ) const
inlineoverride

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

Definition at line 192 of file Algorithm.h.

192 { return m_targetState; }

◆ terminate()

StatusCode Gaudi::Algorithm::terminate ( )
inlineoverride

Dummy implementation of IStateful::terminate() method.

Definition at line 175 of file Algorithm.h.

175 { return StatusCode::SUCCESS; }

◆ timelineSvc()

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

Definition at line 567 of file Algorithm.cpp.

567 { return get_svc_( m_timelineSvc, "TimelineSvc" ); }

◆ toControlFlowExpression()

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

Produce string represention of the control flow expression.

Definition at line 661 of file Algorithm.cpp.

661  {
662  return os << type() << "('" << name() << "')";
663  }

◆ tools() [1/2]

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

Definition at line 620 of file Algorithm.cpp.

620  {
622  return m_tools;
623  }

◆ tools() [2/2]

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

Definition at line 615 of file Algorithm.cpp.

615  {
617  return m_tools;
618  }

◆ toolSvc()

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

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

Definition at line 564 of file Algorithm.cpp.

564 { return get_svc_( m_ptoolSvc, "ToolSvc" ); }

◆ type()

const std::string& Gaudi::Algorithm::type ( ) const
inlineoverride

The type of the algorithm object.

Definition at line 165 of file Algorithm.h.

165 { return m_type; }

◆ version()

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

Definition at line 530 of file Algorithm.cpp.

530 { return m_version; }

◆ whiteboard()

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

Definition at line 568 of file Algorithm.cpp.

568 { return get_svc_( m_WB, "EventDataSvc" ); }

Member Data Documentation

◆ AlgorithmManager

friend Gaudi::Algorithm::AlgorithmManager

Definition at line 95 of file Algorithm.h.

◆ m_aess

SmartIF<IAlgExecStateSvc> Gaudi::Algorithm::m_aess
mutableprivate

Alg execution state mgr.

Definition at line 474 of file Algorithm.h.

◆ m_asynchronous

Gaudi::Property<bool> Gaudi::Algorithm::m_asynchronous
private
Initial value:
{ this, "Asynchronous", false,
"whether algorithm is asynchronous and uses Boost Fiber to suspend "
"while offloaded code is running." }

Definition at line 518 of file Algorithm.h.

◆ m_auditInit

Gaudi::Property<bool> Gaudi::Algorithm::m_auditInit
private
Initial value:
{ this, "AuditAlgorithms", Details::getDefaultAuditorValue( m_pSvcLocator ),
"[[deprecated]] unused" }

Definition at line 492 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 499 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 500 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 494 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 496 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 498 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 502 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 503 of file Algorithm.h.

◆ m_cardinality

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

Definition at line 513 of file Algorithm.h.

◆ m_contextSvc

SmartIF<IAlgContextSvc> Gaudi::Algorithm::m_contextSvc
mutableprivate

Algorithm Context Service.

Definition at line 471 of file Algorithm.h.

◆ m_CSS

SmartIF<IChronoStatSvc> Gaudi::Algorithm::m_CSS
mutableprivate

Chrono & Stat Service.

Definition at line 465 of file Algorithm.h.

◆ m_DCS

SmartIF<IConversionSvc> Gaudi::Algorithm::m_DCS
mutableprivate

Detector conversion service.

Definition at line 462 of file Algorithm.h.

◆ m_DDS

SmartIF<IDataProviderSvc> Gaudi::Algorithm::m_DDS
mutableprivate

Detector data service.

Definition at line 461 of file Algorithm.h.

◆ m_doTimeline

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

Definition at line 505 of file Algorithm.h.

◆ m_ECS

SmartIF<IConversionSvc> Gaudi::Algorithm::m_ECS
mutableprivate

Event conversion service.

Definition at line 460 of file Algorithm.h.

◆ m_EDS

SmartIF<IDataProviderSvc> Gaudi::Algorithm::m_EDS
mutableprivate

Event data service.

Definition at line 458 of file Algorithm.h.

◆ m_errorMax

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

Definition at line 490 of file Algorithm.h.

◆ m_EXS

SmartIF<IExceptionSvc> Gaudi::Algorithm::m_EXS
mutableprivate

Exception Handler Service.

Definition at line 467 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 522 of file Algorithm.h.

◆ m_HDS

SmartIF<IHistogramSvc> Gaudi::Algorithm::m_HDS
mutableprivate

Histogram data service.

Definition at line 463 of file Algorithm.h.

◆ m_index

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

Algorithm's index.

Definition at line 446 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 488 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 507 of file Algorithm.h.

◆ m_MS

SmartIF<IMessageSvc> Gaudi::Algorithm::m_MS
mutableprivate

Message service.

Definition at line 457 of file Algorithm.h.

◆ m_name

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

Algorithm's name for identification.

Definition at line 443 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 515 of file Algorithm.h.

◆ m_NTS

SmartIF<INTupleSvc> Gaudi::Algorithm::m_NTS
mutableprivate

N tuple service.

Definition at line 464 of file Algorithm.h.

◆ m_outputLevel

Gaudi::Property<int> Gaudi::Algorithm::m_outputLevel
private
Initial value:
{
this, "OutputLevel", MSG::NIL,
"output level" }

Definition at line 484 of file Algorithm.h.

◆ m_pAuditorSvc

SmartIF<IAuditorSvc> Gaudi::Algorithm::m_pAuditorSvc
mutableprivate

Auditor Service.

Definition at line 468 of file Algorithm.h.

◆ m_pMonitorSvc

SmartIF<IMonitorSvc> Gaudi::Algorithm::m_pMonitorSvc
mutableprivate

Online Monitoring Service.

Definition at line 470 of file Algorithm.h.

◆ m_pSvcLocator

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

Pointer to service locator service.

Definition at line 476 of file Algorithm.h.

◆ m_ptoolSvc

SmartIF<IToolSvc> Gaudi::Algorithm::m_ptoolSvc
mutableprivate

ToolSvc Service.

Definition at line 469 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 510 of file Algorithm.h.

◆ m_RGS

SmartIF<IRndmGenSvc> Gaudi::Algorithm::m_RGS
mutableprivate

Random Number Generator Service.

Definition at line 466 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 527 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 528 of file Algorithm.h.

◆ m_timelineSvc

SmartIF<ITimelineSvc> Gaudi::Algorithm::m_timelineSvc
mutableprivate

Timeline Service.

Definition at line 473 of file Algorithm.h.

◆ m_toolHandleArrays

std::vector<GaudiHandleArrayBase*> Gaudi::Algorithm::m_toolHandleArrays
mutableprivate

Definition at line 451 of file Algorithm.h.

◆ m_toolHandles

std::vector<BaseToolHandle*> Gaudi::Algorithm::m_toolHandles
mutableprivate

Definition at line 450 of file Algorithm.h.

◆ m_toolHandlesInit

bool Gaudi::Algorithm::m_toolHandlesInit = false
mutableprivate

Definition at line 525 of file Algorithm.h.

◆ m_tools

std::vector<IAlgTool*> Gaudi::Algorithm::m_tools
mutableprivate

Definition at line 449 of file Algorithm.h.

◆ m_type

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

Algorithm's type.

Definition at line 444 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 480 of file Algorithm.h.

◆ m_version

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

Algorithm's version.

Definition at line 445 of file Algorithm.h.

◆ m_WB

SmartIF<IHiveWhiteBoard> Gaudi::Algorithm::m_WB
mutableprivate

Event data service (whiteboard)

Definition at line 459 of file Algorithm.h.


The documentation for this class was generated from the following files:
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:25
Gaudi::Algorithm::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Algorithm.h:476
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: PropertyBase.h:35
IAuditor::ReStart
@ ReStart
Definition: IAuditor.h:34
Gaudi::Algorithm::m_auditorExecute
Gaudi::Property< bool > m_auditorExecute
Definition: Algorithm.h:499
Gaudi::Algorithm::m_RGS
SmartIF< IRndmGenSvc > m_RGS
Random Number Generator Service.
Definition: Algorithm.h:466
Gaudi::Algorithm::m_EXS
SmartIF< IExceptionSvc > m_EXS
Exception Handler Service.
Definition: Algorithm.h:467
std::string
STL class.
Gaudi::Algorithm::contextSvc
SmartIF< IAlgContextSvc > & contextSvc() const
get Algorithm Context Service
Definition: Algorithm.cpp:566
details::size
constexpr auto size(const T &, Args &&...) noexcept
Definition: AnyDataWrapper.h:23
std::exception
STL class.
IAuditor::Execute
@ Execute
Definition: IAuditor.h:34
Gaudi::Algorithm::m_errorMax
Gaudi::Property< unsigned int > m_errorMax
Definition: Algorithm.h:490
Gaudi::Algorithm::acceptDHVisitor
void acceptDHVisitor(IDataHandleVisitor *) const override
Definition: Algorithm.cpp:186
std::move
T move(T... args)
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:526
Gaudi::Algorithm::eventSvc
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Definition: Algorithm.cpp:559
Gaudi::Algorithm::m_pAuditorSvc
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: Algorithm.h:468
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:314
Gaudi::Algorithm::m_state
Gaudi::StateMachine::State m_state
flag indicating whether ToolHandle tools have been added to m_tools
Definition: Algorithm.h:527
std::unordered_set< DataObjID, DataObjID_Hasher >
Gaudi::Algorithm::addToolsArray
void addToolsArray(ToolHandleArray< T > &hndlArr)
Definition: Algorithm.h:389
Gaudi::Algorithm::type
const std::string & type() const override
The type of the algorithm object.
Definition: Algorithm.h:165
Gaudi::Algorithm::m_isEnabled
Gaudi::Property< bool > m_isEnabled
Definition: Algorithm.h:488
Gaudi::Algorithm::m_neededResources
Gaudi::Property< std::vector< std::string > > m_neededResources
Definition: Algorithm.h:515
std::vector
STL class.
Gaudi::StateMachine::FINALIZE
@ FINALIZE
Definition: StateMachine.h:38
std::find
T find(T... args)
Gaudi::Algorithm::initialize
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition: Algorithm.h:178
GaudiException
Definition: GaudiException.h:31
GaudiPartProp.decorators.get
get
decorate the vector of properties
Definition: decorators.py:283
Gaudi::Algorithm::m_doTimeline
Gaudi::Property< bool > m_doTimeline
Definition: Algorithm.h:505
Gaudi::Algorithm::m_ptoolSvc
SmartIF< IToolSvc > m_ptoolSvc
ToolSvc Service.
Definition: Algorithm.h:469
Gaudi::Algorithm::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Algorithm.cpp:570
Gaudi::Algorithm::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Algorithm.cpp:555
std::unique_ptr::get
T get(T... args)
Gaudi::Algorithm::m_auditorReinitialize
Gaudi::Property< bool > m_auditorReinitialize
Definition: Algorithm.h:496
Gaudi::Algorithm::m_WB
SmartIF< IHiveWhiteBoard > m_WB
Event data service (whiteboard)
Definition: Algorithm.h:459
Gaudi::Functional::FilterDecision::FAILED
@ FAILED
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::outputHandles
std::vector< Gaudi::DataHandle * > outputHandles() const override
Definition: DataHandleHolderBase.h:41
Gaudi::Algorithm::m_HDS
SmartIF< IHistogramSvc > m_HDS
Histogram data service.
Definition: Algorithm.h:463
Gaudi::Algorithm::m_CSS
SmartIF< IChronoStatSvc > m_CSS
Chrono & Stat Service.
Definition: Algorithm.h:465
Gaudi::Algorithm::m_updateDataHandles
std::unique_ptr< IDataHandleVisitor > m_updateDataHandles
Hook for for derived classes to provide a custom visitor for data handles.
Definition: Algorithm.h:480
IMonitorSvc
Definition: IMonitorSvc.h:33
Gaudi::Algorithm::start
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Definition: Algorithm.h:180
DHHVisitor
Definition: DataHandleHolderVisitor.h:21
CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:148
PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >::bindPropertiesTo
void bindPropertiesTo(Gaudi::Interfaces::IOptionsSvc &optsSvc)
Definition: PropertyHolder.h:252
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::m_outputDataObjs
DataObjIDColl m_outputDataObjs
Definition: DataHandleHolderBase.h:98
Gaudi::Guards::AuditorGuard
Definition: Guards.h:213
Gaudi::Algorithm::declareTool
StatusCode declareTool(ToolHandle< T > &handle, bool createIf=true)
Definition: Algorithm.h:369
Gaudi::StateMachine::INITIALIZE
@ INITIALIZE
Definition: StateMachine.h:35
std::vector::push_back
T push_back(T... args)
Gaudi::Algorithm::chronoSvc
SmartIF< IChronoStatSvc > & chronoSvc() const
The standard Chrono & Stat service, Return a pointer to the service if present.
Definition: Algorithm.cpp:556
Gaudi::Algorithm::m_ECS
SmartIF< IConversionSvc > m_ECS
Event conversion service.
Definition: Algorithm.h:460
Gaudi::Algorithm::m_auditInit
Gaudi::Property< bool > m_auditInit
Definition: Algorithm.h:492
Gaudi::Algorithm::initToolHandles
void initToolHandles() const
Definition: Algorithm.cpp:574
IAuditor::Finalize
@ Finalize
Definition: IAuditor.h:34
Gaudi::Algorithm::m_auditorRestart
Gaudi::Property< bool > m_auditorRestart
Definition: Algorithm.h:498
Gaudi::Algorithm::m_auditorStop
Gaudi::Property< bool > m_auditorStop
Definition: Algorithm.h:503
Gaudi::Algorithm::m_NTS
SmartIF< INTupleSvc > m_NTS
N tuple service.
Definition: Algorithm.h:464
Gaudi::Algorithm::m_auditorInitialize
Gaudi::Property< bool > m_auditorInitialize
Definition: Algorithm.h:494
Gaudi::Algorithm::isEnabled
bool isEnabled() const override
Is this algorithm enabled or disabled?
Definition: Algorithm.cpp:536
bug_34121.tool
tool
Definition: bug_34121.py:18
CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >::setUpMessaging
MSG::Level setUpMessaging() const
Set up local caches.
Definition: CommonMessaging.h:174
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition: StateMachine.h:24
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
Gaudi::Algorithm::m_registerContext
Gaudi::Property< bool > m_registerContext
Definition: Algorithm.h:510
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::initDataHandleHolder
void initDataHandleHolder()
initializes all handles - called by the sysInitialize method of any descendant of this
Definition: DataHandleHolderBase.h:94
StatusCode
Definition: StatusCode.h:65
Gaudi::Algorithm::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Algorithm.h:484
IAuditor::Stop
@ Stop
Definition: IAuditor.h:34
IAlgorithm
Definition: IAlgorithm.h:38
GaudiPython.Pythonizations.execute
execute
Definition: Pythonizations.py:578
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::FSMState
Gaudi::StateMachine::State FSMState() const override
returns the current state of the algorithm
Definition: Algorithm.h:190
Gaudi::Algorithm::m_contextSvc
SmartIF< IAlgContextSvc > m_contextSvc
Algorithm Context Service.
Definition: Algorithm.h:471
Gaudi::Details::getDefaultAuditorValue
bool getDefaultAuditorValue(ISvcLocator *loc)
Definition: Algorithm.cpp:44
Gaudi::Algorithm::execState
AlgExecState & execState(const EventContext &ctx) const override
reference to AlgExecState of Alg
Definition: Algorithm.cpp:538
IAuditor::Initialize
@ Initialize
Definition: IAuditor.h:34
IAuditor::ReInitialize
@ ReInitialize
Definition: IAuditor.h:34
Gaudi::Algorithm::m_cardinality
Gaudi::Property< int > m_cardinality
Definition: Algorithm.h:513
ITimelineSvc::TimelineRecorder
RAII helper to record timeline events.
Definition: ITimelineSvc.h:44
AlgSequencer.h
h
Definition: AlgSequencer.py:31
AlgExecState::setState
void setState(State s)
Definition: IAlgExecStateSvc.h:45
Gaudi::Algorithm::m_monitorSvcName
Gaudi::Property< std::string > m_monitorSvcName
Definition: Algorithm.h:507
Gaudi::Utils::AlgContext
Definition: IAlgContextSvc.h:84
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:237
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::m_inputDataObjs
DataObjIDColl m_inputDataObjs
Definition: DataHandleHolderBase.h:98
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes
Definition: ServiceLocatorHelper.h:27
std::vector::erase
T erase(T... args)
CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:185
Gaudi::Algorithm::m_targetState
Gaudi::StateMachine::State m_targetState
Algorithm has been initialized flag.
Definition: Algorithm.h:528
SmartIF< ISvcLocator >
Gaudi::Algorithm::version
const std::string & version() const override
Definition: Algorithm.cpp:530
genconfuser.verbose
verbose
Definition: genconfuser.py:28
Gaudi::Algorithm::m_name
Gaudi::StringKey m_name
Algorithm's name for identification.
Definition: Algorithm.h:443
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:119
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:202
Gaudi::Algorithm::tools
const std::vector< IAlgTool * > & tools() const
Definition: Algorithm.cpp:615
Gaudi::Algorithm::m_EDS
SmartIF< IDataProviderSvc > m_EDS
Event data service.
Definition: Algorithm.h:458
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition: StateMachine.h:26
Gaudi::Algorithm::exceptionSvc
SmartIF< IExceptionSvc > & exceptionSvc() const
Get the exception Service.
Definition: Algorithm.cpp:565
Gaudi::Algorithm::m_auditorStart
Gaudi::Property< bool > m_auditorStart
Definition: Algorithm.h:502
Gaudi::Algorithm::monitorSvc
SmartIF< IMonitorSvc > & monitorSvc() const
Access the monitor service.
Definition: Algorithm.h:330
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
ToolHandleInfo::isPublic
bool isPublic() const noexcept
Definition: ToolHandle.h:51
Stat
Definition: Stat.h:56
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::inputHandles
std::vector< Gaudi::DataHandle * > inputHandles() const override
Definition: DataHandleHolderBase.h:38
Gaudi::StateMachine::ChangeState
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition: StateMachine.cpp:19
Gaudi::Algorithm::m_tools
std::vector< IAlgTool * > m_tools
Definition: Algorithm.h:449
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
Gaudi::Algorithm::algExecStateSvc
SmartIF< IAlgExecStateSvc > & algExecStateSvc() const
Definition: Algorithm.cpp:554
IAuditor::Start
@ Start
Definition: IAuditor.h:34
Gaudi::Algorithm::m_toolHandles
std::vector< BaseToolHandle * > m_toolHandles
Definition: Algorithm.h:450
Gaudi::Algorithm::service_i
StatusCode service_i(std::string_view svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of legacy service method
Definition: Algorithm.cpp:629
PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
Definition: PropertyHolder.h:106
Gaudi::Algorithm::finalize
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
Definition: Algorithm.h:184
MSG::VERBOSE
@ VERBOSE
Definition: IMessageSvc.h:25
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:100
Gaudi::Algorithm::m_toolHandleArrays
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
Definition: Algorithm.h:451
AlgTool
Definition: AlgTool.h:62
BaseToolHandle
Definition: ToolHandle.h:80
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:86
std::vector::begin
T begin(T... args)
Gaudi::Algorithm::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Timeline Service.
Definition: Algorithm.h:473
Gaudi::Algorithm::restart
StatusCode restart() override
the default (empty) implementation of IStateful::restart() method
Definition: Algorithm.cpp:511
MSG::NIL
@ NIL
Definition: IMessageSvc.h:25
Gaudi::Algorithm::m_toolHandlesInit
bool m_toolHandlesInit
Definition: Algorithm.h:525
Gaudi::Algorithm::service
StatusCode service(std::string_view name, T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Algorithm.h:206
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:25
Gaudi::StateMachine::START
@ START
Definition: StateMachine.h:36
Gaudi::Algorithm::m_version
std::string m_version
Algorithm's version.
Definition: Algorithm.h:445
Gaudi::Algorithm::m_DDS
SmartIF< IDataProviderSvc > m_DDS
Detector data service.
Definition: Algorithm.h:461
Gaudi::StringKey::str
const std::string & str() const
the actual string
Definition: StringKey.h:56
Gaudi::Algorithm::timelineSvc
SmartIF< ITimelineSvc > & timelineSvc() const
Definition: Algorithm.cpp:567
Gaudi::Algorithm::m_filterCircDeps
Gaudi::Property< bool > m_filterCircDeps
Definition: Algorithm.h:522
ToolHandle::initialize
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:213
Gaudi::Algorithm::m_index
unsigned int m_index
Algorithm's index.
Definition: Algorithm.h:446
Gaudi::Algorithm::m_aess
SmartIF< IAlgExecStateSvc > m_aess
Alg execution state mgr.
Definition: Algorithm.h:474
Gaudi::Algorithm::m_pMonitorSvc
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: Algorithm.h:470
ToolHandle::typeAndName
std::string typeAndName() const override
Definition: ToolHandle.h:273
std::vector::end
T end(T... args)
Gaudi::Algorithm::reinitialize
StatusCode reinitialize() override
the default (empty) implementation of IStateful::reinitialize() method
Definition: Algorithm.cpp:491
AlgExecState
Definition: IAlgExecStateSvc.h:36
Gaudi::Algorithm::m_asynchronous
Gaudi::Property< bool > m_asynchronous
Definition: Algorithm.h:518
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:101
Gaudi::Details::Property::ParsingErrorPolicy::Exception
@ Exception
Gaudi::Algorithm::registerContext
bool registerContext() const
register for Algorithm Context Service?
Definition: Algorithm.h:297
AlgExecState::setFilterPassed
void setFilterPassed(bool f=true)
Definition: IAlgExecStateSvc.h:44
Gaudi::Algorithm::m_type
std::string m_type
Algorithm's type.
Definition: Algorithm.h:444
Gaudi::Algorithm::stop
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
Definition: Algorithm.h:182
Gaudi::Algorithm::get_svc_
SmartIF< IFace > & get_svc_(SmartIF< IFace > &p, const char *service_name) const
Definition: Algorithm.cpp:543
Gaudi::Algorithm::isSequence
bool isSequence() const override
Are we a Sequence?
Definition: Algorithm.h:198
Gaudi::StateMachine::STOP
@ STOP
Definition: StateMachine.h:37
Gaudi::Algorithm::m_DCS
SmartIF< IConversionSvc > m_DCS
Detector conversion service.
Definition: Algorithm.h:462
IDataHandleVisitor::visit
virtual void visit(const IDataHandleHolder *)=0
PrepareBase.out
out
Definition: PrepareBase.py:20
Gaudi::Algorithm::m_auditorFinalize
Gaudi::Property< bool > m_auditorFinalize
Definition: Algorithm.h:500