| The Gaudi Framework v27r1

- 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 | 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 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 () override=default
| Standard Destructor. 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 (Property &p)
| Top algorithm List handler. More...
StatusCode | decodeTopAlgs ()
| decodeTopAlgNameList & topAlgNameListHandler More...
void | outStreamHandler (Property &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...
StatusCode | setProperty (const Property &p) override
StatusCode | setProperty (const std::string &s) override
StatusCode | setProperty (const std::string &n, const std::string &v) override
StatusCode | getProperty (Property *p) const override
const Property & | getProperty (const std::string &name) const override
StatusCode | getProperty (const std::string &n, std::string &v) const override
const std::vector< Property * > & | getProperties () const override
bool | hasProperty (const std::string &name) const override
template<class TYPE >
StatusCode | setProperty (const std::string &name, const TYPE &value)
| set the property form the value 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 >
Property * | declareProperty (const std::string &name, T &property, const std::string &doc="none") const
| Declare the named property. More...
Property * | declareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="") const
| Declare remote named properties. 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 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
SmartIF< IAppMgrUI > | m_appMgrUI
| Reference to the IAppMgrUI interface of the application manager. More...
SmartIF< IIncidentSvc > | m_incidentSvc
| Reference to the incident service. More...
ListAlg | m_topAlgList
| List of top level algorithms. More...
ListAlg | m_outStreamList
| List of output streams. More...
std::string | m_outStreamType
| Out Stream type. More...
StringArrayProperty | m_topAlgNames
| List of top level algorithms names. More...
StringArrayProperty | m_outStreamNames
| List of output stream names. 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
IntegerProperty | m_outputLevel = MSG::NIL
| Service output level. More...
Gaudi::StateMachine::State | m_state = Gaudi::StateMachine::OFFLINE
| Service state. More...
Gaudi::StateMachine::State | m_targetState = Gaudi::StateMachine::OFFLINE
| Service state. More...

## Private Member Functions
| MinimalEventLoopMgr (const MinimalEventLoopMgr &)
| Fake copy constructor (never implemented). More...
MinimalEventLoopMgr & | operator= (const MinimalEventLoopMgr &)
| Fake assignment operator (never implemented). 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 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 25 of file MinimalEventLoopMgr.h.

## Member Typedef Documentation

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

Definition at line 29 of file MinimalEventLoopMgr.h.

## Member Enumeration Documentation

enum MinimalEventLoopMgr::State
| protected

Enumerator
OFFLINE |
CONFIGURED |
FINALIZED |
INITIALIZED |

Definition at line 33 of file MinimalEventLoopMgr.h.

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

## Constructor & Destructor Documentation

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

Standard Constructor.

Definition at line 52 of file MinimalEventLoopMgr.cpp.

53 : base_class(nam, svcLoc), m_appMgrUI(svcLoc)
54 {
55 declareProperty("TopAlg", m_topAlgNames );
56 declareProperty("OutStream", m_outStreamNames );
57 declareProperty("OutStreamType", m_outStreamType = "OutputStream");
58 m_topAlgNames.declareUpdateHandler ( &MinimalEventLoopMgr::topAlgHandler, this );
59 m_outStreamNames.declareUpdateHandler( &MinimalEventLoopMgr::outStreamHandler, this );
60 }
Property::declareUpdateHandler
virtual Property & declareUpdateHandler(std::function< void(Property &)> fun)
set new callback for update
Definition: Property.cpp:72
MinimalEventLoopMgr::outStreamHandler
void outStreamHandler(Property &p)
Output stream List handler.
Definition: MinimalEventLoopMgr.cpp:498
extends< Service, IEventProcessor >::base_class
extends base_class
Typedef to this class.
Definition: extends.h:14
MinimalEventLoopMgr::topAlgHandler
void topAlgHandler(Property &p)
Top algorithm List handler.
Definition: MinimalEventLoopMgr.cpp:448
MinimalEventLoopMgr::m_outStreamType
std::string m_outStreamType
Out Stream type.
Definition: MinimalEventLoopMgr.h:43
MinimalEventLoopMgr::m_topAlgNames
StringArrayProperty m_topAlgNames
List of top level algorithms names.
Definition: MinimalEventLoopMgr.h:45
Service::declareProperty
Property * declareProperty(const std::string &name, T &property, const std::string &doc="none") const
Declare the named property.
Definition: Service.h:215
MinimalEventLoopMgr::m_outStreamNames
StringArrayProperty m_outStreamNames
List of output stream names.
Definition: MinimalEventLoopMgr.h:47
MinimalEventLoopMgr::m_appMgrUI
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
Definition: MinimalEventLoopMgr.h:35

MinimalEventLoopMgr::~MinimalEventLoopMgr | ( |  | ) |
| override default

Standard Destructor.

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

Fake copy constructor (never implemented).

## Member Function Documentation

StatusCode MinimalEventLoopMgr::decodeOutStreams | ( |  | ) |

decodeOutStreamNameList & outStreamNameListHandler

Definition at line 509 of file MinimalEventLoopMgr.cpp.

509 {
510 StatusCode sc = StatusCode::SUCCESS;
511 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
512 auto algMan = serviceLocator()->as<IAlgManager>();
513 if ( algMan ) {
514 // Reset the existing Top Algorithm List
515 m_outStreamList.clear();
516 for (const auto& it : m_outStreamNames.value( ) ) {
517 Gaudi::Utils::TypeNameString item(it, m_outStreamType);
518 DEBMSG << "Creating " << m_outStreamType << it << endmsg;
519 const bool CREATE = false;
520 SmartIF<IAlgorithm> os = algMan->algorithm( item, CREATE );
521 if (os) {
522 DEBMSG << "Output Stream " << item.name() << " already exists" << endmsg;
523 } else {
524 DEBMSG << "Creating Output Stream " << it << endmsg;
525 IAlgorithm* ios = nullptr;
526 StatusCode sc1 = algMan->createAlgorithm( item.type(), item.name(), ios );
527 if( !sc1.isSuccess() ) {
528 error() << "Unable to create Output Stream " << it << endmsg;
529 return sc1;
530 }
531 os = ios; // manage reference counting
532 }
533 m_outStreamList.push_back( os );
534 }
535 return sc;
536 }
537 sc = StatusCode::FAILURE;
538 }
539 return sc;
540 }
SmartIF< IAlgorithm >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:33
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:33
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
merge_files.sc
int sc
Definition: merge_files.py:167
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:49
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:25
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:41
Io::CREATE
Definition: IFileMgr.h:30
ana.item
tuple item
print s1,s2
Definition: ana.py:146
MinimalEventLoopMgr::m_outStreamType
std::string m_outStreamType
Out Stream type.
Definition: MinimalEventLoopMgr.h:43
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:46
MinimalEventLoopMgr::m_outStreamNames
StringArrayProperty m_outStreamNames
List of output stream names.
Definition: MinimalEventLoopMgr.h:47
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 459 of file MinimalEventLoopMgr.cpp.

459 {
460 StatusCode sc = StatusCode::SUCCESS;
461 if ( CONFIGURED == m_state || INITIALIZED == m_state ) {
462 auto algMan = serviceLocator()->as<IAlgManager>();
463 if ( algMan ) {
464 // Reset the existing Top Algorithm List
465 m_topAlgList.clear( );
466 m_topAlgList.reserve( m_topAlgNames.value().size() );
467 for (const auto& it : m_topAlgNames.value( )) {
468 Gaudi::Utils::TypeNameString item{it};
469 // Got the type and name. Now creating the algorithm, avoiding duplicate creation.
470 std::string item_name = item.name() + getGaudiThreadIDfromName(name());
471 const bool CREATE = false;
472 SmartIF<IAlgorithm> alg = algMan->algorithm(item_name, CREATE);
473 if (alg) {
474 DEBMSG << "Top Algorithm " << item_name << " already exists" << endmsg;
475 }
476 else {
477 DEBMSG << "Creating Top Algorithm " << item.type() << " with name " << item_name << endmsg;
478 IAlgorithm *ialg = nullptr;
479 StatusCode sc1 = algMan->createAlgorithm(item.type(), item_name, ialg);
480 if( !sc1.isSuccess() ) {
481 error() << "Unable to create Top Algorithm " << item.type() << " with name " << item_name << endmsg;
482 return sc1;
483 }
484 alg = ialg; // manage reference counting
485 }
486 m_topAlgList.push_back(alg);
487 }
488 return sc;
489 }
490 sc = StatusCode::FAILURE;
491 }
492 return sc;
493 }
SmartIF< IAlgorithm >
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:33
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:33
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
merge_files.sc
int sc
Definition: merge_files.py:167
std::string
STL class.
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:49
Service::name
const std::string & name() const override
Retrieve name of the service.
Definition: Service.cpp:319
std::vector::push_back
T push_back(T...args)
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
Gaudi::Utils::TypeNameString
Helper class to parse a string of format "type/name".
Definition: TypeNameString.h:9
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:25
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
std::vector::size
T size(T...args)
Io::CREATE
Definition: IFileMgr.h:30
ana.item
tuple item
print s1,s2
Definition: ana.py:146
MinimalEventLoopMgr::m_topAlgNames
StringArrayProperty m_topAlgNames
List of top level algorithms names.
Definition: MinimalEventLoopMgr.h:45
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:46
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
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
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39
std::vector::reserve
T reserve(T...args)

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

implementation of IEventProcessor::executeEvent(void* par)

Definition at line 358 of file MinimalEventLoopMgr.cpp.

358 {
359 bool eventfailed = false;
360
361 // Call the resetExecuted() method of ALL "known" algorithms
362 // (before we were reseting only the topalgs)
363 auto algMan = serviceLocator()->as<IAlgManager>();
364 if (LIKELY(algMan.isValid())) {
365 const auto& allAlgs = algMan->getAlgorithms();
366 std::for_each( std::begin(allAlgs), std::end(allAlgs),
367 [](IAlgorithm* alg) {
368 if (LIKELY(alg!=nullptr)) alg->resetExecuted();
369 } );
370 }
371
372 // Get the IProperty interface of the ApplicationMgr to pass it to RetCodeGuard
373 const auto appmgr = serviceLocator()->as<IProperty>();
374 // Call the execute() method of all top algorithms
375 for (auto& ita : m_topAlgList ) {
376 StatusCode sc(StatusCode::FAILURE);
377 try {
378 if (UNLIKELY(m_abortEvent)) {
379 DEBMSG << "AbortEvent incident fired by "
380 << m_abortEventSource << endmsg;
381 m_abortEvent = false;
382 sc.ignore();
383 break;
384 }
385 RetCodeGuard rcg(appmgr, Gaudi::ReturnCode::UnhandledException);
386 sc = ita->sysExecute();
387 rcg.ignore(); // disarm the guard
388 } catch ( const GaudiException& Exception ) {
389 fatal() << ".executeEvent(): Exception with tag=" << Exception.tag()
390 << " thrown by " << ita->name() << endmsg;
391 error() << Exception << endmsg;
392 } catch ( const std::exception& Exception ) {
393 fatal() << ".executeEvent(): Standard std::exception thrown by "
394 << ita->name() << endmsg;
395 error() << Exception.what() << endmsg;
396 } catch(...) {
397 fatal() << ".executeEvent(): UNKNOWN Exception thrown by "
398 << ita->name() << endmsg;
399 }
400
401 if (UNLIKELY(!sc.isSuccess())) {
402 warning() << "Execution of algorithm " << ita->name() << " failed" << endmsg;
403 eventfailed = true;
404 }
405 }
406
407 // ensure that the abortEvent flag is cleared before the next event
408 if (UNLIKELY(m_abortEvent)) {
409 DEBMSG << "AbortEvent incident fired by " << m_abortEventSource << endmsg;
410 m_abortEvent = false;
411 }
412
413 // Call the execute() method of all output streams
414 for (auto& ito : m_outStreamList) {
415 ito->resetExecuted();
416 StatusCode sc;
417 sc = ito->sysExecute();
418 if (UNLIKELY(!sc.isSuccess())) {
419 warning() << "Execution of output stream " << ito->name() << " failed" << endmsg;
420 eventfailed = true;
421 }
422 }
423
424 // Check if there was an error processing current event
425 if (UNLIKELY(eventfailed)){
426 error() << "Error processing event loop." << endmsg;
427 return StatusCode(StatusCode::FAILURE,true);
428 }
429 return StatusCode(StatusCode::SUCCESS,true);
430 }
UNLIKELY
#define UNLIKELY(x)
Definition: Kernel.h:126
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
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::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
IAlgManager
The IAlgManager is the interface implemented by the Algorithm Factory in the Application Manager to s...
Definition: IAlgManager.h:27
std::end
T end(T...args)
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
IAlgManager::getAlgorithms
virtual const std::vector< IAlgorithm * > & getAlgorithms() const =0
Return the list of Algorithms.
IAlgorithm::resetExecuted
virtual void resetExecuted()=0
Reset the Algorithm executed state for the current event.
merge_files.sc
int sc
Definition: merge_files.py:167
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:118
MinimalEventLoopMgr::m_abortEventSource
std::string m_abortEventSource
Source of the AbortEvent incident.
Definition: MinimalEventLoopMgr.h:58
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode::FAILURE
Definition: StatusCode.h:29
std::exception::what
T what(T...args)
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
GaudiException::tag
virtual const std::string & tag() const
name tag for the exception, or exception type
Definition: GaudiException.h:119
std::exception
STL class.
IAlgorithm
The IAlgorithm is the interface implemented by the Algorithm base class.
Definition: IAlgorithm.h:25
LIKELY
#define LIKELY(x)
Definition: Kernel.h:125
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:41
std::begin
T begin(T...args)
DEBMSG
#define DEBMSG
Definition: MinimalEventLoopMgr.cpp:46
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
std::for_each
T for_each(T...args)
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
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39
MinimalEventLoopMgr::m_abortEvent
bool m_abortEvent
Flag signalling that the event being processedhas to be aborted (skip all following top algs)...
Definition: MinimalEventLoopMgr.h:56

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

implementation of IEventProcessor::executeRun( )

Definition at line 306 of file MinimalEventLoopMgr.cpp.

306 {
307 StatusCode sc;
308 bool eventfailed = false;
309
310 // Call the beginRun() method of all top algorithms
311 for (auto& ita : m_topAlgList ) {
312 sc = ita->sysBeginRun();
313 if (!sc.isSuccess()) {
314 warning() << "beginRun() of algorithm " << ita->name() << " failed" << endmsg;
315 eventfailed = true;
316 }
317 }
318
319 // Call now the nextEvent(...)
320 sc = nextEvent(maxevt);
321 if (!sc.isSuccess()) eventfailed = true;
322
323 // Call the endRun() method of all top algorithms
324 for (auto& ita : m_topAlgList) {
325 sc = ita->sysEndRun();
326 if (!sc.isSuccess()) {
327 warning() << "endRun() of algorithm " << ita->name() << " failed" << endmsg;
328 eventfailed = true;
329 }
330 }
331
332 return eventfailed ? StatusCode::FAILURE : StatusCode::SUCCESS;
333 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode::FAILURE
Definition: StatusCode.h:29
MinimalEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
Definition: MinimalEventLoopMgr.cpp:297
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
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
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39

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

implementation of IService::finalize

Definition at line 247 of file MinimalEventLoopMgr.cpp.

247 {
248 StatusCode sc = StatusCode::SUCCESS;
249 StatusCode scRet = StatusCode::SUCCESS;
250 // Call the finalize() method of all top algorithms
251 for (auto& ita : m_topAlgList ) {
252 sc = ita->sysFinalize();
253 if( !sc.isSuccess() ) {
254 scRet = StatusCode::FAILURE;
255 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
256 }
257 }
258 // Call the finalize() method of all Output streams
259 for (auto &ita : m_outStreamList) {
260 sc = ita->sysFinalize();
261 if( !sc.isSuccess() ) {
262 scRet = StatusCode::FAILURE;
263 warning() << "Finalization of algorithm " << ita->name() << " failed" << endmsg;
264 }
265 }
266 // release all top algorithms
267 auto algMan = serviceLocator()->as<IAlgManager>();
268 for (auto &ita : m_topAlgList ) {
269 if (algMan->removeAlgorithm(ita).isFailure()) {
270 scRet = StatusCode::FAILURE;
271 warning() << "Problems removing Algorithm " << ita->name() << endmsg;
272 }
273 }
274 m_topAlgList.clear();
275 m_outStreamList.clear();
276 if ( sc.isSuccess() ) m_state = FINALIZED;
277
278 m_incidentSvc->removeListener(m_abortEventListener, IncidentType::AbortEvent);
279 m_abortEventListener.reset();
280
281 m_incidentSvc.reset();
282 m_appMgrUI.reset();
283
284 sc = Service::finalize();
285
286 if (sc.isFailure()) {
287 scRet = StatusCode::FAILURE;
288 error() << "Problems finalizing Service base class" << endmsg;
289 }
290
291 return scRet;
292 }
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
Service::finalize
StatusCode finalize() override
Definition: Service.cpp:193
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
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:33
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
merge_files.sc
int sc
Definition: merge_files.py:167
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:49
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
MinimalEventLoopMgr::m_abortEventListener
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:53
CommonMessagingBase::warning
MsgStream & warning() const
shortcut for the method msgStream(MSG::WARNING)
Definition: CommonMessaging.h:121
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:37
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:41
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.
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:35
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39

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

implementation of IService::initialize

Definition at line 65 of file MinimalEventLoopMgr.cpp.

65 {
66
67 if ( !m_appMgrUI ) return StatusCode::FAILURE;
68
69 StatusCode sc = Service::initialize();
70 if ( !sc.isSuccess() ) {
71 error() << "Failed to initialize Service Base class." << endmsg;
72 return StatusCode::FAILURE;
73 }
74
75 auto prpMgr = serviceLocator()->as<IProperty>();
76 if ( !prpMgr ) {
77 error() << "Error retrieving AppMgr interface IProperty." << endmsg;
78 return StatusCode::FAILURE;
79 }
80 if ( m_topAlgNames.value().empty() ) {
81 setProperty(prpMgr->getProperty("TopAlg")).ignore();
82 }
83 if ( m_outStreamNames.value().empty() ) {
84 setProperty(prpMgr->getProperty("OutStream")).ignore();
85 }
86
87 // Get the references to the services that are needed by the ApplicationMgr itself
88 m_incidentSvc = serviceLocator()->service("IncidentSvc");
89 if( !m_incidentSvc ) {
90 fatal() << "Error retrieving IncidentSvc." << endmsg;
91 return StatusCode::FAILURE;
92 }
93
94 m_abortEventListener = new AbortEventListener(m_abortEvent,m_abortEventSource);
95 m_incidentSvc->addListener(m_abortEventListener,IncidentType::AbortEvent);
96
97 // The state is changed at this moment to allow decodeXXXX() to do something
98 m_state = INITIALIZED;
99
100 //--------------------------------------------------------------------------------------------
101 // Create output streams. Do not initialize them yet.
102 // The state is updated temporarily in order to enable the handler, which
103 // is also triggered by a change to the "OutputStream" Property.
104 //--------------------------------------------------------------------------------------------
105 sc = decodeOutStreams();
106 if ( !sc.isSuccess() ) {
107 error() << "Failed to initialize Output streams." << endmsg;
108 m_state = CONFIGURED;
109 return sc;
110 }
111 //--------------------------------------------------------------------------------------------
112 // Create all needed Top Algorithms. Do not initialize them yet.
113 // The state is updated temporarily in order to enable the handler, which
114 // is also triggered by a change to the "TopAlg" Property.
115 //--------------------------------------------------------------------------------------------
116 sc = decodeTopAlgs();
117 if ( !sc.isSuccess() ) {
118 error() << "Failed to initialize Top Algorithms streams." << endmsg;
119 m_state = CONFIGURED;
120 return sc;
121 }
122
123 // Initialize all the new TopAlgs. In fact Algorithms are protected against getting
124 // initialized twice.
125 for (auto& ita : m_topAlgList ) {
126 sc = ita->sysInitialize();
127 if( !sc.isSuccess() ) {
128 error() << "Unable to initialize Algorithm: " << ita->name() << endmsg;
129 return sc;
130 }
131 }
132 for (auto& ita : m_outStreamList ) {
133 sc = ita->sysInitialize();
134 if( !sc.isSuccess() ) {
135 error() << "Unable to initialize Output Stream: " << ita->name() << endmsg;
136 return sc;
137 }
138 }
139
140 return StatusCode::SUCCESS;
141 }
Service::initialize
StatusCode initialize() override
Definition: Service.cpp:68
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
std::vector::empty
T empty(T...args)
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
MinimalEventLoopMgr::INITIALIZED
Definition: MinimalEventLoopMgr.h:33
Service::setProperty
StatusCode setProperty(const Property &p) override
Definition: Service.cpp:330
MinimalEventLoopMgr::CONFIGURED
Definition: MinimalEventLoopMgr.h:33
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
MinimalEventLoopMgr::decodeTopAlgs
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Definition: MinimalEventLoopMgr.cpp:459
merge_files.sc
int sc
Definition: merge_files.py:167
MinimalEventLoopMgr::m_state
State m_state
State of the object.
Definition: MinimalEventLoopMgr.h:49
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:118
MinimalEventLoopMgr::m_abortEventSource
std::string m_abortEventSource
Source of the AbortEvent incident.
Definition: MinimalEventLoopMgr.h:58
MinimalEventLoopMgr::m_abortEventListener
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: MinimalEventLoopMgr.h:53
StatusCode::FAILURE
Definition: StatusCode.h:29
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
MinimalEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: MinimalEventLoopMgr.h:37
PropertyWithValue::value
const TYPE & value() const
explicit conversion
Definition: Property.h:341
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:41
IIncidentSvc::addListener
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
MinimalEventLoopMgr::m_topAlgNames
StringArrayProperty m_topAlgNames
List of top level algorithms names.
Definition: MinimalEventLoopMgr.h:45
MinimalEventLoopMgr::decodeOutStreams
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
Definition: MinimalEventLoopMgr.cpp:509
CommonMessagingBase::fatal
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
Definition: CommonMessaging.h:112
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
MinimalEventLoopMgr::m_outStreamNames
StringArrayProperty m_outStreamNames
List of output stream names.
Definition: MinimalEventLoopMgr.h:47
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:35
MinimalEventLoopMgr::m_topAlgList
ListAlg m_topAlgList
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39
MinimalEventLoopMgr::m_abortEvent
bool m_abortEvent
Flag signalling that the event being processedhas to be aborted (skip all following top algs)...
Definition: MinimalEventLoopMgr.h:56

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

implementation of IEventProcessor::nextEvent

Definition at line 297 of file MinimalEventLoopMgr.cpp.

297 {
298 error() << "This method cannot be called on an object of type "
299 << System::typeinfoName(typeid(*this)) << endmsg;
300 return StatusCode::FAILURE;
301 }
System::typeinfoName
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
Definition: System.cpp:297
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::FAILURE
Definition: StatusCode.h:29
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).

void MinimalEventLoopMgr::outStreamHandler | ( | Property & | p | ) |

Output stream List handler.

Definition at line 498 of file MinimalEventLoopMgr.cpp.

498 {
499 if ( !(decodeOutStreams( )).isSuccess() ) {
500 throw GaudiException("Failed to initialize output streams.",
501 "MinimalEventLoopMgr::outStreamHandler",
502 StatusCode::FAILURE);
503 }
504 }
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:509

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

implementation of IService::reinitialize

Definition at line 198 of file MinimalEventLoopMgr.cpp.

198 {
199 StatusCode sc = StatusCode::SUCCESS;
200
201 // Reinitialize all the TopAlgs.
202 for (auto& ita : m_topAlgList) {
203 sc = ita->sysReinitialize();
204 if( !sc.isSuccess() ) {
205 error() << "Unable to reinitialize Algorithm: " << ita->name() << endmsg;
206 return sc;
207 }
208 }
209 for (auto &ita : m_outStreamList ) {
210 sc = ita->sysReinitialize();
211 if( !sc.isSuccess() ) {
212 error() << "Unable to reinitialize Output Stream: " << ita->name() << endmsg;
213 return sc;
214 }
215 }
216
217 return sc;
218 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:41
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
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39

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

implementation of IService::restart

Definition at line 222 of file MinimalEventLoopMgr.cpp.

222 {
223 StatusCode sc = StatusCode::SUCCESS;
224
225 // Restart all the TopAlgs.
226 for (auto& ita : m_topAlgList ) {
227 sc = ita->sysRestart();
228 if( !sc.isSuccess() ) {
229 error() << "Unable to restart Algorithm: " << ita->name() << endmsg;
230 return sc;
231 }
232 }
233 for (auto& ita : m_outStreamList ) {
234 sc = ita->sysRestart();
235 if( !sc.isSuccess() ) {
236 error() << "Unable to restart Output Stream: " << ita->name() << endmsg;
237 return sc;
238 }
239 }
240
241 return sc;
242 }
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:41
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
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39

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

implementation of IService::start

Definition at line 145 of file MinimalEventLoopMgr.cpp.

145 {
146
147 StatusCode sc = Service::start();
148 if ( ! sc.isSuccess() ) return sc;
149
150 // Start all the new TopAlgs. In fact Algorithms are protected against getting
151 // started twice.
152 for (auto& ita : m_topAlgList) {
153 sc = ita->sysStart();
154 if( !sc.isSuccess() ) {
155 error() << "Unable to start Algorithm: " << ita->name() << endmsg;
156 return sc;
157 }
158 }
159 for (auto& ita : m_outStreamList ) {
160 sc = ita->sysStart();
161 if( !sc.isSuccess() ) {
162 error() << "Unable to start Output Stream: " << ita->name() << endmsg;
163 return sc;
164 }
165 }
166 return StatusCode::SUCCESS;
167 }
Service::start
StatusCode start() override
Definition: Service.cpp:152
StatusCode::isSuccess
bool isSuccess() const
Test for a status code of SUCCESS.
Definition: StatusCode.h:76
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::SUCCESS
Definition: StatusCode.h:30
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:41
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
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39

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

implementation of IService::stop

Definition at line 171 of file MinimalEventLoopMgr.cpp.

171 {
172
173 StatusCode sc(StatusCode::SUCCESS,true);
174
175 // Stop all the TopAlgs. In fact Algorithms are protected against getting
176 // stopped twice.
177 for (auto & ita : m_topAlgList ) {
178 sc = ita->sysStop();
179 if( !sc.isSuccess() ) {
180 error() << "Unable to stop Algorithm: " << ita->name() << endmsg;
181 return sc;
182 }
183 }
184 for (auto &ita : m_outStreamList ) {
185 sc = ita->sysStop();
186 if( !sc.isSuccess() ) {
187 error() << "Unable to stop Output Stream: " << ita->name() << endmsg;
188 return sc;
189 }
190 }
191
192 return Service::stop();
193 }
merge_files.sc
int sc
Definition: merge_files.py:167
CommonMessagingBase::error
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Definition: CommonMessaging.h:118
StatusCode::SUCCESS
Definition: StatusCode.h:30
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:26
Service::stop
StatusCode stop() override
Definition: Service.cpp:146
MinimalEventLoopMgr::m_outStreamList
ListAlg m_outStreamList
List of output streams.
Definition: MinimalEventLoopMgr.h:41
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
List of top level algorithms.
Definition: MinimalEventLoopMgr.h:39

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

implementation of IEventProcessor::stopRun( )

Definition at line 434 of file MinimalEventLoopMgr.cpp.

434 {
435 // Set the application return code
436 auto appmgr = serviceLocator()->as<IProperty>();
437 if(Gaudi::setAppReturnCode(appmgr, Gaudi::ReturnCode::ScheduledStop).isFailure()) {
438 error() << "Could not set return code of the application ("
439 << Gaudi::ReturnCode::ScheduledStop << ")" << endmsg;
440 }
441 m_scheduledStop = true;
442 return StatusCode::SUCCESS;
443 }
Service::serviceLocator
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition: Service.cpp:324
MinimalEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: MinimalEventLoopMgr.h:51
ISvcLocator::as
SmartIF< IFace > as()
Definition: ISvcLocator.h:106
StatusCode::isFailure
bool isFailure() const
Test for a status code of FAILURE.
Definition: StatusCode.h:86
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:118
StatusCode::SUCCESS
Definition: StatusCode.h:30
Gaudi::setAppReturnCode
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.
Definition: AppReturnCode.h:50
IProperty
The IProperty is the basic interface for all components which have properties that can be set or get...
Definition: IProperty.h:21
endmsg
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition: MsgStream.h:244

void MinimalEventLoopMgr::topAlgHandler | ( | Property & | p | ) |

Top algorithm List handler.

Definition at line 448 of file MinimalEventLoopMgr.cpp.

448 {
449 if ( !(decodeTopAlgs( )).isSuccess() ) {
450 throw GaudiException("Failed to initialize Top Algorithms streams.",
451 "MinimalEventLoopMgr::topAlgHandler",
452 StatusCode::FAILURE);
453 }
454 }
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:23
MinimalEventLoopMgr::decodeTopAlgs
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Definition: MinimalEventLoopMgr.cpp:459
StatusCode::FAILURE
Definition: StatusCode.h:29

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

SmartIF<IIncidentListener> MinimalEventLoopMgr::m_abortEventListener
| protected

Instance of the incident listener waiting for AbortEvent.

Definition at line 53 of file MinimalEventLoopMgr.h.

std::string MinimalEventLoopMgr::m_abortEventSource
| protected

Source of the AbortEvent incident.

Definition at line 58 of file MinimalEventLoopMgr.h.

SmartIF<IAppMgrUI> MinimalEventLoopMgr::m_appMgrUI
| protected

Reference to the IAppMgrUI interface of the application manager.

Definition at line 35 of file MinimalEventLoopMgr.h.

SmartIF<IIncidentSvc> MinimalEventLoopMgr::m_incidentSvc
| protected

Reference to the incident service.

Definition at line 37 of file MinimalEventLoopMgr.h.

ListAlg MinimalEventLoopMgr::m_outStreamList
| protected

List of output streams.

Definition at line 41 of file MinimalEventLoopMgr.h.

StringArrayProperty MinimalEventLoopMgr::m_outStreamNames
| protected

List of output stream names.

Definition at line 47 of file MinimalEventLoopMgr.h.

std::string MinimalEventLoopMgr::m_outStreamType
| protected

Out Stream type.

Definition at line 43 of file MinimalEventLoopMgr.h.

bool MinimalEventLoopMgr::m_scheduledStop = false
| protected

Scheduled stop of event processing.

Definition at line 51 of file MinimalEventLoopMgr.h.

State MinimalEventLoopMgr::m_state = OFFLINE
| protected

State of the object.

Definition at line 49 of file MinimalEventLoopMgr.h.

ListAlg MinimalEventLoopMgr::m_topAlgList
| protected

List of top level algorithms.

Definition at line 39 of file MinimalEventLoopMgr.h.

StringArrayProperty MinimalEventLoopMgr::m_topAlgNames
| protected

List of top level algorithms names.

Definition at line 45 of file MinimalEventLoopMgr.h.

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

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