User and Programmers Guide to the Neutron Ray-Tracing Package McStas, version 3.9

6.4  A complete example

The following excerpt shows the pieces from this chapter assembled into a working instrument fragment: an aluminium sample can holding an iron sample, both with incoherent and powder scattering.

1COMPONENT Al_inc = Incoherent_process(sigma=4*0.0082, unit_cell_volume=66.4) 
2AT (0,0,0) ABSOLUTE 
3 
4COMPONENT Al_powder = Powder_process(reflections="Al.laz") 
5AT (0,0,0) ABSOLUTE 
6 
7COMPONENT Al = Union_make_material(my_absorption=100*4*0.231/66.4, 
8    process_string="Al_inc,Al_powder") 
9AT (0,0,0) ABSOLUTE 
10 
11COMPONENT Fe_inc = Incoherent_process(sigma=2*0.4, unit_cell_volume=24.04) 
12AT (0,0,0) ABSOLUTE 
13 
14COMPONENT Fe_powder = Powder_process(reflections="Fe.laz") 
15AT (0,0,0) ABSOLUTE 
16 
17COMPONENT Fe = Union_make_material(my_absorption=100*2*2.56/24.04, 
18    process_string="Fe_inc,Fe_powder") 
19AT (0,0,0) ABSOLUTE 
20 
21/* ... source, guide etc. as normal ... */ 
22 
23COMPONENT sample_position = Arm() 
24AT (0,0,12.5) RELATIVE Guide 
25 
26COMPONENT can = Union_cylinder(radius=0.006, yheight=0.04, 
27    priority=1, material_string="Al") 
28AT (0,0,0) RELATIVE sample_position 
29 
30COMPONENT can_vacuum = Union_cylinder(radius=0.005, yheight=0.038, 
31    priority=2, material_string="Vacuum") 
32AT (0,0,0) RELATIVE sample_position 
33 
34COMPONENT sample = Union_cylinder(radius=0.004, yheight=0.03, 
35    priority=3, material_string="Fe") 
36AT (0,0,0) RELATIVE sample_position 
37 
38COMPONENT master = Union_master() 
39AT (0,0,0) RELATIVE sample_position 
40 
41COMPONENT Banana_monitor = Monitor_nD(radius=1, yheight=0.1, 
42    options="banana, theta limits=[20,170], bins=200", filename="banana.dat") 
43AT (0,0,0) RELATIVE sample_position