24 template <Gaudi::StateMachine::Transition TR>
25 class OutStreamTransition {
41 const StatusCode sc = item.second->sysInitialize();
65 const StatusCode sc = item.second->sysFinalize();
73 template <Gaudi::StateMachine::Transition TR>
75 OutStreamTransition<TR> trans(
msg() );
76 std::for_each( m_outputStreams.begin(), m_outputStreams.end(), trans );
77 return trans.result();
89 m_algMgr = service(
"ApplicationMgr" );
90 if (
UNLIKELY( !m_algMgr ) )
return Error(
"cannot retrieve IAlgManager" );
93 if (
UNLIKELY( !m_evtMgr ) )
return Error(
"cannot retrieve IDataManagerSvc " );
97 return i_outStreamTransition<Gaudi::StateMachine::INITIALIZE>();
106 return i_outStreamTransition<Gaudi::StateMachine::START>();
125 if ( alg->
execState( ctx ).
state() != AlgExecState::State::Done ) {
128 this->warning() <<
name <<
" already executed for the current event" <<
endmsg;
131 this->warning() <<
"invalid OuputStream " <<
name <<
endmsg;
144 StatusCode sc = i_outStreamTransition<Gaudi::StateMachine::FINALIZE>();
147 m_outputStreams.clear();
159 StatusCode sc = i_outStreamTransition<Gaudi::StateMachine::STOP>();
170 if ( m_outputStreams.find( algId ) == m_outputStreams.end() ) {
171 m_outputStreams[algId] = m_algMgr->algorithm( outStream );
172 if ( !m_outputStreams[algId] ) {
176 warning() <<
"OutputStream instance " << outStream.
name() <<
" already added, ignoring " << outStream <<
endmsg;
Definition of the MsgStream class used to transmit messages.
Define general base for Gaudi exception.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
StatusCode finalize() override
Algorithm finalization.
StatusCode initialize() override
standard initialization method
constexpr static const auto SUCCESS
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.
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.
StatusCode execute() override
Algorithm execution.
virtual Out operator()(const vector_of_const_< In > &inputs) const =0
virtual AlgExecState & execState(const EventContext &ctx) const =0
reference to AlgExecState of Alg
StatusCode start() override
Algorithm initialization.
constexpr static const auto FAILURE
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.