McEventSelector Class Reference

#include <McEventSelector.h>

List of all members.

Public Member Functions

 McEventSelector (const std::string &name, ISvcLocator *svcloc)
 ~McEventSelector ()
virtual StatusCode initialize ()
virtual StatusCode finalize ()
virtual StatusCode queryInterface (const InterfaceID &riid, void **ppvInterface)
virtual StatusCode createContext (Context *&refpCtxt) const
virtual StatusCode last (Context &refContext) const
virtual StatusCode next (Context &refCtxt) const
virtual StatusCode next (Context &refCtxt, int jump) const
virtual StatusCode previous (Context &refCtxt) const
virtual StatusCode previous (Context &refCtxt, int jump) const
virtual StatusCode rewind (Context &refCtxt) const
virtual StatusCode createAddress (const Context &refCtxt, IOpaqueAddress *&) const
virtual StatusCode releaseContext (Context *&refCtxt) const
virtual StatusCode resetCriteria (const std::string &cr, Context &c) const

Private Attributes

IntegerProperty m_runNo
IntegerProperty m_firstEventNo
IntegerProperty m_eventsPerRun


Detailed Description

Definition at line 39 of file McEventSelector.h.


Constructor & Destructor Documentation

McEventSelector::McEventSelector ( const std::string name,
ISvcLocator *  svcloc 
)

Definition at line 268 of file McEventSelector.cxx.

References m_eventsPerRun, m_firstEventNo, and m_runNo.

00268                                                                              :
00269   Service( name, svcloc)
00270 {
00271 
00272   //declareProperty( "RunNumber",           m_runNo = 5040 );
00273   //declareProperty( "EventsPerRun",        m_eventsPerRun = 100000000 );
00274   //declareProperty( "FirstEvent",          m_firstEventNo = 0 );
00275   m_runNo.verifier().setLower( 0 );
00276   m_eventsPerRun.verifier().setLower( 0 );
00277   m_firstEventNo.verifier().setLower( 0 );   
00278  
00279 }

McEventSelector::~McEventSelector (  ) 

Definition at line 281 of file McEventSelector.cxx.

00281                                   {
00282   // FIXME: who deletes the Context?
00283 }


Member Function Documentation

StatusCode McEventSelector::createAddress ( const Context &  refCtxt,
IOpaqueAddress *&   
) const [virtual]

Definition at line 412 of file McEventSelector.cxx.

References CLID_Event, calibUtil::ERROR, McContext::eventNumber(), and McContext::runNumber().

00413                                                             {
00414 
00415   const McContext* ctx = dynamic_cast<const McContext*>( &refCtxt );
00416 
00417   if (ctx != 0) {
00418     McAddress* mcAddr = new McAddress(CLID_Event, "Event", "");
00419     mcAddr-> setRunEvt(ctx->runNumber(), ctx->eventNumber());
00420     addr = mcAddr;
00421   } else {
00422     MsgStream log(messageService(), name());
00423     log << MSG::ERROR << "casting to a McContext" << endreq;
00424     return StatusCode::FAILURE;
00425   }
00426 
00427   return StatusCode::SUCCESS;
00428 
00429 }

StatusCode McEventSelector::createContext ( Context *&  refpCtxt  )  const [virtual]

Definition at line 286 of file McEventSelector.cxx.

00287 {
00288   McContext* ctx =  new McContext(this);//,
00289                                   //(unsigned int) m_runNo.value( ),
00290                                   //(unsigned int) m_firstEventNo.value( ),
00291                                   //(unsigned int) m_eventsPerRun.value( )
00292                                   //);
00293   refpCtxt = ctx;
00294 
00295   return StatusCode::SUCCESS;
00296 }

StatusCode McEventSelector::finalize (  )  [virtual]

Definition at line 312 of file McEventSelector.cxx.

References Bes_Common::INFO.

00312                                          {
00313   MsgStream log(messageService(), name());
00314   log << MSG::INFO << "finalize" << endreq;
00315 
00316   return StatusCode::SUCCESS;
00317 }

StatusCode McEventSelector::initialize (  )  [virtual]

Definition at line 298 of file McEventSelector.cxx.

References calibUtil::ERROR, and Bes_Common::INFO.

00298                                            {
00299   MsgStream log(messageService(), name());
00300   log << MSG::INFO << " Enter McEventSelector Initialization " << endreq;
00301   StatusCode sc = Service::initialize();
00302   if( sc.isSuccess() ) {
00303   } else {
00304     log << MSG::ERROR << "Unable to initialize service " << endreq;
00305     return sc;
00306   }
00307 
00308   log << MSG::INFO  << " McEventSelector Initialized Properly ... " << endreq;
00309   return sc;
00310 }

StatusCode McEventSelector::last ( Context &  refContext  )  const [virtual]

Definition at line 384 of file McEventSelector.cxx.

References calibUtil::ERROR.

00384                                              {
00385   MsgStream log(messageService(), name());
00386   log << MSG::ERROR 
00387       << "............. Last Event Not Implemented ............." 
00388       << endreq;
00389   return StatusCode::FAILURE;
00390 }

StatusCode McEventSelector::next ( Context &  refCtxt,
int  jump 
) const [virtual]

Definition at line 337 of file McEventSelector.cxx.

References genRecEmupikp::i, and next().

00338 {
00339   if ( jump > 0 ) {
00340     for ( int i = 0; i < jump; ++i ) {
00341       StatusCode status = next(ctxt);
00342       if ( !status.isSuccess() ) {
00343         return status;
00344       }
00345     }
00346     return StatusCode::SUCCESS;
00347   }
00348   return StatusCode::FAILURE;
00349 }

StatusCode McEventSelector::next ( Context &  refCtxt  )  const [virtual]

Definition at line 321 of file McEventSelector.cxx.

References Bes_Common::DEBUG, and McContext::next().

Referenced by next().

00321                                          {
00322   MsgStream log(messageService(), name());
00323   log << MSG::DEBUG << "............. Next Event ............." << endreq;
00324 
00325   McContext* ct = dynamic_cast<McContext*>(&ctxt);
00326 
00327   if (ct != 0 ) {
00328     ct->next();
00329     return StatusCode::SUCCESS;
00330   } else {
00331     MsgStream log(messageService(), name());
00332     log << "Could not dcast to McContext" << endreq;
00333     return StatusCode::FAILURE;
00334   }
00335 }

StatusCode McEventSelector::previous ( Context &  refCtxt,
int  jump 
) const [virtual]

Definition at line 369 of file McEventSelector.cxx.

References genRecEmupikp::i, and previous().

00370 {
00371   if ( jump > 0 ) {
00372     for ( int i = 0; i < jump; ++i ) {
00373       StatusCode status = previous(ctxt);
00374       if ( !status.isSuccess() ) {
00375         return status;
00376       }
00377     }
00378     return StatusCode::SUCCESS;
00379   }
00380   return StatusCode::FAILURE;
00381 }

StatusCode McEventSelector::previous ( Context &  refCtxt  )  const [virtual]

Definition at line 354 of file McEventSelector.cxx.

References McContext::previous().

Referenced by previous().

00354                                              {
00355   McContext* ct = dynamic_cast<McContext*>(&ctxt);
00356 
00357   if (ct != 0 ) {
00358     ct->previous();
00359     return StatusCode::SUCCESS;
00360   } else {
00361     MsgStream log(messageService(), name());
00362     log << "Could not dcast to McContext" << endreq;
00363     return StatusCode::FAILURE;
00364   }
00365 
00366 }

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

Definition at line 256 of file McEventSelector.cxx.

00257                                                          {
00258   if ( riid == IEvtSelector::interfaceID() )  {
00259     *ppvIf = (IEvtSelector*)this;
00260     addRef();
00261     return SUCCESS;
00262   }
00263   return Service::queryInterface( riid, ppvIf );
00264 }

StatusCode McEventSelector::releaseContext ( Context *&  refCtxt  )  const [virtual]

Definition at line 432 of file McEventSelector.cxx.

References calibUtil::ERROR.

00432                                                            {
00433 
00434   MsgStream log(messageService(), name());
00435   log << MSG::ERROR 
00436       << "............. releaseContext Not Implemented ............." 
00437       << endreq;
00438 
00439   return StatusCode::FAILURE;
00440 
00441 }

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

Definition at line 444 of file McEventSelector.cxx.

References calibUtil::ERROR.

00444                                                                 {
00445 
00446   MsgStream log(messageService(), name());
00447   log << MSG::ERROR 
00448       << "............. resetCriteria Not Implemented ............." 
00449       << endreq;
00450 
00451   return StatusCode::FAILURE;
00452   
00453 }

StatusCode McEventSelector::rewind ( Context &  refCtxt  )  const [virtual]

Definition at line 394 of file McEventSelector.cxx.

References McContext::rewind().

00395 {
00396 
00397   McContext* ct = dynamic_cast<McContext*>(&ctxt);
00398 
00399   if (ct != 0 ) {
00400     ct->rewind();
00401     return StatusCode::SUCCESS;
00402   } else {
00403     MsgStream log(messageService(), name());
00404     log << "Could not dcast to McContext" << endreq;
00405     return StatusCode::FAILURE;
00406   }
00407 
00408 }


Member Data Documentation

IntegerProperty McEventSelector::m_eventsPerRun [private]

Definition at line 71 of file McEventSelector.h.

Referenced by McEventSelector().

IntegerProperty McEventSelector::m_firstEventNo [private]

Definition at line 70 of file McEventSelector.h.

Referenced by McEventSelector().

IntegerProperty McEventSelector::m_runNo [private]

Definition at line 69 of file McEventSelector.h.

Referenced by McEventSelector().


Generated on Tue Nov 29 23:20:05 2016 for BOSS_7.0.2 by  doxygen 1.4.7