The Union framework, originally contributed by Mads Bertelsen for McStas and ported to McXtrace, is a set of components that together allow the description of complex, possibly nested or overlapping, sample environments with multiple scattering, by separating the description of geometry (where matter is) from physical process (what happens to a photon there, e.g. Compton or Rayleigh scattering, photoelectric absorption, or powder diffraction).
A Union simulation is assembled in four steps, each using one or more of the component classes documented in this chapter:
One or more process components (e.g. Incoherent_process, Compton_xrl_process, Rayleigh_xrl_process, Powder_process) each describe one interaction process.
These are gathered into named materials using Union_make_material, which may combine several processes into one material definition.
Geometry components (Union_box, Union_cylinder, Union_sphere, Union_cone) place volumes of a given material in the instrument, and may be nested or intersected to build up arbitrarily complex sample environments.
A Union_master component, placed after all of the geometries it should simulate, performs the actual ray-tracing (including multiple scattering) through every geometry defined since the previous master (or since Union_init).