| # Gaudi Framework, version v20r4
Generated: 8 Jan 2009

# EventSelector Class Reference

`#include <EventSelector.h>`

Inheritance diagram for EventSelector:

[legend]
Collaboration diagram for EventSelector:

[legend]

List of all members.

## Detailed Description

Definition of class EventSelector.

Basic event selector service. The event selector service itself is able to connect other services to attached streams.

History: +---------+----------------------------------------------+---------+ | Date | Comment | Who | +---------+----------------------------------------------+---------+ | 3/10/00 | Initial version | M.Frank | +---------+----------------------------------------------+---------+

Author:
  Markus Frank

Version:
  1.0

Definition at line 50 of file EventSelector.h.

## Public Types
typedef std::vector < EventSelectorDataStream * > | Streams
typedef std::vector< std::string > | StreamSpecs
typedef std::vector < StringProperty > | Properties
## Public Member Functions
virtual StatusCode | initialize ()
| IService implementation: Db event selector override.
virtual StatusCode | finalize ()
| IService implementation: Service finalization.
virtual StatusCode | reinitialize ()
| Service override: Reinitialize service.
virtual StatusCode | queryInterface (const InterfaceID &riid, void **ppvInterface)
| Service override: queryInterface.
virtual StatusCode | createContext (Context *&refpCtxt) const
| Create a new event loop context.
virtual StatusCode | next (Context &refCtxt) const
| Get next iteration item from the event loop context.
virtual StatusCode | next (Context &refCtxt, int jump) const
| Get next iteration item from the event loop context, but skip jump elements.
virtual StatusCode | previous (Context &refCtxt) const
| Get previous iteration item from the event loop context.
virtual StatusCode | previous (Context &refCtxt, int jump) const
| Get previous iteration item from the event loop context, but skip jump elements.
virtual StatusCode | rewind (Context &refCtxt) const
| Rewind the dataset.
virtual StatusCode | createAddress (const Context &refCtxt, IOpaqueAddress *&refpAddr) const
| Create new Opaque address corresponding to the current record.
virtual StatusCode | releaseContext (Context *&refCtxt) const
| Release existing event iteration context.
virtual StatusCode | resetCriteria (const std::string &cr, Context &c) const
| Will set a new criteria for the selection of the next list of events and will change the state of the context in a way to point to the new list.
virtual StatusCode | last (Context &c) const
| Access last item in the iteration.
StatusCode | firstOfNextStream (bool shutDown, EvtSelectorContext &it) const
| Retrieve first entry of the next data stream.
StatusCode | lastOfPreviousStream (bool shutDown, EvtSelectorContext &it) const
| Retrieve last entry of the previous data stream.
| EventSelector (const std::string &name, ISvcLocator *svcloc)
| Standard Constructor.
virtual | ~EventSelector ()
| Standard Destructor.
## Public Attributes
long int | m_streamID
## Protected Member Functions
virtual void | printEvtInfo (const EvtSelectorContext *iter) const
| Progress report.
## Protected Attributes
IIncidentSvc * | m_incidentSvc
| Reference to the indicent service.
IToolSvc * | m_toolSvc
IDataStreamTool * | m_streamtool
bool | m_reconfigure
| Reconfigure occurred.
StreamSpecs | m_streamSpecs
| Input stream specifiers (for job options).
StreamSpecs | m_streamSpecsLast
| Input stream specifiers (last used).
Streams | m_streams
| Input streams.
int | m_streamCount
| Input stream counter (0..oo, monotonely increasing).
int | m_firstEvent
| First event to be processed.
int | m_evtMax
| Maximum number of events to be processed.
int | m_evtPrintFrequency
| Printout frequency.
std::string | m_streamManager

## Member Typedef Documentation

typedef std::vector<EventSelectorDataStream*> EventSelector::Streams

Definition at line 52 of file EventSelector.h.

typedef std::vector<std::string> EventSelector::StreamSpecs

Definition at line 53 of file EventSelector.h.

typedef std::vector<StringProperty> EventSelector::Properties

Definition at line 54 of file EventSelector.h.

## Constructor & Destructor Documentation

EventSelector::EventSelector | ( | const std::string & | name,
|  | ISvcLocator * | svcloc |
| ) |  |  |

Standard Constructor.

Definition at line 26 of file EventSelector.cpp.

    00027   : Service( name, svcloc)
    00028 {
    00029   m_incidentSvc       = 0;
    00030   m_toolSvc           = 0;
    00031   m_streamCount       = 0;
    00032   m_firstEvent        = 0;
    00033   m_evtPrintFrequency = 10;
    00034   m_evtMax            = INT_MAX;
    00035   declareProperty( "Input",      m_streamSpecs);
    00036   declareProperty( "FirstEvent", m_firstEvent);
    00037   declareProperty( "EvtMax",     m_evtMax);
    00038   declareProperty( "PrintFreq",  m_evtPrintFrequency);
    00039   declareProperty( "StreamManager",  m_streamManager="DataStreamTool");
    00040   m_reconfigure = false;
    00041 }

EventSelector::~EventSelector | ( |  | ) | `[virtual]`

Standard Destructor.

Definition at line 44 of file EventSelector.cpp.

    00045 {
    00046 }

## Member Function Documentation

void EventSelector::printEvtInfo | ( | const EvtSelectorContext * | iter | ) | const`[protected, virtual]`

Progress report.

Definition at line 56 of file EventSelector.cpp.

    00056                                                                      {
    00057   if ( 0 != iter )  {
    00058     long count = iter->numEvent();
    00059     // Print an message every m_evtPrintFrequency events
    00060     if ( 0 == iter->context() )   {
    00061       MsgStream log(messageService(), name());
    00062       log << MSG::INFO << "End of event input reached." << endreq;
    00063     }
    00064     else if( iter->numStreamEvent() == -1 ) {
    00065       // Intial value for this stream
    00066     }
    00067     else if( m_evtPrintFrequency != -1 && (count % m_evtPrintFrequency == 0))   {
    00068       MsgStream log(messageService(), name());
    00069       log << MSG::ALWAYS << "Reading Event record " << count+1
    00070           << ". Record number within stream " << iter->ID()+1
    00071           << ": " << iter->numStreamEvent()+1 << endreq;
    00072     }
    00073   }
    00074   else  {
    00075     MsgStream log(messageService(), name());
    00076     log << MSG::INFO << "End of event input reached." << endreq;
    00077   }
    00078 }

StatusCode EventSelector::initialize | ( |  | ) | `[virtual]`

IService implementation: Db event selector override.

Reimplemented from Service.

Definition at line 385 of file EventSelector.cpp.

    00385                                         {
    00386   // Initialize base class
    00387   StatusCode status = Service::initialize();
    00388   MsgStream logger(messageService(), name());
    00389   if ( !status.isSuccess() )    {
    00390     logger << MSG::ERROR << "Error initializing base class Service!" << endreq;
    00391     return status;
    00392   }
    00393   // Get the references to the services that are needed by the ApplicationMgr itself
    00394   StatusCode sc = serviceLocator()->service("IncidentSvc", m_incidentSvc, true);
    00395   if( !sc.isSuccess() )  {
    00396     logger << MSG::FATAL << "Error retrieving IncidentSvc." << endreq;
    00397     return sc;
    00398   }
    00399   if ( m_evtMax != INT_MAX )   {
    00400     logger << MSG::ERROR << "EvtMax is an obsolete property of the event selector." << endreq;
    00401     logger << MSG::ERROR << "Please set \"ApplicationMgr.EvtMax = " << m_evtMax
    00402            << ";\" to process the requested number of events." << endreq;
    00403     return StatusCode::FAILURE;
    00404   }
    00405
    00406   m_toolSvc = 0 ;
    00407   sc = serviceLocator()->service( "ToolSvc" , m_toolSvc , true );
    00408   if ( sc.isFailure() )
    00409   { logger << MSG::ERROR << " Could not locate the Tool Service! " << endreq ;
    00410   return StatusCode::FAILURE ;}
    00411
    00412   sc = m_toolSvc->retrieveTool(m_streamManager.c_str(), m_streamtool, this );
    00413
    00414   if( sc.isFailure() ) {
    00415     logger << MSG::ERROR << "Error initializing "
    00416            << m_streamManager << endreq;
    00417     return sc;
    00418   }
    00419
    00420   sc = m_streamtool->clear();
    00421   if( sc.isFailure() ) {
    00422     // Message already printed by the tool
    00423     return sc;
    00424   }
    00425
    00426   status = m_streamtool->addStreams(m_streamSpecs);
    00427
    00428   m_streamSpecsLast = m_streamSpecs;
    00429
    00430   m_streamID          = 0;
    00431
    00432   return status;
    00433 }

StatusCode EventSelector::finalize | ( | void |  | ) | `[virtual]`

IService implementation: Service finalization.

Reimplemented from Service.

Definition at line 455 of file EventSelector.cpp.

    00455                                       {
    00456
    00457   MsgStream log(msgSvc(), name());
    00458
    00459   log << MSG::DEBUG << "finalize()" << endreq;
    00460
    00461   if( m_incidentSvc ) {
    00462     m_incidentSvc->release();
    00463     m_incidentSvc = 0 ;
    00464   }
    00465
    00466   if( m_streamtool ) {
    00467     m_streamtool->release();
    00468     m_streamtool = 0 ;
    00469   }
    00470
    00471   if( m_toolSvc ) {
    00472     m_toolSvc->release();
    00473     m_toolSvc = 0 ;
    00474   }
    00475
    00476   return Service::finalize();
    00477 }

StatusCode EventSelector::reinitialize | ( |  | ) | `[virtual]`

Service override: Reinitialize service.

Reimplemented from Service.

Definition at line 436 of file EventSelector.cpp.

    00436                                        {
    00437   if ( FSMState() != Gaudi::StateMachine::INITIALIZED ) {
    00438     MsgStream logger(messageService(), name());
    00439     logger << MSG::ERROR << "Cannot reinitialize: service not in state initialized" << endreq;
    00440     return StatusCode::FAILURE;
    00441   }
    00442
    00443   if( m_streamSpecsLast != m_streamSpecs ) {
    00444     StatusCode status = m_streamtool->clear();
    00445     if ( status.isFailure() ) return status;
    00446     m_streamSpecsLast = m_streamSpecs;
    00447     m_reconfigure = true;
    00448     return m_streamtool->addStreams(m_streamSpecs);
    00449   }
    00450
    00451   return StatusCode::SUCCESS;
    00452 }

StatusCode EventSelector::queryInterface | ( | const InterfaceID & | riid,
|  | void ** | ppvInterface |
| ) |  |  | `[virtual]`

Service override: queryInterface.

Reimplemented from Service.

Definition at line 375 of file EventSelector.cpp.

    00375                                                                                       {
    00376   if ( riid == IID_IEvtSelector )  {
    00377     *ppvInterface = (IEvtSelector*)this;
    00378     addRef();
    00379     return SUCCESS;
    00380   }
    00381   return Service::queryInterface( riid, ppvInterface );
    00382 }

StatusCode EventSelector::createContext | ( | Context *& | refpCtxt | ) | const`[virtual]`

Create a new event loop context.

Parameters:

  | refpCtxt | [IN/OUT] Reference to pointer to store the context

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 188 of file EventSelector.cpp.

    00189 {
    00190   // Max event is zero. Return begin = end
    00191   refpCtxt = 0;
    00192   if ( m_firstEvent < 0 ) {
    00193     MsgStream log(messageService(), name());
    00194     log << MSG::ERROR  << "First Event = " << m_firstEvent << " not valid" << endreq;
    00195     log << MSG::ERROR  << "It should be > 0 " << endreq;
    00196     return StatusCode::FAILURE;    // if failure => iterators = end();
    00197   }
    00198   EvtSelectorContext* ctxt = new EvtSelectorContext(this);
    00199   ctxt->set(0, -1, 0, 0);
    00200   firstOfNextStream(true, *ctxt).ignore();
    00201   refpCtxt = ctxt;
    00202   long nskip = m_firstEvent;
    00203   while( --nskip > 0 )    {
    00204     StatusCode sc = next(*refpCtxt);
    00205     if ( sc.isFailure() ) {
    00206       MsgStream log(messageService(), name());
    00207       log << MSG::ERROR << " createContext() failed to start with event number "
    00208           << m_firstEvent << endreq;
    00209       releaseContext(refpCtxt);
    00210       refpCtxt = 0;
    00211       return StatusCode::FAILURE;
    00212     }
    00213   }
    00214   return StatusCode::SUCCESS;
    00215 }

StatusCode EventSelector::next | ( | Context & | refCtxt | ) | const`[virtual]`

Get next iteration item from the event loop context.

Parameters:

  | refCtxt | [IN/OUT] Reference to the context

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 218 of file EventSelector.cpp.

    00218                                                       {
    00219   return next(refCtxt, 1);
    00220 }

StatusCode EventSelector::next | ( | Context & | refCtxt,
|  | int | jump |
| ) |  |  | const`[virtual]`

Get next iteration item from the event loop context, but skip jump elements.

Parameters:

  | refCtxt | [IN/OUT] Reference to the context

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 223 of file EventSelector.cpp.

    00223                                                                        {
    00224   EvtSelectorContext *pIt  = dynamic_cast<EvtSelectorContext*>(&refCtxt);
    00225   if ( pIt )    {
    00226     if ( pIt->ID() != -1 ) {
    00227       const EventSelectorDataStream* s = m_streamtool->getStream(pIt->ID());
    00228       Context* it = pIt->context();
    00229       IEvtSelector* sel = s->selector();
    00230       if ( it && sel )    { // First exploit the current stream
    00231         StatusCode sc = sel->next(*it);  // This stream is empty: advance to the next stream
    00232         if ( !sc.isSuccess() )   {
    00233           sc = firstOfNextStream(true, *pIt);
    00234           if (sc.isSuccess() ) sc = next(*pIt);
    00235         }
    00236         else  {
    00237           pIt->increaseCounters(false);
    00238           pIt->set(it, 0);
    00239           printEvtInfo(pIt);
    00240         }
    00241         return sc;
    00242       }
    00243       else if ( m_reconfigure )  {
    00244         StatusCode sc = firstOfNextStream(false, *pIt);
    00245         printEvtInfo(pIt);
    00246         return sc;
    00247       }
    00248     }
    00249     else if ( m_reconfigure )  {
    00250       StatusCode sc = firstOfNextStream(false, *pIt);
    00251       printEvtInfo(pIt);
    00252       return sc;
    00253     }
    00254     pIt->increaseCounters(false);
    00255   }
    00256   printEvtInfo(pIt);
    00257   return StatusCode::FAILURE;
    00258 }

StatusCode EventSelector::previous | ( | Context & | refCtxt | ) | const`[virtual]`

Get previous iteration item from the event loop context.

Parameters:

  | refCtxt | [IN/OUT] Reference to the context
  | jump | [IN] Number of events to be skipped

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 261 of file EventSelector.cpp.

    00261                                                           {
    00262   return previous(refCtxt, 1);
    00263 }

StatusCode EventSelector::previous | ( | Context & | refCtxt,
|  | int | jump |
| ) |  |  | const`[virtual]`

Get previous iteration item from the event loop context, but skip jump elements.

Parameters:

  | refCtxt | [IN/OUT] Reference to the context
  | jump | [IN] Number of events to be skipped

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 266 of file EventSelector.cpp.

    00266                                                               {
    00267   EvtSelectorContext *pIt  = dynamic_cast<EvtSelectorContext*>(&it);
    00268   if ( pIt && jump > 0 )    {
    00269     StatusCode sc = StatusCode::SUCCESS;
    00270     for ( int i = 0; i < jump && sc.isSuccess(); ++i ) {
    00271       const EventSelectorDataStream* s = m_streamtool->getStream(pIt->ID());
    00272       Context* it = pIt->context();
    00273       IEvtSelector* sel = s->selector();
    00274       if ( it && sel )    { // First exploit the current stream
    00275                             // This stream is empty: advance to the next stream
    00276         sc = sel->previous(*it);  // This stream is empty: advance to the next stream
    00277         if ( !sc.isSuccess() )   {
    00278           sc = lastOfPreviousStream(true, *pIt);
    00279         }
    00280         else  {
    00281           pIt->increaseCounters(false);
    00282           pIt->set(it, 0);
    00283         }
    00284         printEvtInfo(pIt);
    00285         if ( !sc.isSuccess() ) {
    00286           return sc;
    00287         }
    00288       }
    00289       pIt->increaseCounters(false);
    00290     }
    00291     return sc;
    00292   }
    00293   printEvtInfo(pIt);
    00294   return StatusCode::FAILURE;
    00295 }

StatusCode EventSelector::rewind | ( | Context & | refCtxt | ) | const`[virtual]`

Rewind the dataset.

Parameters:

  | refCtxt | [IN/OUT] Reference to the context

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 306 of file EventSelector.cpp.

    00306                                                         {
    00307   EvtSelectorContext *ctxt  = dynamic_cast<EvtSelectorContext*>(&refCtxt);
    00308   if ( ctxt )    {
    00309     ctxt->set(0, -1, 0, 0);
    00310     firstOfNextStream(true, *ctxt);
    00311     long nskip = m_firstEvent;
    00312     while( --nskip > 0 )    {
    00313       StatusCode sc = next(*ctxt);
    00314       if ( sc.isFailure() ) {
    00315         MsgStream log(messageService(), name());
    00316         log << MSG::ERROR << "rewind() failed to start with event number "
    00317             << m_firstEvent << endreq;
    00318         return StatusCode::FAILURE;
    00319       }
    00320     }
    00321     return StatusCode::SUCCESS;
    00322   }
    00323   return StatusCode::FAILURE;
    00324 }

StatusCode EventSelector::createAddress | ( | const Context & | refCtxt,
|  | IOpaqueAddress *& | refpAddr |
| ) |  |  | const`[virtual]`

Create new Opaque address corresponding to the current record.

Parameters:

  | refCtxt | [IN/OUT] Reference to the context
  | refpAddr | [OUT] Reference to address pointer

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 328 of file EventSelector.cpp.

    00330 {
    00331   const EvtSelectorContext *cpIt  = dynamic_cast<const EvtSelectorContext*>(&refCtxt);
    00332   EvtSelectorContext *pIt  = const_cast<EvtSelectorContext*>(cpIt);
    00333   refpAddr = 0;
    00334   if ( pIt )    {
    00335     const EventSelectorDataStream* s = m_streamtool->getStream(pIt->ID());
    00336     Context* it = pIt->context();
    00337     IEvtSelector* sel = s->selector();
    00338     if ( it && sel )    {
    00339       IOpaqueAddress* pAddr = 0;
    00340       StatusCode sc = sel->createAddress(*it, pAddr);
    00341       if ( sc.isSuccess() )  {
    00342         refpAddr = pAddr;
    00343       }
    00344       pIt->set(it, pAddr);
    00345       return sc;
    00346     }
    00347   }
    00348   return StatusCode::FAILURE;
    00349 }

StatusCode EventSelector::releaseContext | ( | Context *& | refCtxt | ) | const`[virtual]`

Release existing event iteration context.

Parameters:

  | refCtxt | [IN/OUT] Reference to the context

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 352 of file EventSelector.cpp.

    00352                                                                  {
    00353   const EvtSelectorContext *cpIt = dynamic_cast<const EvtSelectorContext*>(refCtxt);
    00354   EvtSelectorContext       *pIt  = const_cast<EvtSelectorContext*>(cpIt);
    00355   if ( pIt && pIt->ID() >= 0 && pIt->ID() < (long)m_streamtool->size() ) {
    00356     const EventSelectorDataStream* s = m_streamtool->getStream(pIt->ID());
    00357     Context* it = pIt->context();
    00358     IEvtSelector* sel = s->selector();
    00359     if ( it && sel )    {
    00360       StatusCode sc = sel->releaseContext(it);
    00361       if ( sc.isSuccess() )  {
    00362         refCtxt = 0;
    00363         delete pIt;
    00364         return sc;
    00365       }
    00366     }
    00367   }
    00368   if ( pIt )   {
    00369     delete pIt;
    00370   }
    00371   return StatusCode::SUCCESS;
    00372 }

StatusCode EventSelector::resetCriteria | ( | const std::string & | cr,
|  | Context & | c |
| ) |  |  | const`[virtual]`

Will set a new criteria for the selection of the next list of events and will change the state of the context in a way to point to the new list.

Parameters:

  | cr | The new criteria string.
  | c | Reference pointer to the Context object.

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 49 of file EventSelector.cpp.

    00051 {
    00052   return StatusCode::FAILURE;
    00053 }

StatusCode EventSelector::last | ( | Context & | c | ) | const`[virtual]`

Access last item in the iteration.

Parameters:

  | c | Reference to the Context object.

Returns:
  StatusCode indicating success or failure

Implements IEvtSelector.

Definition at line 298 of file EventSelector.cpp.

    00298                                                      {
    00299   EvtSelectorContext *pIt  = dynamic_cast<EvtSelectorContext*>(&refCtxt);
    00300   if ( pIt )    {
    00301   }
    00302   return StatusCode::FAILURE;
    00303 }

StatusCode EventSelector::firstOfNextStream | ( | bool | shutDown,
|  | EvtSelectorContext & | it |
| ) |  |  | const

Retrieve first entry of the next data stream.

Definition at line 82 of file EventSelector.cpp.

    00082                                                                               {
    00083   StatusCode status = StatusCode::SUCCESS;
    00084   IDataStreamTool::size_type iter_id = (m_reconfigure) ? 0 : iter.ID()+1;
    00085   if ( m_reconfigure ) const_cast<EventSelector*>(this)->m_reconfigure = false;
    00086   if ( shutDown )   {
    00087     if ( iter.ID() >= 0 && iter.ID() < (long)m_streamtool->size() )   {
    00088       const EventSelectorDataStream* s = m_streamtool->getStream(iter.ID());
    00089       if ( s->isInitialized() )    {
    00090         EventSelector* thisPtr = const_cast<EventSelector*>(this);
    00091         if ( s->selector() && iter.context() )  {
    00092           Context* ctxt = iter.context();
    00093           s->selector()->releaseContext(ctxt).ignore();
    00094           iter.set(0,0);
    00095         }
    00096         status = thisPtr->m_streamtool->finalizeStream(const_cast<EventSelectorDataStream*>(s));
    00097         iter.set(0,0);
    00098       }
    00099     }
    00100   }
    00101
    00102   const EventSelectorDataStream* s ;
    00103   status = m_streamtool->getNextStream( s , iter_id );
    00104
    00105   if ( status.isSuccess() )   {
    00106
    00107     if ( !s->isInitialized() )    {
    00108       EventSelector* thisPtr = const_cast<EventSelector*>(this);
    00109       status = thisPtr->m_streamtool->initializeStream(const_cast<EventSelectorDataStream*>(s));
    00110     }
    00111
    00112     if ( status.isSuccess() ) {
    00113       const IEvtSelector* sel = s->selector();
    00114       if ( sel )    {
    00115         Context* ctxt = 0;
    00116         status = sel->createContext(ctxt);
    00117         if ( status.isSuccess() )   {
    00118           status = sel->resetCriteria(s->criteria(), *ctxt);
    00119           if ( status.isSuccess() )   {
    00120             MsgStream log(messageService(), name());
    00121             iter.set(this, iter_id, ctxt, 0);
    00122             log << MSG::INFO << *s << endreq;
    00123             return StatusCode::SUCCESS;
    00124           }
    00125         }
    00126       }
    00127     }
    00128   }
    00129
    00130   iter.set(this, -1, 0, 0);
    00131   status.setChecked();
    00132   return StatusCode::FAILURE;
    00133 }

StatusCode EventSelector::lastOfPreviousStream | ( | bool | shutDown,
|  | EvtSelectorContext & | it |
| ) |  |  | const

Retrieve last entry of the previous data stream.

Definition at line 137 of file EventSelector.cpp.

    00137                                                                                  {
    00138   StatusCode status = StatusCode::SUCCESS;
    00139   if ( shutDown )   {
    00140     if ( iter.ID() >= 0 && iter.ID() < (long)m_streamtool->size() )   {
    00141       const EventSelectorDataStream* s = m_streamtool->getStream(iter.ID());
    00142       if ( s->isInitialized() )    {
    00143         EventSelector* thisPtr = const_cast<EventSelector*>(this);
    00144         if ( s->selector() && iter.context() )  {
    00145           Context* ctxt = iter.context();
    00146           s->selector()->releaseContext(ctxt);
    00147           iter.set(0,0);
    00148         }
    00149         status = thisPtr->m_streamtool->finalizeStream(const_cast<EventSelectorDataStream*>(s));
    00150         iter.set(0,0);
    00151       }
    00152     }
    00153   }
    00154
    00155   IDataStreamTool::size_type iter_id = iter.ID()-1;
    00156   const EventSelectorDataStream* s ;
    00157   status = m_streamtool->getPreviousStream( s , iter_id );
    00158
    00159   if ( status.isSuccess() )   {
    00160
    00161     if ( !s->isInitialized() )    {
    00162       EventSelector* thisPtr = const_cast<EventSelector*>(this);
    00163       status = thisPtr->m_streamtool->initializeStream(const_cast<EventSelectorDataStream*>(s));
    00164     }
    00165     if ( status.isSuccess() )   {
    00166       const IEvtSelector* sel = s->selector();
    00167       if ( sel )  {
    00168         Context* ctxt = 0;
    00169         status = sel->createContext(ctxt);
    00170         if ( status.isSuccess() )   {
    00171           status = sel->resetCriteria(s->criteria(), *ctxt);
    00172           if ( status.isSuccess() )   {
    00173             MsgStream log(messageService(), name());
    00174             iter.set(this, iter_id, ctxt, 0);
    00175             log << MSG::INFO << *s << endreq;
    00176             return StatusCode::SUCCESS;
    00177           }
    00178         }
    00179       }
    00180     }
    00181   }
    00182
    00183   iter.set(this, -1, 0, 0);
    00184   return StatusCode::FAILURE;
    00185 }

## Member Data Documentation

long int EventSelector::m_streamID

Definition at line 56 of file EventSelector.h.

IIncidentSvc* EventSelector::m_incidentSvc`[protected]`

Reference to the indicent service.

Definition at line 60 of file EventSelector.h.

IToolSvc* EventSelector::m_toolSvc`[protected]`

Definition at line 62 of file EventSelector.h.

IDataStreamTool* EventSelector::m_streamtool`[protected]`

Definition at line 64 of file EventSelector.h.

bool EventSelector::m_reconfigure`[protected]`

Reconfigure occurred.

Definition at line 67 of file EventSelector.h.

StreamSpecs EventSelector::m_streamSpecs`[protected]`

Input stream specifiers (for job options).

Definition at line 69 of file EventSelector.h.

StreamSpecs EventSelector::m_streamSpecsLast`[protected]`

Input stream specifiers (last used).

Definition at line 71 of file EventSelector.h.

Streams EventSelector::m_streams`[protected]`

Input streams.

Definition at line 73 of file EventSelector.h.

int EventSelector::m_streamCount`[protected]`

Input stream counter (0..oo, monotonely increasing).

Definition at line 75 of file EventSelector.h.

int EventSelector::m_firstEvent`[protected]`

First event to be processed.

Definition at line 77 of file EventSelector.h.

int EventSelector::m_evtMax`[protected]`

Maximum number of events to be processed.

Definition at line 79 of file EventSelector.h.

int EventSelector::m_evtPrintFrequency`[protected]`

Printout frequency.

Definition at line 81 of file EventSelector.h.

std::string EventSelector::m_streamManager`[protected]`

Definition at line 83 of file EventSelector.h.

The documentation for this class was generated from the following files:

- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r4/GaudiSvc/src/EventSelector/EventSelector.h
- /afs/cern.ch/sw/Gaudi/releases/GAUDI/GAUDI_v20r4/GaudiSvc/src/EventSelector/EventSelector.cpp