54#ifndef PACKAGE_VERSION
55# define PACKAGE_VERSION "unknown"
87 PropertyHolder<CommonMessaging<implements<IAlgorithm, IDataHandleHolder, IProperty, IStateful>>>> {
157 const std::string& name()
const override;
165 const std::string& version()
const override;
167 unsigned int index()
const override;
192 bool isEnabled()
const override;
198 unsigned int errorCount()
const;
201 SmartIF<IService> service( std::string_view name,
const bool createIf =
true,
const bool quiet =
false )
const;
282 using PropertyHolderImpl::declareProperty;
287 const std::string& doc =
"none" ) {
296 const std::string& doc =
"none" ) {
324 void declareInfo(
const std::string&
name,
const T& var,
const std::string& desc )
const {
337 const std::string& desc )
const {
345 void registerTool(
IAlgTool* tool )
const;
346 void deregisterTool(
IAlgTool* tool )
const;
358 throw GaudiException{ std::string{
"Cannot create handle for " } +
359 ( handle.
isPublic() ?
"public" :
"private" ) +
" tool " + toolTypeAndName,
373 const std::vector<IAlgTool*>& tools()
const;
384 std::vector<IAlgTool*>& tools();
391 void initToolHandles()
const;
410 void setIndex(
const unsigned int& idx )
override;
418 std::ostream& toControlFlowExpression( std::ostream& os )
const override;
438 template <
typename IFace>
477 "trigger auditor on reinitialize()" };
479 "trigger auditor on restart()" };
481 "trigger auditor on execute()" };
483 "trigger auditor on finalize()" };
485 "trigger auditor on start()" };
491 "name to use for Monitor Service" };
494 "flag to enforce the registration for Algorithm Context Service" };
497 "how many clones to create - 0 means algo is reentrant" };
499 this,
"NeededResources", {},
"named resources needed during event looping" };
502 "whether algorithm is asynchronous and uses Boost Fiber to suspend "
503 "while offloaded code is running." };
506 "filter out circular data dependencies" };
GAUDI_API std::string format(const char *,...)
MsgStream format utility "a la sprintf(...)".
wrapper on an Algorithm state.
The AlgorithmManager class is in charge of the creation of concrete instances of Algorithms.
void updateMsgStreamOutputLevel(int level)
This class represents an entry point to all the event specific data.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
Gaudi::StringKey m_name
Algorithm's name for identification.
SmartIF< ISvcLocator > & svcLoc() const
shortcut for method serviceLocator
unsigned int m_index
Algorithm's index.
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).
bool setAsynchronousTimeline()
SmartIF< IDataProviderSvc > m_EDS
Event data service.
Gaudi::Property< bool > m_auditorStart
SmartIF< IAlgContextSvc > m_contextSvc
Algorithm Context Service.
SmartIF< IChronoStatSvc > m_CSS
Chrono & Stat Service.
SmartIF< IRndmGenSvc > m_RGS
Random Number Generator Service.
std::unique_ptr< IDataHandleVisitor > m_updateDataHandles
Hook for for derived classes to provide a custom visitor for data handles.
AlgExecStateRef::AlgKey m_execSvcKey
identifier of this algorithm in the AlgExecStateSvc
Gaudi::Property< int > m_cardinality
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
Gaudi::Property< bool > m_doTimeline
Gaudi::StateMachine::State FSMState() const override
returns the current state of the algorithm
SmartIF< IFace > & get_svc_(SmartIF< IFace > &p, const char *service_name) const
Algorithm(const Algorithm &)=delete
delete copy constructor: NO COPY ALLOWED
Gaudi::Property< int > m_outputLevel
Gaudi::Property< AlgResources_t > m_neededResources
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
StatusCode declareTool(ToolHandle< T > &handle, bool createIf=true)
StatusCode configure() override
Dummy implementation of IStateful::configure() method.
SmartIF< T > service(std::string_view name, bool createIf=true, bool quiet=false) const
Gaudi::Property< std::string > m_monitorSvcName
Gaudi::StateMachine::State m_targetState
Algorithm has been initialized flag.
Gaudi::Details::PropertyBase * declareProperty(const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
SmartIF< IConversionSvc > m_ECS
Event conversion service.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
void setAsynchronous(bool value)
SmartIF< IExceptionSvc > m_EXS
Exception Handler Service.
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
Gaudi::PluginService::Factory< IAlgorithm *(const std::string &, ISvcLocator *)> Factory
std::string m_type
Algorithm's type.
Algorithm & operator=(const Algorithm &)=delete
delete assignment operator: NO ASSIGNMENT ALLOWED
const std::string & version() const override
bool registerContext() const
register for Algorithm Context Service?
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
Gaudi::Property< bool > m_auditorExecute
const AlgResources_t & neededResources() const override
StatusCode declareTool(ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Gaudi::Property< bool > m_auditorFinalize
void declareInfo(const std::string &name, const T &var, const std::string &desc) const
Declare monitoring information.
SmartIF< IDataProviderSvc > m_DDS
Detector data service.
bool isReEntrant() const override
SmartIF< IConversionSvc > m_DCS
Detector conversion service.
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
Gaudi::Property< bool > m_auditorRestart
const std::string & name() const override
The identifying name of the algorithm object.
void addToolsArray(ToolHandleArray< T > &hndlArr)
SmartIF< INTupleSvc > m_NTS
N tuple service.
Gaudi::Property< bool > m_asynchronous
Gaudi::StateMachine::State m_state
flag indicating whether ToolHandle tools have been added to m_tools
Gaudi::Property< bool > m_filterCircDeps
bool isFinalized() const override
Has the Algorithm already been finalized?
SmartIF< IHiveWhiteBoard > m_WB
Event data service (whiteboard).
StatusCode terminate() override
Dummy implementation of IStateful::terminate() method.
SmartIF< IAlgExecStateSvc > m_aess
Alg execution state mgr.
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
std::vector< BaseToolHandle * > m_toolHandles
Gaudi::Property< bool > m_auditorInitialize
SmartIF< IMonitorSvc > & monitorSvc() const
Access the monitor service.
const std::string & type() const override
The type of the algorithm object.
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").
Gaudi::StateMachine::State targetFSMState() const override
returns the state the algorithm will be in after the ongoing transition
SmartIF< IMessageSvc > m_MS
Message service.
SmartIF< ITimelineSvc > m_timelineSvc
Timeline Service.
bool isAsynchronous() const
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Gaudi::Property< bool > m_auditorStop
SmartIF< IHistogramSvc > m_HDS
Histogram data service.
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Gaudi::Property< bool > m_isEnabled
Gaudi::Property< bool > m_auditorReinitialize
bool isInitialized() const override
Has the Algorithm already been initialized?
Gaudi::Property< bool > m_registerContext
void setType(std::string type) override
bool isSequence() const override
Are we a Sequence?
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
std::string m_version
Algorithm's version.
SmartIF< IToolSvc > m_ptoolSvc
ToolSvc Service.
SmartIF< IMonitorSvc > m_pMonitorSvc
Online Monitoring Service.
unsigned int cardinality() const override
Return the cardinality.
std::vector< IAlgTool * > m_tools
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Implementation of property with value of concrete type.
Helper class for efficient "key" access for strings.
Define general base for Gaudi exception.
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition of the IMonitorSvc interface, which publishes Gaudi variables to outside monitoring proces...
virtual void declareInfo(const std::string &name, const bool &var, const std::string &desc, const IInterface *owner)=0
Declare monitoring information.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Gaudi::Details::PropertyBase & declareProperty(Gaudi::Details::PropertyBase &prop)
Small smart pointer class with automatic reference counting for IInterface.
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
bool getDefaultAuditorValue(ISvcLocator *loc)
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm,...
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...