/******************************************************************************* * 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() /* The DECLARE section allows us to declare variables or small */ /* functions in C syntax. These may be used in the whole instrument. */ DECLARE %{ double coll_div = 60; %} /* 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 source = Source_simple(radius = 0.015, dist = 1, xw=0.024, yh=0.015, E0=5, dE=0.2, compat = 1) AT (0,0,0) RELATIVE Origin COMPONENT collimator = Collimator_linear(len = 0.2, divergence = coll_div, xwidth = 0.04, yheight=0.06) AT (0, 0, 0.4) RELATIVE source //COMPONENT moniti = Monitor_nD( // options = "lambda, auto, parallel") //, exclusive") // AT (0, 0, 0.85) RELATIVE Origin COMPONENT sample = V_sample(//rad_sphere=0.03, xwidth=0.05, yheight=0.05, zthick=0.01, // radius_i = 0.008, radius_o = 0.012, h = 0.015, focus_r = 0, pack = 1, //sig_a=0, target_x = 0, target_y = 0, target_z = 1) AT (0,0,1.0) RELATIVE Origin ROTATED (0,50,0) RELATIVE Origin COMPONENT nD_4Pi = Monitor_nD( xwidth = 1, options="theta auto bins=90, phi auto bins=90, sphere restore_neutron=1") AT (0,0,0) RELATIVE sample ROTATED (0,0,0) RELATIVE Origin COMPONENT PSD_4Pi = PSD_monitor_4PI(radius=1, nx=90, ny=90, filename="Output.psd", restore_neutron=1) AT (0,0,0) RELATIVE sample ROTATED (0,0,0) RELATIVE Origin /* COMPONENT arm = Arm( ) AT (0, 0, 0) RELATIVE sample ROTATED (0,40, 0) RELATIVE Origin COMPONENT arm2 = Arm( ) AT (0, 0, 0.49) RELATIVE arm COMPONENT monitf = Monitor_nD( options = "lambda auto, parallel, bins=100") //, limits=[5 8.5]") AT (0, 0, 0.5) RELATIVE arm COMPONENT monitf2 = Monitor_nD( options = "x y, auto, parallel") AT (0, 0, 0.5) RELATIVE arm */ FINALLY %{ %} /* The END token marks the instrument definition end */ END