/******************************************************************************* * McStas instrument definition URL=http://www.mcstas.org * * Instrument: Ex_4 * * %Identification * Written by: E. Farhi * Date: Current May 2010, 20 * Origin: ILL * Release: McStas CVS-080208 * Version: 0.2 * %INSTRUMENT_SITE: Ven2010 * * A simple detector that shows many features * * %Description * A gas cell, with a housing plate in front. Beam is a single pencil-like ray. * * Example: mcrun Ex_4.instr lambda=2 * * %Parameters * lambda: [Angs] Incoming wavelength * window: [string] material used as housing * * %Link * essworkshop.org * * %End *******************************************************************************/ /* Change name of instrument and input parameters with default values */ DEFINE INSTRUMENT Ex_4(lambda=2, string window="Al.laz") /* The DECLARE section allows us to declare variables or small */ /* functions in C syntax. These may be used in the whole instrument. */ DECLARE %{ int flag_window=0; %} TRACE COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE EXTEND %{ flag_window=0; %} COMPONENT Source = Source_simple( radius = 1e-4, dist = 2, xw = 0.1e-3, yh = 0.1e-3, Lambda0 = lambda, dLambda = 0.1) AT (0, 0, 0) RELATIVE Origin COMPONENT Window = PowderN( xwidth=0.1, yheight=0.1, zthick=0.001, reflections=window, tfrac=0.9, frac=0.05 ) AT (0, 0, 2-0.02) RELATIVE Source EXTEND %{ if (SCATTERED) flag_window=1; %} COMPONENT PSD_total=Monitor_nD(bins=128) AT(0,0,2.01) RELATIVE Source COMPONENT PSD_window=Monitor_nD(bins=128) WHEN (flag_window) AT(0,0,2.02) RELATIVE Source COMPONENT BIDIM26=PSD_Detector(xwidth=0.026, yheight=0.026, nx=128, ny=128, depth=0.03, thres=100, borderx=-1, bordery=-1, PressureConv=5, PressureStop=1, FN_Conv="Gas_tables/He3inHe.table", FN_Stop="Gas_tables/He3inCF4.table", xChDivRelSigma=0, yChDivRelSigma=0, filename="BIDIM26.psd") AT(0,0,2.03) RELATIVE Source END