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)


Motivation

7.1  Motivation

An ordinary McXtrace instrument is a linear sequence of self-contained components: an x-ray enters a component, something happens to it (or not), and it moves on to the next component in the sequence. This is a good match for the intended beam path through an instrument, but it means that

  • a single sample component must contain all the physics relevant to that sample – absorption and every scattering process – as one monolithic block of code, and

  • multiple scattering between physically separate parts of a sample environment (a sample inside a capillary, inside a sample changer, …) is essentially impossible to capture, since each part would need to be a separate component and McXtrace components do not natively talk to each other.

The Union components solve this by splitting the sample simulation task into several cooperating component classes – processes, materials, geometries and a master – and performing the actual ray tracing for all of them together, inside the master component, with full native multiple scattering between every defined volume. Because physics (processes) and geometry are separated, adding a new scattering process is a comparatively small task, and existing processes can be freely combined and reused across different shapes.


PIC


Figure 7.1.: Left: the linear succession of components in a traditional McXtrace instrument file. Right: the same instrument using Union components – all ray tracing for the sample environment happens inside a single master component, which works around the normal McXtrace component sequence to achieve native multiple scattering between an arbitrary number of volumes. (Originally illustrated for McStas; the same principle applies unchanged to McXtrace.)


It is entirely possible, and common, to mix ordinary McXtrace components with Union components in the same instrument file – the Union machinery only takes over at its Union_master components (section 7.2).

7.1.1  Volumes, priority and overlap

The central concept of the Union components is the volume: a geometrical shape (box, cylinder, sphere or cone) combined with a material definition (absorption plus zero or more scattering processes), placed in space using the ordinary AT/ROTATED mechanism. Volumes may be placed in any order in the instrument file, and, unlike ordinary McXtrace geometry, volumes are allowed to overlap.

Each volume is given a unique priority value. Wherever two or more volumes overlap in space, the material of the volume with the highest priority applies. This single rule makes it straightforward to build geometries that would otherwise require careful, error-prone manual splitting into non-overlapping pieces: a hollow capillary wall is simply a material cylinder with a vacuum cylinder of higher priority placed inside it, and a layered sample with several different materials is built from concentric or adjacent shapes, each its own volume and material.


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