I am trying to implement in Geant4 a few electromagnetic processes whose cross-sections depend not only on the energy of the incident particle, but also on the angle between the particle track and a given vector in space. Ideally, I’d modify the G4UserSteppingAction to add:
- The calculation of such angle (which is eventually stored in a private variable of a Singleton class, or in any other way I can think of).
- The update of the cross-section values used for determining what happens to the particle, calling for example
G4VEmModelis derived from a pre-existing model, such as
G4BetheHeitlerModel, with only minor modifications in the
I know how to do the first point, but not the second, because in my simulations all the calls to
ComputeCrossSectionPerAtom occur only in the preparation of the cross-sections tables and never during a G4Event. So my question is: is it possible to modify the values of the cross-sections of a few processes during a G4Step? Which files should I modify, beyond my implementation of the