\section{Computing the Mean Energy Loss} \label{en_loss}
 
Energy loss processes are very similar for \(e+/e-\) , \(\mu+/\mu-\) and
charged hadrons, so a common description for them was a natural choice in 
Geant4.  Any energy loss process must calculate the continuous and discrete
energy loss in a material.  Below a given energy threshold the energy loss 
is continuous and above it the energy loss is simulated by the explicit 
production of secondary particles -  gammas, electrons, and positrons. 

\subsection{Method}

Let
\[\frac{d\sigma(Z,E,T)}{dT}\]
be the differential cross-section per atom (atomic number $Z$) for the ejection
of a secondary particle with kinetic energy $T$ by an incident particle of 
total energy $E$ moving in a material of density $\rho$.  The value of the 
{\em kinetic energy cut-off} or {\em production threshold} is denoted by 
$T_{cut}$.  Below this threshold the soft secondaries ejected are simulated as 
continuous energy loss by the incident particle, and above it they are 
explicitly generated.  The mean rate of energy loss is given by:
\begin{equation}
\label{comion.a}
\frac{dE_{soft}(E,T_{cut})}{dx} = n_{at} \cdot
 \int_{0}^{T_{cut}} \frac{d \sigma (Z,E,T)}{dT} T \: dT  
\end{equation}
where $n_{at}$ is the number of atoms per volume in the material. 
The total cross section per atom for the ejection of a secondary of 
energy \linebreak $T > T_{cut}$ is
\begin{equation}
\label{comion.b}
\sigma (Z,E,T_{cut})
= \int_{T_{cut}}^{T_{max}}\frac{d \sigma (Z,E,T)} {dT} \: dT \,
\end{equation}
where $T_{max}$ is the maximum energy transferable to the secondary particle.

\noindent
If there are several processes providing energy loss for a given particle, then
the total continuous part of the energy loss is the sum:
\begin{equation}
\label{comion.c}
\frac{dE_{soft}^{tot}(E,T_{cut})}{dx} = \sum_i{\frac{dE_{soft,i}(E,T_{cut})}{dx}}.
\end{equation}
These values are pre-calculated during the initialization phase of {\sc Geant4}
and stored in the $dE/dx$ table. Using this table the ranges of the particle in
given materials are calculated and stored in the $Range$ table. The $Range$ 
table is then inverted to provide the $InverseRange$ table.  At run time, 
values of the particle's continuous energy loss and range are obtained using 
these tables. Concrete processes contributing to the energy loss are not 
involved in the calculation at that moment. In contrast, the production of 
secondaries with kinetic energies above the production threshold is sampled 
by each concrete energy loss process. 

The default energy interval for these tables extends from 100 eV to 100 TeV and
the default number of bins is 120. For muon energy loss processes models are 
valid for higher energies and this interval can be extended up to 1000 PeV. 
Note that this extention should be done for all three processes which 
contribute to muon energy loss.

\subsection{Implementation Details}

Common calculations are performed in the class $G4VEnergyLossProcess$ in which 
the following methods are implemented:
\begin{itemize}
\item
BuildPhysicsTable;
\item
StorePhysicsTable;
\item
RetrievePhysicsTable;
\item
AlongStepDoIt;
\item
PostStepDoIt;
\item
GetMeanFreePath;
\item
GetContinuousStepLimit;
\item
MicroscopicCrossSection;
\item
GetDEDXDispersion;
\item
SetMinKinEnergy;
\item
SetMaxKinEnergy;
\item
SetDEDXBinning;
\item
SetLambdaBinning;
\end{itemize}
This interface is used by the following processes:
\begin{itemize}
\item
G4eIonisation;
\item
G4eBremsstrahlung;
\item
G4hIonisation;
\item
G4hhIonisation;
\item
G4ionIonisation;
\item
G4MuIonisation;
\item
G4MuBremsstrahlung;
\item
G4MuPairProduction.
\end{itemize}
These processes mainly provide initialization. The physics models are 
implemented using the $G4VEmModel$ interface. Because a model is defined to
be active over a given energy range and for a defined set of $G4Region$s,
an energy loss process can have one or several models defined for a particle 
and $G4Region$. The following models are available:
\begin{itemize}
\item
G4BetheBlochModel;
\item
G4BetheBlochNoDeltaModel;
\item
G4BraggModel;
\item
G4BraggIonModel;
\item
G4BraggNoDeltaModel;
\item
G4MollerBhabhaModel;
\item
G4PAIModel;
\item
G4PAIPhotonModel;
\item
G4eBremmstrahlungModel;
\item
G4MuBetheBlochModel;
\item
G4MuBremmstrahlungModel;
\item
G4MuPairProductionModel;
\end{itemize}
 
\subsubsection{Stepsize Limit Due to Continuous Energy Loss}

Continuous energy loss imposes a limit on the stepsize because of the 
energy dependence of the cross sections. It is generally assumed in MC programs
\cite{enloss.G3}  
that the particle cross sections are approximately constant along a step, i.e. 
the step size should be small enough that the change in cross section, from 
the beginning of the step to the end, is also small.  In principle one must
use very small steps in order to insure an accurate simulation, however 
the computing time increases as the stepsize decreases. A good compromise is
to limit the stepsize by not allowing the stopping range of the particle to
decrease by more than 20 \% during the step. This condition works well for
particles with kinetic energies $> 1 MeV$, but for lower energies it gives 
very short stepsizes.

To cure this problem a lower limit on the stepsize was introduced.  There is a 
natural choice for this limit: the stepsize cannot be smaller than the 
{\em range cut} parameter of the program.  The stepsize limit varies smoothly 
with decreasing energy from the value given by the 
condition \(\Delta range/range=0.20\) to the lowest possible value
{\em range cut}. These are the default step limitation parameters; they can be
overwritten using the UI command ``/process/eLoss/StepFunction 0.2 1 mm'',
for example.


\subsubsection{Energy Loss Computation}

The computation of the {\em mean energy loss} after a given step is done
by using the $dE/dx$, $Range$, and $InverseRange$ tables. The $dE/dx$ table 
is used if the energy deposition is less than  5 \% of kinetic energy of the 
particle.  When a larger percentage of energy is lost, the mean loss 
\(\Delta T\) can be written as
  \begin{equation}
       \Delta T = T_0 - f_T(r_0-step)
  \end{equation}
where \(T_0\) is the kinetic energy,
      \(r_0\)    the range           at the beginning of the step \(step\),
       the function \(f_T(r)\) is the inverse of the $Range$ table (i.e. it
       gives the kinetic energy of the particle for a range value of $r$) .
\\       
After the mean energy loss has been calculated, the process computes the
{\em actual} energy loss, i.e. the loss with fluctuations.  The fluctuation
is computed from a model described in Section \ref{gen_fluctuations}.


\subsection{Energy Loss by Heavy Charged Particles}

To save memory 
in the case of hadron energy loss, $dE/dx$, $Range$ and $InverseRange$ tables 
are constructed only for {\em protons}. The energy loss for other heavy, 
charged particles is computed from these tables at the 
{\em scaled kinetic energy} $T_{scaled}$ :
\begin{equation}
  T_{scaled} = q^2_{eff}\frac{ M_{proton} T}{ M_{particle}},
\end{equation}
where $T$ is the kinetic energy of the particle, $q_{eff}$ its effective 
change in units of positron charge, $M_{proton}$ and
$M_{particle}$ are the masses of the proton and particle.
Note that in this approach the small differences between $T_{max}$ 
values calculated for different changed particles are neglected.
This is acceptable for hadrons and ions, but is not very accurate 
for the simulation of muon energy loss, which is simulated by a 
separate process. For slow ions effective charge is different from the charge 
of ion nucleus, because of exchange between trasporting ion and the media.
The effective charge approach is used \cite{enloss.Ziegler88}.

\subsection{Status of this document}
 09.10.98  created by L. Urb\'an.\\
 01.12.03  revised by V.Ivanchenko.\\
 02.12.03  spelling and grammar check by D.H. Wright \\
 09.12.05  minor update by V.Ivanchenko.\\

\begin{latexonly}

\begin{thebibliography}{99}
\bibitem{enloss.G3} {\sc geant3} manual
  {\em Cern Program Library Long Writeup W5013 (1994)}   
\bibitem{enloss.Ziegler88} J.F.~Ziegler and
J.M.~Manoyan, Nucl. Instr. and Meth.
B35 (1988) 215.
\end{thebibliography}

\end{latexonly}

\begin{htmlonly}

\subsection{Bibliography}

\begin{enumerate}
\item {\sc geant3} manual
  {\em Cern Program Library Long Writeup W5013} (1994).  
\item J.F.~Ziegler and
J.M.~Manoyan, Nucl. Instr. and Meth.
B35 (1988) 215.
\end{enumerate}

\end{htmlonly}
