Component Manual for the Neutron Ray-Tracing Package McStas, version 3.8.6

2.2  The neutron weight

A totally realistic semi-classical simulation will require that each neutron is at any time either present or lost. In many instruments, only a very small fraction of the initial neutrons will ever be detected, and simulations of this kind will therefore waste much time in dealing with neutrons that never hit the relevant detector or monitor.

An important way of speeding up calculations is to introduce a neutron "weight factor" for each simulated neutron ray and to adjust this weight according to the path of the ray. If e.g. the reflectivity of a certain optical component is 10%, and only reflected neutrons ray are considered later in the simulations, the neutron weight will be multiplied by 0.10 when passing this component, but every neutron is allowed to reflect in the component. In contrast, the totally realistic simulation of the component would require in average ten incoming neutrons for each reflected one.

Let the initial neutron weight be \(p_0\) and let us denote the weight multiplication factor in the \(j\)’th component by \(\pi _j\). The resulting weight factor for the neutron ray after passage of the \(n\) components in the instrument becomes the product of all contributions \begin {equation} \label {e:probprod} p = p_n = p_0 \prod _{j=1}^n \pi _j . \end {equation} Each adjustment factor should be \(0 < \pi _j < 1\), except in special circumstances, so that total flux can only decrease through the simulation, see section 2.3. For convenience, the value of \(p\) is updated (within each component) during the simulation.

Simulation by weight adjustment is performed whenever possible. This includes

2.2.1  Statistical errors of non-integer counts

In a typical simulation, the result will consist of a count of neutrons histories ("rays") with different weights. The sum of these weights is an estimate of the mean number of neutrons hitting the monitor (or detector) per second in a “real” experiment. One may write the counting result as \begin {equation} \label {psum} I = \sum _i p_i = N \overline {p} , \end {equation} where \(N\) is the number of rays hitting the detector and the horizontal bar denotes averaging. By performing the weight transformations, the (statistical) mean value of \(I\) is unchanged. However, \(N\) will in general be enhanced, and this will improve the accuracy of the simulation.

To give an estimate of the statistical error, we proceed as follows: Let us first for simplicity assume that all the counted neutron weights are almost equal, \(p_i \approx \overline {p}\), and that we observe a large number of neutrons, \(N \geq 10\). Then \(N\) almost follows a normal distribution with the uncertainty \(\sigma (N) = \sqrt {N}\) 1. Hence, the statistical uncertainty of the observed intensity becomes \begin {equation} \label {e:sigI1} \sigma (I) = \sqrt {N} \overline {p} = I / \sqrt {N} , \end {equation} as is used in real neutron experiments (where \(\overline {p} \equiv 1\)). For a better approximation we return to Eq. (2.3). Allowing variations in both \(N\) and \(\overline {p}\), we calculate the variance of the resulting intensity, assuming that the two variables are statistically independent: \begin {equation} \sigma ^2(I) = \sigma ^2(N) \overline {p}^2 + N^2 \sigma ^2(\overline {p}) . \end {equation} Assuming as before that \(N\) follows a normal distribution, we reach \(\sigma ^2(N) \overline {p}^2 = N \overline {p}^2\). Further, assuming that the individual weights, \(p_i\), follow a Gaussian distribution (which in some cases is far from the truth) we have \(N^2 \sigma ^2(\overline {p}) = \sigma ^2(\sum _i p_i) = N \sigma ^2(p_i)\) and reach \begin {equation} \sigma ^2(I) = N \left ( \overline {p}^2 + \sigma ^2(p_i) \right ). \end {equation} The statistical variance of the \(p_i\)’s is estimated by \(\sigma ^2(p_i) \approx (\sum _i p_i^2 - N \overline {p}^2) / (N-1)\). The resulting variance then reads \begin {equation} \sigma ^2(I) = \frac {N}{N-1} \left ( \sum _i p_i^2 - \overline {p}^2 \right ) . \end {equation} For almost any positive value of \(N\), this is very well approximated by the simple expression \begin {equation} \sigma ^2(I) \approx \sum _i p_i^2 . \end {equation} As a consistency check, we note that for all \(p_i\) equal, this reduces to eq. (2.4)

In order to compute the intensities and uncertainties, the monitor/detector components in McStas will keep track of \(N=\sum _i p_i^0, I=\sum _i p_i^1\), and \(M_2 = \sum _i p_i^2\).