| The Gaudi Framework v28r2p1 (f1a77ff4)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

Public Types | Public Member Functions | Protected Types | Protected Attributes | Private Member Functions | Private 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]

## 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
typedef Gaudi::PluginService::Factory< IService *, const std::string &, ISvcLocator * > | Factory
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...
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...
StatusCode | nextEvent (int maxevt) override
| implementation of IEventProcessor::nextEvent More...
StatusCode | executeEvent (void *par) override
| implementation of IEventProcessor::executeEvent(void* par) 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...
| ~extends () override=default
| Virtual destructor. 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 | declarePrivateTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Private tool. More...
template<class T >
StatusCode | declarePublicTool (ToolHandle< T > &handle, std::string toolTypeAndName="", bool createIf=true)
| Declare used Public 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
| ~PropertyHolder () override=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, TYPE &value, const std::string &doc="none") const
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
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleBase &ref, const std::string &doc="none")
| Specializations for various GaudiHandles. More...
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, GaudiHandleArrayBase &ref, const std::string &doc="none")
Gaudi::Details::PropertyBase * | declareProperty (const std::string &name, DataObjectHandleBase &ref, const std::string &doc="none")
Public Member Functions inherited from CommonMessagingBase
virtual | ~CommonMessagingBase ()=default
| Virtual destructor. More...
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...
MSG::Level | msgLevel () const
| get the output level from the embedded MsgStream More...
MSG::Level | outputLevel () const __attribute__((deprecated))
| Backward compatibility function for getting the output level. More...
bool | msgLevel (MSG::Level lvl) const
| get the output level from the embedded MsgStream More...
Public Member Functions inherited from extend_interfaces< Interfaces... >
| ~extend_interfaces () override=default
| Virtual destructor. More...

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

## Protected Attributes
Gaudi::Property< std::vector< std::string > > | m_topAlgNames {this, "TopAlg", {}, "list of top level algorithms names"}
Gaudi::Property< std::vector< std::string > > | m_outStreamNames {this, "OutStream", {}, "list of output stream names"}
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...
SmartIF< IIncidentListener > | m_abortEventListener
| Instance of the incident listener waiting for AbortEvent. More...
bool | m_abortEvent = false
| Flag signalling that the event being processedhas to be aborted (skip all following top algs). More...
std::string | m_abortEventSource
| Source of the AbortEvent incident. More...
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, "[[deprecated]] 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...

## Private Member Functions
| MinimalEventLoopMgr (const MinimalEventLoopMgr &)
| Fake copy constructor (never implemented). More...
MinimalEventLoopMgr & | operator= (const MinimalEventLoopMgr &)
| Fake assignment operator (never implemented). More...

## Private Attributes
SmartIF< IHiveWhiteBoard > | m_WB
size_t | m_nevt {0}

## 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 > >
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, they list may as well be empty.

Author
  Markus Frank

Version
  1.0

Definition at line 28 of file MinimalEventLoopMgr.h.

## Member Typedef Documentation

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

Definition at line 31 of file MinimalEventLoopMgr.h.

## Member Enumeration Documentation

enum MinimalEventLoopMgr::State
| protected

Enumerator
OFFLINE |
CONFIGURED |
FINALIZED |
INITIALIZED |

Definition at line 43 of file MinimalEventLoopMgr.h.

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

## Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 56 of file MinimalEventLoopMgr.cpp.

57 : base_class( nam, svcLoc ), m_appMgrUI( svcLoc )
58 {
59 m_topAlgNames.declareUpdateHandler( &MinimalEventLoopMgr::topAlgHandler, this );
60 m_outStreamNames.declareUpdateHandler( &MinimalEventLoopMgr::outStreamHandler, this );
61 }
MinimalEventLoopMgr::topAlgHandler
void topAlgHandler(Gaudi::Details::PropertyBase &p)
Top algorithm List handler.
Definition: MinimalEventLoopMgr.cpp:498
MinimalEventLoopMgr::outStreamHandler
void outStreamHandler(Gaudi::Details::PropertyBase &p)
Output stream List handler.
Definition: MinimalEventLoopMgr.cpp:548
extends< Service, IEventProcessor >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
MinimalEventLoopMgr::m_outStreamNames
Gaudi::Property< std::vector< std::string > > m_outStreamNames
Definition: MinimalEventLoopMgr.h:36
MinimalEventLoopMgr::m_topAlgNames
Gaudi::Property< std::vector< std::string > > m_topAlgNames
Definition: MinimalEventLoopMgr.h:35
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:45

MinimalEventLoopMgr::MinimalEventLoopMgr | ( | const MinimalEventLoopMgr & |  | ) |
| private

Fake copy constructor (never implemented).

## Member Function Documentation

StatusCode MinimalEventLoopMgr::decodeOutStreams | ( |  | ) |

decodeOutStreamNameList & outStreamNameListHandler

Definition at line 559 of file MinimalEventLoopMgr.cpp.

560 {
561 StatusCode sc = StatusCode::SUCCESS;
562 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
563 auto algMan = serviceLocator()->as<IAlgManager>();
564 if ( algMan ) {
565 // Reset the existing Top Algorithm List
566 m_outStreamList.clear();
567 for ( const auto& it : m_outStreamNames.value() ) {
568 Gaudi::Utils::TypeNameString item( it, m_outStreamType );
569 const bool CREATE = false;
570 SmartIF<IAlgorithm> os = algMan->algorithm( item, CREATE );
571 if ( os ) {
572 DEBMSG << "Output Stream " << item.name() << " already exists" << endmsg;
573 } else {
574 DEBMSG << "Creating Output Stream " << it << endmsg;
575 IAlgorithm* ios = nullptr;
576 StatusCode sc1 = algMan->createAlgorithm( item.type(), item.name(), ios );
577 if ( !sc1.isSuccess() ) {
578 error() << "Unable to create Output Stream " << it << endmsg;
579 return sc1;
580 }
581 os = ios; // manage reference counting
582 }
583 m_outStreamList.push_back( os );
584 }
585 return sc;
586 }
587 sc = StatusCode::FAILURE;
588 }
589 return sc;
590 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
SmartIF< IAlgorithm >
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:43
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:43
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:54
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
MinimalEventLoopMgr::m_outStreamNames
Gaudi::Property< std::vector< std::string > > m_outStreamNames
Definition: MinimalEventLoopMgr.h:36
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::vector::clear
T clear(T...args)
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:27
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:52
Io::CREATE
Definition: IFileMgr.h:30
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:50
MinimalEventLoopMgr::m_outStreamType
Gaudi::Property< std::string > m_outStreamType
Definition: MinimalEventLoopMgr.h:37
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

StatusCode MinimalEventLoopMgr::decodeTopAlgs | ( |  | ) |

decodeTopAlgNameList & topAlgNameListHandler

Definition at line 509 of file MinimalEventLoopMgr.cpp.

510 {
511 StatusCode sc = StatusCode::SUCCESS;
512 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
513 auto algMan = serviceLocator()->as<IAlgManager>();
514 if ( algMan ) {
515 // Reset the existing Top Algorithm List
516 m_topAlgList.clear();
517 m_topAlgList.reserve( m_topAlgNames.value().size() );
518 for ( const auto& it : m_topAlgNames.value() ) {
519 Gaudi::Utils::TypeNameString item{it};
520 // Got the type and name. Now creating the algorithm, avoiding duplicate creation.
521 std::string item_name = item.name() + getGaudiThreadIDfromName( name() );
522 const bool CREATE = false;
523 SmartIF<IAlgorithm> alg = algMan->algorithm( item_name, CREATE );
524 if ( alg ) {
525 DEBMSG << "Top Algorithm " << item_name << " already exists" << endmsg;
526 } else {
527 DEBMSG << "Creating Top Algorithm " << item.type() << " with name " << item_name << endmsg;
528 IAlgorithm* ialg = nullptr;
529 StatusCode sc1 = algMan->createAlgorithm( item.type(), item_name, ialg );
530 if ( !sc1.isSuccess() ) {
531 error() << "Unable to create Top Algorithm " << item.type() << " with name " << item_name << endmsg;
532 return sc1;
533 }
534 alg = ialg; // manage reference counting
535 }
536 m_topAlgList.push_back( alg );
537 }
538 return sc;
539 }
540 sc = StatusCode::FAILURE;
541 }
542 return sc;
543 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
SmartIF< IAlgorithm >
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:289
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:43
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:43
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
std::string
STL class.
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:54
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:12
MinimalEventLoopMgr::m_topAlgNames
Gaudi::Property< std::vector< std::string > > m_topAlgNames
Definition: MinimalEventLoopMgr.h:35
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::vector::clear
T clear(T...args)
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:27
Io::CREATE
Definition: IFileMgr.h:30
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:50
getGaudiThreadIDfromName
GAUDI_API std::string getGaudiThreadIDfromName(const std::string &name)
helper function to extract Gaudi Thread ID from thread copy name
Definition: ThreadGaudi.cpp:26
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50
std::vector::reserve
T reserve(T...args)

StatusCode MinimalEventLoopMgr::executeEvent | ( | void * | par | ) |
| override

implementation of IEventProcessor::executeEvent(void* par)

Definition at line 395 of file MinimalEventLoopMgr.cpp.

396 {
397 bool eventfailed = false;
398
399 // reset state of ALL "known" algorithms
400 // (before we were reseting only the topalgs)
401 const EventContext& context = Gaudi::Hive::currentContext();
402 m_aess->reset(context);
403
404 // Set event number in the context
405 Gaudi::Hive::setCurrentContextEvt(m_nevt);
406
407 // select the appropriate store
408 if (m_WB.isValid())
409 m_WB->selectStore(context.slot()).ignore();
410
411 // Get the IProperty interface of the ApplicationMgr to pass it to RetCodeGuard
412 const auto appmgr = serviceLocator()->as<IProperty>();
413 // Call the execute() method of all top algorithms
414 for ( auto& ita : m_topAlgList ) {
415 StatusCode sc( StatusCode::FAILURE );
416 try {
417 if ( UNLIKELY( m_abortEvent ) ) {
418 DEBMSG << "AbortEvent incident fired by " << m_abortEventSource << endmsg;
419 m_abortEvent = false;
420 sc.ignore();
421 break;
422 }
423 RetCodeGuard rcg( appmgr, Gaudi::ReturnCode::UnhandledException );
424 sc = ita->sysExecute(context);
425 rcg.ignore(); // disarm the guard
426 } catch ( const GaudiException& Exception ) {
427 fatal() << ".executeEvent(): Exception with tag=" << Exception.tag() << " thrown by " << ita->name() << endmsg;
428 error() << Exception << endmsg;
429 } catch ( const std::exception& Exception ) {
430 fatal() << ".executeEvent(): Standard std::exception thrown by " << ita->name() << endmsg;
431 error() << Exception.what() << endmsg;
432 } catch ( ... ) {
433 fatal() << ".executeEvent(): UNKNOWN Exception thrown by " << ita->name() << endmsg;
434 }
435
436 AlgExecState& state = m_aess->algExecState(ita, context);
437 state.setExecuted(true);
438 state.setExecStatus(sc);
439
440 if ( UNLIKELY( !sc.isSuccess() ) ) {
441 warning() << "Execution of algorithm " << ita->name() << " failed" << endmsg;
442 eventfailed = true;
443 }
444 }
445
446 m_aess->updateEventStatus(eventfailed, context);
447
448 // ensure that the abortEvent flag is cleared before the next event
449 if ( UNLIKELY( m_abortEvent ) ) {
450 DEBMSG << "AbortEvent incident fired by " << m_abortEventSource << endmsg;
451 m_abortEvent = false;
452 }
453
454 // Call the execute() method of all output streams
455 for ( auto& ito : m_outStreamList ) {
456 AlgExecState& state = m_aess->algExecState(ito, context);
457 state.setExecuted(false);
458 state.setFilterPassed(true);
459 StatusCode sc;
460 sc = ito->sysExecute(context);
461 state.setExecStatus(sc);
462 if ( UNLIKELY( !sc.isSuccess() ) ) {
463 warning() << "Execution of output stream " << ito->name() << " failed" << endmsg;
464 eventfailed = true;
465 }
466 }
467
468 m_nevt++;
469
470 // Check if there was an error processing current event
471 if ( UNLIKELY( eventfailed ) ) {
472 error() << "Error processing event loop." << endmsg;
473 std::ostringstream ost;
474 m_aess->dump(ost, context);
475 debug() << "Dumping AlgExecStateSvc status:\n" << ost.str() << endmsg;
476 return StatusCode( StatusCode::FAILURE, true );
477 }
478
479 return StatusCode( StatusCode::SUCCESS, true );
480 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
RetCodeGuard
Helper class to set the application return code in case of early exit (e.g.
Definition: RetCodeGuard.h:9
StatusCode::FAILURE
Definition: StatusCode.h:29
compareRootHistos.state
state
Definition: compareRootHistos.py:348
EventContext::slot
ContextID_t slot() const
Definition: EventContext.h:41
MinimalEventLoopMgr::m_aess
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:49
IAlgExecStateSvc::dump
virtual void dump(std::ostringstream &ost, const EventContext &ctx) const =0
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
AlgExecState::setExecStatus
void setExecStatus(const StatusCode &sc=StatusCode::SUCCESS)
Definition: IAlgExecStateSvc.h:39
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
Gaudi::ReturnCode::UnhandledException
constexpr int UnhandledException
Definition: AppReturnCode.h:29
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
MinimalEventLoopMgr::m_abortEventSource
std::string m_abortEventSource
Source of the AbortEvent incident.
Definition: MinimalEventLoopMgr.h:63
IHiveWhiteBoard::selectStore
virtual StatusCode selectStore(size_t partitionIndex)=0
Activate an given &#39;slot&#39; for all subsequent calls within the same thread id.
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:120
MinimalEventLoopMgr::m_WB
SmartIF< IHiveWhiteBoard > m_WB
Definition: MinimalEventLoopMgr.h:120
std::exception::what
T what(T...args)
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::ostringstream
STL class.
IAlgExecStateSvc::algExecState
virtual const AlgExecState & algExecState(const Gaudi::StringKey &algName, const EventContext &ctx) const =0
Gaudi::Hive::currentContext
GAUDI_API const EventContext & currentContext()
Definition: ThreadLocalContext.cpp:24
std::ostringstream::str
T str(T...args)
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
AlgExecState::setExecuted
void setExecuted(bool e=true)
Definition: IAlgExecStateSvc.h:38
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:52
CommonMessagingBase::debug
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Definition: CommonMessaging.h:126
SmartIF::isValid
bool isValid() const
Allow for check if smart pointer is valid.
Definition: SmartIF.h:62
Gaudi::Hive::setCurrentContextEvt
GAUDI_API void setCurrentContextEvt(long int evtN)
Definition: ThreadLocalContext.cpp:28
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:50
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
AlgExecState::setFilterPassed
void setFilterPassed(bool f=true)
Definition: IAlgExecStateSvc.h:37
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
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50
MinimalEventLoopMgr::m_abortEvent
bool m_abortEvent
Flag signalling that the event being processedhas to be aborted (skip all following top algs)...
Definition: MinimalEventLoopMgr.h:61
MinimalEventLoopMgr::m_nevt
size_t m_nevt
Definition: MinimalEventLoopMgr.h:123

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

implementation of IEventProcessor::executeRun( )

Definition at line 338 of file MinimalEventLoopMgr.cpp.

339 {
340 StatusCode sc;
341 bool eventfailed = false;
342
343 // Call the beginRun() method of all top algorithms
344 for ( auto& ita : m_topAlgList ) {
345 sc = ita->sysBeginRun();
346 if ( !sc.isSuccess() ) {
347 warning() << "beginRun() of algorithm " << ita->name() << " failed" << endmsg;
348 eventfailed = true;
349 }
350 }
351
352 // Call now the nextEvent(...)
353 sc = nextEvent( maxevt );
354 if ( !sc.isSuccess() ) eventfailed = true;
355
356 // Call the endRun() method of all top algorithms
357 for ( auto& ita : m_topAlgList ) {
358 sc = ita->sysEndRun();
359 if ( !sc.isSuccess() ) {
360 warning() << "endRun() of algorithm " << ita->name() << " failed" << endmsg;
361 eventfailed = true;
362 }
363 }
364
365 return eventfailed ? StatusCode::FAILURE : StatusCode::SUCCESS;
366 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:120
MinimalEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
Definition: MinimalEventLoopMgr.cpp:329
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
maxevt
int maxevt
Definition: Bootstrap.cpp:279
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50

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

implementation of IService::finalize

Definition at line 278 of file MinimalEventLoopMgr.cpp.

279 {
280 StatusCode sc = StatusCode::SUCCESS;
281 StatusCode scRet = StatusCode::SUCCESS;
282 // Call the finalize() method of all top algorithms
283 for ( auto& ita : m_topAlgList ) {
284 sc = ita->sysFinalize();
285 if ( !sc.isSuccess() ) {
286 scRet = StatusCode::FAILURE;
287 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
288 }
289 }
290 // Call the finalize() method of all Output streams
291 for ( auto& ita : m_outStreamList ) {
292 sc = ita->sysFinalize();
293 if ( !sc.isSuccess() ) {
294 scRet = StatusCode::FAILURE;
295 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
296 }
297 }
298 // release all top algorithms
299 auto algMan = serviceLocator()->as<IAlgManager>();
300 for ( auto& ita : m_topAlgList ) {
301 if ( algMan->removeAlgorithm( ita ).isFailure() ) {
302 scRet = StatusCode::FAILURE;
303 warning() << "Problems removing Algorithm " << ita->name() << endmsg;
304 }
305 }
306 m_topAlgList.clear();
307 m_outStreamList.clear();
308 if ( sc.isSuccess() ) m_state = FINALIZED;
309
310 m_incidentSvc->removeListener( m_abortEventListener, IncidentType::AbortEvent );
311 m_abortEventListener.reset();
312
313 m_incidentSvc.reset();
314 m_appMgrUI.reset();
315
316 sc = Service::finalize();
317
318 if ( sc.isFailure() ) {
319 scRet = StatusCode::FAILURE;
320 error() << "Problems finalizing Service base class" << endmsg;
321 }
322
323 return scRet;
324 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:174
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
MinimalEventLoopMgr::FINALIZED
Definition: MinimalEventLoopMgr.h:43
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:54
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
MinimalEventLoopMgr::m_abortEventListener
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:58
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:120
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MsgStream::clear
void clear(STATE_TYPE _i=std::ios_base::failbit)
Definition: MsgStream.h:222
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:47
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:52
SmartIF::reset
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
Definition: SmartIF.h:88
IIncidentSvc::removeListener
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:45
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50

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

implementation of IService::initialize

Definition at line 66 of file MinimalEventLoopMgr.cpp.

67 {
68
69 if ( !m_appMgrUI ) return StatusCode::FAILURE;
70
71 StatusCode sc = Service::initialize();
72 if ( !sc.isSuccess() ) {
73 error() << "Failed to initialize Service Base class." << endmsg;
74 return StatusCode::FAILURE;
75 }
76
77 auto prpMgr = serviceLocator()->as<IProperty>();
78 if ( !prpMgr ) {
79 error() << "Error retrieving AppMgr interface IProperty." << endmsg;
80 return StatusCode::FAILURE;
81 }
82 if ( m_topAlgNames.value().empty() ) {
83 setProperty( prpMgr->getProperty( "TopAlg" ) ).ignore();
84 }
85 if ( m_outStreamNames.value().empty() ) {
86 setProperty( prpMgr->getProperty( "OutStream" ) ).ignore();
87 }
88
89 // Get the references to the services that are needed by the ApplicationMgr itself
90 m_incidentSvc = serviceLocator()->service( "IncidentSvc" );
91 if ( !m_incidentSvc ) {
92 fatal() << "Error retrieving IncidentSvc." << endmsg;
93 return StatusCode::FAILURE;
94 }
95
96 m_abortEventListener = new AbortEventListener( m_abortEvent, m_abortEventSource );
97 m_incidentSvc->addListener( m_abortEventListener, IncidentType::AbortEvent );
98
99 // The state is changed at this moment to allow decodeXXXX() to do something
100 m_state = INITIALIZED;
101
102 // Get WhiteBoard interface if implemented by EventDataSvc
103 m_WB = service( "EventDataSvc" );
104
105 // setup the default EventContext with slot 0
106 Gaudi::Hive::setCurrentContextId(Gaudi::Hive::ContextIdType(0));
107
108 //--------------------------------------------------------------------------------------------
109 // Create output streams. Do not initialize them yet.
110 // The state is updated temporarily in order to enable the handler, which
111 // is also triggered by a change to the "OutputStream" Property.
112 //--------------------------------------------------------------------------------------------
113 sc = decodeOutStreams();
114 if ( !sc.isSuccess() ) {
115 error() << "Failed to initialize Output streams." << endmsg;
116 m_state = CONFIGURED;
117 return sc;
118 }
119 //--------------------------------------------------------------------------------------------
120 // Create all needed Top Algorithms. Do not initialize them yet.
121 // The state is updated temporarily in order to enable the handler, which
122 // is also triggered by a change to the "TopAlg" Property.
123 //--------------------------------------------------------------------------------------------
124 sc = decodeTopAlgs();
125 if ( !sc.isSuccess() ) {
126 error() << "Failed to initialize Top Algorithms streams." << endmsg;
127 m_state = CONFIGURED;
128 return sc;
129 }
130
131 // Initialize all the new TopAlgs. In fact Algorithms are protected against
132 // getting initialized twice.
133 for ( auto& ita : m_topAlgList ) {
134 sc = ita->sysInitialize();
135 if ( !sc.isSuccess() ) {
136 error() << "Unable to initialize Algorithm: " << ita->name() << endmsg;
137 return sc;
138 }
139 }
140 for ( auto& ita : m_outStreamList ) {
141 sc = ita->sysInitialize();
142 if( !sc.isSuccess() ) {
143 error() << "Unable to initialize Output Stream: " << ita->name() << endmsg;
144 return sc;
145 }
146 }
147
148 // get hold of the Algorithm Execution State mgr
149 m_aess = serviceLocator()->service("AlgExecStateSvc");
150 if( !m_aess ) {
151 fatal() << "Error retrieving AlgExecStateSvc." << endmsg;
152 return StatusCode::FAILURE;
153 }
154
155 if (m_printCFExp && !m_topAlgList.empty()) {
156 info() << "Control Flow Expression:" << endmsg;
157 std::stringstream expr;
158 auto& first = m_topAlgList.front();
159 for(auto& ialg: m_topAlgList) {
160 if (ialg != first) expr << " >> ";
161 ialg->toControlFlowExpression(expr);
162 }
163 info() << expr.str() << endmsg;
164 }
165 return StatusCode::SUCCESS;
166 }
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:64
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::FAILURE
Definition: StatusCode.h:29
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:31
PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >::setProperty
StatusCode setProperty(const Gaudi::Details::PropertyBase &p) override
set the property form another property
Definition: PropertyHolder.h:210
CommonMessagingBase::info
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
Definition: CommonMessaging.h:123
MinimalEventLoopMgr::m_aess
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:49
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:43
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:43
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
MinimalEventLoopMgr::decodeTopAlgs
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Definition: MinimalEventLoopMgr.cpp:509
std::stringstream
STL class.
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:54
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:78
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
MinimalEventLoopMgr::m_abortEventSource
std::string m_abortEventSource
Source of the AbortEvent incident.
Definition: MinimalEventLoopMgr.h:63
MinimalEventLoopMgr::m_outStreamNames
Gaudi::Property< std::vector< std::string > > m_outStreamNames
Definition: MinimalEventLoopMgr.h:36
MinimalEventLoopMgr::m_abortEventListener
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:58
MinimalEventLoopMgr::m_topAlgNames
Gaudi::Property< std::vector< std::string > > m_topAlgNames
Definition: MinimalEventLoopMgr.h:35
MinimalEventLoopMgr::m_WB
SmartIF< IHiveWhiteBoard > m_WB
Definition: MinimalEventLoopMgr.h:120
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
std::stringstream::str
T str(T...args)
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:47
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:52
IIncidentSvc::addListener
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
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&#39;t already exist.
Definition: Service.h:85
MinimalEventLoopMgr::decodeOutStreams
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
Definition: MinimalEventLoopMgr.cpp:559
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:111
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:39
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:45
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50
MinimalEventLoopMgr::m_abortEvent
bool m_abortEvent
Flag signalling that the event being processedhas to be aborted (skip all following top algs)...
Definition: MinimalEventLoopMgr.h:61

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

implementation of IEventProcessor::nextEvent

Definition at line 329 of file MinimalEventLoopMgr.cpp.

330 {
331 error() << "This method cannot be called on an object of type " << System::typeinfoName( typeid( *this ) ) << endmsg;
332 return StatusCode::FAILURE;
333 }
StatusCode::FAILURE
Definition: StatusCode.h:29
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:299
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Fake assignment operator (never implemented).

Event data service (whiteboard)

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

Output stream List handler.

Definition at line 548 of file MinimalEventLoopMgr.cpp.

549 {
550 if ( !( decodeOutStreams() ).isSuccess() ) {
551 throw GaudiException( "Failed to initialize output streams.", "MinimalEventLoopMgr::outStreamHandler",
552 StatusCode::FAILURE );
553 }
554 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
MinimalEventLoopMgr::decodeOutStreams
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
Definition: MinimalEventLoopMgr.cpp:559

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

implementation of IService::reinitialize

Definition at line 225 of file MinimalEventLoopMgr.cpp.

226 {
227 StatusCode sc = StatusCode::SUCCESS;
228
229 // Reinitialize all the TopAlgs.
230 for ( auto& ita : m_topAlgList ) {
231 sc = ita->sysReinitialize();
232 if ( !sc.isSuccess() ) {
233 error() << "Unable to reinitialize Algorithm: " << ita->name() << endmsg;
234 return sc;
235 }
236 }
237 for ( auto& ita : m_outStreamList ) {
238 sc = ita->sysReinitialize();
239 if ( !sc.isSuccess() ) {
240 error() << "Unable to reinitialize Output Stream: " << ita->name() << endmsg;
241 return sc;
242 }
243 }
244
245 return sc;
246 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:52
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50

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

implementation of IService::restart

Definition at line 250 of file MinimalEventLoopMgr.cpp.

251 {
252 StatusCode sc = StatusCode::SUCCESS;
253
254 // Restart all the TopAlgs.
255 for ( auto& ita : m_topAlgList ) {
256 m_aess->resetErrorCount(ita);
257 sc = ita->sysRestart();
258 if ( !sc.isSuccess() ) {
259 error() << "Unable to restart Algorithm: " << ita->name() << endmsg;
260 return sc;
261 }
262 }
263 for ( auto& ita : m_outStreamList ) {
264 m_aess->resetErrorCount(ita);
265 sc = ita->sysRestart();
266 if ( !sc.isSuccess() ) {
267 error() << "Unable to restart Output Stream: " << ita->name() << endmsg;
268 return sc;
269 }
270 }
271
272 return sc;
273 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
MinimalEventLoopMgr::m_aess
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:49
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:52
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:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50

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

implementation of IService::start

Definition at line 170 of file MinimalEventLoopMgr.cpp.

171 {
172
173 StatusCode sc = Service::start();
174 if ( !sc.isSuccess() ) return sc;
175
176 // Start all the new TopAlgs. In fact Algorithms are protected against getting
177 // started twice.
178 for ( auto& ita : m_topAlgList ) {
179 sc = ita->sysStart();
180 if ( !sc.isSuccess() ) {
181 error() << "Unable to start Algorithm: " << ita->name() << endmsg;
182 return sc;
183 }
184 }
185 for ( auto& ita : m_outStreamList ) {
186 sc = ita->sysStart();
187 if ( !sc.isSuccess() ) {
188 error() << "Unable to start Output Stream: " << ita->name() << endmsg;
189 return sc;
190 }
191 }
192 return StatusCode::SUCCESS;
193 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
Service::start
StatusCode start() override
Definition: Service.cpp:137
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:74
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:52
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50

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

implementation of IService::stop

Definition at line 197 of file MinimalEventLoopMgr.cpp.

198 {
199
200 StatusCode sc( StatusCode::SUCCESS, true );
201
202 // Stop all the TopAlgs. In fact Algorithms are protected against getting
203 // stopped twice.
204 for ( auto& ita : m_topAlgList ) {
205 sc = ita->sysStop();
206 if ( !sc.isSuccess() ) {
207 error() << "Unable to stop Algorithm: " << ita->name() << endmsg;
208 return sc;
209 }
210 }
211 for ( auto& ita : m_outStreamList ) {
212 sc = ita->sysStop();
213 if ( !sc.isSuccess() ) {
214 error() << "Unable to stop Output Stream: " << ita->name() << endmsg;
215 return sc;
216 }
217 }
218
219 return Service::stop();
220 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Service::stop
StatusCode stop() override
Definition: Service.cpp:130
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:52
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
Definition: MinimalEventLoopMgr.h:50

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

implementation of IEventProcessor::stopRun( )

Definition at line 484 of file MinimalEventLoopMgr.cpp.

485 {
486 // Set the application return code
487 auto appmgr = serviceLocator()->as<IProperty>();
488 if ( Gaudi::setAppReturnCode( appmgr, Gaudi::ReturnCode::ScheduledStop ).isFailure() ) {
489 error() << "Could not set return code of the application (" << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg;
490 }
491 m_scheduledStop = true;
492 return StatusCode::SUCCESS;
493 }
StatusCode::SUCCESS
Definition: StatusCode.h:30
MinimalEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: MinimalEventLoopMgr.h:56
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:84
Gaudi::ReturnCode::ScheduledStop
constexpr int ScheduledStop
Definition: AppReturnCode.h:27
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:117
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:51
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:20
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:292
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

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

Top algorithm List handler.

Definition at line 498 of file MinimalEventLoopMgr.cpp.

499 {
500 if ( !( decodeTopAlgs() ).isSuccess() ) {
501 throw GaudiException( "Failed to initialize Top Algorithms streams.", "MinimalEventLoopMgr::topAlgHandler",
502 StatusCode::FAILURE );
503 }
504 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
StatusCode::FAILURE
Definition: StatusCode.h:29
MinimalEventLoopMgr::decodeTopAlgs
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Definition: MinimalEventLoopMgr.cpp:509

## Member Data Documentation

bool MinimalEventLoopMgr::m_abortEvent = false
| protected

Flag signalling that the event being processedhas to be aborted (skip all following top algs).

Definition at line 61 of file MinimalEventLoopMgr.h.

SmartIF<IIncidentListener> MinimalEventLoopMgr::m_abortEventListener
| protected

Instance of the incident listener waiting for AbortEvent.

Definition at line 58 of file MinimalEventLoopMgr.h.

std::string MinimalEventLoopMgr::m_abortEventSource
| protected

Source of the AbortEvent incident.

Definition at line 63 of file MinimalEventLoopMgr.h.

SmartIF<IAlgExecStateSvc> MinimalEventLoopMgr::m_aess
| protected

List of top level algorithms.

Definition at line 49 of file MinimalEventLoopMgr.h.

SmartIF<IAppMgrUI> MinimalEventLoopMgr::m_appMgrUI
| protected

Reference to the IAppMgrUI interface of the application manager.

Definition at line 45 of file MinimalEventLoopMgr.h.

SmartIF<IIncidentSvc> MinimalEventLoopMgr::m_incidentSvc
| protected

Reference to the incident service.

Definition at line 47 of file MinimalEventLoopMgr.h.

size_t MinimalEventLoopMgr::m_nevt {0}
| private

Definition at line 123 of file MinimalEventLoopMgr.h.

ListAlg MinimalEventLoopMgr::m_outStreamList
| protected

List of output streams.

Definition at line 52 of file MinimalEventLoopMgr.h.

Gaudi::Property<std::vector<std::string> > MinimalEventLoopMgr::m_outStreamNames {this, "OutStream", {}, "list of output stream names"}
| protected

Definition at line 36 of file MinimalEventLoopMgr.h.

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

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

Definition at line 37 of file MinimalEventLoopMgr.h.

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 39 of file MinimalEventLoopMgr.h.

bool MinimalEventLoopMgr::m_scheduledStop = false
| protected

Scheduled stop of event processing.

Definition at line 56 of file MinimalEventLoopMgr.h.

State MinimalEventLoopMgr::m_state = OFFLINE
| protected

State of the object.

Definition at line 54 of file MinimalEventLoopMgr.h.

ListAlg MinimalEventLoopMgr::m_topAlgList
| protected

Definition at line 50 of file MinimalEventLoopMgr.h.

Gaudi::Property<std::vector<std::string> > MinimalEventLoopMgr::m_topAlgNames {this, "TopAlg", {}, "list of top level algorithms names"}
| protected

Definition at line 35 of file MinimalEventLoopMgr.h.

SmartIF<IHiveWhiteBoard> MinimalEventLoopMgr::m_WB
| private

Definition at line 120 of file MinimalEventLoopMgr.h.

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

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