BOSS 7.1.0
BESIII Offline Software System
Loading...
Searching...
No Matches
McEventSelector Class Reference

#include <McEventSelector.h>

+ Inheritance diagram for McEventSelector:

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
 

Detailed Description

Definition at line 39 of file McEventSelector.h.

Constructor & Destructor Documentation

◆ McEventSelector()

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

Definition at line 269 of file McEventSelector.cxx.

269 :
270 Service( name, svcloc)
271{
272
273 //declareProperty( "RunNumber", m_runNo = 5040 );
274 //declareProperty( "EventsPerRun", m_eventsPerRun = 100000000 );
275 //declareProperty( "FirstEvent", m_firstEventNo = 0 );
276 m_runNo.verifier().setLower( 0 );
277 m_eventsPerRun.verifier().setLower( 0 );
278 m_firstEventNo.verifier().setLower( 0 );
279
280}

◆ ~McEventSelector()

McEventSelector::~McEventSelector ( )

Definition at line 282 of file McEventSelector.cxx.

282 {
283 // FIXME: who deletes the Context?
284}

Member Function Documentation

◆ createAddress()

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

Definition at line 413 of file McEventSelector.cxx.

414 {
415
416 const McContext* ctx = dynamic_cast<const McContext*>( &refCtxt );
417
418 if (ctx != 0) {
419 McAddress* mcAddr = new McAddress(CLID_Event, "Event", "");
420 mcAddr-> setRunEvt(ctx->runNumber(), ctx->eventNumber());
421 addr = mcAddr;
422 } else {
423 MsgStream log(messageService(), name());
424 log << MSG::ERROR << "casting to a McContext" << endreq;
425 return StatusCode::FAILURE;
426 }
427
428 return StatusCode::SUCCESS;
429
430}
const CLID & CLID_Event
Definition: EventModel.cxx:193
unsigned int eventNumber() const
int runNumber() const

◆ createContext()

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

Definition at line 287 of file McEventSelector.cxx.

288{
289 McContext* ctx = new McContext(this);//,
290 //(unsigned int) m_runNo.value( ),
291 //(unsigned int) m_firstEventNo.value( ),
292 //(unsigned int) m_eventsPerRun.value( )
293 //);
294 refpCtxt = ctx;
295
296 return StatusCode::SUCCESS;
297}

◆ finalize()

StatusCode McEventSelector::finalize ( )
virtual

Definition at line 313 of file McEventSelector.cxx.

313 {
314 MsgStream log(messageService(), name());
315 log << MSG::INFO << "finalize" << endreq;
316
317 return StatusCode::SUCCESS;
318}

◆ initialize()

StatusCode McEventSelector::initialize ( )
virtual

Definition at line 299 of file McEventSelector.cxx.

299 {
300 MsgStream log(messageService(), name());
301 log << MSG::INFO << " Enter McEventSelector Initialization " << endreq;
302 StatusCode sc = Service::initialize();
303 if( sc.isSuccess() ) {
304 } else {
305 log << MSG::ERROR << "Unable to initialize service " << endreq;
306 return sc;
307 }
308
309 log << MSG::INFO << " McEventSelector Initialized Properly ... " << endreq;
310 return sc;
311}

◆ last()

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

Definition at line 385 of file McEventSelector.cxx.

385 {
386 MsgStream log(messageService(), name());
387 log << MSG::ERROR
388 << "............. Last Event Not Implemented ............."
389 << endreq;
390 return StatusCode::FAILURE;
391}

◆ next() [1/2]

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

Definition at line 322 of file McEventSelector.cxx.

322 {
323 MsgStream log(messageService(), name());
324 log << MSG::DEBUG << "............. Next Event ............." << endreq;
325
326 McContext* ct = dynamic_cast<McContext*>(&ctxt);
327
328 if (ct != 0 ) {
329 ct->next();
330 return StatusCode::SUCCESS;
331 } else {
332 MsgStream log(messageService(), name());
333 log << "Could not dcast to McContext" << endreq;
334 return StatusCode::FAILURE;
335 }
336}

Referenced by next().

◆ next() [2/2]

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

Definition at line 338 of file McEventSelector.cxx.

339{
340 if ( jump > 0 ) {
341 for ( int i = 0; i < jump; ++i ) {
342 StatusCode status = next(ctxt);
343 if ( !status.isSuccess() ) {
344 return status;
345 }
346 }
347 return StatusCode::SUCCESS;
348 }
349 return StatusCode::FAILURE;
350}
virtual StatusCode next(Context &refCtxt) const

◆ previous() [1/2]

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

Definition at line 355 of file McEventSelector.cxx.

355 {
356 McContext* ct = dynamic_cast<McContext*>(&ctxt);
357
358 if (ct != 0 ) {
359 ct->previous();
360 return StatusCode::SUCCESS;
361 } else {
362 MsgStream log(messageService(), name());
363 log << "Could not dcast to McContext" << endreq;
364 return StatusCode::FAILURE;
365 }
366
367}

Referenced by previous().

◆ previous() [2/2]

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

Definition at line 370 of file McEventSelector.cxx.

371{
372 if ( jump > 0 ) {
373 for ( int i = 0; i < jump; ++i ) {
374 StatusCode status = previous(ctxt);
375 if ( !status.isSuccess() ) {
376 return status;
377 }
378 }
379 return StatusCode::SUCCESS;
380 }
381 return StatusCode::FAILURE;
382}
virtual StatusCode previous(Context &refCtxt) const

◆ queryInterface()

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

Definition at line 257 of file McEventSelector.cxx.

258 {
259 if ( riid == IEvtSelector::interfaceID() ) {
260 *ppvIf = (IEvtSelector*)this;
261 addRef();
262 return SUCCESS;
263 }
264 return Service::queryInterface( riid, ppvIf );
265}

◆ releaseContext()

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

Definition at line 433 of file McEventSelector.cxx.

433 {
434
435 MsgStream log(messageService(), name());
436 log << MSG::ERROR
437 << "............. releaseContext Not Implemented ............."
438 << endreq;
439
440 return StatusCode::FAILURE;
441
442}

◆ resetCriteria()

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

Definition at line 445 of file McEventSelector.cxx.

445 {
446
447 MsgStream log(messageService(), name());
448 log << MSG::ERROR
449 << "............. resetCriteria Not Implemented ............."
450 << endreq;
451
452 return StatusCode::FAILURE;
453
454}

◆ rewind()

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

Definition at line 395 of file McEventSelector.cxx.

396{
397
398 McContext* ct = dynamic_cast<McContext*>(&ctxt);
399
400 if (ct != 0 ) {
401 ct->rewind();
402 return StatusCode::SUCCESS;
403 } else {
404 MsgStream log(messageService(), name());
405 log << "Could not dcast to McContext" << endreq;
406 return StatusCode::FAILURE;
407 }
408
409}

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