/******************************************************************************* * 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: 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 ex1_CRLs(lens=0,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 /* 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 an xray source ! */ /* Progress_bar is an Arm displaying simulation progress. */ COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT source=Source_gaussian( sig_x=48.2e-6,sig_y=9.5e-6,sigPr_x=100e-6, sigPr_y=4.3e-6, focus_xw=2e-3, focus_yh=2e-3, dist=31.5, E0=23.32, dE=1, gauss=1) AT(0,0,0) RELATIVE Origin COMPONENT emon_src= E_monitor( restore_xray=1,xwidth=2e-3, yheight=2e-3, nE=101, Emin=20.5, Emax=26.5, filename="emon_s") AT(0,0,31.5) RELATIVE source COMPONENT psd_src = PSD_monitor( restore_xray=1,yheight=2e-3, xwidth=2e-3, nx=101, ny=101, filename="psd_s") AT(0,0,31.5) RELATIVE PREVIOUS COMPONENT transfocator_Be=Lens_parab( material_datafile="Be.txt",yheight=1e-3,r=200e-6,d=50e-6,N=16 ) WHEN(lens==0) AT(0,0,31.5) RELATIVE source COMPONENT transfocator_Al= Lens_parab( material_datafile="Al.txt",yheight=1e-3,r=200e-6,d=20e-6,N=21 ) WHEN (lens==1) AT(0,0,31.5) RELATIVE source COMPONENT psd0 = PSD_monitor( yheight=2e-3, xwidth=2e-3, nx=101, ny=101, filename="psd0") AT(0,0,1e-1) RELATIVE transfocator_Be COMPONENT emon2 = E_monitor( restore_xray=1,yheight=2e-3, xwidth=2e-3, nE=201, Emin=20.5, Emax=26.5, filename="emon2") AT(0,0,L) RELATIVE transfocator_Be COMPONENT psd2 = PSD_monitor( restore_xray=1, yheight=2e-3, xwidth=2e-3, nx=101, ny=101, filename="psd2") AT(0,0,L) RELATIVE transfocator_Be COMPONENT slit = Slit( xwidth=10e-6, yheight=10e-6) AT(0,0,L) RELATIVE transfocator_Be COMPONENT emon3 = E_monitor( restore_xray=1,yheight=2e-3, xwidth=2e-3, nE=201, Emin=20.5, Emax=26.5, filename="emon3") AT(0,0,1e-6) RELATIVE slit COMPONENT psd3 = PSD_monitor( yheight=2e-3, xwidth=2e-3, nx=101, ny=101, filename="psd3") AT(0,0,1e-6) RELATIVE slit /* 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