/******************************************************************************* * McXtrace instrument definition URL=http://www.mcxtrace.org * * Instrument: test (rename also the example and DEFINE lines below) * * %Identification * Written by: Your name (email) * Date: Current Date * Origin: Your institution * Release: McXtrace 1.0 * Version: 0.2 * %INSTRUMENT_SITE: Institution_name_as_a_single word * * Instrument short description * * %Description * Instrument longer description (type, elements, usage...) * * Example: 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 ex3_KB(L=10) /* 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 COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT src = Source_gaussian( sig_x = 1e-6, sig_y = 2e-6, sigPr_x = 1e-6, sigPr_y = 1e-6, flux = 1e18, dist = 40, gauss = 1, focus_xw = 1e-3, focus_yh = 1e-3, E0 = 12.5, dE = 1) AT (0, 0, 0) RELATIVE Origin COMPONENT m1 = Mirror_curved( coating = "Rh.txt", radius = 100, length = 0.2, width = 0.2) AT (0, 0, 40) RELATIVE src ROTATED (0, 9.2, 0) RELATIVE src COMPONENT m1out = Arm( ) AT (0, 0, 0) RELATIVE PREVIOUS ROTATED (0, 9.2, 0) RELATIVE PREVIOUS COMPONENT m2in = Arm() AT(0,0,2) RELATIVE PREVIOUS ROTATED (0,0,90) RELATIVE PREVIOUS COMPONENT m2 = COPY(m1)(radius=84) AT (0,0,0) RELATIVE PREVIOUS ROTATED (0,9.2,0) RELATIVE PREVIOUS COMPONENT m2out = Arm() AT(0,0,0) RELATIVE PREVIOUS ROTATED (0,9.2,-90) RELATIVE PREVIOUS COMPONENT psdf=PSD_monitor( xwidth=1e-3, yheight=1e-3, nx=201, ny=201, filename="psdf") AT(0,0,L-2) 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