9 #include "HepMC/IO_GenEvent.h"
10 #include "HepMC/GenEvent.h"
38 if ( abs(p->
pdg_id()) == 24 )
return 1;
61 if ( ascii_in.rdstate() == std::ios::failbit ) {
62 std::cerr <<
"ERROR input file example_UsingIterators.txt is needed "
63 <<
"and does not exist. "
64 <<
"\n Look for it in HepMC/examples, Exit." << std::endl;
74 std::list<HepMC::GenVertex*> allvertices;
77 allvertices.push_back(*v);
81 std::list<HepMC::GenVertex*> allvertices2;
83 back_inserter(allvertices2) );
88 std::list<HepMC::GenParticle*> finalstateparticles;
91 if ( isfinal(*p) ) finalstateparticles.push_back(*p);
97 std::list<HepMC::GenParticle*> finalstateparticles2;
105 if ( isphoton(*p) ) (*p)->print();
128 std::cout <<
"A W boson has been found: " << std::endl;
133 std::cout <<
"\t Its parents are: " << std::endl;
134 if ( (*p)->production_vertex() ) {
136 = (*p)->production_vertex()->
137 particles_begin(HepMC::parents);
138 mother != (*p)->production_vertex()->
139 particles_end(HepMC::parents);
148 std::cout <<
"\t\t Its descendants are: " << std::endl;
149 if ( (*p)->end_vertex() ) {
151 =(*p)->end_vertex()->
152 particles_begin(HepMC::descendants);
153 des != (*p)->end_vertex()->
154 particles_end(HepMC::descendants);
int pdg_id() const
particle ID
particle_const_iterator particles_begin() const
begin particle iteration
void copy_if(InputIterator first, InputIterator last, OutputIterator out, Predicate pred)
define the type of iterator to use
non-const particle iterator
bool operator()(const HepMC::GenParticle *p)
returns true if the GenParticle is a W
The GenEvent class is the core of HepMC.
IO_GenEvent also deals with HeavyIon and PdfInfo.
int status() const
HEPEVT decay status.
vertex_const_iterator vertices_end() const
end vertex iteration
bool operator()(const HepMC::GenParticle *p)
returns true if the GenParticle is a photon with more than 10 GeV transverse momentum ...
particle_const_iterator particles_end() const
end particle iteration
bool operator()(const HepMC::GenParticle *p)
returns true if the GenParticle does not decay
double perp() const
Transverse component of the spatial vector (R in cylindrical system).
const FourVector & momentum() const
standard 4 momentum
vertex_const_iterator vertices_begin() const
begin vertex iteration
GenVertex * end_vertex() const
pointer to the decay vertex
non-const vertex iterator
The GenParticle class contains information about generated particles.