Incorrect Setting of isIon in Trajectories for Hydrogen Ions with nElectrons > 0

Issue #276 resolved
Former user created an issue

There is a misidentification of particle ID in the case of negative hydrogen ions. The ion is defined with 'particle="ion 1 1 -1" ' but in the output file the variable "isIon" is false. In the debugger the G4ParticleDefinition variable "theParticleName" is "proton".

Comments (4)

  1. Laurie Nevay

    We use Geant’s IsIon which identifies a proton as an ion. This is because it inherits G4Ions and is considered an ion. In BDSIM, we treat a proton as a specific particle and therefore filter IsIon specifically for protons. This is wrong in the case of a proton with at least 1 electron as it’s better considered an ion then.

  2. Laurie Nevay

    This has been fixed in develop now. The code for checking this was duplicated in a few places and is now in BDSPhysicsUtilities. This has also be fixed for aperture impacts too.

  3. Log in to comment