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)


A complete example

7.4  A complete example

The following excerpt, adapted from the PowderCompton_union example instrument (section 7.5), combines Compton scattering in a sphere with powder diffraction in a box:

1COMPONENT compton1 = Compton_xrl_process(density=8.92, atomno=29) 
2AT (0,0,0) ABSOLUTE 
3 
4COMPONENT pow2_proc = Powder_process(reflections=refs) 
5AT (0,0,0) ABSOLUTE 
6 
7COMPONENT cmpton1 = Union_make_material( 
8    process_string="compton1", my_absorption=0) 
9AT (0,0,0) ABSOLUTE 
10 
11COMPONENT pow2 = Union_make_material( 
12    process_string="pow2_proc", my_absorption=0) 
13AT (0,0,0) ABSOLUTE 
14 
15/* ... source, slits etc. as normal ... */ 
16 
17COMPONENT usphere = Union_sphere(radius=0.25e-3, material_string="cmpton1", 
18    priority=2) 
19AT (0,-0.3e-3,0) RELATIVE sample_position 
20 
21COMPONENT ubox = Union_box(xwidth=1e-3, yheight=0.75e-3, zdepth=0.5e-3, 
22    material_string="pow2", priority=1) 
23AT (0,0.8e-3,0) RELATIVE sample_position 
24 
25COMPONENT master = Union_master() 
26AT (0,0,0) RELATIVE sample_position 
27 
28COMPONENT fpi = PSD_monitor_4PI(radius=1.25, nx=101, ny=101, filename="fpi") 
29AT (0,0,0) RELATIVE sample_position

Note the two volumes overlap in neither space nor priority here (a sphere and a box placed side by side) – the priority mechanism only matters where volumes actually share space, as discussed in section 7.1.1.


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