25 template <Gaudi::StateMachine::Transition TR>
26 class OutStreamTransition
44 const StatusCode sc = item.second->sysInitialize();
71 const StatusCode sc = item.second->sysFinalize();
79 template <Gaudi::StateMachine::Transition TR>
82 OutStreamTransition<TR> trans(
msg() );
83 std::for_each( m_outputStreams.begin(), m_outputStreams.end(), trans );
84 return trans.result();
97 m_algMgr = service(
"ApplicationMgr" );
98 if (
UNLIKELY( !m_algMgr ) )
return Error(
"cannot retrieve IAlgManager" );
101 if (
UNLIKELY( !m_evtMgr ) )
return Error(
"cannot retrieve IDataManagerSvc " );
105 return i_outStreamTransition<Gaudi::StateMachine::INITIALIZE>();
115 return i_outStreamTransition<Gaudi::StateMachine::START>();
137 this->warning() <<
name <<
" already executed for the current event" <<
endmsg;
140 this->warning() <<
"invalid OuputStream " <<
name <<
endmsg;
154 StatusCode sc = i_outStreamTransition<Gaudi::StateMachine::FINALIZE>();
157 m_outputStreams.clear();
170 StatusCode sc = i_outStreamTransition<Gaudi::StateMachine::STOP>();
182 if ( m_outputStreams.find( algId ) == m_outputStreams.end() ) {
183 m_outputStreams[algId] = m_algMgr->algorithm( outStream );
184 if ( !m_outputStreams[algId] ) {
188 warning() <<
"OutputStream instance " << outStream.
name() <<
" already added, ignoring " << outStream <<
endmsg;
constexpr static const auto FAILURE
Definition of the MsgStream class used to transmit messages.
Define general base for Gaudi exception.
StatusCode finalize() override
Algorithm finalization.
StatusCode initialize() override
standard initialization method
virtual const name_type & name() const =0
Name of the directory (or key)
#define DECLARE_COMPONENT(type)
StatusCode i_outStreamTransition()
Helper function to call the transition on the contained OutputStreams.
Helper class to parse a string of format "type/name".
StatusCode stop() override
Algorithm finalization.
This class is used for returning status codes from appropriate routines.
virtual bool isExecuted() const =0
check if the algorithm is already executed for the current event
StatusCode finalize() override
standard finalization method
virtual StatusCode sysExecute(const EventContext &)=0
System execution. This method invokes the execute() method of a concrete algorithm.
GAUDI_API const EventContext & currentContext()
The IRegistry represents the entry door to the environment any data object residing in a transient da...
void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream)
Add a new algorithm to the list of OutputStreams.
Helper class to fill the internal map of OutputStreams.
constexpr static const auto SUCCESS
StatusCode execute() override
Algorithm execution.
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
StatusCode start() override
Algorithm initialization.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
StatusCode initialize() override
Algorithm initialization.
const std::string & name() const
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
static const std::string locationRoot()
Return the path in the Transient Store used to record the triggered instances.