/******************************************************************************* * McXtrace instrument definition URL=http://www.mcxtrace.org * * Instrument: test (rename also the example and DEFINE lines below) * * %Identification * Written by: Jana Baltser * Date: March 2011 * Origin: NBI, BNL * Release: McXtrace 1.0 * Version: 0.2 * %INSTRUMENT_SITE: NSLS2 * * This is a lay-out of the coherent hard x-ray (CHX) beamline at NSLS-II. * Since the ray-tracing method doesn't allow to account for partial coherence of the * undulator source, the best approximation was to use the gaussian photon beam and to neglect * diffraction effects on apertures. * The choice of the source sizes along with angular divergence corresponds to the situation of * high emittance (e=0.99nm). * * %Parameters * L [m] - distance from the source to the SS1 - secondary source aperture. * L2 [m] - position of the CRL. * L3 [m] - position of the Kinoform lens. * Energy [keV] - primary energy used at the beamline. * * * * %End *******************************************************************************/ DEFINE INSTRUMENT ex2_NSLS2_CHX_beamline(L=33.5,L2=35.3,L3=44,Energy=10) DECLARE %{ const double source_h=43e-6; const double source_v=7e-6; const double div_h=22e-6; const double div_v=8.8e-6; const double slit_x=44e-6; const double slit_y=1e-3; %} INITIALIZE %{ %} TRACE COMPONENT Origin = Progress_bar() AT (0,0,0) ABSOLUTE COMPONENT Source = Source_gaussian(sig_x=source_h,sig_y=source_v,sigPr_x=div_h,sigPr_y=div_v,E0=Energy,dE=0,dist=L,focus_yh=slit_y,focus_xw=slit_x,flux=4e18,phase=0) AT (0, 0, 0) RELATIVE Origin //COMPONENT Det0=PSD_monitor(filename="psd0.dat",xwidth=1e-3,yheight=1e-3,restore_xray=1,nx=500,ny=500) //AT (0,0,1e-6) RELATIVE Origin COMPONENT Det=PSD_monitor(filename="psd.dat",xwidth=5e-3,yheight=5e-3,restore_xray=1,nx=500,ny=500) AT (0,0,L) RELATIVE Origin COMPONENT Slit=Slit(xwidth=slit_x,yheight=slit_y) AT (0,0,10e-4) RELATIVE PREVIOUS COMPONENT Det1=PSD_monitor(filename="psd1.dat",xwidth=.4e-3,yheight=2e-3,restore_xray=1,nx=500,ny=500) AT (0,0,L2-1e-3) RELATIVE Origin COMPONENT Det1v=PSD_monitor_coh(filename="psd1v",restore_xray=1,filename="psd1v", xwidth=.4e-3,yheight=2e-3,nx=1,ny=500) AT(0,0,L2-1e-3) RELATIVE Origin COMPONENT Det1h=PSD_monitor_coh(filename="psd1h",restore_xray=0,filename="psd1h", xwidth=.4e-3,yheight=2e-3,nx=500,ny=1) AT(0,0,L2-1e-3) RELATIVE Origin COMPONENT CRL=Lens_parab_Cyl(r=.5e-3,yheight=1e-3,xwidth=1e-3,d=.05e-3,N=9, material_datafile="Be.txt") AT (0,0,L2) RELATIVE Origin COMPONENT Det_f=PSD_monitor(filename="psd_f.dat",xwidth=.4e-3,yheight=.4e-3, restore_xray=1, nx=500, ny=500) AT (0,0,43.98) RELATIVE Origin COMPONENT Det_fv=PSD_monitor_coh(filename="psd_fv.dat",xwidth=.4e-3,yheight=.4e-3, restore_xray=1, nx=1, ny=500) AT(0,0,43.98) RELATIVE Origin COMPONENT Det_fh=PSD_monitor_coh(filename="psd_fh.dat",xwidth=.4e-3,yheight=.4e-3, restore_xray=0, nx=500, ny=1) AT(0,0,43.98) RELATIVE Origin COMPONENT Kinoform=Lens_parab_Cyl(r=.5e-3,yheight=1.3e-3,xwidth=1.3e-3,d=.1e-3,N=21, material_datafile="Be.txt") AT (0,0,L3) RELATIVE Origin ROTATED (0,0 ,90) RELATIVE Origin COMPONENT Det_ff=PSD_monitor(filename="psd_ff.dat",xwidth=.08e-3,yheight=.08e-3, restore_xray=1, nx=500, ny=500) AT(0,0,48.5) RELATIVE Origin COMPONENT Det_ffv=PSD_monitor_coh(filename="psd_ffv.dat",xwidth=.08e-3,yheight=.08e-3, restore_xray=1, nx=1, ny=500) AT(0,0,48.5) RELATIVE Origin COMPONENT Det_ffh=PSD_monitor_coh(filename="psd_ffh.dat",xwidth=.08e-3,yheight=.08e-3, restore_xray=0, nx=500, ny=1) AT(0,0,48.5) RELATIVE Origin END