McXtrace logo

McXtrace - An X-ray ray-trace simulation package

Synchrotron SOLEIL DTU Physics

McXtrace

About McXtrace
 Publications
 Project Partners
 Project People
 Goal

Download
 Components

Documentation
 Manual
 Commands
 Wiki (GitHub)
 Tutorial

Mailing list

Links

Search

Code-repository (GitHub)

Report bugs (GitHub)


8 Monitors and detectors

8  Monitors and detectors

In real scattering experiments, detectors and monitors play quite different roles. One wants the detectors to be as efficient as possible, counting all photons (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 photons passing by. In computer simulations, it is of course possible to detect every xray 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 xray 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.

When a monitor detects a xray, a number counting variable is incremented: \(n_i = n_{i-1}+1\). In addition, the photon 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 photonts/sec.) is \(I_N\), while the estimated errorbar is \(\sqrt {M_{2,N}^2}\).

Several different monitor components have been developed for McXtrace, 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, a few lines of code in existing monitors can easily be modified.

Another solution is the “Swiss army knife” of monitors, Monitor_nD, that can handle almost any simulation requirement, but may prove challenging for inexperienced users or users who like to make their own modifications.


Last Modified: Monday, 05-Oct-2026 10:48:08 CEST
Search website mailinglist archive GitHub repos