30 template <Gaudi::StateMachine::Transition TR>
31 class OutStreamTransition {
33 typedef ReplayOutputStream::OutStreamsMapType::value_type ItemType;
34 OutStreamTransition( MsgStream& msg ) : m_msg(
msg ), m_code( StatusCode::
SUCCESS ) {}
36 void operator()( ItemType& item );
38 StatusCode result()
const {
return m_code; }
46 void OutStreamTransition<Gaudi::StateMachine::INITIALIZE>::operator()( ItemType& item ) {
47 const StatusCode sc = item.second->sysInitialize();
54 void OutStreamTransition<Gaudi::StateMachine::START>::operator()( ItemType& item ) {
62 void OutStreamTransition<Gaudi::StateMachine::STOP>::operator()( ItemType& item ) {
70 void OutStreamTransition<Gaudi::StateMachine::FINALIZE>::operator()( ItemType& item ) {
71 const StatusCode sc = item.second->sysFinalize();
79template <Gaudi::StateMachine::Transition TR>
81 OutStreamTransition<TR> trans(
msg() );
83 return trans.result();
103 error() <<
"cannot retrieve IDataManagerSvc" <<
endmsg;
127 std::vector<std::string> names;
130 if ( lvl > 0 ) names.push_back( pReg->name() );
136 std::for_each( names.begin(), names.end(), [
this](
const std::string&
name ) {
137 SmartIF<IAlgorithm>& alg = this->m_outputStreams[name];
139 const auto& ctx = Gaudi::Hive::currentContext();
140 if ( alg->execState( ctx ).state() != AlgExecState::Done ) {
141 alg->sysExecute( ctx ).ignore( );
143 this->warning() << name <<
" already executed for the current event" << endmsg;
146 this->warning() <<
"invalid OuputStream " << name << endmsg;
184 const std::string algId =
"/" + outStream.
name();
191 warning() <<
"OutputStream instance " << outStream.
name() <<
" already added, ignoring " << outStream <<
endmsg;
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
MsgStream & msg() const
shortcut for the method msgStream(MSG::INFO)
MSG::Level msgLevel() const
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
const std::string & name() const override
The identifying name of the algorithm object.
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")
StatusCode start() override
the default (empty) implementation of IStateful::start() method
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
Helper class to parse a string of format "type/name".
const std::string & name() const
Define general base for Gaudi exception.
The IRegistry represents the entry door to the environment any data object residing in a transient da...
static const std::string locationRoot()
Return the path in the Transient Store used to record the triggered instances.
Helper class to fill the internal map of OutputStreams.
StatusCode stop() override
Algorithm finalization.
OutStreamsMapType m_outputStreams
Internal storage for the OutputStreams to call.
void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream)
Add a new algorithm to the list of OutputStreams.
StatusCode execute() override
Algorithm execution.
StatusCode i_outStreamTransition()
Helper function to call the transition on the contained OutputStreams.
StatusCode start() override
Algorithm initialization.
SmartIF< IDataManagerSvc > m_evtMgr
SmartIF< IAlgManager > m_algMgr
StatusCode initialize() override
Algorithm initialization.
StatusCode finalize() override
Algorithm finalization.
Gaudi::Property< std::vector< std::string > > m_outputStreamNames
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS
constexpr static const auto FAILURE