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

4  Monte Carlo Techniques and simulation strategy

This chapter explains the simulation strategy and the Monte Carlo techniques used in McXtrace. We first explain the concept of the x-ray weight factor, and discuss the statistical errors in dealing with sums of x-ray weights. Secondly, we give an expression for how the weight factor transforms under a Monte Carlo choice and specialize this to the concept of direction focusing. Finally, we present a way of generating random numbers with arbitrary distributions. More details are available in the Appendix concerning random numbers in the User manual.

4.1 X-ray simulations
4.1.1 Monte Carlo ray tracing simulations
4.2 The x-ray weight
4.2.1 Statistical errors of non-integer counts
4.3 Weight factor transformations during a Monte Carlo choice
4.3.1 Direction focusing
4.4 Stratified sampling
4.5 Accuracy of Monte Carlo simulations