2 #include "GaudiKernel/SmartIF.h"
3 #include "GaudiKernel/Incident.h"
4 #include "GaudiKernel/MsgStream.h"
5 #include "GaudiKernel/IIncidentSvc.h"
6 #include "GaudiKernel/ISvcLocator.h"
7 #include "GaudiKernel/ISvcManager.h"
8 #include "GaudiKernel/IToolSvc.h"
9 #include "GaudiKernel/IDataStreamTool.h"
10 #include "GaudiKernel/IAddressCreator.h"
11 #include "GaudiKernel/PropertyMgr.h"
12 #include "GaudiKernel/EventSelectorDataStream.h"
24 declareProperty(
"Input", m_streamSpecs);
25 declareProperty(
"FirstEvent", m_firstEvent);
26 declareProperty(
"EvtMax", m_evtMax);
27 declareProperty(
"PrintFreq", m_evtPrintFrequency);
28 declareProperty(
"StreamManager", m_streamManager);
52 log <<
MSG::ALWAYS <<
"Reading Event record " << count+1
53 <<
". Record number within stream " << iter->
ID()+1
99 Context* ctxt =
nullptr;
105 iter.
set(
this, iter_id, ctxt, 0);
117 iter.
set(
this, -1, 0, 0);
133 Context* ctxt = iter.
context();
156 Context* ctxt =
nullptr;
162 iter.
set(
this, iter_id, ctxt, 0);
171 iter.
set(
this, -1, 0, 0);
187 ctxt->
set(0, -1, 0, 0);
191 while( --nskip > 0 ) {
195 log <<
MSG::ERROR <<
" createContext() failed to start with event number "
207 return next(refCtxt, 1);
214 if ( pIt->
ID() != -1 ) {
257 if ( pIt && jump > 0 ) {
298 ctxt->
set(0, -1, 0, 0);
301 while( --nskip > 0 ) {
305 log <<
MSG::ERROR <<
"rewind() failed to start with event number "
344 Context* it = pIt->context();
373 logger <<
MSG::ERROR <<
"EvtMax is an obsolete property of the event selector." <<
endmsg;
375 <<
";\" to process the requested number of events." <<
endmsg;
379 m_toolSvc = serviceLocator()->service(
"ToolSvc");
418 logger <<
MSG::ERROR <<
"Cannot reinitialize: service not in state initialized" <<
endmsg;
StatusCode lastOfPreviousStream(bool shutDown, EvtSelectorContext &it) const
Retrieve last entry of the previous data stream.
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the indicent service.
bool isInitialized() const
Check initialization status.
Definition of the MsgStream class used to transmit messages.
StatusCode initialize() override
IEvtSelector::Context * context() const
Access "real" iterator.
int m_evtPrintFrequency
Printout frequency.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
int m_firstEvent
First event to be processed.
StatusCode finalize() override
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
int m_evtMax
Maximum number of events to be processed.
The Event Selector Interface.
bool isSuccess() const
Test for a status code of SUCCESS.
StatusCode releaseContext(Context *&refCtxt) const override
Release existing event iteration context.
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...
IDataStreamTool * m_streamtool
IEvtSelector * selector() const
Retrieve event selector object.
virtual void printEvtInfo(const EvtSelectorContext *iter) const
Progress report.
virtual StatusCode resetCriteria(const std::string &cr, Context &c) const =0
Will set a new criteria for the selection of the next list of events and will change the state of the...
GAUDIPS_API Logger & logger()
Return the current logger instance.
StatusCode firstOfNextStream(bool shutDown, EvtSelectorContext &it) const
Retrieve first entry of the next data stream.
const std::string FailInputFile
could not open or read from this file
bool isFailure() const
Test for a status code of FAILURE.
StreamSpecs m_streamSpecsLast
Input stream specifiers (last used)
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
StatusCode rewind(Context &refCtxt) const override
Rewind the dataset.
StatusCode reinitialize() override
Service override: Reinitialize service.
StatusCode previous(Context &refCtxt) const override
Get previous iteration item from the event loop context.
#define DECLARE_COMPONENT(type)
Definition of class EventIterator.
This class is used for returning status codes from appropriate routines.
virtual StatusCode next(Context &c) const =0
Fetch the next event or the first event if it will be use soon after the creation of the context...
const std::string EndInputFile
an input file has been finished
virtual StatusCode createContext(Context *&c) const =0
Create and return a context object that will keep track of the state of selection.
virtual StatusCode releaseContext(Context *&) const =0
Release the Context object.
StatusCode initialize() override
IService implementation: Db event selector override.
StreamSpecs m_streamSpecs
Input stream specifiers (for job options)
long numStreamEvent() const
Access counter within stream.
virtual StatusCode setPriority(const std::string &name, int pri)=0
StatusCode finalize() override
IService implementation: Service finalization.
SmartIF< IToolSvc > m_toolSvc
virtual int getPriority(const std::string &name) const =0
void set(const IEvtSelector *sel, IDataStreamTool::size_type id, IEvtSelector::Context *it, IOpaqueAddress *pA)
Set the address of the iterator.
Base class used to extend a class implementing other interfaces.
Definition of class EventSelectorDataStream.
Base class for all Incidents (computing events).
virtual IDataStreamTool::size_type ID() const
Stream identifier.
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
virtual StatusCode previous(Context &c) const =0
Fetch the previous event.
Definition of class EventSelector.
void reset(TYPE *ptr=nullptr)
Set the internal pointer to the passed one disposing of the old one.
StatusCode createAddress(const Context &refCtxt, IOpaqueAddress *&refpAddr) const override
Create new Opaque address corresponding to the current record.
const std::string & criteria() const
Retrieve stream criteria.
bool m_reconfigure
Reconfigure occurred.
Opaque address interface definition.
StatusCode last(Context &c) const override
Access last item in the iteration.
std::string m_streamManager
virtual StatusCode createAddress(const Context &c, IOpaqueAddress *&iop) const =0
Create an IOpaqueAddress object from the event fetched.
long numEvent() const
Access counter.
StatusCode createContext(Context *&refpCtxt) const override
Create a new event loop context.
const std::string & dbName() const
Retrieve stream dbName.
void setChecked() const
Ignore the checking code;.
const std::string BeginInputFile
a new input file has been started