Go to the documentation of this file.
47 assert( loc !=
nullptr );
50 if (
appMgr &&
appMgr->hasProperty(
"AuditAlgorithms" ) ) {
51 audit.assign(
appMgr->getProperty(
"AuditAlgorithms" ) );
108 fatal() <<
" Exception with tag=" << Exception.tag() <<
" is caught " <<
endmsg;
109 error() << Exception <<
endmsg;
113 fatal() <<
" Standard std::exception is caught " <<
endmsg;
114 error() << Exception.what() <<
endmsg;
118 fatal() <<
"UNKNOWN Exception is caught " <<
endmsg;
140 if ( !
h->objKey().empty() )
out.emplace(
h->fullKey() );
143 if ( !
h->objKey().empty() &&
out.find(
h->fullKey() ) !=
out.end() ) {
145 error() <<
"Explicit circular data dependency detected for id " <<
h->fullKey() <<
endmsg;
150 if ( !sc )
return sc;
158 error() <<
"Failing initializing ToolHandles : " << Exception <<
endmsg;
169 warning() <<
"Implicit circular data dependency detected for id " <<
h <<
endmsg;
172 error() <<
"Implicit circular data dependency detected for id " <<
h <<
endmsg;
178 if ( !sc )
return sc;
185 return { in.begin(), in.end(), sort };
188 debug() <<
"Data Deps for " <<
name();
190 for (
auto id : orderset( avis.
ignoredInpKeys() ) ) { debug() <<
"\n + INPUT IGNORED " << id; }
192 for (
auto id : orderset( avis.
ignoredOutKeys() ) ) { debug() <<
"\n + OUTPUT IGNORED " << id; }
235 fatal() <<
"in sysStart(): exception with tag=" << Exception.tag() <<
" is caught" <<
endmsg;
236 error() << Exception <<
endmsg;
240 fatal() <<
"in sysStart(): standard std::exception is caught" <<
endmsg;
241 error() << Exception.what() <<
endmsg;
245 fatal() <<
"in sysStart(): UNKNOWN Exception is caught" <<
endmsg;
261 error() <<
"sysReinitialize(): cannot reinitialize algorithm not initialized" <<
endmsg;
281 fatal() <<
"sysReinitialize(): Exception with tag=" << Exception.tag() <<
" is caught" <<
endmsg;
282 error() << Exception <<
endmsg;
286 fatal() <<
"sysReinitialize(): Standard std::exception is caught" <<
endmsg;
287 error() << Exception.what() <<
endmsg;
291 fatal() <<
"sysReinitialize(): UNKNOWN Exception is caught" <<
endmsg;
307 error() <<
"sysRestart(): cannot restart algorithm not started" <<
endmsg;
323 fatal() <<
"sysRestart(): Exception with tag=" << Exception.tag() <<
" is caught" <<
endmsg;
324 error() << Exception <<
endmsg;
328 fatal() <<
"sysRestart(): Standard std::exception is caught" <<
endmsg;
329 error() << Exception.what() <<
endmsg;
333 fatal() <<
"sysRestart(): UNKNOWN Exception is caught" <<
endmsg;
348 algState.
setState( AlgExecState::State::Executing );
379 error() <<
" Recoverable";
382 msgStream() <<
" Exception with tag=" << Exception.tag() <<
" is caught " <<
endmsg;
384 error() << Exception <<
endmsg;
390 fatal() <<
" Standard std::exception is caught " <<
endmsg;
391 error() << Exception.what() <<
endmsg;
396 fatal() <<
"UNKNOWN Exception is caught " <<
endmsg;
404 unsigned int nerr =
m_aess->incrementErrorCount(
this );
407 warning() <<
"Continuing from error (cnt=" << nerr <<
", max=" <<
m_errorMax <<
")" <<
endmsg;
411 error() <<
"Maximum number of errors (" <<
m_errorMax <<
") reached." <<
endmsg;
415 algState.
setState( AlgExecState::State::Done, status );
447 fatal() <<
"in sysStop(): exception with tag=" << Exception.tag() <<
" is caught" <<
endmsg;
448 error() << Exception <<
endmsg;
452 fatal() <<
"in sysStop(): standard std::exception is caught" <<
endmsg;
453 error() << Exception.what() <<
endmsg;
457 fatal() <<
"in sysStop(): UNKNOWN Exception is caught" <<
endmsg;
490 fatal() <<
" Exception with tag=" << Exception.tag() <<
" is caught " <<
endmsg;
491 error() << Exception <<
endmsg;
495 fatal() <<
" Standard std::exception is caught " <<
endmsg;
496 error() << Exception.what() <<
endmsg;
500 fatal() <<
"UNKNOWN Exception is caught " <<
endmsg;
531 error() <<
"restart(): cannot be stopped" <<
endmsg;
536 error() <<
"restart(): cannot be started" <<
endmsg;
558 template <
typename IFace>
561 p = this->
service( service_name );
593 if ( !th->isEnabled() ) {
595 debug() <<
"ToolHandle " << th->typeAndName() <<
" not used" <<
endmsg;
599 auto sc = th->retrieve();
600 if ( sc.isFailure() ) {
604 auto tool = th->get();
606 debug() <<
"Adding " << ( th->isPublic() ?
"public" :
"private" ) <<
" ToolHandle tool " <<
tool->name() <<
" ("
613 debug() <<
"Registering all Tools in ToolHandleArray " << thArr->propertyName() <<
endmsg;
615 for (
auto toolHandle : thArr->getBaseArray() ) {
620 error() <<
"Error retrieving ToolHandle " << toolHandle->typeAndName() <<
" in ToolHandleArray "
621 << thArr->propertyName() <<
". Not registered" <<
endmsg;
646 void** ppSvc )
const {
648 return helper.
getService( svcName, createIf, iid, ppSvc );
652 void** ppSvc )
const {
678 return os <<
type() <<
"('" <<
name() <<
"')";
const Gaudi::StringKey & nameKey() const override
SmartIF< IService > service(std::string_view name, const bool quiet=false, const bool createIf=true) const
SmartIF< ISvcLocator > m_pSvcLocator
Pointer to service locator service.
Gaudi::Property< bool > m_auditorExecute
SmartIF< IRndmGenSvc > m_RGS
Random Number Generator Service.
SmartIF< IExceptionSvc > m_EXS
Exception Handler Service.
StatusCode sysExecute(const EventContext &ctx) override
The actions to be performed by the algorithm on an event.
unsigned int index() const override
SmartIF< IAlgContextSvc > & contextSvc() const
get Algorithm Context Service
SmartIF< IToolSvc > & toolSvc() const
The standard ToolSvc 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.
Gaudi::Property< unsigned int > m_errorMax
void acceptDHVisitor(IDataHandleVisitor *) const override
const std::string & name() const override
The identifying name of the algorithm object.
SmartIF< IDataProviderSvc > & eventSvc() const
The standard event data service.
SmartIF< IAuditorSvc > m_pAuditorSvc
Auditor Service.
Gaudi::StateMachine::State m_state
flag indicating whether ToolHandle tools have been added to m_tools
const std::string & type() const override
The type of the algorithm object.
Gaudi::Property< bool > m_isEnabled
StatusCode sysRestart() override
Restart method invoked by the framework.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
SmartIF< IHistogramSvc > & histoSvc() const
The standard histogram service.
Gaudi::Property< bool > m_doTimeline
SmartIF< IToolSvc > m_ptoolSvc
ToolSvc Service.
SmartIF< ISvcLocator > & serviceLocator() const override
The standard service locator.
SmartIF< IAuditorSvc > & auditorSvc() const
The standard auditor service.May not be invoked before sysInitialize() has been invoked.
SmartIF< IDataProviderSvc > & detSvc() const
The standard detector data service.
Gaudi::Property< bool > m_auditorReinitialize
SmartIF< IHiveWhiteBoard > m_WB
Event data service (whiteboard)
std::vector< Gaudi::DataHandle * > outputHandles() const override
SmartIF< IHistogramSvc > m_HDS
Histogram data service.
SmartIF< IChronoStatSvc > m_CSS
Chrono & Stat Service.
std::unique_ptr< IDataHandleVisitor > m_updateDataHandles
Hook for for derived classes to provide a custom visitor for data handles.
StatusCode sysStop() override
System stop.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
SmartIF< IConversionSvc > & eventCnvSvc() const
The standard event data persistency conversion service.
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
void bindPropertiesTo(Gaudi::Interfaces::IOptionsSvc &optsSvc)
DataObjIDColl m_outputDataObjs
std::string fullKey() const
combination of the key and the ClassName, mostly for debugging
SmartIF< IChronoStatSvc > & chronoSvc() const
The standard Chrono & Stat service, Return a pointer to the service if present.
void deregisterTool(IAlgTool *tool) const
SmartIF< IConversionSvc > m_ECS
Event conversion service.
void initToolHandles() const
Gaudi::Property< bool > m_auditorRestart
Gaudi::Property< bool > m_auditorStop
SmartIF< IHiveWhiteBoard > & whiteboard() const
SmartIF< INTupleSvc > m_NTS
N tuple service.
Gaudi::Property< bool > m_auditorInitialize
bool isEnabled() const override
Is this algorithm enabled or disabled?
MSG::Level setUpMessaging() const
Set up local caches.
auto get(const Handle &handle, const Algo &, const EventContext &) -> decltype(details::deref(handle.get()))
void initDataHandleHolder()
initializes all handles - called by the sysInitialize method of any descendant of this
Gaudi::Property< int > m_outputLevel
Gaudi::StateMachine::State FSMState() const override
returns the current state of the algorithm
SmartIF< IAlgContextSvc > m_contextSvc
Algorithm Context Service.
bool getDefaultAuditorValue(ISvcLocator *loc)
AlgExecState & execState(const EventContext &ctx) const override
reference to AlgExecState of Alg
StatusCode sysInitialize() override
Initialization method invoked by the framework.
RAII helper to record timeline events.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
const ValueType & value() const
Backward compatibility (.
DataObjIDColl m_inputDataObjs
const DataObjIDColl & ignoredOutKeys() const
an helper to share the implementation of service() among the various kernel base classes
StatusCode getService(std::string_view name, bool createIf, const InterfaceID &iid, void **ppSvc) const
Gaudi::StateMachine::State m_targetState
Algorithm has been initialized flag.
const std::string & version() const override
Gaudi::StringKey m_name
Algorithm's name for identification.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
const std::vector< IAlgTool * > & tools() const
std::ostream & toControlFlowExpression(std::ostream &os) const override
Produce string represention of the control flow expression.
SmartIF< IDataProviderSvc > m_EDS
Event data service.
Header file for std:chrono::duration-based Counters.
SmartIF< IExceptionSvc > & exceptionSvc() const
Get the exception Service.
Gaudi::Property< bool > m_auditorStart
const DataObjIDColl & ignoredInpKeys() const
std::vector< Gaudi::DataHandle * > inputHandles() const override
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...
std::vector< IAlgTool * > m_tools
SmartIF< IAlgExecStateSvc > & algExecStateSvc() const
StatusCode sysStart() override
Reinitialization method invoked by the framework.
std::vector< BaseToolHandle * > m_toolHandles
StatusCode service_i(std::string_view svcName, bool createIf, const InterfaceID &iid, void **ppSvc) const
implementation of service method
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
constexpr static const auto SUCCESS
std::vector< GaudiHandleArrayBase * > m_toolHandleArrays
StatusCode sysFinalize() override
System finalization.
SmartIF< ITimelineSvc > m_timelineSvc
Timeline Service.
StatusCode restart() override
the default (empty) implementation of IStateful::restart() method
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.
SmartIF< IDataProviderSvc > m_DDS
Detector data service.
const std::string & str() const
the actual string
SmartIF< ITimelineSvc > & timelineSvc() const
Gaudi::Property< bool > m_filterCircDeps
unsigned int m_index
Algorithm's index.
SmartIF< IAlgExecStateSvc > m_aess
Alg execution state mgr.
StatusCode reinitialize() override
the default (empty) implementation of IStateful::reinitialize() method
SmartIF< IConversionSvc > & detCnvSvc() const
The standard detector data persistency conversion service.
constexpr static const auto FAILURE
void setIndex(const unsigned int &idx) override
set instantiation index of Alg
StatusCode sysReinitialize() override
Reinitialization method invoked by the framework.
bool registerContext() const
register for Algorithm Context Service?
StatusCode createService(std::string_view name, const InterfaceID &iid, void **ppSvc) const
void registerTool(IAlgTool *tool) const
void setFilterPassed(bool f=true)
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
SmartIF< INTupleSvc > & ntupleSvc() const
The standard N tuple service.
SmartIF< IFace > & get_svc_(SmartIF< IFace > &p, const char *service_name) const
bool isSequence() const override
Are we a Sequence?
unsigned int errorCount() const
Get the number of failures of the algorithm.
SmartIF< IConversionSvc > m_DCS
Detector conversion service.
virtual void visit(const IDataHandleHolder *)=0
Gaudi::Property< bool > m_auditorFinalize