ATLAS Offline Software
Loading...
Searching...
No Matches
AthenaEventLoopMgr.h
Go to the documentation of this file.
1// -*- C++ -*-
2
3/*
4 Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
5*/
6
7#ifndef ATHENASERVICES_ATHENAEVENTLOOPMGR_H
8#define ATHENASERVICES_ATHENAEVENTLOOPMGR_H
13
14// Base class headers
17#include "GaudiKernel/IIncidentListener.h"
19#include "GaudiKernel/MinimalEventLoopMgr.h"
20
21// Athena headers
25#ifndef EVENTINFO_EVENTID_H
26# include "EventInfo/EventID.h" /* number_type */
27#endif
28
29// Gaudi headers
30#include <string>
31#include <vector>
32#include "GaudiKernel/IEvtSelector.h"
33#include "Gaudi/Property.h"
34#include "GaudiKernel/ServiceHandle.h"
35#include "GaudiKernel/ToolHandle.h"
36#include "GaudiKernel/IChronoStatSvc.h"
37#include "GaudiKernel/IAlgExecStateSvc.h"
38
39// Forward declarations
40class IConversionSvc;
41struct IDataManagerSvc;
42class IIncidentSvc;
43class StoreGateSvc;
44class EventContext;
45class ISvcLocator;
47
58class AthenaEventLoopMgr : public extends<MinimalEventLoopMgr,
59 IEventSeek, ICollectionSize, IIncidentListener>,
61 public AthMessaging
62{
63public:
64 typedef IEvtSelector::Context EvtContext;
65
66protected:
70
74
76 IEvtSelector* m_evtSelector;
78 IEvtSelector::Context* m_evtSelCtxt;
80 StringProperty m_evtsel;
81
85
89
93
95 StringArrayProperty m_execAtPreFork;
96
98 StringProperty m_histPersName;
99
104
106 IntegerProperty m_failureMode;
107
109 UnsignedIntegerProperty m_eventPrintoutInterval;
110
113 typedef ToolHandleArray< tool_type > tool_store;
114 typedef tool_store::const_iterator tool_iterator;
115 typedef std::vector<unsigned int> tool_stats;
116 typedef tool_stats::const_iterator tool_stats_iterator;
117
122
125
128
130 void setupPreSelectTools(Gaudi::Details::PropertyBase&);
131
135 StringProperty m_clearStorePolicy;
136
139 void setClearStorePolicy(Gaudi::Details::PropertyBase& clearStorePolicy);
140
142 virtual StatusCode writeHistograms(bool force=false);
143
145 virtual StatusCode executeAlgorithms(const EventContext&);
146
148 StatusCode initializeAlgorithms();
149
150protected:
152 SmartIF<IAlgExecStateSvc> m_aess;
153
154public:
156 AthenaEventLoopMgr(const std::string& nam, ISvcLocator* svcLoc);
158 virtual ~AthenaEventLoopMgr();
160 virtual StatusCode initialize() override;
162 virtual StatusCode finalize() override;
164 virtual StatusCode nextEvent(int maxevt) override;
166 virtual StatusCode executeEvent( EventContext && ctx ) override;
168 virtual StatusCode executeRun(int maxevt) override;
170 virtual StatusCode seek(int evt) override;
172 virtual int curEvent() const override;
174 virtual int size() override;
176 virtual void handle(const Incident& inc) override;
178 StatusCode execAtPreFork(const EventContext& ctx) const;
180 virtual StatusCode stopRun() override;
181
182 using AthMessaging::msg;
184
185 //FIXME hack to workaround pylcgdict problem...
186 virtual const std::string& name() const override { return Service::name(); } //FIXME
187
188 virtual void modifyEventContext(EventContext& ctx, const EventID& eID, bool consume_modifier_stream);
189
190private:
194
195 StatusCode installEventContext(EventContext& ctx);
196
197 int m_nevt{};
199 IntegerProperty m_writeInterval;
201
203 unsigned int m_nev;
204 unsigned int m_proc;
206
207 unsigned int m_lastNev{};
209 time_t m_lastTime{};
210
212
213 StoreGateSvc* eventStore() const;
214
215 bool m_doChrono = false;
218};
219
220#endif // STOREGATE_ATHENAEVENTLOOPMGR_H
ClearStorePolicy::Type clearStorePolicy(const std::string &policyName, MsgStream &msg)
returns the enum-version of the policy (by name)
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
This file contains the class definition for the IAthenaEvtLoopPreSelectTool class.
Abstract interface for finding the size of an event collection.
Interface for doing garbage collection of conditions objects.
Abstract interface for seeking within an event stream.
Timeout singleton.
MsgStream & msg() const
The standard message stream.
bool msgLvl(const MSG::Level lvl) const
Test the output level.
AthMessaging(IMessageSvc *msgSvc, const std::string &name)
Constructor.
virtual ~AthenaEventLoopMgr()
Standard Destructor.
UnsignedIntegerProperty m_eventPrintoutInterval
EventID::number_type number_type
IntegerProperty m_failureMode
IEvtSelector::Context * m_evtSelCtxt
Gaudi EventSelector Context (may be used as a cursor by the evt selector)
AthenaEventLoopMgr & operator=(const AthenaEventLoopMgr &)
no implementation
virtual int curEvent() const override
Return the current event count.
tool_stats m_toolInvoke
tool called counter
IIncidentSvc_t m_incidentSvc
Reference to the incident service.
unsigned int m_nev
events processed
StoreGateSvc_t m_eventStore
Reference to StoreGateSvc;.
bool m_useSecondaryEventNumber
read event number from secondary input
tool_stats m_toolAccept
tool returns StatusCode::SUCCESS counter
virtual void handle(const Incident &inc) override
IIncidentListenet interfaces.
bool m_requireInputAttributeList
require input attribute list
ServiceHandle< IEvtIdModifierSvc > IEvtIdModifierSvc_t
std::vector< unsigned int > tool_stats
SmartIF< IAlgExecStateSvc > m_aess
Reference to the Algorithm Execution State Svc.
virtual StatusCode writeHistograms(bool force=false)
Dump out histograms as needed.
StringProperty m_histPersName
tool_stats m_toolReject
tool returns StatusCode::FAILURE counter
AthenaEventLoopMgr()
no implementation
StatusCode execAtPreFork(const EventContext &ctx) const
Execute certain algorithms/sequences in PreFork.
IConversionSvc_t m_histoPersSvc
AthenaEventLoopMgr(const AthenaEventLoopMgr &)
no implementation
IEvtSelector * m_evtSelector
Reference to the Event Selector.
virtual StatusCode executeEvent(EventContext &&ctx) override
implementation of IEventProcessor::executeEvent(EventContext&& ctx)
virtual StatusCode initialize() override
implementation of IAppMgrUI::initalize
virtual StatusCode seek(int evt) override
Seek to a given event.
ToolHandleArray< tool_type > tool_store
virtual int size() override
Return the size of the collection.
IEvtIdModifierSvc_t m_evtIdModSvc
StoreGateSvc * eventStore() const
StringProperty m_evtsel
virtual StatusCode finalize() override
implementation of IAppMgrUI::finalize
IntegerProperty m_writeInterval
StringProperty m_clearStorePolicy
ServiceHandle< IDataManagerSvc > IDataManagerSvc_t
ServiceHandle< IConversionSvc > IConversionSvc_t
StatusCode installEventContext(EventContext &ctx)
ServiceHandle< IIncidentSvc > IIncidentSvc_t
virtual StatusCode stopRun() override
Called from ApplicationMgr::stopRun() to terminate the loop.
ServiceHandle< StoreGateSvc > StoreGateSvc_t
void setupPreSelectTools(Gaudi::Details::PropertyBase &)
property update handler:sets up the Pre-selection tools
virtual const std::string & name() const override
AthenaEventLoopMgr(const std::string &nam, ISvcLocator *svcLoc)
Standard Constructor.
IAthenaEvtLoopPreSelectTool tool_type
IEvtSelector::Context EvtContext
virtual StatusCode executeAlgorithms(const EventContext &)
Run the algorithms for the current event.
StringArrayProperty m_execAtPreFork
virtual void modifyEventContext(EventContext &ctx, const EventID &eID, bool consume_modifier_stream)
number_type m_currentRun
current run number
unsigned int m_intervalInSeconds
StatusCode initializeAlgorithms()
Initialize all algorithms and output streams.
tool_store::const_iterator tool_iterator
tool_store m_tools
internal tool store
virtual StatusCode executeRun(int maxevt) override
implementation of IEventProcessor::executeRun(int maxevt)
tool_stats::const_iterator tool_stats_iterator
virtual StatusCode nextEvent(int maxevt) override
implementation of IAppMgrUI::nextEvent. maxevt==0 returns immediately
ServiceHandle< IChronoStatSvc > m_chronoStatSvc
ServiceHandle< Athena::IConditionsCleanerSvc > m_conditionsCleaner
IDataManagerSvc_t m_histoDataMgrSvc
Reference to the Histogram Data Service.
void setClearStorePolicy(Gaudi::Details::PropertyBase &clearStorePolicy)
property update handler:set the clear-store policy value and check its value.
Class to modify timeout flag.
Definition Timeout.h:77
This class provides a unique identification for each event, in terms of run/event number and/or a tim...
Definition EventID.h:35
EventIDBase::number_type number_type
Definition EventID.h:37
This class provides the interface for AthenaEvtLoopPreSelectTool classes used by AthenaEventLoopMgr.
The Athena Transient Store API.