BOSS 7.0.6
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 268 of file McEventSelector.cxx.

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

◆ ~McEventSelector()

McEventSelector::~McEventSelector ( )

Definition at line 281 of file McEventSelector.cxx.

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

Member Function Documentation

◆ createAddress()

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

Definition at line 412 of file McEventSelector.cxx.

413 {
414
415 const McContext* ctx = dynamic_cast<const McContext*>( &refCtxt );
416
417 if (ctx != 0) {
418 McAddress* mcAddr = new McAddress(CLID_Event, "Event", "");
419 mcAddr-> setRunEvt(ctx->runNumber(), ctx->eventNumber());
420 addr = mcAddr;
421 } else {
422 MsgStream log(messageService(), name());
423 log << MSG::ERROR << "casting to a McContext" << endreq;
424 return StatusCode::FAILURE;
425 }
426
427 return StatusCode::SUCCESS;
428
429}
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 286 of file McEventSelector.cxx.

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

◆ finalize()

StatusCode McEventSelector::finalize ( )
virtual

Definition at line 312 of file McEventSelector.cxx.

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

◆ initialize()

StatusCode McEventSelector::initialize ( )
virtual

Definition at line 298 of file McEventSelector.cxx.

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

◆ last()

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

Definition at line 384 of file McEventSelector.cxx.

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

◆ next() [1/2]

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

Definition at line 321 of file McEventSelector.cxx.

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

Referenced by next().

◆ next() [2/2]

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

Definition at line 337 of file McEventSelector.cxx.

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

◆ previous() [1/2]

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

Definition at line 354 of file McEventSelector.cxx.

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

Referenced by previous().

◆ previous() [2/2]

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

Definition at line 369 of file McEventSelector.cxx.

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

◆ queryInterface()

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

Definition at line 256 of file McEventSelector.cxx.

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

◆ releaseContext()

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

Definition at line 432 of file McEventSelector.cxx.

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

◆ resetCriteria()

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

Definition at line 444 of file McEventSelector.cxx.

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

◆ rewind()

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

Definition at line 394 of file McEventSelector.cxx.

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

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