72{
73 for(HepMC::GenEvent::vertex_const_iterator vitr= hepmcevt->vertices_begin();
74 vitr != hepmcevt->vertices_end(); ++vitr ) {
75
76
77 G4bool qvtx=false;
78 for (HepMC::GenVertex::particle_iterator
79 pitr= (*vitr)->particles_begin(HepMC::children);
80 pitr != (*vitr)->particles_end(HepMC::children); ++pitr) {
81
82 if (!(*pitr)->end_vertex() && (*pitr)->status()==1) {
83 qvtx=true;
84 break;
85 }
86 }
87 if (!qvtx) continue;
88
89
90 HepMC::FourVector pos= (*vitr)->
position();
91 G4LorentzVector xvtx(pos.x(), pos.y(), pos.z(), pos.t());
93
94
97 xvtx.t()*mm/c_light);
98
99 for (HepMC::GenVertex::particle_iterator
100 vpitr= (*vitr)->particles_begin(HepMC::children);
101 vpitr != (*vitr)->particles_end(HepMC::children); ++vpitr) {
102
103 if( (*vpitr)->status() != 1 ) continue;
104
105 G4int pdgcode= (*vpitr)-> pdg_id();
106 pos= (*vpitr)-> momentum();
107 G4LorentzVector p(pos.px(), pos.py(), pos.pz(), pos.e());
110
111 g4vtx-> SetPrimary(g4prim);
112 }
113 g4event-> AddPrimaryVertex(g4vtx);
114 }
115}
virtual G4bool CheckVertexInsideWorld(const G4ThreeVector &pos) const