\section{Penelope physics} \subsection{Introduction} A new set of physics models for photons, electrons and positrons is implemented in Geant4: it includes Compton scattering, photoelectric effect, Rayleigh scattering, gamma conversion, bremsstrahlung, ionization and positron annihilation. These models are the Geant4 implementation of the physics models developed for the PENELOPE code (PENetration and Energy LOss of Positrons and Electrons), version 2001, that are described in detail in Ref. \cite{uno}. The Penelope models have been specifically developed for Monte Carlo simulation and great care was given to the low energy description (i.e. atomic effects, etc.). Hence, these implementations provide reliable results for energies down to a few hundred eV and can be used up to $\sim$1 GeV \cite{uno,due}. For this reason, they may be used in Geant4 as an alternative to the LowEnergy/Livermore models. For the same physics processes, the user now has more alternative descriptions from which to choose, including the cross section calculation and the final state sampling. \subsection{Compton scattering} \subsubsection{Total cross section} The total cross section of the Compton scattering process is determined from an analytical parameterization. For $\gamma$ energy $E$ greater than 5 MeV, the usual Klein-Nishina formula is used for $\sigma(E)$. For \mbox{$E<5$ MeV} a more accurate parameterization is used, which takes into account atomic binding effects and Doppler broadening \cite{tre}: \begin{eqnarray} \sigma(E) \ = \ 2 \pi \int_{-1}^{1} \frac{r_{e}^{2}}{2} \frac{E_{C}^{2}} {E^{2}} (\frac{E_{C}}{E} + \frac{E}{E_{C}} - \sin^{2} \theta) \cdot \nonumber \\ \sum_{shells} f_{i} \Theta(E-U_{i})n_{i}(p_{z}^{max}) \ d(\cos \theta) \label{equno} \end{eqnarray} where: \\ $r_{e}$ = classical radius of the electron; \\ $m_{e}$ = mass of the electron; \\ $\theta$ = scattering angle; \\ $E_{C}$ = Compton energy \\ \begin{displaymath} = \ \frac{E}{1+\frac{E}{m_{e}c^{2}}(1-\cos\theta)} \end{displaymath} \\ $f_{i}$ = number of electrons in the i-th atomic shell; \\ $U_{i}$ = ionisation energy of the i-th atomic shell; \\ $\Theta$ = Heaviside step function; \\ $p_{z}^{max}$ = highest possible value of $p_{z}$ (projection of the initial momentum of the electron in the direction of the scattering angle) \\ \begin{displaymath} = \ \frac{E(E-U_{i})(1-\cos\theta)-m_{e}c^{2}U_{i}}{c \sqrt{2E(E-U_{i})(1- \cos\theta)+U_{i}^{2}}}. \end{displaymath} Finally, \begin{equation} \begin{array}{rlll} n_{i}(x) = & & & \\ & \frac{1}{2} e^{[ \frac{1}{2}-( \frac{1}{2} - \sqrt{2} J_{i0}x )^{2}]} & \mbox{if} & x < 0 \\ & 1-\frac{1}{2} e^{[\frac{1}{2}-(\frac{1}{2}+\sqrt{2}J_{i0}x)^{2}]} & \mbox{if} & x > 0 \\ % \begin{cases} % \frac{1}{2} e^{[ \frac{1}{2}-( \frac{1}{2} - \sqrt{2} J_{i0}x )^{2}]} & % \textrm{if} \quad x<0\\ % 1-\frac{1}{2} e^{[\frac{1}{2}-(\frac{1}{2}+\sqrt{2}J_{i0}x)^{2}]} & % \textrm{if} \quad x>0\\ % \end{cases} \end{array} \end{equation} where $J_{i0}$ is the value of the $p_{z}$-distribution profile $J_{i}(p_{z})$ for the i-th atomic shell calculated in $p_{z}=0$. The values of $J_{i0}$ for the different shells of the different elements are tabulated from the Hartree-Fock atomic orbitals of Ref. \cite{quattro}.\\ The integration of Eq.(\ref{equno}) is performed numerically using the 20-point Gaussian method. For this reason, the initialization of the Penelope Compton model is somewhat slower than the Livermore model. \subsubsection{Sampling of the final state} The polar deflection $\cos\theta$ is sampled from the probability density function \begin{equation} P(\cos\theta) \ = \frac{r_{e}^{2}}{2} \frac{E_{C}^{2}} {E^{2}} \Big( \frac{E_{C}}{E} + \frac{E}{E_{C}} - \sin^{2} \theta \Big) \sum_{shells} f_{i} \Theta(E-U_{i})n_{i}(p_{z}^{max}) \label{eqdue} \end{equation} (see Ref. \cite{uno} for details on the sampling algorithm). Once the direction of the emerging photon has been set, the active electron shell $i$ is selected with relative probability equal to $Z_{i} \Theta(E-U_{i})n_{i}[p_{z}^{max}(E,\theta)]$. A random value of $p_{z}$ is generated from the analytical Compton profile \cite{quattro}. The energy of the emerging photon is \begin{equation} E' \ = \ \frac{E \tau}{1-\tau t} \ \Big[ (1-\tau t \cos\theta) + \frac{p_{z}}{|p_{z}|} \sqrt{(1-\tau t \cos\theta)^{2}-(1-t \tau^{2})(1-t)} \Big], \end{equation} where \begin{equation} t \ = \ \Big( \frac{p_{z}}{m_{e}c} \Big)^{2} \quad \textrm{and} \quad \tau \ = \ \frac{E_{C}}{E}. \end{equation} The azimuthal scattering angle $\phi$ of the photon is sampled uniformly in the interval (0,2$\pi$). It is assumed that the Compton electron is emitted with energy $E_{e} = E-E'-U_{i}$, with polar angle $\theta_{e}$ and azimuthal angle $\phi_{e} = \phi + \pi $, relative to the direction of the incident photon. In this case $\cos\theta_{e}$ is given by \begin{equation} \cos\theta_{e} \ = \ \frac{E-E'\cos\theta}{\sqrt{E^{2}+E^{'2}- 2EE' \cos\theta}}. \end{equation} Since the active electron shell is known, characteristic x-rays and electrons emitted in the de-excitation of the ionized atom can also be followed. The de-excitation is simulated as described in section~\ref{relax}. For further details see \cite{uno}.\\ \subsection{Rayleigh scattering} \subsubsection{Total cross section} The total cross section of the Rayleigh scattering process is determined from an analytical parameterization. The atomic cross section for coherent scattering is given approximately by \cite{cinque} \begin{equation} \sigma(E) \ = \ \pi r_{e}^{2} \int_{-1}^{1} \frac{1+\cos^{2}\theta}{2} [F(q,Z)]^{2} \ d \cos\theta, \label{eqtre} \end{equation} where $F(q,Z)$ is the atomic form factor, $Z$ is the atomic number and $q$ is the magnitude of the momentum transfer, i.e. \begin{equation} q \ = \ 2 \ \frac{E}{c} \ \sin \Big( \frac{\theta}{2} \Big). \end{equation} In the numerical calculation the following analytical approximations are used for the form factor: \begin{equation} \begin{array}{rlll} F(q,Z) = f(x,Z) = & & & \\ & Z \ \frac{1+a_{1}x^{2}+a_{2}x^{3}+a_{3}x^{4}}{(1+a_{4}x^{2}+a_{5}x^{4})^{2}} & \mbox{or} & \\ & \max[f(x,Z),F_{K}(x,Z)] & \mbox{if} \ Z>10 \ \mbox{and} \ f(x,Z) < 2 & \\ % \begin{cases} % f(x,Z) = Z \ \frac{1+a_{1}x^{2}+a_{2}x^{3}+a_{3}x^{4}}{(1+a_{4}x^{2}+a_{5} % x^{4})^{2}} & \\ % \max[f(x,Z),F_{K}(x,Z)] & \textrm{if} \ Z>10 \ \textrm{and} \ % f(x,Z)<2\\ % \end{cases} \end{array} \end{equation} where \begin{equation} F_{K}(x,Z) \ = \ \frac{\sin(2b \arctan Q)}{bQ(1+Q^{2})^{b}}, \end{equation} with \begin{equation} x = 20.6074 \frac{q}{m_{e}c}, \quad Q = \frac{q}{2m_{e}ca}, \quad b = \sqrt{1-a^{2}}, \quad a = \alpha \Big( Z-\frac{5}{16} \Big ), \end{equation} where $\alpha$ is the fine-structure constant. The function $F_{K}(x,Z)$ is the contribution to the atomic form factor due to the two K-shell electrons (see \cite{sei}). The parameters of expression $f(x,Z)$ have been determined in Ref. \cite{sei} for Z=1 to 92 by numerically fitting the atomic form factors tabulated in Ref. \cite{sette}. The integration of Eq.(\ref{eqtre}) is performed numerically using the 20-point Gaussian method. For this reason the initialization of the Penelope Rayleigh model is somewhat slower than the Livermore model. \subsubsection{Sampling of the final state} The angular deflection $\cos\theta$ of the scattered photon is sampled from the probability distribution function \begin{equation} P(\cos\theta) \ = \ \frac{1+\cos^{2}\theta}{2} [F(q,Z)]^{2}. \end{equation} For details on the sampling algorithm (which is quite heavy from the computational point of view) see Ref. \cite{uno}. The azimuthal scattering angle $\phi$ of the photon is sampled uniformly in the interval (0,2$\pi$). % \subsection{Gamma conversion} \subsubsection{Total cross section} The total cross section of the $\gamma$ conversion process is determined from the data \cite{otto}, as described in section~\ref{subsubsigmatot}. \subsubsection{Sampling of the final state} The energies $E_{-}$ and $E_{+}$ of the secondary electron and positron are sampled using the Bethe-Heitler cross section with the Coulomb correction, using the semiempirical model of Ref. \cite{sei}. If \begin{equation} \epsilon \ = \ \frac{E_{-}+m_{e}c^{2}}{E} \end{equation} is the fraction of the $\gamma$ energy $E$ which is taken away from the electron, \begin{equation} \kappa \ = \ \frac{E}{m_{e}c^{2}} \quad \textrm{and} \quad a = \alpha Z, \end{equation} the differential cross section, which includes a low-energy correction and a high-energy radiative correction, is \begin{equation} \frac{d\sigma}{d\epsilon} \ = \ r_{e}^{2} a (Z+\eta) C_{r} \frac{2}{3} \Big[ 2 \Big( \frac{1}{2} - \epsilon \Big)^{2}\phi_{1}(\epsilon)+ \phi_{2}(\epsilon) \Big], \label{eqquattro} \end{equation} where: \begin{eqnarray} \phi_{1}(\epsilon) \ = \ \frac{7}{3} - 2 \ln (1+b^{2}) -6b\arctan (b^{-1}) \nonumber \\ -b^{2}[4-4b \arctan(b^{-1})-3 \ln(1+b^{-2})] \nonumber \\ + 4\ln (R m_{e} c/\hbar) - 4f_{C}(Z) + F_{0}(\kappa,Z) \end{eqnarray} and \begin{eqnarray} \phi_{2}(\epsilon) \ = \ \frac{11}{6} - 2 \ln (1+b^{2}) -3b\arctan (b^{-1}) \nonumber \\ +\frac{1}{2}b^{2}[4-4b \arctan(b^{-1})-3 \ln(1+b^{-2})] \nonumber \\ + 4\ln (R m_{e} c/\hbar) - 4f_{C}(Z) + F_{0}(\kappa,Z), \end{eqnarray} with \begin{equation} b \ = \ \frac{Rm_{e}c}{\hbar} \frac{1}{2\kappa} \frac{1}{\epsilon(1-\epsilon)}. \end{equation} In this case $R$ is the screening radius for the atom $Z$ (tabulated in \cite{dieci} for Z=1 to 92) and $\eta$ is the contribution of pair production in the electron field (rather than in the nuclear field). The parameter $\eta$ is approximated as \begin{equation} \eta \ = \ \eta_{\infty}(1-e^{-v}), \end{equation} where \begin{eqnarray} v \ = \ (0.2840-0.1909a)\ln(4/\kappa)+(0.1095+0.2206a)\ln^{2}(4/\kappa) \nonumber \\ + (0.02888 - 0.04269a)\ln^{3}(4/\kappa) \nonumber \\ +(0.002527+0.002623)\ln^{4}(4/\kappa) \end{eqnarray} and $\eta_{\infty}$ is the contribution for the atom $Z$ in the high-energy limit and is tabulated for Z=1 to 92 in Ref. \cite{dieci}. In the Eq.(\ref{eqquattro}), the function $f_{C}(Z)$ is the high-energy Coulomb correction of Ref. \cite{nove}, given by \begin{eqnarray} f_{C}(Z) \ = \ a^{2}[(1+a^{2})^{-1}+0.202059-0.03693a^{2}+0.00835a^{4} \nonumber \\ -0.00201a^{6}+0.00049a^{8}-0.00012a^{10}+0.00003a^{12}]; \end{eqnarray} $C_{r} = 1.0093$ is the high-energy limit of Mork and Olsen's radiative correction (see Ref. \cite{dieci}); $F_{0}(\kappa,Z)$ is a Coulomb-like correction function, which has been analytically approximated as \cite{uno} \begin{eqnarray} F_{0}(\kappa,Z) \ = \ (-0.1774 - 12.10a + 11.18a^{2})(2/\kappa)^{1/2} \nonumber \\ + (8.523 + 73.26a - 44.41a^{2})(2/\kappa) \nonumber \\ - (13.52 + 121.1a - 96.41a^{2})(2/\kappa)^{3/2} \nonumber \\ + (8.946 + 62.05a - 63.41a^{2})(2/\kappa)^{2}. \end{eqnarray} The kinetic energy $E_{+}$ of the secondary positron is obtained as \begin{equation} E_{+} \ = \ E - E_{-} - 2m_{e}c^{2}. \end{equation} The polar angles $\theta_{-}$ and $\theta_{+}$ of the directions of movement of the electron and the positron, relative to the direction of the incident photon, are sampled from the leading term of the expression obtained from high-energy theory (see Ref. \cite{undici}) \begin{equation} p(\cos\theta_{\pm}) \ = \ a(1-\beta_{\pm}\cos\theta_{\pm})^{-2}, \end{equation} where $a$ is the a normalization constant and $\beta_{\pm}$ is the particle velocity in units of the speed of light. As the directions of the produced particles and of the incident photon are not necessarily coplanar, the azimuthal angles $\phi_{-}$ and $\phi_{+}$ of the electron and of the positron are sampled independently and uniformly in the interval (0,2$\pi$). % \subsection{Photoelectric effect} \subsubsection{Total cross section} The total photoelectric cross section at a given photon energy $E$ is calculated from the data \cite{dodici}, as described in section~\ref{subsubsigmatot}. \subsubsection{Sampling of the final state} The incident photon is absorbed and one electron is emitted. The direction of the electron is sampled according to the Sauter distribution \cite{dodicibis}. Introducing the variable $\nu = 1 - \cos\theta_{e}$, the angular distribution can be expressed as \begin{equation} p(\nu) \ = \ (2-\nu) \Big[ \frac{1}{A+\nu} + \frac{1}{2} \beta \gamma (\gamma - 1)(\gamma -2) \Big] \frac{\nu}{(A+\nu)^{3}}, \end{equation} where \begin{equation} \gamma = 1 + \frac{E_{e}}{m_{e}c^{2}}, \quad A = \frac{1}{\beta} - 1, \end{equation} $E_{e}$ is the electron energy, $m_{e}$ its rest mass and $\beta$ its velocity in units of the speed of light $c$. Though the Sauter distribution, strictly speaking, is adequate only for ionisation of the K-shell by high-energy photons, in many practical simulations it does not introduce appreciable errors in the description of any photoionisation event, irrespective of the atomic shell or of the photon energy.\\ %in the same %direction as the primary photon. The subshell from which the electron is emitted is randomly selected according to the relative cross sections of subshells, determined at the energy $E$ by interpolation of the data of Ref. \cite{undici}. The electron kinetic energy is the difference between the incident photon energy and the binding energy of the electron before the interaction in the sampled shell. The interaction leaves the atom in an excited state; the subsequent de-excitation is simulated as described in section~\ref{relax}.\\ \subsection{Bremsstrahlung} \subsubsection{Introduction} The model {\tt G4PenelopeBremsstrahlungModel} calculates the continuous energy loss due to soft $\gamma$ emission and simulates the photon production by electrons and positrons. As usual, the gamma production threshold $T_{c}$ for a given material is used to separate the continuous and the discrete parts of the process. \subsubsection{Electrons} The total cross sections are calculated from the data \cite{quattordici}, as described in sections~\ref{subsubsigmatot} and \ref{lowebrems}.\\ The energy distribution $\frac{d\sigma}{dW}(E)$, i.e. the probability of the emission of a photon with energy $W$ given an incident electron of kinetic energy $E$, is generated according to the formula \begin{equation} \frac{d\sigma}{dW}(E) \ = \ \frac{F(\kappa)}{\kappa}, \quad \kappa \ = \ \frac{W}{E}. \end{equation} The functions $F(\kappa)$ describing the energy spectra of the outgoing photons are taken from Ref. \cite{tredici}. For each element $Z$ from 1 to 92, 32 points in $\kappa$, ranging from $10^{-12}$ to 1, are used for the linear interpolation of this function. $F(\kappa)$ is normalized using the condition $F(10^{-12})=1$. The energy distribution of the emitted photons is available in the library \cite{tredici} for 57 energies of the incident electron between 1 keV and 100 GeV. For other primary energies, logarithmic interpolation is used to obtain the values of the function $F(\kappa)$.\\ The direction of the emitted bremsstrahlung photon is determined by the polar angle $\theta$ and the azimuthal angle $\phi$. For isotropic media, with randomly oriented atoms, the bremsstrahlung differential cross section is independent of $\phi$ and can be expressed as \begin{equation} \frac{d^{2} \sigma}{dW d\cos\theta} \ = \ \frac{d\sigma}{dW} p(Z,E,\kappa; \cos\theta). \end{equation} Numerical values of the ``shape function'' $p(Z,E,\kappa;\cos\theta)$, calculated by partial-wave methods, have been published in Ref. \cite{quindici} for the following benchmark cases: $Z$= 2, 8, 13, 47, 79 and 92; $E$= 1, 5, 10, 50, 100 and 500 keV; $\kappa$= 0, 0.6, 0.8 and 0.95. It was found in Ref. \cite{uno} that the benchmark partial-wave shape function of Ref. \cite{quindici} can be closely approximated by the analytical form (obtained in the Lorentz-dipole approximation) \begin{eqnarray} p(\cos\theta) = A \frac{3}{8} \Big[ 1+\Big( \frac{\cos\theta - \beta'} {1-\beta' \cos \theta} \Big)^{2} \Big] \frac{1-\beta^{'2}}{(1-\beta'\cos\theta)^{2}} \nonumber \\ + (1-A) \frac{3}{4} \Big[ 1- \Big( \frac{\cos\theta - \beta'}{1-\beta' \cos \theta}m \Big)^{2} \Big] \frac{1-\beta^{'2}}{(1-\beta'\cos\theta)^{2}}, \end{eqnarray} with $\beta' = \beta (1+B)$, if one considers $A$ and $B$ as adjustable parameters. The parameters $A$ and $B$ have been determined, by least squares fitting, for the 144 combinations of atomic numbers, electron energies and reduced photon energies corresponding to the benchmark shape functions tabulated in \cite{quindici}. The quantities $\ln(AZ\beta)$ and $B\beta$ vary smoothly with Z, $\beta$ and $\kappa$ and can be obtained by cubic spline interpolation of their values for the benchmark cases. This permits the fast evaluation of the shape function $p(Z,E,\kappa;\cos\theta)$ for any combination of $Z$, $\beta$ and $\kappa$. \\ The stopping power $\frac{dE}{dx}$ due to soft bremsstrahlung is calculated by interpolating in $E$ and $\kappa$ the numerical data of scaled cross sections of Ref. \cite{sedici}. The energy and the direction of the outgoing electron are determined by using energy-momentum balance. \subsubsection{Positrons} The radiative differential cross section $\frac{d\sigma^{+}}{dW} (E)$ for positrons reduces to that for electrons in the high-energy limit, but is smaller for intermediate and low energies. Owing to the lack of more accurate calculations, the differential cross section for positrons is obtained by multiplying the electron differential cross section $\frac{d\sigma^{-}}{dW} (E)$ by a $\kappa -$indendent factor, i.e. \begin{equation} \frac{d\sigma^{+}}{dW} \ = \ F_{p}(Z,E) \frac{d\sigma^{-}}{dW}. \end{equation} The factor $F_{p}(Z,E)$ is set equal to the ratio of the radiative stopping powers for positrons and electrons, which has been calculated in Ref. \cite{diciassette}. For the actual calculation, the following analytical approximation is used: \begin{eqnarray} F_{p}(Z,E) \ = \ 1-\exp(-1.2359 \cdot 10^{-1} t + 6.1274 \cdot 10^{-2} t^{2} - 3.1516 \cdot 10^{-2} t^{3} \nonumber \\ + 7.7446 \cdot 10^{-3} t^{4} - 1.0595 \cdot 10^{-3} t^{5} + 7.0568 \cdot 10^{-5} t^{6} \nonumber \\ -1.8080 \cdot 10^{-6} t^{7}), \end{eqnarray} where \begin{equation} t \ = \ \ln \Big( 1+ \frac{10^{6}}{Z^{2}} \frac{E}{m_{e}c^{2}} \Big). \end{equation} Because the factor $F_{p}(Z,E)$ is independent on $\kappa$, the energy distribution of the secondary $\gamma$'s has the same shape as electron bremsstrahlung. Similarly, owing to the lack of numerical data for positrons, it is assumed that the shape of the angular distribution $p(Z,E,\kappa;\cos\theta)$ of the bremsstrahlung photons for positrons is the same as for the electrons.\\ The energy and direction of the outgoing positron are determined from energy-momentum balance. % \subsection{Ionisation} The {\tt G4PenelopeIonisationModel} model calculates the continuous energy loss due to electron and positron ionisation and simulates the $\delta$-ray production by electrons and positrons. The electron production threshold $T_{c}$ for a given material is used to separate the continuous and the discrete parts of the process.\\ The simulation of inelastic collisions of electrons and positrons is performed on the basis of a Generalized Oscillation Strength (GOS) model (see Ref. \cite{uno} for a complete description). It is assumed that GOS splits into contributions from the different atomic electron shells. % \subsubsection{Electrons} \label{ionelect} The total cross section $\sigma^{-} (E)$ for the inelastic collision of electrons of energy $E$ is calculated analytically. It can be split into contributions from distant longitudinal, distant transverse and close interactions, \begin{equation} \sigma^{-} (E) \ = \ \sigma_{dis,l} + \sigma_{dis,t} + \sigma^{-}_{clo}. \end{equation} The contributions from distant longitudinal and transverse interactions are \begin{equation} \sigma_{dis,l} \ = \ \frac{2 \pi e^{4}}{m_{e}v^{2}} \sum_{shells} f_{k} \frac{1}{W_{k}} \ln \Big( \frac{W_{k}}{Q^{min}_{k}} \ \frac{Q^{min}_{k}+2m_{e}c^{2}}{W_{k}+2m_{e}c^{2}} \Big) \Theta (E-W_{k}) \label{dist1} \end{equation} and \begin{equation} \sigma_{dis,t} \ = \ \frac{2 \pi e^{4}}{m_{e}v^{2}} \sum_{shells} f_{k} \frac{1}{W_{k}} \Big[ \ln \Big( \frac{1}{1-\beta^{2}} \Big) - \beta^{2}-\delta_{F} \Big] \Theta (E-W_{k}) \label{dist2} \end{equation} respectively, where: \\ $m_{e}$ = mass of the electron; \\ $v$ = velocity of the electron; \\ $\beta$ = velocity of the electron in units of $c$; \\ $f_{k}$ = number of electrons in the $k$-th atomic shell; \\ $\Theta$ = Heaviside step function; \\ $W_{k}$ = resonance energy of the $k$-th atomic shell oscillator;\\ $Q^{min}_{k}$ = minimum kinematically allowed recoil energy for energy transfer $W_{k}$ \\ \begin{displaymath} = \ \sqrt{\Big[ \sqrt{E(E+2m_{e}c^{2})}-\sqrt{(E-W_{k})(E-W_{k}+ 2m_{e}c^{2})} \Big]^{2}+m_{e}^{2}c^{4}}-m_{e}c^{2}; \end{displaymath} \\ $\delta_{F}$ = Fermi density effect correction, computed as described in Ref. \cite{diciotto}. % The value of $W_{k}$ is calculated from the ionisation energy $U_{k}$ of the $k$-th shell as \mbox{$W_{k}=1.65 \ U_{k}$}. This relation is derived from the hydrogenic model, which is valid for the innermost shells. In this model, the shell ionisation cross sections are only roughly approximated; nevertheless the ionisation of inner shells is a low-probability process and the approximation has a weak effect on the global transport properties\footnote{In cases where inner-shell ionisation is directly observed, a more accurate description of the process should be used.}. \\ The integrated cross section for close collisions is the M\o ller cross section \begin{equation} \sigma^{-}_{clo} \ = \ \frac{2 \pi e^{4}}{m_{e}v^{2}} \sum_{shells} f_{k} \int_{W_{k}}^{\frac{E}{2}} \frac{1}{W^{2}} F^{-}(E,W) dW, \label{close} \end{equation} where \begin{equation} F^{-}(E,W) \ = \ 1+ \Big( \frac{W}{E-W} \Big)^{2} - \frac{W}{E-W} + \Big( \frac{E}{E+m_{e}c^{2}} \Big)^{2} \Big( \frac{W}{E-W} + \frac{W^{2}}{E^{2}} \Big). \end{equation} The integral of Eq.(\ref{close}) can be evaluated analytically. In the final state there are two indistinguishable free electrons and the fastest one is considered as the ``primary''; accordingly, the maximum allowed energy transfer in close collisions is $\frac{E}{2}$.\\ The GOS model also allows evaluation of the spectrum $\frac{d \sigma^{-}}{d W}$ of the energy $W$ lost by the primary electron as the sum of distant longitudinal, distant transverse and close interaction contributions, \begin{equation} \frac{d\sigma^{-}}{dW} \ = \ \frac{d\sigma^{-}_{clo}}{dW} + \frac{d\sigma_{dis,l}}{dW} + \frac{d\sigma_{dis,t}}{dW}. \label{aaa} \end{equation} In particular, \begin{equation} \frac{d\sigma_{dis,l}}{dW} \ = \ \frac{2 \pi e^{4}}{m_{e}v^{2}} \sum_{shells} f_{k} \frac{1}{W_{k}} \ln \Big( \frac{W_{k}}{Q_{-}} \ \frac{Q_{-}+2m_{e}c^{2}}{W_{k}+2m_{e}c^{2}} \Big) \delta(W-W_{k}) \Theta (E-W_{k}), \label{ddist1} \end{equation} where \begin{equation} Q_{-} \ = \ \sqrt{\Big[ \sqrt{E(E+2m_{e}c^{2})}-\sqrt{(E-W)(E-W+ 2m_{e}c^{2})} \Big]^{2}+m_{e}^{2}c^{4}}-m_{e}c^{2}, \end{equation} \begin{eqnarray} \frac{d\sigma_{dis,t}}{dW} \ = \ \frac{2 \pi e^{4}}{m_{e}v^{2}} \sum_{shells} f_{k} \frac{1}{W_{k}} \Big[ \ln \Big( \frac{1}{1-\beta^{2}} \Big) - \beta^{2}-\delta_{F} \Big] \nonumber \\ \Theta (E-W_{k}) \delta(W-W_{k}) \label{ddist2} \end{eqnarray} and \begin{equation} \frac{d \sigma^{-}_{clo}}{dW} \ = \ \frac{2 \pi e^{4}}{m_{e}v^{2}} \sum_{shells} f_{k} \frac{1}{W^{2}} F^{-}(E,W) \Theta (W-W_{k}). \label{dclose} \end{equation} Eqs. (\ref{dist1}), (\ref{dist2}) and (\ref{close}) derive respectively from the integration in $dW$ of Eqs. (\ref{ddist1}), (\ref{ddist2}) and (\ref{dclose}) in the interval [0,$W_{max}$], where $W_{max}=E$ for distant interactions and $W_{max}=\frac{E}{2}$ for close. The analytical GOS model provides an accurate \emph{average} description of inelastic collisions. However, the continuous energy loss spectrum associated with single distant excitations of a given atomic shell is approximated as a single resonance (a $\delta$ distribution). As a consequence, the simulated energy loss spectra show unphysical narrow peaks at energy losses that are multiples of the resonance energies. These spurious peaks are automatically smoothed out after multiple inelastic collisions. \\ The explicit expression of $\frac{d\sigma^{-}}{dW}$, Eq. (\ref{aaa}), allows the analytic calculation of the partial cross sections for soft and hard ionisation events, i.e. \begin{equation} \sigma^{-}_{soft} \ = \ \int_{0}^{T_{c}} \frac{d\sigma^{-}}{dW} dW \quad \textrm{and} \quad \sigma^{-}_{hard} \ = \ \int_{T_{c}}^{W_{max}} \frac{d\sigma^{-}}{dW} dW. \end{equation} The first stage of the simulation is the selection of the active oscillator $k$ and the oscillator branch (distant or close). \\ In distant interactions with the $k$-th oscillator, the energy loss $W$ of the primary electron corresponds to the excitation energy $W_{k}$, i.e. $W$=$W_{k}$. If the interaction is transverse, the angular deflection of the projectile is neglected, i.e. $\cos \theta$=1. For longitudinal collisions, the distribution of the recoil energy $Q$ is given by \begin{equation} \begin{array}{rlll} P_{k}(Q) = & & & \\ & \frac{1}{Q [1+Q/(2m_{e}c^{2})]} & \textrm{if} \ Q_{-} < Q < W_{max} & \\ & 0 & \textrm{otherwise} & \\ \label{ele1} \end{array} %P_{k}(Q) = %\begin{cases} %\frac{1}{Q [1+Q/(2m_{e}c^{2})]} & %\textrm{if} \quad Q_{-} < Q < W_{max} \\ %0 & \textrm{otherwise} \label{ele1} %\end{cases}. \end{equation} Once the energy loss $W$ and the recoil energy $Q$ have been sampled, the polar scattering angle is determined as \begin{equation} \cos \theta \ = \ \frac{E(E+2m_{e}c^{2})+(E-W)(E-W+2m_{e}c^{2})- Q(Q+2m_{e}c^{2})}{2\sqrt{E(E+2m_{e}c^{2})(E-W)(E-W+2m_{e}c^{2})}}. \label{ele2} \end{equation} The azimuthal scattering angle $\phi$ is sampled uniformly in the interval (0,2$\pi$). \\ For close interactions, the distributions for the reduced energy loss $\kappa \equiv W/E$ for electrons are \begin{eqnarray} P^{-}_{k}(\kappa) \ = \ \Big[ \frac{1}{\kappa^{2}}+\frac{1}{(1-\kappa)^2} - \frac{1}{\kappa(1-\kappa)} + \Big( \frac{E}{E+m_{e}c^{2}} \Big)^{2} \Big( 1+\frac{1}{\kappa(1-\kappa)} \Big) \Big] \nonumber \\ \Theta(\kappa-\kappa_{c}) \Theta(\frac{1}{2}-\kappa) \label{closed} \end{eqnarray} with $\kappa_{c} = \max(W_{k},T_{c})/E$. The maximum allowed value of $\kappa$ is 1/2, consistent with the indistinguishability of the electrons in the final state. After the sampling of the energy loss $W= \kappa E$, the polar scattering angle $\theta$ is obtained as \begin{equation} \cos^{2} \theta \ = \ \frac{E-W}{E} \ \frac{E+2m_{e}c^{2}}{E-W+2m_{e}c^{2}}. \end{equation} The azimuthal scattering angle $\phi$ is sampled uniformly in the interval (0,2$\pi$). \\ According to the GOS model, each oscillator $W_{k}$ corresponds to an atomic shell with $f_{k}$ electrons and ionisation energy $U_{k}$. In the case of ionisation of an inner shell $i$ (K or L), a secondary electron ($\delta$-ray) is emitted with energy $E_{s}=W-U_{i}$ and the residual ion is left with a vacancy in the shell (which is then filled with the emission of fluorescence x-rays and/or Auger electrons). In the case of ionisation of outer shells, the simulated $\delta$-ray is emitted with kinetic energy $E_{s}=W$ and the target atom is assumed to remain in its ground state. The polar angle of emission of the secondary electron is calculated as \begin{equation} \cos^{2} \theta_{s} \ = \ \frac{W^{2}/\beta^{2}}{Q(Q+2m_{e}c^{2})} \Big[ 1+ \frac{Q(Q+2m_{e}c^{2})-W^{2}}{2W(E+m_{e}c^{2})} \Big]^{2} \end{equation} (for close collisions $Q=W$), while the azimuthal angle is $\phi_{s} = \phi + \pi$. In this model, the Doppler effects on the angular distribution of the $\delta$ rays are neglected. \\ The stopping power due to soft interactions of electrons, which is used for the computation of the continuous part of the process, is analytically calculated as \begin{equation} S^{-}_{in} \ = \ N \int_{0}^{T_{c}} W \frac{d\sigma^{-}}{dW} dW \end{equation} from the expression (\ref{aaa}), where $N$ is the number of scattering centers (atoms or molecules) per unit volume. \\ % \subsubsection{Positrons} The total cross section $\sigma^{+} (E)$ for the inelastic collision of positrons of energy $E$ is calculated analytically. As in the case of electrons, it can be split into contributions from distant longitudinal, distant transverse and close interactions, \begin{equation} \sigma^{+} (E) \ = \ \sigma_{dis,l} + \sigma_{dis,t} + \sigma^{+}_{clo}. \end{equation} The contributions from distant longitudinal and transverse interactions are the same as for electrons, Eq. (\ref{dist1}) and (\ref{dist2}), while the integrated cross section for close collisions is the Bhabha cross section \begin{equation} \sigma^{+}_{clo} \ = \ \frac{2 \pi e^{4}}{m_{e}v^{2}} \sum_{shells} f_{k} \int_{W_{k}}^{E} \frac{1}{W^{2}} F^{+}(E,W) dW, \label{closepos} \end{equation} where \begin{equation} F^{+}(E,W) \ = 1- b_{1}\frac{W}{E} + b_{2} \frac{W^{2}}{E^{2}} - b_{3} \frac{W^{3}}{E^{3}} + b_{4} \frac{W^{4}}{E^{4}}; \end{equation} the Bhabha factors are \begin{eqnarray} b_{1} = \Big( \frac{\gamma-1}{\gamma} \Big)^{2} \ \frac{2(\gamma+1)^{2}-1} {\gamma^{2}-1} & & b_{2} = \Big( \frac{\gamma-1}{\gamma} \Big)^{2} \ \frac{3(\gamma+1)^{2}+1} {(\gamma+1)^{2}}, \nonumber \\ b_{3} = \Big( \frac{\gamma-1}{\gamma} \Big)^{2} \ \frac{2(\gamma-1)\gamma} {(\gamma+1)^{2}}, & & b_{4} = \Big( \frac{\gamma-1}{\gamma} \Big)^{2} \ \frac{(\gamma-1)^{2}} {(\gamma+1)^{2}}, \\ \end{eqnarray} and $\gamma$ is the Lorentz factor of the positron. The integral of Eq. (\ref{closepos}) can be evaluated analytically. The particles in the final state are not undistinguishable so the maximum energy transfer $W_{max}$ in close collisions is $E$.\\ As for electrons, the GOS model allows the evaluation of the spectrum $\frac{d \sigma^{+}}{d W}$ of the energy $W$ lost by the primary positron as the sum of distant longitudinal, distant transverse and close interaction contributions, \begin{equation} \frac{d\sigma^{+}}{dW} \ = \ \frac{d\sigma^{+}_{clo}}{dW} + \frac{d\sigma_{dis,l}}{dW} + \frac{d\sigma_{dis,t}}{dW}, \label{bbb} \end{equation} where the distant terms $\frac{d\sigma_{dis,l}}{dW}$ and $\frac{d\sigma_{dis,t}}{dW}$ are those from Eqs. (\ref{ddist1}) and (\ref{ddist2}), while the close contribution is \begin{equation} \frac{d \sigma^{+}_{clo}}{dW} \ = \ \frac{2 \pi e^{4}}{m_{e}v^{2}} \sum_{shells} f_{k} \frac{1}{W^{2}} F^{+}(E,W) \Theta (W-W_{k}). \label{dclosepos} \end{equation} Also in this case, the explicit expression of $\frac{d\sigma^{+}}{dW}$, Eq. (\ref{bbb}), allows an analytic calculation of the partial cross sections for soft and hard ionisation events, i.e. \begin{equation} \sigma^{+}_{soft} \ = \ \int_{0}^{T_{c}} \frac{d\sigma^{+}}{dW} dW \quad \textrm{and} \quad \sigma^{+}_{hard} \ = \ \int_{T_{c}}^{E} \frac{d\sigma^{+}}{dW} dW. \end{equation} The sampling of the final state in the case of distant interactions (transverse or longitudinal) is performed in the same way as for primary electrons, see section~\ref{ionelect}. For close positron interactions with the $k$-th oscillator, the distribution for the reduced energy loss $\kappa \equiv W/E$ is \begin{eqnarray} P^{+}_{k}(\kappa) \ = \ \Big[\frac{1}{\kappa^{2}} - \frac{b_{1}}{\kappa}+b_{2} -b_{3}\kappa + b_{4} \kappa^{2} \Big] \Theta(\kappa-\kappa_{c}) \Theta(1-\kappa) \label{closedpos} \end{eqnarray} with $\kappa_{c} = \max(W_{k},T_{c})/E$. In this case, the maximum allowed reduced energy loss $\kappa$ is 1. After sampling the energy loss $W= \kappa E$, the polar angle $\theta$ and the azimuthal angle $\phi$ are obtained using the equations introduced for electrons in section~\ref{ionelect}. Similarly, the generation of $\delta$ rays is performed in the same way as for electrons.\\ Finally, the stopping power due to soft interactions of positrons, which is used for the computation of the continuous part of the process, is analytically calculated as \begin{equation} S^{+}_{in} \ = \ N \int_{0}^{T_{c}} W \frac{d\sigma^{+}}{dW} dW \end{equation} from the expression (\ref{bbb}), where $N$ is the number of scattering centers per unit volume. \\ % \subsection{Positron Annihilation} \subsubsection{Total Cross Section} The total cross section (per target electron) for the annihilation of a positron of energy $E$ into two photons is evaluated from the analytical formula \cite{diciannove,venti} \begin{eqnarray} \lefteqn{\sigma(E) \ = \ \frac{\pi r_{e}^{2}}{(\gamma+1)(\gamma^{2}-1)} \quad \times} \nonumber \\ & & \Big{\{} (\gamma^{2}+4\gamma+1) \ln \Big[ \gamma + \sqrt{\gamma^{2}-1} \Big] -(3+\gamma)\sqrt{\gamma^{2}-1} \Big{\}}. \end{eqnarray} where \\ $r_{e}$ = classical radius of the electron, and \\ $\gamma$ = Lorentz factor of the positron. \\ % \subsubsection{Sampling of the Final State} The target electrons are assumed to be free and at rest: binding effects, that enable one-photon annihilation \cite{diciannove}, are neglected. When the annihilation occurs in flight, the two photons may have different energies, say $E_{-}$ and $E_{+}$ (the photon with lower energy is denoted by the superscript ``$-$''), whose sum is $E+2m_{e}c^{2}$. Each annihilation event is completely characterized by the quantity \begin{equation} \zeta \ = \ \frac{E_{-}}{E+2m_{e}c^{2}}, \end{equation} which is in the interval $\zeta_{min} \le \zeta \le \frac{1}{2}$, with \begin{equation} \zeta_{min} \ = \ \frac{1}{\gamma + 1 + \sqrt{\gamma^{2}-1}}. \end{equation} The parameter $\zeta$ is sampled from the differential distribution \begin{equation} P(\zeta) \ = \ \frac{\pi r_{e}^{2}}{(\gamma+1)(\gamma^{2}-1)} [S(\zeta)+S(1-\zeta)], \end{equation} where $\gamma$ is the Lorentz factor and \begin{equation} S(\zeta) \ = \ -(\gamma+1)^{2}+(\gamma^{2}+4\gamma+1) \frac{1}{\zeta}-\frac{1}{\zeta^{2}}. \end{equation} From conservation of energy and momentum, it follows that the two photons are emitted in directions with polar angles \begin{equation} \cos \theta_{-} \ = \ \frac{1}{\sqrt{\gamma^{2}-1}} \Big( \gamma+1-\frac{1}{\zeta} \Big) \end{equation} and \begin{equation} \cos \theta_{+} \ = \ \frac{1}{\sqrt{\gamma^{2}-1}} \Big( \gamma+1-\frac{1}{1-\zeta} \Big) \end{equation} that are completely determined by $\zeta$; in particuar, when $\zeta=\zeta_{min}$, $\cos\theta_{-}=-1$. The azimuthal angles are $\phi_{-}$ and $\phi_{+} = \phi_{-} + \pi$; owing to the axial symmetry of the process, the angle $\phi_{-}$ is uniformly distributed in $(0,2\pi)$. % \subsection{Status of the document} 09.06.2003 created by L.~Pandola \\ 20.06.2003 spelling and grammar check by D.H.~Wright\\ 07.11.2003 Ionisation and Annihilation section added by L.~Pandola\\ 01.06.2005 Added text in the PhotoElectric effect section, L.~Pandola \\ 27.11.2009 Updated after the process to model design migration, L.~Pandola \\ % \begin{latexonly} \begin{thebibliography}{99} \bibitem{uno} \emph{Penelope - A Code System for Monte Carlo Simulation of Electron and Photon Transport}, Workshop Proceedings Issy-les-Moulineaux, France, 5$-$7 November 2001, AEN-NEA; \bibitem{due} J.Sempau \emph{et al.}, \emph{Experimental benchmarks of the Monte Carlo code PENELOPE}, submitted to NIM B (2002); \bibitem{tre} D.Brusa \emph{et al.}, \emph{Fast sampling algorithm for the simulation of photon Compton scattering}, NIM A379,167 (1996); \bibitem{quattro} F.Biggs \emph{et al.}, \emph{Hartree-Fock Compton profiles for the elements}, At.Data Nucl.Data Tables 16,201 (1975); \bibitem{cinque} M.Born, \emph{Atomic physics}, Ed. Blackie and Sons (1969); \bibitem{sei} J.Bar\'o \emph{et al.}, \emph{Analytical cross sections for Monte Carlo simulation of photon transport}, Radiat.Phys.Chem. 44,531 (1994); \bibitem{sette} J.H.Hubbel \emph{et al.}, \emph{Atomic form factors, incoherent scattering functions and photon scattering cross sections}, J. Phys.Chem.Ref.Data 4,471 (1975). Erratum: \emph{ibid.} 6,615 (1977); \bibitem{otto} M.J.Berger and J.H.Hubbel, \emph{XCOM: photom cross sections on a personal computer}, Report NBSIR 87-3597 (National Bureau of Standards) (1987); \bibitem{nove} H.Davies \emph{et al.}, \emph{Theory of bremsstrahlung and pair production. II.Integral cross section for pair production}, Phys.Rev. 93,788 (1954); \bibitem{dieci} J.H.Hubbel \emph{et al.}, \emph{Pair, triplet and total atomic cross sections (and mass attenuation coefficients) for 1 MeV $-$ 100 GeV photons in element Z=1 to 100}, J.Phys.Chem.Ref.Data 9,1023 (1980); \bibitem{undici} J.W.Motz \emph{et al.}, \emph{Pair production by photons}, Rev.Mod.Phys 41,581 (1969); \bibitem{dodici} D.E.Cullen \emph{et al.}, \emph{Tables and graphs of photon-interaction cross sections from 10 eV to 100 GeV derived from the LLNL evaluated photon data library (EPDL)}, Report UCRL-50400 (Lawrence Livermore National Laboratory) (1989); \bibitem{dodicibis}, F. Sauter, Ann. Phys. 11 (1931) 454 \bibitem{tredici} S.M.Seltzer and M.J.Berger, \emph{Bremsstrahlung energy spectra from electrons with kinetic energy 1 keV - 100 GeV incident on screened nuclei and orbital electrons of neutral atoms with Z=1-100}, At.Data Nucl.Data Tables 35,345 (1986); \bibitem{quattordici} D.E.Cullen \emph{et al.}, \emph{Tables and graphs of electron-interaction cross sections from 10 eV to 100 GeV derived from the LLNL evaluated photon data library (EEDL)}, Report UCRL-50400 (Lawrence Livermore National Laboratory) (1989); \bibitem{quindici} L.Kissel \emph{et al.}, \emph{Shape functions for atomic-field bremsstrahlung from electron of kinetic energy 1$-$500 keV on selected neutral atoms $1 \le Z \le 92$}, At.Data Nucl.Data.Tab. 28,381 (1983); \bibitem{sedici} M.J.Berger and S.M.Seltzer, \emph{Stopping power of electrons and positrons}, Report NBSIR 82-2550 (National Bureau of Standards) (1982); \bibitem{diciassette} L.Kim \emph{et al.}, \emph{Ratio of positron to electron bremsstrahlung energy loss: an approximate scaling law}, Phys.Rev.A 33,3002 (1986); \bibitem{diciotto} U.Fano, \emph{Penetration of protons, alpha particles and mesons}, Ann.Rev.Nucl.Sci. 13,1 (1963); \bibitem{diciannove} W.Heitler, \emph{The quantum theory of radiation}, Oxford University Press, London (1954); \bibitem{venti} W.R.Nelson \emph{et al.}, \emph{The EGS4 code system}, Report SLAC-265 (1985). \end{thebibliography} \end{latexonly} \begin{htmlonly} \subsection{Bibliography} \begin{enumerate} \item \emph{Penelope - A Code System for Monte Carlo Simulation of Electron and Photon Transport}, Workshop Proceedings Issy-les-Moulineaux, France, 5$-$7 November 2001, AEN-NEA; \item J.Sempau \emph{et al.}, \emph{Experimental benchmarks of the Monte Carlo code PENELOPE}, submitted to NIM B (2002); \item D.Brusa \emph{et al.}, \emph{Fast sampling algorithm for the simulation of photon Compton scattering}, NIM A379,167 (1996); \item F.Biggs \emph{et al.}, \emph{Hartree-Fock Compton profiles for the elements}, At.Data Nucl.Data Tables 16,201 (1975); \item M.Born, \emph{Atomic physics}, Ed. Blackie and Sons (1969); \item J.Bar\'o \emph{et al.}, \emph{Analytical cross sections for Monte Carlo simulation of photon transport}, Radiat.Phys.Chem. 44,531 (1994); \item J.H.Hubbel \emph{et al.}, \emph{Atomic form factors, incoherent scattering functions and photon scattering cross sections}, J. Phys.Chem.Ref.Data 4,471 (1975). Erratum: \emph{ibid.} 6,615 (1977); \item M.J.Berger and J.H.Hubbel, \emph{XCOM: photom cross sections on a personal computer}, Report NBSIR 87-3597 (National Bureau of Standards) (1987); \item H.Davies \emph{et al.}, \emph{Theory of bremsstrahlung and pair production. II.Integral cross section for pair production}, Phys.Rev. 93,788 (1954); \item J.H.Hubbel \emph{et al.}, \emph{Pair, triplet and total atomic cross sections (and mass attenuation coefficients) for 1 MeV $-$ 100 GeV photons in element Z=1 to 100}, J.Phys.Chem.Ref.Data 9,1023 (1980); \item J.W.Motz \emph{et al.}, \emph{Pair production by photons}, Rev.Mod.Phys 41,581 (1969); \item D.E.Cullen \emph{et al.}, \emph{Tables and graphs of photon-interaction cross sections from 10 eV to 100 GeV derived from the LLNL evaluated photon data library (EPDL)}, Report UCRL-50400 (Lawrence Livermore National Laboratory) (1989); \item S.M.Seltzer and M.J.Berger, \emph{Bremsstrahlung energy spectra from electrons with kinetic energy 1 keV - 100 GeV incident on screened nuclei and orbital electrons of neutral atoms with Z=1-100}, At.Data Nucl.Data Tables 35,345 (1986); \item D.E.Cullen \emph{et al.}, \emph{Tables and graphs of electron-interaction cross sections from 10 eV to 100 GeV derived from the LLNL evaluated photon data library (EEDL)}, Report UCRL-50400 (Lawrence Livermore National Laboratory) (1989); \item L.Kissel \emph{et al.}, \emph{Shape functions for atomic-field bremsstrahlung from electron of kinetic energy 1$-$500 keV on selected neutral atoms $1 \le Z \le 92$}, At.Data Nucl.Data.Tab. 28,381 (1983); \item M.J.Berger and S.M.Seltzer, \emph{Stopping power of electrons and positrons}, Report NBSIR 82-2550 (National Bureau of Standards) (1982); \item L.Kim \emph{et al.}, \emph{Ratio of positron to electron bremsstrahlung energy loss: an approximate scaling law}, Phys.Rev.A 33,3002 (1986); \item U.Fano, \emph{Penetration of protons, alpha particles and mesons}, Ann.Rev.Nucl.Sci. 13,1 (1963); \item W.Heitler, \emph{The quantum theory of radiation}, Oxford University Press, London (1954); \item W.R.Nelson \emph{et al.}, \emph{The EGS4 code system}, Report SLAC-265 (1985). \end{enumerate} \end{htmlonly}