| The Gaudi Framework v32r1 (f65d50dc)

Classes | Public Types | Public Member Functions | Protected Types | Protected Attributes | List of all members
MinimalEventLoopMgr Class Reference

This is the default processing manager of the application manager. More...

`#include <GaudiKernel/MinimalEventLoopMgr.h>`

Inheritance diagram for MinimalEventLoopMgr:
[legend]
Collaboration diagram for MinimalEventLoopMgr:
[legend]

## Classes
class | AbortEventListener

## Public Types
typedef std::vector< SmartIF< IAlgorithm > > | ListAlg
Public Types inherited from extends< Service, IEventProcessor >
using | base_class = extends
| Typedef to this class. More...
using | extend_interfaces_base = extend_interfaces< Interfaces... >
| Typedef to the base of this class. More...
Public Types inherited from Service
using | Factory = Gaudi::PluginService::Factory< IService *(const std::string &, ISvcLocator *)>
Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using | PropertyHolderImpl = PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| Typedef used to refer to this class from derived classes, as in. More...
Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using | base_class = CommonMessaging
Public Types inherited from extend_interfaces< Interfaces... >
using | ext_iids = typename Gaudi::interface_list_cat< typename Interfaces::ext_iids... >::type
| take union of the ext_iids of all Interfaces... More...

## Public Member Functions
| MinimalEventLoopMgr (const std::string &nam, ISvcLocator *svcLoc)
| Standard Constructor. More...
| MinimalEventLoopMgr (const MinimalEventLoopMgr &)=delete
| No copy allowed. More...
MinimalEventLoopMgr & | operator= (const MinimalEventLoopMgr &)=delete
| No copy allowed. More...
StatusCode | initialize () override
| implementation of IService::initialize More...
StatusCode | start () override
| implementation of IService::start More...
StatusCode | stop () override
| implementation of IService::stop More...
StatusCode | finalize () override
| implementation of IService::finalize More...
StatusCode | reinitialize () override
| implementation of IService::reinitialize More...
StatusCode | restart () override
| implementation of IService::restart More...
EventContext | createEventContext () override
| implementation of IEventProcessor::createEventContext() More...
StatusCode | nextEvent (int maxevt) override
| implementation of IEventProcessor::nextEvent More...
StatusCode | executeEvent (EventContext &&ctx) override
| implementation of IEventProcessor::executeEvent(EventContext&&) More...
StatusCode | executeRun (int maxevt) override
| implementation of IEventProcessor::executeRun( ) More...
StatusCode | stopRun () override
| implementation of IEventProcessor::stopRun( ) More...
void | topAlgHandler (Gaudi::Details::PropertyBase &p)
| Top algorithm List handler. More...
StatusCode | decodeTopAlgs ()
| decodeTopAlgNameList & topAlgNameListHandler More...
void | outStreamHandler (Gaudi::Details::PropertyBase &p)
| Output stream List handler. More...
StatusCode | decodeOutStreams ()
| decodeOutStreamNameList & outStreamNameListHandler More...
Public Member Functions inherited from extends< Service, IEventProcessor >
void * | i_cast (const InterfaceID &tid) const override
| Implementation of IInterface::i_cast. More...
StatusCode | queryInterface (const InterfaceID &ti, void **pp) override
| Implementation of IInterface::queryInterface. More...
std::vector< std::string > | getInterfaceNames () const override
| Implementation of IInterface::getInterfaceNames. More...
Public Member Functions inherited from Service
const std::string & | name () const override
| Retrieve name of the service. More...
StatusCode | configure () override
StatusCode | initialize () override
StatusCode | start () override
StatusCode | stop () override
StatusCode | finalize () override
StatusCode | terminate () override
Gaudi::StateMachine::State | FSMState () const override
Gaudi::StateMachine::State | targetFSMState () const override
StatusCode | reinitialize () override
StatusCode | restart () override
StatusCode | sysInitialize () override
| Initialize Service. More...
StatusCode | sysStart () override
| Initialize Service. More...
StatusCode | sysStop () override
| Initialize Service. More...
StatusCode | sysFinalize () override
| Finalize Service. More...
StatusCode | sysReinitialize () override
| Re-initialize the Service. More...
StatusCode | sysRestart () override
| Re-initialize the Service. More...
| Service (std::string name, ISvcLocator *svcloc)
| Standard Constructor. More...
SmartIF< ISvcLocator > & | serviceLocator () const override
| Retrieve pointer to service locator. More...
StatusCode | setProperties ()
| Method for setting declared properties to the values specified for the job. More...
template<class T >
StatusCode | service (const std::string &name, const T *&psvc, bool createIf=true) const
| Access a service by name, creating it if it doesn't already exist. More...
template<class T >
StatusCode | service (const std::string &name, T *&psvc, bool createIf=true) const
template<typename IFace = IService>
SmartIF< IFace > | service (const std::string &name, bool createIf=true) const
template<class T >
StatusCode | service (const std::string &svcType, const std::string &svcName, T *&psvc) const
| Access a service by name and type, creating it if it doesn't already exist. More...
template<class T >
StatusCode | declareTool (ToolHandle< T > &handle, std::string toolTypeAndName, bool createIf=true)
| Declare used tool. More...
SmartIF< IAuditorSvc > & | auditorSvc () const
| The standard auditor service.May not be invoked before sysInitialize() has been invoked. More...
Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
| PropertyHolder ()=default
Gaudi::Details::PropertyBase & | declareProperty (Gaudi::Details::PropertyBase &prop)
| Declare a property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
| Helper to wrap a regular data member and use it as a regular property. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
| Declare a PropertyBase instance setting name and documentation. More...
Gaudi::Details::PropertyBase * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
| Declare a remote property. More...
StatusCode | setProperty (const Gaudi::Details::PropertyBase &p) override
| set the property form another property More...
StatusCode | setProperty (const std::string &s) override
| set the property from the formatted string More...
StatusCode | setProperty (const std::string &n, const std::string &v) override
| set the property from name and the value More...
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value More...
StatusCode | getProperty (Gaudi::Details::PropertyBase *p) const override
| get the property More...
const Gaudi::Details::PropertyBase & | getProperty (const std::string &name) const override
| get the property by name More...
StatusCode | getProperty (const std::string &n, std::string &v) const override
| convert the property to the string More...
const std::vector< Gaudi::Details::PropertyBase * > & | getProperties () const override
| get all properties More...
bool | hasProperty (const std::string &name) const override
| Return true if we have a property with the given name. More...
| PropertyHolder (const PropertyHolder &)=delete
PropertyHolder & | operator= (const PropertyHolder &)=delete
Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | msgLevel () const
| get the cached level (originally extracted from the embedded MsgStream) More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const
| Backward compatibility function for getting the output level. More...
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
const SmartIF< IMessageSvc > & | msgSvc () const
| The standard message service. More...
MsgStream & | msgStream () const
| Return an uninitialized MsgStream. More...
MsgStream & | msgStream (const MSG::Level level) const
| Predefined configurable message stream for the efficient printouts. More...
MsgStream & | always () const
| shortcut for the method msgStream(MSG::ALWAYS) More...
MsgStream & | fatal () const
| shortcut for the method msgStream(MSG::FATAL) More...
MsgStream & | err () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | error () const
| shortcut for the method msgStream(MSG::ERROR) More...
MsgStream & | warning () const
| shortcut for the method msgStream(MSG::WARNING) More...
MsgStream & | info () const
| shortcut for the method msgStream(MSG::INFO) More...
MsgStream & | debug () const
| shortcut for the method msgStream(MSG::DEBUG) More...
MsgStream & | verbose () const
| shortcut for the method msgStream(MSG::VERBOSE) More...
MsgStream & | msg () const
| shortcut for the method msgStream(MSG::INFO) More...

## Protected Types
enum | State { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED }

## Protected Attributes
Gaudi::Property< std::vector< std::string > > | m_topAlgNames
Gaudi::Property< std::vector< std::string > > | m_outStreamNames
Gaudi::Property< std::string > | m_outStreamType
Gaudi::Property< bool > | m_printCFExp
SmartIF< IAppMgrUI > | m_appMgrUI
| Reference to the IAppMgrUI interface of the application manager. More...
SmartIF< IIncidentSvc > | m_incidentSvc
| Reference to the incident service. More...
SmartIF< IAlgExecStateSvc > | m_aess
| List of top level algorithms. More...
ListAlg | m_topAlgList
ListAlg | m_outStreamList
| List of output streams. More...
State | m_state = OFFLINE
| State of the object. More...
bool | m_scheduledStop = false
| Scheduled stop of event processing. More...
AbortEventListener | m_abortEventListener
| Instance of the incident listener waiting for AbortEvent. More...
SmartIF< IHiveWhiteBoard > | m_WB
| < Event data service (whiteboard) More...
size_t | m_nevt {0}
Protected Attributes inherited from Service
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::Property< int > | m_outputLevel {this, "OutputLevel", MSG::NIL, "output level"}
Gaudi::Property< bool > | m_auditInit {this, "AuditServices", false, " unused"}
Gaudi::Property< bool > | m_auditorInitialize {this, "AuditInitialize", false, "trigger auditor on initialize()"}
Gaudi::Property< bool > | m_auditorStart {this, "AuditStart", false, "trigger auditor on start()"}
Gaudi::Property< bool > | m_auditorStop {this, "AuditStop", false, "trigger auditor on stop()"}
Gaudi::Property< bool > | m_auditorFinalize {this, "AuditFinalize", false, "trigger auditor on finalize()"}
Gaudi::Property< bool > | m_auditorReinitialize {this, "AuditReinitialize", false, "trigger auditor on reinitialize()"}
Gaudi::Property< bool > | m_auditorRestart {this, "AuditRestart", false, "trigger auditor on restart()"}
SmartIF< IAuditorSvc > | m_pAuditorSvc
| Auditor Service. More...

## Additional Inherited Members
Protected Member Functions inherited from Service
| ~Service () override
| Standard Destructor. More...
int | outputLevel () const
| get the `Service's` output level More...
Protected Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
Gaudi::Details::PropertyBase * | property (const std::string &name) const
Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level | setUpMessaging () const
| Set up local caches. More...
MSG::Level | resetMessaging ()
| Reinitialize internal states. More...
void | updateMsgStreamOutputLevel (int level)
| Update the output level of the cached MsgStream. More...

## Detailed Description

This is the default processing manager of the application manager.

This object handles the minimal requirements needed by the application manager. It also is capable of handling a bunch of algorithms and output streams. However, the list may as well be empty.

Author
  Markus Frank

Version
  1.0

Definition at line 25 of file MinimalEventLoopMgr.h.

## Member Typedef Documentation

## ◆ ListAlg

typedef std::vector<SmartIF<IAlgorithm> > MinimalEventLoopMgr::ListAlg

Definition at line 46 of file MinimalEventLoopMgr.h.

## Member Enumeration Documentation

## ◆ State

enum MinimalEventLoopMgr::State
| protected

Enumerator
OFFLINE |
CONFIGURED |
FINALIZED |
INITIALIZED |

Definition at line 60 of file MinimalEventLoopMgr.h.

60 { OFFLINE, CONFIGURED, FINALIZED, INITIALIZED };
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:60
MinimalEventLoopMgr::FINALIZED
Definition: MinimalEventLoopMgr.h:60
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:60
MinimalEventLoopMgr::OFFLINE
Definition: MinimalEventLoopMgr.h:60

## Constructor & Destructor Documentation

## ◆ MinimalEventLoopMgr() [1/2]

MinimalEventLoopMgr::MinimalEventLoopMgr | ( | const std::string & | nam,
|  | ISvcLocator * | svcLoc
| ) |  |

Standard Constructor.

Definition at line 28 of file MinimalEventLoopMgr.cpp.

29 : base_class( nam, svcLoc ), m_appMgrUI( svcLoc ) {}
extends< Service, IEventProcessor >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:62

## ◆ MinimalEventLoopMgr() [2/2]

MinimalEventLoopMgr::MinimalEventLoopMgr | ( | const MinimalEventLoopMgr & |  | ) |
| delete

No copy allowed.

## Member Function Documentation

## ◆ createEventContext()

EventContext MinimalEventLoopMgr::createEventContext | ( |  | ) |
| override

implementation of IEventProcessor::createEventContext()

Definition at line 282 of file MinimalEventLoopMgr.cpp.

282 { return EventContext{m_nevt++, 0}; }
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
MinimalEventLoopMgr::m_nevt
size_t m_nevt
Definition: MinimalEventLoopMgr.h:134

## ◆ decodeOutStreams()

StatusCode MinimalEventLoopMgr::decodeOutStreams | ( |  | ) |

decodeOutStreamNameList & outStreamNameListHandler

Definition at line 460 of file MinimalEventLoopMgr.cpp.

460 {
461 StatusCode sc = StatusCode::SUCCESS;
462 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
463 auto algMan = serviceLocator()->as<IAlgManager>();
464 if ( algMan ) {
465 // Reset the existing Top Algorithm List
466 m_outStreamList.clear();
467 for ( const auto& it : m_outStreamNames.value() ) {
468 Gaudi::Utils::TypeNameString item( it, m_outStreamType );
469 const bool CREATE = false;
470 SmartIF<IAlgorithm> os = algMan->algorithm( item, CREATE );
471 if ( os ) {
472 DEBMSG << "Output Stream " << item.name() << " already exists" << endmsg;
473 } else {
474 DEBMSG << "Creating Output Stream " << it << endmsg;
475 IAlgorithm* ios = nullptr;
476 StatusCode sc1 = algMan->createAlgorithm( item.type(), item.name(), ios );
477 if ( !sc1.isSuccess() ) {
478 error() << "Unable to create Output Stream " << it << endmsg;
479 return sc1;
480 }
481 os = ios; // manage reference counting
482 }
483 m_outStreamList.push_back( os );
484 }
485 return sc;
486 }
487 sc = StatusCode::FAILURE;
488 }
489 return sc;
490 }
SmartIF< IAlgorithm >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:60
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:60
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:71
std::vector::push_back
T push_back(T... args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
MinimalEventLoopMgr::m_outStreamNames
Gaudi::Property< std::vector< std::string > > m_outStreamNames
Definition: MinimalEventLoopMgr.h:52
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:10
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
std::vector::clear
T clear(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
Io::CREATE
Definition: IFileMgr.h:31
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:22
MinimalEventLoopMgr::m_outStreamType
Gaudi::Property< std::string > m_outStreamType
Definition: MinimalEventLoopMgr.h:54
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ decodeTopAlgs()

StatusCode MinimalEventLoopMgr::decodeTopAlgs | ( |  | ) |

decodeTopAlgNameList & topAlgNameListHandler

Definition at line 412 of file MinimalEventLoopMgr.cpp.

412 {
413 StatusCode sc = StatusCode::SUCCESS;
414 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
415 auto algMan = serviceLocator()->as<IAlgManager>();
416 if ( algMan ) {
417 // Reset the existing Top Algorithm List
418 m_topAlgList.clear();
419 m_topAlgList.reserve( m_topAlgNames.value().size() );
420 for ( const auto& it : m_topAlgNames.value() ) {
421 Gaudi::Utils::TypeNameString item{it};
422 // Got the type and name. Now creating the algorithm, avoiding duplicate creation.
423 std::string item_name = item.name();
424 const bool CREATE = false;
425 SmartIF<IAlgorithm> alg = algMan->algorithm( item_name, CREATE );
426 if ( alg ) {
427 DEBMSG << "Top Algorithm " << item_name << " already exists" << endmsg;
428 } else {
429 DEBMSG << "Creating Top Algorithm " << item.type() << " with name " << item_name << endmsg;
430 IAlgorithm* ialg = nullptr;
431 StatusCode sc1 = algMan->createAlgorithm( item.type(), item_name, ialg );
432 if ( !sc1.isSuccess() ) {
433 error() << "Unable to create Top Algorithm " << item.type() << " with name " << item_name << endmsg;
434 return sc1;
435 }
436 alg = ialg; // manage reference counting
437 }
438 m_topAlgList.push_back( alg );
439 }
440 return sc;
441 }
442 sc = StatusCode::FAILURE;
443 }
444 return sc;
445 }
SmartIF< IAlgorithm >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
ManySmallAlgs.alg
alg
Definition: ManySmallAlgs.py:69
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:60
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:60
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
std::string
STL class.
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:71
std::vector::push_back
T push_back(T... args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:10
MinimalEventLoopMgr::m_topAlgNames
Gaudi::Property< std::vector< std::string > > m_topAlgNames
Definition: MinimalEventLoopMgr.h:50
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
std::vector::clear
T clear(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:28
Io::CREATE
Definition: IFileMgr.h:31
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:22
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67
std::vector::reserve
T reserve(T... args)

## ◆ executeEvent()

StatusCode MinimalEventLoopMgr::executeEvent | ( | EventContext && | ctx | ) |
| override

implementation of IEventProcessor::executeEvent(EventContext&&)

Definition at line 319 of file MinimalEventLoopMgr.cpp.

319 {
320 bool eventfailed = false;
321
322 m_aess->reset( context );
323
324 // select the appropriate store
325 if ( m_WB.isValid() ) m_WB->selectStore( context.slot() ).ignore();
326
327 // Get the IProperty interface of the ApplicationMgr to pass it to RetCodeGuard
328 const auto appmgr = serviceLocator()->as<IProperty>();
329 // Call the execute() method of all top algorithms
330 for ( auto& ita : m_topAlgList ) {
331 StatusCode sc( StatusCode::FAILURE );
332 try {
333 if ( UNLIKELY( m_abortEventListener.abortEvent ) ) {
334 DEBMSG << "AbortEvent incident fired by " << m_abortEventListener.abortEventSource << endmsg;
335 m_abortEventListener.abortEvent = false;
336 sc.ignore();
337 break;
338 }
339 RetCodeGuard rcg( appmgr, Gaudi::ReturnCode::UnhandledException );
340 sc = ita->sysExecute( context );
341 rcg.ignore(); // disarm the guard
342 } catch ( const GaudiException& Exception ) {
343 fatal() << ".executeEvent(): Exception with tag=" << Exception.tag() << " thrown by " << ita->name() << endmsg;
344 error() << Exception << endmsg;
345 } catch ( const std::exception& Exception ) {
346 fatal() << ".executeEvent(): Standard std::exception thrown by " << ita->name() << endmsg;
347 error() << Exception.what() << endmsg;
348 } catch ( ... ) { fatal() << ".executeEvent(): UNKNOWN Exception thrown by " << ita->name() << endmsg; }
349
350 if ( UNLIKELY( !sc.isSuccess() ) ) {
351 warning() << "Execution of algorithm " << ita->name() << " failed" << endmsg;
352 eventfailed = true;
353 }
354 }
355
356 m_aess->updateEventStatus( eventfailed, context );
357
358 // ensure that the abortEvent flag is cleared before the next event
359 if ( UNLIKELY( m_abortEventListener.abortEvent ) ) {
360 DEBMSG << "AbortEvent incident fired by " << m_abortEventListener.abortEventSource << endmsg;
361 m_abortEventListener.abortEvent = false;
362 }
363
364 // Call the execute() method of all output streams
365 for ( auto& ito : m_outStreamList ) {
366 AlgExecState& state = m_aess->algExecState( ito, context );
367 state.setFilterPassed( true );
368 StatusCode sc = ito->sysExecute( context );
369 if ( UNLIKELY( !sc.isSuccess() ) ) {
370 warning() << "Execution of output stream " << ito->name() << " failed" << endmsg;
371 eventfailed = true;
372 }
373 }
374
375 // Check if there was an error processing current event
376 if ( UNLIKELY( eventfailed ) ) {
377 error() << "Error processing event loop." << endmsg;
378 std::ostringstream ost;
379 m_aess->dump( ost, context );
380 debug() << "Dumping AlgExecStateSvc status:\n" << ost.str() << endmsg;
381 return StatusCode( StatusCode::FAILURE, true );
382 }
383
384 return StatusCode( StatusCode::SUCCESS, true );
385 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:96
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
MinimalEventLoopMgr::AbortEventListener::abortEvent
bool abortEvent
Flag signalling that the event being processed has to be aborted (skip all following top algs).
Definition: MinimalEventLoopMgr.h:40
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
RetCodeGuard
Helper class to set the application return code in case of early exit (e.g.
Definition: RetCodeGuard.h:9
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:101
MinimalEventLoopMgr::m_aess
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:66
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:67
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MinimalEventLoopMgr::AbortEventListener::abortEventSource
std::string abortEventSource
Source of the AbortEvent incident.
Definition: MinimalEventLoopMgr.h:42
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
IAlgExecStateSvc::algExecState
virtual const AlgExecState & algExecState(const Gaudi::StringKey &algName, const EventContext &ctx) const =0
Gaudi::ReturnCode::UnhandledException
constexpr int UnhandledException
Definition: AppReturnCode.h:27
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
IHiveWhiteBoard::selectStore
virtual StatusCode selectStore(size_t partitionIndex)=0
Activate an given 'slot' for all subsequent calls within the same thread id.
IAlgExecStateSvc::dump
virtual void dump(std::ostringstream &ost, const EventContext &ctx) const =0
MinimalEventLoopMgr::m_WB
SmartIF< IHiveWhiteBoard > m_WB
< Event data service (whiteboard)
Definition: MinimalEventLoopMgr.h:131
std::exception::what
T what(T... args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
std::ostringstream
STL class.
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
std::ostringstream::str
T str(T... args)
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:107
MinimalEventLoopMgr::m_abortEventListener
AbortEventListener m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:75
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
std::exception
STL class.
IAlgExecStateSvc::updateEventStatus
virtual void updateEventStatus(const bool &b, const EventContext &ctx)=0
IAlgExecStateSvc::reset
virtual void reset(const EventContext &ctx)=0
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:22
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20
AlgExecState
Definition: IAlgExecStateSvc.h:27
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:92
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67

## ◆ executeRun()

StatusCode MinimalEventLoopMgr::executeRun | ( | int | maxevt | ) |
| override

implementation of IEventProcessor::executeRun( )

Definition at line 294 of file MinimalEventLoopMgr.cpp.

294 {
295 // Call now the nextEvent(...)
296 return nextEvent( maxevt );
297 }
MinimalEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
Definition: MinimalEventLoopMgr.cpp:286
maxevt
int maxevt
Definition: Bootstrap.cpp:260

## ◆ finalize()

StatusCode MinimalEventLoopMgr::finalize | ( |  | ) |
| override

implementation of IService::finalize

Definition at line 236 of file MinimalEventLoopMgr.cpp.

236 {
237 StatusCode sc = StatusCode::SUCCESS;
238 StatusCode scRet = StatusCode::SUCCESS;
239 // Call the finalize() method of all top algorithms
240 for ( auto& ita : m_topAlgList ) {
241 sc = ita->sysFinalize();
242 if ( !sc.isSuccess() ) {
243 scRet = StatusCode::FAILURE;
244 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
245 }
246 }
247 // Call the finalize() method of all Output streams
248 for ( auto& ita : m_outStreamList ) {
249 sc = ita->sysFinalize();
250 if ( !sc.isSuccess() ) {
251 scRet = StatusCode::FAILURE;
252 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
253 }
254 }
255 // release all top algorithms
256 auto algMan = serviceLocator()->as<IAlgManager>();
257 for ( auto& ita : m_topAlgList ) {
258 if ( algMan->removeAlgorithm( ita ).isFailure() ) {
259 scRet = StatusCode::FAILURE;
260 warning() << "Problems removing Algorithm " << ita->name() << endmsg;
261 }
262 }
263 m_topAlgList.clear();
264 m_outStreamList.clear();
265 if ( sc.isSuccess() ) m_state = FINALIZED;
266
267 m_incidentSvc->removeListener( &m_abortEventListener, IncidentType::AbortEvent );
268
269 m_incidentSvc.reset();
270 m_appMgrUI.reset();
271
272 sc = Service::finalize();
273
274 if ( sc.isFailure() ) {
275 scRet = StatusCode::FAILURE;
276 error() << "Problems finalizing Service base class" << endmsg;
277 }
278
279 return scRet;
280 }
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:164
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:101
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MinimalEventLoopMgr::FINALIZED
Definition: MinimalEventLoopMgr.h:60
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:71
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
MinimalEventLoopMgr::m_abortEventListener
AbortEventListener m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:75
std::vector::clear
T clear(T... args)
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:64
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:86
IIncidentSvc::removeListener
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:62
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67

## ◆ initialize()

StatusCode MinimalEventLoopMgr::initialize | ( |  | ) |
| override

implementation of IService::initialize

Definition at line 34 of file MinimalEventLoopMgr.cpp.

34 {
35
36 if ( !m_appMgrUI ) return StatusCode::FAILURE;
37
38 StatusCode sc = Service::initialize();
39 if ( !sc.isSuccess() ) {
40 error() << "Failed to initialize Service Base class." << endmsg;
41 return StatusCode::FAILURE;
42 }
43
44 auto prpMgr = serviceLocator()->as<IProperty>();
45 if ( !prpMgr ) {
46 error() << "Error retrieving AppMgr interface IProperty." << endmsg;
47 return StatusCode::FAILURE;
48 }
49 if ( m_topAlgNames.value().empty() ) { setProperty( prpMgr->getProperty( "TopAlg" ) ).ignore(); }
50 if ( m_outStreamNames.value().empty() ) { setProperty( prpMgr->getProperty( "OutStream" ) ).ignore(); }
51
52 // Get the references to the services that are needed by the ApplicationMgr itself
53 m_incidentSvc = serviceLocator()->service( "IncidentSvc" );
54 if ( !m_incidentSvc ) {
55 fatal() << "Error retrieving IncidentSvc." << endmsg;
56 return StatusCode::FAILURE;
57 }
58
59 m_incidentSvc->addListener( &m_abortEventListener, IncidentType::AbortEvent );
60
61 // The state is changed at this moment to allow decodeXXXX() to do something
62 m_state = INITIALIZED;
63
64 // Get WhiteBoard interface if implemented by EventDataSvc
65 m_WB = service( "EventDataSvc" );
66
67 // setup the default EventContext with slot 0
68 Gaudi::Hive::setCurrentContextId( Gaudi::Hive::ContextIdType( 0 ) );
69
70 //--------------------------------------------------------------------------------------------
71 // Create output streams. Do not initialize them yet.
72 // The state is updated temporarily in order to enable the handler, which
73 // is also triggered by a change to the "OutputStream" Property.
74 //--------------------------------------------------------------------------------------------
75 sc = decodeOutStreams();
76 if ( !sc.isSuccess() ) {
77 error() << "Failed to initialize Output streams." << endmsg;
78 m_state = CONFIGURED;
79 return sc;
80 }
81 //--------------------------------------------------------------------------------------------
82 // Create all needed Top Algorithms. Do not initialize them yet.
83 // The state is updated temporarily in order to enable the handler, which
84 // is also triggered by a change to the "TopAlg" Property.
85 //--------------------------------------------------------------------------------------------
86 sc = decodeTopAlgs();
87 if ( !sc.isSuccess() ) {
88 error() << "Failed to initialize Top Algorithms streams." << endmsg;
89 m_state = CONFIGURED;
90 return sc;
91 }
92
93 // Initialize all the new TopAlgs. In fact Algorithms are protected against
94 // getting initialized twice.
95 for ( auto& ita : m_topAlgList ) {
96 sc = ita->sysInitialize();
97 if ( !sc.isSuccess() ) {
98 error() << "Unable to initialize Algorithm: " << ita->name() << endmsg;
99 return sc;
100 }
101 }
102 for ( auto& ita : m_outStreamList ) {
103 sc = ita->sysInitialize();
104 if ( !sc.isSuccess() ) {
105 error() << "Unable to initialize Output Stream: " << ita->name() << endmsg;
106 return sc;
107 }
108 }
109
110 // get hold of the Algorithm Execution State mgr
111 m_aess = serviceLocator()->service( "AlgExecStateSvc" );
112 if ( !m_aess ) {
113 fatal() << "Error retrieving AlgExecStateSvc." << endmsg;
114 return StatusCode::FAILURE;
115 }
116
117 if ( m_printCFExp && !m_topAlgList.empty() ) {
118 info() << "Control Flow Expression:" << endmsg;
119 std::stringstream expr;
120 auto& first = m_topAlgList.front();
121 for ( auto& ialg : m_topAlgList ) {
122 if ( ialg != first ) expr << " >> ";
123 ialg->toControlFlowExpression( expr );
124 }
125 info() << expr.str() << endmsg;
126 }
127 return StatusCode::SUCCESS;
128 }
Gaudi::Hive::ContextIdType
std::size_t ContextIdType
Internal type used for the ContextId.
Definition: ThreadLocalContext.h:13
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:60
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
std::vector::empty
T empty(T... args)
Gaudi::Hive::setCurrentContextId
GAUDI_API void setCurrentContextId(ContextIdType newId)
Used by the framework to change the value of the current context id.
Definition: ThreadLocalContext.cpp:23
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:145
std::vector::front
T front(T... args)
MinimalEventLoopMgr::m_aess
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:66
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:60
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:60
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:104
MinimalEventLoopMgr::decodeTopAlgs
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Definition: MinimalEventLoopMgr.cpp:412
std::stringstream
STL class.
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:71
ISvcLocator::service
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
Definition: ISvcLocator.h:76
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
MinimalEventLoopMgr::m_outStreamNames
Gaudi::Property< std::vector< std::string > > m_outStreamNames
Definition: MinimalEventLoopMgr.h:52
MinimalEventLoopMgr::m_topAlgNames
Gaudi::Property< std::vector< std::string > > m_topAlgNames
Definition: MinimalEventLoopMgr.h:50
MinimalEventLoopMgr::m_WB
SmartIF< IHiveWhiteBoard > m_WB
< Event data service (whiteboard)
Definition: MinimalEventLoopMgr.h:131
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
std::stringstream::str
T str(T... args)
MinimalEventLoopMgr::m_abortEventListener
AbortEventListener m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:75
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:64
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
IIncidentSvc::addListener
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
Service::service
StatusCode service(const std::string &name, const T *&psvc, bool createIf=true) const
Access a service by name, creating it if it doesn't already exist.
Definition: Service.h:83
MinimalEventLoopMgr::decodeOutStreams
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
Definition: MinimalEventLoopMgr.cpp:460
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20
MinimalEventLoopMgr::m_printCFExp
Gaudi::Property< bool > m_printCFExp
Definition: MinimalEventLoopMgr.h:56
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:92
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:62
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67

## ◆ nextEvent()

StatusCode MinimalEventLoopMgr::nextEvent | ( | int | maxevt | ) |
| override

implementation of IEventProcessor::nextEvent

Definition at line 286 of file MinimalEventLoopMgr.cpp.

286 {
287 error() << "This method cannot be called on an object of type " << System::typeinfoName( typeid( *this ) ) << endmsg;
288 return StatusCode::FAILURE;
289 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:298
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ operator=()

MinimalEventLoopMgr& MinimalEventLoopMgr::operator= | ( | const MinimalEventLoopMgr & |  | ) |
| delete

No copy allowed.

## ◆ outStreamHandler()

void MinimalEventLoopMgr::outStreamHandler | ( | Gaudi::Details::PropertyBase & | p | ) |

Output stream List handler.

Definition at line 450 of file MinimalEventLoopMgr.cpp.

450 {
451 if ( !( decodeOutStreams() ).isSuccess() ) {
452 throw GaudiException( "Failed to initialize output streams.", "MinimalEventLoopMgr::outStreamHandler",
453 StatusCode::FAILURE );
454 }
455 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86
MinimalEventLoopMgr::decodeOutStreams
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
Definition: MinimalEventLoopMgr.cpp:460

## ◆ reinitialize()

StatusCode MinimalEventLoopMgr::reinitialize | ( |  | ) |
| override

implementation of IService::reinitialize

Definition at line 185 of file MinimalEventLoopMgr.cpp.

185 {
186 StatusCode sc = StatusCode::SUCCESS;
187
188 // Reinitialize all the TopAlgs.
189 for ( auto& ita : m_topAlgList ) {
190 sc = ita->sysReinitialize();
191 if ( !sc.isSuccess() ) {
192 error() << "Unable to reinitialize Algorithm: " << ita->name() << endmsg;
193 return sc;
194 }
195 }
196 for ( auto& ita : m_outStreamList ) {
197 sc = ita->sysReinitialize();
198 if ( !sc.isSuccess() ) {
199 error() << "Unable to reinitialize Output Stream: " << ita->name() << endmsg;
200 return sc;
201 }
202 }
203
204 return sc;
205 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67

## ◆ restart()

StatusCode MinimalEventLoopMgr::restart | ( |  | ) |
| override

implementation of IService::restart

Definition at line 209 of file MinimalEventLoopMgr.cpp.

209 {
210 StatusCode sc = StatusCode::SUCCESS;
211
212 // Restart all the TopAlgs.
213 for ( auto& ita : m_topAlgList ) {
214 m_aess->resetErrorCount( ita );
215 sc = ita->sysRestart();
216 if ( !sc.isSuccess() ) {
217 error() << "Unable to restart Algorithm: " << ita->name() << endmsg;
218 return sc;
219 }
220 }
221 for ( auto& ita : m_outStreamList ) {
222 m_aess->resetErrorCount( ita );
223 sc = ita->sysRestart();
224 if ( !sc.isSuccess() ) {
225 error() << "Unable to restart Output Stream: " << ita->name() << endmsg;
226 return sc;
227 }
228 }
229
230 return sc;
231 }
MinimalEventLoopMgr::m_aess
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:66
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
IAlgExecStateSvc::resetErrorCount
virtual void resetErrorCount(const IAlgorithm *iAlg)=0
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67

## ◆ start()

StatusCode MinimalEventLoopMgr::start | ( |  | ) |
| override

implementation of IService::start

Definition at line 132 of file MinimalEventLoopMgr.cpp.

132 {
133
134 StatusCode sc = Service::start();
135 if ( !sc.isSuccess() ) return sc;
136
137 // Start all the new TopAlgs. In fact Algorithms are protected against getting
138 // started twice.
139 for ( auto& ita : m_topAlgList ) {
140 sc = ita->sysStart();
141 if ( !sc.isSuccess() ) {
142 error() << "Unable to start Algorithm: " << ita->name() << endmsg;
143 return sc;
144 }
145 }
146 for ( auto& ita : m_outStreamList ) {
147 sc = ita->sysStart();
148 if ( !sc.isSuccess() ) {
149 error() << "Unable to start Output Stream: " << ita->name() << endmsg;
150 return sc;
151 }
152 }
153 return StatusCode::SUCCESS;
154 }
Service::start
StatusCode start() override
Definition: Service.cpp:129
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
StatusCode::isSuccess
bool isSuccess() const
Definition: StatusCode.h:267
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67

## ◆ stop()

StatusCode MinimalEventLoopMgr::stop | ( |  | ) |
| override

implementation of IService::stop

Definition at line 158 of file MinimalEventLoopMgr.cpp.

158 {
159
160 StatusCode sc( StatusCode::SUCCESS, true );
161
162 // Stop all the TopAlgs. In fact Algorithms are protected against getting
163 // stopped twice.
164 for ( auto& ita : m_topAlgList ) {
165 sc = ita->sysStop();
166 if ( !sc.isSuccess() ) {
167 error() << "Unable to stop Algorithm: " << ita->name() << endmsg;
168 return sc;
169 }
170 }
171 for ( auto& ita : m_outStreamList ) {
172 sc = ita->sysStop();
173 if ( !sc.isSuccess() ) {
174 error() << "Unable to stop Output Stream: " << ita->name() << endmsg;
175 return sc;
176 }
177 }
178
179 return Service::stop();
180 }
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
Service::stop
StatusCode stop() override
Definition: Service.cpp:123
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:69
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:67

## ◆ stopRun()

StatusCode MinimalEventLoopMgr::stopRun | ( |  | ) |
| override

implementation of IEventProcessor::stopRun( )

Definition at line 389 of file MinimalEventLoopMgr.cpp.

389 {
390 // Set the application return code
391 auto appmgr = serviceLocator()->as<IProperty>();
392 if ( Gaudi::setAppReturnCode( appmgr, Gaudi::ReturnCode::ScheduledStop ).isFailure() ) {
393 error() << "Could not set return code of the application (" << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg;
394 }
395 m_scheduledStop = true;
396 return StatusCode::SUCCESS;
397 }
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:277
MinimalEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: MinimalEventLoopMgr.h:73
StatusCode::SUCCESS
constexpr static const auto SUCCESS
Definition: StatusCode.h:85
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:103
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:25
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:98
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:49
StatusCode::isFailure
bool isFailure() const
Definition: StatusCode.h:130
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get.
Definition: IProperty.h:20
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:192

## ◆ topAlgHandler()

void MinimalEventLoopMgr::topAlgHandler | ( | Gaudi::Details::PropertyBase & | p | ) |

Top algorithm List handler.

Definition at line 402 of file MinimalEventLoopMgr.cpp.

402 {
403 if ( !( decodeTopAlgs() ).isSuccess() ) {
404 throw GaudiException( "Failed to initialize Top Algorithms streams.", "MinimalEventLoopMgr::topAlgHandler",
405 StatusCode::FAILURE );
406 }
407 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:21
MinimalEventLoopMgr::decodeTopAlgs
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Definition: MinimalEventLoopMgr.cpp:412
StatusCode::FAILURE
constexpr static const auto FAILURE
Definition: StatusCode.h:86

## Member Data Documentation

## ◆ m_abortEventListener

AbortEventListener MinimalEventLoopMgr::m_abortEventListener
| protected

Instance of the incident listener waiting for AbortEvent.

Definition at line 75 of file MinimalEventLoopMgr.h.

## ◆ m_aess

SmartIF<IAlgExecStateSvc> MinimalEventLoopMgr::m_aess
| protected

List of top level algorithms.

Definition at line 66 of file MinimalEventLoopMgr.h.

## ◆ m_appMgrUI

SmartIF<IAppMgrUI> MinimalEventLoopMgr::m_appMgrUI
| protected

Reference to the IAppMgrUI interface of the application manager.

Definition at line 62 of file MinimalEventLoopMgr.h.

## ◆ m_incidentSvc

SmartIF<IIncidentSvc> MinimalEventLoopMgr::m_incidentSvc
| protected

Reference to the incident service.

Definition at line 64 of file MinimalEventLoopMgr.h.

## ◆ m_nevt

size_t MinimalEventLoopMgr::m_nevt {0}
| protected

Definition at line 134 of file MinimalEventLoopMgr.h.

## ◆ m_outStreamList

ListAlg MinimalEventLoopMgr::m_outStreamList
| protected

List of output streams.

Definition at line 69 of file MinimalEventLoopMgr.h.

## ◆ m_outStreamNames

Gaudi::Property<std::vector<std::string> > MinimalEventLoopMgr::m_outStreamNames
| protected

Initial value:
{
this, "OutStream", {}, &MinimalEventLoopMgr::outStreamHandler, "list of output stream names"}

Definition at line 52 of file MinimalEventLoopMgr.h.

## ◆ m_outStreamType

Gaudi::Property<std::string> MinimalEventLoopMgr::m_outStreamType
| protected

Initial value:
{this, "OutStreamType", "OutputStream",
" default type for OutputStream instances"}

Definition at line 54 of file MinimalEventLoopMgr.h.

## ◆ m_printCFExp

Gaudi::Property<bool> MinimalEventLoopMgr::m_printCFExp
| protected

Initial value:
{this, "PrintControlFlowExpression", false,
"Print the control flow expression representing the content of TopAlg"}

Definition at line 56 of file MinimalEventLoopMgr.h.

## ◆ m_scheduledStop

bool MinimalEventLoopMgr::m_scheduledStop = false
| protected

Scheduled stop of event processing.

Definition at line 73 of file MinimalEventLoopMgr.h.

## ◆ m_state

State MinimalEventLoopMgr::m_state = OFFLINE
| protected

State of the object.

Definition at line 71 of file MinimalEventLoopMgr.h.

## ◆ m_topAlgList

ListAlg MinimalEventLoopMgr::m_topAlgList
| protected

Definition at line 67 of file MinimalEventLoopMgr.h.

## ◆ m_topAlgNames

Gaudi::Property<std::vector<std::string> > MinimalEventLoopMgr::m_topAlgNames
| protected

Initial value:
{
this, "TopAlg", {}, &MinimalEventLoopMgr::topAlgHandler, "list of top level algorithms names"}

Definition at line 50 of file MinimalEventLoopMgr.h.

## ◆ m_WB

SmartIF<IHiveWhiteBoard> MinimalEventLoopMgr::m_WB
| protected

< Event data service (whiteboard)

Definition at line 131 of file MinimalEventLoopMgr.h.

The documentation for this class was generated from the following files:

- GaudiKernel/GaudiKernel/MinimalEventLoopMgr.h
- GaudiKernel/src/Lib/MinimalEventLoopMgr.cpp