I'm working with my Geant4 simulation where C12+4 beam is involved and facing the problem of defining partially charged ion definition. I have found that parameter Q in "/gps/ion Z A Q" and "gun/ion Z A Q" has no meaning. Here is my conclusion after searching keywords in the Geant4 source code. Both commands call G4ParticleGun::SetParticleCharge(G4double) method to set the field "particle_charge" of a G4Particle instance, but this variable is not used in the entire Geant4 source code. Instead, all physics implementation uses PDGCharge information as a charge of ion particle which is only decided at the creation from G4IonTable::CreateIon() and it is always the same with the atomic numbers of ions. I suggest commenting that all ions created by G4IonTable::GetIons(...) are considered as fully ionized ions and G4ParticleGun::SetParticleCharge(...) method has no effect on the primary particle yet in the documentation.
---------------------------------Addition-------------------------------- I found that there is the problem only if the effective ion charge model is registered using G4ionIonization model in physics list. Command "/gps/ion Z A Q"(or "/gun/ion Z A Q") works well in a magnetic field without the model.
Hello, yes, it is due to effective charge approach which is used by default in Geant4. This approach is accurate in the case of solid and liquid media. In gases and vacuum charge exchange between a projectile ion and the media is suppressed. To address this, we have special models G4BetheBlochIonGasModel and G4BraggIonGasModel, which should be used in low-density volumes. The example how to enable is in examples/extended/electromagnetic/TestEm7/src/PhysicsList.cc In this example the model is defined for world, it is possible to define for a G4Region, for example, for volume with vacuum. So, this is not a bug, I will close this bugreport. VI