musrfit: A free platform-independent framework for muSR data analysis

Reading time: 6 minute
...

📝 Original Info

  • Title: musrfit: A free platform-independent framework for muSR data analysis
  • ArXiv ID: 1111.1569
  • Date: 2016-03-29
  • Authors: : J. A. K. Howard, M. E. D. Ekström, R. H. Heij, and P. M. van der Laan

📝 Abstract

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).

💡 Deep Analysis

Figure 1

📄 Full Content

Currently, various data-analysis tools for analyzing muon-spin-rotation (µSR) data are available, however, the situation is unsatisfactory for different reasons. Most of these programmes are limited to a single platform, e. g. Microsoft Windows, others are not maintained anymore, and some of them are not free software. Another problem arising from this situation is that more elaborate modelling is almost impossible from within the current frameworks and hence, the users are forced to write their own code. This was especially true for low-energy µSR (LE-µSR) where often the µ + stopping distribution has to be taken into account in the analysis. Therefore, we started to develop a free data-analysis framework for µSR, called musrfit, which should overcome the problems described.

From the points raised, the design criteria were: (i) musrfit has to be free software according to the GNU licenses [1], and hence available to everyone. (ii) It should be transparent and user-friendly, e. g. a clear and complete online documentation should be available. (iii) Extensions to the basic framework should be possible on the user level. (iv) musrfit should be able to read all currently used µSR-data-file formats directly. (v) Datavisualization and fit-parameter tools should be available. (vi) The maintainability should be warranted.

In order to fulfil all these requirements we decided to build up on the ROOT framework [2] developed and maintained at CERN and heavily used in particle physics as well as other fields of physics and engineering. The ROOT framework is a collection of C++ libraries together with a C++ macro interpreter. It provides graphical-userinterface tools and contains the Minuit/Minuit2 optimization routines [3]. For us it is a “natural” choice since the ROOT framework is already part of the µSRdata-acquisition systems at PSI. musrfit consists of a collection of C++ classes [4] which can be used either directly using the ROOT macro capabilities, or-probably simpler for most of the users-can be accessed via some user-friendly programmes, provided within the musrfit suite described in the next section.

The analysis of µSR data using the musrfit suite is controlled by text files with the extension msr (“msr files”). These human-readable files contain all information needed to fit a model function to the µSR data: the fit parameters, the definition of the model, some details on the relevant µSR data files, and the fitting routines to be used. Moreover, information used for the graphical presentation of the data and fits, such as plot ranges and parameters for Fourier transforms are stored in the msr files as well. These msr files are also used as a protocol of the fit results. A detailed explanation of the structure and syntax of the msr files can be found in Ref. [5]. In the following, only a basic overview of the different programmes shall be given.

After musrfit is called to fit a model it analyzes the respective msr file and reads in all specified data files. Successively, the fit is performed and the resulting parameters are written to a mlog file which also complies with the msr file structure. Additionally, the covariance matrix and the correlation coefficients of the free fit parameters as determined by Minuit2 are saved as ASCII and binary ROOT files. In a final step, the msr and mlog files are swapped so that the msr file contains the updated parameter values while the mlog file holds a copy of the parameter set used as input to musrfit. This procedure is summarized in Fig. 1. Currently, musrfit supports χ 2 minimization and log-likelihood maximization.

The analyzed data and the model functions can be visualized using the programme musrview. Like the actions of musrfit also the initial plotting frame of musrview is controlled by the msr file. For example, it can be specified which data should be drawn in which range; if more than one set of data should be drawn it can be chosen if they should appear in a single canvas or in separate ones, and so on. Since the plotting routines are based on ROOT as well, the initially drawn graphs can be easily modified using conventional ROOT editing features-e. g. labels or arrows could be added, colours could be changed, and so on. musrview also offers the possibility to calculate and show the Fourier transforms of µSR time spectra. As an example, Fig. 2 depicts the time spectrum and the corresponding field distribution of a selected µSR measurement plotted by musrview. Despite not being shown in Fig. 2, also the difference between the analyzed data and a given model can be plotted. Furthermore, a set of keyboard shortcuts has been implemented to make the navigation more easy, e. g. pressing ‘f’ toggles between the data presentation in the time and frequency domains, ’d’ changes the view to the difference plot. Finally, there also exists the possibility to save the shown data and model curves in an ASCII file which facilitates the further use of these data in th

📸 Image Gallery

cover.png

Reference

This content is AI-processed based on open access ArXiv data.

Start searching

Enter keywords to search articles

↑↓
ESC
⌘K Shortcut