Custom cross-section for hadronic processes


Could someone direct me please to an example code which demonstrates how to replace the cross-section data for a given process of isotope production, e.g., 160(p,p)15O or 12C(p, pn)11C?

Also, is there a way to directly (without a simulation experiment) obtain the cross-section currently configured for such a process?

Thank you,


1 Like

In general, Geant4 does not use tabulated cross sections for individual process channels. Instead, there are inclusive cross sections for various processes (elastic scattering, inelastic scattering, capture, and so on), and the individual channels are modeled by way of the microphysics of interactions with the nucleus.

1 Like

Thank you for the clarification!


There is a work about implementation of W515 GENBOD generator and user defined cross sections from EXFOR database.

I think for your purpose you need to implement this generator because you have products from your reaction and this generator should help. It produces the products taking into account energy conservation.

If you are don’t interested in secondaries particles from your reaction and you just need the statistics about how much reactions occurs for example then the task is easier. You only need to create some additional module to take into account external cross sections. Please find the example about implementation of this here:

Hello Aleksei!
Thanks a lot for the useful feedback!
I think in my case even the approach described in your wiki (G4DiscreteProcess) is an overkill. I have decided to try to implement my custom cross-sections using the SteppingAction. The reason is that I do not need to track any reaction products. But essentially, the idea is the same you are proposing:
Calculate the mean free path for the current material based on the step length and use the random generator to check if the process should be triggered (in this case the particle is killed).
Thanks again!

There is a physics model that reads the cross section data from a file (experimental where there is, else from TENDL database): particleHP
You could change the cross sections there directly.
I promised to have by the end of the year a code so that users can change the XS, but if you do not want to wait, contact me.

Hi, Dear arce!
Did you complete the code that can change the cross sections directly? How to contact you to get it?

I can give you a preliminary version. Write me to

Hi Andrey, I am struggling with the same issue. Could you please let me know how did you implement your cross-section function within a stepping action class? Thank you