Skip to content

Commit

Permalink
Update HepMCToEDMConverter.cpp (mass conversion) (#28)
Browse files Browse the repository at this point in the history
* Update HepMCToEDMConverter.cpp

Added line to get mass. 

Mass was not converted which would result in mass being 0 for all particles after conversion.

* Update HepMCToEDMConverter.cpp

Changed type from float to double for mass
  • Loading branch information
AsgerGaardsvoll authored Feb 8, 2024
1 parent 7fdf37a commit 19713b4
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions k4Gen/src/components/HepMCToEDMConverter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ edm4hep::MutableMCParticle HepMCToEDMConverter::convert(std::shared_ptr<const He
// convert momentum
auto p = hepmcParticle->momentum();
edm_particle.setMomentum( {float(p.px()), float(p.py()), float(p.pz())} );
edm_particle.setMass( double ( hepmcParticle->generated_mass() ) );

// add spin (particle helicity) information if available
std::shared_ptr<HepMC3::VectorFloatAttribute> spin = hepmcParticle->attribute<HepMC3::VectorFloatAttribute>("spin");
Expand Down

0 comments on commit 19713b4

Please sign in to comment.