The Gaudi Framework  v36r16 (ea80daf8)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
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, std::string toolTypeAndName, bool createIf=true)
 
template<class T >
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
bool isBlocking () const
 
void setBlocking (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 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_blocking
 
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...
 

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

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

◆ addToolsArray()

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

Definition at line 387 of file Algorithm.h.

387  {
388  m_toolHandleArrays.push_back( &hndlArr );
389  }

◆ algExecStateSvc()

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

Definition at line 556 of file Algorithm.cpp.

556 { 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 557 of file Algorithm.cpp.

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

◆ cardinality()

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

Return the cardinality.

Definition at line 413 of file Algorithm.h.

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

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

568 { 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 354 of file Algorithm.h.

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

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

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

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

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

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

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

◆ declareTool() [1/2]

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

Definition at line 367 of file Algorithm.h.

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

◆ declareTool() [2/2]

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

Definition at line 372 of file Algorithm.h.

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

◆ deregisterTool()

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

Definition at line 653 of file Algorithm.cpp.

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

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

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

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

◆ errorCount()

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

Get the number of failures of the algorithm.

Definition at line 667 of file Algorithm.cpp.

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

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

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

◆ evtSvc()

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

shortcut for method eventSvc

Definition at line 248 of file Algorithm.h.

248 { return eventSvc(); }

◆ exceptionSvc()

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

Get the exception Service.

Definition at line 567 of file Algorithm.cpp.

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

◆ execState()

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

reference to AlgExecState of Alg

Definition at line 540 of file Algorithm.cpp.

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

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

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

◆ histoSvc()

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

The standard histogram service.

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

Definition at line 563 of file Algorithm.cpp.

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

◆ index()

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

Definition at line 534 of file Algorithm.cpp.

534 { 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 576 of file Algorithm.cpp.

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

◆ isBlocking()

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

Definition at line 394 of file Algorithm.h.

394 { return m_blocking; }

◆ isEnabled()

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

Is this algorithm enabled or disabled?

Definition at line 538 of file Algorithm.cpp.

538 { return m_isEnabled; }

◆ isFinalized()

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

Has the Algorithm already been finalized?

Definition at line 422 of file Algorithm.h.

◆ isInitialized()

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

Has the Algorithm already been initialized?

Definition at line 419 of file Algorithm.h.

◆ isReEntrant()

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

Definition at line 438 of file Algorithm.h.

438 { 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 435 of file Algorithm.h.

435 { 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 328 of file Algorithm.h.

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

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

528 { return m_name.str(); }

◆ nameKey()

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

Definition at line 530 of file Algorithm.cpp.

530 { return m_name; }

◆ neededResources()

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

Definition at line 415 of file Algorithm.h.

415 { 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 564 of file Algorithm.cpp.

564 { 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 565 of file Algorithm.cpp.

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

◆ registerContext()

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

register for Algorithm Context Service?

Definition at line 295 of file Algorithm.h.

295 { return m_registerContext; }

◆ registerTool()

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

Definition at line 648 of file Algorithm.cpp.

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

◆ reinitialize()

StatusCode Gaudi::Algorithm::reinitialize ( )
override

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

Definition at line 493 of file Algorithm.cpp.

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

◆ restart()

StatusCode Gaudi::Algorithm::restart ( )
override

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

Definition at line 513 of file Algorithm.cpp.

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

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

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

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

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

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

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

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

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

◆ service_i() [1/2]

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

implementation of service method

Protected Member Functions.

Definition at line 631 of file Algorithm.cpp.

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

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

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

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

572  {
573  return *const_cast<SmartIF<ISvcLocator>*>( &m_pSvcLocator );
574  }

◆ setBlocking()

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

Definition at line 396 of file Algorithm.h.

396 { m_blocking = value; }

◆ setIndex()

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

set instantiation index of Alg

Definition at line 536 of file Algorithm.cpp.

536 { 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 288 of file Algorithm.h.

288 { 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 327 of file Algorithm.cpp.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

569 { 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 663 of file Algorithm.cpp.

663  {
664  return os << type() << "('" << name() << "')";
665  }

◆ tools() [1/2]

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

Definition at line 622 of file Algorithm.cpp.

622  {
624  return m_tools;
625  }

◆ tools() [2/2]

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

Definition at line 617 of file Algorithm.cpp.

617  {
619  return m_tools;
620  }

◆ toolSvc()

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

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

Definition at line 566 of file Algorithm.cpp.

566 { 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 532 of file Algorithm.cpp.

532 { return m_version; }

◆ whiteboard()

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

Definition at line 570 of file Algorithm.cpp.

570 { 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 472 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 490 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 497 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 498 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 492 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 494 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 496 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 500 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 501 of file Algorithm.h.

◆ m_blocking

Gaudi::Property<bool> Gaudi::Algorithm::m_blocking
private
Initial value:
{
this, "Blocking", false,
"if algorithm invokes CPU-blocking system calls (offloads computations to accelerators or "
"quantum processors, performs disk or network I/O, is bound by resource synchronization, etc)" }

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

◆ m_contextSvc

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

Algorithm Context Service.

Definition at line 469 of file Algorithm.h.

◆ m_CSS

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

Chrono & Stat Service.

Definition at line 463 of file Algorithm.h.

◆ m_DCS

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

Detector conversion service.

Definition at line 460 of file Algorithm.h.

◆ m_DDS

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

Detector data service.

Definition at line 459 of file Algorithm.h.

◆ m_doTimeline

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

Definition at line 503 of file Algorithm.h.

◆ m_ECS

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

Event conversion service.

Definition at line 458 of file Algorithm.h.

◆ m_EDS

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

Event data service.

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

◆ m_EXS

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

Exception Handler Service.

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

◆ m_index

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

Algorithm's index.

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

◆ m_isFinalized

bool Gaudi::Algorithm::m_isFinalized
private

Algorithm has been finalized flag.

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

◆ m_MS

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

Message service.

Definition at line 455 of file Algorithm.h.

◆ m_name

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

Algorithm's name for identification.

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

◆ m_NTS

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

N tuple service.

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

◆ m_pAuditorSvc

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

Auditor Service.

Definition at line 466 of file Algorithm.h.

◆ m_pMonitorSvc

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

Online Monitoring Service.

Definition at line 468 of file Algorithm.h.

◆ m_pSvcLocator

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

Pointer to service locator service.

Definition at line 474 of file Algorithm.h.

◆ m_ptoolSvc

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

ToolSvc Service.

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

◆ m_RGS

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

Random Number Generator Service.

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

◆ m_toolHandleArrays

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

Definition at line 449 of file Algorithm.h.

◆ m_toolHandles

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

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

◆ m_type

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

Algorithm's type.

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

◆ m_version

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

Algorithm's version.

Definition at line 443 of file Algorithm.h.

◆ m_WB

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

Event data service (whiteboard)

Definition at line 457 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:474
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:497
Gaudi::Algorithm::m_RGS
SmartIF< IRndmGenSvc > m_RGS
Random Number Generator Service.
Definition: Algorithm.h:464
Gaudi::Algorithm::m_EXS
SmartIF< IExceptionSvc > m_EXS
Exception Handler Service.
Definition: Algorithm.h:465
std::string
STL class.
Gaudi::Algorithm::contextSvc
SmartIF< IAlgContextSvc > & contextSvc() const
get Algorithm Context Service
Definition: Algorithm.cpp:568
details::size
constexpr auto size(const T &, Args &&...) noexcept
Definition: AnyDataWrapper.h:22
std::exception
STL class.
IAuditor::Execute
@ Execute
Definition: IAuditor.h:34
Gaudi::Algorithm::m_errorMax
Gaudi::Property< unsigned int > m_errorMax
Definition: Algorithm.h:488
Gaudi::Algorithm::acceptDHVisitor
void acceptDHVisitor(IDataHandleVisitor *) const override
Definition: Algorithm.cpp:188
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:528
Gaudi::Algorithm::eventSvc
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Definition: Algorithm.cpp:561
Gaudi::Algorithm::m_pAuditorSvc
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: Algorithm.h:466
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:387
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:486
Gaudi::Algorithm::m_neededResources
Gaudi::Property< std::vector< std::string > > m_neededResources
Definition: Algorithm.h:513
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
Gaudi::Algorithm::m_doTimeline
Gaudi::Property< bool > m_doTimeline
Definition: Algorithm.h:503
Gaudi::Algorithm::m_ptoolSvc
SmartIF< IToolSvc > m_ptoolSvc
ToolSvc Service.
Definition: Algorithm.h:467
Gaudi::Algorithm::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Algorithm.cpp:572
Gaudi::Algorithm::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Algorithm.cpp:557
std::unique_ptr::get
T get(T... args)
Gaudi::Algorithm::m_auditorReinitialize
Gaudi::Property< bool > m_auditorReinitialize
Definition: Algorithm.h:494
Gaudi::Algorithm::m_WB
SmartIF< IHiveWhiteBoard > m_WB
Event data service (whiteboard)
Definition: Algorithm.h:457
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:461
Gaudi::Algorithm::m_CSS
SmartIF< IChronoStatSvc > m_CSS
Chrono & Stat Service.
Definition: Algorithm.h:463
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:478
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:367
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:558
Gaudi::Algorithm::m_ECS
SmartIF< IConversionSvc > m_ECS
Event conversion service.
Definition: Algorithm.h:458
Gaudi::Algorithm::m_auditInit
Gaudi::Property< bool > m_auditInit
Definition: Algorithm.h:490
Gaudi::Algorithm::initToolHandles
void initToolHandles() const
Definition: Algorithm.cpp:576
IAuditor::Finalize
@ Finalize
Definition: IAuditor.h:34
Gaudi::Algorithm::m_auditorRestart
Gaudi::Property< bool > m_auditorRestart
Definition: Algorithm.h:496
Gaudi::Algorithm::m_auditorStop
Gaudi::Property< bool > m_auditorStop
Definition: Algorithm.h:501
Gaudi::Algorithm::m_NTS
SmartIF< INTupleSvc > m_NTS
N tuple service.
Definition: Algorithm.h:462
Gaudi::Algorithm::m_auditorInitialize
Gaudi::Property< bool > m_auditorInitialize
Definition: Algorithm.h:492
Gaudi::Algorithm::isEnabled
bool isEnabled() const override
Is this algorithm enabled or disabled?
Definition: Algorithm.cpp:538
bug_34121.tool
tool
Definition: bug_34121.py:17
CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >::setUpMessaging
MSG::Level setUpMessaging() const
Set up local caches.
Definition: CommonMessaging.h:174
Gaudi::Functional::details::get
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
Definition: FunctionalDetails.h:444
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition: StateMachine.h:24
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:588
Gaudi::Algorithm::m_registerContext
Gaudi::Property< bool > m_registerContext
Definition: Algorithm.h:508
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:482
IAuditor::Stop
@ Stop
Definition: IAuditor.h:34
IAlgorithm
Definition: IAlgorithm.h:38
GaudiPython.Pythonizations.execute
execute
Definition: Pythonizations.py:588
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:469
Gaudi::Details::getDefaultAuditorValue
bool getDefaultAuditorValue(ISvcLocator *loc)
Definition: Algorithm.cpp:46
Gaudi::Algorithm::execState
AlgExecState & execState(const EventContext &ctx) const override
reference to AlgExecState of Alg
Definition: Algorithm.cpp:540
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:511
ITimelineSvc::TimelineRecorder
RAII helper to record timeline events.
Definition: ITimelineSvc.h:44
AlgSequencer.h
h
Definition: AlgSequencer.py:32
AlgExecState::setState
void setState(State s)
Definition: IAlgExecStateSvc.h:46
Gaudi::Algorithm::m_monitorSvcName
Gaudi::Property< std::string > m_monitorSvcName
Definition: Algorithm.h:505
Gaudi::Utils::AlgContext
Definition: IAlgContextSvc.h:84
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:239
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
Gaudi::Algorithm::m_blocking
Gaudi::Property< bool > m_blocking
Definition: Algorithm.h:516
SmartIF< ISvcLocator >
Gaudi::Algorithm::version
const std::string & version() const override
Definition: Algorithm.cpp:532
genconfuser.verbose
verbose
Definition: genconfuser.py:29
Gaudi::Algorithm::m_name
Gaudi::StringKey m_name
Algorithm's name for identification.
Definition: Algorithm.h:441
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:203
Gaudi::Algorithm::tools
const std::vector< IAlgTool * > & tools() const
Definition: Algorithm.cpp:617
Gaudi::Algorithm::m_EDS
SmartIF< IDataProviderSvc > m_EDS
Event data service.
Definition: Algorithm.h:456
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition: StateMachine.h:26
Gaudi::Algorithm::exceptionSvc
SmartIF< IExceptionSvc > & exceptionSvc() const
Get the exception Service.
Definition: Algorithm.cpp:567
Gaudi::Algorithm::m_auditorStart
Gaudi::Property< bool > m_auditorStart
Definition: Algorithm.h:500
Gaudi::Algorithm::monitorSvc
SmartIF< IMonitorSvc > & monitorSvc() const
Access the monitor service.
Definition: Algorithm.h:328
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:447
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
Gaudi::Algorithm::algExecStateSvc
SmartIF< IAlgExecStateSvc > & algExecStateSvc() const
Definition: Algorithm.cpp:556
IAuditor::Start
@ Start
Definition: IAuditor.h:34
Gaudi::Algorithm::m_toolHandles
std::vector< BaseToolHandle * > m_toolHandles
Definition: Algorithm.h:448
Gaudi::Algorithm::service_i
StatusCode service_i(std::string_view svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of service method
Definition: Algorithm.cpp:631
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:449
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:471
Gaudi::Algorithm::restart
StatusCode restart() override
the default (empty) implementation of IStateful::restart() method
Definition: Algorithm.cpp:513
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:205
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:443
Gaudi::Algorithm::m_DDS
SmartIF< IDataProviderSvc > m_DDS
Detector data service.
Definition: Algorithm.h:459
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:569
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:444
Gaudi::Algorithm::m_aess
SmartIF< IAlgExecStateSvc > m_aess
Alg execution state mgr.
Definition: Algorithm.h:472
Gaudi::Algorithm::m_pMonitorSvc
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: Algorithm.h:468
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:493
AlgExecState
Definition: IAlgExecStateSvc.h:37
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:295
AlgExecState::setFilterPassed
void setFilterPassed(bool f=true)
Definition: IAlgExecStateSvc.h:45
Gaudi::Algorithm::m_type
std::string m_type
Algorithm's type.
Definition: Algorithm.h:442
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:545
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:460
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:498