/******************************************************************************* * * McStas, neutron ray-tracing package * Copyright (C) 1997-2008, All rights reserved * Risoe National Laboratory, Roskilde, Denmark * Institut Laue Langevin, Grenoble, France * * Instrument: Union_test_box * * %Identification * Written by: Mads Bertelsen * Date: June 2020 * Origin: ESS * %INSTRUMENT_SITE: Union_demos * * Simple test instrument for absorption loggers. * * %Description * Simple test instrument for absorption loggers. * * %End *******************************************************************************/ DEFINE INSTRUMENT Union_layers_abs_logger() DECLARE %{ %} TRACE COMPONENT incoherent_1 = Incoherent_process(sigma=10, packing_factor=1, unit_cell_volume=66.4) AT (0,0,0) ABSOLUTE COMPONENT material_1 = Union_make_material(my_absorption=4.0, process_string="incoherent_1") AT (0,0,0) ABSOLUTE COMPONENT incoherent_2 = Incoherent_process(sigma=3, packing_factor=1, unit_cell_volume=66.4) AT (0,0,0) ABSOLUTE COMPONENT material_2 = Union_make_material(my_absorption=6.0, process_string="incoherent_2") AT (0,0,0) ABSOLUTE COMPONENT a1 = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT source = Source_div( xwidth=0.0005, yheight=0.0005,focus_aw=0.1, focus_ah=0.1, E0 = 10, dE = 0) AT (0,0,0) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1 // Sample position COMPONENT beam_center = Arm() AT (0,0,1.4) RELATIVE a1 ROTATED (0,0,0) RELATIVE a1 COMPONENT detector_dir = Arm() AT (0,0,0) RELATIVE beam_center ROTATED (0, 30, 0) RELATIVE beam_center // V1 COMPONENT layer1 = Union_box(xwidth=0.15, yheight=0.15, zdepth=0.03, priority=5, material_string="material_1") AT (0,0,0) RELATIVE beam_center ROTATED (0,0,0) RELATIVE beam_center // V2 COMPONENT layer2 = Union_box(xwidth=0.15, yheight = 0.15, zdepth=0.03, priority=6, material_string="material_2") AT (0,0,0.03 + 0.005) RELATIVE layer1 // 5 mm space between // Normal logger, recording scattering events COMPONENT logger = Union_logger_2D_space( D_direction_1="z", D1_min=-0.05, D1_max=0.05, n1=200, D_direction_2="x", D2_min=-0.05, D2_max=0.05, n2=200, filename="logger_space_xz") AT (0,0,0) RELATIVE beam_center // Absorption logger, recording absorption events COMPONENT abs_logger = Union_abs_logger_2D_space( D_direction_1="z", D1_min=-0.05, D1_max=0.05, n1=200, D_direction_2="x", D2_min=-0.05, D2_max=0.05, n2=200, filename="abs_logger_space_xz.dat") AT (0,0,0) RELATIVE beam_center // Absorption logger which is attached to a geometry, only recording events in that geometry COMPONENT abs_logger_attached = Union_abs_logger_2D_space( target_geometry="layer2", D_direction_1="z", D1_min=-0.05, D1_max=0.05, n1=200, D_direction_2="x", D2_min=-0.05, D2_max=0.05, n2=200, filename="abs_logger_space_xz_layer2.dat") AT (0,0,0) RELATIVE beam_center // Absorption logger 1D version, measuring along the y direction. COMPONENT abs_logger_1D = Union_abs_logger_1D_space( yheight=0.2, n=100, filename="abs_logger_1D_space_y.dat") AT (0,0.01,0) RELATIVE beam_center // Moved to check translations work // Conditional component will limit the recorded events to those that satisfy the conditional COMPONENT conditional_psd = Union_conditional_PSD( target_loggers="abs_logger_1D", xwidth=0.05, yheight=0.05) AT (0, 0, 0.3) RELATIVE detector_dir // Absorption logger that includes time of absorption COMPONENT abs_logger_1D_space_tof = Union_abs_logger_1D_space_tof( yheight=0.2, n=100, time_min=0.00095, time_max=0.0015, time_bins=1000, filename="abs_logger_1D_space_y_tof.dat") AT (0,0,0) RELATIVE beam_center // Conditional component that checks the final energy COMPONENT conditional_energy = Union_conditional_standard( target_loggers="abs_logger_1D_space_tof", E_min=9, E_max=10.5) AT (0,0,0) RELATIVE beam_center // Union master that performs the simulation, recording absorption to file as well COMPONENT master = Union_master(record_absorption=1) AT(0,0,0) RELATIVE beam_center ROTATED(0,0,0) RELATIVE beam_center END