40 info() <<
"End of event input reached." <<
endmsg;
44 always() <<
"Reading Event record " << count + 1 <<
". Record number within stream " << iter->
ID() + 1 <<
": " 48 info() <<
"End of event input reached." <<
endmsg;
56 if (
m_reconfigure ) const_cast<EventSelector*>(
this )->m_reconfigure =
false;
60 if (
s->isInitialized() ) {
62 if (
s->selector() && iter.
context() ) {
64 s->selector()->releaseContext( ctxt ).ignore();
79 if ( !
s->isInitialized() ) {
87 Context* ctxt =
nullptr;
88 status =
sel->createContext( ctxt );
90 status =
sel->resetCriteria(
s->criteria(), *ctxt );
92 iter.
set(
this, iter_id, ctxt, 0 );
105 iter.
set(
this, -1, 0, 0 );
117 if (
s->isInitialized() ) {
119 if (
s->selector() && iter.
context() ) {
120 Context* ctxt = iter.
context();
121 if ( status =
s->selector()->releaseContext( ctxt ); !status )
return status;
136 if ( !
s->isInitialized() ) {
143 Context* ctxt =
nullptr;
144 status =
sel->createContext( ctxt );
146 status =
sel->resetCriteria(
s->criteria(), *ctxt );
148 iter.
set(
this, iter_id, ctxt, 0 );
157 iter.
set(
this, -1, 0, 0 );
172 ctxt->set( 0, -1, 0, 0 );
175 while ( --nskip > 0 ) {
194 if ( pIt->
ID() != -1 ) {
232 if ( pIt && jump > 0 ) {
234 for (
int i = 0; i < jump && sc.
isSuccess(); ++i ) {
240 sc =
sel->previous( *it );
270 ctxt->
set( 0, -1, 0, 0 );
273 while ( --nskip > 0 ) {
283 auto cpIt = dynamic_cast<const EvtSelectorContext*>( &refCtxt );
284 auto pIt = const_cast<EvtSelectorContext*>( cpIt );
289 auto it = pIt->context();
290 auto sel =
s->selector();
293 sc =
sel->createAddress( *it, pAddr );
294 if ( sc.
isSuccess() ) { refpAddr = pAddr; }
295 pIt->set( it, pAddr );
304 auto cpIt = dynamic_cast<const EvtSelectorContext*>( refCtxt );
308 auto it = pIt->context();
309 auto sel =
s->selector();
310 if ( it &&
sel ) { sc =
sel->releaseContext( it ); }
321 error() <<
"Error initializing base class Service!" <<
endmsg;
327 fatal() <<
"Error retrieving IncidentSvc." <<
endmsg;
331 error() <<
"EvtMax is an obsolete property of the event selector." <<
endmsg;
332 error() <<
"Please set \"ApplicationMgr.EvtMax = " <<
m_evtMax <<
";\" to process the requested number of events." 339 error() <<
" Could not locate the Tool Service! " <<
endmsg;
374 error() <<
"Cannot reinitialize: service not in state initialized" <<
endmsg;
SmartIF< IIncidentSvc > m_incidentSvc
Reference to the indicent service.
StatusCode initialize() override
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
virtual StatusCode setPriority(std::string_view name, int pri)=0
StatusCode finalize() override
Gaudi::StateMachine::State FSMState() const override
IEvtSelector::Context * context() const
Access "real" iterator.
The Event Selector Interface.
StatusCode releaseContext(Context *&refCtxt) const override
Release existing event iteration context.
IDataStreamTool * m_streamtool
constexpr static const auto SUCCESS
MsgStream & always() const
shortcut for the method msgStream(MSG::ALWAYS)
MsgStream & info() const
shortcut for the method msgStream(MSG::INFO)
MSG::Level msgLevel() const
get the cached level (originally extracted from the embedded MsgStream)
StreamSpecs m_streamSpecsLast
Input stream specifiers (last used)
#define DECLARE_COMPONENT(type)
StatusCode next(Context &refCtxt) const override
Get next iteration item from the event loop context.
StatusCode service(const Gaudi::Utils::TypeNameString &name, T *&svc, bool createIf=true)
Templated method to access a service by name.
const std::string & name() const override
Retrieve name of the service.
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
Gaudi::Property< int > m_evtPrintFrequency
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
Gaudi::Property< std::string > m_streamManager
virtual int getPriority(std::string_view name) const =0
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.
Definition of class EventIterator.
long numEvent() const
Access counter.
This class is used for returning status codes from appropriate routines.
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...
virtual void printEvtInfo(const EvtSelectorContext *iter) const
Progress report.
Gaudi::Property< int > m_evtMax
StatusCode firstOfNextStream(bool shutDown, EvtSelectorContext &it) const
Retrieve first entry of the next data stream.
StatusCode initialize() override
IService implementation: Db event selector override.
Gaudi::Property< StreamSpecs > m_streamSpecs
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
Gaudi::Property< int > m_firstEvent
StatusCode finalize() override
IService implementation: Service finalization.
SmartIF< IToolSvc > m_toolSvc
StatusCode lastOfPreviousStream(bool shutDown, EvtSelectorContext &it) const
Retrieve last entry of the previous data stream.
const StatusCode & ignore() const
Ignore/check StatusCode.
virtual unsigned long release()=0
Release Interface instance.
void set(const IEvtSelector *sel, IDataStreamTool::size_type id, IEvtSelector::Context *it, IOpaqueAddress *pA)
Set the address of the iterator.
Definition of class EventSelectorDataStream.
Base class for all Incidents (computing events).
constexpr static const auto FAILURE
virtual IDataStreamTool::size_type ID() const
Stream identifier.
long numStreamEvent() const
Access counter within stream.
IDataStreamTool::size_type increaseCounters(bool reset=false)
Increase counters.
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.
bool m_reconfigure
Reconfigure occurred.
Opaque address interface definition.
StatusCode last(Context &c) const override
Access last item in the iteration.
StatusCode createContext(Context *&refpCtxt) const override
Create a new event loop context.
MsgStream & fatal() const
shortcut for the method msgStream(MSG::FATAL)
const StatusCode & setChecked(bool checked=true) const
Check/uncheck StatusCode.
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.