The Gaudi Framework  master (37c0b60a)
EventSelector.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 //====================================================================
12 // EventSelector.h
13 //--------------------------------------------------------------------
14 //
15 // Package : EventSelector (LHCb Event Selector Package)
16 //
17 // Author : M.Frank
18 // Created : 4/10/00
19 //
20 //====================================================================
21 // Modified : 11/11/06
22 //
23 // Author : Andres Felipe OSORIO OLIVEROS
24 // : Marco CLEMENCIC
25 //
26 //====================================================================
27 
28 #ifndef GAUDISVC_EVENTSELECTOR_EVENTSELECTOR_H
29 #define GAUDISVC_EVENTSELECTOR_EVENTSELECTOR_H 1
30 
31 // Include files
33 #include <GaudiKernel/Service.h>
34 
35 // STL include files
36 #include <vector>
37 
38 // Forward declarations
39 class IIncidentSvc;
40 class IAddressCreator;
41 class IToolSvc;
43 class EvtSelectorContext;
44 class IDataStreamTool;
45 
63 class EventSelector : public extends<Service, IEvtSelector> {
64 public:
68 
69  long int m_streamID;
70 
71 protected:
74 
76 
78 
80  bool m_reconfigure = false;
86  int m_streamCount = 0;
87 
88  // Properties
89  Gaudi::Property<StreamSpecs> m_streamSpecs{ this, "Input", {}, "input stream specifiers (for job options)" };
90  Gaudi::Property<int> m_firstEvent{ this, "FirstEvent", 0, "first event to be processed" };
91  Gaudi::Property<int> m_evtMax{ this, "EvtMax", INT_MAX, "maximum number of events to be processed" };
92  Gaudi::Property<int> m_evtPrintFrequency{ this, "PrintFreq", 10, "printout frequency" };
93  Gaudi::Property<std::string> m_streamManager{ this, "StreamManager", "DataStreamTool", "" };
94 
96  virtual void printEvtInfo( const EvtSelectorContext* iter ) const;
97 
98 public:
100  StatusCode initialize() override;
101 
103  StatusCode finalize() override;
104 
106  StatusCode reinitialize() override;
107 
109 
113  StatusCode createContext( Context*& refpCtxt ) const override;
114 
116 
120  StatusCode next( Context& refCtxt ) const override;
121 
123 
127  StatusCode next( Context& refCtxt, int jump ) const override;
128 
130 
135  StatusCode previous( Context& refCtxt ) const override;
136 
138 
143  StatusCode previous( Context& refCtxt, int jump ) const override;
144 
146 
150  StatusCode rewind( Context& refCtxt ) const override;
151 
153 
158  StatusCode createAddress( const Context& refCtxt, IOpaqueAddress*& refpAddr ) const override;
159 
161 
165  StatusCode releaseContext( Context*& refCtxt ) const override;
166 
175  StatusCode resetCriteria( const std::string& cr, Context& c ) const override;
176 
182  StatusCode last( Context& c ) const override;
183 
185  StatusCode firstOfNextStream( bool shutDown, EvtSelectorContext& it ) const;
187  StatusCode lastOfPreviousStream( bool shutDown, EvtSelectorContext& it ) const;
188 
190  using extends::extends;
191 };
192 
193 #endif // GAUDISVC_EVENTSELECTOR_EVENTSELECTOR_H
IAddressCreator
Definition: IAddressCreator.h:38
std::string
STL class.
EventSelector::firstOfNextStream
StatusCode firstOfNextStream(bool shutDown, EvtSelectorContext &it) const
Retrieve first entry of the next data stream.
Definition: EventSelector.cpp:53
EventSelector::lastOfPreviousStream
StatusCode lastOfPreviousStream(bool shutDown, EvtSelectorContext &it) const
Retrieve last entry of the previous data stream.
Definition: EventSelector.cpp:111
EventSelector::m_firstEvent
Gaudi::Property< int > m_firstEvent
Definition: EventSelector.h:90
EventSelector::m_toolSvc
SmartIF< IToolSvc > m_toolSvc
Definition: EventSelector.h:75
EventSelector::releaseContext
StatusCode releaseContext(Context *&refCtxt) const override
Release existing event iteration context.
Definition: EventSelector.cpp:301
IOpaqueAddress
Definition: IOpaqueAddress.h:33
std::vector< EventSelectorDataStream * >
EventSelector::StreamSpecs
std::vector< std::string > StreamSpecs
Definition: EventSelector.h:66
EventSelector::printEvtInfo
virtual void printEvtInfo(const EvtSelectorContext *iter) const
Progress report.
Definition: EventSelector.cpp:35
IEvtSelector.h
EventSelector::reinitialize
StatusCode reinitialize() override
Service override: Reinitialize service.
Definition: EventSelector.cpp:371
gaudirun.c
c
Definition: gaudirun.py:525
EventSelector::next
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.
Definition: EventSelector.cpp:187
EventSelector::finalize
StatusCode finalize() override
IService implementation: Service finalization.
Definition: EventSelector.cpp:389
EventSelector::previous
StatusCode previous(Context &refCtxt) const override
Get previous iteration item from the event loop context.
Definition: EventSelector.cpp:226
EvtSelectorContext
Definition of class EventIterator.
Definition: EventIterator.h:42
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:30
EventSelector::m_streamtool
IDataStreamTool * m_streamtool
Definition: EventSelector.h:77
EventSelector::m_streamCount
int m_streamCount
Input stream counter (0..oo, monotonely increasing)
Definition: EventSelector.h:86
EventSelector::Streams
std::vector< EventSelectorDataStream * > Streams
Definition: EventSelector.h:65
EventSelector::m_evtPrintFrequency
Gaudi::Property< int > m_evtPrintFrequency
Definition: EventSelector.h:92
StatusCode
Definition: StatusCode.h:65
EventSelector::createAddress
StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&refpAddr) const override
Create new Opaque address corresponding to the current record.
Definition: EventSelector.cpp:281
EventSelector::m_incidentSvc
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the indicent service.
Definition: EventSelector.h:73
SmartIF< IIncidentSvc >
extends
Base class used to extend a class implementing other interfaces.
Definition: extends.h:20
EventSelector::m_evtMax
Gaudi::Property< int > m_evtMax
Definition: EventSelector.h:91
EventSelector::initialize
StatusCode initialize() override
IService implementation: Db event selector override.
Definition: EventSelector.cpp:316
EventSelector::m_streamManager
Gaudi::Property< std::string > m_streamManager
Definition: EventSelector.h:93
EventSelector::last
StatusCode last(Context &c) const override
Access last item in the iteration.
Definition: EventSelector.cpp:258
Service.h
EventSelector::m_streams
Streams m_streams
Input streams.
Definition: EventSelector.h:84
EventSelector::m_streamID
long int m_streamID
Definition: EventSelector.h:69
EventSelector::m_streamSpecs
Gaudi::Property< StreamSpecs > m_streamSpecs
Definition: EventSelector.h:89
EventSelector::createContext
StatusCode createContext(Context *&refpCtxt) const override
Create a new event loop context.
Definition: EventSelector.cpp:161
EventSelectorDataStream
Definition of class EventSelectorDataStream.
Definition: EventSelectorDataStream.h:55
EventSelector::m_reconfigure
bool m_reconfigure
Reconfigure occurred.
Definition: EventSelector.h:80
IDataStreamTool
Definition: IDataStreamTool.h:32
EventSelector::m_streamSpecsLast
StreamSpecs m_streamSpecsLast
Input stream specifiers (last used)
Definition: EventSelector.h:82
EventSelector
Definition of class EventSelector.
Definition: EventSelector.h:63
IIncidentSvc
Definition: IIncidentSvc.h:33
IToolSvc
Definition: IToolSvc.h:29
Gaudi::Property
Implementation of property with value of concrete type.
Definition: Property.h:37
EventSelector::Properties
std::vector< Gaudi::Property< std::string > > Properties
Definition: EventSelector.h:67
EventSelector::rewind
StatusCode rewind(Context &refCtxt) const override
Rewind the dataset.
Definition: EventSelector.cpp:265