/******************************************************************************* * McStas instrument definition URL=http://www.mcstas.org * * Instrument: test (rename also the example and DEFINE lines below) * * %Identification * Written by: Your name (email) * Date: Current Date * Origin: Your institution * Release: McStas CVS-080208 * Version: 0.2 * %INSTRUMENT_SITE: Institution_name_as_a_single word * * Instrument short description * * %Description * Instrument longer description (type, elements, usage...) * * Example: mcrun test.instr * * %Parameters * Par1: [unit] Parameter1 description * * %Link * A reference/HTML link for more information * * %End *******************************************************************************/ /* Change name of instrument and input parameters with default values */ DEFINE INSTRUMENT Ex2_2_2(f=5, Theta0=10) TRACE /* The Arm() class component defines reference points and orientations */ /* in 3D space. Every component instance must have a unique name. Here, */ /* Origin is used. This Arm() component is set to define the origin of */ /* our global coordinate system (AT (0,0,0) ABSOLUTE). It may be used */ /* for further RELATIVE reference, Other useful keywords are : ROTATED */ /* EXTEND GROUP PREVIOUS. Also think about adding a neutron source ! */ /* Progress_bar is an Arm displaying simulation progress. */ COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT Source = Source_simple( radius = 0.12, dist = 1.5, xw = 0.06, yh = 0.06, Lambda0 = 5.5, dLambda = 4.5) AT (0, 0, 0) RELATIVE Origin EXTEND %{ t = rand01(); %} COMPONENT TOF0 = Monitor_nD(filename = "tof0", xwidth = 0.06, yheight = 0.06, options="t auto bins=200") AT (0, 0, 0) RELATIVE Source COMPONENT Guide = Guide( w1 = 0.06, h1 = 0.06, w2 = 0.06, h2 = 0.06, l = 20, m = 3) AT (0, 0, 1.5) RELATIVE Source COMPONENT Chop = DiskChopper(R=0.5, omega=2*PI*f, theta_0=Theta0, phi_0=90, n=2) AT (0, 0, 20.0005) RELATIVE Guide COMPONENT TOF1 = Monitor_nD(filename = "tof1", xwidth = 0.06, yheight = 0.06, options="t auto bins=200") AT (0, 0, 20.001) RELATIVE Guide COMPONENT PSD = PSD_monitor( filename = "psd", xwidth = 0.07, yheight = 0.07) AT (0, 0, 0.001) RELATIVE PREVIOUS COMPONENT TX = Monitor_nD(filename = "tof_x", xwidth = 0.06, yheight = 0.06, options="t auto bins=200 x auto bins=200") AT (0, 0, 0.001) RELATIVE PREVIOUS /* This section is executed when the simulation ends (C code). Other */ /* optional sections are : SAVE */ FINALLY %{ %} /* The END token marks the instrument definition end */ END