Chargedgeantino vs. generic ion in exampleB3

  1. In exampleB3, fParticleGun->SetParticleDefinition() is set as “chargedgeantino” in the constructor, but it is re-set as a generic ion (F-18) in GeneratePrimaries(). Is there any reason to set it twice and differently in two places instead of using either of them?

The way the particle definition is re-set in GeneratePrimaries is actually a bit confusing. It tests whether the particle is of “chargedgeantino” type, and, if so, it re-set the type as generic ion. Not sure why…

  1. Also, the particle energy of chargedgeantino is set as 1eV in the constructor. Wouldn’t it be just 0 for F-18 at rest?

It is a trick.
You are right : the default primary ion should have been defined in the constructor. Unfortunately, at that time, the IonTable is not yet built : F18 would not be recognized. Charged geantino is a kind of dummy particle.
Before to enter in GeneratePrimary() function, a user may define his primary ion via UI commands : /gun/particle/ion … etc … (especially interactively). We must respect this choice before to fixe F18 as default.
This trick has a weakness : if user really want charged geantino as primary particle, it is always replaced by F18 …

For energy, you are right. But what is the range of 1 eV ion F18 in Brain tissu ? F18 travels on this range and decays.

Thank you very much for the explanation.