/******************************************************************************* * McStas instrument definition URL=http://www.mcstas.org * * Instrument: Exercise3e_detectors * * %Identification * Written by: Luke Skywalker * Origin: The Moon * Release: McStas CVS-080208 * Version: 0.2 * %INSTRUMENT_SITE: Death_Star * * 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 Exercise3e_detectors.instr lambda=2 * * %Parameters * lambda: [Angs] Incoming wavelength * window: [string] material used as housing * * %End *******************************************************************************/ DEFINE INSTRUMENT Exercise3e_detectors(lambda=2, string window="Al.laz") 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, focus_xw = 0.1e-3, focus_yh = 0.1e-3, lambda0 = lambda, dlambda = 0.1) AT (0, 0, 0) RELATIVE Origin COMPONENT Window = PowderN( xwidth=0.1, yheight=0.1, zdepth=0.001, reflections=window, p_transmit=0.9, p_inc=0.05 ) AT (0, 0, 2-0.02) RELATIVE Source EXTEND %{ if (SCATTERED) flag_window=1; %} COMPONENT PSD_total=Monitor_nD(bins=128, xwidth=0.05, yheight=0.05) AT(0,0,2.01) RELATIVE Source COMPONENT PSD_window=COPY(PSD_total) WHEN (flag_window) AT(0,0,2.02) RELATIVE Source COMPONENT BIDIM26=PSD_Detector(xwidth=0.026, yheight=0.026, nx=128, ny=128, zdepth=0.03, PressureConv=5, PressureStop=1, FN_Conv="Gas_tables/He3inHe.table", FN_Stop="Gas_tables/He3inCF4.table", filename="BIDIM26.psd") AT(0,0,2.03) RELATIVE Source END