26 Commits

Author SHA1 Message Date
5c3accc6ed added jump to block feature. 2024-12-02 20:05:50 +01:00
6f8b0a2341 center edit widget for find. This gives a better user experience. 2024-12-02 17:06:02 +01:00
4febdb42b4 make sure that for non-muSR data errors are not = 0. Will set it to 1, and issue a warning. This prevents chisq to crash. 2024-10-14 12:22:25 +02:00
ae95a5dc1c implemented unary operator for metaData in functions. 2024-10-11 16:34:49 +02:00
c3f531e0d5 fixed a bug for out-of-repo build to generate git-info. 2024-10-11 08:19:54 +02:00
0b61130e28 adopted OpenMP handling for libZFRelaxation. 2024-09-23 09:41:20 +02:00
d1cd63dcb0 fixed a bug in the mupp gui refresh of a collection. 2024-09-21 13:02:31 +02:00
7838901fbe make sure that the run template number has at least 4 digits before proceeding. 2024-09-17 16:27:04 +02:00
00b012d0dd Merge https://bitbucket.org/muonspin/musrfit into root6 2024-09-12 09:29:03 +02:00
d2984d8923 Merged in avg (pull request #18)
fix batch mode averaged output

Approved-by: Andreas Suter
2024-09-12 07:28:15 +00:00
58889614e5 fix batch mode averaged output
closes issue #63
2024-09-10 13:52:30 -07:00
c9fc373862 improved dat-file reading for mupp. 2024-07-02 09:26:44 +02:00
ebefcf7af9 updated the docu. 2024-06-24 09:44:07 +02:00
64d3b6192b added the option to write the content of the MINUIT2.OUTPUT ascii file as yaml. This extends the previous commit from Ryan M.L. McFadden. 2024-06-18 11:16:15 +02:00
6bcb26f9d5 Merge branch 'root6' of https://bitbucket.org/muonspin/musrfit into root6 2024-06-18 08:19:01 +02:00
6b865efd3b Merged in ignore (pull request #17)
ignore all files generated from an in-repo build

Approved-by: Andreas Suter
2024-06-18 06:18:56 +00:00
caccfb175a Merged in yaml (pull request #16)
write the fit results to an easy-to-read/parse yaml file

Approved-by: Andreas Suter
2024-06-18 06:18:31 +00:00
1845b5c176 Merged in segfault (pull request #15)
fix segfault

Approved-by: Andreas Suter
2024-06-18 06:18:14 +00:00
8821112927 ignore all files generated from an in-repo build 2024-06-17 13:07:06 -03:00
833171c712 write the fit results to an easy-to-read/parse yaml file
This patch adds routines for writing a comprehensive set of fit results (i.e., parameter values, parabolic errors, asymmetric errors, covariances, correlation coefficients, etc.) for an individual `.msr` file to an easy-to-read/parse `.yaml` file.

The main motivation for the code addition is to provide users with easy access to the fit's covariance matrix without the need for "extra" manual effort (e.g., parsing the contents of `MINUIT2.OUTPUT` or `MINUIT2.root`). The other fit quantities are also included for completeness.

Reading/accessing the output is trivial using, for example, the PyYAML Python library (https://github.com/yaml/pyyaml):

```python
import yaml

with open("2125_tf_histo.yaml", "r") as fh:
	results = yaml.load(fh, Loader=yaml.SafeLoader)

cov = results["covariance"]["Field_1"]["Sigma_1"]
```

Note: the naming conventions chosen for the blocks in the `.yaml` output closely follow those used by the iminuit Python library (https://github.com/scikit-hep/iminuit).
2024-06-17 12:51:04 -03:00
61749b91c4 fix segfault
This patch provides a memory-safe alternative to the changes introduced in commit 418adfde67, which causes a segfault when the "batch mode" flag is required (i.e., for ascii/graphic export).

Note: the program name (i.e., argv[0]) has been added the list arguments passed to ROOT's TApplication. This ensures that the TApplication name matches that of the program (see 542b98b2cc/core/base/src/TApplication.cxx (L179-L180)).
2024-06-17 10:52:14 -03:00
3d92e2eefb add CPU info to the configure process. 2024-06-09 17:45:02 +02:00
b71dce9291 remove more accidently added file. 2024-06-08 16:39:57 +02:00
1aa4ce0a99 remove accidentely added file. 2024-06-08 16:36:54 +02:00
425ed02e22 update of the docu. 2024-06-08 09:23:36 +02:00
a36abfc461 updated version info, due to the macOS OpenMP support. 2024-06-08 09:17:05 +02:00
66 changed files with 610 additions and 146 deletions

BIN
.DS_Store vendored

Binary file not shown.

2
.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
# ignore all files generated from an in-repo build
build/

View File

@ -1,7 +1,7 @@
# - musrfit
cmake_minimum_required(VERSION 3.17)
project(musrfit VERSION 1.9.3 LANGUAGES C CXX)
project(musrfit VERSION 1.9.6 LANGUAGES C CXX)
#--- musrfit specific options -------------------------------------------------
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
@ -249,6 +249,8 @@ set(CMAKE_INSTALL_RPATH "${rpath}")
add_subdirectory(src)
#--- write summary of the installation
cmake_host_system_information(RESULT PROCESSOR QUERY PROCESSOR_DESCRIPTION)
message("")
message("|-----------------------------------------------------------------------|")
message("| |")
@ -256,8 +258,9 @@ message("| Summary
message("| |")
message("|-----------------------------------------------------------------------|")
message("")
message(" System: ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} - ${CMAKE_HOST_SYSTEM_VERSION}")
message(" -------")
message(" System: ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} - ${CMAKE_HOST_SYSTEM_VERSION}")
message(" Processor: ${PROCESSOR} (${CMAKE_SYSTEM_PROCESSOR})")
message(" ----------")
message("")
message(" musrfit Version: ${musrfit_VERSION}")
message(" ----------------")

View File

@ -9,7 +9,7 @@ set(MUSRFIT_VERSION "@MUSRFIT_VERSION@")
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${SRC_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
@ -17,7 +17,7 @@ execute_process(
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --pretty="%h, %ci"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
WORKING_DIRECTORY ${SRC_DIR}
OUTPUT_VARIABLE GIT_CURRENT_SHA1
OUTPUT_STRIP_TRAILING_WHITESPACE
)

BIN
doc/.DS_Store vendored

Binary file not shown.

BIN
doc/examples/.DS_Store vendored

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 28c8d31b3d0d7429fcebb7bd0074bdd3
config: 1c72e3ac8764a6fbfdf66c0cdf797d3d
tags: 645f666f9bcd5a90fca523b33c5a78b7

View File

@ -1,6 +1,6 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.9.3',
VERSION: '1.9.5',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Acknowledgements &mdash; musrfit 1.9.3 documentation</title>
<title>Acknowledgements &mdash; musrfit 1.9.5 documentation</title>
@ -201,7 +201,7 @@ extremely competent way to deal with his projects as well as to deal with the ch
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -223,7 +223,7 @@ extremely competent way to deal with his projects as well as to deal with the ch
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>any2many - a Universal μSR-file-format converter &mdash; musrfit 1.9.3 documentation</title>
<title>any2many - a Universal μSR-file-format converter &mdash; musrfit 1.9.5 documentation</title>
@ -191,7 +191,7 @@ For a detailed description see <a class="reference internal" href="user-manual.h
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -213,7 +213,7 @@ For a detailed description see <a class="reference internal" href="user-manual.h
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bugtracking &mdash; musrfit 1.9.3 documentation</title>
<title>Bugtracking &mdash; musrfit 1.9.5 documentation</title>
@ -189,7 +189,7 @@ or send an e-mail to A. Suter at PSI.</p>
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -211,7 +211,7 @@ or send an e-mail to A. Suter at PSI.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>How to Cite musrfit? &mdash; musrfit 1.9.3 documentation</title>
<title>How to Cite musrfit? &mdash; musrfit 1.9.5 documentation</title>
@ -203,7 +203,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -225,7 +225,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Short description and references to the supported file-formats &mdash; musrfit 1.9.3 documentation</title>
<title>Short description and references to the supported file-formats &mdash; musrfit 1.9.5 documentation</title>
@ -503,7 +503,7 @@ Between detectors, there will be an empty line.</p>
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -525,7 +525,7 @@ Between detectors, there will be an empty line.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index &mdash; musrfit 1.9.3 documentation</title>
<title>Index &mdash; musrfit 1.9.5 documentation</title>
@ -753,7 +753,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -775,7 +775,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.9.3 documentation</title>
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.9.5 documentation</title>
@ -285,7 +285,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -307,7 +307,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files &mdash; musrfit 1.9.3 documentation</title>
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files &mdash; musrfit 1.9.5 documentation</title>
@ -518,7 +518,7 @@ fit serves as template for the second and so on. The template field stays empty
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -540,7 +540,7 @@ fit serves as template for the second and so on. The template field stays empty
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.9.3 documentation</title>
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.9.5 documentation</title>
@ -408,7 +408,7 @@ SCRIPT COMMANDS:
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -430,7 +430,7 @@ SCRIPT COMMANDS:
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MusrRoot - an Extensible Open File Format for μSR &mdash; musrfit 1.9.3 documentation</title>
<title>MusrRoot - an Extensible Open File Format for μSR &mdash; musrfit 1.9.5 documentation</title>
@ -1007,7 +1007,7 @@ the entry has been added. The last token, <code class="docutils literal notransl
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -1029,7 +1029,7 @@ the entry has been added. The last token, <code class="docutils literal notransl
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>musredit: the GUI Based Interface to musrfit &mdash; musrfit 1.9.3 documentation</title>
<title>musredit: the GUI Based Interface to musrfit &mdash; musrfit 1.9.5 documentation</title>
@ -634,7 +634,7 @@ the corresponding fit parameter value, except the phases where the step will be
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -656,7 +656,7 @@ the corresponding fit parameter value, except the phases where the step will be
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; musrfit 1.9.3 documentation</title>
<title>Search &mdash; musrfit 1.9.5 documentation</title>
@ -185,7 +185,7 @@
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -207,7 +207,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Setting up musrfit / DKS: High Speed Fitting with GPUs &mdash; musrfit 1.9.3 documentation</title>
<title>Setting up musrfit / DKS: High Speed Fitting with GPUs &mdash; musrfit 1.9.5 documentation</title>
@ -408,7 +408,7 @@ The only thing you need <code class="docutils literal notranslate"><span class="
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -430,7 +430,7 @@ The only thing you need <code class="docutils literal notranslate"><span class="
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.9.3 documentation</title>
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.9.5 documentation</title>
@ -264,7 +264,7 @@ Currently the <code class="docutils literal notranslate"><span class="pre">MXML<
<p>If <em>optionally</em> the editor and graphical user interface <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> / <code class="docutils literal notranslate"><span class="pre">musredit</span></code> is going to be installed there is one further requirement:</p>
<dl class="docutils" id="index-11">
<dt><strong>Qt</strong></dt>
<dd>A cross-platform application and user interface framework. <em>Required version ≥ 4.6</em> (musredit) (see <a class="reference external" href="http://qt.io/">Qt</a>). Currently the <strong>Qt5</strong> is the main development part. Qt6 just kicked in, but is not widely available yet.</dd>
<dd>A cross-platform application and user interface framework. <em>Required version ≥ 4.6</em> (musredit) (see <a class="reference external" href="http://qt.io/">Qt</a>). Currently the <strong>Qt5</strong> is still supported since some older distributions are not yet supporting Qt6. <strong>Qt6</strong> is the <em>main</em> development part. Should be available on all new major distributions.</dd>
</dl>
<p>Each of the following sections focusing on the installation of <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> on the different operating systems will also give a brief introduction on the installation of the requirements before the actual musrfit installation is described.</p>
</div>
@ -273,9 +273,8 @@ Currently the <code class="docutils literal notranslate"><span class="pre">MXML<
<p>Before the installation procedure will be described, please note the following restrictions:</p>
<dl class="docutils">
<dt><strong>GNU/Linux</strong></dt>
<dd>No serious problems are currently known. Tested distributions: <a class="reference external" href="https://www.redhat.com/de/technologies/linux-platforms/enterprise-linux">RHEL</a>, <a class="reference external" href="https://getfedora.org/">Fedora</a>,
<a class="reference external" href="https://www.debian.org/">Debian</a>, <a class="reference external" href="https://www.ubuntu.com/">Ubuntu</a>, <a class="reference external" href="https://linuxmint.com/">Mint</a>, <a class="reference external" href="https://en.opensuse.org/Main_Page">openSUSE</a>,
and <cite>manjaro &lt;https://de.manjaro.org/&gt;</cite>.</dd>
<dd>No serious problems are currently known. Tested distributions: <a class="reference external" href="https://www.redhat.com/de/technologies/linux-platforms/enterprise-linux">RHEL</a> (also <a class="reference external" href="https://almalinux.org/">Alma</a>, <a class="reference external" href="https://rockylinux.org/">Rocky</a>), <a class="reference external" href="https://getfedora.org/">Fedora</a>,
<a class="reference external" href="https://www.debian.org/">Debian</a>, <a class="reference external" href="https://www.ubuntu.com/">Ubuntu</a>, <a class="reference external" href="https://linuxmint.com/">Mint</a>, <a class="reference external" href="https://en.opensuse.org/Main_Page">openSUSE</a>, and <a class="reference external" href="https://de.manjaro.org/">Manjaro</a>.</dd>
<dt><strong>Mac OS X/macOS</strong></dt>
<dd>No serious problems are currently known for macOS ≥ 10.6. <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> is ARM M1 ready.</dd>
<dt><strong>MS Windows</strong></dt>
@ -307,11 +306,11 @@ from the shell will do the trick (never type the $ it is the shell prompt
<p>For <strong>Qt5/Qt6</strong>:</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ yum install epel-release
$ yum install git cmake boost-devel gsl-devel fftw-devel libxml2-devel qt5-qtbase-devel qt5-qtsvg-devel
$ yum install git cmake boost-devel gsl-devel fftw-devel libxml2-devel qt6-qtbase-devel qt6-qtsvg-devel
</pre></div>
</div>
</div></blockquote>
<p>If using <code class="docutils literal notranslate"><span class="pre">Qt6</span></code> replace <code class="docutils literal notranslate"><span class="pre">qt5-qtbase-devel</span> <span class="pre">qt5-qtsvg-devel</span></code> by <code class="docutils literal notranslate"><span class="pre">qt6-qtbase-devel</span> <span class="pre">qt6-qtsvg-devel</span></code></p>
<p>If using <code class="docutils literal notranslate"><span class="pre">Qt5</span></code>, since e.g. Qt6 is not available, replace <code class="docutils literal notranslate"><span class="pre">qt6-qtbase-devel</span> <span class="pre">qt6-qtsvg-devel</span></code> by <code class="docutils literal notranslate"><span class="pre">qt5-qtbase-devel</span> <span class="pre">qt5-qtsvg-devel</span></code></p>
<p>When dealing with a distribution that uses the dpkg/apt package manager like <a class="reference external" href="https://www.debian.org/">Debian</a> or <a class="reference external" href="https://www.ubuntu.com/">Ubuntu</a>
the installation would look like:</p>
<p>For <strong>Qt4</strong> (deprecated):</p>
@ -322,11 +321,11 @@ the installation would look like:</p>
</div></blockquote>
<p>For <strong>Qt5/Qt6</strong>:</p>
<blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libboost-filesystem-dev libboost-system-dev libgsl-dev libfftw3-dev libxml2-dev qt5-default qtbase5-dev libqt5svg5-dev
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libboost-filesystem-dev libboost-system-dev libgsl-dev libfftw3-dev libxml2-dev qt6-base-dev qt6-svg-dev
</pre></div>
</div>
</div></blockquote>
<p>If using <code class="docutils literal notranslate"><span class="pre">Qt6</span></code> replace <code class="docutils literal notranslate"><span class="pre">qt5-default</span> <span class="pre">qtbase5-dev</span> <span class="pre">libqt5svg5-dev</span></code> by <code class="docutils literal notranslate"><span class="pre">qt6-default</span> <span class="pre">qtbase6-dev</span> <span class="pre">libqt6svg6-dev</span></code></p>
<p>If using <code class="docutils literal notranslate"><span class="pre">Qt5</span></code>, since e.g. Qt6 is not available, replace <code class="docutils literal notranslate"><span class="pre">qt6-base-dev</span> <span class="pre">qt6-svg-dev</span></code> by <code class="docutils literal notranslate"><span class="pre">qtbase5-dev</span> <span class="pre">libqt5svg5-dev</span></code></p>
<p>Everyone should know best himself which is the way to install distribution software on the chosen distribution.</p>
<p>In case the distribution does not include the required software it has to be compiled from the source files. This means either to download
the source code from the corresponding website, or to clone the git repo. If you need to follow this line, please check the install details of the corresponding package.</p>
@ -366,8 +365,8 @@ $ mkdir build
$ <span class="nb">cd</span> build
$ cmake -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">1</span> -DENABLE_MXML<span class="o">=</span><span class="m">0</span> ../code
$ cmake --build ./ --clean-first
$ <span class="c1"># make install needs either to be carried out as root or sudo depending on your linux flavour.</span>
$ sudo make install
$ <span class="c1"># install needs either to be carried out as root or sudo depending on your linux flavour.</span>
$ sudo cmake --install ./
</pre></div>
</div>
</div>
@ -412,7 +411,7 @@ $ <span class="c1"># calling it with the option -j &lt;number&gt;, where &lt;num
$ <span class="c1"># e.g. cmake --build ./ --clean-first -- -j8</span>
$ cmake --build ./ --clean-first
$ <span class="c1"># as a last step of the ROOT build process we need to install it</span>
$ make install
$ cmake --install ./
</pre></div>
</div>
<p>What is still missing is that the system should be told where to find the <code class="docutils literal notranslate"><span class="pre">ROOT</span></code> installation, therefore the following is suggested:</p>
@ -471,7 +470,7 @@ $ git pull
$ <span class="nb">cd</span> build
$ xargs rm &lt; install_manifest.txt
$ cmake --build ./ --clean-first
$ make install
$ cmake --install ./
</pre></div>
</div>
<p>As an alternative (if git is not available), the source code can also be downloaded from the following web-page: <a class="reference external" href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a></p>
@ -511,7 +510,7 @@ $ <span class="nb">cd</span> build
$ cmake ../ -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span> -Dnexus<span class="o">=</span><span class="m">1</span>
<span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8
$ make install
$ cmake --install ./
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
@ -657,7 +656,7 @@ add a new line pointing to your local copy, <em>e.g.</em></p>
</ol>
<p>Then the MacPorts system should be set up and can be used to install additional software.</p>
<p>The installation of the software mentioned above is then done in the terminal:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo port -v install pkgconfig autoconf automake libtool cmake fftw-3 fftw-3-single gsl boost libxml2 qt6 qt6-qtsvg
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo port -v install pkgconfig autoconf automake libtool cmake libomp fftw-3 fftw-3-single gsl boost libxml2 qt6 qt6-qtsvg
</pre></div>
</div>
<p>With <code class="docutils literal notranslate"><span class="pre">Qt6</span></code>, <code class="docutils literal notranslate"><span class="pre">musredit</span></code> will be installed. If it happens that you used <code class="docutils literal notranslate"><span class="pre">musrgui</span></code> in the past,
@ -668,6 +667,7 @@ please change over to <code class="docutils literal notranslate"><span class="pr
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo port -v install hdf4 hdf5
</pre></div>
</div>
<p><em>hdf4</em> is likely not available anymore.</p>
<p><strong>Only NeXus Version ≥ 4.4 is support!</strong></p>
<p>To get things compiled do:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="c1"># get and install NeXus</span>
@ -678,9 +678,12 @@ $ <span class="c1"># next we will build NeXus out-of-source</span>
$ <span class="nb">cd</span> nexus
$ mkdir build
$ <span class="nb">cd</span> build
$ <span class="c1"># in case hdf4 is present</span>
$ cmake -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">1</span> -DENABLE_MXML<span class="o">=</span><span class="m">0</span> ../code
$ make
$ sudo make install
$ <span class="c1"># in case hdf4 is **not** present</span>
$ cmake -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">0</span> -DENABLE_MXML<span class="o">=</span><span class="m">0</span> ../code
$ cmake --build ./
$ sudo cmake --install ./
</pre></div>
</div>
</div>
@ -728,7 +731,7 @@ $ <span class="c1"># make with the option -j &lt;number&gt;, where &lt;number&gt
$ <span class="c1"># e.g. make -j8</span>
$ cmake --build ./ --clean-first -- -j8
$ <span class="c1"># make will take quite a while</span>
$ make install
$ cmake --install ./
</pre></div>
</div>
<p>For further details see <a class="reference external" href="https://root.cern.ch/building-root">Installing ROOT from Source</a>.</p>
@ -816,10 +819,11 @@ install it.</dd>
</dl>
<p>After installing the <code class="docutils literal notranslate"><span class="pre">Xcode</span></code> tools go to the <a class="reference external" href="https://brew.sh/">Homebrew</a> page, and follow the installation instructions there.</p>
<p>The essential packages (called formulae) which you will need to install are</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cmake</span> <span class="n">boost</span> <span class="n">gsl</span> <span class="n">fftw</span> <span class="n">qt6</span> <span class="n">root</span>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">cmake</span> <span class="n">libomp</span> <span class="n">boost</span> <span class="n">gsl</span> <span class="n">fftw</span> <span class="n">qt6</span> <span class="p">(</span><span class="n">root</span><span class="p">)</span>
</pre></div>
</div>
<p>For example to install <code class="docutils literal notranslate"><span class="pre">cmake</span></code> this is done the following way:</p>
<p>The preferred installation of root would be from source (see below), hence it is set here in parenthesis.
For example to install <code class="docutils literal notranslate"><span class="pre">cmake</span></code> this is done the following way:</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ brew install cmake
</pre></div>
</div>
@ -842,7 +846,7 @@ $ mkdir build
$ <span class="nb">cd</span> build
$ cmake ../code -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">0</span> -DENABLE_MXML<span class="o">=</span><span class="m">0</span>
$ cmake --build ./ --clean-first -- -j8
$ sudo make install
$ sudo cmake --install ./
</pre></div>
</div>
</div>
@ -880,7 +884,7 @@ $ <span class="c1"># make with the option -j &lt;number&gt;, where &lt;number&gt
$ <span class="c1"># e.g. make -j8</span>
$ cmake --build ./ --clean-first -- -j8
$ <span class="c1"># make will take quite a while</span>
$ make install
$ cmake --install ./
</pre></div>
</div>
<p>For further details see <a class="reference external" href="https://root.cern.ch/building-root">Installing ROOT from Source</a>.</p>
@ -993,7 +997,16 @@ If the value is set to <code class="docutils literal notranslate"><span class="p
<dd>Will check if <code class="docutils literal notranslate"><span class="pre">OpenMP</span></code> support is possible, and if yes use it. The default is enabled</dd>
</dl>
<p>Normally it should not be necessary to make use of any of the options except for specifying the installation path with <code class="docutils literal notranslate"><span class="pre">-DCMAKE_INSTALL_PREFIX</span></code>.
<code class="docutils literal notranslate"><span class="pre">musrfit</span></code> build with <code class="docutils literal notranslate"><span class="pre">cmake</span></code> takes the <code class="docutils literal notranslate"><span class="pre">out-of-source</span></code> approach. Therefore a typical configuration / make / install process including
<code class="docutils literal notranslate"><span class="pre">musrfit</span></code> build with <code class="docutils literal notranslate"><span class="pre">cmake</span></code> takes the <code class="docutils literal notranslate"><span class="pre">out-of-source</span></code> approach.</p>
<p>In order to have <strong>OpenMP</strong> available, which allows parallel processing of the fitter, you will need to guide <code class="docutils literal notranslate"><span class="pre">cmake</span></code> to where it can find it. For a <code class="docutils literal notranslate"><span class="pre">Homebrew</span></code> installation, this would be</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">export</span> <span class="nv">OpenMP_ROOT</span><span class="o">=</span><span class="k">$(</span>brew --prefix<span class="k">)</span>/opt/libomp
</pre></div>
</div>
<p>and for a <code class="docutils literal notranslate"><span class="pre">MacPorts</span></code> installation, something like</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">export</span> <span class="nv">OpenMP_ROOT</span><span class="o">=</span>/opt/local/include/libomp
</pre></div>
</div>
<p>Therefore a typical configuration / make / install process including
<code class="docutils literal notranslate"><span class="pre">NeXus</span></code> support would look like</p>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ mkdir build
@ -1001,7 +1014,24 @@ $ <span class="nb">cd</span> build
$ cmake ../ -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span> -Dnexus<span class="o">=</span><span class="m">1</span>
<span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8
$ make install
$ cmake --install ./
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">If you use <code class="docutils literal notranslate"><span class="pre">MacPorts</span></code> you will likely need to guide cmake where to find <code class="docutils literal notranslate"><span class="pre">qt6</span></code>.
You will need to provide the path to the necessary <code class="docutils literal notranslate"><span class="pre">cmake</span></code> files. This is done
from the command line via the switch <code class="docutils literal notranslate"><span class="pre">CMAKE_PREFIX_PATH</span></code>.
The configuration, build, and install process might look like this:</p>
</div>
<div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake ../ -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span> -Dnexus<span class="o">=</span><span class="m">1</span> -DCMAKE_PREFIX_PATH<span class="o">=</span>/opt/local/libexec/qt6/lib/cmake
<span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8
$ cmake --install ./
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
@ -1095,7 +1125,7 @@ $ musrview test-histo-ROOT-NPP.msr
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -1117,7 +1147,7 @@ $ musrview test-histo-ROOT-NPP.msr
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tutorial for musrfit &mdash; musrfit 1.9.3 documentation</title>
<title>Tutorial for musrfit &mdash; musrfit 1.9.5 documentation</title>
@ -527,7 +527,7 @@ For a complete description please refer to the manuals of <a class="reference in
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -549,7 +549,7 @@ For a complete description please refer to the manuals of <a class="reference in
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documentation of user libs (user functions) &mdash; musrfit 1.9.3 documentation</title>
<title>Documentation of user libs (user functions) &mdash; musrfit 1.9.5 documentation</title>
@ -875,7 +875,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -897,7 +897,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User manual &mdash; musrfit 1.9.3 documentation</title>
<title>User manual &mdash; musrfit 1.9.5 documentation</title>
@ -257,6 +257,26 @@
<dt><strong>-u, use-no-of-threads &lt;number&gt;</strong></dt>
<dd>&lt;number&gt;: number of threads to be used (OpenMP). Needs to be &lt;= max. number of cores.
If OpenMP is enable, the maximal number of cores is used, if it is not limited by this option.</dd>
<dt><strong>-r, reset</strong></dt>
<dd><p class="first">reset startup <code class="docutils literal notranslate"><span class="pre">musrfit_startup.xml</span></code>, i.e. rewrite a default, and quit.
The order of which <code class="docutils literal notranslate"><span class="pre">musrfit_startup.xml</span></code> is reset is:</p>
<blockquote class="last">
<div><ol class="arabic simple">
<li>if present in the current dir.</li>
<li>if present under <code class="docutils literal notranslate"><span class="pre">$HOME/.musrfit/</span></code></li>
<li>if present under <code class="docutils literal notranslate"><span class="pre">$MUSRFITPATH/</span></code></li>
<li>if present under <code class="docutils literal notranslate"><span class="pre">$ROOTSYS/</span></code></li>
</ol>
</div></blockquote>
</dd>
<dt><strong>-y, yaml</strong></dt>
<dd><p class="first">write fit results (<code class="docutils literal notranslate"><span class="pre">MINUIT2.OUTPUT</span></code>) into a yaml-file. Output <code class="docutils literal notranslate"><span class="pre">&lt;msr-file&gt;.yaml</span></code>.</p>
<p class="last">The motivation for storing parameter information in this (hierarchical) manner is to provide easy access to details that are cumbersome
to store/access in tabular formats (e.g., <code class="docutils literal notranslate"><span class="pre">CSV</span></code> or <code class="docutils literal notranslate"><span class="pre">TSV</span></code>). This is especially true for the parameter covariance/correlation matrices.
The advantage is evident when processing the contents of the <code class="docutils literal notranslate"><span class="pre">.yaml</span></code> output, which can be easily accomplished using one of the
YAML parsers implemented in your favourite programming language (see, e.g., <a class="reference external" href="https://yaml.org/">https://yaml.org/</a> for a list of options). As an example,
this can be achieved in <code class="docutils literal notranslate"><span class="pre">Python</span></code> using the <code class="docutils literal notranslate"><span class="pre">PyYAML</span></code>.</p>
</dd>
<dt><strong>dump &lt;type&gt;</strong></dt>
<dd>is writing a data file with the fit data and the theory; &lt;type&gt; can be ascii (data in columns) or root (data in ROOT histograms).</dd>
<dt><strong>timeout &lt;timeout_tag&gt;</strong></dt>
@ -2874,7 +2894,7 @@ The syntax here is attribute driven</li>
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024.
Last updated on Jun 24, 2024.
</p>
</div>
@ -2896,7 +2916,7 @@ The syntax here is attribute driven</li>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.3',
VERSION:'1.9.5',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -39,9 +39,10 @@
#include <iomanip>
#include <fstream>
#include <limits>
#include <cmath>
#include <boost/variant/variant.hpp>
#include <sys/time.h>
#include "Minuit2/FunctionMinimum.h"
@ -264,8 +265,8 @@ UInt_t PSectorChisq::GetNDF(UInt_t idx)
* \param runListCollection pointer of the run list collection (pre-processed historgrams)
* \param chisq_only flag: true=calculate chisq only (no fitting)
*/
PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bool_t chisq_only) :
fChisqOnly(chisq_only), fRunInfo(runInfo), fRunListCollection(runListCollection)
PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bool_t chisq_only, Bool_t yaml_out) :
fChisqOnly(chisq_only), fYamlOut(yaml_out), fRunInfo(runInfo), fRunListCollection(runListCollection)
{
// initialize variables
fIsScanOnly = true;
@ -2473,6 +2474,122 @@ Bool_t PFitter::ExecuteSave(Bool_t firstSave)
ccorr->Write("ccorr", TObject::kOverwrite, sizeof(ccorr));
hcorr->Write("hcorr", TObject::kOverwrite, sizeof(hcorr));
ff.Close();
if (fYamlOut) {
// write the fit results to an easy-to-read/parse yaml file
// note: the block names follow those used by Python library iminuit
// https://github.com/scikit-hep/iminuit
// dynamically name the yaml output file
// https://stackoverflow.com/a/25389052
std::string yaml_filename(fRunInfo->GetFileName().Data());
const std::string msr_ext(".msr");
yaml_filename.replace(yaml_filename.find(msr_ext), msr_ext.length(),
".yaml");
// define yaml's 2-space indentation
const std::string yaml_indent(" ");
// open the yaml file for writing
std::ofstream yaml_file(yaml_filename);
// number formatting of the output
yaml_file << std::scientific << std::setprecision(16);
// write the parameter values
yaml_file << "values:\n";
for (unsigned int i = 0; i < fParams.size(); ++i) {
yaml_file << yaml_indent << fParams[i].fName.Data() << ": "
<< fParams[i].fValue << "\n";
}
// write the parabolic errors
yaml_file << "errors:\n";
for (unsigned int i = 0; i < fParams.size(); ++i) {
yaml_file << yaml_indent << fParams[i].fName.Data() << ": "
<< fMnUserParams.Error(i) << "\n";
}
// write the minos errors
yaml_file << "mnerrors:\n";
for (unsigned int i = 0; i < fParams.size(); ++i) {
// use boost's implementation of a variant, which can be streamed by
// default - see: https://stackoverflow.com/q/47168477
boost::variant<double, std::string> positive_error, negative_error;
if (fParams[i].fPosErrorPresent) {
positive_error = fParams[i].fPosError;
negative_error = fParams[i].fStep;
} else {
positive_error = "null";
negative_error = "null";
}
yaml_file << yaml_indent << fParams[i].fName.Data() << ":\n";
yaml_file << yaml_indent << yaml_indent
<< "positive: " << positive_error << "\n";
yaml_file << yaml_indent << yaml_indent
<< "negative: " << negative_error << "\n";
}
// write the parameter limits
yaml_file << "limits:\n";
for (unsigned int i = 0; i < fParams.size(); ++i) {
// use boost's implementation of a variant, which can be streamed by
// default - see: https://stackoverflow.com/q/47168477
boost::variant<double, std::string> upper_limit, lower_limit;
if (fParams[i].fLowerBoundaryPresent) {
lower_limit = fParams[i].fLowerBoundary;
} else {
lower_limit = "null";
}
if (fParams[i].fUpperBoundaryPresent) {
upper_limit = fParams[i].fUpperBoundary;
} else {
upper_limit = "null";
}
yaml_file << yaml_indent << fParams[i].fName.Data() << ":\n";
yaml_file << yaml_indent << yaml_indent << "lower: " << lower_limit
<< "\n";
yaml_file << yaml_indent << yaml_indent << "upper: " << upper_limit
<< "\n";
}
// write if the parameter is fixed
yaml_file << "fixed:\n";
for (unsigned int i = 0; i < fParams.size(); ++i) {
std::string is_fixed = fParams[i].fStep == 0.0 ? "true" : "false";
yaml_file << yaml_indent << fParams[i].fName.Data() << ": " << is_fixed
<< "\n";
}
// write the covariance matrix (omitting fixed parameters)
yaml_file << "covariance:\n";
for (unsigned int i = 0; i < cov.Nrow(); ++i) {
yaml_file << yaml_indent << mnState.Name(parNo[i]) << ":\n";
for (unsigned int j = 0; j < cov.Nrow(); ++j) {
yaml_file << yaml_indent << yaml_indent << mnState.Name(parNo[j])
<< ": " << cov(i, j) << "\n";
}
}
// write the correlation matrix (omitting fixed parameters)
yaml_file << "correlation:\n";
for (unsigned int i = 0; i < cov.Nrow(); ++i) {
yaml_file << yaml_indent << mnState.Name(parNo[i]) << ":\n";
for (unsigned int j = 0; j < cov.Nrow(); ++j) {
double correlation =
i == j ? 1.0
: cov(i, j) / (fMnUserParams.Error(parNo[i]) *
fMnUserParams.Error(parNo[j]));
yaml_file << yaml_indent << yaml_indent << mnState.Name(parNo[j])
<< ": " << correlation << "\n";
}
}
// close the yaml file
yaml_file.close();
}
}
parNo.clear(); // clean up
} else {

View File

@ -188,13 +188,28 @@ void PFunction::FillFuncEvalTree(iter_t const& i, PFuncTreeNode &node)
node.fID = PFunctionGrammar::constGammaMuID; // keep the ID
node.fDvalue = GAMMA_BAR_MUON; // keep the value
} else if (i->value.id() == PFunctionGrammar::constFieldID) { // handle constant field from meta data
str = std::string(i->value.begin(), i->value.end()); // get string
boost::algorithm::trim(str);
if (strstr(str.c_str(), "-"))
node.fSign = true;
node.fID = PFunctionGrammar::constFieldID; // keep the ID
} else if (i->value.id() == PFunctionGrammar::constEnergyID) { // handle constant energy from meta data
str = std::string(i->value.begin(), i->value.end()); // get string
boost::algorithm::trim(str);
if (strstr(str.c_str(), "-"))
node.fSign = true;
node.fID = PFunctionGrammar::constEnergyID; // keep the ID
} else if (i->value.id() == PFunctionGrammar::constTempID) { // handle constant temperature from meta data
str = std::string(i->value.begin(), i->value.end()); // get string
boost::algorithm::trim(str);
status = sscanf(str.c_str(), "T%d", &ivalue); // convert string to temperature index
std::string pstr;
if (strstr(str.c_str(), "-")) {
node.fSign = true;
pstr = "-T%d";
} else {
pstr = "T%d";
}
status = sscanf(str.c_str(), pstr.c_str(), &ivalue); // convert string to temperature index
node.fID = PFunctionGrammar::constTempID; // keep the ID
node.fIvalue = ivalue; // Temp idx
} else if (i->value.id() == PFunctionGrammar::parameterID) { // handle parameter number
@ -432,21 +447,30 @@ Double_t PFunction::EvalNode(PFuncTreeNode &node)
} else if (node.fID == PFunctionGrammar::constGammaMuID) {
return node.fDvalue;
} else if (node.fID == PFunctionGrammar::constFieldID) {
return fMetaData.fField;
Double_t dval = fMetaData.fField;
if (node.fSign)
dval *= -1.0;
return dval;
} else if (node.fID == PFunctionGrammar::constEnergyID) {
if (fMetaData.fEnergy == PMUSR_UNDEFINED) {
std::cerr << std::endl << "**PANIC ERROR**: PFunction::EvalNode: energy meta data not available." << std::endl;
std::cerr << std::endl;
exit(0);
}
return fMetaData.fEnergy;
Double_t dval = fMetaData.fEnergy;
if (node.fSign)
dval *= -1.0;
return dval;
} else if (node.fID == PFunctionGrammar::constTempID) {
if (node.fIvalue >= fMetaData.fTemp.size()) {
std::cerr << std::endl << "**PANIC ERROR**: PFunction::EvalNode: Temp idx=" << node.fIvalue << " requested which is >= #Temp(s)=" << fMetaData.fTemp.size() << " available." << std::endl;
std::cerr << std::endl;
exit(0);
}
return fMetaData.fTemp[node.fIvalue];
Double_t dval = fMetaData.fTemp[node.fIvalue];
if (node.fSign)
dval *= -1.0;
return dval;
} else if (node.fID == PFunctionGrammar::parameterID) {
Double_t dval;
if (node.fSign)
@ -609,10 +633,10 @@ void PFunction::EvalTreeForStringExpression(iter_t const& i, bool funcFlag)
fFuncString += "Pi";
} else if (i->value.id() == PFunctionGrammar::constGammaMuID) {
fFuncString += "gamma_mu";
} else if (i->value.id() == PFunctionGrammar::constFieldID) {
fFuncString += "B";
} else if (i->value.id() == PFunctionGrammar::constFieldID) {
fFuncString += boost::algorithm::trim_copy(std::string(i->value.begin(), i->value.end())).c_str();
} else if (i->value.id() == PFunctionGrammar::constEnergyID) {
fFuncString += "EN";
fFuncString += boost::algorithm::trim_copy(std::string(i->value.begin(), i->value.end())).c_str();
} else if (i->value.id() == PFunctionGrammar::constTempID) {
assert(i->children.size() == 0);
fFuncString += boost::algorithm::trim_copy(std::string(i->value.begin(), i->value.end())).c_str();

View File

@ -697,6 +697,14 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
// std::cout << "debug> " << msrParamList->at(i).fNo << ": " << msrParamList->at(i).fName.Data() << " is global: " << msrParamList->at(i).fIsGlobal << std::endl;
}
// there should be at least one run specific parameter, otherwise the GLOBAL option doesn't make sense
if (fNumSpecParam == 0) {
std::cout << ">> msr2data: **ERROR** found NO run specific parameter, hence the GLOBAL option doesn't make sense." << std::endl;
std::cout << ">> msr2data: Could it be, that your run specific labling is < 4 digits? Please check your msr-Input-File." << std::endl;
return false;
}
// check if parameters have been sorted correctly from the beginning
bool wasSorted(true);
for (unsigned int i(0); i < fNumGlobalParam; ++i) {

View File

@ -939,6 +939,7 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
if (fBatchMode) {
if (fStartWithAvg) { // this is needed to get the averaging in the batch mode
fAveragedView = fStartWithAvg;
HandleAverage();
PlotAverage(true);
}

View File

@ -3697,6 +3697,8 @@ Bool_t PRunDataHandler::ReadAsciiFile()
{
Bool_t success = true;
std::cout << "as35> in ReadAsciiFile() ..." << std::endl;
// open file
std::ifstream f;
@ -3848,7 +3850,14 @@ Bool_t PRunDataHandler::ReadAsciiFile()
break;
}
ey = ostr->GetString().Atof();
if (ey == 0) {
std::cerr << std::endl << ">> PRunDataHandler::ReadAsciiFile **WARNING** line no " << lineNo << ": error y = 0 which doesn't make sense. Will set it to 1.0. Please check!!";
std::cerr << std::endl;
ey = 1.0;
}
} else {
std::cerr << std::endl << ">> PRunDataHandler::ReadAsciiFile **WARNING** line no " << lineNo << ": error y = 0 which doesn't make sense. Will set it to 1.0. Please check!!";
std::cerr << std::endl;
ey = 1.0;
}
@ -4357,7 +4366,7 @@ Bool_t PRunDataHandler::ReadDatFile()
// open file
std::ifstream f;
// open db-file
// open dat-file
f.open(fRunPathName.Data(), std::ifstream::in);
if (!f.is_open()) {
std::cerr << std::endl << ">> PRunDataHandler::ReadDatFile **ERROR** Couldn't open data file (" << fRunPathName.Data() << ") for reading, sorry ...";
@ -4456,6 +4465,12 @@ Bool_t PRunDataHandler::ReadDatFile()
idx++;
} else { // error value
if (isData[i-1] == 1) { // Err or PosErr hence keep it
if (dval == 0.0) {
std::cout << std::endl << ">> PRunDataHandler::ReadDatFile **WARNING** found Err value = 0. Doesn't make sense! Will set it to 1. Please check!";
std::cerr << std::endl << ">> in line: " << lineNo;
std::cerr << std::endl;
dval = 1.0;
}
runData.fDataNonMusr.AppendSubErrData(idx-1, dval);
}
}
@ -4470,11 +4485,11 @@ Bool_t PRunDataHandler::ReadDatFile()
f.close();
// got through all the data sets and if there is NO error vector set it to '0.0'
// got through all the data sets and if there is NO error vector set it to '1.0'
for (UInt_t i=0; i<noOfDataSets; i++) {
if (runData.fDataNonMusr.GetErrData()->at(i).size() == 0) {
for (UInt_t j=0; j<runData.fDataNonMusr.GetData()->at(i).size(); j++) {
runData.fDataNonMusr.AppendSubErrData(i, 0.0);
runData.fDataNonMusr.AppendSubErrData(i, 1.0);
}
}
}

View File

@ -53,14 +53,10 @@ target_include_directories(
)
#--- add library dependencies -------------------------------------------------
if (OpenMP_FOUND)
target_compile_options(ZFRelaxation PUBLIC ${OpenMP_CXX_FLAGS})
endif (OpenMP_FOUND)
set(gomp "")
if (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
set(gomp gomp)
endif (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
if (OpenMP_FOUND)
set(gomp OpenMP::OpenMP_CXX)
endif (OpenMP_FOUND)
target_link_libraries(ZFRelaxation
${gomp} FFTW3::FFTW3 ${ROOT_LIBRARIES} PUserFcnBase cuba BMWtools
)

View File

@ -111,7 +111,7 @@ class PSectorChisq
class PFitter
{
public:
PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bool_t chisq_only = false);
PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bool_t chisq_only = false, Bool_t yaml_out = false);
virtual ~PFitter();
Bool_t IsValid() { return fIsValid; }
@ -124,6 +124,7 @@ class PFitter
Bool_t fIsScanOnly; ///< flag. true: scan along some parameters (no fitting).
Bool_t fConverged; ///< flag. true: the fit has converged.
Bool_t fChisqOnly; ///< flag. true: calculate chi^2 only (no fitting).
Bool_t fYamlOut; ///< flag. true: generate yaml output file of the fit results (MINUIT2.OUTPUT -> yaml)
Bool_t fUseChi2; ///< flag. true: chi^2 fit. false: log-max-likelihood
UInt_t fPrintLevel; ///< tag, showing the level of messages whished. 0=minimum, 1=standard, 2=maximum

View File

@ -82,11 +82,14 @@ struct PFunctionGrammar : public grammar<PFunctionGrammar>
const_gamma_mu = leaf_node_d[ str_p("GAMMA_MU") ];
const_field = leaf_node_d[ str_p("B") ];
const_field = leaf_node_d[ str_p("B") ] |
leaf_node_d[ str_p("-B") ];
const_energy = leaf_node_d[ str_p("EN") ];
const_energy = leaf_node_d[ str_p("EN") ] |
leaf_node_d[ str_p("-EN") ];
const_temp = leaf_node_d[ ( lexeme_d[ "T" >> +digit_p ] ) ];
const_temp = leaf_node_d[ ( lexeme_d[ "T" >> +digit_p ] ) ] |
leaf_node_d[ ( lexeme_d[ "-T" >> +digit_p ] ) ];
fun_label = leaf_node_d[ ( lexeme_d[ "FUN" >> +digit_p ] ) ];

View File

@ -127,6 +127,7 @@ void msr2data_syntax()
std::cout << std::endl << " -k, --keep-mn2-output : if fitting is used, pass the option --keep-mn2-output to musrfit";
std::cout << std::endl << " -t, --title-from-data-file : if fitting is used, pass the option --title-from-data-file to musrfit";
std::cout << std::endl << " -e, --estimateN0: estimate N0 for single histogram fits.";
std::cout << std::endl << " -y, --yaml: write fit results (MINUIT2.OUTPUT) into a yaml-file. Output <msr-file>.yaml";
std::cout << std::endl << " -p, --per-run-block-chisq: will per run block chisq to the msr-file.";
std::cout << std::endl;
std::cout << std::endl << " global : switch on the global-fit mode";
@ -187,6 +188,7 @@ std::string msr2data_validArguments(const std::vector<std::string> &arg)
|| (!iter->substr(0,3).compare("fit")) || (!iter->compare("-k")) || (!iter->compare("--keep-mn2-output")) \
|| (!iter->compare("-t")) || (!iter->compare("--title-from-data-file")) \
|| (!iter->compare("-e")) || (!iter->compare("--estimateN0")) \
|| (!iter->compare("-y") || (!iter->compare("--yaml"))) \
|| (!iter->compare("-p")) || (!iter->compare("--per-run-block-chisq")) \
|| (!iter->compare("data")) || (!iter->substr(0,4).compare("msr-")) || (!iter->compare("global")) \
|| (!iter->compare("global+")) || (!iter->compare("global+!")) || (!iter->compare("new")) \
@ -716,6 +718,8 @@ int main(int argc, char *argv[])
musrfitOptions.append("-t ");
if (!msr2data_useOption(arg, "-e") || !msr2data_useOption(arg, "--estimateN0"))
musrfitOptions.append("-e ");
if (!msr2data_useOption(arg, "-y") || !msr2data_useOption(arg, "--yaml"))
musrfitOptions.append("-y ");
if (!msr2data_useOption(arg, "-p") || !msr2data_useOption(arg, "--per-run-block-chisq"))
musrfitOptions.append("-p ");
}
@ -761,7 +765,7 @@ int main(int argc, char *argv[])
// Check if all given run numbers are covered by the formatting of the data file name
status = msr2dataHandler->CheckRunNumbersInRange();
if(status) {
if (status) {
std::cerr << std::endl;
std::cerr << ">> msr2data: **ERROR** At least one given run number is out of range! Quitting..." << std::endl;
return status;

View File

@ -1437,19 +1437,18 @@ Int_t main(Int_t argc, Char_t *argv[])
musrFT_dumpData(startupParam.dumpFln, fourier, startupParam.fourierRange[0], startupParam.fourierRange[1]);
} else { // do Canvas
// if Fourier graphical export is whished, switch to batch mode
// if Fourier graphical export is wished, switch to batch mode
Bool_t batch = false;
int cc=0;
char **arg;
// create list of essential arguments to pass to the ROOT application
std::vector<char*> args;
args.push_back(argv[0]); // program name
if (startupParam.graphicFormat.Length() != 0) {
batch = true;
arg[cc] = (Char_t*)malloc(16*sizeof(Char_t));
strcpy(arg[cc], "-b");
cc++;
args.push_back((char*)"-b"); // batch mode flag
}
int cc = args.size();
// plot the Fourier transform
TApplication app("App", &cc, arg);
TApplication app("App", &cc, args.data());
if (startupHandler) {
fourierCanvas = std::unique_ptr<PFourierCanvas>(new PFourierCanvas(fourier, dataSetTag, startupParam.title.Data(),

View File

@ -656,12 +656,17 @@ PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool &
param.SetName(headerInfo[i]);
param.SetValue(dval);
if (i+1 < token.size()) {
if (headerCode[i+1] == PMUPP_VALUE) {
if ((headerCode[i+1] == PMUPP_VALUE) || (headerCode[i+1] == PMUPP_RUN)) {
param.SetNegErr(0.0);
param.SetPosErr(0.0);
run.AddParam(param);
param.ResetParam();
}
} else { // last token
param.SetNegErr(0.0);
param.SetPosErr(0.0);
run.AddParam(param);
param.ResetParam();
}
} else if (headerCode[i] == PMUPP_POSNEGERR) {
param.SetPosErr(dval);

View File

@ -985,7 +985,8 @@ void PmuppGui::refresh()
for (int i=0; i<fParamDataHandler->GetNoOfCollections(); i++) {
if (fParamDataHandler->GetCollection(i)->GetName() == label) { // found collection
pathName = fParamDataHandler->GetCollection(i)->GetPathName();
QDir dir(QDir::currentPath());
pathName = dir.path() + "/" + fParamDataHandler->GetCollection(i)->GetName();
collIdx = i;
break;
}
@ -1014,7 +1015,7 @@ void PmuppGui::refresh()
}
} else {
QMessageBox::critical(this, "ERROR - REFRESH",
QString("Couldn't refresh %1").arg(fParamDataHandler->GetCollection(collIdx)->GetName()));
QString("Couldn't refresh %1?!").arg(fParamDataHandler->GetCollection(collIdx)->GetName()));
return;
}

View File

@ -160,6 +160,8 @@ bool PAdminXMLParser::startElement()
fKeyWord = eDumpRoot;
} else if (qName == "estimate_n0") {
fKeyWord = eEstimateN0;
} else if (qName == "yaml_out") {
fKeyWord = eYamlOut;
} else if (qName == "chisq_per_run_block") {
fKeyWord = eChisqPreRunBlock;
} else if (qName == "path_file_name") {
@ -389,6 +391,14 @@ bool PAdminXMLParser::characters()
fAdmin->fMsr2DataParam.estimateN0 = flag;
fAdmin->setEstimateN0Flag(flag);
break;
case eYamlOut:
if (str == "y")
flag = true;
else
flag = false;
fAdmin->fMsr2DataParam.yamlOut = flag;
fAdmin->setYamlOutFlag(flag);
break;
case eChisqPreRunBlock:
if (str == "y")
flag = true;
@ -608,6 +618,7 @@ void PAdminXMLParser::dump()
std::cout << "debug> title_from_data_file : " << fAdmin->getTitleFromDataFileFlag() << std::endl;
std::cout << "debug> chisq_per_run_block : " << fAdmin->getChisqPerRunBlockFlag() << std::endl;
std::cout << "debug> estimate_n0 : " << fAdmin->getEstimateN0Flag() << std::endl;
std::cout << "debug> yaml_out : " << fAdmin->getYamlOutFlag() << std::endl;
std::cout << "debug> musrview_show_fourier : " << fAdmin->getMusrviewShowFourierFlag() << std::endl;
std::cout << "debug> musrview_show_avg : " << fAdmin->getMusrviewShowAvgFlag() << std::endl;
std::cout << "debug> enable_musrt0 : " << fAdmin->getEnableMusrT0Flag() << std::endl;
@ -746,6 +757,7 @@ PAdmin::PAdmin() : QObject()
fEnableMusrT0 = false;
fLifetimeCorrection = true;
fEstimateN0 = true;
fYamlOut = false;
fChisqPreRunBlock = false;
fEditWidth = 900;
@ -760,6 +772,7 @@ PAdmin::PAdmin() : QObject()
fMsr2DataParam.ignoreDataHeaderInfo = false;
fMsr2DataParam.keepMinuit2Output = false;
fMsr2DataParam.estimateN0 = fEstimateN0;
fMsr2DataParam.yamlOut = false;
fMsr2DataParam.writeColumnData = false;
fMsr2DataParam.recreateDbFile = false;
fMsr2DataParam.chainFit = true;
@ -991,6 +1004,12 @@ int PAdmin::savePrefs(QString pref_fln)
else
data[i] = " <estimate_n0>n</estimate_n0>";
}
if (data[i].contains("<yaml_out>") && data[i].contains("</yaml_out>")) {
if (fYamlOut)
data[i] = " <yaml_out>y</yaml_out>";
else
data[i] = " <yaml_out>n</yaml_out>";
}
if (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
if (fMusrviewShowFourier)
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";

View File

@ -71,7 +71,7 @@ class PAdminXMLParser
private:
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut,
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eEditW, eEditH,
eFontName, eFontSize, eExecPath, eDefaultSavePath,
@ -129,6 +129,7 @@ class PAdmin : public QObject
bool getDumpAsciiFlag() { return fDumpAscii; }
bool getDumpRootFlag() { return fDumpRoot; }
bool getEstimateN0Flag() { return fEstimateN0; }
bool getYamlOutFlag() { return fYamlOut; }
bool getChisqPerRunBlockFlag() { return fChisqPreRunBlock; }
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu; }
bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar; }
@ -157,6 +158,7 @@ class PAdmin : public QObject
void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; }
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; }
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; }
void setYamlOutFlag(const bool flag) { fYamlOut = flag; }
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; }
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; }
void setDarkThemeIconsToolbarFlag(const bool flag) { fDarkThemeIconsToolbar = flag; }
@ -205,6 +207,7 @@ class PAdmin : public QObject
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes).
bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
bool fYamlOut; ///< flag indicating if the MINUIT2.OUTPUT file should also be written as <msr-file>.yaml output. (default: no).
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
bool fDarkThemeIconsMenu; ///< flag indicating if dark theme icons shall be used in the menu (default: no)
bool fDarkThemeIconsToolbar; ///< flag indicating if dark theme icons shall be used in the toolbar (default: no)

View File

@ -84,6 +84,7 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he
fIgnoreDataHeaderInfo_checkBox->setChecked(fMsr2DataParam->ignoreDataHeaderInfo);
fKeepMinuit2Output_checkBox->setChecked(fMsr2DataParam->keepMinuit2Output);
fEstimateN0_checkBox->setChecked(fMsr2DataParam->estimateN0);
fYamlOut_checkBox->setChecked(fMsr2DataParam->yamlOut);
fWriteColumnData_checkBox->setChecked(fMsr2DataParam->writeColumnData);
fRecreateDataFile_checkBox->setChecked(fMsr2DataParam->recreateDbFile);
fChainFit_checkBox->setChecked(fMsr2DataParam->chainFit);
@ -121,6 +122,7 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
fMsr2DataParam->ignoreDataHeaderInfo = fIgnoreDataHeaderInfo_checkBox->isChecked();
fMsr2DataParam->keepMinuit2Output = fKeepMinuit2Output_checkBox->isChecked();
fMsr2DataParam->estimateN0 = fEstimateN0_checkBox->isChecked();
fMsr2DataParam->yamlOut = fYamlOut_checkBox->isChecked();
fMsr2DataParam->writeColumnData = fWriteColumnData_checkBox->isChecked();
fMsr2DataParam->recreateDbFile = fRecreateDataFile_checkBox->isChecked();
fMsr2DataParam->chainFit = fChainFit_checkBox->isChecked();

View File

@ -76,6 +76,7 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag());
fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag());
fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag());
fYamlOut_checkBox->setChecked(fAdmin->getYamlOutFlag());
fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag());
fAvg_checkBox->setChecked(fAdmin->getMusrviewShowAvgFlag());
fOneToOne_checkBox->setChecked(fAdmin->getMusrviewShowOneToOneFlag());

View File

@ -54,6 +54,7 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
bool getEnableMusrT0Flag() { return fEnableMusrT0_checkBox->isChecked(); }
bool getKeepRunPerBlockChisqFlag() { return fPerRunBlockChisq_checkBox->isChecked(); }
bool getEstimateN0Flag() { return fEstimateN0_checkBox->isChecked(); }
bool getYamlOutFlag() { return fYamlOut_checkBox->isChecked(); }
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu_checkBox->isChecked(); }
bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar_checkBox->isChecked(); }
bool getOneToOneFlag() { return fOneToOne_checkBox->isChecked(); }

View File

@ -125,6 +125,7 @@ PTextEdit::PTextEdit( QWidget *parent )
setupEditActions();
setupTextActions();
setupMusrActions();
setupJumpToBlock();
setupHelpActions();
fTabWidget = std::make_unique<QTabWidget>( this );
@ -958,6 +959,31 @@ void PTextEdit::setupHelpActions()
menu->addAction(a);
}
//----------------------------------------------------------------------------------------------------
/**
* <p>Setup the JumpToBlock actions.
*/
void PTextEdit::setupJumpToBlock()
{
QToolBar *tb = new QToolBar( this );
tb->setWindowTitle( "JumpToBlock Actions" );
addToolBar( tb );
QStringList jumpToBlockStr = {"FITPARAMETER", "THEORY", "FUNCTIONS", "GLOBAL", "RUN", "COMMANDS", "PLOT", "FOURIER", "STATISTIC"};
fJumpToBlock = std::make_unique<QComboBox>();
if (fJumpToBlock == nullptr)
return;
fJumpToBlock->addItems(jumpToBlockStr);
fJumpToBlock->setEditable(false);
connect( fJumpToBlock.get(), SIGNAL( activated(int) ), this, SLOT( jumpToBlock(int) ));
QLabel *jstr = new QLabel(" Jump to block: ");
tb->addWidget(jstr);
tb->addWidget(fJumpToBlock.get());
}
//----------------------------------------------------------------------------------------------------
/**
* <p>load a msr-file.
@ -974,6 +1000,7 @@ void PTextEdit::load( const QString &f, const int index )
// create a new text edit object
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
// place the text edit object at the appropriate tab position
if (index == -1)
@ -1016,7 +1043,7 @@ PSubTextEdit *PTextEdit::currentEditor() const
return nullptr;
if ( fTabWidget->currentWidget() ) {
if (fTabWidget->currentWidget()->inherits( "PSubTextEdit" )) {
if (fTabWidget->currentWidget()->inherits( "PSubTextEdit" )) {
return dynamic_cast<PSubTextEdit*>(fTabWidget->currentWidget());
}
}
@ -1158,6 +1185,7 @@ void PTextEdit::fileNew()
{
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
doConnections( edit );
fTabWidget->addTab( edit, tr( "noname" ) );
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
@ -2104,6 +2132,11 @@ void PTextEdit::musrFit()
cmd.append("--estimateN0");
}
// check yamlOut flag
if (fAdmin->getYamlOutFlag()) {
cmd.append("--yaml");
}
// check per-run-block-chisq flag
if (fAdmin->getChisqPerRunBlockFlag()) {
cmd.append("--per-run-block-chisq");
@ -2336,6 +2369,11 @@ void PTextEdit::musrMsr2Data()
cmd.append("-e");
}
// yaml out. Add flag only if a fit is done
if (fMsr2DataParam->yamlOut && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
cmd.append("-y");
}
// write per-run-block chisq. Add flag only if a fit is done
if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
cmd.append("-p");
@ -2719,6 +2757,7 @@ void PTextEdit::musrPrefs()
fAdmin->setTimeout(dlg->getTimeout());
fAdmin->setChisqPerRunBlockFlag(dlg->getKeepRunPerBlockChisqFlag());
fAdmin->setEstimateN0Flag(dlg->getEstimateN0Flag());
fAdmin->setYamlOutFlag(dlg->getYamlOutFlag());
}
delete dlg;
@ -3293,6 +3332,26 @@ void PTextEdit::setFileSystemWatcherActive()
fFileSystemWatcherActive = true;
}
//----------------------------------------------------------------------------------------------------
/**
* <p>slot called when jumpToBlock combobox is selected
* @param idx
*/
void PTextEdit::jumpToBlock(int idx)
{
QString str = fJumpToBlock->itemText(idx);
QTextDocument::FindFlags flags= QTextDocument::FindCaseSensitively | QTextDocument::FindWholeWords;
bool found = currentEditor()->find(str, flags);
if (found)
return;
// set cursor to start
currentEditor()->moveCursor(QTextCursor::Start);
currentEditor()->find(str, flags);
}
//----------------------------------------------------------------------------------------------------
/**
* @brief PTextEdit::getTheme

View File

@ -86,6 +86,7 @@ private:
void setupTextActions();
void setupMusrActions();
void setupHelpActions();
void setupJumpToBlock();
void load( const QString &f, const int index=-1 );
PSubTextEdit *currentEditor() const;
void doConnections( PSubTextEdit *e );
@ -167,6 +168,8 @@ private slots:
void fileChanged(const QString &fileName);
void setFileSystemWatcherActive();
void jumpToBlock(int idx);
private:
bool fDarkMenuIcon; ///< flag indicating if a dark or plain icon shall be used in the menu pull-downs
bool fDarkToolBarIcon; ///< flag indicating if a dark or plain icon shall be used in the toolbar
@ -187,6 +190,7 @@ private:
std::unique_ptr<QComboBox> fComboFont; ///< combo box for the font selector
std::unique_ptr<QComboBox> fComboSize; ///< combo box for the font size
bool fFontChanging; ///< flag needed to prevent some textChanged feature to occure when only the font changed
std::unique_ptr<QComboBox> fJumpToBlock; ///< combo box used to jump to the msr-file blocks
std::unique_ptr<QTabWidget> fTabWidget; ///< tab widget in which the text editor(s) are placed
QMap<PSubTextEdit*, QString> fFilenames; ///< mapper between tab widget object and filename

View File

@ -338,7 +338,7 @@
<x>6</x>
<y>20</y>
<width>560</width>
<height>131</height>
<height>135</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_9">
@ -456,6 +456,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fYamlOut_checkBox">
<property name="text">
<string>yaml out</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>

View File

@ -33,7 +33,7 @@
<item>
<widget class="QTabWidget" name="fTabWidget">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="fGeneral_tab">
<attribute name="title">
@ -152,9 +152,9 @@
<widget class="QCheckBox" name="fTitleFromData_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<x>170</x>
<y>10</y>
<width>241</width>
<width>161</width>
<height>23</height>
</rect>
</property>
@ -165,9 +165,9 @@
<widget class="QCheckBox" name="fPerRunBlockChisq_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<x>170</x>
<y>35</y>
<width>241</width>
<width>181</width>
<height>22</height>
</rect>
</property>
@ -178,9 +178,9 @@
<widget class="QCheckBox" name="fEstimateN0_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<x>170</x>
<y>60</y>
<width>241</width>
<width>171</width>
<height>22</height>
</rect>
</property>
@ -188,6 +188,19 @@
<string>estimate N0</string>
</property>
</widget>
<widget class="QCheckBox" name="fYamlOut_checkBox">
<property name="geometry">
<rect>
<x>350</x>
<y>10</y>
<width>85</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>yaml out</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrview_tab">
<attribute name="title">

View File

@ -56,6 +56,7 @@ struct PMsr2DataParam {
bool openFilesAfterFitting; ///< flag: true = open msr-file after fit in musredit. false = do not open msr-file after fit.
bool titleFromDataFile; ///< flag indicating if the title for the msr-file shall be extracted from the data-file ('-t' in msr2data)
bool estimateN0; ///< flag indicating if the N0 shall be estimated for single histogram fitting
bool yamlOut; ///< flag indicating if the MINUIT2.OUTPUT content should be written to <msr-file>.yaml
bool perRunBlockChisq; ///< flag indicating if per-run-block-chisq shall be dumped into the msr-file
bool createMsrFileOnly; ///< flag: true = just create the msr-files without any fitting ('msr-<template>' in msr2data)
bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).

View File

@ -14,6 +14,7 @@
<title_from_data_file>y</title_from_data_file>
<chisq_per_run_block>n</chisq_per_run_block>
<estimate_n0>y</estimate_n0>
<yaml_out>n</yaml_out>
<musrview_show_fourier>n</musrview_show_fourier>
<musrview_show_avg>n</musrview_show_avg>
<musrview_show_one_to_one>n</musrview_show_one_to_one>

View File

@ -645,12 +645,17 @@ PmuppCollection PParamDataHandler::ReadColumnParamFile(const QString fln, bool &
param.SetName(headerInfo[i]);
param.SetValue(dval);
if (i+1 < token.size()) {
if (headerCode[i+1] == PMUPP_VALUE) {
if ((headerCode[i+1] == PMUPP_VALUE) || (headerCode[i+1] == PMUPP_RUN)) {
param.SetNegErr(0.0);
param.SetPosErr(0.0);
run.AddParam(param);
param.ResetParam();
}
} else { // last token
param.SetNegErr(0.0);
param.SetPosErr(0.0);
run.AddParam(param);
param.ResetParam();
}
} else if (headerCode[i] == PMUPP_POSNEGERR) {
param.SetPosErr(dval);

View File

@ -973,7 +973,8 @@ void PmuppGui::refresh()
for (int i=0; i<fParamDataHandler->GetNoOfCollections(); i++) {
if (fParamDataHandler->GetCollection(i)->GetName() == label) { // found collection
pathName = fParamDataHandler->GetCollection(i)->GetPathName();
QDir dir(QDir::currentPath());
pathName = dir.path() + "/" + fParamDataHandler->GetCollection(i)->GetName();
collIdx = i;
break;
}

View File

@ -166,6 +166,8 @@ bool PAdminXMLParser::startElement()
fKeyWord = eDumpRoot;
} else if (qName == "estimate_n0") {
fKeyWord = eEstimateN0;
} else if (qName == "yaml_out") {
fKeyWord = eYamlOut;
} else if (qName == "chisq_per_run_block") {
fKeyWord = eChisqPreRunBlock;
} else if (qName == "path_file_name") {
@ -396,6 +398,13 @@ bool PAdminXMLParser::characters()
fAdmin->fMsr2DataParam.estimateN0 = flag;
fAdmin->setEstimateN0Flag(flag);
break;
case eYamlOut:
if (str == "y")
flag = true;
else
flag = false;
fAdmin->fMsr2DataParam.yamlOut = flag;
fAdmin->setYamlOutFlag(flag);
case eChisqPreRunBlock:
if (str == "y")
flag = true;
@ -615,6 +624,7 @@ void PAdminXMLParser::dump()
std::cout << "debug> title_from_data_file : " << fAdmin->getTitleFromDataFileFlag() << std::endl;
std::cout << "debug> chisq_per_run_block : " << fAdmin->getChisqPerRunBlockFlag() << std::endl;
std::cout << "debug> estimate_n0 : " << fAdmin->getEstimateN0Flag() << std::endl;
std::cout << "debug> yaml_out : " << fAdmin->getYamlOutFlag() << std::endl;
std::cout << "debug> musrview_show_fourier : " << fAdmin->getMusrviewShowFourierFlag() << std::endl;
std::cout << "debug> musrview_show_avg : " << fAdmin->getMusrviewShowAvgFlag() << std::endl;
std::cout << "debug> enable_musrt0 : " << fAdmin->getEnableMusrT0Flag() << std::endl;
@ -753,6 +763,7 @@ PAdmin::PAdmin() : QObject()
fEnableMusrT0 = false;
fLifetimeCorrection = true;
fEstimateN0 = true;
fYamlOut = false;
fChisqPreRunBlock = false;
fMsr2DataParam.runList = QString("");
@ -764,6 +775,7 @@ PAdmin::PAdmin() : QObject()
fMsr2DataParam.ignoreDataHeaderInfo = false;
fMsr2DataParam.keepMinuit2Output = false;
fMsr2DataParam.estimateN0 = fEstimateN0;
fMsr2DataParam.yamlOut = false;
fMsr2DataParam.writeColumnData = false;
fMsr2DataParam.recreateDbFile = false;
fMsr2DataParam.chainFit = true;
@ -995,6 +1007,12 @@ int PAdmin::savePrefs(QString pref_fln)
else
data[i] = " <estimate_n0>n</estimate_n0>";
}
if (data[i].contains("<yaml_out>") && data[i].contains("</yaml_out>")) {
if (fYamlOut)
data[i] = " <yaml_out>y</yaml_out>";
else
data[i] = " <yaml_out>n</yaml_out>";
}
if (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
if (fMusrviewShowFourier)
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";

View File

@ -71,7 +71,7 @@ class PAdminXMLParser
private:
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut,
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eEditW, eEditH,
eFontName, eFontSize, eExecPath, eDefaultSavePath,
@ -125,6 +125,7 @@ class PAdmin : public QObject
bool getMusrviewShowAvgFlag() { return fMusrviewShowAvg; }
bool getMusrviewShowOneToOneFlag() { return fMusrviewShowOneToOne; }
bool getEnableMusrT0Flag() { return fEnableMusrT0; }
bool getYamlOutFlag() { return fYamlOut; }
bool getKeepMinuit2OutputFlag() { return fKeepMinuit2Output; }
bool getDumpAsciiFlag() { return fDumpAscii; }
bool getDumpRootFlag() { return fDumpRoot; }
@ -157,6 +158,7 @@ class PAdmin : public QObject
void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; }
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; }
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; }
void setYamlOutFlag(const bool flag) { fYamlOut = flag; }
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; }
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; }
void setDarkThemeIconsToolbarFlag(const bool flag) { fDarkThemeIconsToolbar = flag; }
@ -205,6 +207,7 @@ class PAdmin : public QObject
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes).
bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no).
bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
bool fYamlOut; ///< flag indicating if the MINUIT2.OUTPUT file should also be written as <msr-file>.yaml output. (default: no).
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
bool fDarkThemeIconsMenu; ///< flag indicating if dark theme icons shall be used in the menu (default: no)
bool fDarkThemeIconsToolbar; ///< flag indicating if dark theme icons shall be used in the toolbar (default: no)

View File

@ -84,6 +84,7 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he
fIgnoreDataHeaderInfo_checkBox->setChecked(fMsr2DataParam->ignoreDataHeaderInfo);
fKeepMinuit2Output_checkBox->setChecked(fMsr2DataParam->keepMinuit2Output);
fEstimateN0_checkBox->setChecked(fMsr2DataParam->estimateN0);
fYamlOut_checkBox->setChecked(fMsr2DataParam->yamlOut);
fWriteColumnData_checkBox->setChecked(fMsr2DataParam->writeColumnData);
fRecreateDataFile_checkBox->setChecked(fMsr2DataParam->recreateDbFile);
fChainFit_checkBox->setChecked(fMsr2DataParam->chainFit);
@ -121,6 +122,7 @@ PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
fMsr2DataParam->ignoreDataHeaderInfo = fIgnoreDataHeaderInfo_checkBox->isChecked();
fMsr2DataParam->keepMinuit2Output = fKeepMinuit2Output_checkBox->isChecked();
fMsr2DataParam->estimateN0 = fEstimateN0_checkBox->isChecked();
fMsr2DataParam->yamlOut = fYamlOut_checkBox->isChecked();
fMsr2DataParam->writeColumnData = fWriteColumnData_checkBox->isChecked();
fMsr2DataParam->recreateDbFile = fRecreateDataFile_checkBox->isChecked();
fMsr2DataParam->chainFit = fChainFit_checkBox->isChecked();

View File

@ -76,6 +76,7 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag());
fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag());
fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag());
fYamlOut_checkBox->setChecked(fAdmin->getYamlOutFlag());
fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag());
fAvg_checkBox->setChecked(fAdmin->getMusrviewShowAvgFlag());
fOneToOne_checkBox->setChecked(fAdmin->getMusrviewShowOneToOneFlag());

View File

@ -54,6 +54,7 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog
bool getEnableMusrT0Flag() { return fEnableMusrT0_checkBox->isChecked(); }
bool getKeepRunPerBlockChisqFlag() { return fPerRunBlockChisq_checkBox->isChecked(); }
bool getEstimateN0Flag() { return fEstimateN0_checkBox->isChecked(); }
bool getYamlOutFlag() { return fYamlOut_checkBox->isChecked(); }
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu_checkBox->isChecked(); }
bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar_checkBox->isChecked(); }
bool getOneToOneFlag() { return fOneToOne_checkBox->isChecked(); }

View File

@ -127,6 +127,7 @@ PTextEdit::PTextEdit( QWidget *parent )
setupEditActions();
setupTextActions();
setupMusrActions();
setupJumpToBlock();
setupHelpActions();
fTabWidget = std::make_unique<QTabWidget>( this );
@ -965,6 +966,31 @@ void PTextEdit::setupHelpActions()
menu->addAction(a);
}
//----------------------------------------------------------------------------------------------------
/**
* <p>Setup the JumpToBlock actions.
*/
void PTextEdit::setupJumpToBlock()
{
QToolBar *tb = new QToolBar( this );
tb->setWindowTitle( "JumpToBlock Actions" );
addToolBar( tb );
QStringList jumpToBlockStr = {"FITPARAMETER", "THEORY", "FUNCTIONS", "GLOBAL", "RUN", "COMMANDS", "PLOT", "FOURIER", "STATISTIC"};
fJumpToBlock = std::make_unique<QComboBox>();
if (fJumpToBlock == nullptr)
return;
fJumpToBlock->addItems(jumpToBlockStr);
fJumpToBlock->setEditable(false);
connect( fJumpToBlock.get(), SIGNAL( activated(int) ), this, SLOT( jumpToBlock(int) ));
QLabel *jstr = new QLabel(" Jump to block: ");
tb->addWidget(jstr);
tb->addWidget(fJumpToBlock.get());
}
//----------------------------------------------------------------------------------------------------
/**
* <p>load a msr-file.
@ -981,6 +1007,7 @@ void PTextEdit::load( const QString &f, const int index )
// create a new text edit object
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
// place the text edit object at the appropriate tab position
if (index == -1)
@ -1165,6 +1192,8 @@ void PTextEdit::fileNew()
{
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
doConnections( edit );
fTabWidget->addTab( edit, tr( "noname" ) );
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
@ -2108,6 +2137,11 @@ void PTextEdit::musrFit()
cmd.append("--estimateN0");
}
// check yamlOut flag
if (fAdmin->getYamlOutFlag()) {
cmd.append("--yaml");
}
// check per-run-block-chisq flag
if (fAdmin->getChisqPerRunBlockFlag()) {
cmd.append("--per-run-block-chisq");
@ -2184,6 +2218,7 @@ void PTextEdit::musrMsr2Data()
fMsr2DataParam->keepMinuit2Output = fAdmin->getKeepMinuit2OutputFlag();
fMsr2DataParam->titleFromDataFile = fAdmin->getTitleFromDataFileFlag();
fMsr2DataParam->estimateN0 = fAdmin->getEstimateN0Flag();
fMsr2DataParam->yamlOut = fAdmin->getYamlOutFlag();
fMsr2DataParam->perRunBlockChisq = fAdmin->getChisqPerRunBlockFlag();
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
@ -2206,6 +2241,7 @@ void PTextEdit::musrMsr2Data()
fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output);
fAdmin->setTitleFromDataFileFlag(fMsr2DataParam->titleFromDataFile);
fAdmin->setEstimateN0Flag(fMsr2DataParam->estimateN0);
fAdmin->setYamlOutFlag(fMsr2DataParam->yamlOut);
fAdmin->setChisqPerRunBlockFlag(fMsr2DataParam->perRunBlockChisq);
// analyze parameters
@ -2336,6 +2372,11 @@ void PTextEdit::musrMsr2Data()
cmd.append("-e");
}
// yaml out. Add flag only if a fit is done
if (fMsr2DataParam->yamlOut && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
cmd.append("-y");
}
// write per-run-block chisq. Add flag only if a fit is done
if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
cmd.append("-p");
@ -2713,6 +2754,7 @@ void PTextEdit::musrPrefs()
fAdmin->setTimeout(dlg->getTimeout());
fAdmin->setChisqPerRunBlockFlag(dlg->getKeepRunPerBlockChisqFlag());
fAdmin->setEstimateN0Flag(dlg->getEstimateN0Flag());
fAdmin->setYamlOutFlag(dlg->getYamlOutFlag());
}
delete dlg;
@ -3278,6 +3320,26 @@ void PTextEdit::setFileSystemWatcherActive()
fFileSystemWatcherActive = true;
}
//----------------------------------------------------------------------------------------------------
/**
* <p>slot called when jumpToBlock combobox is selected
* @param idx
*/
void PTextEdit::jumpToBlock(int idx)
{
QString str = fJumpToBlock->itemText(idx);
QTextDocument::FindFlags flags= QTextDocument::FindCaseSensitively | QTextDocument::FindWholeWords;
bool found = currentEditor()->find(str, flags);
if (found)
return;
// set cursor to start
currentEditor()->moveCursor(QTextCursor::Start);
currentEditor()->find(str, flags);
}
//----------------------------------------------------------------------------------------------------
/**
* @brief PTextEdit::getTheme

View File

@ -86,6 +86,7 @@ private:
void setupTextActions();
void setupMusrActions();
void setupHelpActions();
void setupJumpToBlock();
void load( const QString &f, const int index=-1 );
PSubTextEdit *currentEditor() const;
void doConnections( PSubTextEdit *e );
@ -167,6 +168,8 @@ private slots:
void fileChanged(const QString &fileName);
void setFileSystemWatcherActive();
void jumpToBlock(int idx);
private:
bool fDarkMenuIcon; ///< flag indicating if a dark or plain icon shall be used in the menu pull-downs
bool fDarkToolBarIcon; ///< flag indicating if a dark or plain icon shall be used in the toolbar
@ -187,6 +190,7 @@ private:
std::unique_ptr<QComboBox> fComboFont; ///< combo box for the font selector
std::unique_ptr<QComboBox> fComboSize; ///< combo box for the font size
bool fFontChanging; ///< flag needed to prevent some textChanged feature to occure when only the font changed
std::unique_ptr<QComboBox> fJumpToBlock; ///< combo box used to jump to the msr-file blocks
std::unique_ptr<QTabWidget> fTabWidget; ///< tab widget in which the text editor(s) are placed
QMap<PSubTextEdit*, QString> fFilenames; ///< mapper between tab widget object and filename

View File

@ -338,7 +338,7 @@
<x>6</x>
<y>20</y>
<width>560</width>
<height>131</height>
<height>135</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_9">
@ -456,6 +456,13 @@
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fYamlOut_checkBox">
<property name="text">
<string>yaml out</string>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_8">
<item>

View File

@ -33,7 +33,7 @@
<item>
<widget class="QTabWidget" name="fTabWidget">
<property name="currentIndex">
<number>2</number>
<number>1</number>
</property>
<widget class="QWidget" name="fGeneral_tab">
<attribute name="title">
@ -152,9 +152,9 @@
<widget class="QCheckBox" name="fTitleFromData_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<x>170</x>
<y>10</y>
<width>241</width>
<width>171</width>
<height>23</height>
</rect>
</property>
@ -165,7 +165,7 @@
<widget class="QCheckBox" name="fPerRunBlockChisq_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<x>170</x>
<y>35</y>
<width>241</width>
<height>22</height>
@ -178,9 +178,9 @@
<widget class="QCheckBox" name="fEstimateN0_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<x>170</x>
<y>60</y>
<width>241</width>
<width>101</width>
<height>22</height>
</rect>
</property>
@ -188,6 +188,19 @@
<string>estimate N0</string>
</property>
</widget>
<widget class="QCheckBox" name="fYamlOut_checkBox">
<property name="geometry">
<rect>
<x>360</x>
<y>10</y>
<width>85</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>yaml out</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrview_tab">
<attribute name="title">

View File

@ -56,6 +56,7 @@ struct PMsr2DataParam {
bool openFilesAfterFitting; ///< flag: true = open msr-file after fit in musredit. false = do not open msr-file after fit.
bool titleFromDataFile; ///< flag indicating if the title for the msr-file shall be extracted from the data-file ('-t' in msr2data)
bool estimateN0; ///< flag indicating if the N0 shall be estimated for single histogram fitting
bool yamlOut; ///< flag indicating if the MINUIT2.OUTPUT content should be written to <msr-file>.yaml
bool perRunBlockChisq; ///< flag indicating if per-run-block-chisq shall be dumped into the msr-file
bool createMsrFileOnly; ///< flag: true = just create the msr-files without any fitting ('msr-<template>' in msr2data)
bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).

View File

@ -14,6 +14,7 @@
<title_from_data_file>y</title_from_data_file>
<chisq_per_run_block>n</chisq_per_run_block>
<estimate_n0>y</estimate_n0>
<yaml_out>n</yaml_out>
<musrview_show_fourier>n</musrview_show_fourier>
<musrview_show_avg>n</musrview_show_avg>
<musrview_show_one_to_one>n</musrview_show_one_to_one>

View File

@ -127,6 +127,7 @@ void musrfit_syntax()
std::cout << std::endl << " (ii) if present under $HOME/.musrfit/";
std::cout << std::endl << " (iii) if present under $MUSRFITPATH/";
std::cout << std::endl << " (iv) if present under $ROOTSYS/";
std::cout << std::endl << " -y, --yaml: write fit results (MINUIT2.OUTPUT) into a yaml-file. Output <msr-file>.yaml";
std::cout << std::endl << " --dump <type> is writing a data file with the fit data and the theory";
std::cout << std::endl << " <type> can be 'ascii', 'root'";
std::cout << std::endl << " --timeout <timeout_tag>: overwrites to predefined timeout of " << timeout << " (sec).";
@ -446,6 +447,7 @@ int main(int argc, char *argv[])
int status;
bool keep_mn2_output = false;
bool chisq_only = false;
bool yaml_out = false;
bool title_from_data_file = false;
bool timeout_enabled = true;
bool reset_startup_file = false;
@ -532,6 +534,8 @@ int main(int argc, char *argv[])
startup_options.estimateN0 = true;
} else if (!strcmp(argv[i], "-p") || !strcmp(argv[i], "--per-run-block-chisq")) {
startup_options.writeExpectedChisq = true;
} else if (!strcmp(argv[i], "-y") || !strcmp(argv[i], "--yaml")) {
yaml_out = true;
} else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--no-of-cores-avail")) {
#ifdef HAVE_GOMP
std::cout << std::endl;
@ -724,7 +728,7 @@ int main(int argc, char *argv[])
// do fitting
std::unique_ptr<PFitter> fitter;
if (success) {
fitter = std::make_unique<PFitter>(msrHandler.get(), runListCollection.get(), chisq_only);
fitter = std::make_unique<PFitter>(msrHandler.get(), runListCollection.get(), chisq_only, yaml_out);
if (fitter->IsValid()) {
fitter->DoFit();
if (!fitter->IsScanOnly())

View File

@ -37,6 +37,7 @@
#include <iostream>
#include <memory>
#include <vector>
#include <TApplication.h>
#include <TSAXParser.h>
@ -301,15 +302,15 @@ int main(int argc, char *argv[])
}
if (result == PMUSR_SUCCESS) {
// generate Root application needed for PMusrCanvas
int cc=0;
char **arg;
// create the ROOT application needed for PMusrCanvas
// and pass it only essential arguments
std::vector<char*> args;
args.push_back(argv[0]); // program name
if (graphicsOutput || asciiOutput) {
arg[cc] = (char*)malloc(16*sizeof(char));
strcpy(arg[cc], "-b");
cc++;
args.push_back((char*)"-b"); // batch mode flag
}
TApplication app("App", &cc, arg);
int cc = args.size();
TApplication app("App", &cc, args.data());
std::vector<PMusrCanvas*> canvasVector;
PMusrCanvas *musrCanvas;