/******************************************************************************* * * McStas, neutron ray-tracing package * Copyright (C) 1997-2008, All rights reserved * Risoe National Laboratory, Roskilde, Denmark * Institut Laue Langevin, Grenoble, France * * Instrument: templateVanadiumMultipleScat_Mantid * * %Identification * Written by: Mads Bertelsen (UCPH), Anders Markvardsen (ISIS), Peter Willendrup (DTU) * Date: 19th Dec 2003. * %INSTRUMENT_SITE: Mantid * * Test instrument demonstrating use of the McStas-Mantid coupling for studies of multiple * scattering. Will be developed further at later time. * * %Description * Very simple test instrument demonstrating use of the McStas-Mantid coupling for studies * of multiple scattering * * Needed steps: * 1) Compile your instrument with NeXus library support * 2) Generate an IDF using * mcdisplay.pl --format=Mantid templateVanadiumMultipleScat_Mantid -n0 * 3) mcrun templateVanadiumMultipleScat_Mantid -n1e6 --format=NeXus * * %Parameters * * %Link * * %End *******************************************************************************/ DEFINE INSTRUMENT templateVanadiumMultipleScat_Mantid() DECLARE %{ int multi_flag ; int single_flag ; %} TRACE COMPONENT Origin = Progress_bar(percent=5) AT (0,0,0) ABSOLUTE EXTEND %{ single_flag = multi_flag = 0; %} COMPONENT sourceMantid = Source_simple(radius=0.001, dist=1, focus_xw=0.001, focus_yh=0.001, E0=5, dE=0.01) AT (0, 0, 0) RELATIVE Origin COMPONENT sampleMantid = Incoherent(radius=0.002, yheight=0.015, focus_r=0, pack=1, target_x=0, target_y=0, target_z=1, f_QE=0, gamma=0) AT (0, 0, 1) RELATIVE sourceMantid EXTEND %{ if (SCATTERED == 1) single_flag =1 ; if (SCATTERED > 1) multi_flag =1 ; %} COMPONENT nD_Mantid_0 = Monitor_nD( options ="Mantid square, x limits=[-2.5 2.5] bins=50 y limits=[-2.5 2.5] bins=50, neutron pixel min=0 t limits [0.002,0.005] list all neutrons, file=multi", xwidth = 5, yheight = 5, restore_neutron = 1) WHEN (multi_flag ==1) AT (0, 0, 1) RELATIVE sampleMantid COMPONENT Mantid_1 = Monitor_nD( options ="square, x limits=[-2.5 2.5] bins=50 y limits=[-2.5 2.5] bins=50, neutron pixel min=0 t limits [0.002,0.005] list all neutrons, file=single", xwidth = 5, yheight = 5, restore_neutron = 1) WHEN (single_flag ==1) AT (0, 0, 1) RELATIVE sampleMantid END