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 s->selector()->releaseContext( ctxt );
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 );
269 ctxt->
set( 0, -1, 0, 0 );
272 while ( --nskip > 0 ) {
286 auto cpIt = dynamic_cast<const EvtSelectorContext*>( &refCtxt );
287 auto pIt = const_cast<EvtSelectorContext*>( cpIt );
292 auto it = pIt->context();
293 auto sel =
s->selector();
296 sc =
sel->createAddress( *it, pAddr );
297 if ( sc.
isSuccess() ) { refpAddr = pAddr; }
298 pIt->set( it, pAddr );
307 auto cpIt = dynamic_cast<const EvtSelectorContext*>( refCtxt );
311 auto it = pIt->context();
312 auto sel =
s->selector();
313 if ( it &&
sel ) { sc =
sel->releaseContext( it ); }
324 error() <<
"Error initializing base class Service!" <<
endmsg;
330 fatal() <<
"Error retrieving IncidentSvc." <<
endmsg;
334 error() <<
"EvtMax is an obsolete property of the event selector." <<
endmsg;
335 error() <<
"Please set \"ApplicationMgr.EvtMax = " <<
m_evtMax <<
";\" to process the requested number of events." 342 error() <<
" Could not locate the Tool Service! " <<
endmsg;
377 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.
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
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
virtual StatusCode setPriority(const std::string &name, int pri)=0
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.
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.
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.