/******************************************************************************* * McStas instrument definition URL=http://www.mcstas.org * * Instrument: Ex_3_1 * * %Identification * Written by: E. Farhi * Date: May 19, 2010 * Origin: ESS * Release: McStas CVS-080208 * Version: 0.2 * %INSTRUMENT_SITE: Ven2010 * * A simple sample and environment * * %Description * A simple sample and environment * * Example: mcrun Ex_3_1_2.instr lambda=2 * * %Parameters * lambda: [Angs] Incoming wavelength * sample: [string] Material used as a sample * * %Link * essworkshop.org/storage * * %End *******************************************************************************/ /* Change name of instrument and input parameters with default values */ DEFINE INSTRUMENT Ex_3_1_2(lambda=2, string sample="SiO2_quartza.lau") DECLARE %{ int flag_env=0; int flag_sample=0; %} TRACE COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE EXTEND %{ flag_env=flag_sample=0; %} COMPONENT Source=Source_simple( radius=0.05, dist=4,xw=0.02,yh=0.02,Lambda0=lambda,dLambda=0.1) AT(0,0,0) RELATIVE Origin COMPONENT entry_side=PowderN( reflections="Al.laz", radius=0.035, radius_i=0.035-0.0002, yheight=0.1, d_phi=50,tfrac=0.8,concentric=1) AT(0,0,4) RELATIVE Source EXTEND %{ if (SCATTERED) flag_env=1; %} COMPONENT Sample=PowderN( reflections=sample, radius=0.005,yheight=0.02,d_phi=50) AT(0,0,4) RELATIVE Source EXTEND %{ if (SCATTERED) flag_sample=1; %} COMPONENT exit_side=COPY(entry_side)(concentric=0) AT(0,0,4) RELATIVE Source EXTEND %{ if (SCATTERED) flag_env=1; %} COMPONENT Detector=Monitor_nD( xwidth=2,yheight=1, options="banana theta y, auto", bins=180) AT(0,0,0) RELATIVE Sample COMPONENT Det_env=COPY(Detector) WHEN (flag_env) AT(0,0,0) RELATIVE Sample COMPONENT Det_samlpe=COPY(Detector) WHEN (flag_sample) AT(0,0,0) RELATIVE Sample END