User and Programmers’ Guide to the X Ray-Tracing Package McXtrace, version 3.8.6

4.3  Weight factor transformations during a Monte Carlo choice

When a Monte Carlo choice must be performed, e.g. when the initial energy and direction of the x-ray ray is decided at the source, it is important to adjust the x-ray weight so that the combined effect of x-ray weight change and Monte Carlo probability of making this particular choice equals the actual physical properties we like to model.

Let us follow up on the simple example of transmission. The probability of transmitting the real x-ray is \(P\), but we make the Monte Carlo choice of transmitting the x-ray every time: \(f_\mathrm {MC}=1\). This must be reflected on the choice of weight multiplier \(\pi _j\) given by the master equation In the “real” semi-classical world, there is a distribution (probability density) for the x-rays in the six dimensional (energy, direction, position) space of \(\Pi (E,\Ombold ,\mathbf {r}) = dP/(dE d\Ombold d^3\mathbf {r})\) depending upon the source type and its parameters (such as gap, period, field strength etc. for an undulator). In the Monte Carlo simulations, the six coordinates are for efficiency reasons in general picked from another distribution: \(f_\mathrm {MC}(E,\Ombold ,\mathbf {r}) \neq \Pi (E, \Ombold ,\mathbf {r})\), since one would e.g. often generate only x-rays within a certain parameter interval. However, we must then require that the weights are adjusted by a factor \(\pi _j\) (in this case: \(j=1\)) so that \begin {equation} \label {probrule} f_\mathrm {MC} \pi _j = P . \end {equation}

This probability rule is general, and holds also if, e.g., it is decided to transmit only half of the rays \((f_\mathrm {MC}=0.5)\). An important different example is elastic scattering from a powder sample, where the Monte-Carlo choices are the particular powder line to scatter from, the scattering position within the sample and the final x-ray direction within the Debye-Scherrer cone.

4.3.1  Direction focusing

An important application of weight transformation is direction focusing. Assume that the sample scatters the x-rays in many directions. In general, only x-rays in some of these directions will stand any chance of being detected. These directions we call the interesting directions. The idea in focusing is to avoid wasting computation time on x-rays scattered in the other directions. This trick is an instance of what in Monte Carlo terminology is known as importance sampling.

If e.g. a sample scatters isotropically over the whole \(4\pi \) solid angle, and all interesting directions are known to be contained within a certain solid angle interval \(\Delta \Ombold \), only these solid angles are used for the Monte Carlo choice of scattering direction. According to Eq. (4.9), the weight factor will then have to be changed by the amount \(\pi _j = |\Delta \Ombold | / (4 \pi )\). One thus ensures that the mean simulated intensity is unchanged during a ”correct” direction focusing, while a too narrow focusing will result in a lower (i.e. wrong) intensity, since we cut x-rays rays that should have reached the final detector.


PIC


Figure 4.1.: Illustration of the effect of direction focusing in McXtrace. Weights of x-rays emitted into a certain solid angle are scaled down by the full unit sphere area.