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

#include <BesHepMCInterface.h>

Inheritance diagram for BesHepMCInterface:

Public Member Functions

 BesHepMCInterface ()
 ~BesHepMCInterface ()
HepMC::GenEvent * GenerateHepMCEvent ()
Public Member Functions inherited from G4HepMCInterface
void HepMC2G4 (HepMC::GenEvent *hepmcevt, G4Event *g4event)
void Print (const HepMC::GenEvent *hepmcevt)
G4int CheckType (const HepMC::GenEvent *hepmcevt)
void Boost (HepMC::GenEvent *hepmcevt)
void PrintHPlist ()
G4int GetLogLevel ()
void SetLogLevel (G4int level)
 G4HepMCInterface ()
virtual ~G4HepMCInterface ()
HepMC::GenEvent * GetHepMCGenEvent () const
virtual void GeneratePrimaryVertex (G4Event *anEvent)

Additional Inherited Members

Public Attributes inherited from G4HepMCInterface
std::vector< G4HepMCParticle * > HPlist
Protected Attributes inherited from G4HepMCInterface
HepMC::GenEvent * hepmcEvent
G4int m_logLevel

Detailed Description

Definition at line 9 of file BesHepMCInterface.h.

Constructor & Destructor Documentation

◆ BesHepMCInterface()

BesHepMCInterface::BesHepMCInterface ( )

Definition at line 12 of file BesHepMCInterface.cpp.

12{ p_evtSvc = 0; }

◆ ~BesHepMCInterface()

BesHepMCInterface::~BesHepMCInterface ( )

Definition at line 13 of file BesHepMCInterface.cpp.

13 {
14 // std::cout<< "\b the BesHepMCInterface is being destroyed "<<std::endl;
15}

Member Function Documentation

◆ GenerateHepMCEvent()

HepMC::GenEvent * BesHepMCInterface::GenerateHepMCEvent ( )
virtual

Reimplemented from G4HepMCInterface.

Definition at line 17 of file BesHepMCInterface.cpp.

17 {
18
19 if ( p_evtSvc == 0 )
20 {
21 // std::cout<<" standard interface to EvtDataSvc for retrieving HepMC events"<<std::endl;
22 ISvcLocator* svcLocator = Gaudi::svcLocator(); // from Bootstrap
23 StatusCode sc = svcLocator->service( "EventDataSvc", p_evtSvc );
24 if ( sc.isFailure() )
25 {
26 // std::cout<<"BesHepMCInterface could not access EventDataSvc!!"<<std::endl;
27 }
28 }
29 int n = 0;
30 // std::cout <<" BesHepMCInterface::GenerateAnEvent "<<std::endl;
31
32 SmartDataPtr<McGenEventCol> mcCollptr( p_evtSvc, "/Event/Gen" );
33
34 if ( mcCollptr != 0 )
35 {
36 // std::cout <<" could retrieve the collection "<<std::endl;
37
38 n = mcCollptr->size();
39
40 // std::cout <<" nr of events "<<n<<std::endl;
41
42 McGenEventCol::const_iterator it = mcCollptr->begin();
43
44 McGenEvent* mcEvent = (McGenEvent*)( *it );
45 // getting only the first event here.
46 // std::cout <<"iterator"<<std::endl;
47
48 HepMC::GenEvent* p_evt;
49
50 // std::cout <<"hepmc event"<<std::endl;
51 p_evt = mcEvent->getGenEvt();
52 // std::cout << "eventNumber = " << p_evt-> event_number() << std::endl;
53
54 // std::cout << " BesHepMCInterface:: --> " <<std::endl;
55 // std::cout << " particles_size = " << p_evt->particles_size()
56 // << " vertices_size = " << p_evt->vertices_size()
57 // << std::endl;
58
59 // std::cout <<"got it"<<std::endl;
60
61 return p_evt;
62 }
63
64 else { std::cout << "no McGenEventCollection found." << std::endl; }
65 return 0;
66}
const Int_t n
GenEvent * getGenEvt() const

Referenced by G4SvcRunManager::GenerateEvent().


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