The Gaudi Framework  master (37c0b60a)
HiveSlimEventLoopMgr.h
Go to the documentation of this file.
1 /***********************************************************************************\
2 * (c) Copyright 1998-2024 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 #ifndef GAUDIHIVE_HIVESLIMEVENTLOOPMGR_H
12 #define GAUDIHIVE_HIVESLIMEVENTLOOPMGR_H 1
13 
14 // Framework include files
22 #include <GaudiKernel/IScheduler.h>
24 #include <GaudiKernel/SmartIF.h>
25 
26 // External Libraries
27 #include <boost/dynamic_bitset.hpp>
28 
29 // STL
30 #include <memory>
31 
32 class HiveSlimEventLoopMgr : public extends<Service, IEventProcessor> {
33 
34 protected:
35  Gaudi::Property<std::string> m_histPersName{ this, "HistogramPersistency", "", "" };
36  Gaudi::Property<std::string> m_evtsel{ this, "EvtSel", "", "" };
37  Gaudi::Property<bool> m_warnings{ this, "Warnings", true, "Set this property to false to suppress warning messages" };
38  Gaudi::Property<std::string> m_schedulerName{ this, "SchedulerName", "AvalancheSchedulerSvc",
39  "Name of the scheduler to be used" };
40  Gaudi::Property<std::vector<unsigned int>> m_eventNumberBlacklist{ this, "EventNumberBlackList", {}, "" };
41  Gaudi::Property<bool> m_abortOnFailure{ this, "AbortOnFailure", true, "Abort job on event failure" };
42 
63  bool m_endEventFired = false;
67  StatusCode clearWBSlot( int evtSlot );
71  StatusCode drainScheduler( int& finishedEvents );
75  bool m_scheduledStop = false;
78 
79  // if finite number of evts is processed use bitset
81 
83 
84 public:
85  // inherit base class constructor
86  using extends::extends;
87 
88  ~HiveSlimEventLoopMgr() override;
89 
93  StatusCode initialize() override;
95  StatusCode reinitialize() override;
97  StatusCode stop() override;
99  StatusCode finalize() override;
101  StatusCode nextEvent( int maxevt ) override;
103  EventContext createEventContext() override;
105  StatusCode executeEvent( EventContext&& ctx ) override;
107  StatusCode executeRun( int maxevt ) override;
109  StatusCode stopRun() override;
110 };
111 #endif // GAUDIHIVE_HIVESLIMEVENTLOOPMGR_H
HiveSlimEventLoopMgr::m_appMgrProperty
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Definition: HiveSlimEventLoopMgr.h:60
HiveSlimEventLoopMgr::m_abortOnFailure
Gaudi::Property< bool > m_abortOnFailure
Definition: HiveSlimEventLoopMgr.h:41
IAlgResourcePool.h
HiveSlimEventLoopMgr::m_schedulerSvc
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
Definition: HiveSlimEventLoopMgr.h:65
HiveSlimEventLoopMgr::m_eventNumberBlacklist
Gaudi::Property< std::vector< unsigned int > > m_eventNumberBlacklist
Definition: HiveSlimEventLoopMgr.h:40
HiveSlimEventLoopMgr::reinitialize
StatusCode reinitialize() override
implementation of IService::reinitialize
Definition: HiveSlimEventLoopMgr.cpp:139
HiveSlimEventLoopMgr::clearWBSlot
StatusCode clearWBSlot(int evtSlot)
Clear a slot in the WB.
Definition: HiveSlimEventLoopMgr.cpp:566
IOpaqueAddress
Definition: IOpaqueAddress.h:33
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:63
HiveSlimEventLoopMgr::m_histPersName
Gaudi::Property< std::string > m_histPersName
Definition: HiveSlimEventLoopMgr.h:35
HiveSlimEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveSlimEventLoopMgr.h:44
IEvtSelector.h
HiveSlimEventLoopMgr::finalize
StatusCode finalize() override
implementation of IService::finalize
Definition: HiveSlimEventLoopMgr.cpp:210
HiveSlimEventLoopMgr::createEventContext
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
Definition: HiveSlimEventLoopMgr.cpp:491
HiveSlimEventLoopMgr::m_nevt
EventContext::ContextEvt_t m_nevt
Definition: HiveSlimEventLoopMgr.h:82
IEvtSelector::Context
Definition: IEvtSelector.h:33
HiveSlimEventLoopMgr::stop
StatusCode stop() override
implementation of IService::stop
Definition: HiveSlimEventLoopMgr.cpp:197
HiveSlimEventLoopMgr::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
Definition: HiveSlimEventLoopMgr.h:56
HiveSlimEventLoopMgr::~HiveSlimEventLoopMgr
~HiveSlimEventLoopMgr() override
Definition: HiveSlimEventLoopMgr.cpp:38
IIncidentSvc.h
IScheduler.h
SmartIF.h
GaudiPython.Pythonizations.ctx
ctx
Definition: Pythonizations.py:578
StatusCode
Definition: StatusCode.h:65
HiveSlimEventLoopMgr::m_abortEventListener
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: HiveSlimEventLoopMgr.h:73
HiveSlimEventLoopMgr::m_histoDataMgrSvc
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Definition: HiveSlimEventLoopMgr.h:50
HiveSlimEventLoopMgr::executeRun
StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun()
Definition: HiveSlimEventLoopMgr.cpp:319
HiveSlimEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: HiveSlimEventLoopMgr.h:77
HiveSlimEventLoopMgr::m_warnings
Gaudi::Property< bool > m_warnings
Definition: HiveSlimEventLoopMgr.h:37
SmartIF< IDataManagerSvc >
IHiveWhiteBoard.h
HiveSlimEventLoopMgr
Definition: HiveSlimEventLoopMgr.h:32
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
HiveSlimEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: HiveSlimEventLoopMgr.h:75
HiveSlimEventLoopMgr::drainScheduler
StatusCode drainScheduler(int &finishedEvents)
Drain the scheduler from all actions that may be queued.
Definition: HiveSlimEventLoopMgr.cpp:509
HiveSlimEventLoopMgr::stopRun
StatusCode stopRun() override
implementation of IEventProcessor::stopRun()
Definition: HiveSlimEventLoopMgr.cpp:344
HiveSlimEventLoopMgr::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
Definition: HiveSlimEventLoopMgr.h:54
HiveSlimEventLoopMgr::executeEvent
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
Definition: HiveSlimEventLoopMgr.cpp:272
HiveSlimEventLoopMgr::m_blackListBS
std::unique_ptr< boost::dynamic_bitset<> > m_blackListBS
Definition: HiveSlimEventLoopMgr.h:80
HiveSlimEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveSlimEventLoopMgr.h:48
IIncidentListener.h
HiveSlimEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IService::nextEvent
Definition: HiveSlimEventLoopMgr.cpp:361
HiveSlimEventLoopMgr::m_algExecStateSvc
SmartIF< IAlgExecStateSvc > m_algExecStateSvc
Reference to the AlgExecStateSvc.
Definition: HiveSlimEventLoopMgr.h:58
MinimalEventLoopMgr.h
EventContext
Definition: EventContext.h:34
HiveSlimEventLoopMgr::declareEventRootAddress
StatusCode declareEventRootAddress()
Declare the root address of the event.
Definition: HiveSlimEventLoopMgr.cpp:469
HiveSlimEventLoopMgr::m_schedulerName
Gaudi::Property< std::string > m_schedulerName
Definition: HiveSlimEventLoopMgr.h:38
HiveSlimEventLoopMgr::getEventRoot
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
Definition: HiveSlimEventLoopMgr.cpp:453
HiveSlimEventLoopMgr::initialize
StatusCode initialize() override
implementation of IService::initialize
Definition: HiveSlimEventLoopMgr.cpp:43
HiveSlimEventLoopMgr::m_histoPersSvc
SmartIF< IConversionSvc > m_histoPersSvc
Reference to the Histogram Persistency Service.
Definition: HiveSlimEventLoopMgr.h:52
HiveSlimEventLoopMgr::m_evtsel
Gaudi::Property< std::string > m_evtsel
Definition: HiveSlimEventLoopMgr.h:36
IAlgExecStateSvc.h
std::unique_ptr
STL class.
EventContext::ContextEvt_t
size_t ContextEvt_t
Definition: EventContext.h:37
Gaudi::Property< std::string >
IDataManagerSvc.h
HiveSlimEventLoopMgr::m_evtSelector
SmartIF< IEvtSelector > m_evtSelector
Reference to the Event Selector.
Definition: HiveSlimEventLoopMgr.h:46