45 assert( loc !=
nullptr );
47 if (
auto appMgr = loc->
service<
IProperty>(
"ApplicationMgr" ) ) { appMgr->getProperty( &audit ).ignore(); }
103 fatal() <<
" Exception with tag=" << Exception.tag() <<
" is caught " <<
endmsg;
107 }
catch (
const std::exception& Exception ) {
108 fatal() <<
"Standard std::exception is caught in " << __func__ <<
endmsg;
113 fatal() <<
"UNKNOWN Exception is caught " <<
endmsg;
135 if ( !h->objKey().empty() ) out.emplace( h->fullKey() );
138 if ( !h->objKey().empty() && out.find( h->fullKey() ) != out.end() ) {
140 error() <<
"Explicit circular data dependency detected for id " << h->fullKey() <<
endmsg;
145 if ( !sc )
return sc;
153 error() <<
"Failing initializing ToolHandles : " << Exception <<
endmsg;
164 warning() <<
"Implicit circular data dependency detected for id " << h <<
endmsg;
167 error() <<
"Implicit circular data dependency detected for id " << h <<
endmsg;
173 if ( !sc )
return sc;
216 fatal() <<
"in sysStart(): exception with tag=" << Exception.tag() <<
" is caught" <<
endmsg;
220 }
catch (
const std::exception& Exception ) {
221 fatal() <<
"in sysStart(): standard std::exception is caught" <<
endmsg;
226 fatal() <<
"in sysStart(): UNKNOWN Exception is caught" <<
endmsg;
242 error() <<
"sysReinitialize(): cannot reinitialize algorithm not initialized" <<
endmsg;
262 fatal() <<
"sysReinitialize(): Exception with tag=" << Exception.tag() <<
" is caught" <<
endmsg;
266 }
catch (
const std::exception& Exception ) {
267 fatal() <<
"sysReinitialize(): Standard std::exception is caught" <<
endmsg;
272 fatal() <<
"sysReinitialize(): UNKNOWN Exception is caught" <<
endmsg;
288 error() <<
"sysRestart(): cannot restart algorithm not started" <<
endmsg;
304 fatal() <<
"sysRestart(): Exception with tag=" << Exception.tag() <<
" is caught" <<
endmsg;
308 }
catch (
const std::exception& Exception ) {
309 fatal() <<
"sysRestart(): Standard std::exception is caught" <<
endmsg;
314 fatal() <<
"sysRestart(): UNKNOWN Exception is caught" <<
endmsg;
348 status = execute( ctx );
361 error() <<
" Recoverable";
364 msgStream() <<
" Exception with tag=" << Exception.tag() <<
" is caught " <<
endmsg;
370 }
catch (
const std::exception& Exception ) {
372 fatal() <<
"Standard std::exception is caught in " << __func__ <<
endmsg;
378 fatal() <<
"UNKNOWN Exception is caught " <<
endmsg;
418 fatal() <<
"in sysStop(): exception with tag=" << Exception.tag() <<
" is caught" <<
endmsg;
422 }
catch (
const std::exception& Exception ) {
423 fatal() <<
"in sysStop(): standard std::exception is caught" <<
endmsg;
428 fatal() <<
"in sysStop(): UNKNOWN Exception is caught" <<
endmsg;
458 thArr->release().orThrow(
"Cannot release " + thArr->propertyName() );
466 fatal() <<
" Exception with tag=" << Exception.tag() <<
" is caught " <<
endmsg;
470 }
catch (
const std::exception& Exception ) {
471 fatal() <<
"Standard std::exception is caught in " << __func__ <<
endmsg;
476 fatal() <<
"UNKNOWN Exception is caught " <<
endmsg;
507 error() <<
"restart(): cannot be stopped" <<
endmsg;
512 error() <<
"restart(): cannot be started" <<
endmsg;
534 template <
typename IFace>
537 p = this->
service( service_name );
539 throw GaudiException(
"Service [" + std::string{ service_name } +
"] not found", this->
name(),
569 if ( !th->isEnabled() ) {
571 debug() <<
"ToolHandle " << th->typeAndName() <<
" not used" <<
endmsg;
575 auto sc = th->retrieve();
576 if ( sc.isFailure() ) {
580 auto tool = th->get();
582 debug() <<
"Adding " << ( th->isPublic() ?
"public" :
"private" ) <<
" ToolHandle tool " << tool->name() <<
" ("
583 << tool->type() <<
")" <<
endmsg;
589 debug() <<
"Registering all Tools in ToolHandleArray " << thArr->propertyName() <<
endmsg;
591 for (
auto toolHandle : thArr->getBaseArray() ) {
596 error() <<
"Error retrieving ToolHandle " << toolHandle->typeAndName() <<
" in ToolHandleArray "
597 << thArr->propertyName() <<
". Not registered" <<
endmsg;
632 std::vector<IAlgTool*>::iterator it = std::find(
m_tools.begin(),
m_tools.end(), tool );
642 return os <<
type() <<
"('" <<
name() <<
"')";
std::unordered_set< DataObjID, DataObjID_Hasher > DataObjIDColl
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
wrapper on an Algorithm state.
void setFilterPassed(bool f=true)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
MsgStream & msgStream() const
Return an uninitialized MsgStream.
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
MSG::Level setUpMessaging() const override final
bool empty() const
return true if no DataHandle was found
std::vector< Gaudi::DataHandle * > inputHandles() const override
std::vector< Gaudi::DataHandle * > outputHandles() const override
void initDataHandleHolder()
DataObjIDColl m_outputDataObjs
DataObjIDColl m_inputDataObjs
This class represents an entry point to all the event specific data.
StatusCode restart() override
the default (empty) implementation of IStateful::restart() method
Gaudi::StringKey m_name
Algorithm's name for identification.
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
unsigned int m_index
Algorithm's index.
const std::vector< IAlgTool * > & tools() const
const Gaudi::StringKey & nameKey() const override
StatusCode sysStart() override
Reinitialization method invoked by the framework.
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.
StatusCode sysExecute(const EventContext &ctx) override
The actions to be performed by the algorithm on an event.
void acceptDHVisitor(IDataHandleVisitor *) const override
AlgExecStateRef::AlgKey m_execSvcKey
identifier of this algorithm in the AlgExecStateSvc
SmartIF< IConversionSvc > & detCnvSvc() const
The standard detector data persistency conversion service.
SmartIF< IHistogramSvc > & histoSvc() const
The standard histogram service.
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< IConversionSvc > & eventCnvSvc() const
The standard event data persistency conversion service.
SmartIF< IFace > & get_svc_(SmartIF< IFace > &p, const char *service_name) const
Gaudi::Property< int > m_outputLevel
void deregisterTool(IAlgTool *tool) const
Gaudi::StateMachine::State m_targetState
Algorithm has been initialized flag.
SmartIF< IConversionSvc > m_ECS
Event conversion service.
StatusCode sysReinitialize() override
Reinitialization method invoked by the framework.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
SmartIF< IExceptionSvc > m_EXS
Exception Handler Service.
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
SmartIF< IAlgExecStateSvc > & algExecStateSvc() const
SmartIF< IAlgContextSvc > & contextSvc() const
get Algorithm Context Service
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
SmartIF< IChronoStatSvc > & chronoSvc() const
The standard Chrono & Stat service, Return a pointer to the service if present.
SmartIF< IRndmGenSvc > & randSvc() const
The standard RandomGen service, Return a pointer to the service if present.
unsigned int errorCount() const
Get the number of failures of the algorithm.
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
Gaudi::Property< bool > m_auditorFinalize
SmartIF< ITimelineSvc > & timelineSvc() const
void initToolHandles() const
SmartIF< IDataProviderSvc > m_DDS
Detector data service.
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.
StatusCode sysFinalize() override
System finalization.
StatusCode reinitialize() override
the default (empty) implementation of IStateful::reinitialize() method
SmartIF< INTupleSvc > m_NTS
N tuple service.
SmartIF< IDataProviderSvc > & detSvc() const
The standard detector data service.
Gaudi::StateMachine::State m_state
flag indicating whether ToolHandle tools have been added to m_tools
Gaudi::Property< bool > m_filterCircDeps
SmartIF< IHiveWhiteBoard > & whiteboard() const
SmartIF< IHiveWhiteBoard > m_WB
Event data service (whiteboard).
StatusCode sysRestart() override
Restart method invoked by the framework.
AlgExecStateRef execState(const EventContext &ctx) const override
get the AlgExecStateRef of current algorithm Actually a small wrapper around it, thus the plain objec...
SmartIF< IAlgExecStateSvc > m_aess
Alg execution state mgr.
void registerTool(IAlgTool *tool) const
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
unsigned int index() const override
std::vector< BaseToolHandle * > m_toolHandles
Gaudi::Property< bool > m_auditorInitialize
const std::string & type() const override
The type of the algorithm object.
bool isEnabled() const override
Is this algorithm enabled or disabled?
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").
SmartIF< IExceptionSvc > & exceptionSvc() const
Get the exception Service.
SmartIF< ITimelineSvc > m_timelineSvc
Timeline Service.
std::ostream & toControlFlowExpression(std::ostream &os) const override
Produce string represention of the control flow expression.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
Gaudi::Property< bool > m_auditorStop
SmartIF< INTupleSvc > & ntupleSvc() const
The standard N tuple service.
SmartIF< IHistogramSvc > m_HDS
Histogram data service.
Gaudi::Property< bool > m_isEnabled
Gaudi::Property< bool > m_auditorReinitialize
void setIndex(const unsigned int &idx) override
set instantiation index of Alg
SmartIF< IToolSvc > & toolSvc() const
The standard ToolSvc service, Return a pointer to the service if present.
bool isSequence() const override
Are we a Sequence?
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
std::string m_version
Algorithm's version.
StatusCode sysStop() override
System stop.
SmartIF< IToolSvc > m_ptoolSvc
ToolSvc Service.
StatusCode sysInitialize() override
Initialization method invoked by the framework.
std::vector< IAlgTool * > m_tools
It is a simple guard, which "locks" the scope for the Auditor Service is am exception-safe way.
static const std::string Stop
static const std::string Initialize
static const std::string Finalize
static const std::string Execute
static const std::string Start
static const std::string ReInitialize
static const std::string ReStart
Implementation of property with value of concrete type.
const ValueType & value() const
Helper class for efficient "key" access for strings.
Helper "sentry" class to automatize the safe register/unregister the algorithm's context.
Define general base for Gaudi exception.
Base class of array's of various gaudihandles.
virtual AlgExecStateRef::AlgKey addAlg(const Gaudi::StringKey &algName)=0
adds a new algorithm to the service
The IAlgorithm is the interface implemented by the Algorithm base class.
virtual void visit(const IDataHandleHolder *)=0
virtual StatusCode handle(const INamedInterface &o, const GaudiException &e) const =0
Handle caught GaudiExceptions.
virtual StatusCode handleErr(const INamedInterface &o, const StatusCode &s) const =0
Handle errors.
The IProperty is the basic interface for all components which have properties that can be set or get.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
virtual SmartIF< IService > & service(const Gaudi::Utils::TypeNameString &typeName, const bool createIf=true)=0
Returns a smart pointer to a service.
RAII helper to record timeline events.
virtual bool isEnabled() const =0
virtual TimelineRecorder getRecorder(std::string alg, const EventContext &ctx)=0
void bindPropertiesTo(Gaudi::Interfaces::IOptionsSvc &optsSvc)
an helper to share the implementation of service() among the various kernel base classes
SmartIF< IService > service(std::string_view name, const bool quiet=false, const bool createIf=true) const
Small smart pointer class with automatic reference counting for IInterface.
Small wrapper class for easy manipulation with generic counters and IStatSvc interface.
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE
bool getDefaultAuditorValue(ISvcLocator *loc)
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...
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...