/******************************************************************************* * 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 test(nrepeat=1000, radius=0.005) /* The DECLARE section allows us to declare variables or small */ /* functions in C syntax. These may be used in the whole instrument. */ DECLARE %{ %} /* The INITIALIZE section is executed when the simulation starts */ /* (C code). You may use them as component parameter values. */ INITIALIZE %{ %} /* Here comes the TRACE section, where the actual */ /* instrument is defined as a sequence of components. */ 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 virtual_out = Virtual_input( file = "mysource.dat", repeat_count = nrepeat) AT (0, 0, 0) RELATIVE Origin SPLIT 10 COMPONENT sample = PowderN( reflections = "Fe.laz", radius = radius, yheight = 0.1, Vc = 23.55, sigma_abs = 2.56, sigma_inc = 0.4) AT (0, 0, 0.05) RELATIVE virtual_out COMPONENT soller = Collimator_radial( xwidth = 0.01, yheight = 0.2, length = 0.3, divergence = 12, theta_min = 0, theta_max = 180, nchan = 70, radius = 0.6) AT (0, 0, 0) RELATIVE sample COMPONENT BananaTheta = Monitor_nD( options = "banana, theta limits=[5,180], bins=1750", yheight = 0.3, xwidth=2.4,filename="banana") AT (0, 0, 0) RELATIVE sample /* 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