Tracking in vacuum in magnetic field with integer effective charge

I am wondering how I should track low energy ions through vacuum within a
magnetic field properly with trajectories corresponding to integer charges.

When I simulate ions, I get proper trajectories if the ion always is in
vacuum. The instant the ion travels through another material, it gets a
non-integer effective charge and I get trajectories which should not be
possible. Instead of discrete radii the ion tracks have continuous radii,
corresponding to the non-integer effective charges. Can I force the
particle to have an integer charge while in vacuum or is there another way
to do this tracking to get only discrete radii?

There is a comment on another topic which mentions my problem, but without
an answer or follow-up:

Thank you in advance.


_Geant4 Version: 11.3.0 _
_Operating System: Devuan/Linux _
_Compiler/Version: g++ (Debian 10.2.1-6) 10.2.1 20210110 _
_CMake Version: 3.18.4 _

The EM group should be commenting on this post.
As a non-expert I can only relate my experience which is: if you set the ion charges and launch them in vacuum, and you issue the command /process/inactivate ionIoni before tracking, then the ion integer charges will be preserved and they will track correctly in fields. If you are tracking only in vacuum this is a solution. But if you have vacuum and other materials, the energy loss of the ions in the materials will be disabled and you will not get realistic tracking.
The problem is, how to combine integer charge states in vacuum with the effective charge states used in other materials. Requires expert comment.