![Page 1: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/1.jpg)
Powered by McStas technology
"McXtrace: a Monte Carlo software package for simulating X-ray optics, beamlines and experiments", Journal of Applied Crystallography, vol. 46, part 3, June 2013
![Page 2: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/2.jpg)
03-06-2013 McXtrace @ 3Codes 2
Outline
● People/Funding etc.
● McXtrace at a glance
● Examples by McXtrace
● Details of a beamline simulation (Max II 811)
![Page 3: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/3.jpg)
03-06-2013 McXtrace @ 3Codes 3
Peter Willendrup [1]Andrea Prodi [4]Jana Baltser [2]Søren Schmidt [1]Martin Meedom [1]Henning Friis Poulsen [1]Manuel Sanchez del Rio [4]Claudio Ferrero [4]Karsten Joensen [5]Kell Mortensen [3]Søren Kynde [3]Martin Petersen [3]Robert Feidenhans’l [2]Kim Lefmann [2]Maria Thomsen [2]Carsten Cooper-Jensen [6]
[1] Physics Department, DTU, Kgs. Lyngby, Denmark[2] Niels Bohr Institute, University of Copenhagen, Copenhagen, Denmark[3] Faculty of Life Science, University of Copenhagen, Copenhagen, Denmark[4] European Synchrotron Radiation Facility (ESRF), Grenoble, France[5] SAXSLAB, Denmark (Formerly JJ X-RAY Systems)[6] European Spallation Source, Lund, Sweden
![Page 4: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/4.jpg)
03-06-2013 McXtrace @ 3Codes 4
NaBiITStrategisk Forskningsråd
![Page 5: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/5.jpg)
03-06-2013 McXtrace @ 3Codes 5
![Page 6: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/6.jpg)
03-06-2013 McXtrace @ 3Codes 6
![Page 7: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/7.jpg)
03-06-2013 McXtrace @ 3Codes 7
User Base
![Page 8: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/8.jpg)
03-06-2013 McXtrace @ 3Codes 8
McXtrace History
● 1998 McStas 1.0
● 2009 McXtrace project start
– 2009 McXtrace beta
● 2011 McXtrace 1.0
● 2013 McXtrace 1.1
![Page 9: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/9.jpg)
03-06-2013 McXtrace @ 3Codes 9
Beta:a. First package build of McXtrace Linux and Windows XPb. 2 Example beamlinesc. Few components
1.0:d. Optimized packaging, Linux, Windows7, XP and Mac OSXe. Time-propagationf. Phase-propagation, wavefront reconstruction experimentalg. Sample modelsh. Monochromator crystal (Perfect_crystal)
1.1:i. Linux, Windows 7, XP, Mac OSX, FreeBSDj. Optimized grammark. Chopper modell. Faster data file searchingm. Lots more componentsn. More Sample modelso. OFF-support - anyshape options enabledp. Roughness in lensesq. Shadow interfaces
Feature History
![Page 10: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/10.jpg)
03-06-2013 McXtrace @ 3Codes 10
• Built on proven base of McStas for neutron ray tracingK. Lefmann and K. Nielsen, Neutron News 10, 20, (1999).
• Release 1.1• Portable code (Unix/Linux/Mac/Windows, 32 and 64 bit support)
Has run on all from iPhone to 1000+ node clusters
• GPL-license• DSL / Compiler Technology.
Using Lex & Yacc• Modular Open Structure.
Components/devices written in structured ISO-c automatically fits in the system• Dependencies: c-compiler (perl/tk for gui).• Permanent staff at DTU Physics maintaining the code
Project website athttp://www.mcxtrace.org
McXtrace buzzwords
![Page 11: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/11.jpg)
The McXtrace Way
1. Describe your beamline in the McXtrace language (In a text file).
2. Automatically convert beamline into ANSI c
3. Compile
4. Run
1.Optimized for your platform2.Only includes what you use
![Page 12: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/12.jpg)
03-06-2013 McXtrace @ 3Codes 12
Instrument file – all users
existing examples
user written – GUI assisted
Component files – some users
Short pieces of code
Easy to modify from existing
Kernel code – McXtrace developers
Propagation routines
Intersections
Generated ISO-C code – “no” users
Assembled by code generation
Very low overhead of unneeded code
Includes runtime libs that comps rely on (propagation etc.)
Instrumentfile (average user, point/click, DSL)
● Component (advanced user,
modify from existing, c-code)
Kernel (McXtrace
team)
Levels of Code
![Page 13: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/13.jpg)
03-06-2013 McXtrace @ 3Codes 13
•Instrument fileWritten by all usersStructured description of beamline layout
Beamline Description / Instrument File
![Page 14: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/14.jpg)
03-06-2013 McXtrace @ 3Codes 14
Beamline Description
![Page 15: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/15.jpg)
McXtrace positioning scheme
Rotated relative to source
Rotated relative to Mirror 1
![Page 16: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/16.jpg)
![Page 17: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/17.jpg)
• Photon ray/package:
• (r,k,φ,t,p,E)
• r - spatial coordinates
• k - wave vector
• φ - phase
• t - time
• p – photon weight package
• E - Electrical field polarisation
McXtrace photon model
![Page 18: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/18.jpg)
03-06-2013 McXtrace @ 3Codes 18
Written by expert users and developersWhere photons interact with beamline objects ->
Where physics happenStructured ISO-C
Component Internals
![Page 19: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/19.jpg)
03-06-2013 McXtrace @ 3Codes 19
Sources• Source_pt• Source_flat• Source_div
Samples
Optics• Arm• Lens_simple• Mirror_curved• Slit
Misc• Progress_bar
Monitors• E_monitor• L_monitor• PSD_monitor• PSD_monitor_4PI
Component history - 2009
![Page 20: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/20.jpg)
03-06-2013 McXtrace @ 3Codes 20
Component history - 2012
Sources• Source_pt• Source_lab• Source_gaussian• Source_flat• Source_div
Samples• Single_crystal• Saxs_spheres• PowderN• Perfect_crystal• Absorption_sample• SAXS-samples• Molecule_2state
Optics• Arm• Beamstop• Chopper_simple• Filter• Lens_kinoform• Lens_parab• Lens_parab_Cyl• Lens_simple• Mirror_curved• Mirror_elliptic• Mirror_parabolic• Multilayer_elliptic• Slit• Slit_N• Twin_KB_ML
Misc• Progress_bar• Shadow_input• Shadow_output
Monitors• E_monitor• EPSD_monitor• L_monitor• Monitor• Monitor_nD• PreMonitor_nD• PSD_monitor• PSD_monitor_4PI• PSD_monitor_coh• W_psd_monitor
![Page 21: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/21.jpg)
03-06-2013 McXtrace @ 3Codes 21
Sources• Source_pt• Source_lab• Source_gaussian• Source_flat• Source_div• Source_SPECTRA
Samples• Single_crystal• Saxs_spheres• PowderN• Perfect_crystal• Absorption_sample• SAXS-samples• Molecule_2state• Isotropic_Sqw
Optics• Arm• Beamstop• Chopper_simple• Filter• Lens_kinoform• Lens_parab• Lens_parab_Cyl• Lens_simple• Mirror_curved• Mirror_elliptic• Mirror_parabolic• Multilayer_elliptic• Slit• Slit_N• Twin_KB_ML• Zone_plate• Grating
Misc• Progress_bar• Shadow_input• Shadow_output• SRW_input• SRW_output
Monitors• E_monitor• EPSD_monitor• L_monitor• Monitor• Monitor_nD• PreMonitor_nD• PSD_monitor• PSD_monitor_4PI• PSD_monitor_coh• W_psd_monitor
Component History 2013
![Page 22: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/22.jpg)
03-06-2013 McXtrace @ 3Codes 22
McStas / McXtrace inheritance
Binary datafile searching
Perfect crystal model
Phase handling (?)
Geometry engine
Fast runtime library
Monitor models
Crystal sample models
![Page 23: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/23.jpg)
03-06-2013 McXtrace @ 3Codes 24
ID11 pink beam monochromator
![Page 24: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/24.jpg)
03-06-2013 McXtrace @ 3Codes 25
Max II 711 Powder Diffraction
![Page 25: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/25.jpg)
03-06-2013 McXtrace @ 3Codes 26
Max II 711 Powder Diffraction Si-crystal
![Page 26: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/26.jpg)
03-06-2013 McXtrace @ 3Codes 27
Max II 811, surface diffraction and XAFS beamline
![Page 27: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/27.jpg)
03-06-2013 McXtrace @ 3Codes 28
Reported flux on sample: [2000...20000] photons /sSimulated flux on sample: 20080 photons / s
Max II 811, surface diffraction and XAFS beamline
![Page 28: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/28.jpg)
03-06-2013 McXtrace @ 3Codes 29
Laue Camera
![Page 29: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/29.jpg)
03-06-2013 McXtrace @ 3Codes 30
radial integration
Time resolved scattering, Pump & Probe
![Page 30: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/30.jpg)
03-06-2013 McXtrace @ 3Codes 31
Time resolved scattering, Fe (2,2' bpy)_3
![Page 31: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/31.jpg)
03-06-2013 McXtrace @ 3Codes 32
Time resolved, difference signal
![Page 32: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/32.jpg)
Tomography
Setup mimicking that of TU München
![Page 33: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/33.jpg)
03-06-2013 McXtrace @ 3Codes 34
Anyshape tomography
![Page 34: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/34.jpg)
03-06-2013 McXtrace @ 3Codes 35
Anyshape Reconstruction
![Page 35: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/35.jpg)
03-06-2013 McXtrace @ 3Codes 36
Single Slit
![Page 36: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/36.jpg)
03-06-2013 McXtrace @ 3Codes 37
Double Slit
![Page 37: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/37.jpg)
03-06-2013 McXtrace @ 3Codes 38
Double Slit
![Page 38: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/38.jpg)
03-06-2013 McXtrace @ 3Codes 39
Double Slit
![Page 39: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/39.jpg)
03-06-2013 McXtrace @ 3Codes 40
Double Slit
![Page 40: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/40.jpg)
03-06-2013 McXtrace @ 3Codes 41
Triple Slit
![Page 41: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/41.jpg)
Coherent examples
1 Be refractive lens:Red: IncoherentMagenta: Fully coherent, in phase
8 Be refractive lenses:Red: IncoherentMagenta: Fully coherent, in phase
![Page 42: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/42.jpg)
03-06-2013 McXtrace @ 3Codes 43
![Page 43: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/43.jpg)
03-06-2013 McXtrace @ 3Codes 44
McXtrace Simulation
![Page 44: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/44.jpg)
03-06-2013 McXtrace @ 3Codes 45
Test Data
![Page 45: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/45.jpg)
03-06-2013 McXtrace @ 3Codes 46
Difference?
Add an offset slit after Side-by-Side KB-mirror
![Page 46: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/46.jpg)
03-06-2013 McXtrace @ 3Codes 47
APS ID14 Bio CARS
![Page 47: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/47.jpg)
03-06-2013 McXtrace @ 3Codes 48
APS ID14 High Focus option 1
![Page 48: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/48.jpg)
03-06-2013 McXtrace @ 3Codes 49
APS ID14 High Focus option 2
![Page 49: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/49.jpg)
03-06-2013 McXtrace @ 3Codes 51
Instrument file – all users
existing examples
user written – GUI assisted
Component files – some users
Short pieces of code
Easy to modify from existing
Kernel code – McXtrace developers
Propagation routines
Intersections
Generated ISO-C code – “no” users
Assembled by code generation
Very low overhead of unneeded code
Includes runtime libs that comps rely on (propagation etc.)
Instrumentfile (average user, point/click, DSL)
● Component (advanced user,
modify from existing, c-code)
Kernel (McXtrace
team)
Levels of Code revisited
![Page 50: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/50.jpg)
03-06-2013 McXtrace @ 3Codes 52
Modelling the Max II beamline 811
![Page 51: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/51.jpg)
03-06-2013 McXtrace @ 3Codes 53
Ring Current
250 mA
Source Superconducting Wiggler
Magnetic Field
3.5 T
Magnet Period
65 mm
Number of Poles
49
K value 20
Source flux
2*10^15 (0.1% Bandwidth)^-1 calculated
Source Size
50 μm x 250 μm (v x h)
Source Divergence
0.3 mrad x 6.0 mrad (v x h)
Front-end Slits
6.4 m from source
Carlsson et.al., J. Synch. Rad, vol 13, pt. 5, pp 359, 2006
Wiggler
From SPECTRA
![Page 52: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/52.jpg)
03-06-2013 McXtrace @ 3Codes 54
Front-end fixed apertures and Slits
![Page 53: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/53.jpg)
03-06-2013 McXtrace @ 3Codes 55
Mirror/Monochromator Layout
![Page 54: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/54.jpg)
03-06-2013 McXtrace @ 3Codes 56
Mirror 1
Mirror 2
Monochromator 2
Mirror/Monochromator Layout
Mirror 1
![Page 55: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/55.jpg)
03-06-2013 McXtrace @ 3Codes 57
Monochromator 2
Mirror 2
Be-windowMirror 1
Mirror/Monochromator Layout trace
Monochromator 1
![Page 56: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/56.jpg)
03-06-2013 McXtrace @ 3Codes 58
Experimental Hutch
![Page 57: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/57.jpg)
03-06-2013 McXtrace @ 3Codes 59
Experimental Hutch
![Page 58: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/58.jpg)
03-06-2013 McXtrace @ 3Codes 60
δλλ
≃0.012
Ratio between photons emitted and on sample match up OK:
real: [2000..20000] reported, virtual: 20800
Unslit Spatial beam distribution
Experimental Hutch
![Page 59: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/59.jpg)
03-06-2013 McXtrace @ 3Codes 61
Ion chambers have so far been approximated by Integrating Intensity monitors
Ion Chamber 0 Ion
Chamber 2
Ion Chamber 1
Reference Sample Foil
Sample
Experimental Hutch, XAFS Station
![Page 60: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/60.jpg)
03-06-2013 McXtrace @ 3Codes 62
Using a Silicon Powder sample
Sample Pilatus Area Detector
Experimental Hutch, Diffraction Station
![Page 61: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/61.jpg)
03-06-2013 McXtrace @ 3Codes 63
Using a Silicon Powder sample
Experimental hutch, Diffraction Station
![Page 62: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/62.jpg)
• Prove slit-scatter with crystal sample• Revamp/Reorganize website again• Publish manual POD (amazon?)• Consolidate reflectivity models• Partial Coherence Work integration• Finish (a) SPECTRA and (b)SRW interfaces• Allow python/ruby components?• McXtrace under ROOT/cling?
TODO
![Page 63: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/63.jpg)
Why McXtrace ?
● Open Source GPL.
● Extensible
● Fast/Scalable
● Portable
● Connectable/Embeddable to/in other tools
● Community friendly (crowdsourcing)
● 100+ page manual
McXtrace 1.1 release out!
![Page 64: McXtrace: a Monte Carlo software package for simulating X ...ftp.esrf.eu/pub/scisoft/3CodesTutorial/MCXTRACE/MCXTRACE_slide… · Journal of Applied Crystallography, vol. 46, part](https://reader033.vdocuments.us/reader033/viewer/2022050503/5f95c0e0374bde11bf40b73b/html5/thumbnails/64.jpg)
THANK YOU FOR YOUR TIME AND ATTENTION!