BOSS 7.0.3
BESIII Offline Software System
Loading...
Searching...
No Matches
GenAccessIO.h
Go to the documentation of this file.
1//
2#ifndef TRUTHHELPER_GENACCESSIO_H
3#define TRUTHHELPER_GENACCESSIO_H
4// STL
5#include <string>
6#include "GaudiKernel/Bootstrap.h"
7#include "GaudiKernel/ISvcLocator.h"
8#include "GaudiKernel/DataObject.h"
9#include "GaudiKernel/ObjectVector.h"
10// StoreGate
11#include "StoreGate/StoreGateSvc.h"
12// #include "StoreGate/DataHandle.h"
13
14#include "GeneratorObjects/McEventCollection.h"
15#include "HepMC/GenParticle.h"
16#include <vector>
17typedef std::vector<const HepMC::GenParticle*> MCparticleCollection ;
18typedef std::vector<const HepMC::GenParticle*>::const_iterator MCparticleCollectionCIter ;
19
20class GenIMCselector;
21
23public:
24 typedef std::string String;
25 //
27 StatusCode getMC (MCparticleCollection&) const;
28 StatusCode getMC (MCparticleCollection&,
29 const GenIMCselector* ) const;
30 //
31 StatusCode getDH (const McEventCollection*&) const;
32 StatusCode getDH (const McEventCollection*&, String key) const;
33 StatusCode store (McEventCollection*) const;
34 StatusCode store (McEventCollection*, String key) const;
35
36private:
37 // IDataProviderSvc* m_dataSvc;
38 StoreGateSvc* m_sgSvc;
39};
40
41
42inline GenAccessIO::GenAccessIO():m_sgSvc(0){
43 ISvcLocator* svcLoc = Gaudi::svcLocator( );
44 if( (svcLoc->service( "StoreGateSvc", m_sgSvc )).isFailure() ){
45 throw StatusCode::FAILURE;
46 }
47}
48
49inline
50StatusCode GenAccessIO::getDH(const McEventCollection*& dh) const {
51 if((m_sgSvc->retrieve(dh)).isFailure() ){
52 return StatusCode::FAILURE;
53 }
54 return StatusCode::SUCCESS;
55}
56
57inline
58StatusCode GenAccessIO::getDH(const McEventCollection*& dh, String key) const {
59 if( (m_sgSvc->retrieve(dh, key)).isFailure() ){
60 return StatusCode::FAILURE;
61 }
62 return StatusCode::SUCCESS;
63}
64
65inline StatusCode GenAccessIO::store(McEventCollection* pObject) const {
66 return (m_sgSvc->record(pObject) ) ;
67}
68
69inline
70StatusCode GenAccessIO::store(McEventCollection* storee, String key) const {
71 return (m_sgSvc->record(storee, key) ) ;
72}
73
74#endif
std::vector< const HepMC::GenParticle * > MCparticleCollection
Definition: GenAccessIO.h:17
std::vector< constHepMC::GenParticle * >::const_iterator MCparticleCollectionCIter
Definition: GenAccessIO.h:18
*************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
std::string String
Definition: GenAccessIO.h:24
StatusCode getMC(MCparticleCollection &) const
Definition: GenAccessIO.cxx:9
StatusCode getDH(const McEventCollection *&) const
Definition: GenAccessIO.h:50
StatusCode store(McEventCollection *) const
Definition: GenAccessIO.h:65