Go to the documentation of this file.
57 #ifndef PACKAGE_VERSION
58 # define PACKAGE_VERSION "unknown"
90 PropertyHolder<CommonMessaging<implements<IAlgorithm, IDataHandleHolder, IProperty, IStateful>>>> {
104 , m_pSvcLocator( svcloc ) {}
170 unsigned int index()
const override;
195 bool isEnabled()
const override;
201 unsigned int errorCount()
const;
206 return service_i(
name, createIf, T::interfaceID(), (
void**)&psvc );
212 return service_i( svcType, svcName, T::interfaceID(),
reinterpret_cast<void**
>( &psvc ) );
216 SmartIF<IService> service( std::string_view
name,
const bool createIf =
true,
const bool quiet =
false )
const;
220 return service(
name, createIf, quiet ).as<T>();
298 using PropertyHolderImpl::declareProperty;
304 this->declareTool( hndl, hndl.
typeAndName() ).ignore();
305 return PropertyHolderImpl::declareProperty(
name, hndl, doc );
314 addToolsArray( hndlArr );
315 return PropertyHolderImpl::declareProperty(
name, hndlArr, doc );
330 if ( !m_pMonitorSvc ) {
331 m_pMonitorSvc = service( m_monitorSvcName,
false,
true );
333 return m_pMonitorSvc;
368 return this->declareTool( handle, handle.
typeAndName(), createIf );
377 ( handle.
isPublic() ?
"public" :
"private" ) +
" tool " + toolTypeAndName,
381 m_toolHandles.push_back( &handle );
388 m_toolHandleArrays.push_back( &hndlArr );
406 void initToolHandles()
const;
413 unsigned int cardinality()
const override {
return m_cardinality; }
425 void setIndex(
const unsigned int& idx )
override;
444 unsigned int m_index = 0;
452 template <
typename IFace>
491 "[[deprecated]] unused" };
493 "trigger auditor on initialize()" };
495 "trigger auditor on reinitialize()" };
499 "trigger auditor on finalize()" };
506 "name to use for Monitor Service" };
509 "flag to enforce the registration for Algorithm Context Service" };
512 "how many clones to create - 0 means algo is reentrant" };
514 this,
"NeededResources", {},
"named resources needed during event looping" };
517 this,
"Blocking",
false,
518 "if algorithm invokes CPU-blocking system calls (offloads computations to accelerators or "
519 "quantum processors, performs disk or network I/O, is bound by resource synchronization, etc)" };
523 "filter out circular data dependencies" };
525 mutable bool m_toolHandlesInit =
false;
532 StatusCode service_i( std::string_view svcName,
bool createIf,
const InterfaceID& iid,
void** ppSvc )
const;
534 void** ppSvc )
const;
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
bool m_isFinalized
Algorithm has been finalized flag.
SmartIF< IRndmGenSvc > m_RGS
Random Number Generator Service.
SmartIF< IExceptionSvc > m_EXS
Exception Handler Service.
SmartIF< ISvcLocator > & svcLoc() const
shortcut for method serviceLocator
constexpr auto size(const T &, Args &&...) noexcept
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
void setType(std::string type) override
StatusCode declareTool(ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
void addToolsArray(ToolHandleArray< T > &hndlArr)
bool isInitialized() const override
Has the Algorithm already been initialized?
const std::string & type() const override
The type of the algorithm object.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
SmartIF< IToolSvc > m_ptoolSvc
ToolSvc Service.
SmartIF< IHiveWhiteBoard > m_WB
Event data service (whiteboard)
SmartIF< IHistogramSvc > m_HDS
Histogram data service.
SmartIF< IChronoStatSvc > m_CSS
Chrono & Stat Service.
StatusCode configure() override
Dummy implementation of IStateful::configure() method.
std::unique_ptr< IDataHandleVisitor > m_updateDataHandles
Hook for for derived classes to provide a custom visitor for data handles.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
unsigned int maxErrors() const
SmartIF< T > service(std::string_view name, bool createIf=true, bool quiet=false) const
StatusCode declareTool(ToolHandle< T > &handle, bool createIf=true)
bool isReEntrant() const override
unsigned int cardinality() const override
Return the cardinality.
SmartIF< IConversionSvc > m_ECS
Event conversion service.
SmartIF< INTupleSvc > m_NTS
N tuple service.
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm,...
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
Gaudi::StateMachine::State FSMState() const override
returns the current state of the algorithm
SmartIF< IAlgContextSvc > m_contextSvc
Algorithm Context Service.
bool getDefaultAuditorValue(ISvcLocator *loc)
Base class from which all concrete algorithm classes should be derived.
void setBlocking(bool value)
const ValueType & value() const
Gaudi::StringKey m_name
Algorithm's name for identification.
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
Algorithm(const Algorithm &)=delete
delete copy constructor: NO COPY ALLOWED
Gaudi::PluginService::Factory< IAlgorithm *(const std::string &, ISvcLocator *)> Factory
SmartIF< IDataProviderSvc > m_EDS
Event data service.
Header file for std:chrono::duration-based Counters.
SmartIF< IMonitorSvc > & monitorSvc() const
Access the monitor service.
SmartIF< IMessageSvc > m_MS
Message service.
std::vector< IAlgTool * > m_tools
std::vector< BaseToolHandle * > m_toolHandles
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
constexpr static const auto SUCCESS
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
SmartIF< ITimelineSvc > m_timelineSvc
Timeline 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.
std::string m_version
Algorithm's version.
StatusCode terminate() override
Dummy implementation of IStateful::terminate() method.
SmartIF< IDataProviderSvc > m_DDS
Detector data service.
void declareInfo(const std::string &name, const T &var, const std::string &desc) const
Declare monitoring information.
const std::vector< std::string > & neededResources() const override
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.
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)
Algorithm & operator=(const Algorithm &)=delete
delete assignment operator: NO ASSIGNMENT ALLOWED
SmartIF< IAlgExecStateSvc > m_aess
Alg execution state mgr.
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
bool registerContext() const
register for Algorithm Context Service?
std::string m_type
Algorithm's type.
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
bool isSequence() const override
Are we a Sequence?
Gaudi::StateMachine::State targetFSMState() const override
returns the state the algorithm will be in after the ongoing transition
bool isFinalized() const override
Has the Algorithm already been finalized?
SmartIF< IConversionSvc > m_DCS
Detector conversion service.