Separate Contributions of Different Elements to Spectrum

Hi Geant4 Users and Developers,

I am trying to use Geant4 to understand the x-ray fluorescence spectra in my research. The primary source energy is low, (in the range of 10 - 40 kev). I can now successfully get the simulated spectrum following one of the extended examples included in the Geant4 release. But, I don’t know if there is any way of knowing which part of the photons are generated by which elements by which process (either fluorescence or compton or rayleigh scattering).

More specifically, if I get 100000 photons in a scoring volume, the sample which primary sources hit has a known concentration ( 40% Carbon, 40% Hydrogen, 20% Sulfur), how many of the 100000 photons are ever compton scattered by a carbon atom? how many of the 100000 photons are generated by a fluorescence process of a sulfur atom?

The way I can think of is to create a customized trajectory class which stores the information of physical process every step. But, I could not find a way of storing which atom is responsible for a fluorescence and compton rayleigh scattering.

Any suggestion, advice or comment is welcome. Thank you in advance!

Hi pengwrip,

To my knowledge there is not a method that exists to do exactly what you want to achieve. When you define the materials that compose a volume, a cross section for each of your processes (compton, rayleigh, photoelectric etc.) is calculated. But when the simulation is running itself it is not performing any calculations to determine which element a photon scattered off of.

Though I am not familiar with it in detail, you may want to look into example TestEm0, which as the README states “is not a simulation. It prints the cross sections and stopping power used by the standard electromagnetic package”. You might find this example, or something similar to it useful, such that you could determine the relative contributions to your cross sections from carbon, hydrogen, and sulfur as you are interested in.

Another approach you could take, is to run seperate simulations where your scoring volume is composed of only a single element: carbon, hydrogen, or sulfur. You could count the number of scatters per particle or some other quantity of interest and then compare the relative amount of scattering between the three simulations.


Hi Joseph,

Thank you so very much for your answer! I have been struggling with this for some time, so probably it is time for me to look for other resources.

I thought about the way you proposed of having single element material. The problem is, some of the generated fluorescence x-ray photons would be “absorbed” again by other atoms through photo electric processes, etc., before those photons reach the scoring volume. The scoring volume I look at mostly are outside of a sample, and the scoring volume is in the position of detector in real XRF (x-ray fluorescence) instruments.

So, the composition of the material has a great impact not only on the generation but also absorption of x-ray photons I want to count. If I study the single element material instead of the real sample, the information I draw from the simulation would be less helpful to study the absorption of the XRF photons.

Please let me know if I am making any sense or confusing anyone in my argument. Thank you again!