<<

####### ### ## ## ## ## ## ## ## ## ## ## ## ## ## ## ####### ## ## #### ## ## ######### ## ## ## ## ## ## ## ## ## ## ##

The BESSY RAYTRACE PROGRAM to calculate (not only) RADIATION BEAMLINES

Franz Schäfers (HZB-BESSY) e ####### ### ## ## Vorspiegel ## ## ## ## ## ## ## ## ## ## ## ## U Eintritts- ####### ## ## #### nd ula Spalt ## ## ######### ## tor Monochromator- ## ## ## ## ## S Monochromator

p

e steuerung ## ## ## ## ##

i

e c h

e

r

r

i n Experimentier-

g steuerung HISTORY Gitter Spiegel Datenerfassung Austritts- Spalt 1984 FORTRAN-VMS/PDP-11

e- 1989 VMS / VAX Refokussier- Probe e- Spiegel e- 1990 Surface profiles Detektor Experiment 1993 Stokes formalism 1994 Crystal optics 1995 Helical 1996 VMS / Alpha 2000 Multilayers 2002 PC-Windows / LINUX 50 BESSY beamlines 2003 Pathlength from IR to hard x-rays 2005 Wavefront 2006 Expert‘s Optics 2008 Zoneplates 2008 Spinger Vol. 137 … ~100 copies worldwide F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 2 Intro What is raytracing?

• Imaging / focusing properties of optical systems ± 150 mm • create rays within a source volume σ − 15 mrad spherical exit I • trace them through optical elements BESSY II horizontal σ + mirror vertical plane grating ( R=10.3m) • display geometric distribution at the focus apertures 1200 l/mm 3600 l/mm exit II

•Design tool for (SR-) beamlines 58 18452 06 0 13847 dis tance to so • dipole radiation (bending magnets) urce [mm] 24258 16452

5 • 3G / beamlines, 4G FEL’s 229

• general optical applications 23681 • predict performance under realistic conditions • specify requirements of optical elements before order

• RAY, REFLEC Crystal 2 1606 mm Side view focus Bendable 1533 mm • user-friendly cylindrical mirror <0.5 mrad Crystal 1 • Wiggler 179.45 ° easy to learn Source 1400 mm

• easy accessible aperture Bendable cylindrical • every day use mirror

• minimum file handling 0 m 11.4 m 25.4 m 28 m 39.5m • online graphic • quick response to new demands

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 3 Intro BESSY optics software tools

photon source talk M. Scheer WAVE / URGENT / SMUT

FEM optical elements gratings ANSYS / ProE REFLEC EFFI

raytracing RAY / PHASE talk J. Bahrdt

2003/09/29 08.25 JOB 38 UE52 E = 396eV

Width(y): 0.0819 mm 0.1 0.1 Center : -0.002 mm 0.6 12 1.0 x 10 /BW

2 1000

800 0.8 0.0 0.0

photons/s/mm 0.4

600 (mm) y

400 0.6

200 0.2 -0.1 -0.1 0.4 -0.05 0.00 0.05 0.10 05000 blaze angle (°) grating efficiency efficiency grating Intensity u41-162-0p7-40-ray 1 y Width(x): 0.0472 mm 1. image at : 755.00 mm 0.75 4000 vert. position (mm) Center : 0.014 mm N/s/0.1A/ 0.0mrad/ 0.1000%BW .1360D+16 0.5 Transmission: 44.889 % 0.25 1.5 0.2 0.0 112222( 112222) out of 250000 1 2000 2 N /mm : 0.6915D+18 0 0.5 max 0.2 0.4 0.6 0.8 S1: 1.000 S2: 0.000 S3: 0.000

-0.25 Intensit 0 hori. position (mm) -0.5 -0.5 0 -1 -0.75 -1.5 -0.05 0.00 0.05 0.10 -1 c ff x (mm) Distribution in pinhole temperature distribution spatial distribution grating efficiency spot pattern

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 4 Intro What is a ray?

• A RAY is described by 12 parameters yI

zI • geometric coordinates (x,y,z) xI • emission angle (l, m, n) • energy (hv) • polarisation (S0, S1, S2, S3) y • time (pathlength) (t) M 2Θ β zM ys α x x ϕ M s z • The RAY starts in a SOURCE-volume ψ χ s with defined emission characteristics

1. OPTICAL IMAGE SOURCE ELEMENT PLANE • The RAY is modified by OPTICAL ELEMENTS acc. to laws of geometry and optics • transmitting - slits, foils (abs.) • reflecting - mirrors (refl.) • dispersing - gratings, zoneplates (eff.) • diffracting - crystals (refl.)

• All parameters of the RAY can be visualised at the Source, Optics and Image Planes

3 m . .

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 5 Intro OPTICAL DATA TABLES

VIS UV EUV VUV XUV soft X hard X

MOLECULES (Al2O3, SiC, SiO2…) n, k

PALIK (Al, Au, C, Cr, Cu, Ir, Ni, Os, Pt, Si,…) n, k

HENKE (Z=1-92) f1, f2 Calculation of

CROMER (Z=2-92) f1, f2

• Reflectivity STRUCTURE FACTORS f , f , f o H HC • Efficiency Zinkblende Hexagonal • Transmission Beryl • Rocking curves • Photon Flux • Resolving power 1E-3 0.01 0.1 1 10 100 • Polarisation Photon Energy (keV)

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 6 Raytrace Basic law of RAY: §1: ALL RAYS HAVE EQUAL PROBABILITY = INTENSITY

• Systematic generation or… 1.0 w(x)=exp(-x2/2σ2) • Statistical generation of rays within the source Gaussi an distribution • Probability distribution 0.8 function - start coordinates x, y, z

- emission angles ϕ, ψ +1 σ - energy, time… 0.6 FWHM • Advantages - easy (2.35 σ) - few rays enough for realistic simulation 0.4

(within given statistics) Probability (x) w - no systematic errors (only statistical) +1 σ = 68.3 % 0.2 • Example: Gaussian intensity profile FWHM = 76.0 % +2 σ = 95.4 % 3. probability for this x value +3 σ = 99.7 % 1. get random number ran1 2 2 w(x) = exp(-x /2σ ) 0.0 0 < ran1 < 1 -3σ -2σ -1σ 0 1σ 2σ 3σ 2. scale variable, e.g. x 4. get random number ran2 +/-x 3σx x = (ran1 - 0.5) δx 0 < ran2 > 1 -δx/2 < x < δx/2 5. ACCEPT x ONLY IF Applicable to ANY w(x) - ran2 > 0 probability function 6. if not, goto 1

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 7 Raytrace §2: ALL RAYS ARE INDEPENDENT, but… (Particles and Waves) • Statistical treatment of an ensemble of rays Collective effects (Interference, diffraction…)

• Reflectity losses / angle / energy (Rocking curves)

1.01.01.0

6534 1010102 rays raysrays Mo/SiMo/Si 0.80.80.8 420 450.115 secsec sec sec N=50N=50N=50 d=6.75d=6.75 nm 0.60.60.6

0.40.40.4 Rays / channel (norm.) Rays / channel (norm.) channel Rays / Rays / channel (norm.) Rays / channel (norm.) channel / Rays Rays / channel (norm.)

0.20.20.2

•0.00.0 Diffraction on slits (P~ (sin v/v)) • Zoneplate diffraction (A. Erko) 0.0 88 90 92 94 96 98 100 888888 90 90 90 92 92 92 94 94 94 96 96 98 98 100 Photon energy (eV) PhotonPhotonPhoton energy energyenergy (eV)(eV)(eV) 40 80 120 160 200

KRGF RAY

100 200 80 60 160 40

20 120µm µm 0 -20 80 -40 -60 40 -80 µm -100 -100 -80 -60 -40 -20 0 20 40 60 80 100 40 80 120 160 200 100 F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 8 2. SOURCES xr = xr + tαr α S S ϕ ⎛l ⎞ ⎛sin cosψ ⎞ S ψ r ⎜ ⎟ ⎜ ⎟ S = ⎜mS ⎟ = ⎜sin ⎟ ⎜ ⎟ ⎜ ϕ ⎟ ⎝nS ⎠ ⎝cos cosψ ⎠ PO_int PI_xel CI_rcle

DI_pole WI_ggler • Realistic simulation of source intensity, volume and emission • Input by file: create your own source ((helical) undulator…) • SR sources: polarisation included beam emittance effects detuning effects (orbit change, misalignment)

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 9 Raytrace 2nd, 3rd order surfaces F(x, y, z) = 2 2 2 = a11x + a22 y + a33z +

+ 2a12xy + 2a13xz + 2a23 yz +

+ 2a14x + 2a24 y + 2a34z + a44 = 0 2 2 PM_plane m. +b12x y +b21xy + + b x2 z + b xz2 + CY_linder (x,z) 13 31 2 2 + b23 y z +b32 yz = 0 CO_ne TO_roid SP_here ET_elliptical toroid EL_lipsoid DI_aboloid

PA_raboloid (circ., ell.) EO_expert‘s optic

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 10 Raytrace Textbook raytracing

Find the intersection point xM, yM, zM 2. ⎛n ⎞ ⎛ f ⎞ ⎜ x ⎟ ⎜ x ⎟ r 1 n = ⎜ny ⎟ = ⎜ f y ⎟ r Find the local normal vector 2 2 2 ⎜ ⎟ f x + f y + f z ⎜ ⎟ f = ∇F ⎝nz ⎠ ⎝ f z ⎠ (Include slope errors, surface profile) r r r r Find the direction of outgoing ray α2 =α1 − 2⋅(n oα1)n r r x = D~ (θ)D (χ)T (z )⋅ x Attach next optical element M2 x z z q M1

or find intersection with ⎛x ⎞ ⎛x⎞ 1 ⎛l ⎞ ⎜ I ⎟ = ⎜ ⎟ + ⎜ ⎟(z − z) Image Plane ⎜ ⎟ ⎜ ⎟ ⎜ ⎟ I1,2,3 ⎝ yI ⎠ ⎝ y⎠ n ⎝m⎠

r nr (α2)

r Data Evaluation, Storage, Display (α1 ) Start with a new ray in the source…

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 11 Raytrace Features of optical elements IO EP R • (Multilayer-) Coatings on Optics PG (SG) ES

• Special monochromator mounts: θ Absorber dA SX700 plane grating PGM Spacer dαB β Spherical grating SGM X-ray Source

T α PM

Varied Line Spacing-(VLS-) gratings θ Θ−α Laterally graded crystals, -multilayersYMi φ ψ ZMi Lattice Planes • Miscellaneous: Misalignment XMi Increasing d

Measured, calc. surface profiles χ

• Rectangular, circular shape or rings (capillaries)

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 12 Raytrace Reflection Gratings (plane, spherical, toroidal)

l kλ=d(sinα +sinβ) ⎛l ⎞ ⎛ 1 ⎞ ⎜ 2 ⎟ ⎜ ⎟ r m ⎜ m 2 n 2 ()n a 2 ⎟ (α2)= ⎜ 2 ⎟ = 1 + 1 − 1 − 1 VLS-Grating: ⎜ ⎟ ⎜ ⎟ ⎝n2 ⎠ ⎜n1 − a1 ⎟ 2 3 2 3 ⎝ α1 =kl/d ⎠ 1/ d = n = n0 ⋅(1+ 2b2z +3b3z + 4b4z + 2b5x +3b6x + 4b7 x )

conical diffraction 40 o o 100 l/mm 75/100/135 eV 2θ=160 0 3000 l/mm 75/100/135 eV 2θ=160 135 eV 30 100 eV 4 -10 75 eV 0 order 20 3 1st order 2 m= -20 3 10 2 1 1 -30 0 2nd order 75 eV 0 -1 1 0 0 α β -2 2

-1 -40 100 eV -1 -2 m=-3 3 -10 -50 Y Position (mm) Y Position -2 Y Position (mm) 3rd order -20 135 eV 75 eV -3 -60 -30 100 eV -4 -70 135 eV -40 -10 0 10 20 0 20 40 60 80 100 120 140 X Position (mm) X Position (mm) F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 13 Examples KMC-1 beamline performance

crystal 2

8

<0.2 mrad 2

side view 3 <0.5 mrad 179.2 ° crystal 1

distance between elements (mm) 12978 15120 7175

0 11540 11800 12978 28098 35273 distance to source (mm)

(HAX)PES better than calc. 1012 1010

Si (111) RAY Si (311) 1011 InSbInSb (111)(111)

Si (422) 10 11 10 Si (111)

Pt L III

109 Resolution (eV) Photon Flux mA / 100 Pt L Resolution (eV) II Si (555) 0.10.1 8 Pt L 10 I Si (333)Si (333) Si (444)Si (444) 2 4 6 8 10 12 14 224681012 4 6 8 10 12 Energy (keV) EnergyEnergy (keV)(keV) F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 14 Examples Diaboloid - optics Stigmatic Imaging of an astigmatic source (Convert toroid to spherical wavefront)

ity dens r flux ighe es h 5 tim

slope error (σ) 0.5 μm x 0.2 μrad

IDL-Animation (Thomas Zeschke, BESSY) F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 15 Examples Diaboloid - optics

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 16 Examples Time Evolution of beams - controlling the pulse shape & broadening Path length 2 2 2 pl = ((x − xold ) + (y − yold ) + (z − zold ) ) − zq 2π pl Phase ϕ = pl Travel time t = λ c Focus Source Grating

1200

1000 l

anne 800 h c / 100 fs 600 ays R μ 400 30 m

200

0 -60 -40 -20 0 20 40 60 Time (fs)

Confining illuminated grating length: pulse length unchanged

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 17 Outlook Wavefronts, Coherence

Path length 2 2 2 pl = ((x − xold ) + (y − yold ) + (z − zold ) ) − zq 2π pl Phase ϕ = pl Travel time t = λ c Coherent illumination of toroid, 10:1, θ=2.5o

2

iϕ j Geometric Phase I = ∑e = Interference Intensity j • Similar to “real” wavefront codes: PHASE, SRW • Phasespace, time, energy, polarisation: Identify sections of equal phase: Coherence F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 18 Conclusions LIMITATIONS / WARNINGS

• The program has NO intelligence - even after 25 years of programming

• The program will NOT give any ideas for the kind of beamline you want to have

• Nor does it have any idea of good experiments at a beamline

• The program performs only what was programmed - The results are valid only within the mathematical or physical model implemented

• The program may still have errors (it has - definitely!!)

• The designer may have made typing errors in the input menue

• The designer may have misunderstand the program’s language or a result

YOU ARE THE EXPERT – NOT RAY !!!

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 19 Acknowledgements

Programming Special features implementation Josef Feldhaus (Start) Josef Feldhaus Alexei Erko (…) Michael Krumrey (CR) Michael Krumrey Rolf Follath (time) K.J.S. Sawhney (EPU) K.J.S. Sawhney Gerd Reichardt (GR) Dirk Abramsohn (PC) Dirk Abramsohn Fred Senf (CO) Shahin Sahraei (RZP) Shahin Sahraei Thomas Zeschke (IDL,Diab.,Phase) Advertisement Users William Peatman (“Gratings, Mirrors and Slits”) BESSY optics group Worldwide usage Alexei Erko, Mourad Idir et al.(ed.) (“Modern Developments…”)

F. Schaefers TheRAY BESSY @ raytrace program RAY SMEXOS Feb. 24.-25. 2009 20