In real neutron experiments, detectors and monitors play quite different roles. One wants the detectors to be as efficient as possible, counting all neutrons (absorbing them in the process), while the monitors measure the intensity of the incoming beam, and must as such be almost transparent, interacting only with (roughly) 0.1-1% of the neutrons passing by. In computer simulations, it is of course possible to detect every neutron ray without absorbing it or disturbing any of its parameters. Hence, the two components have very similar functions in the simulations, and we do not distinguish between them. For simplicity, they are from here on just called monitors.
Another important difference between computer simulations and real experiments is that one may allow the monitor to be sensitive to any neutron property, as e.g. direction, energy, and divergence, in addition to what is found in real-world detectors (space and time). One may, in fact, let the monitor record correlations between these properties, as seen for example in the divergence/position sensitive monitor in section 10.7.
When a monitor detects a neutron ray, a number counting variable is incremented: \(n_i = n_{i-1}+1\). In addition, the neutron weight \(p_i\) is added to the weight counting variable: \(I_i = I_{i-1} + p_i\), and the second moment of the weight is updated: \(M_{2,i} = M_{2,i-1} + p_i^2\). As also discussed chapter 2, after a simulation of \(N\) rays the detected intensity (in units of neutrons/sec.) is \(I_N\), while the estimated errorbar is \(\sqrt {M_{2,N}^2}\).
Many different monitor components have been developed for McStas, but we have decided to support only the most important ones. One example of the monitors we have omitted is the single monitor, Monitor, that measures just one number (with errorbars) per simulation. This effect is mirrored by any of the 1- or 2-dimensional components we support, e.g. the PSD_monitor. In case additional functionality of monitors is required, the few code lines of existing monitors can easily be modified.
However, the ultimate solution is the use of the “Swiss army knife” of monitors, Monitor_nD, that can face almost any simulation requirement, but will prove challenging for users who like to perform own modifications. When compiling an instrument for GPU/OpenACC (see the User Manual, section on GPU acceleration), Monitor_nD automatically falls back to the companion component Monitor_nD_noacc for any options string not yet supported on GPU, via the NOACC/CPU funneling mechanism (see the User Manual’s kernel chapter); this is handled transparently and does not normally require any instrument change.
The monitors presented in detail below are a representative selection; the library additionally contains cylindrical and spherical variants of most of them (e.g. Cyl_monitor, PSD_monitor_4PI), energy-transfer and \(S(q,\omega )\)-aware monitors (Sqw_monitor, TOFLambda_monitor), polarisation-aware monitors (Pol_monitor, PolLambda_monitor), and flexible, user-configurable histogrammers (Flex_monitor_1D/2D/3D). Use mcdoc (User Manual, section on McDoc) for the complete, current list.