BOSS 8.0.0
BESIII Offline Software System
Loading...
Searching...
No Matches
GenAccessIO Class Reference

#include <GenAccessIO.h>

Public Types

typedef std::string String

Public Member Functions

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

Detailed Description

Definition at line 22 of file GenAccessIO.h.

Member Typedef Documentation

◆ String

typedef std::string GenAccessIO::String

Definition at line 24 of file GenAccessIO.h.

Constructor & Destructor Documentation

◆ GenAccessIO()

GenAccessIO::GenAccessIO ( )
inline

Definition at line 40 of file GenAccessIO.h.

40 : m_sgSvc( 0 ) {
41 ISvcLocator* svcLoc = Gaudi::svcLocator();
42 if ( ( svcLoc->service( "StoreGateSvc", m_sgSvc ) ).isFailure() )
43 { throw StatusCode::FAILURE; }
44}

Member Function Documentation

◆ getDH() [1/2]

StatusCode GenAccessIO::getDH ( const McEventCollection *& dh) const
inline

Definition at line 46 of file GenAccessIO.h.

46 {
47 if ( ( m_sgSvc->retrieve( dh ) ).isFailure() ) { return StatusCode::FAILURE; }
48 return StatusCode::SUCCESS;
49}

Referenced by getMC().

◆ getDH() [2/2]

StatusCode GenAccessIO::getDH ( const McEventCollection *& dh,
String key ) const
inline

Definition at line 51 of file GenAccessIO.h.

51 {
52 if ( ( m_sgSvc->retrieve( dh, key ) ).isFailure() ) { return StatusCode::FAILURE; }
53 return StatusCode::SUCCESS;
54}
*************DOUBLE PRECISION m_pi *DOUBLE PRECISION m_HvecTau2 DOUBLE PRECISION m_HvClone2 DOUBLE PRECISION m_gamma1 DOUBLE PRECISION m_gamma2 DOUBLE PRECISION m_thet1 DOUBLE PRECISION m_thet2 INTEGER m_IFPHOT *COMMON c_Taupair $ !Spin Polarimeter vector first Tau $ !Spin Polarimeter vector second Tau $ !Clone Spin Polarimeter vector first Tau $ !Clone Spin Polarimeter vector second Tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning st tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !Random Euler angle for cloning nd tau $ !phi of HvecTau1 $ !theta of HvecTau1 $ !phi of HvecTau2 $ !theta of HvecTau2 $ !super key
Definition Taupair.h:42

◆ getMC() [1/2]

StatusCode GenAccessIO::getMC ( MCparticleCollection & mcParticles) const

Definition at line 9 of file GenAccessIO.cxx.

9 {
10 const GenIMCselector* selector = new GenAll();
11 StatusCode stat = this->getMC( mcParticles, selector );
12 return stat;
13}
StatusCode getMC(MCparticleCollection &) const

Referenced by getMC().

◆ getMC() [2/2]

StatusCode GenAccessIO::getMC ( MCparticleCollection & mcParticles,
const GenIMCselector * selector ) const

Definition at line 15 of file GenAccessIO.cxx.

16 {
17
18 const McEventCollection* mcCollptr;
19 StatusCode stat = this->getDH( mcCollptr );
20 if ( !stat ) { return StatusCode::FAILURE; }
21
22 // Iterate over all McEvent records
23 McEventCollection::const_iterator itr;
24 for ( itr = mcCollptr->begin(); itr != mcCollptr->end(); ++itr )
25 {
26 // Access the HepMC record which is wrapped within McEvent
27 const HepMC::GenEvent* genEvt = ( *itr );
28 if ( genEvt == 0 ) return StatusCode::FAILURE;
29
30 HepMC::GenEvent::particle_const_iterator it = genEvt->particles_begin();
31 HepMC::GenEvent::particle_const_iterator en = genEvt->particles_end();
32 for ( ; it != en; ++it )
33 {
34 if ( ( *selector )( *it ) ) { mcParticles.push_back( *it ); }
35 }
36 }
37
38 return StatusCode::SUCCESS;
39}
StatusCode getDH(const McEventCollection *&) const
Definition GenAccessIO.h:46

◆ store() [1/2]

StatusCode GenAccessIO::store ( McEventCollection * pObject) const
inline

Definition at line 56 of file GenAccessIO.h.

56 {
57 return ( m_sgSvc->record( pObject ) );
58}

◆ store() [2/2]

StatusCode GenAccessIO::store ( McEventCollection * storee,
String key ) const
inline

Definition at line 60 of file GenAccessIO.h.

60 {
61 return ( m_sgSvc->record( storee, key ) );
62}

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