The Gaudi Framework  v30r3 (a5ef0a68)
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
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;
33 class EvtSelectorContext;
34 class IDataStreamTool;
35 
53 class EventSelector : public extends<Service, IEvtSelector>
54 {
55 public:
59 
60  long int m_streamID;
61 
62 protected:
65 
67 
69 
71  bool m_reconfigure = false;
73  StreamSpecs m_streamSpecsLast;
75  Streams m_streams;
77  int m_streamCount = 0;
78 
79  // Properties
80  Gaudi::Property<StreamSpecs> m_streamSpecs{this, "Input", {}, "input stream specifiers (for job options)"};
81  Gaudi::Property<int> m_firstEvent{this, "FirstEvent", 0, "first event to be processed"};
82  Gaudi::Property<int> m_evtMax{this, "EvtMax", INT_MAX, "maximum number of events to be processed"};
83  Gaudi::Property<int> m_evtPrintFrequency{this, "PrintFreq", 10, "printout frequency"};
84  Gaudi::Property<std::string> m_streamManager{this, "StreamManager", "DataStreamTool", ""};
85 
87  virtual void printEvtInfo( const EvtSelectorContext* iter ) const;
88 
89 public:
91  StatusCode initialize() override;
92 
94  StatusCode finalize() override;
95 
97  StatusCode reinitialize() override;
98 
100 
104  StatusCode createContext( Context*& refpCtxt ) const override;
105 
107 
111  StatusCode next( Context& refCtxt ) const override;
112 
114 
118  StatusCode next( Context& refCtxt, int jump ) const override;
119 
121 
126  StatusCode previous( Context& refCtxt ) const override;
127 
129 
134  StatusCode previous( Context& refCtxt, int jump ) const override;
135 
137 
141  StatusCode rewind( Context& refCtxt ) const override;
142 
144 
149  StatusCode createAddress( const Context& refCtxt, IOpaqueAddress*& refpAddr ) const override;
150 
152 
156  StatusCode releaseContext( Context*& refCtxt ) const override;
157 
166  StatusCode resetCriteria( const std::string& cr, Context& c ) const override;
167 
173  StatusCode last( Context& c ) const override;
174 
176  StatusCode firstOfNextStream( bool shutDown, EvtSelectorContext& it ) const;
178  StatusCode lastOfPreviousStream( bool shutDown, EvtSelectorContext& it ) const;
179 
181  using extends::extends;
182 };
183 
184 #endif // GAUDISVC_EVENTSELECTOR_EVENTSELECTOR_H
StatusCode lastOfPreviousStream(bool shutDown, EvtSelectorContext &it) const
Retrieve last entry of the previous data stream.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the indicent service.
Definition: EventSelector.h:64
StatusCode createContext(Context *&refpCtxt) const override
Create a new event loop context.
The interface implemented by the IToolSvc base class.
Definition: IToolSvc.h:19
StatusCode rewind(Context &refCtxt) const override
Rewind the dataset.
Implementation of property with value of concrete type.
Definition: Property.h:381
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...
std::vector< EventSelectorDataStream * > Streams
Definition: EventSelector.h:56
StatusCode releaseContext(Context *&refCtxt) const override
Release existing event iteration context.
IDataStreamTool * m_streamtool
Definition: EventSelector.h:68
Streams m_streams
Input streams.
Definition: EventSelector.h:75
IAddressCreator interface definition.
long int m_streamID
Definition: EventSelector.h:60
virtual void printEvtInfo(const EvtSelectorContext *iter) const
Progress report.
StatusCode firstOfNextStream(bool shutDown, EvtSelectorContext &it) const
Retrieve first entry of the next data stream.
StreamSpecs m_streamSpecsLast
Input stream specifiers (last used)
Definition: EventSelector.h:73
STL class.
Gaudi::Property< int > m_evtPrintFrequency
Definition: EventSelector.h:83
Gaudi::Property< std::string > m_streamManager
Definition: EventSelector.h:84
StatusCode reinitialize() override
Service override: Reinitialize service.
StatusCode last(Context &c) const override
Access last item in the iteration.
Definition of class EventIterator.
Definition: EventIterator.h:32
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:51
Gaudi::Property< int > m_evtMax
Definition: EventSelector.h:82
StatusCode initialize() override
IService implementation: Db event selector override.
Gaudi::Property< StreamSpecs > m_streamSpecs
Definition: EventSelector.h:80
Gaudi::Property< int > m_firstEvent
Definition: EventSelector.h:81
StatusCode finalize() override
IService implementation: Service finalization.
std::vector< std::string > StreamSpecs
Definition: EventSelector.h:57
SmartIF< IToolSvc > m_toolSvc
Definition: EventSelector.h:66
std::vector< Gaudi::Property< std::string > > Properties
Definition: EventSelector.h:58
Base class used to extend a class implementing other interfaces.
Definition: extends.h:10
Definition of class EventSelectorDataStream.
StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&refpAddr) const override
Create new Opaque address corresponding to the current record.
StatusCode previous(Context &refCtxt) const override
Get previous iteration item from the event loop context.
int m_streamCount
Input stream counter (0..oo, monotonely increasing)
Definition: EventSelector.h:77
Definition of class EventSelector.
Definition: EventSelector.h:53
bool m_reconfigure
Reconfigure occurred.
Definition: EventSelector.h:71
Opaque address interface definition.
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.