| The Gaudi Framework v32r1 (f65d50dc)

EventSelector.h
Go to the documentation of this file.
1 //====================================================================
2 // EventSelector.h
3 //--------------------------------------------------------------------
4 //
5 // Package : EventSelector (LHCb Event Selector Package)
6 //
7 // Author : M.Frank
8 // Created : 4/10/00
9 //
10 //====================================================================
11 // Modified : 11/11/06
12 //
13 // Author : Andres Felipe OSORIO OLIVEROS
14 // : Marco CLEMENCIC
15 //
16 //====================================================================
17
18 #ifndef GAUDISVC_EVENTSELECTOR_EVENTSELECTOR_H
19 #define GAUDISVC_EVENTSELECTOR_EVENTSELECTOR_H 1
20
21 // Include files
22 #include "GaudiKernel/IEvtSelector.h"
23 #include "GaudiKernel/Service.h"
24
25 // STL include files
26 #include <vector>
27
28 // Forward declarations
29 class IIncidentSvc;
30 class IAddressCreator;
31 class IToolSvc;
32 class EventSelectorDataStream;
33 class EvtSelectorContext;
34 class IDataStreamTool;
35
53 class EventSelector : public extends<Service, IEvtSelector> {
54 public:
55 typedef std::vector<EventSelectorDataStream*> Streams;
56 typedef std::vector<std::string> StreamSpecs;
57 typedef std::vector<Gaudi::Property<std::string>> Properties;
58
59 long int m_streamID;
60
61 protected:
63 SmartIF<IIncidentSvc> m_incidentSvc = nullptr;
64
65 SmartIF<IToolSvc> m_toolSvc = nullptr;
66
67 IDataStreamTool* m_streamtool = nullptr;
68
70 bool m_reconfigure = false;
72 StreamSpecs m_streamSpecsLast;
74 Streams m_streams;
76 int m_streamCount = 0;
77
78 // Properties
79 Gaudi::Property<StreamSpecs> m_streamSpecs{this, "Input", {}, "input stream specifiers (for job options)"};
80 Gaudi::Property<int> m_firstEvent{this, "FirstEvent", 0, "first event to be processed"};
81 Gaudi::Property<int> m_evtMax{this, "EvtMax", INT_MAX, "maximum number of events to be processed"};
82 Gaudi::Property<int> m_evtPrintFrequency{this, "PrintFreq", 10, "printout frequency"};
83 Gaudi::Property<std::string> m_streamManager{this, "StreamManager", "DataStreamTool", ""};
84
86 virtual void printEvtInfo( const EvtSelectorContext* iter ) const;
87
88 public:
90 StatusCode initialize() override;
91
93 StatusCode finalize() override;
94
96 StatusCode reinitialize() override;
97
99
103 StatusCode createContext( Context*& refpCtxt ) const override;
104
106
110 StatusCode next( Context& refCtxt ) const override;
111
113
117 StatusCode next( Context& refCtxt, int jump ) const override;
118
120
125 StatusCode previous( Context& refCtxt ) const override;
126
128
133 StatusCode previous( Context& refCtxt, int jump ) const override;
134
136
140 StatusCode rewind( Context& refCtxt ) const override;
141
143
148 StatusCode createAddress( const Context& refCtxt, IOpaqueAddress*& refpAddr ) const override;
149
151
155 StatusCode releaseContext( Context*& refCtxt ) const override;
156
165 StatusCode resetCriteria( const std::string& cr, Context& c ) const override;
166
172 StatusCode last( Context& c ) const override;
173
175 StatusCode firstOfNextStream( bool shutDown, EvtSelectorContext& it ) const;
177 StatusCode lastOfPreviousStream( bool shutDown, EvtSelectorContext& it ) const;
178
180 using extends::extends;
181 };
182
183 #endif // GAUDISVC_EVENTSELECTOR_EVENTSELECTOR_H
EventSelector::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the indicent service.
Definition: EventSelector.h:63
IToolSvc
The interface implemented by the IToolSvc base class.
Definition: IToolSvc.h:19
SmartIF< IIncidentSvc >
gaudirun.c
c
Definition: gaudirun.py:487
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:352
EventSelector::Streams
std::vector< EventSelectorDataStream * > Streams
Definition: EventSelector.h:55
EventSelector::releaseContext
StatusCode releaseContext(Context *&refCtxt) const override
Release existing event iteration context.
Definition: EventSelector.cpp:294
EventSelector::resetCriteria
StatusCode resetCriteria(const std::string &cr, Context &c) const override
Will set a new criteria for the selection of the next list of events and will change the state of the...
Definition: EventSelector.cpp:20
EventSelector::m_streamtool
IDataStreamTool * m_streamtool
Definition: EventSelector.h:67
EventSelector::m_streams
Streams m_streams
Input streams.
Definition: EventSelector.h:74
IAddressCreator
IAddressCreator interface definition.
Definition: IAddressCreator.h:28
EventSelector::m_streamID
long int m_streamID
Definition: EventSelector.h:59
EventSelector::m_streamSpecsLast
StreamSpecs m_streamSpecsLast
Input stream specifiers (last used)
Definition: EventSelector.h:72
std::string
STL class.
Service.h
EventSelector::next
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.
Definition: EventSelector.cpp:177
EventSelector::m_evtPrintFrequency
Gaudi::Property< int > m_evtPrintFrequency
Definition: EventSelector.h:82
EventSelector::m_streamManager
Gaudi::Property< std::string > m_streamManager
Definition: EventSelector.h:83
EventSelector::rewind
StatusCode rewind(Context &refCtxt) const override
Rewind the dataset.
Definition: EventSelector.cpp:255
EventSelector::reinitialize
StatusCode reinitialize() override
Service override: Reinitialize service.
Definition: EventSelector.cpp:368
EventSelector::previous
StatusCode previous(Context &refCtxt) const override
Get previous iteration item from the event loop context.
Definition: EventSelector.cpp:216
EvtSelectorContext
Definition of class EventIterator.
Definition: EventIterator.h:32
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:50
EventSelector::printEvtInfo
virtual void printEvtInfo(const EvtSelectorContext *iter) const
Progress report.
Definition: EventSelector.cpp:25
EventSelector::m_evtMax
Gaudi::Property< int > m_evtMax
Definition: EventSelector.h:81
EventSelector::firstOfNextStream
StatusCode firstOfNextStream(bool shutDown, EvtSelectorContext &it) const
Retrieve first entry of the next data stream.
Definition: EventSelector.cpp:43
EventSelector::initialize
StatusCode initialize() override
IService implementation: Db event selector override.
Definition: EventSelector.cpp:313
EventSelector::m_streamSpecs
Gaudi::Property< StreamSpecs > m_streamSpecs
Definition: EventSelector.h:79
EventSelector::m_firstEvent
Gaudi::Property< int > m_firstEvent
Definition: EventSelector.h:80
EventSelector::finalize
StatusCode finalize() override
IService implementation: Service finalization.
Definition: EventSelector.cpp:386
EventSelector::StreamSpecs
std::vector< std::string > StreamSpecs
Definition: EventSelector.h:56
EventSelector::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
Definition: EventSelector.h:65
EventSelector::lastOfPreviousStream
StatusCode lastOfPreviousStream(bool shutDown, EvtSelectorContext &it) const
Retrieve last entry of the previous data stream.
Definition: EventSelector.cpp:101
std::vector< EventSelectorDataStream * >
EventSelector::Properties
std::vector< Gaudi::Property< std::string > > Properties
Definition: EventSelector.h:57
IDataStreamTool
Definition: IDataStreamTool.h:22
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:45
EventSelector::m_streamCount
int m_streamCount
Input stream counter (0..oo, monotonely increasing)
Definition: EventSelector.h:76
IEvtSelector.h
EventSelector
Definition of class EventSelector.
Definition: EventSelector.h:53
EventSelector::createAddress
StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&refpAddr) const override
Create new Opaque address corresponding to the current record.
Definition: EventSelector.cpp:274
EventSelector::m_reconfigure
bool m_reconfigure
Reconfigure occurred.
Definition: EventSelector.h:70
IOpaqueAddress
Opaque address interface definition.
Definition: IOpaqueAddress.h:23
EventSelector::last
StatusCode last(Context &c) const override
Access last item in the iteration.
Definition: EventSelector.cpp:248
EventSelector::createContext
StatusCode createContext(Context *&refpCtxt) const override
Create a new event loop context.
Definition: EventSelector.cpp:151
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23