Every once and a while it is good to do basic physics again. This problem was for the validation (again) of my GEANT4 code that simulates the energy deposition and distribution of secondary electrons in a thin film in order to make sure that I am grabbing the right particles / using the correct tracking.
The physics involved are the energy of the Compton scattering of the photon
\[E_e= E - \frac{E m_e c^2}{m_e c^2 + E (1-\cos\theta)}\]
and the Klein-Nishma scattering cross section
\[ d\sigma = r_0^2 f(\theta)\sin\theta d\theta d\phi \]
where
\[f(\theta) = \frac{1}{2}\left(\frac{E'}{E}\right)^2 \left(\frac{E'}{E} + \frac{E}{E'}-\sin^2\theta\right)\].
After integrating out the phi component it is possible to arrive at
\[\frac{d\sigma}{d \theta} = 2\pi r_e^2 f(\theta) \sin \theta \]
Then taking the derivative of the electron kinetic energy allows for the relationship between the scattering probability and the electron kinetic energy.
\[\frac{d\sigma}{dE_e} = 2\pi r_e^2 \sin \theta f(\theta)\left [
\frac{1+\frac{E}{m_e c^2}\left(1-\cos\theta \right)^2}{E^2 \sin \theta}
\right ]\]
The difficult part was in correctly sampling the distribution, for this I just used a simple rejection method in which the probability of an energy is proportional the the scattering angle of that energy as the PDF (shown above) would be difficult to invert. For this a
python script was written. The first part was to make sure that I could reproduce the Compton Scattering cross section; i.e. make sure that my math was correct (Hey, I had to do some fancy chain rule stuff and it has been awhile).
 |
| Scattering Cross Section as a function of Photon Energy (Co-60) |
Finally, I sample from the above distribution and binned it according to a logarithmic energy binning, as shown below. The comparison to the GEANT4 data is also shown as the final figure.
 |
| Klein-Nishma Electron Kinetic Energy Spectra |
 |
| Pretty Good, but I don't have the peak slightly below 1 MeV. |
|
After all of this it is kinda depressing - I spent so much time just making sure I was right that the simulation code wasn't really worth the effort if in two days you can do a quick analytical check - but hey, it is pretty sweet that I can reproduce things.