| The Gaudi Framework v32r1 (f65d50dc)

HiveSlimEventLoopMgr.h
Go to the documentation of this file.
1 #ifndef GAUDIHIVE_HIVESLIMEVENTLOOPMGR_H
2 #define GAUDIHIVE_HIVESLIMEVENTLOOPMGR_H 1
3
4 // Framework include files
5 #include "GaudiKernel/IAlgExecStateSvc.h"
6 #include "GaudiKernel/IAlgResourcePool.h"
7 #include "GaudiKernel/IDataManagerSvc.h"
8 #include "GaudiKernel/IEvtSelector.h"
9 #include "GaudiKernel/IHiveWhiteBoard.h"
10 #include "GaudiKernel/IIncidentListener.h"
11 #include "GaudiKernel/IIncidentSvc.h"
12 #include "GaudiKernel/IScheduler.h"
13 #include "GaudiKernel/MinimalEventLoopMgr.h"
14 #include "GaudiKernel/SmartIF.h"
15
16 // External Libraries
17 #include <boost/dynamic_bitset.hpp>
18
19 // STL
20 #include <memory>
21
22 class HiveSlimEventLoopMgr : public extends<Service, IEventProcessor> {
23
24 protected:
25 Gaudi::Property<std::string> m_histPersName{this, "HistogramPersistency", "", ""};
26 Gaudi::Property<std::string> m_evtsel{this, "EvtSel", "", ""};
27 Gaudi::Property<bool> m_warnings{this, "Warnings", true, "Set this property to false to suppress warning messages"};
28 Gaudi::Property<std::string> m_schedulerName{this, "SchedulerName", "AvalancheSchedulerSvc",
29 "Name of the scheduler to be used"};
30 Gaudi::Property<std::vector<unsigned int>> m_eventNumberBlacklist{this, "EventNumberBlackList", {}, ""};
31 Gaudi::Property<bool> m_abortOnFailure{this, "AbortOnFailure", true, "Abort job on event failure"};
32
34 SmartIF<IDataManagerSvc> m_evtDataMgrSvc;
36 SmartIF<IEvtSelector> m_evtSelector;
38 IEvtSelector::Context* m_evtContext = nullptr;
40 SmartIF<IDataManagerSvc> m_histoDataMgrSvc;
42 SmartIF<IConversionSvc> m_histoPersSvc;
44 SmartIF<IHiveWhiteBoard> m_whiteboard;
46 SmartIF<IAlgResourcePool> m_algResourcePool;
48 SmartIF<IAlgExecStateSvc> m_algExecStateSvc;
50 SmartIF<IProperty> m_appMgrProperty;
53 bool m_endEventFired = false;
55 SmartIF<IScheduler> m_schedulerSvc;
57 StatusCode clearWBSlot( int evtSlot );
59 StatusCode declareEventRootAddress();
61 StatusCode drainScheduler( int& finishedEvents );
63 SmartIF<IIncidentListener> m_abortEventListener;
65 bool m_scheduledStop = false;
67 SmartIF<IIncidentSvc> m_incidentSvc;
68
69 // if finite number of evts is processed use bitset
70 std::unique_ptr<boost::dynamic_bitset<>> m_blackListBS;
71
72 EventContext::ContextEvt_t m_nevt{0};
73
74 public:
75 // inherit base class constructor
76 using extends::extends;
77
78 ~HiveSlimEventLoopMgr() override;
79
81 StatusCode getEventRoot( IOpaqueAddress*& refpAddr );
83 StatusCode initialize() override;
85 StatusCode reinitialize() override;
87 StatusCode stop() override;
89 StatusCode finalize() override;
91 StatusCode nextEvent( int maxevt ) override;
93 EventContext createEventContext() override;
95 StatusCode executeEvent( EventContext&& ctx ) override;
97 StatusCode executeRun( int maxevt ) override;
99 StatusCode stopRun() override;
100 };
101 #endif // GAUDIHIVE_HIVESLIMEVENTLOOPMGR_H
HiveSlimEventLoopMgr::clearWBSlot
StatusCode clearWBSlot(int evtSlot)
Clear a slot in the WB.
Definition: HiveSlimEventLoopMgr.cpp:550
HiveSlimEventLoopMgr::m_evtsel
Gaudi::Property< std::string > m_evtsel
Definition: HiveSlimEventLoopMgr.h:26
HiveSlimEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: HiveSlimEventLoopMgr.h:67
SmartIF< IDataManagerSvc >
HiveSlimEventLoopMgr::m_blackListBS
std::unique_ptr< boost::dynamic_bitset<> > m_blackListBS
Definition: HiveSlimEventLoopMgr.h:70
HiveSlimEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveSlimEventLoopMgr.h:34
HiveSlimEventLoopMgr::declareEventRootAddress
StatusCode declareEventRootAddress()
Declare the root address of the event.
Definition: HiveSlimEventLoopMgr.cpp:453
HiveSlimEventLoopMgr::m_abortOnFailure
Gaudi::Property< bool > m_abortOnFailure
Definition: HiveSlimEventLoopMgr.h:31
IAlgExecStateSvc.h
HiveSlimEventLoopMgr::createEventContext
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
Definition: HiveSlimEventLoopMgr.cpp:475
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
HiveSlimEventLoopMgr::drainScheduler
StatusCode drainScheduler(int &finishedEvents)
Drain the scheduler from all actions that may be queued.
Definition: HiveSlimEventLoopMgr.cpp:493
HiveSlimEventLoopMgr::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
Definition: HiveSlimEventLoopMgr.h:44
HiveSlimEventLoopMgr::m_schedulerSvc
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
Definition: HiveSlimEventLoopMgr.h:55
HiveSlimEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: HiveSlimEventLoopMgr.h:65
IAlgResourcePool.h
HiveSlimEventLoopMgr
Definition: HiveSlimEventLoopMgr.h:22
HiveSlimEventLoopMgr::m_eventNumberBlacklist
Gaudi::Property< std::vector< unsigned int > > m_eventNumberBlacklist
Definition: HiveSlimEventLoopMgr.h:30
IEvtSelector::Context
Definition: IEvtSelector.h:23
IScheduler.h
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
HiveSlimEventLoopMgr::m_appMgrProperty
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Definition: HiveSlimEventLoopMgr.h:50
HiveSlimEventLoopMgr::m_warnings
Gaudi::Property< bool > m_warnings
Definition: HiveSlimEventLoopMgr.h:27
HiveSlimEventLoopMgr::finalize
StatusCode finalize() override
implementation of IService::finalize
Definition: HiveSlimEventLoopMgr.cpp:199
HiveSlimEventLoopMgr::stopRun
StatusCode stopRun() override
implementation of IEventProcessor::stopRun()
Definition: HiveSlimEventLoopMgr.cpp:334
IDataManagerSvc.h
HiveSlimEventLoopMgr::~HiveSlimEventLoopMgr
~HiveSlimEventLoopMgr() override
Definition: HiveSlimEventLoopMgr.cpp:27
EventContext::ContextEvt_t
size_t ContextEvt_t
Definition: EventContext.h:27
IIncidentSvc.h
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
HiveSlimEventLoopMgr::executeRun
StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun()
Definition: HiveSlimEventLoopMgr.cpp:309
SmartIF.h
HiveSlimEventLoopMgr::getEventRoot
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
Definition: HiveSlimEventLoopMgr.cpp:437
HiveSlimEventLoopMgr::initialize
StatusCode initialize() override
implementation of IService::initialize
Definition: HiveSlimEventLoopMgr.cpp:32
HiveSlimEventLoopMgr::m_algExecStateSvc
SmartIF< IAlgExecStateSvc > m_algExecStateSvc
Reference to the AlgExecStateSvc.
Definition: HiveSlimEventLoopMgr.h:48
std::unique_ptr
STL class.
HiveSlimEventLoopMgr::m_histoPersSvc
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
Definition: HiveSlimEventLoopMgr.h:42
HiveSlimEventLoopMgr::m_schedulerName
Gaudi::Property< std::string > m_schedulerName
Definition: HiveSlimEventLoopMgr.h:28
MinimalEventLoopMgr.h
IHiveWhiteBoard.h
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
HiveSlimEventLoopMgr::m_histoDataMgrSvc
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Definition: HiveSlimEventLoopMgr.h:40
HiveSlimEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveSlimEventLoopMgr.h:36
HiveSlimEventLoopMgr::executeEvent
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
Definition: HiveSlimEventLoopMgr.cpp:261
HiveSlimEventLoopMgr::reinitialize
StatusCode reinitialize() override
implementation of IService::reinitialize
Definition: HiveSlimEventLoopMgr.cpp:128
IEvtSelector.h
IIncidentListener.h
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
maxevt
int maxevt
Definition: Bootstrap.cpp:260
HiveSlimEventLoopMgr::m_histPersName
Gaudi::Property< std::string > m_histPersName
Definition: HiveSlimEventLoopMgr.h:25
HiveSlimEventLoopMgr::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
Definition: HiveSlimEventLoopMgr.h:46
HiveSlimEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IService::nextEvent
Definition: HiveSlimEventLoopMgr.cpp:351
HiveSlimEventLoopMgr::m_endEventFired
bool m_endEventFired
Flag to avoid to fire the EnvEvent incident twice in a row (and also not before the first event)
Definition: HiveSlimEventLoopMgr.h:53
HiveSlimEventLoopMgr::m_abortEventListener
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: HiveSlimEventLoopMgr.h:63
HiveSlimEventLoopMgr::stop
StatusCode stop() override
implementation of IService::stop
Definition: HiveSlimEventLoopMgr.cpp:186
HiveSlimEventLoopMgr::m_nevt
EventContext::ContextEvt_t m_nevt
Definition: HiveSlimEventLoopMgr.h:72
HiveSlimEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveSlimEventLoopMgr.h:38