BOSS 8.0.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 37 of file McEventSelector.h.

Constructor & Destructor Documentation

◆ McEventSelector()

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

Definition at line 257 of file McEventSelector.cxx.

258 : Service( name, svcloc ) {
259 m_runNo.verifier().setLower( 0 );
260 m_eventsPerRun.verifier().setLower( 0 );
261 m_firstEventNo.verifier().setLower( 0 );
262}

◆ ~McEventSelector()

McEventSelector::~McEventSelector ( )

Definition at line 264 of file McEventSelector.cxx.

264 {
265 // FIXME: who deletes the Context?
266}

Member Function Documentation

◆ createAddress()

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

Definition at line 386 of file McEventSelector.cxx.

387 {
388
389 const McContext* ctx = dynamic_cast<const McContext*>( &refCtxt );
390
391 if ( ctx != 0 )
392 {
393 McAddress* mcAddr = new McAddress( CLID_Event, "Event", "" );
394 mcAddr->setRunEvt( ctx->runNumber(), ctx->eventNumber() );
395 addr = mcAddr;
396 }
397 else
398 {
399 MsgStream log( msgSvc(), name() );
400 log << MSG::ERROR << "casting to a McContext" << endmsg;
401 return StatusCode::FAILURE;
402 }
403
404 return StatusCode::SUCCESS;
405}
const CLID & CLID_Event
IMessageSvc * msgSvc()
void setRunEvt(int run, unsigned int evt)
Event accessors.
Definition McAddress.h:33
unsigned int eventNumber() const
int runNumber() const

◆ createContext()

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

Definition at line 268 of file McEventSelector.cxx.

268 {
269 McContext* ctx = new McContext( this ); //,
270 //(unsigned int) m_runNo.value( ),
271 //(unsigned int) m_firstEventNo.value( ),
272 //(unsigned int) m_eventsPerRun.value( )
273 //);
274 refpCtxt = ctx;
275
276 return StatusCode::SUCCESS;
277}

◆ finalize()

StatusCode McEventSelector::finalize ( )
virtual

Definition at line 294 of file McEventSelector.cxx.

294 {
295 MsgStream log( msgSvc(), name() );
296 log << MSG::INFO << "finalize" << endmsg;
297
298 return StatusCode::SUCCESS;
299}

◆ initialize()

StatusCode McEventSelector::initialize ( )
virtual

Definition at line 279 of file McEventSelector.cxx.

279 {
280 MsgStream log( msgSvc(), name() );
281 log << MSG::INFO << " Enter McEventSelector Initialization " << endmsg;
282 StatusCode sc = Service::initialize();
283 if ( sc.isSuccess() ) {}
284 else
285 {
286 log << MSG::ERROR << "Unable to initialize service " << endmsg;
287 return sc;
288 }
289
290 log << MSG::INFO << " McEventSelector Initialized Properly ... " << endmsg;
291 return sc;
292}

◆ last()

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

Definition at line 363 of file McEventSelector.cxx.

363 {
364 MsgStream log( msgSvc(), name() );
365 log << MSG::ERROR << "............. Last Event Not Implemented ............." << endmsg;
366 return StatusCode::FAILURE;
367}

◆ next() [1/2]

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

Definition at line 302 of file McEventSelector.cxx.

302 {
303 MsgStream log( msgSvc(), name() );
304 log << MSG::DEBUG << "............. Next Event ............." << endmsg;
305
306 McContext* ct = dynamic_cast<McContext*>( &ctxt );
307
308 if ( ct != 0 )
309 {
310 ct->next();
311 return StatusCode::SUCCESS;
312 }
313 else
314 {
315 MsgStream log( msgSvc(), name() );
316 log << "Could not dcast to McContext" << endmsg;
317 return StatusCode::FAILURE;
318 }
319}

Referenced by next().

◆ next() [2/2]

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

Definition at line 320 of file McEventSelector.cxx.

320 {
321 if ( jump > 0 )
322 {
323 for ( int i = 0; i < jump; ++i )
324 {
325 StatusCode status = next( ctxt );
326 if ( !status.isSuccess() ) { return status; }
327 }
328 return StatusCode::SUCCESS;
329 }
330 return StatusCode::FAILURE;
331}
virtual StatusCode next(Context &refCtxt) const

◆ previous() [1/2]

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

Definition at line 334 of file McEventSelector.cxx.

334 {
335 McContext* ct = dynamic_cast<McContext*>( &ctxt );
336
337 if ( ct != 0 )
338 {
339 ct->previous();
340 return StatusCode::SUCCESS;
341 }
342 else
343 {
344 MsgStream log( msgSvc(), name() );
345 log << "Could not dcast to McContext" << endmsg;
346 return StatusCode::FAILURE;
347 }
348}

Referenced by previous().

◆ previous() [2/2]

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

Definition at line 350 of file McEventSelector.cxx.

350 {
351 if ( jump > 0 )
352 {
353 for ( int i = 0; i < jump; ++i )
354 {
355 StatusCode status = previous( ctxt );
356 if ( !status.isSuccess() ) { return status; }
357 }
358 return StatusCode::SUCCESS;
359 }
360 return StatusCode::FAILURE;
361}
virtual StatusCode previous(Context &refCtxt) const

◆ queryInterface()

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

Definition at line 247 of file McEventSelector.cxx.

247 {
248 if ( riid == IEvtSelector::interfaceID() )
249 {
250 *ppvIf = (IEvtSelector*)this;
251 addRef();
252 return StatusCode::SUCCESS;
253 }
254 return Service::queryInterface( riid, ppvIf );
255}

◆ releaseContext()

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

Definition at line 407 of file McEventSelector.cxx.

407 {
408
409 MsgStream log( msgSvc(), name() );
410 log << MSG::ERROR << "............. releaseContext Not Implemented ............." << endmsg;
411
412 return StatusCode::FAILURE;
413}

◆ resetCriteria()

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

Definition at line 415 of file McEventSelector.cxx.

415 {
416
417 MsgStream log( msgSvc(), name() );
418 log << MSG::ERROR << "............. resetCriteria Not Implemented ............." << endmsg;
419
420 return StatusCode::FAILURE;
421}

◆ rewind()

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

Definition at line 369 of file McEventSelector.cxx.

369 {
370
371 McContext* ct = dynamic_cast<McContext*>( &ctxt );
372
373 if ( ct != 0 )
374 {
375 ct->rewind();
376 return StatusCode::SUCCESS;
377 }
378 else
379 {
380 MsgStream log( msgSvc(), name() );
381 log << "Could not dcast to McContext" << endmsg;
382 return StatusCode::FAILURE;
383 }
384}

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