32 #include "HepMCG4Interface.hh"
60 -> GetNavigatorForTracking();
63 G4VSolid* solid= world-> GetLogicalVolume()-> GetSolid();
64 EInside qinside= solid-> Inside(pos);
66 if( qinside !=
kInside)
return false;
74 for(HepMC::GenEvent::vertex_const_iterator vitr= hepmcevt->vertices_begin();
75 vitr != hepmcevt->vertices_end(); ++vitr ) {
79 for (HepMC::GenVertex::particle_iterator
80 pitr= (*vitr)->particles_begin(HepMC::children);
81 pitr != (*vitr)->particles_end(HepMC::children); ++pitr) {
83 if (!(*pitr)->end_vertex() && (*pitr)->status()==1) {
91 HepMC::FourVector pos= (*vitr)->
position();
100 for (HepMC::GenVertex::particle_iterator
101 vpitr= (*vitr)->particles_begin(HepMC::children);
102 vpitr != (*vitr)->particles_end(HepMC::children); ++vpitr) {
104 if( (*vpitr)->status() != 1 )
continue;
106 G4int pdgcode= (*vpitr)-> pdg_id();
107 pos= (*vpitr)-> momentum();
112 g4vtx-> SetPrimary(g4prim);
114 g4event-> AddPrimaryVertex(g4vtx);
121 HepMC::GenEvent* aevent=
new HepMC::GenEvent();
134 G4cout <<
"HepMCInterface: no generated particles. run terminated..."
static G4RunManager * GetRunManager()
static const G4double pos
static constexpr double mm
virtual ~HepMCG4Interface()
virtual HepMC::GenEvent * GenerateHepMCEvent()
HepMC::GenEvent * hepmcEvent
static G4TransportationManager * GetTransportationManager()
static constexpr double c_light
virtual void GeneratePrimaryVertex(G4Event *anEvent)
void HepMC2G4(const HepMC::GenEvent *hepmcevt, G4Event *g4event)
G4GLOB_DLL std::ostream G4cout
virtual G4bool CheckVertexInsideWorld(const G4ThreeVector &pos) const
static constexpr double GeV