The Gaudi Framework  master (b9786168)
Loading...
Searching...
No Matches
MinimalEventLoopMgr.h
Go to the documentation of this file.
1/***********************************************************************************\
2* (c) Copyright 1998-2025 CERN for the benefit of the LHCb and ATLAS collaborations *
3* *
4* This software is distributed under the terms of the Apache version 2 licence, *
5* copied verbatim in the file "LICENSE". *
6* *
7* In applying this licence, CERN does not waive the privileges and immunities *
8* granted to it by virtue of its status as an Intergovernmental Organization *
9* or submit itself to any jurisdiction. *
10\***********************************************************************************/
11#pragma once
12
21#include <GaudiKernel/Service.h>
22#include <vector>
23
33class GAUDI_API MinimalEventLoopMgr : public extends<Service, IEventProcessor> {
34private:
35 class AbortEventListener : public implements<IIncidentListener> {
36 public:
38 void handle( const Incident& i ) override {
39 if ( i.type() == IncidentType::AbortEvent ) {
40 abortEvent = true;
42 }
43 }
44
45 public:
48 bool abortEvent = false;
50 std::string abortEventSource;
51 };
52
53public:
54 typedef std::vector<SmartIF<IAlgorithm>> ListAlg;
55
56protected:
57 // Properties
59 this, "TopAlg", {}, &MinimalEventLoopMgr::topAlgHandler, "list of top level algorithms names" };
61 this, "OutStream", {}, &MinimalEventLoopMgr::outStreamHandler, "list of output stream names" };
62 Gaudi::Property<bool> m_printCFExp{ this, "PrintControlFlowExpression", false,
63 "Print the control flow expression representing the content of TopAlg" };
64
65 // enums
79 bool m_scheduledStop = false;
82
83public:
85 MinimalEventLoopMgr( const std::string& nam, ISvcLocator* svcLoc );
90
92 StatusCode initialize() override;
94 StatusCode start() override;
96 StatusCode stop() override;
98 StatusCode finalize() override;
100 StatusCode reinitialize() override;
102 StatusCode restart() override;
106 StatusCode nextEvent( int maxevt ) override;
108 StatusCode executeEvent( EventContext&& ctx ) override;
110 StatusCode executeRun( int maxevt ) override;
112 StatusCode stopRun() override;
113
122
123protected:
126
127 // number of events processed
128 size_t m_nevt{ 0 };
129};
#define GAUDI_API
Definition Kernel.h:49
This class represents an entry point to all the event specific data.
PropertyBase base class allowing PropertyBase* collections to be "homogeneous".
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
Definition ISvcLocator.h:42
Base class for all Incidents (computing events).
Definition Incident.h:24
const std::string & type() const
Access to the incident type.
Definition Incident.h:43
const std::string & source() const
Access to the source of the incident.
Definition Incident.h:49
bool abortEvent
Flag signalling that the event being processed has to be aborted (skip all following top algs).
void handle(const Incident &i) override
Inform that a new incident has occurred.
std::string abortEventSource
Source of the AbortEvent incident.
StatusCode stop() override
implementation of IService::stop
Gaudi::Property< std::vector< std::string > > m_outStreamNames
StatusCode restart() override
implementation of IService::restart
StatusCode nextEvent(int maxevt) override
implementation of IEventProcessor::nextEvent
MinimalEventLoopMgr & operator=(const MinimalEventLoopMgr &)=delete
No copy allowed.
StatusCode start() override
implementation of IService::start
void outStreamHandler(Gaudi::Details::PropertyBase &p)
Output stream List handler.
Gaudi::Property< bool > m_printCFExp
StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun( )
bool m_scheduledStop
Scheduled stop of event processing.
MinimalEventLoopMgr(const std::string &nam, ISvcLocator *svcLoc)
Standard Constructor.
ListAlg m_outStreamList
List of output streams.
StatusCode decodeTopAlgs()
decodeTopAlgNameList & topAlgNameListHandler
Gaudi::Property< std::vector< std::string > > m_topAlgNames
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
SmartIF< IAppMgrUI > m_appMgrUI
Reference to the IAppMgrUI interface of the application manager.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
StatusCode finalize() override
implementation of IService::finalize
void topAlgHandler(Gaudi::Details::PropertyBase &p)
Top algorithm List handler.
StatusCode decodeOutStreams()
decodeOutStreamNameList & outStreamNameListHandler
AbortEventListener m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
std::vector< SmartIF< IAlgorithm > > ListAlg
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
SmartIF< IAlgExecStateSvc > m_aess
List of top level algorithms.
StatusCode initialize() override
implementation of IService::initialize
StatusCode reinitialize() override
implementation of IService::reinitialize
SmartIF< IHiveWhiteBoard > m_WB
< Event data service (whiteboard)
State m_state
State of the object.
MinimalEventLoopMgr(const MinimalEventLoopMgr &)=delete
No copy allowed.
StatusCode stopRun() override
implementation of IEventProcessor::stopRun( )
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
Base class used to extend a class implementing other interfaces.
Definition extends.h:19