Difference between ParticleMomentum and ParticleEnergy

Hello, in my simulations I used SetParticleMomentum from G4ParticleGun so far, but I realized that I get different results if I use SetParticleEnergy. So I wanted to ask what’s the actual difference between these two because I couldn’t find an answer in the documentation.

in this case the source code will help you out:
https://apc.u-paris.fr/~franco/g4doxy/html/classG4ParticleGun.html#05b8603b6240f4ae9e31075cc07fd0fd

the difference is for massive particles:

   particle_momentum = aMomentum;
   particle_energy = std::sqrt(particle_momentum*particle_momentum+mass*mass)-mass;

OK, that solves my problem. Thank you very much

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.