Physics Physics Department, Technical University of Denmark 2800 Kongens Lyngby, Denmark
Component Manual for the Neutron
Ray-Tracing Package McStas, version 3.9
P. Willendrup, E. Farhi, E. Knudsen, K. Lefmann
September, 2026
The software package McStas is a tool for carrying out Monte Carlo ray-tracing simulations
of neutron scattering instruments with high complexity and precision. The simulations can
compute all aspects of the performance of instruments and can thus be used to optimize the
use of existing equipment, design new instrumentation, and carry out virtual experiments for
e.g. training, experimental planning or data analysis. McStas is based on a unique design
where an automatic compilation process translates high-level textual instrument
descriptions into efficient ISO-C code. This design makes it simple to set up typical
simulations and also gives essentially unlimited freedom to handle more unusual
cases.
This report constitutes the reference manual for McStas, and, together with the
manual for the McStas components, it contains documentation of most aspects of the
program. It covers the various ways to compile and run simulations, a description of the
meta-language used to define simulations, and some example simulations performed with the
program.
This report documents McStas version 3.9, released September, 2026
The authors are:
Peter Kjær Willendrup <pkwi@fysik.dtu.dk> Physics Department, Technical University of Denmark, Kongens Lyngby,
Denmark
Emmanuel Farhi <emmanuel.farhi@synchrotron-soleil.fr> Synchrotron SOLEIL, Saint-Aubin, France
Kim Lefmann <lefmann@nbi.dk> Niels Bohr Institute, University of Copenhagen, Denmark
as well as authors who left the project:
Erik Knudsen <erkn@fysik.dtu.dk> Physics Department, Technical University of Denmark, Kongens Lyngby,
Denmark Jakob Garde <jaga@fysik.dtu.dk> Physics Department, Technical University of Denmark, Kongens Lyngby,
Denmark Peter Christiansen <pchristi@hep.lu.se> Materials Research Department, Risø National Laboratory, Roskilde,
Denmark Present address: University of Lund, Lund, Sweden Klaus Lieutenant <k.lieutenant@fz-juelich.dee> Institut Laue-Langevin, Grenoble, France Present address: Forschungs-Zentrum Jülich, Germany Kristian Nielsen <kristian-nielsen@mail.tele.dk> Materials Research Department, Risø National Laboratory, Roskilde,
Denmark Presently associated with: MySQL AB, Sweden