The Gaudi Framework  master (82fdf313)
Loading...
Searching...
No Matches
EventSelector.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
14#include <GaudiKernel/Service.h>
15#include <vector>
16
17class IIncidentSvc;
18class IAddressCreator;
19class IToolSvc;
22class IDataStreamTool;
23
41class EventSelector : public extends<Service, IEvtSelector> {
42public:
43 typedef std::vector<EventSelectorDataStream*> Streams;
44 typedef std::vector<std::string> StreamSpecs;
45 typedef std::vector<Gaudi::Property<std::string>> Properties;
46
47 long int m_streamID;
48
49protected:
52
54
56
58 bool m_reconfigure = false;
65
66 // Properties
67 Gaudi::Property<StreamSpecs> m_streamSpecs{ this, "Input", {}, "input stream specifiers (for job options)" };
68 Gaudi::Property<int> m_firstEvent{ this, "FirstEvent", 0, "first event to be processed" };
69 Gaudi::Property<int> m_evtMax{ this, "EvtMax", INT_MAX, "maximum number of events to be processed" };
70 Gaudi::Property<int> m_evtPrintFrequency{ this, "PrintFreq", 10, "printout frequency" };
71 Gaudi::Property<std::string> m_streamManager{ this, "StreamManager", "DataStreamTool", "" };
72
74 virtual void printEvtInfo( const EvtSelectorContext* iter ) const;
75
76public:
78 StatusCode initialize() override;
79
81 StatusCode finalize() override;
82
84 StatusCode reinitialize() override;
85
87
91 StatusCode createContext( Context*& refpCtxt ) const override;
92
94
98 StatusCode next( Context& refCtxt ) const override;
99
101
105 StatusCode next( Context& refCtxt, int jump ) const override;
106
108
113 StatusCode previous( Context& refCtxt ) const override;
114
116
121 StatusCode previous( Context& refCtxt, int jump ) const override;
122
124
128 StatusCode rewind( Context& refCtxt ) const override;
129
131
136 StatusCode createAddress( const Context& refCtxt, IOpaqueAddress*& refpAddr ) const override;
137
139
143 StatusCode releaseContext( Context*& refCtxt ) const override;
144
153 StatusCode resetCriteria( const std::string& cr, Context& c ) const override;
154
160 StatusCode last( Context& c ) const override;
161
163 StatusCode firstOfNextStream( bool shutDown, EvtSelectorContext& it ) const;
165 StatusCode lastOfPreviousStream( bool shutDown, EvtSelectorContext& it ) const;
166
168 using extends::extends;
169};
Definition of class EventSelectorDataStream.
Definition of class EventSelector.
bool m_reconfigure
Reconfigure occurred.
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.
StatusCode finalize() override
IService implementation: Service finalization.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the indicent service.
StatusCode lastOfPreviousStream(bool shutDown, EvtSelectorContext &it) const
Retrieve last entry of the previous data stream.
StatusCode rewind(Context &refCtxt) const override
Rewind the dataset.
StatusCode reinitialize() override
Service override: Reinitialize service.
std::vector< EventSelectorDataStream * > Streams
StreamSpecs m_streamSpecsLast
Input stream specifiers (last used)
StatusCode firstOfNextStream(bool shutDown, EvtSelectorContext &it) const
Retrieve first entry of the next data stream.
Gaudi::Property< int > m_evtMax
StatusCode initialize() override
IService implementation: Db event selector override.
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...
SmartIF< IToolSvc > m_toolSvc
StatusCode last(Context &c) const override
Access last item in the iteration.
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)
StatusCode releaseContext(Context *&refCtxt) const override
Release existing event iteration context.
Gaudi::Property< StreamSpecs > m_streamSpecs
StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&refpAddr) const override
Create new Opaque address corresponding to the current record.
virtual void printEvtInfo(const EvtSelectorContext *iter) const
Progress report.
IDataStreamTool * m_streamtool
StatusCode createContext(Context *&refpCtxt) const override
Create a new event loop context.
Streams m_streams
Input streams.
std::vector< std::string > StreamSpecs
long int m_streamID
Gaudi::Property< int > m_evtPrintFrequency
Gaudi::Property< std::string > m_streamManager
Gaudi::Property< int > m_firstEvent
Definition of class EventIterator.
Implementation of property with value of concrete type.
Definition PropertyFwd.h:27
IAddressCreator interface definition.
The interface implemented by the IncidentSvc service.
Opaque address interface definition.
The interface implemented by the IToolSvc base class.
Definition IToolSvc.h:28
Small smart pointer class with automatic reference counting for IInterface.
Definition SmartIF.h:28
This class is used for returning status codes from appropriate routines.
Definition StatusCode.h:64
Base class used to extend a class implementing other interfaces.
Definition extends.h:19