9 #include "testHepMCMethods.h"
15 if ( (*p)->pdg_id() == 111 ) {
16 return (*p)->generated_mass();
24 int numDecayed = 0, numUndecayed = 0, numBeam = 0;
25 int numDecayed2 = 0, numUndecayed2 = 0, numBeam2 = 0;
28 if ( (*p)->is_undecayed() ) {
31 if ( (*p)->has_decayed() ) {
34 if ( (*p)->is_beam() ) {
37 if ( (*p)->status() == 1 ) {
40 if ( (*p)->status() == 2 ) {
43 if ( (*p)->status() == 4 ) {
47 if( numUndecayed != numUndecayed2 ) {
48 std::cerr <<
"ERROR: incorrect count of undecayed particles: "
49 << numUndecayed <<
" does not match "
50 << numUndecayed2 << std::endl;
52 if( numDecayed != numDecayed2 ) {
53 std::cerr <<
"ERROR: incorrect count of undecayed particles: "
54 << numDecayed <<
" does not match "
55 << numDecayed2 << std::endl;
57 if( numBeam != numBeam2 ) {
58 std::cerr <<
"ERROR: incorrect count of undecayed particles: "
59 << numBeam <<
" does not match "
60 << numBeam2 << std::endl;
62 int ndcy = numUndecayed + numDecayed;
64 std::cerr <<
"ERROR: count does not add up: "
65 << ndcy <<
" is greater than the number of particles in the event: "
70 <<
" particles, " << numDecayed
71 <<
" decayed particles, " << numUndecayed
72 <<
" undecayed particles, and " << numBeam
79 HepMC::Units::MomentumUnit from,
80 HepMC::Units::MomentumUnit to )
83 const double factor = HepMC::Units::conversion_factor( from, to );
90 double gm = (*p)->generatedMass();
95 if( gm > 0. ) (*p)->set_generated_mass( factor*gm );
int particles_size() const
how many particle barcodes exist?
particle_const_iterator particles_begin() const
begin particle iteration
double e() const
return E
non-const particle iterator
double px() const
return px
The GenEvent class is the core of HepMC.
double pz() const
return pz
particle_const_iterator particles_end() const
end particle iteration
FourVector is a simple representation of a physics 4 vector.
int event_number() const
event number
double py() const
return py