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
Simulation by weight adjustment is performed whenever possible. This includes
Transmission through filters and windows.
Transmission through Soller blade collimators and velocity selectors (in the approximation which does not take each blade into account).
Reflection from monochromator (and analyzer) crystals with finite reflectivity and mosaicity.
Reflection from guide walls.
Passage of a continuous beam through a chopper.
Scattering from all types of samples.
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
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
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\).