Source-linked AI summary
musrfit: A free platform-independent framework for muSR data analysis
A. Suter, B. M. Wojek
TL;DR
µSR analysis tools had platform, maintenance, licensing, and modelling limitations. musrfit addresses these through a free ROOT-based framework of user-facing programs controlled by human-readable msr files, with extensibility, visualization, fit-parameter handling, and direct support for multiple facility formats. Its supported workflow includes fitting, result recording, graphing, Fourier transforms, file generation, parameter extraction, and user-defined C++ functions.
Problem
Existing µSR tools were often platform-limited, unmaintained, non-free, or inadequate for elaborate modelling, particularly in analyses involving muon stopping distributions.
Method
musrfit combines ROOT-based C++ components and Minuit routines with human-readable msr-controlled programs for fitting, visualization, file handling, and user-defined extensions.
Results
The framework provides fitting, visualization, Fourier-transform display, parameter extraction, msr-file generation, data conversion, and direct reading of available µSR data files.
Takeaways & Limitations
musrfit offers a free, extensible workflow intended to make µSR data analysis and related file handling broadly accessible.
Abstract
from arXiv · showhide
A free data-analysis framework for muSR has been developed. musrfit is fully written in C++, is running under GNU/Linux, Mac OS X, as well as Microsoft Windows, and is distributed under the terms of the GNU GPL. It is based on the CERN ROOT framework and is utilizing the Minuit optimization routines for fitting. It consists of a set of programs allowing the user to analyze and visualize the data. The fitting process is controlled by an ascii-input file with an extended syntax. A dedicated text editor is helping the user to create and handle these files in an efficient way, execute the fitting, show the data, get online help, and so on. A versatile tool for the generation of new input files and the extraction of fit parameters is provided as well. musrfit facilitates a plugin mechanism allowing to invoke user-defined functions. Hence, the functionality of the framework can be extended with a minimal amount of overhead for the user. Currently, musrfit can read the following facility raw-data files: PSI-BIN, MDU (PSI), ROOT (LEM/PSI), WKM (outdated ascii format), MUD (TRIUMF), NeXus (ISIS).
INTRODUCTION
musrfit was developed as a free, cross-platform µSR framework addressing limited, unmaintained, non-free tools and difficult modelling. It uses ROOT-based C++ components and user-friendly programs to support extensibility and analysis workflows.
- Existing µSR tools were often platform-limited, unmaintained, non-free, or inadequate for elaborate modelling.These limitations could force users to write their own code, especially for LE-µSR analyses involving muon stopping distributions.
- The design criteria required free software, transparent documentation, user-level extensions, broad file-format support, visualization, fit-parameter tools, and maintainability.
- musrfit builds on CERN’s ROOT framework, using C++ libraries, macro capabilities, graphical tools, and Minuit/Minuit2 optimization routines.The framework’s C++ classes can be used directly through ROOT macros or accessed through suite programs.
THE MUSRFIT SUITE
musrfit uses human-readable msr files as the central control and record format for fitting and presenting µSR data.
- Human-readable msr files specify fit parameters, model definitions, data files, fitting routines, and graphical presentation settings.They can also store plot ranges and Fourier-transform parameters.
- msr files also serve as a protocol of the fit results.
- The file structure and syntax are documented in a dedicated reference.
musrfit—fitting a model
musrfit reads an msr file and specified data, performs the fit, records outputs, and updates the parameter file through a defined file-flow procedure.
- musrfit analyzes the msr file, reads specified data files, performs the fit, and writes resulting parameters to an mlog file.
- The covariance matrix and free-parameter correlation coefficients are saved in ASCII and binary ROOT files.These quantities are determined by Minuit2.
- After fitting, the msr and mlog files are swapped so updated parameters remain in msr while the input set is copied to mlog.
- The fitting framework supports χ2 minimization and log-likelihood maximization.
musrview—graphical presentation
musrview visualizes µSR data and model functions using plotting settings from msr files, while retaining ROOT-based editing and Fourier-transform capabilities.
- musrview uses msr files to control which data are drawn, their ranges, and whether multiple datasets share or use separate canvases.
- ROOT editing features allow users to modify labels, arrows, colours, and other displayed graph elements.
- musrview can calculate and display Fourier transforms of µSR time spectra.
msr2data—advanced msr-file handling
msr2data processes multiple msr files to summarize fit parameters and can generate new msr files from templates. It also supports combining generation, fitting, and parameter summarization across runs.
- msr2data processes multiple msr files sharing the same parameters and summarizes their fit parameters in TRIUMF DB or column ASCII files.
- For each run, external parameters and metadata such as temperature or applied magnetic field can optionally be included in the resulting parameter file.
- A template can generate new msr files by substituting run numbers, including files for a list of runs.
- Generated msr files can be processed by musrfit, after which each run’s parameters are automatically summarized in a parameter file.
musredit/musrgui—editing msr files
musredit and musrgui are dedicated text editors and frontends for handling msr files. They combine basic editing with interfaces to musrfit.
- musredit and musrgui help users handle msr files through dedicated editor interfaces.
- Both programs provide basic editor functions and interfaces to musrfit.
- musrgui uses Qt 3, whereas musredit uses Qt 4.6 or newer.
User-defined functions
musrfit combines predefined muon-spin-polarization functions with a C++ plug-in mechanism for user-defined functions. This extends analyses, including models for low-energy µSR and superconducting screening.
- The plug-in mechanism invokes user-defined functions implemented as C++ classes.
- Plug-ins allow users to extend musrfit functionality with minimal overhead.
- For low-energy µSR, plug-ins can incorporate the muon stopping distribution into depolarization-function calculations.
- Available add-on modules model local or nonlocal Meissner screening in superconductors.
any2many—a “universal” µSR-data-file converter
any2many is a helper program for converting among µSR facility data-file formats. It also supports ASCII output for users working with other analysis software.
- any2many provides conversions from one µSR data-file format into another.
- The converter supports virtually all possible format conversions, including ASCII output.
- any2many helps users whose preferred analysis software has difficulty handling different µSR facility data-file formats.