Loading [MathJax]/extensions/tex2jax.js
Go to the documentation of this file.
30 template <Gaudi::StateMachine::Transition TR>
31 class OutStreamTransition {
36 void operator()( ItemType& item );
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();
79 template <Gaudi::StateMachine::Transition TR>
81 OutStreamTransition<TR> trans(
msg() );
83 return trans.result();
97 error() <<
"cannot retrieve IAlgManager" <<
endmsg;
103 error() <<
"cannot retrieve IDataManagerSvc" <<
endmsg;
109 return i_outStreamTransition<Gaudi::StateMachine::INITIALIZE>();
118 return i_outStreamTransition<Gaudi::StateMachine::START>();
127 std::vector<std::string> names;
130 if ( lvl > 0 ) names.push_back( pReg->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;
159 StatusCode sc = i_outStreamTransition<Gaudi::StateMachine::FINALIZE>();
174 StatusCode sc = i_outStreamTransition<Gaudi::StateMachine::STOP>();
184 const std::string algId =
"/" + outStream.
name();
191 warning() <<
"OutputStream instance " << outStream.
name() <<
" already added, ignoring " << outStream <<
endmsg;
StatusCode execute() override
Algorithm execution.
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")
const std::string & name() const
const std::string & name() const override
The identifying name of the algorithm object.
iterator find(const key_type &key)
StatusCode i_outStreamTransition()
Helper function to call the transition on the contained OutputStreams.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
Helper class to fill the internal map of OutputStreams.
StatusCode start() override
Algorithm initialization.
StatusCode start() override
the default (empty) implementation of IStateful::start() method
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
void i_addOutputStream(const Gaudi::Utils::TypeNameString &outStream)
Add a new algorithm to the list of OutputStreams.
Helper class to parse a string of format "type/name".
std::pair< const std::string, SmartIF< IAlgorithm > > value_type
void for_each(ContainerOfSynced &c, Fun &&f)
OutStreamsMapType m_outputStreams
Internal storage for the OutputStreams to call.
Gaudi::Property< std::vector< std::string > > m_outputStreamNames
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.
SmartIF< IAlgManager > m_algMgr
StatusCode stop() override
Algorithm finalization.
StatusCode finalize() override
Algorithm finalization.
StatusCode finalize() override
the default (empty) implementation of IStateful::finalize() method
constexpr static const auto SUCCESS
SmartIF< IDataProviderSvc > & evtSvc() const
shortcut for method eventSvc
#define DECLARE_COMPONENT(type)
StatusCode initialize() override
Algorithm initialization.
constexpr static const auto FAILURE
StatusCode stop() override
the default (empty) implementation of IStateful::stop() method
SmartIF< IDataManagerSvc > m_evtMgr