The Gaudi Framework  master (d98a2936)
HiveSlimEventLoopMgr.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 
13 // Framework include files
21 #include <GaudiKernel/IScheduler.h>
23 #include <GaudiKernel/SmartIF.h>
24 
25 // External Libraries
26 #include <boost/dynamic_bitset.hpp>
27 
28 // STL
29 #include <memory>
30 
31 class HiveSlimEventLoopMgr : public extends<Service, IEventProcessor> {
32 
33 protected:
34  Gaudi::Property<std::string> m_histPersName{ this, "HistogramPersistency", "", "" };
35  Gaudi::Property<std::string> m_evtsel{ this, "EvtSel", "", "" };
36  Gaudi::Property<std::string> m_schedulerName{ this, "SchedulerName", "AvalancheSchedulerSvc",
37  "Name of the scheduler to be used" };
38 
39  Gaudi::Property<std::vector<unsigned int>> m_eventNumberBlacklist{ this, "EventNumberBlackList", {}, "" };
40  Gaudi::Property<bool> m_abortOnFailure{ this, "AbortOnFailure", true, "Abort job on event failure" };
41 
62  bool m_endEventFired = false;
66  StatusCode clearWBSlot( int evtSlot );
70  StatusCode drainScheduler( int& finishedEvents );
74  bool m_scheduledStop = false;
77 
78  // if finite number of evts is processed use bitset
79  std::unique_ptr<boost::dynamic_bitset<>> m_blackListBS;
80 
82 
83 public:
84  // inherit base class constructor
85  using extends::extends;
86 
87  ~HiveSlimEventLoopMgr() override;
88 
92  StatusCode initialize() override;
94  StatusCode reinitialize() override;
96  StatusCode stop() override;
98  StatusCode finalize() override;
100  StatusCode nextEvent( int maxevt ) override;
102  EventContext createEventContext() override;
104  StatusCode executeEvent( EventContext&& ctx ) override;
106  StatusCode executeRun( int maxevt ) override;
108  StatusCode stopRun() override;
109 };
HiveSlimEventLoopMgr::m_appMgrProperty
SmartIF< IProperty > m_appMgrProperty
Property interface of ApplicationMgr.
Definition: HiveSlimEventLoopMgr.h:59
HiveSlimEventLoopMgr::m_abortOnFailure
Gaudi::Property< bool > m_abortOnFailure
Definition: HiveSlimEventLoopMgr.h:40
IAlgResourcePool.h
HiveSlimEventLoopMgr::m_schedulerSvc
SmartIF< IScheduler > m_schedulerSvc
A shortcut for the scheduler.
Definition: HiveSlimEventLoopMgr.h:64
HiveSlimEventLoopMgr::m_eventNumberBlacklist
Gaudi::Property< std::vector< unsigned int > > m_eventNumberBlacklist
Definition: HiveSlimEventLoopMgr.h:39
HiveSlimEventLoopMgr::reinitialize
StatusCode reinitialize() override
implementation of IService::reinitialize
Definition: HiveSlimEventLoopMgr.cpp:136
HiveSlimEventLoopMgr::clearWBSlot
StatusCode clearWBSlot(int evtSlot)
Clear a slot in the WB.
Definition: HiveSlimEventLoopMgr.cpp:563
IOpaqueAddress
Definition: IOpaqueAddress.h:28
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:62
HiveSlimEventLoopMgr::m_histPersName
Gaudi::Property< std::string > m_histPersName
Definition: HiveSlimEventLoopMgr.h:34
HiveSlimEventLoopMgr::m_evtDataMgrSvc
SmartIF< IDataManagerSvc > m_evtDataMgrSvc
Reference to the Event Data Service's IDataManagerSvc interface.
Definition: HiveSlimEventLoopMgr.h:43
IEvtSelector.h
HiveSlimEventLoopMgr::finalize
StatusCode finalize() override
implementation of IService::finalize
Definition: HiveSlimEventLoopMgr.cpp:207
HiveSlimEventLoopMgr::createEventContext
EventContext createEventContext() override
implementation of IEventProcessor::createEventContext()
Definition: HiveSlimEventLoopMgr.cpp:488
HiveSlimEventLoopMgr::m_nevt
EventContext::ContextEvt_t m_nevt
Definition: HiveSlimEventLoopMgr.h:81
IEvtSelector::Context
Definition: IEvtSelector.h:31
HiveSlimEventLoopMgr::stop
StatusCode stop() override
implementation of IService::stop
Definition: HiveSlimEventLoopMgr.cpp:194
HiveSlimEventLoopMgr::m_algResourcePool
SmartIF< IAlgResourcePool > m_algResourcePool
Reference to the Algorithm resource pool.
Definition: HiveSlimEventLoopMgr.h:55
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:64
HiveSlimEventLoopMgr::m_abortEventListener
SmartIF< IIncidentListener > m_abortEventListener
Instance of the incident listener waiting for AbortEvent.
Definition: HiveSlimEventLoopMgr.h:72
HiveSlimEventLoopMgr::m_histoDataMgrSvc
SmartIF< IDataManagerSvc > m_histoDataMgrSvc
Reference to the Histogram Data Service.
Definition: HiveSlimEventLoopMgr.h:49
HiveSlimEventLoopMgr::executeRun
StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun()
Definition: HiveSlimEventLoopMgr.cpp:316
HiveSlimEventLoopMgr::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the incident service.
Definition: HiveSlimEventLoopMgr.h:76
SmartIF< IDataManagerSvc >
IHiveWhiteBoard.h
HiveSlimEventLoopMgr
Definition: HiveSlimEventLoopMgr.h:31
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:19
HiveSlimEventLoopMgr::m_scheduledStop
bool m_scheduledStop
Scheduled stop of event processing.
Definition: HiveSlimEventLoopMgr.h:74
HiveSlimEventLoopMgr::drainScheduler
StatusCode drainScheduler(int &finishedEvents)
Drain the scheduler from all actions that may be queued.
Definition: HiveSlimEventLoopMgr.cpp:506
HiveSlimEventLoopMgr::stopRun
StatusCode stopRun() override
implementation of IEventProcessor::stopRun()
Definition: HiveSlimEventLoopMgr.cpp:341
HiveSlimEventLoopMgr::m_whiteboard
SmartIF< IHiveWhiteBoard > m_whiteboard
Reference to the Whiteboard.
Definition: HiveSlimEventLoopMgr.h:53
HiveSlimEventLoopMgr::executeEvent
StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&&)
Definition: HiveSlimEventLoopMgr.cpp:269
HiveSlimEventLoopMgr::m_blackListBS
std::unique_ptr< boost::dynamic_bitset<> > m_blackListBS
Definition: HiveSlimEventLoopMgr.h:79
HiveSlimEventLoopMgr::m_evtContext
IEvtSelector::Context * m_evtContext
Event Iterator.
Definition: HiveSlimEventLoopMgr.h:47
IIncidentListener.h
HiveSlimEventLoopMgr::nextEvent
StatusCode nextEvent(int maxevt) override
implementation of IService::nextEvent
Definition: HiveSlimEventLoopMgr.cpp:358
HiveSlimEventLoopMgr::m_algExecStateSvc
SmartIF< IAlgExecStateSvc > m_algExecStateSvc
Reference to the AlgExecStateSvc.
Definition: HiveSlimEventLoopMgr.h:57
MinimalEventLoopMgr.h
EventContext
Definition: EventContext.h:34
HiveSlimEventLoopMgr::declareEventRootAddress
StatusCode declareEventRootAddress()
Declare the root address of the event.
Definition: HiveSlimEventLoopMgr.cpp:466
HiveSlimEventLoopMgr::m_schedulerName
Gaudi::Property< std::string > m_schedulerName
Definition: HiveSlimEventLoopMgr.h:36
HiveSlimEventLoopMgr::getEventRoot
StatusCode getEventRoot(IOpaqueAddress *&refpAddr)
Create event address using event selector.
Definition: HiveSlimEventLoopMgr.cpp:450
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:51
HiveSlimEventLoopMgr::m_evtsel
Gaudi::Property< std::string > m_evtsel
Definition: HiveSlimEventLoopMgr.h:35
IAlgExecStateSvc.h
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:45