19 for (
auto& is : serviceLocator()->getServices() ) {
29 wbs = serviceLocator()->service( wbn,
false );
35 m_algStates.resize( 1 );
36 m_eventStatus.resize( 1 );
39 if ( msgLevel(
MSG::DEBUG ) ) debug() <<
"resizing state containers to : " << m_algStates.size() <<
endmsg;
43 fatal() <<
"could not get the AlgManager" <<
endmsg;
50 for (
auto& alg : algos ) addAlg( alg );
51 for (
auto& alg : m_preInitAlgs ) addAlg( alg );
66 fatal() <<
"AlgExecStateSvc not initialized before first use" <<
endmsg;
75 size_t slotID = ctx.
valid() ? ctx.
slot() : 0;
78 ost <<
"Algs: " <<
m_algStates.at( slotID ).size() <<
'\n';
82 [](
size_t m,
const auto& as ) {
return std::max( m, as.first.str().length() ); } );
84 ost <<
" - Slot " << slotID <<
'\n';
85 for (
auto& e : algState ) {
86 ost <<
" + " <<
std::setw( ml ) << e.first.str() <<
" " << e.second <<
'\n';
130 auto itr = algState.find( algName );
131 if (
UNLIKELY( itr == algState.end() ) ) {
151 auto itr = algState.find( iAlg->
nameKey() );
153 if (
UNLIKELY( itr == algState.end() ) ) {
216 error() <<
"Unable to find Algorithm \"" << iAlg->name() <<
"\" in map" 217 <<
" of ErrorCounts" <<
endmsg;
232 error() <<
"Unable to find Algorithm \"" << iAlg->name() <<
"\" in map" 233 <<
" of ErrorCounts" <<
endmsg;
243 error() <<
"Unable to find Algorithm \"" << iAlg->name() <<
"\" in map" 244 <<
" of ErrorCounts" <<
endmsg;
247 return ++( itr->second );
void resetErrorCount(const IAlgorithm *iAlg) override
A service that keeps track of the execution state of Algorithm *.
Define general base for Gaudi exception.
const std::string & name() const override
Retrieve name of the service.
std::vector< AlgStateMap_t > m_algStates
const AlgExecState & algExecState(const Gaudi::StringKey &algName, const EventContext &ctx) const override
std::map< Gaudi::StringKey, std::atomic< unsigned int > > m_errorCount
MsgStream & verbose() const
shortcut for the method msgStream(MSG::VERBOSE)
void dump(std::ostringstream &ost, const EventContext &ctx) const override
class MergingTransformer< Out(const vector_of_const_< In > void
void updateEventStatus(const bool &b, const EventContext &ctx) override
std::once_flag m_initFlag
This class represents an entry point to all the event specific data.
The helper class to represent the efficient "key" for access.
auto begin(reverse_wrapper< T > &w)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
GAUDI_API const EventContext & currentContext()
unsigned int incrementErrorCount(const IAlgorithm *iAlg) override
auto end(reverse_wrapper< T > &w)
#define DECLARE_SERVICE_FACTORY(x)
std::vector< Gaudi::StringKey > m_preInitAlgs
virtual const Gaudi::StringKey & nameKey() const =0
StringKey rep of name.
unsigned int algErrorCount(const IAlgorithm *iAlg) const override
The IAlgorithm is the interface implemented by the Algorithm base class.
const AlgStateMap_t & algExecStates(const EventContext &ctx) const override
void reset(const EventContext &ctx) override
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
bool isValid() const
Allow for check if smart pointer is valid.
const EventStatus::Status & eventStatus(const EventContext &ctx) const override
virtual const std::vector< IAlgorithm * > & getAlgorithms() const =0
Return the list of Algorithms.
std::vector< EventStatus::Status > m_eventStatus
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
virtual size_t getNumberOfStores() const =0
Get the number of 'slots'.
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
void setEventStatus(const EventStatus::Status &sc, const EventContext &ctx) override
const std::string & str() const
the actual string
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
void addAlg(IAlgorithm *iAlg) override