McXtrace - Monte Carlo Xray Tracing, is a joint venture by
Our code is based on technology from .
Code repository (shared with 'McStas') is located at github.com/McStasMcXtrace
For information on our progress, please subscribe to our user mailinglist..
The latest McXtrace news.
McXtrace 1.6 is released
[16/08/2021] Dear simulators,
The McXtrace team is happy to announce the release of McXtrace version 1.6.
At present there are binary packages built for
- Debian/Ubuntu class systems
- Red hat Fedora 33 and newer
- Windows 10 / 64 bit
- MacOS -- both Arm and Intel-based
Please go to https://github.com/McStasMcXtrace/McCode/tree/master/INSTALL-McXtrace for specific installation instructions for your platform. It is always our ambition to stay close to the "generic" installation procedure for the various platforms.
If that fails you may also build McXtrace directly from source by cloning our github repository and proceed using cmake.
Should installation elude you completely we will shortly provide a docker based solution - so stay tuned for that.
As always - should you encounter problems please don't hesitate to reach out through any of our channels: mailing list/direct email/generate a ticket on github, etc.
CHANGES in McXtrace 1.6
- Union concept for X-rays
A subsystem under McXtrace that separate physics from geometry, thereby allowing multiscattering processes from object to object.
- Scatter logger subsystem.
A concept to allow quantification of parasitic scattering from e.g. mirror substrate.
- Sources, Source_div_quasi.comp - quasi-stochastic sampled set divergence source.
- Samples, Abs_objects.comp - A set of absorbing objects
- Misc, Scatter_logger.comp - The set of components defining the scatter logger interface.
- Misc, Scatter_logger_stop.comp
- Misc, Scatter_log_iterator.comp
- Misc, Scatter_log_iterator_stop.comp
- Misc, Shape.comp - Inactive shape, to embellish instrument display, e.g. a flight tube.
- Optics, Grating_trans.comp - Linear transmission grating
- Optics, Lens_CRL_RTM.comp - 1D-compound refractive lens based on the ray transfer matrix method
- Union, Union_master.comp - Set of components defining the Union subsystem.
- Union, Union_cylinder.comp
- Union, Union_sphere.comp
- Union, Union_make_material.comp
- Union, Union_box.comp
- Union, Compton_xrl_process.comp
- Union, Incoherent_process.comp
- Union, Union_logger_2D_space.comp
- Union, Union_logger_1D.comp
- ...and more...
- Contrib, Bragg_crystal_simple.comp - Simple, easy-to-use reflective crystal.
- Many new test-examples and bug fixes.
Refer to new-nightly.mcxtrace.org for daily tests
- New example instruments
- Test_mirror_parabolic.instr - Template instrument for the parabolic reflector.
- Test_Detector_pn.instr - Templat/test instrument for a detector with quantum efficiency.
- Test_grating_trans.instr - Template transmission grating instrument
- Focal_pt_monitor.instr - Template for setting up direct measurement of focal point.
- NBI_Lab_TOMO.instr - Laboratory tomography setup.
- Airport_scannerII.instr - Lab-based large scale tomograhy setup with multiple off-objects
- Union_incoherent.instr - Examples that shows how to use Union.
- Template_DCM.instr - a template for how to set up a double crystal monochromator.
- Template_Johann_spec.instr - template for a Johann spectrometer (such as FXE@E-XFEL)
- Template_Scatter_log_losses.instr - template for logging losses in a mirror
- A GUI feature to connect the McXtrace GUI with your editor of choice
- Many updates to existing beamline models.
McXtrace 1.5 is released
[25/10/2019] Dear all - The McXtrace team is proud to announce the release of McXtrace version 1.5. The release contains many improvements to computations, model improvements, new components and example instruments, as well as general stability improvements. Head on over to downloads.mcxtrace.org and get yours while it is still hot!
Packages have been built on Debian Stable (10), Centos 7, Mac OS Catalina, and for windows 64 bit. Fedora 29 rpms are also available.
Debian and Centos packages are available through our repositories (using apt-get and yum). Mac users should simply be able to download the bundle and drag it to
/Applications, following the instructions in the README.
As always - if you experience _any_ problems please don't hesitate to contact the McXtrace team. Either through the mailing list or indeed submit a ticket on the McCode issue tracker on github github.com/McStasMcXtrace/issues.
CHANGES in 1.5
... and more
- Standardized reflectivity library, making it much simpler to deal with reflectivity files
- The shipped MCPL-library has been updated
- Updated and streamlines the installation procedure - such that windows and Mac installs are now (almost completely sandboxed).
- New components:
- Bragg_crystal (replacing Perfect_crystal)
- Reflective grating
- SAXS_samples series
- Phi_monitor: Phase monitor.
- Updates to components:
- Mirror comp - can now be either in the xz or yz-plane
- Virtual option to Mask-component - used to artifically add a 2D-pattern to a subsequent component.
- Mirrors now use the reflectivity library
- Source_lab: Add Ag as an anode material
- Source_lab: Default is now to use lorentzian line-shapes
- Undulator: Easier to compile with GSL on windows
- PowderN Major improvement in the way incoherent scattering is handled
- Monitors: Monitors now have a nowritefile option to dynamically disable monitor (useful if an instrument has a lot of monitors)
- PSD_monitor: pixel count can now be set by a variable
- PSD_monitor_coh: optionally rays are now treated as if they hit a pixel center. This avoids convoluting the pixel shape in the interference pattern
- MCPL: can now encode polarization vector
- several new example and updated instruments:
- Updated Test instruments (many of these can be used as examples)
- Updates to the GUI - including autoplot options and improved stability of the plotting and display subsystems
- Performance improvement to MPI
- Better performance on reading datafiles (especially on windows)
- Updated manual
McXtrace 1.4 on Mac OS 10.14 Mojave
It appears that McXtrace can fail to compile the generated c-code on Mac OS
10.14, with an error that
math.h cannot be found. A cause for this
may be that with the newest release of XCode 10 there is no longer a
/usr/include directory by default. See the release notes for more
Code 10 Release notes.
For now, a package is distributed with XCode 10 that
/usr/include and its contents:
The release notes state that this package will not be packaged in future releases of XCode. We are working on a long term solution.
McXtrace 1.4: workaround for a python issue on windows 10
[27/11/2017] A reported issue with McXtrace 1.4 and numpy has found a workaround.
The procedure below has been reported to work, if when starting an McXtrace simiulation for the GUI, you happen to see error messages complaing about missing dlls and at the end of them (there can be a lot) find something like the following:
If this applies to you then you may try this, which has been reported to work:
File "C:\mcxtrace-1.4\miniconda3\lib\site-packages\numpy\core\__init__.py", line 14, in
from . import multiarray ImportError: DLL load failed ...
- Move the numpy folder in the miniconda3 folder
c:/mcxtrace-1.4/minoconda3/Lib/site-packages/numpy out of the way.
- Start a mcxtrace shell session
- In the shell, issue the command:
pip install numpy
McXtrace 1.4: known bugs
[16/08/2017] A list of known bugs in the McXtrace 1.4 dsitribution. These will be fixed in an upcoming 1.4.1.
- Lens_parab & Lens_parab_Cyl: A missing 'I' in the header (line 11) trips the intersection algorithm. Fixed in the development tree
- mxplot-pyqtgraph on windows: An error in a post-install script causes
the file c:\mcxtrace-1.4\bin\mxplot-pyqtgraph to have a typo where it
says mcplot.py instead of mxplot.py as it should. The mxplot-pyqtgraph
script is generated install time - the install procedure has been
altered to fix this.
For existing systems the simple workaround is to
either edit that file in place or to replace it with one from this link:downloads.mcxtrace.org/mcxtrace-1.4/fixes.
- On windows, if you want to use the Undulator component, you must also
install The GNU scientific Library (GSL). It is available from gnuwin32.sourceforge.net/packages/gsl.
This also implies that you probably need to edit the mcxtrace compiler
flags. Go to File->Configure and add something along the lines
"-Lc:\mcxtrace\Program Files (x86)\GnuWin32\lib -Ic:\mcxtrace\Program
Files (x86)\GnuWin32\include" to the C flags box for mcxxtrace to be
find the libraries compile time.
McXtrace 1.4 is released!
[23/06/2017] The McXtrace team is proud to announce that McXtrace 1.4 has finally been released. In the first step packages are made available for debian systems, while the testing trolls do their work on the rpms and windows file to make sure the installation procedure runs as smooth as possible. Fortunately testing trolls do not celebrate Swedish midsummers' eve.
New features of 1.4 (pasted from the CHANGES file):
- Source_pt, Source_flat, Source_gaussian, and Source_div now behave in the same manner wrt. phase. The relevant parameters
are randomphase and phase. If randomphase is !=0 the phase is completely random, if ==0 the value of phase is used.
- EPSD_monitor: Has a parameter nE which denotes a number of energy bins. if >1 the monitor will output a number of files.
each corresponding to an energy bin.
- Lens_parab, Lens_parab_Cyl The functionality of the _rough versions of these components have been merged into the main components
and the _rough versions themselves retired.
- Support for binary file dump of photons in the mcpl-format is added.
- On debian class systems, McXtrace now installs to /usr/share to be more standards compliant.
- New Components:
- sources/Undulator.comp: Undulator model based on Kim, 1989, "Characteristics of synchrotron radiation"
- samples/Incoherent.comp: Model sample of an incoherent scatterer
- samples/Polycrystal.comp: Polycrystal sample based on Single_crystal formalism
- samples/SasView_model.comp: All samples included in the SasModels module of SasView.
Currently does not take in absorption into account
- misc/Air.comp: A "box" full of Air that may scatter.
- misc/Focus.comp: Adds resampling to any component. I.e. causes the preceding object to become a secondary source.
- misc/MCPL_input.comp: Interface components to read/write MCPL-format files.
- optics/Bragg_crystal.comp: Superseeds Perfect_Crystal
- optics/Bragg_crystal_bent.comp: Bent crystal model
- optics/Capillary.comp: Capillary tube with reflecting walls.
- optics/Collimator_linear.comp: Ideal collimator models
- optics/Mirror.comp: Simple flat mirror component
- optics/Mirror_toroid.comp: Toroidal mirror
- contrib/Detector_pn.comp: Detector model with quantum efficiency.
- contrib/SAXS/SAXSCurve.comp: A set of SAXS-sample models
- Example Instrument simulations:
- Full model of proposed DanMAX beamline.
- Pump_probe_solvent: Example of disordered scattering in solution.
- SAXS_saxlab: Laboratory SAXS setup with Montel optic.
- template_1Slit_Diff & template_2Slit_Diff: examples of raytracing with coherent interference effects.
- ESRF_ID01: Microdiffraction beamline with polycrystal sample
- templateSasView: Example of using the (experimental) SasView interface.
- ... and various Unit test/Example instruments
- New python/Qt based GUI/plotting tool
- PowderN: incoherent scattering (computed from tables)
- Curved Bragg monochromator crystal,
Major improvements to the flat Bragg monochromator crystal
- Output in the NeXus-format.
- Data files (such as photoelectric absorption spectra) can be read once and reused by other components without further disk IO overhead.
Bug in PowderN.comp
A bug has been found in PowderN shipped with McXtrace 1.2. It results in underestimating absorption substantially. A patch has been commited to the devlopment tree
which may be downloaded from PowderN.comp
Thanks to the groups at University College London and Cranfield University for reporting this.
A manual is "under construction". A rough draft version is available here. From now on, we will upload nightly builds of the manuals here: nightlies.
A printed, bound version is planned using a Print-On-Demand scheme.
This is work in progress and may contain significant omissions and inaccuracies but for the interested it may be downloaded here:
The User manual documents the use of the McXtrace system whereas the Component manual details the inner workings of the models employed in the components, in other words the interaction physics between devices and beam.
McXtrace Code Development
The code development page has more info on code details
We've established a gallery of plots which are beautiful/funnny or otherwise interesting at McXtraceArt. Please take a look and be inspired!
Steering Committee Meeting Minutes
You may now access the minutes of the steering committee meetings
Last Modified: Monday, 16-Aug-2021 16:50:03 CEST