3 #include "HepMC/GenEvent.h"
7 const std::pair<HepMC::GenParticle*, HepMC::GenParticle*> beams = ge->
beam_particles();
10 std::vector<HepMC::GenParticle*> unphys_particles;
14 if (beams.first == *pi || beams.second == *pi)
continue;
16 const int status = (*pi)->status();
17 if (status != 1 && status != 2 && status != 4) {
18 unphys_particles.push_back(*pi);
23 while (unphys_particles.size()) {
38 std::vector<HepMC::GenParticle*> end_particles;
41 end_particles.push_back(*gpe);
44 for (std::vector<HepMC::GenParticle*>::const_iterator gpe = end_particles.begin();
45 gpe != end_particles.end(); ++gpe) {
64 unphys_particles.pop_back();
69 std::vector<HepMC::GenVertex*> orphaned_vtxs;
72 if ((*vi)->particles_in_size() == 0 && (*vi)->particles_out_size() == 0) {
73 orphaned_vtxs.push_back(*vi);
76 while (orphaned_vtxs.size()) {
77 delete orphaned_vtxs.back();
78 orphaned_vtxs.pop_back();
GenParticle * remove_particle(GenParticle *particle)
remove a particle
particle_const_iterator particles_begin() const
begin particle iteration
particles_out_const_iterator particles_out_const_end() const
end iteration of outgoing particles
std::vector< HepMC::GenParticle * >::const_iterator particles_out_const_iterator
const iterator for outgoing particles
std::pair< HepMC::GenParticle *, HepMC::GenParticle * > beam_particles() const
pair of pointers to the two incoming beam particles
GenVertex * production_vertex() const
pointer to the production vertex
GenVertex contains information about decay vertices.
The GenEvent class is the core of HepMC.
void add_particle_out(GenParticle *outparticle)
add outgoing particle
vertex_const_iterator vertices_end() const
end vertex iteration
int particles_out_size() const
number of outgoing particles
particle_const_iterator particles_end() const
end particle iteration
particles_out_const_iterator particles_out_const_begin() const
begin iteration of outgoing particles
vertex_const_iterator vertices_begin() const
begin vertex iteration
GenVertex * end_vertex() const
pointer to the decay vertex
The GenParticle class contains information about generated particles.