/******************************************************************************* * McStas instrument definition URL=http://www.mcstas.org * * Instrument: Ex_2_5 * * %Identification * Written by: Linda Udby, E. Farhi (udby@fys.ku.dk) * Date: 09.04.10 * Origin: University of Copenhagen * Release: McStas CVS-080208 * Version: 0.2 * %INSTRUMENT_SITE: Ven_2010 * * Instrument excercise 2.5, monochromators * * %Description * Instrument excercise 2.5, monochromators * * Example: mcrun MonoFlat.instr * * %Parameters * a1: [deg] rotation angle of monochromator * a2: [deg] rotation angle of monochrimator take-off ,e.g. 2*a1 * LMIN: [Angs] Minimum neutron wavelength to generate * LMAX: [Angs] Maximum neutron wavelength to generate * MOSH: [min] horizontal monochromator mosaicity * MOSV: [min] vertical monochromator mosaicity * %End *******************************************************************************/ /* Change name of instrument and input parameters with default values */ DEFINE INSTRUMENT Ex_2_5(a1=37.07,a2=74.14, LMIN=3.8, LMAX=4.3, MOSH=40, MOSV=40, string mount="Al.laz") DECLARE %{ double nm=1e-9; /* [m] a small shift used to avoid component overlap */ double flag_mechanics=0; %} /* Here comes the TRACE section, where the actual */ /* instrument is defined as a sequence of components. */ TRACE COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT Source = Source_simple( height = 0.1, width = 0.1, dist = 10, xw = 0.1, yh = 0.1, Lambda0 = (LMAX + LMIN)/2, dLambda = (LMAX - LMIN)/2, flux = 1, gauss = 0) AT (0, 0, 0) RELATIVE Origin /* monochrimator cradle */ COMPONENT Arm1 = Arm( ) AT (0, 0, 10) RELATIVE Source ROTATED (0, a1, 0) RELATIVE Source /* direction of outgoing refelcted neutrons (take-off) */ COMPONENT Arm2 = Arm( ) AT (0, 0, 10) RELATIVE Source ROTATED (0, a2, 0) RELATIVE Source EXTEND %{ flag_mechanics=0; %} /* we add here some material to model mechanics */ COMPONENT Mechanics = PowderN( xwidth=0.02, yheight=0.1, zthick=0.02, reflections=mount, d_phi=10, tfrac=0.8, frac=0.05 ) AT (0, 0, -0.06) RELATIVE Arm1 EXTEND %{ if (SCATTERED) flag_mechanics=1; %} COMPONENT Monochromator = Monochromator_flat( width = 0.1, height = 0.1, mosaich = MOSH, mosaicv = MOSV, r0 = 0.8, Q = 1.8734) AT (0, 0, 0) RELATIVE Arm1 COMPONENT PSDsphere = PSD_monitor_4PI( nx = 100, ny = 100, filename = "PSDsphere", restore_neutron = 1, radius = 1-nm) AT (0, 0, 10) RELATIVE Source COMPONENT PSDsphereMechanics = PSD_monitor_4PI( nx = 100, ny = 100, filename = "PSDsphereMechanics", restore_neutron = 1, radius = 1-nm) WHEN (flag_mechanics) AT (0, 0, 10) RELATIVE Source COMPONENT PSD = PSD_monitor( nx = 100, ny = 100, filename = "PSD.dat", restore_neutron = 1, xwidth = 0.15, yheight = 0.15) AT (0, 0, 1) RELATIVE Arm2 COMPONENT DivMon = Divergence_monitor( nh = 200, nv = 200, filename = "DivMon.dat", restore_neutron = 1, xwidth = 0.2, yheight = 0.2, h_maxdiv = 5, v_maxdiv =5) AT (0, 0, 1+nm) RELATIVE Arm2 COMPONENT LambdaMon = L_monitor( nchan = 100, filename = "LambdaMon", restore_neutron = 1, xwidth = 0.1, yheight = 0.1, Lmin = LMIN, Lmax = LMAX) AT (0, 0, 1+2*nm) RELATIVE Arm2 COMPONENT HDivLambda = DivLambda_monitor( nlam = 100, ndiv = 100, filename = "HDivLambda.dat", restore_neutron = 1, xwidth = 0.20, yheight = 0.20, maxdiv = 2, lambda_0 = LMIN, lambda_1 = LMAX) AT (0, 0, 1+3*nm) RELATIVE Arm2 /* The END token marks the instrument definition end */ END