In my code I track a proton (starting at a low energy of a few eV) in a strong magnetic field (~3 T). Inside the B-field there is an electrode charged to a potential of e.g. -20 kV (relative to ground). The proton spirals towards the electrode and gets accelerated. The kinetic energy of the proton when hitting the electrode is only 20 keV when the B-field is zero, as the B-field increases, the final energy of the proton gets lowered!!! I use theTrack->GetKineticEnergy() and thePostStep->GetKineticEnergy() (both agree and both are too low for finite B-fields). Why is energy not conserved in this process? Thanks for any help.
Hello, Geant4 does not violate energy. It was a bug I introduced!!! I withdraw my bug report. Sorry for the confusion.