The Gaudi Framework  master (d98a2936)
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::string & name () const override
 The identifying name of the algorithm object. More...
 
const Gaudi::StringKeynameKey () const override
 
const std::string & type () const override
 The type of the algorithm object. More...
 
void setType (std::string type) override
 
const std::string & version () const override
 
unsigned int index () const override
 
StatusCode configure () override
 Dummy implementation of IStateful::configure() method. More...
 
StatusCode terminate () override
 Dummy implementation of IStateful::terminate() method. More...
 
StatusCode initialize () override
 the default (empty) implementation of IStateful::initialize() method More...
 
StatusCode start () override
 the default (empty) implementation of IStateful::start() method More...
 
StatusCode stop () override
 the default (empty) implementation of IStateful::stop() method More...
 
StatusCode finalize () override
 the default (empty) implementation of IStateful::finalize() method More...
 
StatusCode reinitialize () override
 the default (empty) implementation of IStateful::reinitialize() method More...
 
StatusCode restart () override
 the default (empty) implementation of IStateful::restart() method More...
 
Gaudi::StateMachine::State FSMState () const override
 returns the current state of the algorithm More...
 
Gaudi::StateMachine::State targetFSMState () const override
 returns the state the algorithm will be in after the ongoing transition More...
 
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...
 
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
 
AlgExecStateRef execState (const EventContext &ctx) const override
 get the AlgExecStateRef of current algorithm Actually a small wrapper around it, thus the plain object return type More...
 
std::ostream & toControlFlowExpression (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 const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast. More...
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface. More...
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames. More...
 
- Public Member Functions inherited from 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, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation. More...
 
 requires (!Gaudi::Details::is_gaudi_property_v< TYPE >) Gaudi
 Helper to wrap a regular data member and use it as a regular property. 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 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
 
 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...
 
AlgExecStateRef::AlgKey m_execSvcKey
 identifier of this algorithm in the AlgExecStateSvc 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_auditorInitialize
 
Gaudi::Property< bool > m_auditorReinitialize
 
Gaudi::Property< bool > m_auditorRestart
 
Gaudi::Property< bool > m_auditorExecute
 
Gaudi::Property< bool > m_auditorFinalize
 
Gaudi::Property< bool > m_auditorStart
 
Gaudi::Property< bool > m_auditorStop { this, "AuditStop", m_auditorInitialize.value(), "trigger auditor on stop()" }
 
Gaudi::Property< bool > m_doTimeline { this, "Timeline", true, "send events to TimelineSvc" }
 
Gaudi::Property< std::string > m_monitorSvcName
 
Gaudi::Property< bool > m_registerContext
 
Gaudi::Property< int > m_cardinality
 
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 85 of file Algorithm.h.

Member Typedef Documentation

◆ Factory

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

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

99  : m_name( std::move( name ) )
100  , m_version( std::move( version ) ) // incremented by AlgResourcePool
101  , 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 183 of file Algorithm.cpp.

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

◆ addToolsArray()

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

Definition at line 369 of file Algorithm.h.

369  {
370  m_toolHandleArrays.push_back( &hndlArr );
371  }

◆ algExecStateSvc()

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

Definition at line 552 of file Algorithm.cpp.

552 { 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 553 of file Algorithm.cpp.

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

◆ cardinality()

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

Return the cardinality.

Definition at line 395 of file Algorithm.h.

395 { 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 554 of file Algorithm.cpp.

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

◆ configure()

StatusCode Gaudi::Algorithm::configure ( )
inlineoverride

Dummy implementation of IStateful::configure() method.

Definition at line 170 of file Algorithm.h.

170 { return StatusCode::SUCCESS; }

◆ contextSvc()

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

get Algorithm Context Service

Definition at line 564 of file Algorithm.cpp.

564 { 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 336 of file Algorithm.h.

337  {
338  IMonitorSvc* mS = monitorSvc().get();
339  if ( mS ) mS->declareInfo( name, format, var, size, desc, this );
340  }

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

324  {
325  IMonitorSvc* mS = monitorSvc().get();
326  if ( mS ) mS->declareInfo( name, var, desc, this );
327  }

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

287  {
288  this->declareTool( hndl, hndl.typeAndName() ).ignore();
289  return PropertyHolderImpl::declareProperty( name, hndl, doc );
290  }

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

296  {
297  addToolsArray( hndlArr );
298  return PropertyHolderImpl::declareProperty( name, hndlArr, doc );
299  }

◆ declareTool() [1/2]

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

Definition at line 349 of file Algorithm.h.

349  {
350  return this->declareTool( handle, handle.typeAndName(), createIf );
351  }

◆ declareTool() [2/2]

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

Definition at line 354 of file Algorithm.h.

354  {
355 
356  StatusCode sc = handle.initialize( toolTypeAndName, handle.isPublic() ? nullptr : this, createIf );
357  if ( !sc ) {
358  throw GaudiException{ std::string{ "Cannot create handle for " } +
359  ( handle.isPublic() ? "public" : "private" ) + " tool " + toolTypeAndName,
360  name(), sc };
361  }
362 
363  m_toolHandles.push_back( &handle );
364 
365  return sc;
366  }

◆ deregisterTool()

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

Definition at line 637 of file Algorithm.cpp.

637  {
638  std::vector<IAlgTool*>::iterator it = std::find( m_tools.begin(), m_tools.end(), tool );
639  if ( it != m_tools.end() ) {
640  if ( msgLevel( MSG::DEBUG ) ) debug() << "De-Registering tool " << tool->name() << endmsg;
641  m_tools.erase( it );
642  } else {
643  if ( msgLevel( MSG::DEBUG ) ) debug() << "Could not de-register tool " << tool->name() << endmsg;
644  }
645  }

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

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

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

◆ errorCount()

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

Get the number of failures of the algorithm.

Definition at line 651 of file Algorithm.cpp.

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

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

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

◆ evtSvc()

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

shortcut for method eventSvc

Definition at line 233 of file Algorithm.h.

233 { return eventSvc(); }

◆ exceptionSvc()

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

Get the exception Service.

Definition at line 563 of file Algorithm.cpp.

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

◆ execState()

AlgExecStateRef Gaudi::Algorithm::execState ( const EventContext ctx) const
override

get the AlgExecStateRef of current algorithm Actually a small wrapper around it, thus the plain object return type

Definition at line 536 of file Algorithm.cpp.

536  {
537  return { *algExecStateSvc(), ctx, m_execSvcKey };
538  }

◆ finalize()

StatusCode Gaudi::Algorithm::finalize ( )
inlineoverride

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

Definition at line 181 of file Algorithm.h.

181 { return StatusCode::SUCCESS; }

◆ FSMState()

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

returns the current state of the algorithm

Definition at line 187 of file Algorithm.h.

187 { 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 541 of file Algorithm.cpp.

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

◆ histoSvc()

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

The standard histogram service.

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

Definition at line 559 of file Algorithm.cpp.

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

◆ index()

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

Definition at line 530 of file Algorithm.cpp.

530 { return m_index; }

◆ initialize()

StatusCode Gaudi::Algorithm::initialize ( )
inlineoverride

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

Definition at line 175 of file Algorithm.h.

175 { return StatusCode::SUCCESS; }

◆ initToolHandles()

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

Definition at line 572 of file Algorithm.cpp.

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

◆ isAsynchronous()

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

Definition at line 376 of file Algorithm.h.

376 { return m_asynchronous; }

◆ isEnabled()

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

Is this algorithm enabled or disabled?

Definition at line 534 of file Algorithm.cpp.

534 { return m_isEnabled; }

◆ isFinalized()

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

Has the Algorithm already been finalized?

Definition at line 404 of file Algorithm.h.

◆ isInitialized()

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

Has the Algorithm already been initialized?

Definition at line 401 of file Algorithm.h.

◆ isReEntrant()

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

Definition at line 421 of file Algorithm.h.

421 { return true; }

◆ isSequence()

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

Are we a Sequence?

Definition at line 195 of file Algorithm.h.

195 { return false; }

◆ maxErrors()

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

Definition at line 418 of file Algorithm.h.

418 { 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 310 of file Algorithm.h.

310  {
311  // If not already located try to locate it without forcing a creation
312  if ( !m_pMonitorSvc ) {
313  m_pMonitorSvc = service( m_monitorSvcName, false, true ); // do not create and be quiet
314  }
315  return m_pMonitorSvc;
316  }

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

524 { return m_name.str(); }

◆ nameKey()

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

Definition at line 526 of file Algorithm.cpp.

526 { return m_name; }

◆ neededResources()

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

Definition at line 397 of file Algorithm.h.

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

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

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

◆ registerContext()

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

register for Algorithm Context Service?

Definition at line 280 of file Algorithm.h.

280 { return m_registerContext; }

◆ registerTool()

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

Definition at line 632 of file Algorithm.cpp.

632  {
633  if ( msgLevel( MSG::DEBUG ) ) { debug() << "Registering tool " << tool->name() << endmsg; }
634  m_tools.push_back( tool );
635  }

◆ reinitialize()

StatusCode Gaudi::Algorithm::reinitialize ( )
override

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

Definition at line 489 of file Algorithm.cpp.

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

◆ restart()

StatusCode Gaudi::Algorithm::restart ( )
override

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

Definition at line 509 of file Algorithm.cpp.

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

◆ service() [1/2]

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

Definition at line 204 of file Algorithm.h.

204  {
205  return service( name, createIf, quiet ).as<T>();
206  }

◆ service() [2/2]

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")

Protected Member Functions.

Definition at line 627 of file Algorithm.cpp.

627  {
628  const ServiceLocatorHelper helper( *serviceLocator(), *this );
629  return helper.service( name, quiet, createIf );
630  }

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

568  {
569  return *const_cast<SmartIF<ISvcLocator>*>( &m_pSvcLocator );
570  }

◆ setAsynchronous()

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

Definition at line 378 of file Algorithm.h.

378 { m_asynchronous = value; }

◆ setIndex()

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

set instantiation index of Alg

Definition at line 532 of file Algorithm.cpp.

532 { m_index = idx; }

◆ setType()

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

Definition at line 163 of file Algorithm.h.

163 { 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 177 of file Algorithm.h.

177 { return StatusCode::SUCCESS; }

◆ stop()

StatusCode Gaudi::Algorithm::stop ( )
inlineoverride

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

Definition at line 179 of file Algorithm.h.

179 { return StatusCode::SUCCESS; }

◆ svcLoc()

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

shortcut for method serviceLocator

Definition at line 273 of file Algorithm.h.

273 { 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 322 of file Algorithm.cpp.

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

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

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

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

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

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

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

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

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

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

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

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

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

◆ targetFSMState()

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

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

Definition at line 189 of file Algorithm.h.

189 { return m_targetState; }

◆ terminate()

StatusCode Gaudi::Algorithm::terminate ( )
inlineoverride

Dummy implementation of IStateful::terminate() method.

Definition at line 172 of file Algorithm.h.

172 { return StatusCode::SUCCESS; }

◆ timelineSvc()

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

Definition at line 565 of file Algorithm.cpp.

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

647  {
648  return os << type() << "('" << name() << "')";
649  }

◆ tools() [1/2]

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

Definition at line 618 of file Algorithm.cpp.

618  {
620  return m_tools;
621  }

◆ tools() [2/2]

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

Definition at line 613 of file Algorithm.cpp.

613  {
615  return m_tools;
616  }

◆ toolSvc()

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

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

Definition at line 562 of file Algorithm.cpp.

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

◆ type()

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

The type of the algorithm object.

Definition at line 162 of file Algorithm.h.

162 { return m_type; }

◆ version()

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

Definition at line 528 of file Algorithm.cpp.

528 { return m_version; }

◆ whiteboard()

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

Definition at line 566 of file Algorithm.cpp.

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

Member Data Documentation

◆ AlgorithmManager

friend Gaudi::Algorithm::AlgorithmManager

Definition at line 92 of file Algorithm.h.

◆ m_aess

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

Alg execution state mgr.

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

◆ m_auditorExecute

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

Definition at line 482 of file Algorithm.h.

◆ m_auditorFinalize

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorFinalize
private
Initial value:
{ this, "AuditFinalize", m_auditorInitialize.value(),
"trigger auditor on finalize()" }

Definition at line 484 of file Algorithm.h.

◆ m_auditorInitialize

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorInitialize
private
Initial value:
{
this, "AuditInitialize", Details::getDefaultAuditorValue( m_pSvcLocator ), "trigger auditor on initialize()" }

Definition at line 476 of file Algorithm.h.

◆ m_auditorReinitialize

Gaudi::Property<bool> Gaudi::Algorithm::m_auditorReinitialize
private
Initial value:
{ this, "AuditReinitialize", m_auditorInitialize.value(),
"trigger auditor on reinitialize()" }

Definition at line 478 of file Algorithm.h.

◆ m_auditorRestart

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

Definition at line 480 of file Algorithm.h.

◆ m_auditorStart

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

Definition at line 486 of file Algorithm.h.

◆ m_auditorStop

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

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

◆ m_contextSvc

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

Algorithm Context Service.

Definition at line 455 of file Algorithm.h.

◆ m_CSS

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

Chrono & Stat Service.

Definition at line 449 of file Algorithm.h.

◆ m_DCS

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

Detector conversion service.

Definition at line 446 of file Algorithm.h.

◆ m_DDS

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

Detector data service.

Definition at line 445 of file Algorithm.h.

◆ m_doTimeline

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

Definition at line 490 of file Algorithm.h.

◆ m_ECS

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

Event conversion service.

Definition at line 444 of file Algorithm.h.

◆ m_EDS

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

Event data service.

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

◆ m_execSvcKey

AlgExecStateRef::AlgKey Gaudi::Algorithm::m_execSvcKey
private

identifier of this algorithm in the AlgExecStateSvc

Definition at line 430 of file Algorithm.h.

◆ m_EXS

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

Exception Handler Service.

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

◆ m_HDS

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

Histogram data service.

Definition at line 447 of file Algorithm.h.

◆ m_index

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

Algorithm's index.

Definition at line 427 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 472 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 492 of file Algorithm.h.

◆ m_MS

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

Message service.

Definition at line 441 of file Algorithm.h.

◆ m_name

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

Algorithm's name for identification.

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

◆ m_NTS

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

N tuple service.

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

◆ m_pAuditorSvc

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

Auditor Service.

Definition at line 452 of file Algorithm.h.

◆ m_pMonitorSvc

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

Online Monitoring Service.

Definition at line 454 of file Algorithm.h.

◆ m_pSvcLocator

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

Pointer to service locator service.

Definition at line 460 of file Algorithm.h.

◆ m_ptoolSvc

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

ToolSvc Service.

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

◆ m_RGS

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

Random Number Generator Service.

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

◆ m_timelineSvc

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

Timeline Service.

Definition at line 457 of file Algorithm.h.

◆ m_toolHandleArrays

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

Definition at line 435 of file Algorithm.h.

◆ m_toolHandles

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

Definition at line 434 of file Algorithm.h.

◆ m_toolHandlesInit

bool Gaudi::Algorithm::m_toolHandlesInit = false
mutableprivate

Definition at line 510 of file Algorithm.h.

◆ m_tools

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

Definition at line 433 of file Algorithm.h.

◆ m_type

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

Algorithm's type.

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

◆ m_version

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

Algorithm's version.

Definition at line 426 of file Algorithm.h.

◆ m_WB

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

Event data service (whiteboard)

Definition at line 443 of file Algorithm.h.


The documentation for this class was generated from the following files:
MSG::DEBUG
@ DEBUG
Definition: IMessageSvc.h:22
Gaudi::Algorithm::m_pSvcLocator
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Definition: Algorithm.h:460
Gaudi::Details::PropertyBase
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Definition: PropertyBase.h:34
Gaudi::Algorithm::m_auditorExecute
Gaudi::Property< bool > m_auditorExecute
Definition: Algorithm.h:482
Gaudi::Algorithm::m_RGS
SmartIF< IRndmGenSvc > m_RGS
Random Number Generator Service.
Definition: Algorithm.h:450
Gaudi::Algorithm::m_EXS
SmartIF< IExceptionSvc > m_EXS
Exception Handler Service.
Definition: Algorithm.h:451
Gaudi::IAuditor::Execute
static const std::string Execute
Definition: IAuditor.h:51
Gaudi::Algorithm::service
SmartIF< IService > 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: Algorithm.cpp:627
Gaudi::IAuditor::Initialize
static const std::string Initialize
Definition: IAuditor.h:47
AlgExecStateRef
wrapper on an Algorithm state.
Definition: IAlgExecStateSvc.h:32
Gaudi::Algorithm::contextSvc
SmartIF< IAlgContextSvc > & contextSvc() const
get Algorithm Context Service
Definition: Algorithm.cpp:564
details::size
constexpr auto size(const T &, Args &&...) noexcept
Definition: AnyDataWrapper.h:23
Gaudi::Algorithm::m_errorMax
Gaudi::Property< unsigned int > m_errorMax
Definition: Algorithm.h:474
Gaudi::Algorithm::acceptDHVisitor
void acceptDHVisitor(IDataHandleVisitor *) const override
Definition: Algorithm.cpp:183
Gaudi::Algorithm::name
const std::string & name() const override
The identifying name of the algorithm object.
Definition: Algorithm.cpp:524
Gaudi::Algorithm::eventSvc
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Definition: Algorithm.cpp:557
Gaudi::Algorithm::m_pAuditorSvc
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Definition: Algorithm.h:452
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:512
Gaudi::Algorithm::addToolsArray
void addToolsArray(ToolHandleArray< T > &hndlArr)
Definition: Algorithm.h:369
Gaudi::Algorithm::type
const std::string & type() const override
The type of the algorithm object.
Definition: Algorithm.h:162
Gaudi::Algorithm::m_isEnabled
Gaudi::Property< bool > m_isEnabled
Definition: Algorithm.h:472
Gaudi::Algorithm::m_neededResources
Gaudi::Property< std::vector< std::string > > m_neededResources
Definition: Algorithm.h:500
Gaudi::StateMachine::FINALIZE
@ FINALIZE
Definition: StateMachine.h:37
Gaudi::Algorithm::initialize
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Definition: Algorithm.h:175
GaudiException
Definition: GaudiException.h:29
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:490
Gaudi::Algorithm::m_ptoolSvc
SmartIF< IToolSvc > m_ptoolSvc
ToolSvc Service.
Definition: Algorithm.h:453
Gaudi::Algorithm::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Definition: Algorithm.cpp:568
Gaudi::IAuditor::ReInitialize
static const std::string ReInitialize
Definition: IAuditor.h:48
Gaudi::Algorithm::auditorSvc
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
Definition: Algorithm.cpp:553
Gaudi::Algorithm::m_auditorReinitialize
Gaudi::Property< bool > m_auditorReinitialize
Definition: Algorithm.h:478
Gaudi::Algorithm::m_WB
SmartIF< IHiveWhiteBoard > m_WB
Event data service (whiteboard)
Definition: Algorithm.h:443
Gaudi::Functional::FilterDecision::FAILED
@ FAILED
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::outputHandles
std::vector< Gaudi::DataHandle * > outputHandles() const override
Definition: DataHandleHolderBase.h:40
Gaudi::Algorithm::m_HDS
SmartIF< IHistogramSvc > m_HDS
Histogram data service.
Definition: Algorithm.h:447
Gaudi::Algorithm::m_CSS
SmartIF< IChronoStatSvc > m_CSS
Chrono & Stat Service.
Definition: Algorithm.h:449
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:464
IMonitorSvc
Definition: IMonitorSvc.h:32
Gaudi::Algorithm::start
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Definition: Algorithm.h:177
DHHVisitor
Definition: DataHandleHolderVisitor.h:20
CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >::msgLevel
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
Definition: CommonMessaging.h:147
PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >::bindPropertiesTo
void bindPropertiesTo(Gaudi::Interfaces::IOptionsSvc &optsSvc)
Definition: PropertyHolder.h:238
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::m_outputDataObjs
DataObjIDColl m_outputDataObjs
Definition: DataHandleHolderBase.h:97
Gaudi::Guards::AuditorGuard
Definition: Guards.h:203
Gaudi::Algorithm::declareTool
StatusCode declareTool(ToolHandle< T > &handle, bool createIf=true)
Definition: Algorithm.h:349
AlgExecState::Done
@ Done
Definition: IAlgExecStateSvc.h:23
Gaudi::StateMachine::INITIALIZE
@ INITIALIZE
Definition: StateMachine.h:34
Gaudi::IAuditor::Start
static const std::string Start
Definition: IAuditor.h:49
Gaudi::Algorithm::chronoSvc
SmartIF< IChronoStatSvc > & chronoSvc() const
The standard Chrono & Stat service, Return a pointer to the service if present.
Definition: Algorithm.cpp:554
Gaudi::Algorithm::m_ECS
SmartIF< IConversionSvc > m_ECS
Event conversion service.
Definition: Algorithm.h:444
Gaudi::Algorithm::initToolHandles
void initToolHandles() const
Definition: Algorithm.cpp:572
Gaudi::Algorithm::m_auditorRestart
Gaudi::Property< bool > m_auditorRestart
Definition: Algorithm.h:480
Gaudi::Algorithm::m_auditorStop
Gaudi::Property< bool > m_auditorStop
Definition: Algorithm.h:488
Gaudi::Algorithm::m_NTS
SmartIF< INTupleSvc > m_NTS
N tuple service.
Definition: Algorithm.h:448
Gaudi::Algorithm::m_auditorInitialize
Gaudi::Property< bool > m_auditorInitialize
Definition: Algorithm.h:476
Gaudi::Algorithm::isEnabled
bool isEnabled() const override
Is this algorithm enabled or disabled?
Definition: Algorithm.cpp:534
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:173
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition: StateMachine.h:23
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
Gaudi::Algorithm::m_registerContext
Gaudi::Property< bool > m_registerContext
Definition: Algorithm.h:495
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:93
StatusCode
Definition: StatusCode.h:64
Gaudi::Algorithm::m_outputLevel
Gaudi::Property< int > m_outputLevel
Definition: Algorithm.h:468
IAlgorithm
Definition: IAlgorithm.h:36
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:187
Gaudi::Algorithm::m_contextSvc
SmartIF< IAlgContextSvc > m_contextSvc
Algorithm Context Service.
Definition: Algorithm.h:455
Gaudi::Details::getDefaultAuditorValue
bool getDefaultAuditorValue(ISvcLocator *loc)
Definition: Algorithm.cpp:44
Gaudi::Algorithm::m_cardinality
Gaudi::Property< int > m_cardinality
Definition: Algorithm.h:498
ITimelineSvc::TimelineRecorder
RAII helper to record timeline events.
Definition: ITimelineSvc.h:27
AlgSequencer.h
h
Definition: AlgSequencer.py:31
Gaudi::Algorithm::m_monitorSvcName
Gaudi::Property< std::string > m_monitorSvcName
Definition: Algorithm.h:492
Gaudi::Utils::AlgContext
Definition: IAlgContextSvc.h:76
Gaudi::Property::value
const ValueType & value() const
Definition: Property.h:229
AlgExecState::Executing
@ Executing
Definition: IAlgExecStateSvc.h:23
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::m_inputDataObjs
DataObjIDColl m_inputDataObjs
Definition: DataHandleHolderBase.h:97
ServiceLocatorHelper
an helper to share the implementation of service() among the various kernel base classes
Definition: ServiceLocatorHelper.h:26
CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > >::updateMsgStreamOutputLevel
void updateMsgStreamOutputLevel(int level)
Update the output level of the cached MsgStream.
Definition: CommonMessaging.h:184
Gaudi::Algorithm::m_targetState
Gaudi::StateMachine::State m_targetState
Algorithm has been initialized flag.
Definition: Algorithm.h:513
SmartIF< ISvcLocator >
Gaudi::Algorithm::version
const std::string & version() const override
Definition: Algorithm.cpp:528
genconfuser.verbose
verbose
Definition: genconfuser.py:28
Gaudi::Algorithm::m_name
Gaudi::StringKey m_name
Algorithm's name for identification.
Definition: Algorithm.h:424
format
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Definition: MsgStream.cpp:93
DataObjIDColl
std::unordered_set< DataObjID, DataObjID_Hasher > DataObjIDColl
Definition: DataObjID.h:122
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:198
Gaudi::Algorithm::tools
const std::vector< IAlgTool * > & tools() const
Definition: Algorithm.cpp:613
Gaudi::Algorithm::m_EDS
SmartIF< IDataProviderSvc > m_EDS
Event data service.
Definition: Algorithm.h:442
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition: StateMachine.h:25
Gaudi::Algorithm::exceptionSvc
SmartIF< IExceptionSvc > & exceptionSvc() const
Get the exception Service.
Definition: Algorithm.cpp:563
Gaudi::Algorithm::m_auditorStart
Gaudi::Property< bool > m_auditorStart
Definition: Algorithm.h:486
Gaudi::Algorithm::monitorSvc
SmartIF< IMonitorSvc > & monitorSvc() const
Access the monitor service.
Definition: Algorithm.h:310
Gaudi::Algorithm::m_execSvcKey
AlgExecStateRef::AlgKey m_execSvcKey
identifier of this algorithm in the AlgExecStateSvc
Definition: Algorithm.h:430
StatusCode::ignore
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition: StatusCode.h:139
SmartIF::as
SmartIF< IFace > as() const
return a new SmartIF instance to another interface
Definition: SmartIF.h:110
ToolHandleInfo::isPublic
bool isPublic() const noexcept
Definition: ToolHandle.h:49
Stat
Definition: Stat.h:48
DataHandleHolderBase< PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > > >::inputHandles
std::vector< Gaudi::DataHandle * > inputHandles() const override
Definition: DataHandleHolderBase.h:37
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:433
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:129
Gaudi::Algorithm::algExecStateSvc
SmartIF< IAlgExecStateSvc > & algExecStateSvc() const
Definition: Algorithm.cpp:552
Gaudi::Algorithm::m_toolHandles
std::vector< BaseToolHandle * > m_toolHandles
Definition: Algorithm.h:434
PropertyHolder< CommonMessaging< implements< IAlgorithm, IDataHandleHolder, IProperty, IStateful > > >::declareProperty
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Declare a property.
Definition: PropertyHolder.h:92
Gaudi::Algorithm::finalize
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
Definition: Algorithm.h:181
MSG::VERBOSE
@ VERBOSE
Definition: IMessageSvc.h:22
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:99
Gaudi::Algorithm::m_toolHandleArrays
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
Definition: Algorithm.h:435
AlgTool
Definition: AlgTool.h:55
BaseToolHandle
Definition: ToolHandle.h:78
SmartIF::get
TYPE * get() const
Get interface pointer.
Definition: SmartIF.h:82
Gaudi::IAuditor::Stop
static const std::string Stop
Definition: IAuditor.h:52
Gaudi::Algorithm::m_timelineSvc
SmartIF< ITimelineSvc > m_timelineSvc
Timeline Service.
Definition: Algorithm.h:457
Gaudi::Algorithm::restart
StatusCode restart() override
the default (empty) implementation of IStateful::restart() method
Definition: Algorithm.cpp:509
MSG::NIL
@ NIL
Definition: IMessageSvc.h:22
Gaudi::Algorithm::m_toolHandlesInit
bool m_toolHandlesInit
Definition: Algorithm.h:510
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition: StateMachine.h:24
Gaudi::StateMachine::START
@ START
Definition: StateMachine.h:35
Gaudi::IAuditor::Finalize
static const std::string Finalize
Definition: IAuditor.h:53
Gaudi::Algorithm::m_version
std::string m_version
Algorithm's version.
Definition: Algorithm.h:426
Gaudi::Algorithm::m_DDS
SmartIF< IDataProviderSvc > m_DDS
Detector data service.
Definition: Algorithm.h:445
Gaudi::StringKey::str
const std::string & str() const
the actual string
Definition: StringKey.h:78
Gaudi::IAuditor::ReStart
static const std::string ReStart
Definition: IAuditor.h:50
Gaudi::Algorithm::timelineSvc
SmartIF< ITimelineSvc > & timelineSvc() const
Definition: Algorithm.cpp:565
Gaudi::Algorithm::m_filterCircDeps
Gaudi::Property< bool > m_filterCircDeps
Definition: Algorithm.h:507
ToolHandle::initialize
StatusCode initialize(const std::string &toolTypeAndName, const IInterface *parent=nullptr, bool createIf=true)
Definition: ToolHandle.h:211
Gaudi::Algorithm::m_index
unsigned int m_index
Algorithm's index.
Definition: Algorithm.h:427
Gaudi::Algorithm::m_aess
SmartIF< IAlgExecStateSvc > m_aess
Alg execution state mgr.
Definition: Algorithm.h:458
Gaudi::Algorithm::m_pMonitorSvc
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Definition: Algorithm.h:454
ToolHandle::typeAndName
std::string typeAndName() const override
Definition: ToolHandle.h:271
Gaudi::Algorithm::reinitialize
StatusCode reinitialize() override
the default (empty) implementation of IStateful::reinitialize() method
Definition: Algorithm.cpp:489
Gaudi::Algorithm::m_asynchronous
Gaudi::Property< bool > m_asynchronous
Definition: Algorithm.h:503
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:100
Gaudi::Details::Property::ParsingErrorPolicy::Exception
@ Exception
Gaudi::Algorithm::registerContext
bool registerContext() const
register for Algorithm Context Service?
Definition: Algorithm.h:280
Gaudi::Algorithm::m_type
std::string m_type
Algorithm's type.
Definition: Algorithm.h:425
Gaudi::Algorithm::stop
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
Definition: Algorithm.h:179
Gaudi::Algorithm::get_svc_
SmartIF< IFace > & get_svc_(SmartIF< IFace > &p, const char *service_name) const
Definition: Algorithm.cpp:541
Gaudi::Algorithm::isSequence
bool isSequence() const override
Are we a Sequence?
Definition: Algorithm.h:195
Gaudi::StateMachine::STOP
@ STOP
Definition: StateMachine.h:36
Gaudi::Algorithm::m_DCS
SmartIF< IConversionSvc > m_DCS
Detector conversion service.
Definition: Algorithm.h:446
IDataHandleVisitor::visit
virtual void visit(const IDataHandleHolder *)=0
Gaudi::Algorithm::m_auditorFinalize
Gaudi::Property< bool > m_auditorFinalize
Definition: Algorithm.h:484
Gaudi::Functional::details::out
OptOut && out
Definition: details.h:179