
\section{Synchrotron Radiation}

\subsection{Photon spectrum}

Synchrotron radiation photons are emitted by relativistic charged particles traveling 
in magnetic fields.  The properties of synchrotron radiation are well understood and 
described in textbooks\,\cite{SokolovTernov,BookJDJackson, BookHofmannSynRad}.

In the simplest case, we have an electron of momentum $p$ moving perpendicular to a 
homogeneous magnetic field $B$.  The magnetic field will keep the particle on a circular 
path, with radius
\begin{equation}
\rho = \frac{p}{e\,B}=\frac{m\gamma \beta c}{e\,B}\,.\,\quad \mbox{Numerically we have } \quad \rho[ {\rm m} ] = p [ {\rm GeV/c} ] \, \frac{3.336\,{\rm m}}{B[ {\rm T} ]}\,.
\label{eq:rho}
\end{equation}
In general, there will be an arbitrary angle $\theta$ between the local magnetic field 
${\bf B}$ and momentum vector ${\bf p}$ of the particle.  The motion has a circular 
component in the plane perpendicular to the magnetic field, and in addition a constant 
momentum component parallel to the magnetic field.  For a constant homogeneous field, 
the resulting trajectory is a helix.

The critical energy of the synchrotron radiation can be calculated using the radius 
$\rho$ of Eq.\ref{eq:rho} and angle $\theta$ or the magnetic field perpendicular to the 
particle direction $B_\perp = B \sin \theta$ according to
\begin{equation}
E_c = \frac{3}{2}\;\hbar c \, \frac{\gamma^3\sin\theta}{\rho} =
\frac{3\,\hbar}{2\,m}\,\,\gamma^2 \,e B_\perp\;.
\label{eq:EcritGen}
\end{equation}
Half of the synchrotron radiation power is radiated by photons above the critical energy.

With $x$ we denote the photon energy $E_\gamma$, expressed in units of the critical 
energy $E_c$
\begin{equation}
x = \frac{E_\gamma}{E_c}\,.
\label{eq:DefOfRatioK}
\end{equation}

The photon spectrum (number of photons emitted per path length $s$ and relative energy 
$x$) can be written as
\begin{equation}
\frac{d^2\,N}{ds\,dx} = \frac{\sqrt{3}\,\alpha}{2\pi}\, \,\frac{e B_\perp}{m c} \,\int_{x}^{\infty} K_{5/3}(\xi)\,d\xi
\label{eq:dndx}
\end{equation}
where $\alpha = e^2 /\;4\pi\epsilon_0\hbar c$ is the dimensionless electromagnetic 
coupling (or fine structure) constant and $K_{5/3}$ is the modified Bessel function of 
the third kind.

The number of photons emitted per unit length and the mean free path $\lambda$ 
between two photon emissions is obtained by integration over all photon energies. Using
\begin{equation}
\int_0^\infty\,dx\int_{x}^{\infty} K_{5/3}(\xi)\,d\xi=\frac{5\pi}{3}
\end{equation}
we find that
\begin{equation}
\frac{dN}{ds} = \frac{5\,\alpha}{2\sqrt{3}}\,\frac{e B_\perp}{m \beta c} = \frac{1}{\lambda}\,.
\end{equation}

Here we are only interested in ultra-relativistic ($\beta \approx 1$) particles, for 
which $\lambda$ only depends on the field $B$ and not on the particle energy. We define 
a constant $\lambda_B$ such that
\begin{equation}
\lambda =  \frac{\lambda_B}{B_\perp} \qquad \mbox{where} \quad
\lambda_B = \frac{2\sqrt{3}}{5}\,\frac{m\,c }{\alpha\,e} = 0.16183\,{\rm T m}\;.
\end{equation}

As an example, consider a 10\,GeV electron, travelling perpendicular to a 1\,T field.  
It moves along a circular path of radius $\rho = 33.356\,{\rm m}$. For the Lorentz factor 
we have $\gamma = 19569.5$ and $\beta= 1-1.4\times10^{-9}$.  The critical energy is 
$E_c = 66.5\,{\rm keV}$ and the mean free path between two photon emissions is 
$\lambda = 0.16183\,{\rm m}$.

\subsection{Validity}
The spectrum given in Eq.\,\ref{eq:dndx} can generally be expected to provide a very 
accurate description for the synchrotron radiation spectrum generated by GeV electrons 
in magnetic fields.

Here we discuss some known limitations and possible extensions.

For particles traveling on a circular path, the spectrum observed in one location will 
in fact not be a continuous spectrum, but a discrete spectrum, consisting only of 
harmonics or modes $n$ of the revolution frequency. In practice, the mode numbers 
will generally be too high to make this a visible effect. The critical mode number 
corresponding to the critical energy is $n_c = 3/2\,\gamma^3$.  10\,GeV electrons for 
example have $n_c \approx 10^{13}$.

Synchrotron radiation can be neglected for slower particles and only becomes
relevant for ultra-relativistic particles with $\gamma > 10^3$.
Using $\beta = 1$ introduces an uncertainty of about $1/2\gamma^2$ or less than 
$5\times 10^{-7}$.

It is rather straightforward to extend the formulas presented here to particles 
other than electrons, with arbitrary charge $q$ and mass $m$, 
see \cite{BurkhardtEdge1998}.
The number of photons and the power scales with the square of the charge.

The standard synchrotron spectrum of Eq.\,\ref{eq:dndx} is only valid as long as the 
photon energy remains small compared to the particle 
energy\,\cite{FritzHerlach1971,Erber:1988tk}. This is a very safe 
assumption for GeV electrons and standard magnets with fields of order of Tesla.

An extension of synchrotron radiation to fields exceeding several hundred Tesla, 
such as those present in the beam-beam interaction in linear-colliders, is also 
known as beamstrahlung. For an introduction see\,\cite{Chen_LNP_296}.

The standard photon spectrum applies to homogeneous fields and remains a good 
approximation for magnetic fields which remain approximately constant over a the 
length $\rho/\gamma$, also known as the formation length for synchrotron radiation. 
Short magnets and edge fields will result instead in more energetic photons than 
predicted by the standard spectrum.

We also note that short bunches of many particles will start to radiate coherently like
a single particle of the equivalent charge at wavelengths which are longer than the bunch dimensions.

Low energy, long-wavelength synchrotron radiation may destructively interfere with conducting surfaces\,\cite{Murphy:1996yt}.

The soft part of the synchrotron radiation spectrum emitted by charged particles travelling through a medium will be modified 
for frequencies close to and lower than the plasma frequency\,\cite{Grichine:2002ns}.

\subsection{Direct inversion and generation of the photon energy spectrum}
The task is to find an algorithm that effectively transforms
the flat distribution given by standard pseudo-random generators
into the desired distribution proportional to the expressions given in Eqs.\,\ref{eq:dndx},\,\ref{eq:dndx2}.
% There are standard techniques to generate an arbitrary
% distribution, see for instance \cite{MonteCarloDevroye} or Section\,33 in \cite{Eidelman:2004wy}.
% Generally, to obtain the probability density function $f(x)$,
The transformation is obtained from the inverse $F^{-1}$ of the
cumulative distribution function $F(x)=\int_0^x f(t) dt $.

Leaving aside constant factors, the probability density function relevant for the photon energy spectrum is
\begin{equation}
{\rm SynRad}(x) = \int_x^\infty K_{5/3}(t) dt\;.  %  \frac{3}{5\pi} \,
\label{eq:dndx2}
\end{equation}
Numerical methods to evaluate $K_{5/3}$ are discussed in \cite{Luke_special_func}. An efficient algorithm to evaluate 
the integral SynRad using Chebyshev polynomials is described in\,\cite{Umstaetter_synrad}. This has been used in an 
earlier version of the Monte Carlo generator for synchrotron radiation using approximate transformations and the 
rejection method\,\cite{LEP_Note_632}.

The cumulative distribution function is the integral of the probability density function. Here we have
\begin{equation}
{\rm SynRadInt}(z) = \int_z^\infty \, {\rm SynRad}(x)\,dx\;,
\label{eq:SynRadInt}
\end{equation}
with normalization
\begin{equation}
{\rm SynRadInt}(0) =  \int_0^\infty \, {\rm SynRad}(x)\,dx\ = \frac{5\pi}{3}\;,
\end{equation}
such that $\frac{3}{5\pi}{\rm SynRadInt}(x)$ gives the fraction of photons above $x$.

It is possible to directly obtain the desired distribution with a fast and accurate algorithm using an analytical 
description based on simple transformations and Chebyshev polynomials.  This approach is used here.

We now describe in some detail how the analytical description was obtained. For more details see \cite{InvSynFracInt_report}.

It turned out to be convenient to start from the normalized complement rather then Eq.\,\ref{eq:SynRadInt} directly, that is
\begin{equation}
{\rm SynFracInt}(x) = \frac{3}{5\pi} \int_0^x \int_x^\infty K_{5/3}(t) dt\,dx
= 1 - \frac{3}{5\pi} \, {\rm SynRadInt}(x)\;,
\end{equation}
which gives the fraction of photons below $x$.

\begin{figure}
\center{
\includegraphics[scale=.7]{electromagnetic/xrays/SynchRad/SynFracIntxyLog.eps}
\includegraphics[scale=.7]{electromagnetic/xrays/SynchRad/InvSynFracIntxyLog.eps}}
  \vspace{-2mm}\caption{SynFracInt (left) and its inverse InvSynFracInt (right), on a $\log x$ scale.
  The functions $x^{1/3}$, $y^3$ and $1-e^{-x}$, $-\log(1-y)$ are shown as dashed lines.}
  \label{plot:SynFracIntxyLog}
\end{figure}
%---------figure end

Figure\,\ref{plot:SynFracIntxyLog} shows on the left hand side $y = {\rm SynFracInt(x)}$ and on the right hand side the inverse
$x = {\rm InvSynFracInt}(y)$ together with simple approximate functions.
We can see, that SynFracInt can be approximated by $x^{1/3}$ for small arguments, and by $1-e^{-x}$ for large $x$.
Consequently, we have for the inverse, ${\rm InvSynFracInt}(y)$, which can be approximated for small $y$ by $y^3$ 
and for large $y$ by $-\log(1-y)$.

Good convergence for ${\rm InvSynFracInt}(y)$ was obtained using Chebyshev polynomials combined with the approximate expressions 
for small and large arguments.
For intermediate values, a Chebyshev polynomial can be used directly.
Table\,\ref{tab:InvSynFracInt} summarizes the expressions used in the different intervals.

\begin{table}[htbp]\center
\caption{InvSynFracInt.}
\label{tab:InvSynFracInt}\vskip 1mm
\begin{tabular} {|cc|} \hline
$y$ & $x={\rm InvSynFracInt}(y)$ \\ \hline
$y<0.7$ & $y^3 \, {\rm P}_{\rm Ch}(y)$ \\
$0.7 \leq y \leq 0.9999$ & ${\rm P}_{\rm Ch}(y)$ \\
$y > 0.9999$ & $-\log(1-y) {\rm P}_{\rm Ch}(-\log(1-y))$ \\
\hline
\end{tabular}
\end{table}

\noindent
The procedure for Monte Carlo simulation is to generate $y$ at random uniformly distributed between $0$ at $1$, 
as provided by standard random generators, and then to calculate the
energy $x$ in units of the critical energy according to $x={\rm InvSynFracInt}(y)$.

The numerical accuracy of the energy spectrum presented here is about 14 decimal places, close to the machine precision.
Fig.\,\ref{gesynrad_Direct_gen_1} shows a comparison of generated and expected spectra.
%---------figure start
\begin{figure}
\center
\includegraphics[scale=0.7]{electromagnetic/xrays/SynchRad/gesynrad_Direct_gen_1.eps}
\vspace{-2mm}\caption{Comparison of the exact (smooth curve) and generated (histogram) spectra for $2\times 10^7$ events. 
The photon spectrum is shown on the left and the power spectrum on the right side.}
  \label{gesynrad_Direct_gen_1}
\end{figure}
%---------figure end
A Geant4 display of an electron moving in a magnetic field radiating synchrotron photons is presented in 
Fig.\,\ref{plot:SynRadGeant4} %---------figure start
\begin{figure}
\center
\includegraphics[width=12cm]{electromagnetic/xrays/SynchRad/g4_TestEm16.eps}
\vspace{-2mm}\caption{Geant4 display. 10 GeV e$^+$ moving initially in x-direction, bends downwards on a circular 
path by a 0.1\,T magnetic field in z-direction.}
  \label{plot:SynRadGeant4}
\end{figure}
%---------figure end


\subsection{Properties of the photon energy and power spectra}

The normalised probability function describing the photon energy spectrum is 
\begin{equation}
n_\gamma(x) = \frac{3}{5\pi} \int_x^\infty K_{5/3}(t) dt\;.
\label{eq:ngam}
\end{equation}
$n_\gamma(x)$ gives the fraction of photons in the interval $x$ to $x+dx$, where $x$ is the photon energy in units 
of the critical energy.

The first moment or mean value is
\begin{equation}
\mu =  \int_0^\infty x \, n_\gamma(x) \, dx = \frac{8}{15\,\sqrt{3}}\;.
\end{equation}
implying that the mean photon energy is $\frac{8}{15\,\sqrt{3}} = 0.30792$ of the critical energy.\\ \\
The second moment about the mean, or variance, is
\begin{equation}
\sigma^2 =  \int_0^\infty (x-\mu)^2 \, n_\gamma(x) \, dx = \frac{211}{675}\;,
\end{equation}
and the r.m.s. value of the photon energy spectrum is $\sigma=\sqrt{\frac{211}{675}}=0.5591$.

The normalised power spectrum is
\begin{equation}
P_\gamma(x) = \frac{9\sqrt{3}}{8\pi} \, x \int_x^\infty K_{5/3}(t) dt\;.
\end{equation}
$P_\gamma(x)$ gives the fraction of the power which is radiated in the interval $x$ to $x+dx$.

Half of the power is radiated below the critical energy
\begin{equation}
\int_0^1 P_\gamma(x)\,dx = 0.5000
\end{equation}

The mean value of the power spectrum is
\begin{equation}
\mu =  \int_0^\infty x \, P_\gamma(x) \, dx = \frac{55}{24\,\sqrt{3}} = 1.32309\;.
\end{equation}
The variance is
\begin{equation}
\sigma^2 =  \int_0^\infty (x-\mu)^2 \, P_\gamma(x) \, dx = \frac{2351}{1728}\;,
\end{equation}
and the r.m.s. width is $\sigma=\sqrt{\frac{2351}{1728}}=1.16642$.

\subsection{Status of this document}
08.06.06 created by H.~Burkhardt\\

%% \providecommand{\href}[2]{#2}\begingroup\raggedright\begin{thebibliography}{10}
\begin{latexonly}
\begin{thebibliography}{99}

\bibitem{SokolovTernov}
A.A.Sokolov and I.M.Ternov, {\em {Radiation from Relativistic Electrons}},
\newblock Amer. Inst of Physics, 1986.

\bibitem{BookJDJackson}
J.~Jackson, {\em {Classical Electrodynamics}}.
\newblock John Wiley \& Sons, third~ed., 1998.

\bibitem{BookHofmannSynRad}
A.~Hofmann, {\em {The Physics of Synchrotron Radiation}}.
\newblock Cambridge University Press, 2004.

\bibitem{BurkhardtEdge1998}
H.~Burkhardt, ``{Reminder of the Edge Effect in Synchrotron Radiation}'', LHC
  Project Note 172, CERN Geneva 1998.

\bibitem{FritzHerlach1971}
F.~Herlach, R.~McBroom, T.~Erber, J.~.Murray, and R.~Gearhart, ``{Experiments
  with Megagauss targets at SLAC}'', IEEE Trans Nucl Sci, NS 18, 3 (1971)
  809-814.

\bibitem{Erber:1988tk}
T.~Erber, G.~B. Baumgartner, D.~White, and H.~G. Latal, ``Megagauss
  Bremsstrahlung and Radiation Reaction'', in *Batavia 1983, proceedings, High
  Energy Accelerators*, 372-374.

\bibitem{Chen_LNP_296}
P.~Chen, ``{An Introduction to Beamstrahlung and Disruption}'', in {\em
  Frontiers of Particle Beams}, M.~Month and S.~Turner, eds., Lecture Notes in
  Physics 296, pp.~481--494.
\newblock Springer-Verlag, 1986.

\bibitem{Murphy:1996yt}
J.~B. Murphy, S.~Krinsky, and R.~L. Gluckstern, ``Longitudinal wakefield for an
  electron moving on a circular orbit'', {\em Part. Acc.} { 57} (1997) 9.

\bibitem{Grichine:2002ns}
V.~M. Grichine, ``Radiation of accelerated charge in absorbing medium'',
  CERN-OPEN-2002-056.

\bibitem{Luke_special_func}
Y.~Luke, ``{The special functions and their approximations}'', New York, NY:
  Academic Press, 1975.- 585 p.

\bibitem{Umstaetter_synrad}
H.H.Umst\"atter. CERN/PS/SM/81-13, CERN Geneva 1981.

\bibitem{LEP_Note_632}
H.~Burkhardt, ``{Monte Carlo Generator for Synchrotron Radiation}'', LEP Note
  632, CERN, December, 1990.

\bibitem{InvSynFracInt_report}
H.~Burkhardt, ``{Monte Carlo Generation of the Energy Spectrum of Synchrotron
  Radiation}'', {to be published as CERN-AB and EuroTeV report}.

%% \end{thebibliography}\endgroup
\end{thebibliography}
\end{latexonly}

\begin{htmlonly}
\subsection{Bibliography}
\begin{enumerate}

\item{SokolovTernov}
A.A.Sokolov and I.M.Ternov, {\em {Radiation from Relativistic Electrons}},
\newblock Amer. Inst of Physics, 1986.

\item{BookJDJackson}
J.~Jackson, {\em {Classical Electrodynamics}}.
\newblock John Wiley \& Sons, third~ed., 1998.

\item{BookHofmannSynRad}
A.~Hofmann, {\em {The Physics of Synchrotron Radiation}}.
\newblock Cambridge University Press, 2004.

\item{BurkhardtEdge1998}
H.~Burkhardt, ``{Reminder of the Edge Effect in Synchrotron Radiation}'', LHC
  Project Note 172, CERN Geneva 1998.

\item{FritzHerlach1971}
F.~Herlach, R.~McBroom, T.~Erber, J.~.Murray, and R.~Gearhart, ``{Experiments
  with Megagauss targets at SLAC}'', IEEE Trans Nucl Sci, NS 18, 3 (1971)
  809-814.

\item{Erber:1988tk}
T.~Erber, G.~B. Baumgartner, D.~White, and H.~G. Latal, ``Megagauss
  Bremsstrahlung and Radiation Reaction'', in *Batavia 1983, proceedings, High
  Energy Accelerators*, 372-374.

\item{Chen_LNP_296}
P.~Chen, ``{An Introduction to Beamstrahlung and Disruption}'', in {\em
  Frontiers of Particle Beams}, M.~Month and S.~Turner, eds., Lecture Notes in
  Physics 296, pp.~481--494.
\newblock Springer-Verlag, 1986.

\item{Murphy:1996yt}
J.~B. Murphy, S.~Krinsky, and R.~L. Gluckstern, ``Longitudinal wakefield for an
  electron moving on a circular orbit'', {\em Part. Acc.} { 57} (1997) 9.

\item{Grichine:2002ns}
V.~M. Grichine, ``Radiation of accelerated charge in absorbing medium'',
  CERN-OPEN-2002-056.

\item{Luke_special_func}
Y.~Luke, ``{The special functions and their approximations}'', New York, NY:
  Academic Press, 1975.- 585 p.

\item{Umstaetter_synrad}
H.H.Umst\"atter. CERN/PS/SM/81-13, CERN Geneva 1981.

\item{LEP_Note_632}
H.~Burkhardt, ``{Monte Carlo Generator for Synchrotron Radiation}'', LEP Note
  632, CERN, December, 1990.

\item{InvSynFracInt_report}
H.~Burkhardt, ``{Monte Carlo Generation of the Energy Spectrum of Synchrotron
  Radiation}'', {to be published as CERN-AB and EuroTeV report}.

\end{enumerate}
\end{htmlonly}
