Component Manual for the Xray-Tracing Package McXtrace, version 3.8.6

2.1  X-ray simulations

X-ray scattering beamlines are built as a series of optical elements. Each of these elements modifies the beam characteristics (e.g. divergence, wavelength spread, spatial and temporal distributions) in a way which, for simple x-ray beam configurations, may be modelled with analytical methods.

However, real x-ray beamlines consist of a large number of optical elements, and this brings additional complexity by introducing strong correlations between x-ray beam parameters like divergence and position - which is the basis of the acceptance diagram method - but also wavelength and time. The usual analytical methods, such as phase-space theory, then reach their limit of validity in the description of the resulting effects.

In order to cope with this difficulty, Monte Carlo (MC) methods (for a general review, see Ref. [Jam80]) may be applied to the simulation of x-ray beamlines. The use of probability is commonplace in the description of microscopic physical processes. Integrating these events (absorption, scattering, reflection, ...) over the x-ray trajectories results in an estimation of measurable quantities characterizing the beamline. Moreover, using variance reduction (importance sampling) where possible, reduces the computation time and gives better accuracy.

Implementations of the MC method for X-ray beamlines already exist, most notable is probably SHADOW [WCC94], originally developed by the late Franco Cerrina and coworkers, now developed further by M. Sanchez Del Rio at the ESRF[Rio+11][Sha]. Other implementations of the same concept are RAY [Sch08] from BESSY and Xtrace[Bau+07]. hosted at ANKA

2.1.1  Monte Carlo ray tracing simulations

Mathematically, the Monte-Carlo method is an application of the law of large numbers [Jam80; GRR92]. Let \(f(u)\) be a finite continuous integrable function of parameter \(u\) for which an integral estimate is desirable. The discrete statistical mean value of \(f\) (computed as a series) in the uniformly sampled interval \(a < u < b\) converges to the mathematical mean value of \(f\) over the same interval.

\begin {equation} \lim _{n \rightarrow \infty } \frac {1}{n} \sum _{i=1, a \leq u_i \leq b}^n f(u_i) = \frac {1}{b-a}\int _a^b f(u) du \end {equation}

In the case were the \(u_i\) values are regularly sampled, we come to the well known midpoint integration rule. In the case were the \(u_i\) values are randomly (but uniformly) sampled, this is the Monte-Carlo integration technique. As random generators are not perfect, we rather talk about quasi-Monte-Carlo technique. We encourage the reader to refer to James [Jam80] for a detailed review on the Monte-Carlo method.