/******************************************************************************* * McStas instrument definition URL=http://www.mcstas.org * * Instrument: Incoherent_test * * %Identification * Written by: Peter Willendrup, Erik Knudsen, Aziz Aziz Daoud-aladine * Date: August 14th, 2007 * Origin: RISOE * Release: McStas 1.12c * Version: 0.1 * %INSTRUMENT_SITE: tests * * This instrument allows to compare incoherent scattering from different McStas * sample components. * %Description * This instrument allows to compare incoherent scattering from different McStas * sample components: * * V_sample * PowderN * Single_crystal * Isotropic_sqw * * * Examples: * * Compare incoherent scattering from all four sample comps, beamstop in place: * (V_multiples=0: V_sample algo identical to PowderN algo - NO multiples * V_multiples: V_sample performs crude estimate for multiple scattering) * * mcrun Incoherent_test -d Some_directory -N4 SAMPLE=1,4 STOP=1 V_multiples=0 * * Compare incoherent scattering and direct beam attenuation for PowderN, Single_crystal * and Isotroic_sqw: * * mcrun Incoherent_test -d Some_other_directory -N3 SAMPLE=2,4 STOP=0 * * Have a closer look of direct beam attentuation for PowderN, Single_crystal * and Isotroic_sqw (has the side-effect that back-scattered neutrons are absorbed): * * mcrun Incoherent_test -d Some_third_directory -N3 SAMPLE=2,4 STOP=0 DB=1 * * %Parameters * L_min: [AA] Minimum wavelength of neutrons * L_max: [AA] Maximum wavelength of neutrons * SAMPLE: [1] 1==Vanadium 2==PowderN 3==Single_Crystal 4==Isotropic_sqw * V_multiples: [1] Use crude estimate for multiple scattering in V_sample? * STOP: [1] Beamstop inserted? (Needed in case of comparison between V and SX/sqw). * DB: [1] Direct Beam monitor inserted? (Side-effect: absorbs 'backscattered' neutrons). * Order: [1] Maximum order of multiple scattering in SX/sqw * INC: [barns] Incoherent scattering cross section * ABS: [barns] Absorption cross section * ISISFACE: [string] ISIS moderator face to look at * %Link * Validation of Single_crystal is now in progress! * * %End *******************************************************************************/ DEFINE INSTRUMENT Incoherent_test(L_min=0.5, L_max=7, SAMPLE, STOP=0, V_multiples=1, Order=0, INC=5.08, ABS=5.08, DB=0, string ISISFACE="hydrogen") DECLARE %{ double e_min,e_max; %} INITIALIZE %{ e_min=81.799/L_max/L_max; e_max=81.799/L_min/L_min; %} TRACE COMPONENT Source = ISIS_moderator( Face = ISISFACE, E0 = e_min, E1 = e_max, dist = 8.299, xw = 0.005, yh = 0.005, modXsize = .12, modYsize = .115, CAngle = 0, SAC = 1) AT (0, 0, 0) ABSOLUTE COMPONENT Coord = Arm() AT (0.0,0.0,8.3000) RELATIVE Source COMPONENT Vsample = V_sample( xwidth=0.005, yheight=0.005, zthick=0.005 , sig_a=ABS, sig_i=INC, multiples=V_multiples) WHEN (SAMPLE==1) AT (0, 0, 0) RELATIVE Coord COMPONENT PowN = PowderN(reflections="", d_phi=0, Vc = 13.827, tfrac = 0.5, frac = 0.5, xwidth=0.005, yheight=0.005, zthick=0.005 , sigma_abs=ABS, sigma_inc=INC, radius=0) WHEN (SAMPLE==2) AT (0, 0, 0) RELATIVE Coord COMPONENT SX = Single_crystal(reflections="", order=Order, xwidth=0.005, yheight=0.005, zthick=0.005 , absorption=ABS, incoherent=INC, ax=3.0282, by=3.0282, cz=3.0282/2) WHEN (SAMPLE==3) AT (0, 0, 0) RELATIVE Coord COMPONENT Sqw = Isotropic_Sqw(V_rho=1/13.827, order=Order, sigma_abs=ABS, sigma_inc=INC, sigma_coh=0, xwidth=0.005, yheight=0.005, zdepth=0.005) WHEN (SAMPLE==4) AT (0,0,0) RELATIVE Coord COMPONENT Dirbeam = PSD_monitor(nx=128,ny=128,filename="beamstopPSD",xwidth=0.01,yheight=0.01) WHEN (DB) AT (0,0,0.039) RELATIVE Sqw COMPONENT Stop = Beamstop(radius=0.005) WHEN (STOP==1) AT (0,0,0.04) RELATIVE Sqw COMPONENT Tof_Sphere_4pi = Monitor_nD( options = "sphere abs lambda, limits=[0.38,7.13], bins=2000, file=TOF", xwidth = 0.1, yheight = 0, zthick = 0) AT (0, 0, 0) RELATIVE Coord COMPONENT PSD_Sphere_4pi = PSD_monitor_4PI(radius=0.051, nx=180, ny=180, filename="PSD") AT (0, 0, 0) RELATIVE Coord COMPONENT Coord3 = Arm() AT (0.0,0.0,8.3000) RELATIVE Source EXTEND %{ p=1; %} COMPONENT Sphere_4pi = PSD_monitor_4PI(radius=0.052, nx=180, ny=180, filename="Events") AT (0, 0, 0) RELATIVE Coord END