| # Gaudi Framework, version v21r7 |

Home |  | Generated: 22 Jan 2010

# EventSelector Class Reference

Definition of class EventSelector. More...

`#include <EventSelector.h>`

Inheritance diagram for EventSelector:

[legend]
Collaboration diagram for EventSelector:

[legend]

List of all members.

## 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 | 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
SmartIF< IIncidentSvc > | m_incidentSvc
| Reference to the indicent service.
SmartIF< 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

## 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 | +---------+----------------------------------------------+------------+ | 4/09/09 | Added firing incident on opening/ending file | R. Lambert | +---------+----------------------------------------------+------------+

Author:
  Markus Frank

  R. Lambert

Version:
  1.0

Definition at line 53 of file EventSelector.h.

## Member Typedef Documentation

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

Definition at line 55 of file EventSelector.h.

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

Definition at line 56 of file EventSelector.h.

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

Definition at line 57 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   : base_class( 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(msgSvc(), name());
    00062       log << MSG::INFO << "End of event input reached." << endmsg;
    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(msgSvc(), name());
    00069       log << MSG::ALWAYS << "Reading Event record " << count+1
    00070           << ". Record number within stream " << iter->ID()+1
    00071           << ": " << iter->numStreamEvent()+1 << endmsg;
    00072     }
    00073   }
    00074   else  {
    00075     MsgStream log(msgSvc(), name());
    00076     log << MSG::INFO << "End of event input reached." << endmsg;
    00077   }
    00078 }

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

IService implementation: Db event selector override.

Reimplemented from Service.

Definition at line 379 of file EventSelector.cpp.

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

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

IService implementation: Service finalization.

Reimplemented from Service.

Definition at line 449 of file EventSelector.cpp.

    00449                                       {
    00450
    00451   MsgStream log(msgSvc(), name());
    00452
    00453   log << MSG::DEBUG << "finalize()" << endmsg;
    00454
    00455   m_incidentSvc = 0;
    00456
    00457   if (m_streamtool) {
    00458     if (m_toolSvc.isValid()) {
    00459       m_toolSvc->releaseTool(m_streamtool).ignore();
    00460     } else {
    00461       // It should not be possible to get here
    00462       m_streamtool->release();
    00463     }
    00464     m_streamtool = 0;
    00465   }
    00466
    00467   m_toolSvc = 0;
    00468
    00469   return Service::finalize();
    00470 }

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

Service override: Reinitialize service.

Reimplemented from Service.

Definition at line 430 of file EventSelector.cpp.

    00430                                        {
    00431   if ( FSMState() != Gaudi::StateMachine::INITIALIZED ) {
    00432     MsgStream logger(msgSvc(), name());
    00433     logger << MSG::ERROR << "Cannot reinitialize: service not in state initialized" << endmsg;
    00434     return StatusCode::FAILURE;
    00435   }
    00436
    00437   if( m_streamSpecsLast != m_streamSpecs ) {
    00438     StatusCode status = m_streamtool->clear();
    00439     if ( status.isFailure() ) return status;
    00440     m_streamSpecsLast = m_streamSpecs;
    00441     m_reconfigure = true;
    00442     return m_streamtool->addStreams(m_streamSpecs);
    00443   }
    00444
    00445   return StatusCode::SUCCESS;
    00446 }

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 191 of file EventSelector.cpp.

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

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 221 of file EventSelector.cpp.

    00221                                                       {
    00222   return next(refCtxt, 1);
    00223 }

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 226 of file EventSelector.cpp.

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

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 265 of file EventSelector.cpp.

    00265                                                           {
    00266   return previous(refCtxt, 1);
    00267 }

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 270 of file EventSelector.cpp.

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

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 310 of file EventSelector.cpp.

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

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 332 of file EventSelector.cpp.

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

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 356 of file EventSelector.cpp.

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

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 302 of file EventSelector.cpp.

    00302                                                      {
    00303   EvtSelectorContext *pIt  = dynamic_cast<EvtSelectorContext*>(&refCtxt);
    00304   if ( pIt )    {
    00305   }
    00306   return StatusCode::FAILURE;
    00307 }

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(msgSvc(), name());
    00121             iter.set(this, iter_id, ctxt, 0);
    00122             log << MSG::INFO << *s << endmsg;
    00123             m_incidentSvc->fireIncident(Incident(s->dbName(),IncidentType::BeginInputFile));
    00124             return StatusCode::SUCCESS;
    00125           }
    00126         }
    00127       }
    00128     }
    00129     if(s!=NULL) m_incidentSvc->fireIncident(Incident(s->dbName(),IncidentType::FailInputFile));
    00130   }
    00131
    00132   iter.set(this, -1, 0, 0);
    00133   status.setChecked();
    00134   //m_incidentSvc->fireIncident(Incident(s->dbName(),IncidentType::FailInputFile));
    00135   return StatusCode::FAILURE;
    00136 }

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

Retrieve last entry of the previous data stream.

Definition at line 140 of file EventSelector.cpp.

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

## Member Data Documentation

long int EventSelector::m_streamID

Definition at line 59 of file EventSelector.h.

SmartIF<IIncidentSvc> EventSelector::m_incidentSvc`[protected]`

Reference to the indicent service.

Definition at line 63 of file EventSelector.h.

SmartIF<IToolSvc> EventSelector::m_toolSvc`[protected]`

Definition at line 65 of file EventSelector.h.

IDataStreamTool* EventSelector::m_streamtool`[protected]`

Definition at line 67 of file EventSelector.h.

bool EventSelector::m_reconfigure`[protected]`

Reconfigure occurred.

Definition at line 70 of file EventSelector.h.

StreamSpecs EventSelector::m_streamSpecs`[protected]`

Input stream specifiers (for job options).

Definition at line 72 of file EventSelector.h.

StreamSpecs EventSelector::m_streamSpecsLast`[protected]`

Input stream specifiers (last used).

Definition at line 74 of file EventSelector.h.

Streams EventSelector::m_streams`[protected]`

Input streams.

Definition at line 76 of file EventSelector.h.

int EventSelector::m_streamCount`[protected]`

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

Definition at line 78 of file EventSelector.h.

int EventSelector::m_firstEvent`[protected]`

First event to be processed.

Definition at line 80 of file EventSelector.h.

int EventSelector::m_evtMax`[protected]`

Maximum number of events to be processed.

Definition at line 82 of file EventSelector.h.

int EventSelector::m_evtPrintFrequency`[protected]`

Printout frequency.

Definition at line 84 of file EventSelector.h.

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

Definition at line 86 of file EventSelector.h.

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

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