CGEM BOSS 6.6.5.g
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 42 of file GenAccessIO.h.

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

Member Function Documentation

◆ getDH() [1/2]

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

Definition at line 50 of file GenAccessIO.h.

50 {
51 if((m_sgSvc->retrieve(dh)).isFailure() ){
52 return StatusCode::FAILURE;
53 }
54 return StatusCode::SUCCESS;
55}

Referenced by getMC().

◆ getDH() [2/2]

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

Definition at line 58 of file GenAccessIO.h.

58 {
59 if( (m_sgSvc->retrieve(dh, key)).isFailure() ){
60 return StatusCode::FAILURE;
61 }
62 return StatusCode::SUCCESS;
63}
*************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
Definition: GenAccessIO.cxx:9
Definition: GenAll.h:15

Referenced by TruthDemo::execute(), and getMC().

◆ getMC() [2/2]

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

Definition at line 16 of file GenAccessIO.cxx.

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

◆ store() [1/2]

StatusCode GenAccessIO::store ( McEventCollection pObject) const
inline

Definition at line 65 of file GenAccessIO.h.

65 {
66 return (m_sgSvc->record(pObject) ) ;
67}

◆ store() [2/2]

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

Definition at line 70 of file GenAccessIO.h.

70 {
71 return (m_sgSvc->record(storee, key) ) ;
72}

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