Cascade: Interactions are calculated for outdated energies
At the begining of Cascade::step
, we calculate the FourMomentum of our initial particle (L114-115):
HEPEnergyType const Elab = particle.getEnergy();
FourMomentum const projectileP4{Elab, particle.getMomentum()};
We then use this FourMomentum to calculate the inelastic cross section (L125):
return sequence_.getCrossSection(particle, targetId, targetP4);
Much later in the Cascade::step
code, we pass this FourMomentum and the cross section to interaction
, the method which samples an interaction and finally executes the selected interaction (L299):
interaction(secondaries, projectileP4, composition, total_cx);
Between the calculation of projectilep4
/total_cx
and the call of interaction
, we called doContinuous
in L208:
if (sequence_.doContinuous(particle, step, limitingId) ==
ProcessReturn::ParticleAbsorbed) { // ...
However, these continuous processes can and will change the energy (and therefore the FourMomentum) of the particle. Furthermore, with a different energy, the cross section will also change.
There are several problems I see here:
- When calling
interaction(secondaries, projectileP4, composition, total_cx)
, we pass the information about the particle energy with both thesecondaries
object and theprojectileP4
object. However, both information are not consistent, since the energy insecondaries
corresponds to the particle energy after the continuous processes have been applied, while the energy inFourMomentum
corresponds to the particle energy before the continuous processes have been applied. This is confusing. - With the way the code is written at the moment, we select our interaction based on the cross section values that have been calculated before the continuous losses were applied. However, the energy is different now, which means that the cross sections (and especially the ratios of them) are different as well. In my opinion, the correct way would be to recalculate the cross sections based on the updated energy, and sample (and execute) the interactions based on these calculations.