Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

GenAccessIO Class Reference

#include <GenAccessIO.h>

List of all members.

Public Types

typedef std::string String

Public Member Functions

 GenAccessIO ()
StatusCode getDH (const McEventCollection *&, String key) const
StatusCode getDH (const McEventCollection *&) const
StatusCode getMC (MCparticleCollection &, const GenIMCselector *) const
StatusCode getMC (MCparticleCollection &) const
StatusCode store (McEventCollection *, String key) const
StatusCode store (McEventCollection *) const

Private Attributes

StoreGateSvc * m_sgSvc


Member Typedef Documentation

typedef std::string GenAccessIO::String
 


Constructor & Destructor Documentation

GenAccessIO::GenAccessIO  )  [inline]
 

00042                                :m_sgSvc(0){
00043   ISvcLocator* svcLoc = Gaudi::svcLocator( );
00044   if( (svcLoc->service( "StoreGateSvc", m_sgSvc )).isFailure() ){
00045     throw StatusCode::FAILURE;
00046   }
00047 }


Member Function Documentation

StatusCode GenAccessIO::getDH const McEventCollection *&  ,
String  key
const [inline]
 

00058                                                                             {
00059   if( (m_sgSvc->retrieve(dh, key)).isFailure() ){
00060     return StatusCode::FAILURE;
00061   }
00062   return StatusCode::SUCCESS;
00063 }

StatusCode GenAccessIO::getDH const McEventCollection *&   )  const [inline]
 

00050                                                                 {
00051   if((m_sgSvc->retrieve(dh)).isFailure() ){
00052     return StatusCode::FAILURE;
00053   }
00054   return StatusCode::SUCCESS;
00055 }

StatusCode GenAccessIO::getMC MCparticleCollection ,
const GenIMCselector
const
 

00017                                                                     {
00018     
00019   const McEventCollection* mcCollptr;
00020   StatusCode stat = this->getDH(mcCollptr);
00021   if(!stat){
00022     return StatusCode::FAILURE;
00023   }
00024 
00025   // Iterate over all McEvent records
00026   McEventCollection::const_iterator itr;
00027   for (itr = mcCollptr->begin(); itr!=mcCollptr->end(); ++itr) {
00028     // Access the HepMC record which is wrapped within McEvent
00029     const HepMC::GenEvent* genEvt = (*itr);
00030     if(genEvt == 0) return StatusCode::FAILURE;
00031       
00032     HepMC::GenEvent::particle_const_iterator it= genEvt->particles_begin();
00033     HepMC::GenEvent::particle_const_iterator en= genEvt->particles_end();
00034     for(; it!=en; ++it){
00035       if((*selector)(*it)){mcParticles.push_back(*it);}
00036     }
00037   }
00038     
00039   return StatusCode::SUCCESS;
00040     
00041 }

StatusCode GenAccessIO::getMC MCparticleCollection  )  const
 

00009                                                                      {
00010   const GenIMCselector* selector = new GenAll();
00011   StatusCode stat = this->getMC(mcParticles, selector);
00012   return stat;
00013 }

StatusCode GenAccessIO::store McEventCollection ,
String  key
const [inline]
 

00070                                                                          { 
00071   return (m_sgSvc->record(storee, key) ) ;
00072 }

StatusCode GenAccessIO::store McEventCollection  )  const [inline]
 

00065                                                                      { 
00066   return (m_sgSvc->record(pObject) ) ;
00067 }


Member Data Documentation

StoreGateSvc* GenAccessIO::m_sgSvc [private]
 


The documentation for this class was generated from the following files:
Generated on Wed Feb 2 16:16:32 2011 for BOSS6.5.5 by  doxygen 1.3.9.1