36 Commits

Author SHA1 Message Date
ebdb0feb7f path-run-name in RUN block of the msr-file can now handle spaces. 2025-01-18 13:35:08 +01:00
e67d92fc05 Merged in mnstrategy (pull request #19)
Explicit passing of MnStrategy during minimizer initialization

Approved-by: Suter Andreas
2025-01-10 10:00:30 +00:00
ead1674b13 Explicit passing of MnStrategy during minimizer initialization
This patch fixes compilation errors that arise with recent ROOT versions (e.g., 6.34.02),
which require a ROOT::Minuit2::MnStrategy object to be passed when initializing the
ROOT::Minuit2::MnX (X = Migrad, Simplex, Minimize) minimizers (i.e., instead of the integer
representing the "strategy").
2025-01-09 11:38:33 -08:00
fd22884ce8 slightly re-ordered the default files for mupp in the open dialog. 2024-12-16 07:41:24 +01:00
20dd08fbef changed default ROOT color kGreen to kGreen+2. 2024-12-14 14:54:17 +01:00
3e66760c26 adopted for custom button handling qt5. 2024-12-11 14:06:32 +01:00
d6bcdf52b8 adopted for custom button handling. 2024-12-11 13:58:11 +01:00
30bd2b2876 added missing enum tag. 2024-12-11 09:36:57 +01:00
9f8f89db6d make the theme handling in musredit more flexible. At the same time adopted some part to more modern c++. 2024-12-11 09:25:28 +01:00
458913ca31 update of the ChangeLog 2024-12-03 18:13:02 +01:00
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
69 changed files with 1374 additions and 863 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 # - musrfit
cmake_minimum_required(VERSION 3.17) cmake_minimum_required(VERSION 3.17)
project(musrfit VERSION 1.9.3 LANGUAGES C CXX) project(musrfit VERSION 1.9.7 LANGUAGES C CXX)
#--- musrfit specific options ------------------------------------------------- #--- musrfit specific options -------------------------------------------------
option(nexus "build optional NeXus support. Needed for ISIS" OFF) option(nexus "build optional NeXus support. Needed for ISIS" OFF)
@ -249,6 +249,8 @@ set(CMAKE_INSTALL_RPATH "${rpath}")
add_subdirectory(src) add_subdirectory(src)
#--- write summary of the installation #--- write summary of the installation
cmake_host_system_information(RESULT PROCESSOR QUERY PROCESSOR_DESCRIPTION)
message("") message("")
message("|-----------------------------------------------------------------------|") message("|-----------------------------------------------------------------------|")
message("| |") message("| |")
@ -256,8 +258,9 @@ message("| Summary
message("| |") message("| |")
message("|-----------------------------------------------------------------------|") message("|-----------------------------------------------------------------------|")
message("") message("")
message(" System: ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} - ${CMAKE_HOST_SYSTEM_VERSION}") message(" System: ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} - ${CMAKE_HOST_SYSTEM_VERSION}")
message(" -------") message(" Processor: ${PROCESSOR} (${CMAKE_SYSTEM_PROCESSOR})")
message(" ----------")
message("") message("")
message(" musrfit Version: ${musrfit_VERSION}") message(" musrfit Version: ${musrfit_VERSION}")
message(" ----------------") message(" ----------------")

View File

@ -12,6 +12,27 @@ or
https://bitbucket.org/muonspin/musrfit/commits/all https://bitbucket.org/muonspin/musrfit/commits/all
Release of V1.9.7, 2025/01/18
=============================
allow spaces in RUN block path-filename
Release of V1.9.6, 2024/12/02
=============================
added jump to block feature in musredit.
Release of V1.9.5, 2024/06/24
=============================
yaml export of ALL fit-parameters, as initiated by R.M.L. McFadden.
Release of V1.9.4, 2024/06/08
=============================
enable OpenMP for macOS.
Release of V1.9.3, 2024/04/19 Release of V1.9.3, 2024/04/19
============================= =============================

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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"> <div role="contentinfo">
<p> <p>
&copy; Copyright 2023, Andreas Suter. &copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024. Last updated on Jun 24, 2024.
</p> </p>
</div> </div>
@ -525,7 +525,7 @@ Between detectors, there will be an empty line.</p>
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'1.9.3', VERSION:'1.9.5',
LANGUAGE:'None', LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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"> <div role="contentinfo">
<p> <p>
&copy; Copyright 2023, Andreas Suter. &copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024. Last updated on Jun 24, 2024.
</p> </p>
</div> </div>
@ -207,7 +207,7 @@
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'1.9.3', VERSION:'1.9.5',
LANGUAGE:'None', LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', 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"> <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"> <div role="contentinfo">
<p> <p>
&copy; Copyright 2023, Andreas Suter. &copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024. Last updated on Jun 24, 2024.
</p> </p>
</div> </div>
@ -430,7 +430,7 @@ The only thing you need <code class="docutils literal notranslate"><span class="
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'1.9.3', VERSION:'1.9.5',
LANGUAGE:'None', LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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> <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"> <dl class="docutils" id="index-11">
<dt><strong>Qt</strong></dt> <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> </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> <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> </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> <p>Before the installation procedure will be described, please note the following restrictions:</p>
<dl class="docutils"> <dl class="docutils">
<dt><strong>GNU/Linux</strong></dt> <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>, <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>, <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>
and <cite>manjaro &lt;https://de.manjaro.org/&gt;</cite>.</dd>
<dt><strong>Mac OS X/macOS</strong></dt> <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> <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> <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> <p>For <strong>Qt5/Qt6</strong>:</p>
<blockquote> <blockquote>
<div><div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ yum install epel-release <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> </pre></div>
</div> </div>
</div></blockquote> </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> <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> the installation would look like:</p>
<p>For <strong>Qt4</strong> (deprecated):</p> <p>For <strong>Qt4</strong> (deprecated):</p>
@ -322,11 +321,11 @@ the installation would look like:</p>
</div></blockquote> </div></blockquote>
<p>For <strong>Qt5/Qt6</strong>:</p> <p>For <strong>Qt5/Qt6</strong>:</p>
<blockquote> <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> </pre></div>
</div> </div>
</div></blockquote> </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>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 <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> 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 $ <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 -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 $ 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> $ <span class="c1"># install needs either to be carried out as root or sudo depending on your linux flavour.</span>
$ sudo make install $ sudo cmake --install ./
</pre></div> </pre></div>
</div> </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> $ <span class="c1"># e.g. cmake --build ./ --clean-first -- -j8</span>
$ cmake --build ./ --clean-first $ cmake --build ./ --clean-first
$ <span class="c1"># as a last step of the ROOT build process we need to install it</span> $ <span class="c1"># as a last step of the ROOT build process we need to install it</span>
$ make install $ cmake --install ./
</pre></div> </pre></div>
</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> <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 $ <span class="nb">cd</span> build
$ xargs rm &lt; install_manifest.txt $ xargs rm &lt; install_manifest.txt
$ cmake --build ./ --clean-first $ cmake --build ./ --clean-first
$ make install $ cmake --install ./
</pre></div> </pre></div>
</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> <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> $ 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> <span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8 $ cmake --build ./ --clean-first -- -j8
$ make install $ cmake --install ./
$ /sbin/ldconfig <span class="c1"># (as superuser)</span> $ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div> </pre></div>
</div> </div>
@ -657,7 +656,7 @@ add a new line pointing to your local copy, <em>e.g.</em></p>
</ol> </ol>
<p>Then the MacPorts system should be set up and can be used to install additional software.</p> <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> <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> </pre></div>
</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, <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 <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ sudo port -v install hdf4 hdf5
</pre></div> </pre></div>
</div> </div>
<p><em>hdf4</em> is likely not available anymore.</p>
<p><strong>Only NeXus Version ≥ 4.4 is support!</strong></p> <p><strong>Only NeXus Version ≥ 4.4 is support!</strong></p>
<p>To get things compiled do:</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> <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 $ <span class="nb">cd</span> nexus
$ mkdir build $ mkdir build
$ <span class="nb">cd</span> 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 $ 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 $ <span class="c1"># in case hdf4 is **not** present</span>
$ sudo make install $ 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> </pre></div>
</div> </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> $ <span class="c1"># e.g. make -j8</span>
$ cmake --build ./ --clean-first -- -j8 $ cmake --build ./ --clean-first -- -j8
$ <span class="c1"># make will take quite a while</span> $ <span class="c1"># make will take quite a while</span>
$ make install $ cmake --install ./
</pre></div> </pre></div>
</div> </div>
<p>For further details see <a class="reference external" href="https://root.cern.ch/building-root">Installing ROOT from Source</a>.</p> <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> </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>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> <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> </pre></div>
</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 <div class="highlight-bash notranslate"><div class="highlight"><pre><span></span>$ brew install cmake
</pre></div> </pre></div>
</div> </div>
@ -842,7 +846,7 @@ $ mkdir build
$ <span class="nb">cd</span> 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 ../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 $ cmake --build ./ --clean-first -- -j8
$ sudo make install $ sudo cmake --install ./
</pre></div> </pre></div>
</div> </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> $ <span class="c1"># e.g. make -j8</span>
$ cmake --build ./ --clean-first -- -j8 $ cmake --build ./ --clean-first -- -j8
$ <span class="c1"># make will take quite a while</span> $ <span class="c1"># make will take quite a while</span>
$ make install $ cmake --install ./
</pre></div> </pre></div>
</div> </div>
<p>For further details see <a class="reference external" href="https://root.cern.ch/building-root">Installing ROOT from Source</a>.</p> <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> <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> </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>. <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> <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 <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 $ 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> $ 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> <span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8 $ 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> $ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div> </pre></div>
</div> </div>
@ -1095,7 +1125,7 @@ $ musrview test-histo-ROOT-NPP.msr
<div role="contentinfo"> <div role="contentinfo">
<p> <p>
&copy; Copyright 2023, Andreas Suter. &copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024. Last updated on Jun 24, 2024.
</p> </p>
</div> </div>
@ -1117,7 +1147,7 @@ $ musrview test-histo-ROOT-NPP.msr
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'1.9.3', VERSION:'1.9.5',
LANGUAGE:'None', LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',

View File

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

View File

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

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0"> <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> <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. <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> 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> <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> <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> <dt><strong>timeout &lt;timeout_tag&gt;</strong></dt>
@ -2874,7 +2894,7 @@ The syntax here is attribute driven</li>
<div role="contentinfo"> <div role="contentinfo">
<p> <p>
&copy; Copyright 2023, Andreas Suter. &copy; Copyright 2023, Andreas Suter.
Last updated on Apr 23, 2024. Last updated on Jun 24, 2024.
</p> </p>
</div> </div>
@ -2896,7 +2916,7 @@ The syntax here is attribute driven</li>
<script type="text/javascript"> <script type="text/javascript">
var DOCUMENTATION_OPTIONS = { var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./', URL_ROOT:'./',
VERSION:'1.9.3', VERSION:'1.9.5',
LANGUAGE:'None', LANGUAGE:'None',
COLLAPSE_INDEX:false, COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html', FILE_SUFFIX:'.html',

View File

@ -39,9 +39,10 @@
#include <iomanip> #include <iomanip>
#include <fstream> #include <fstream>
#include <limits> #include <limits>
#include <cmath> #include <cmath>
#include <boost/variant/variant.hpp>
#include <sys/time.h> #include <sys/time.h>
#include "Minuit2/FunctionMinimum.h" #include "Minuit2/FunctionMinimum.h"
@ -54,6 +55,7 @@
#include "Minuit2/MnPrint.h" #include "Minuit2/MnPrint.h"
#include "Minuit2/MnScan.h" #include "Minuit2/MnScan.h"
#include "Minuit2/MnSimplex.h" #include "Minuit2/MnSimplex.h"
#include "Minuit2/MnStrategy.h"
#include "Minuit2/MnUserParameterState.h" #include "Minuit2/MnUserParameterState.h"
#include "Minuit2/MinosError.h" #include "Minuit2/MinosError.h"
@ -264,8 +266,8 @@ UInt_t PSectorChisq::GetNDF(UInt_t idx)
* \param runListCollection pointer of the run list collection (pre-processed historgrams) * \param runListCollection pointer of the run list collection (pre-processed historgrams)
* \param chisq_only flag: true=calculate chisq only (no fitting) * \param chisq_only flag: true=calculate chisq only (no fitting)
*/ */
PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bool_t chisq_only) : PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bool_t chisq_only, Bool_t yaml_out) :
fChisqOnly(chisq_only), fRunInfo(runInfo), fRunListCollection(runListCollection) fChisqOnly(chisq_only), fYamlOut(yaml_out), fRunInfo(runInfo), fRunListCollection(runListCollection)
{ {
// initialize variables // initialize variables
fIsScanOnly = true; fIsScanOnly = true;
@ -1762,7 +1764,7 @@ Bool_t PFitter::ExecuteMigrad()
// create migrad object // create migrad object
// strategy is by default = 'default' // strategy is by default = 'default'
ROOT::Minuit2::MnMigrad migrad((*fFitterFcn), fMnUserParams, fStrategy); ROOT::Minuit2::MnMigrad migrad((*fFitterFcn), fMnUserParams, ROOT::Minuit2::MnStrategy{fStrategy});
// minimize // minimize
// maxfcn is MINUIT2 Default maxfcn // maxfcn is MINUIT2 Default maxfcn
@ -1838,7 +1840,7 @@ Bool_t PFitter::ExecuteMinimize()
// create minimizer object // create minimizer object
// strategy is by default = 'default' // strategy is by default = 'default'
ROOT::Minuit2::MnMinimize minimize((*fFitterFcn), fMnUserParams, fStrategy); ROOT::Minuit2::MnMinimize minimize((*fFitterFcn), fMnUserParams, ROOT::Minuit2::MnStrategy{fStrategy});
// minimize // minimize
// maxfcn is MINUIT2 Default maxfcn // maxfcn is MINUIT2 Default maxfcn
@ -2473,6 +2475,122 @@ Bool_t PFitter::ExecuteSave(Bool_t firstSave)
ccorr->Write("ccorr", TObject::kOverwrite, sizeof(ccorr)); ccorr->Write("ccorr", TObject::kOverwrite, sizeof(ccorr));
hcorr->Write("hcorr", TObject::kOverwrite, sizeof(hcorr)); hcorr->Write("hcorr", TObject::kOverwrite, sizeof(hcorr));
ff.Close(); 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 parNo.clear(); // clean up
} else { } else {
@ -2539,7 +2657,7 @@ Bool_t PFitter::ExecuteSimplex()
// create minimizer object // create minimizer object
// strategy is by default = 'default' // strategy is by default = 'default'
ROOT::Minuit2::MnSimplex simplex((*fFitterFcn), fMnUserParams, fStrategy); ROOT::Minuit2::MnSimplex simplex((*fFitterFcn), fMnUserParams, ROOT::Minuit2::MnStrategy{fStrategy});
// minimize // minimize
// maxfcn is 10*MINUIT2 Default maxfcn // maxfcn is 10*MINUIT2 Default maxfcn

View File

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

View File

@ -140,29 +140,32 @@ int PMsr2Data::DetermineRunNumberDigits(unsigned int runNo, bool normalMode) con
strLine.str(line); strLine.str(line);
strLine >> firstOnLine; strLine >> firstOnLine;
if (!to_lower_copy(firstOnLine).compare("run")) { if (!to_lower_copy(firstOnLine).compare("run")) {
firstOnLine.clear(); // for path-names with spaces
strLine >> firstOnLine; std::string::size_type loc{0};
std::string::size_type loc = firstOnLine.rfind(tempRunNumber.str()); while (!strLine.eof()) {
if ( loc != std::string::npos ) { firstOnLine.clear();
while ( loc > 0 ) { strLine >> firstOnLine;
if (isdigit(firstOnLine.at(--loc))) { loc = firstOnLine.rfind(tempRunNumber.str());
++fRunNumberDigits; if ( loc != std::string::npos ) {
} else { while ( loc > 0 ) {
break; if (isdigit(firstOnLine.at(--loc))) {
++fRunNumberDigits;
} else {
break;
}
} }
in->close();
fRunVectorIter = fRunVector.begin(); // set back the runlist-iterator which might have changed during the search for the correct file
return 0;
} }
in->close();
fRunVectorIter = fRunVector.begin(); // set back the runlist-iterator which might have changed during the search for the correct file
return 0;
} else {
std::cerr << std::endl << ">> msr2data: **ERROR** The first processed run file number does not match the \"file index\"!";
std::cerr << std::endl << ">> msr2data: **ERROR** The number of digits to be used for formatting the run numbers cannot be determined!";
std::cerr << std::endl << ">> msr2data: **ERROR** Please check the first msr-file that should be processed;";
std::cerr << std::endl << ">> msr2data: **ERROR** this is either some template or the first existing file from the run list.";
std::cerr << std::endl;
in->close();
return -2;
} }
std::cerr << std::endl << ">> msr2data: **ERROR** The first processed run file number does not match the \"file index\"!";
std::cerr << std::endl << ">> msr2data: **ERROR** The number of digits to be used for formatting the run numbers cannot be determined!";
std::cerr << std::endl << ">> msr2data: **ERROR** Please check the first msr-file that should be processed;";
std::cerr << std::endl << ">> msr2data: **ERROR** this is either some template or the first existing file from the run list.";
std::cerr << std::endl;
in->close();
return -2;
} }
} }
std::cerr << std::endl << ">> msr2data: **ERROR** Please check the first msr-file that should be processed;"; std::cerr << std::endl << ">> msr2data: **ERROR** Please check the first msr-file that should be processed;";
@ -558,11 +561,23 @@ bool PMsr2Data::PrepareNewInputFile(unsigned int tempRun, bool calledFromGlobalM
strLine.str(line); strLine.str(line);
strLine >> firstOnLine; strLine >> firstOnLine;
if (!to_lower_copy(firstOnLine).compare("run")) { if (!to_lower_copy(firstOnLine).compare("run")) {
strLine >> firstOnLine; // needed for path-fln with spaces
std::string::size_type loc = firstOnLine.rfind(tempRunNumber.str()); std::string::size_type loc;
if ( loc != std::string::npos ) { std::string sstr{""};
firstOnLine.replace(loc, fRunNumberDigits, newRunNumber.str()); firstOnLine.clear();
} else { while (!strLine.eof()) {
strLine >> sstr;
if (firstOnLine.empty())
firstOnLine = sstr;
else
firstOnLine += " " + sstr;
loc = firstOnLine.rfind(tempRunNumber.str());
if ( loc != std::string::npos ) {
firstOnLine.replace(loc, fRunNumberDigits, newRunNumber.str());
break;
}
}
if (strLine.eof()) {
std::cerr << std::endl << ">> msr2data: **WARNING** The template run file number does not match the \"file index\""; std::cerr << std::endl << ">> msr2data: **WARNING** The template run file number does not match the \"file index\"";
std::cerr << std::endl << ">> msr2data: **WARNING** Unexpected things will happen... (for sure)"; std::cerr << std::endl << ">> msr2data: **WARNING** Unexpected things will happen... (for sure)";
std::cerr << std::endl; std::cerr << std::endl;
@ -694,9 +709,16 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
msrParamList->at(i).fIsGlobal = true; msrParamList->at(i).fIsGlobal = true;
++fNumGlobalParam; ++fNumGlobalParam;
} }
// 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 // check if parameters have been sorted correctly from the beginning
bool wasSorted(true); bool wasSorted(true);
for (unsigned int i(0); i < fNumGlobalParam; ++i) { for (unsigned int i(0); i < fNumGlobalParam; ++i) {
@ -1793,6 +1815,9 @@ int PMsr2Data::WriteOutput(const std::string &outfile, const std::vector<unsigne
rawRunData = fDataHandler->GetRunData((*msrRunList)[0].GetRunName()->Data()); rawRunData = fDataHandler->GetRunData((*msrRunList)[0].GetRunName()->Data());
} }
if (rawRunData == nullptr)
return -1;
switch (rawRunData->GetNoOfTemperatures()) { switch (rawRunData->GetNoOfTemperatures()) {
case 1: case 1:
dataParamNames.push_back("dataT"); dataParamNames.push_back("dataT");

View File

@ -3244,7 +3244,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
while ((iter != lines.end()) && !error) { while ((iter != lines.end()) && !error) {
// remove potential comment at the end of lines // remove potential comment at the end of lines
str = iter->fLine; str = iter->fLine;
Ssiz_t idx = str.Index("#"); Ssiz_t idx = str.Index("(");
if (idx != -1) if (idx != -1)
str.Remove(idx); str.Remove(idx);
@ -3274,23 +3274,29 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
} }
// get run name, beamline, institute, and file-format // get run name, beamline, institute, and file-format
// the path/filename could potentially contain spaces! Hence the run name needs to be reconstructed from the parsing
if (tokens->GetEntries() < 5) { if (tokens->GetEntries() < 5) {
error = true; error = true;
} else { } else {
// run name // run name
ostr = dynamic_cast<TObjString*>(tokens->At(1)); str = TString("");
str = ostr->GetString(); for (Int_t i=1; i<tokens->GetEntries()-3; i++) {
ostr = dynamic_cast<TObjString*>(tokens->At(i));
str += ostr->GetString();
if (i<tokens->GetEntries()-4)
str += TString(" ");
}
param.SetRunName(str); param.SetRunName(str);
// beamline // beamline
ostr = dynamic_cast<TObjString*>(tokens->At(2)); ostr = dynamic_cast<TObjString*>(tokens->At(tokens->GetEntries()-3));
str = ostr->GetString(); str = ostr->GetString();
param.SetBeamline(str); param.SetBeamline(str);
// institute // institute
ostr = dynamic_cast<TObjString*>(tokens->At(3)); ostr = dynamic_cast<TObjString*>(tokens->At(tokens->GetEntries()-2));
str = ostr->GetString(); str = ostr->GetString();
param.SetInstitute(str); param.SetInstitute(str);
// data file format // data file format
ostr = dynamic_cast<TObjString*>(tokens->At(4)); ostr = dynamic_cast<TObjString*>(tokens->At(tokens->GetEntries()-1));
str = ostr->GetString(); str = ostr->GetString();
param.SetFileFormat(str); param.SetFileFormat(str);
} }

View File

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

View File

@ -3697,6 +3697,8 @@ Bool_t PRunDataHandler::ReadAsciiFile()
{ {
Bool_t success = true; Bool_t success = true;
std::cout << "as35> in ReadAsciiFile() ..." << std::endl;
// open file // open file
std::ifstream f; std::ifstream f;
@ -3848,7 +3850,14 @@ Bool_t PRunDataHandler::ReadAsciiFile()
break; break;
} }
ey = ostr->GetString().Atof(); 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 { } 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; ey = 1.0;
} }
@ -4357,7 +4366,7 @@ Bool_t PRunDataHandler::ReadDatFile()
// open file // open file
std::ifstream f; std::ifstream f;
// open db-file // open dat-file
f.open(fRunPathName.Data(), std::ifstream::in); f.open(fRunPathName.Data(), std::ifstream::in);
if (!f.is_open()) { if (!f.is_open()) {
std::cerr << std::endl << ">> PRunDataHandler::ReadDatFile **ERROR** Couldn't open data file (" << fRunPathName.Data() << ") for reading, sorry ..."; 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++; idx++;
} else { // error value } else { // error value
if (isData[i-1] == 1) { // Err or PosErr hence keep it 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); runData.fDataNonMusr.AppendSubErrData(idx-1, dval);
} }
} }
@ -4470,11 +4485,11 @@ Bool_t PRunDataHandler::ReadDatFile()
f.close(); 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++) { for (UInt_t i=0; i<noOfDataSets; i++) {
if (runData.fDataNonMusr.GetErrData()->at(i).size() == 0) { if (runData.fDataNonMusr.GetErrData()->at(i).size() == 0) {
for (UInt_t j=0; j<runData.fDataNonMusr.GetData()->at(i).size(); j++) { 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

@ -765,7 +765,7 @@ Bool_t PStartupHandler::WriteDefaultStartupFile(bool reset_startup_file)
fout << " <!-- Color as RGB coded string -->" << std::endl; fout << " <!-- Color as RGB coded string -->" << std::endl;
fout << " <color>0,0,0</color> <!-- kBlack -->" << std::endl; fout << " <color>0,0,0</color> <!-- kBlack -->" << std::endl;
fout << " <color>255,0,0</color> <!-- kRed -->" << std::endl; fout << " <color>255,0,0</color> <!-- kRed -->" << std::endl;
fout << " <color>0,255,0</color> <!-- kGreen -->" << std::endl; fout << " <color>0,153,0</color> <!-- kGreen+2 -->" << std::endl;
fout << " <color>0,0,255</color> <!-- kBlue -->" << std::endl; fout << " <color>0,0,255</color> <!-- kBlue -->" << std::endl;
fout << " <color>255,0,255</color> <!-- kMagenta -->" << std::endl; fout << " <color>255,0,255</color> <!-- kMagenta -->" << std::endl;
fout << " <color>0,255,255</color> <!-- kCyan -->" << std::endl; fout << " <color>0,255,255</color> <!-- kCyan -->" << std::endl;

View File

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

View File

@ -111,7 +111,7 @@ class PSectorChisq
class PFitter class PFitter
{ {
public: 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(); virtual ~PFitter();
Bool_t IsValid() { return fIsValid; } Bool_t IsValid() { return fIsValid; }
@ -124,6 +124,7 @@ class PFitter
Bool_t fIsScanOnly; ///< flag. true: scan along some parameters (no fitting). Bool_t fIsScanOnly; ///< flag. true: scan along some parameters (no fitting).
Bool_t fConverged; ///< flag. true: the fit has converged. Bool_t fConverged; ///< flag. true: the fit has converged.
Bool_t fChisqOnly; ///< flag. true: calculate chi^2 only (no fitting). 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 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 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_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 ] ) ]; 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 << " -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 << " -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 << " -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 << " -p, --per-run-block-chisq: will per run block chisq to the msr-file.";
std::cout << std::endl; std::cout << std::endl;
std::cout << std::endl << " global : switch on the global-fit mode"; 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->substr(0,3).compare("fit")) || (!iter->compare("-k")) || (!iter->compare("--keep-mn2-output")) \
|| (!iter->compare("-t")) || (!iter->compare("--title-from-data-file")) \ || (!iter->compare("-t")) || (!iter->compare("--title-from-data-file")) \
|| (!iter->compare("-e")) || (!iter->compare("--estimateN0")) \ || (!iter->compare("-e")) || (!iter->compare("--estimateN0")) \
|| (!iter->compare("-y") || (!iter->compare("--yaml"))) \
|| (!iter->compare("-p")) || (!iter->compare("--per-run-block-chisq")) \ || (!iter->compare("-p")) || (!iter->compare("--per-run-block-chisq")) \
|| (!iter->compare("data")) || (!iter->substr(0,4).compare("msr-")) || (!iter->compare("global")) \ || (!iter->compare("data")) || (!iter->substr(0,4).compare("msr-")) || (!iter->compare("global")) \
|| (!iter->compare("global+")) || (!iter->compare("global+!")) || (!iter->compare("new")) \ || (!iter->compare("global+")) || (!iter->compare("global+!")) || (!iter->compare("new")) \
@ -716,6 +718,8 @@ int main(int argc, char *argv[])
musrfitOptions.append("-t "); musrfitOptions.append("-t ");
if (!msr2data_useOption(arg, "-e") || !msr2data_useOption(arg, "--estimateN0")) if (!msr2data_useOption(arg, "-e") || !msr2data_useOption(arg, "--estimateN0"))
musrfitOptions.append("-e "); 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")) if (!msr2data_useOption(arg, "-p") || !msr2data_useOption(arg, "--per-run-block-chisq"))
musrfitOptions.append("-p "); 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 // Check if all given run numbers are covered by the formatting of the data file name
status = msr2dataHandler->CheckRunNumbersInRange(); status = msr2dataHandler->CheckRunNumbersInRange();
if(status) { if (status) {
std::cerr << std::endl; std::cerr << std::endl;
std::cerr << ">> msr2data: **ERROR** At least one given run number is out of range! Quitting..." << std::endl; std::cerr << ">> msr2data: **ERROR** At least one given run number is out of range! Quitting..." << std::endl;
return status; 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]); musrFT_dumpData(startupParam.dumpFln, fourier, startupParam.fourierRange[0], startupParam.fourierRange[1]);
} else { // do Canvas } 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; Bool_t batch = false;
int cc=0; // create list of essential arguments to pass to the ROOT application
char **arg; std::vector<char*> args;
args.push_back(argv[0]); // program name
if (startupParam.graphicFormat.Length() != 0) { if (startupParam.graphicFormat.Length() != 0) {
batch = true; batch = true;
arg[cc] = (Char_t*)malloc(16*sizeof(Char_t)); args.push_back((char*)"-b"); // batch mode flag
strcpy(arg[cc], "-b");
cc++;
} }
int cc = args.size();
// plot the Fourier transform // plot the Fourier transform
TApplication app("App", &cc, arg); TApplication app("App", &cc, args.data());
if (startupHandler) { if (startupHandler) {
fourierCanvas = std::unique_ptr<PFourierCanvas>(new PFourierCanvas(fourier, dataSetTag, startupParam.title.Data(), 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.SetName(headerInfo[i]);
param.SetValue(dval); param.SetValue(dval);
if (i+1 < token.size()) { 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.SetNegErr(0.0);
param.SetPosErr(0.0); param.SetPosErr(0.0);
run.AddParam(param); run.AddParam(param);
param.ResetParam(); param.ResetParam();
} }
} else { // last token
param.SetNegErr(0.0);
param.SetPosErr(0.0);
run.AddParam(param);
param.ResetParam();
} }
} else if (headerCode[i] == PMUPP_POSNEGERR) { } else if (headerCode[i] == PMUPP_POSNEGERR) {
param.SetPosErr(dval); param.SetPosErr(dval);

View File

@ -638,7 +638,7 @@ void PmuppGui::fileOpen()
this, this,
"muSR Parameter Files", "muSR Parameter Files",
"./", "./",
"db-files (*.db);; All Params (*.msr *.db *.dat);; Msr-Files (*.msr);; dat-Files (*.dat);; All (*)"); "dat-files (*.dat);; db-Files (*.db);; All Params (*.msr *.db *.dat);; Msr-Files (*.msr);; All (*)");
if (list.count() == 0) if (list.count() == 0)
return; return;
@ -985,7 +985,8 @@ void PmuppGui::refresh()
for (int i=0; i<fParamDataHandler->GetNoOfCollections(); i++) { for (int i=0; i<fParamDataHandler->GetNoOfCollections(); i++) {
if (fParamDataHandler->GetCollection(i)->GetName() == label) { // found collection 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; collIdx = i;
break; break;
} }
@ -1014,7 +1015,7 @@ void PmuppGui::refresh()
} }
} else { } else {
QMessageBox::critical(this, "ERROR - REFRESH", 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; return;
} }

View File

@ -144,6 +144,8 @@ bool PAdminXMLParser::startElement()
fKeyWord = eMusrviewShowOneToOne; fKeyWord = eMusrviewShowOneToOne;
} else if (qName == "enable_musrt0") { } else if (qName == "enable_musrt0") {
fKeyWord = eEnableMusrT0; fKeyWord = eEnableMusrT0;
} else if (qName == "ignore_theme_auto_detection") {
fKeyWord = eIgnoreThemeAutoDetection;
} else if (qName == "dark_theme_icons_menu") { } else if (qName == "dark_theme_icons_menu") {
fKeyWord = eDarkThemeIconsMenu; fKeyWord = eDarkThemeIconsMenu;
} else if (qName == "dark_theme_icons_toolbar") { } else if (qName == "dark_theme_icons_toolbar") {
@ -160,6 +162,8 @@ bool PAdminXMLParser::startElement()
fKeyWord = eDumpRoot; fKeyWord = eDumpRoot;
} else if (qName == "estimate_n0") { } else if (qName == "estimate_n0") {
fKeyWord = eEstimateN0; fKeyWord = eEstimateN0;
} else if (qName == "yaml_out") {
fKeyWord = eYamlOut;
} else if (qName == "chisq_per_run_block") { } else if (qName == "chisq_per_run_block") {
fKeyWord = eChisqPreRunBlock; fKeyWord = eChisqPreRunBlock;
} else if (qName == "path_file_name") { } else if (qName == "path_file_name") {
@ -335,6 +339,13 @@ bool PAdminXMLParser::characters()
flag = false; flag = false;
fAdmin->setEnableMusrT0Flag(flag); fAdmin->setEnableMusrT0Flag(flag);
break; break;
case eIgnoreThemeAutoDetection:
if (str == "y")
flag = true;
else
flag = false;
fAdmin->setIgnoreThemeAutoDetection(flag);
break;
case eDarkThemeIconsMenu: case eDarkThemeIconsMenu:
if (str == "y") if (str == "y")
flag = true; flag = true;
@ -389,6 +400,14 @@ bool PAdminXMLParser::characters()
fAdmin->fMsr2DataParam.estimateN0 = flag; fAdmin->fMsr2DataParam.estimateN0 = flag;
fAdmin->setEstimateN0Flag(flag); fAdmin->setEstimateN0Flag(flag);
break; break;
case eYamlOut:
if (str == "y")
flag = true;
else
flag = false;
fAdmin->fMsr2DataParam.yamlOut = flag;
fAdmin->setYamlOutFlag(flag);
break;
case eChisqPreRunBlock: case eChisqPreRunBlock:
if (str == "y") if (str == "y")
flag = true; flag = true;
@ -608,9 +627,11 @@ void PAdminXMLParser::dump()
std::cout << "debug> title_from_data_file : " << fAdmin->getTitleFromDataFileFlag() << std::endl; 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> chisq_per_run_block : " << fAdmin->getChisqPerRunBlockFlag() << std::endl;
std::cout << "debug> estimate_n0 : " << fAdmin->getEstimateN0Flag() << 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_fourier : " << fAdmin->getMusrviewShowFourierFlag() << std::endl;
std::cout << "debug> musrview_show_avg : " << fAdmin->getMusrviewShowAvgFlag() << std::endl; std::cout << "debug> musrview_show_avg : " << fAdmin->getMusrviewShowAvgFlag() << std::endl;
std::cout << "debug> enable_musrt0 : " << fAdmin->getEnableMusrT0Flag() << std::endl; std::cout << "debug> enable_musrt0 : " << fAdmin->getEnableMusrT0Flag() << std::endl;
std::cout << "debug> ignore_theme_auto_detection : " << fAdmin->getIgnoreThemeAutoDetection() << std::endl;
std::cout << "debug> dark_theme_icons_menu : " << fAdmin->getDarkThemeIconsMenuFlag() << std::endl; std::cout << "debug> dark_theme_icons_menu : " << fAdmin->getDarkThemeIconsMenuFlag() << std::endl;
std::cout << "debug> dark_theme_icons_toolbar : " << fAdmin->getDarkThemeIconsToolbarFlag() << std::endl; std::cout << "debug> dark_theme_icons_toolbar : " << fAdmin->getDarkThemeIconsToolbarFlag() << std::endl;
std::cout << "debug> edit_w : " << fAdmin->getEditWidth() << std::endl; std::cout << "debug> edit_w : " << fAdmin->getEditWidth() << std::endl;
@ -725,32 +746,6 @@ QString PAdminXMLParser::expandPath(const QString &str)
*/ */
PAdmin::PAdmin() : QObject() PAdmin::PAdmin() : QObject()
{ {
fTimeout = 3600;
fFontName = QString("Courier"); // default font
fFontSize = 11; // default font size
fPrefPathName = QString("");
fExecPath = QString("");
fDefaultSavePath = QString("");
fTheoFuncPixmapPath = QString("");
fBeamline = QString("");
fInstitute = QString("");
fFileFormat = QString("");
fMusrviewShowFourier = false;
fMusrviewShowAvg = false;
fTitleFromDataFile = false;
fEnableMusrT0 = false;
fLifetimeCorrection = true;
fEstimateN0 = true;
fChisqPreRunBlock = false;
fEditWidth = 900;
fEditHeight = 800;
fMsr2DataParam.runList = QString(""); fMsr2DataParam.runList = QString("");
fMsr2DataParam.runListFileName = QString(""); fMsr2DataParam.runListFileName = QString("");
fMsr2DataParam.msrFileExtension = QString(""); fMsr2DataParam.msrFileExtension = QString("");
@ -760,6 +755,7 @@ PAdmin::PAdmin() : QObject()
fMsr2DataParam.ignoreDataHeaderInfo = false; fMsr2DataParam.ignoreDataHeaderInfo = false;
fMsr2DataParam.keepMinuit2Output = false; fMsr2DataParam.keepMinuit2Output = false;
fMsr2DataParam.estimateN0 = fEstimateN0; fMsr2DataParam.estimateN0 = fEstimateN0;
fMsr2DataParam.yamlOut = false;
fMsr2DataParam.writeColumnData = false; fMsr2DataParam.writeColumnData = false;
fMsr2DataParam.recreateDbFile = false; fMsr2DataParam.recreateDbFile = false;
fMsr2DataParam.chainFit = true; fMsr2DataParam.chainFit = true;
@ -991,6 +987,12 @@ int PAdmin::savePrefs(QString pref_fln)
else else
data[i] = " <estimate_n0>n</estimate_n0>"; 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 (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
if (fMusrviewShowFourier) if (fMusrviewShowFourier)
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>"; data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";
@ -1009,17 +1011,23 @@ int PAdmin::savePrefs(QString pref_fln)
else else
data[i] = " <enable_musrt0>n</enable_musrt0>"; data[i] = " <enable_musrt0>n</enable_musrt0>";
} }
if (data[i].contains("<ignore_theme_auto_detection>")) {
if (fIgnoreThemeAutoDetection)
data[i] = " <ignore_theme_auto_detection>y</ignore_theme_auto_detection>";
else
data[i] = " <ignore_theme_auto_detection>n</ignore_theme_auto_detection>";
}
if (data[i].contains("<dark_theme_icons_menu>") && data[i].contains("</dark_theme_icons_menu>")) { if (data[i].contains("<dark_theme_icons_menu>") && data[i].contains("</dark_theme_icons_menu>")) {
if (fDarkThemeIconsMenu) if (fDarkThemeIconsMenu)
data[i] = " <dark_theme_icons_menu>y</dark_theme_icons_menu>"; data[i] = " <dark_theme_icons_menu>y</dark_theme_icons_menu>";
else else
data[i] = " <dark_theme_icons_menu>n</dark_theme_icons_menu>"; data[i] = " <dark_theme_icons_menu>n</dark_theme_icons_menu>";
} }
if (data[i].contains("<dark_theme_icons_toolbar>") && data[i].contains("</dark_theme_icons_toolbar>")) { if (data[i].contains("<dark_theme_icons_toolbar>") && data[i].contains("</dark_theme_icons_toolbar>")) {
if (fDarkThemeIconsToolbar) if (fDarkThemeIconsToolbar)
data[i] = " <dark_theme_icons_toolbar>y</dark_theme_icons_toolbar>"; data[i] = " <dark_theme_icons_toolbar>y</dark_theme_icons_toolbar>";
else else
data[i] = " <dark_theme_icons_toolbar>n</dark_theme_icons_toolbar>"; data[i] = " <dark_theme_icons_toolbar>n</dark_theme_icons_toolbar>";
} }
if (data[i].contains("<font_name>") && data[i].contains("</font_name>")) { if (data[i].contains("<font_name>") && data[i].contains("</font_name>")) {
data[i] = QString(" <font_name>%1</font_name>").arg(fFontName); data[i] = QString(" <font_name>%1</font_name>").arg(fFontName);

View File

@ -71,9 +71,9 @@ class PAdminXMLParser
private: private:
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot, enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut,
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0, eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eEditW, eEditH, eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eIgnoreThemeAutoDetection, eEditW, eEditH,
eFontName, eFontSize, eExecPath, eDefaultSavePath, eFontName, eFontSize, eExecPath, eDefaultSavePath,
eRecentFile, eBeamline, eInstitute, eFileFormat, eLifetimeCorrection, eRecentFile, eBeamline, eInstitute, eFileFormat, eLifetimeCorrection,
eTheoFuncPixmapPath, eFunc, eFuncName, eFuncComment, eFuncLabel, eTheoFuncPixmapPath, eFunc, eFuncName, eFuncComment, eFuncLabel,
@ -129,7 +129,9 @@ class PAdmin : public QObject
bool getDumpAsciiFlag() { return fDumpAscii; } bool getDumpAsciiFlag() { return fDumpAscii; }
bool getDumpRootFlag() { return fDumpRoot; } bool getDumpRootFlag() { return fDumpRoot; }
bool getEstimateN0Flag() { return fEstimateN0; } bool getEstimateN0Flag() { return fEstimateN0; }
bool getYamlOutFlag() { return fYamlOut; }
bool getChisqPerRunBlockFlag() { return fChisqPreRunBlock; } bool getChisqPerRunBlockFlag() { return fChisqPreRunBlock; }
bool getIgnoreThemeAutoDetection() { return fIgnoreThemeAutoDetection; }
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu; } bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu; }
bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar; } bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar; }
int getEditWidth() { return fEditWidth; } int getEditWidth() { return fEditWidth; }
@ -157,7 +159,9 @@ class PAdmin : public QObject
void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; } void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; }
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; } void setDumpRootFlag(const bool flag) { fDumpRoot = flag; }
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; } void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; }
void setYamlOutFlag(const bool flag) { fYamlOut = flag; }
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; } void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; }
void setIgnoreThemeAutoDetection(const bool flag) { fIgnoreThemeAutoDetection = flag; }
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; } void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; }
void setDarkThemeIconsToolbarFlag(const bool flag) { fDarkThemeIconsToolbar = flag; } void setDarkThemeIconsToolbarFlag(const bool flag) { fDarkThemeIconsToolbar = flag; }
void setEditWidth(const int width) { fEditWidth = width; } void setEditWidth(const int width) { fEditWidth = width; }
@ -184,37 +188,39 @@ class PAdmin : public QObject
private: private:
friend class PAdminXMLParser; friend class PAdminXMLParser;
int fTimeout; ///< timeout in seconds int fTimeout{3600}; ///< timeout in seconds
QString fFontName; ///< default font name QString fFontName{QString("Monospace")}; ///< default font name
int fFontSize; ///< default font size int fFontSize{11}; ///< default font size
QString fPrefPathName; ///< path-name of the musredit_startup.xml QString fPrefPathName{QString("")}; ///< path-name of the musredit_startup.xml
QString fExecPath; ///< system path to the musrfit executables QString fExecPath{QString("")}; ///< system path to the musrfit executables
QString fDefaultSavePath; ///< default path where the msr-file should be saved QString fDefaultSavePath{QString("")}; ///< default path where the msr-file should be saved
QString fTheoFuncPixmapPath; ///< path where the default pixmaps can be found QString fTheoFuncPixmapPath{QString("")}; ///< path where the default pixmaps can be found
QVector<QString> fRecentFile; ///< keep vector of recent path-file names QVector<QString> fRecentFile; ///< keep vector of recent path-file names
bool fMusrviewShowFourier; ///< flag indicating if musrview should show at startup data (=false) or Fourier of data (=true). bool fMusrviewShowFourier{false}; ///< flag indicating if musrview should show at startup data (=false) or Fourier of data (=true).
bool fMusrviewShowAvg; ///< flag indicating if musrview should show at startup averaged (=true) or original (=false) data/Fourier. bool fMusrviewShowAvg{false}; ///< flag indicating if musrview should show at startup averaged (=true) or original (=false) data/Fourier.
bool fMusrviewShowOneToOne; ///< flag indicating if theory points are calculate only at the data points (=true) or a higher density theory points is calculated bool fMusrviewShowOneToOne{false}; ///< flag indicating if theory points are calculate only at the data points (=true) or a higher density theory points is calculated
bool fKeepMinuit2Output; ///< flag indicating if the Minuit2 output shall be kept (default: no) bool fKeepMinuit2Output{false}; ///< flag indicating if the Minuit2 output shall be kept (default: no)
bool fDumpAscii; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no). bool fDumpAscii{false}; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no).
bool fDumpRoot; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no). bool fDumpRoot{false}; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no).
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes). bool fTitleFromDataFile{true}; ///< 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 fChisqPreRunBlock{false}; ///< 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 fEstimateN0{true}; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes). bool fYamlOut{false}; ///< flag indicating if the MINUIT2.OUTPUT file should also be written as <msr-file>.yaml output. (default: no).
bool fDarkThemeIconsMenu; ///< flag indicating if dark theme icons shall be used in the menu (default: no) bool fEnableMusrT0{true}; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
bool fDarkThemeIconsToolbar; ///< flag indicating if dark theme icons shall be used in the toolbar (default: no) bool fIgnoreThemeAutoDetection{false}; ///< flag indicating that the theme autodetection shall be ignored. (default: no)
bool fDarkThemeIconsMenu{false}; ///< flag indicating if dark theme icons shall be used in the menu (default: no)
bool fDarkThemeIconsToolbar{false}; ///< flag indicating if dark theme icons shall be used in the toolbar (default: no)
int fEditWidth{900}; ///< startup edit width int fEditWidth{900}; ///< startup edit width
int fEditHeight{800}; ///< startup edit height int fEditHeight{800}; ///< startup edit height
QString fBeamline; ///< name of the beamline. Used to generate default run header lines. QString fBeamline{QString("")}; ///< name of the beamline. Used to generate default run header lines.
QString fInstitute; ///< name of the institute. Used to generate default run header lines. QString fInstitute{QString("")}; ///< name of the institute. Used to generate default run header lines.
QString fFileFormat; ///< default file format. Used to generate default run header lines. QString fFileFormat{QString("")}; ///< default file format. Used to generate default run header lines.
bool fLifetimeCorrection; ///< flag indicating if by default the lifetime-correction-flag in a single histo file shall be set. bool fLifetimeCorrection{true}; ///< flag indicating if by default the lifetime-correction-flag in a single histo file shall be set.
mutable PMsr2DataParam fMsr2DataParam; ///< keeps msr2data default parameter flags mutable PMsr2DataParam fMsr2DataParam; ///< keeps msr2data default parameter flags

View File

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

View File

@ -59,6 +59,12 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
fDarkThemeIconsToolbar_checkBox->setCheckState(Qt::Unchecked); fDarkThemeIconsToolbar_checkBox->setCheckState(Qt::Unchecked);
} }
if (fAdmin->getIgnoreThemeAutoDetection()) {
fIgnoreThemeAutoDetection_checkBox->setCheckState(Qt::Checked);
} else {
fIgnoreThemeAutoDetection_checkBox->setCheckState(Qt::Unchecked);
}
fKeepMn2Output_checkBox->setChecked(fAdmin->getKeepMinuit2OutputFlag()); fKeepMn2Output_checkBox->setChecked(fAdmin->getKeepMinuit2OutputFlag());
if (fAdmin->getDumpAsciiFlag() && !fAdmin->getDumpRootFlag()) { if (fAdmin->getDumpAsciiFlag() && !fAdmin->getDumpRootFlag()) {
@ -76,6 +82,7 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag()); fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag());
fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag()); fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag());
fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag()); fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag());
fYamlOut_checkBox->setChecked(fAdmin->getYamlOutFlag());
fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag()); fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag());
fAvg_checkBox->setChecked(fAdmin->getMusrviewShowAvgFlag()); fAvg_checkBox->setChecked(fAdmin->getMusrviewShowAvgFlag());
fOneToOne_checkBox->setChecked(fAdmin->getMusrviewShowOneToOneFlag()); fOneToOne_checkBox->setChecked(fAdmin->getMusrviewShowOneToOneFlag());

View File

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

View File

@ -88,11 +88,11 @@
PTextEdit::PTextEdit( QWidget *parent ) PTextEdit::PTextEdit( QWidget *parent )
: QMainWindow( parent ) : QMainWindow( parent )
{ {
bool gotTheme = getTheme();
// reads and manages the conents of the xml-startup (musredit_startup.xml) file // reads and manages the conents of the xml-startup (musredit_startup.xml) file
fAdmin = std::make_unique<PAdmin>(); fAdmin = std::make_unique<PAdmin>();
bool gotTheme = getTheme();
// set default setting of the fDarkMenuIconIcons only if a theme has been recognized, otherwise take the // set default setting of the fDarkMenuIconIcons only if a theme has been recognized, otherwise take the
// one from the xml startup file. // one from the xml startup file.
if (gotTheme) { if (gotTheme) {
@ -125,6 +125,7 @@ PTextEdit::PTextEdit( QWidget *parent )
setupEditActions(); setupEditActions();
setupTextActions(); setupTextActions();
setupMusrActions(); setupMusrActions();
setupJumpToBlock();
setupHelpActions(); setupHelpActions();
fTabWidget = std::make_unique<QTabWidget>( this ); fTabWidget = std::make_unique<QTabWidget>( this );
@ -133,7 +134,6 @@ PTextEdit::PTextEdit( QWidget *parent )
textFamily(fAdmin->getFontName()); textFamily(fAdmin->getFontName());
textSize(QString("%1").arg(fAdmin->getFontSize())); textSize(QString("%1").arg(fAdmin->getFontSize()));
fFontChanging = false;
QString iconName(""); QString iconName("");
if (fDarkMenuIcon) if (fDarkMenuIcon)
@ -958,6 +958,31 @@ void PTextEdit::setupHelpActions()
menu->addAction(a); 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. * <p>load a msr-file.
@ -974,6 +999,7 @@ void PTextEdit::load( const QString &f, const int index )
// create a new text edit object // create a new text edit object
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() ); PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize())); edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
// place the text edit object at the appropriate tab position // place the text edit object at the appropriate tab position
if (index == -1) if (index == -1)
@ -1016,7 +1042,7 @@ PSubTextEdit *PTextEdit::currentEditor() const
return nullptr; return nullptr;
if ( fTabWidget->currentWidget() ) { if ( fTabWidget->currentWidget() ) {
if (fTabWidget->currentWidget()->inherits( "PSubTextEdit" )) { if (fTabWidget->currentWidget()->inherits( "PSubTextEdit" )) {
return dynamic_cast<PSubTextEdit*>(fTabWidget->currentWidget()); return dynamic_cast<PSubTextEdit*>(fTabWidget->currentWidget());
} }
} }
@ -1158,6 +1184,7 @@ void PTextEdit::fileNew()
{ {
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() ); PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize())); edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
doConnections( edit ); doConnections( edit );
fTabWidget->addTab( edit, tr( "noname" ) ); fTabWidget->addTab( edit, tr( "noname" ) );
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit)); fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
@ -1391,18 +1418,18 @@ void PTextEdit::fileSavePrefs()
QString msg(""); QString msg("");
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setText("Which Preferences do you want to open?"); msgBox.setText("Which Preferences do you want to open?");
msgBox.addButton("Default", QMessageBox::AcceptRole); QAbstractButton *def = msgBox.addButton("Default", QMessageBox::AcceptRole);
msgBox.addButton("Custom", QMessageBox::AcceptRole); QAbstractButton *cust = msgBox.addButton("Custom", QMessageBox::AcceptRole);
msgBox.setStandardButtons(QMessageBox::Cancel); msgBox.setStandardButtons(QMessageBox::Cancel);
int result = msgBox.exec(); int result = msgBox.exec();
if (result == QMessageBox::Cancel) { if (result == QMessageBox::Cancel) {
return; return;
} else if (result == 0) { // default dir } else if (msgBox.clickedButton() == def) { // default dir
fln = fAdmin->getDefaultPrefPathName(); fln = fAdmin->getDefaultPrefPathName();
msg = QString("Current Default Preferences Path-Name:\n") + fln; msg = QString("Current Default Preferences Path-Name:\n") + fln;
if (QMessageBox::information(this, "Info", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel) if (QMessageBox::information(this, "Info", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
return; return;
} else if (result == 1) { // custom dir } else if (msgBox.clickedButton() == cust) { // custom dir
fln = QFileDialog::getSaveFileName( this, fln = QFileDialog::getSaveFileName( this,
tr( "Save Prefs As" ), "musredit_startup.xml", tr( "Save Prefs As" ), "musredit_startup.xml",
tr( "xml-Files (*.xml);;All Files (*)" ) ); tr( "xml-Files (*.xml);;All Files (*)" ) );
@ -1939,7 +1966,7 @@ void PTextEdit::editUncomment()
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
/** /**
* <p>Chances the font. * <p>Changes the font.
* *
* \param f font name * \param f font name
*/ */
@ -1956,7 +1983,7 @@ void PTextEdit::textFamily( const QString &f )
//---------------------------------------------------------------------------------------------------- //----------------------------------------------------------------------------------------------------
/** /**
* <p>Chances the font size. * <p>Changes the font size.
* *
* \param p font size in points. * \param p font size in points.
*/ */
@ -2104,6 +2131,11 @@ void PTextEdit::musrFit()
cmd.append("--estimateN0"); cmd.append("--estimateN0");
} }
// check yamlOut flag
if (fAdmin->getYamlOutFlag()) {
cmd.append("--yaml");
}
// check per-run-block-chisq flag // check per-run-block-chisq flag
if (fAdmin->getChisqPerRunBlockFlag()) { if (fAdmin->getChisqPerRunBlockFlag()) {
cmd.append("--per-run-block-chisq"); cmd.append("--per-run-block-chisq");
@ -2180,6 +2212,7 @@ void PTextEdit::musrMsr2Data()
fMsr2DataParam->keepMinuit2Output = fAdmin->getKeepMinuit2OutputFlag(); fMsr2DataParam->keepMinuit2Output = fAdmin->getKeepMinuit2OutputFlag();
fMsr2DataParam->titleFromDataFile = fAdmin->getTitleFromDataFileFlag(); fMsr2DataParam->titleFromDataFile = fAdmin->getTitleFromDataFileFlag();
fMsr2DataParam->estimateN0 = fAdmin->getEstimateN0Flag(); fMsr2DataParam->estimateN0 = fAdmin->getEstimateN0Flag();
fMsr2DataParam->yamlOut = fAdmin->getYamlOutFlag();
fMsr2DataParam->perRunBlockChisq = fAdmin->getChisqPerRunBlockFlag(); fMsr2DataParam->perRunBlockChisq = fAdmin->getChisqPerRunBlockFlag();
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data")); PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
@ -2202,6 +2235,7 @@ void PTextEdit::musrMsr2Data()
fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output); fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output);
fAdmin->setTitleFromDataFileFlag(fMsr2DataParam->titleFromDataFile); fAdmin->setTitleFromDataFileFlag(fMsr2DataParam->titleFromDataFile);
fAdmin->setEstimateN0Flag(fMsr2DataParam->estimateN0); fAdmin->setEstimateN0Flag(fMsr2DataParam->estimateN0);
fAdmin->setYamlOutFlag(fMsr2DataParam->yamlOut);
fAdmin->setChisqPerRunBlockFlag(fMsr2DataParam->perRunBlockChisq); fAdmin->setChisqPerRunBlockFlag(fMsr2DataParam->perRunBlockChisq);
// analyze parameters // analyze parameters
@ -2336,6 +2370,11 @@ void PTextEdit::musrMsr2Data()
cmd.append("-e"); 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 // write per-run-block chisq. Add flag only if a fit is done
if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) { if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
cmd.append("-p"); cmd.append("-p");
@ -2697,6 +2736,7 @@ void PTextEdit::musrPrefs()
} }
if (dlg->exec() == QDialog::Accepted) { if (dlg->exec() == QDialog::Accepted) {
fAdmin->setIgnoreThemeAutoDetection(dlg->getIgnoreThemeAutoDetection());
fAdmin->setDarkThemeIconsMenuFlag(dlg->getDarkThemeIconsMenuFlag()); fAdmin->setDarkThemeIconsMenuFlag(dlg->getDarkThemeIconsMenuFlag());
fAdmin->setDarkThemeIconsToolbarFlag(dlg->getDarkThemeIconsToolbarFlag()); fAdmin->setDarkThemeIconsToolbarFlag(dlg->getDarkThemeIconsToolbarFlag());
fAdmin->setMusrviewShowFourierFlag(dlg->getMusrviewShowFourierFlag()); fAdmin->setMusrviewShowFourierFlag(dlg->getMusrviewShowFourierFlag());
@ -2719,6 +2759,7 @@ void PTextEdit::musrPrefs()
fAdmin->setTimeout(dlg->getTimeout()); fAdmin->setTimeout(dlg->getTimeout());
fAdmin->setChisqPerRunBlockFlag(dlg->getKeepRunPerBlockChisqFlag()); fAdmin->setChisqPerRunBlockFlag(dlg->getKeepRunPerBlockChisqFlag());
fAdmin->setEstimateN0Flag(dlg->getEstimateN0Flag()); fAdmin->setEstimateN0Flag(dlg->getEstimateN0Flag());
fAdmin->setYamlOutFlag(dlg->getYamlOutFlag());
} }
delete dlg; delete dlg;
@ -3293,12 +3334,35 @@ void PTextEdit::setFileSystemWatcherActive()
fFileSystemWatcherActive = true; 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 * @brief PTextEdit::getTheme
*/ */
bool PTextEdit::getTheme() bool PTextEdit::getTheme()
{ {
if (fAdmin->getIgnoreThemeAutoDetection())
return false;
fDarkMenuIcon = false; // true if theme is dark fDarkMenuIcon = false; // true if theme is dark
fDarkToolBarIcon = false; // needed for ubuntu dark since there the menu icons are dark, however the toolbar icons are plain! fDarkToolBarIcon = false; // needed for ubuntu dark since there the menu icons are dark, however the toolbar icons are plain!
@ -3330,10 +3394,9 @@ bool PTextEdit::getTheme()
if (str.contains("dark", Qt::CaseInsensitive)) { if (str.contains("dark", Qt::CaseInsensitive)) {
fDarkMenuIcon = true; fDarkMenuIcon = true;
if (str.contains("ubuntu", Qt::CaseInsensitive)) { if (str.contains("ubuntu", Qt::CaseInsensitive) ||
fDarkMenuIcon = false; str.contains("xfce", Qt::CaseInsensitive) ||
fDarkToolBarIcon = false; str.contains("mx", Qt::CaseInsensitive)) {
} else if (str.contains("xfce", Qt::CaseInsensitive)) {
fDarkMenuIcon = false; fDarkMenuIcon = false;
fDarkToolBarIcon = false; fDarkToolBarIcon = false;
} else { } else {

View File

@ -86,6 +86,7 @@ private:
void setupTextActions(); void setupTextActions();
void setupMusrActions(); void setupMusrActions();
void setupHelpActions(); void setupHelpActions();
void setupJumpToBlock();
void load( const QString &f, const int index=-1 ); void load( const QString &f, const int index=-1 );
PSubTextEdit *currentEditor() const; PSubTextEdit *currentEditor() const;
void doConnections( PSubTextEdit *e ); void doConnections( PSubTextEdit *e );
@ -167,16 +168,18 @@ private slots:
void fileChanged(const QString &fileName); void fileChanged(const QString &fileName);
void setFileSystemWatcherActive(); void setFileSystemWatcherActive();
void jumpToBlock(int idx);
private: private:
bool fDarkMenuIcon; ///< flag indicating if a dark or plain icon shall be used in the menu pull-downs bool fDarkMenuIcon{false}; ///< 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 bool fDarkToolBarIcon{false}; ///< flag indicating if a dark or plain icon shall be used in the toolbar
std::unique_ptr<PAdmin> fAdmin; ///< pointer to the xml-startup file informations. Needed for different purposes like default working- and executable directories etc. std::unique_ptr<PAdmin> fAdmin; ///< pointer to the xml-startup file informations. Needed for different purposes like default working- and executable directories etc.
std::unique_ptr<QFileSystemWatcher> fFileSystemWatcher; ///< checks if msr-files are changing on the disk while being open in musredit. std::unique_ptr<QFileSystemWatcher> fFileSystemWatcher; ///< checks if msr-files are changing on the disk while being open in musredit.
bool fFileSystemWatcherActive; ///< flag to enable/disable the file system watcher bool fFileSystemWatcherActive; ///< flag to enable/disable the file system watcher
QTimer fFileSystemWatcherTimeout; ///< timer used to re-enable file system watcher. Needed to delay the re-enabling QTimer fFileSystemWatcherTimeout; ///< timer used to re-enable file system watcher. Needed to delay the re-enabling
QString fLastDirInUse; ///< string holding the path from where the last file was loaded. QString fLastDirInUse{QString("")}; ///< string holding the path from where the last file was loaded.
QStringList fMusrFTPrevCmd; QStringList fMusrFTPrevCmd;
int fEditW, fEditH; int fEditW{900}, fEditH{800};
QMap<QString, QAction*> fActions; QMap<QString, QAction*> fActions;
std::unique_ptr<QAction> fMusrT0Action; std::unique_ptr<QAction> fMusrT0Action;
@ -186,7 +189,8 @@ private:
std::unique_ptr<QComboBox> fComboFont; ///< combo box for the font selector std::unique_ptr<QComboBox> fComboFont; ///< combo box for the font selector
std::unique_ptr<QComboBox> fComboSize; ///< combo box for the font size 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 bool fFontChanging{false}; ///< 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 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 QMap<PSubTextEdit*, QString> fFilenames; ///< mapper between tab widget object and filename

View File

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

View File

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>452</width> <width>460</width>
<height>180</height> <height>200</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -20,279 +20,293 @@
<iconset> <iconset>
<normaloff>:/images/musrfit.xpm</normaloff>:/images/musrfit.xpm</iconset> <normaloff>:/images/musrfit.xpm</normaloff>:/images/musrfit.xpm</iconset>
</property> </property>
<widget class="QWidget" name="layoutWidget_0"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="geometry"> <item>
<rect> <layout class="QVBoxLayout" name="verticalLayout">
<x>0</x> <item>
<y>5</y> <widget class="QTabWidget" name="fTabWidget">
<width>451</width> <property name="currentIndex">
<height>171</height> <number>0</number>
</rect> </property>
</property> <widget class="QWidget" name="fGeneral_tab">
<layout class="QVBoxLayout" name="verticalLayout"> <attribute name="title">
<item> <string>general</string>
<widget class="QTabWidget" name="fTabWidget"> </attribute>
<property name="currentIndex"> <widget class="QPushButton" name="fDefaultPath_pushButton">
<number>2</number> <property name="geometry">
</property> <rect>
<widget class="QWidget" name="fGeneral_tab"> <x>10</x>
<attribute name="title"> <y>80</y>
<string>general</string> <width>421</width>
</attribute> <height>31</height>
<widget class="QPushButton" name="fDefaultPath_pushButton"> </rect>
<property name="geometry"> </property>
<rect> <property name="text">
<x>10</x> <string>Change Default Search Paths</string>
<y>70</y> </property>
<width>421</width> </widget>
<height>31</height> <widget class="QWidget" name="">
</rect> <property name="geometry">
</property> <rect>
<property name="text"> <x>10</x>
<string>Change Default Search Paths</string> <y>10</y>
</property> <width>416</width>
<height>61</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="fTimeout_lineEdit"/>
</item>
<item>
<widget class="QLabel" name="fTimeout_label">
<property name="text">
<string>timeout</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>38</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="fIgnoreThemeAutoDetection_checkBox">
<property name="text">
<string>Ignore Theme Auto Detect</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fDarkThemeIconsMenu_checkBox">
<property name="text">
<string>Dark Theme Icons Menu</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fDarkThemeIconsToolbar_checkBox">
<property name="text">
<string>Dark Theme Icons Toolbar</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget> </widget>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="fMusrfit_tab">
<property name="geometry"> <attribute name="title">
<rect> <string>musrfit</string>
<x>12</x> </attribute>
<y>10</y> <widget class="QCheckBox" name="fKeepMn2Output_checkBox">
<width>415</width> <property name="geometry">
<height>62</height> <rect>
</rect> <x>10</x>
</property> <y>10</y>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <width>161</width>
<item> <height>23</height>
<widget class="QLineEdit" name="fTimeout_lineEdit"/> </rect>
</item> </property>
<item> <property name="text">
<widget class="QLabel" name="fTimeout_label"> <string>keep minuit2 output</string>
<property name="text"> </property>
<string>timeout</string> </widget>
</property> <widget class="QCheckBox" name="fDumpAscii_checkBox">
</widget> <property name="geometry">
</item> <rect>
<item> <x>10</x>
<spacer name="horizontalSpacer_2"> <y>35</y>
<property name="orientation"> <width>151</width>
<enum>Qt::Horizontal</enum> <height>23</height>
</property> </rect>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="text">
<width>38</width> <string>dump ascii</string>
<height>30</height> </property>
</size> </widget>
</property> <widget class="QCheckBox" name="fDumpRoot_checkBox">
</spacer> <property name="geometry">
</item> <rect>
<item> <x>10</x>
<layout class="QVBoxLayout" name="verticalLayout_2"> <y>60</y>
<item> <width>131</width>
<widget class="QCheckBox" name="fDarkThemeIconsMenu_checkBox"> <height>23</height>
<property name="text"> </rect>
<string>Dark Theme Icons Menu</string> </property>
</property> <property name="text">
</widget> <string>dump root</string>
</item> </property>
<item> </widget>
<widget class="QCheckBox" name="fDarkThemeIconsToolbar_checkBox"> <widget class="QCheckBox" name="fTitleFromData_checkBox">
<property name="text"> <property name="geometry">
<string>Dark Theme Icons Toolbar</string> <rect>
</property> <x>170</x>
</widget> <y>10</y>
</item> <width>161</width>
</layout> <height>23</height>
</item> </rect>
</layout> </property>
<property name="text">
<string>take title from data file</string>
</property>
</widget>
<widget class="QCheckBox" name="fPerRunBlockChisq_checkBox">
<property name="geometry">
<rect>
<x>170</x>
<y>35</y>
<width>181</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>keep per run block chisq</string>
</property>
</widget>
<widget class="QCheckBox" name="fEstimateN0_checkBox">
<property name="geometry">
<rect>
<x>170</x>
<y>60</y>
<width>171</width>
<height>22</height>
</rect>
</property>
<property name="text">
<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">
<string>musrview</string>
</attribute>
<widget class="QCheckBox" name="fFourier_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>421</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>start with Fourier</string>
</property>
</widget>
<widget class="QCheckBox" name="fAvg_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>421</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>start with averaged data/Fourier</string>
</property>
</widget>
<widget class="QCheckBox" name="fOneToOne_checkBox">
<property name="geometry">
<rect>
<x>260</x>
<y>10</y>
<width>181</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>theo at data points only</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrt0_tab">
<attribute name="title">
<string>musrt0</string>
</attribute>
<widget class="QCheckBox" name="fEnableMusrT0_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>131</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>enable it</string>
</property>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="fMusrfit_tab"> </item>
<attribute name="title"> <item>
<string>musrfit</string> <layout class="QHBoxLayout" name="horizontalLayout">
</attribute> <item>
<widget class="QCheckBox" name="fKeepMn2Output_checkBox"> <widget class="QPushButton" name="fHelp_pushButton">
<property name="geometry"> <property name="text">
<rect> <string>&amp;Help</string>
<x>10</x> </property>
<y>10</y> </widget>
<width>161</width> </item>
<height>23</height> <item>
</rect> <spacer name="horizontalSpacer">
</property> <property name="orientation">
<property name="text"> <enum>Qt::Horizontal</enum>
<string>keep minuit2 output</string> </property>
</property> <property name="sizeHint" stdset="0">
</widget> <size>
<widget class="QCheckBox" name="fDumpAscii_checkBox"> <width>88</width>
<property name="geometry"> <height>20</height>
<rect> </size>
<x>10</x> </property>
<y>35</y> </spacer>
<width>151</width> </item>
<height>23</height> <item>
</rect> <widget class="QPushButton" name="fOk_pushButton">
</property> <property name="text">
<property name="text"> <string>&amp;OK</string>
<string>dump ascii</string> </property>
</property> </widget>
</widget> </item>
<widget class="QCheckBox" name="fDumpRoot_checkBox"> <item>
<property name="geometry"> <widget class="QPushButton" name="fCancel_pushButton">
<rect> <property name="text">
<x>10</x> <string>&amp;Cancel</string>
<y>60</y> </property>
<width>131</width> </widget>
<height>23</height> </item>
</rect> </layout>
</property> </item>
<property name="text"> </layout>
<string>dump root</string> </item>
</property> </layout>
</widget>
<widget class="QCheckBox" name="fTitleFromData_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<y>10</y>
<width>241</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>take title from data file</string>
</property>
</widget>
<widget class="QCheckBox" name="fPerRunBlockChisq_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<y>35</y>
<width>241</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>keep per run block chisq</string>
</property>
</widget>
<widget class="QCheckBox" name="fEstimateN0_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<y>60</y>
<width>241</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>estimate N0</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrview_tab">
<attribute name="title">
<string>musrview</string>
</attribute>
<widget class="QCheckBox" name="fFourier_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>421</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>start with Fourier</string>
</property>
</widget>
<widget class="QCheckBox" name="fAvg_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>421</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>start with averaged data/Fourier</string>
</property>
</widget>
<widget class="QCheckBox" name="fOneToOne_checkBox">
<property name="geometry">
<rect>
<x>260</x>
<y>10</y>
<width>181</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>theo at data points only</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrt0_tab">
<attribute name="title">
<string>musrt0</string>
</attribute>
<widget class="QCheckBox" name="fEnableMusrT0_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>131</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>enable it</string>
</property>
</widget>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="fHelp_pushButton">
<property name="text">
<string>&amp;Help</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>88</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="fOk_pushButton">
<property name="text">
<string>&amp;OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="fCancel_pushButton">
<property name="text">
<string>&amp;Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>fTabWidget</tabstop> <tabstop>fTabWidget</tabstop>

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 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 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 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 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 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). bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).

View File

@ -14,10 +14,12 @@
<title_from_data_file>y</title_from_data_file> <title_from_data_file>y</title_from_data_file>
<chisq_per_run_block>n</chisq_per_run_block> <chisq_per_run_block>n</chisq_per_run_block>
<estimate_n0>y</estimate_n0> <estimate_n0>y</estimate_n0>
<yaml_out>n</yaml_out>
<musrview_show_fourier>n</musrview_show_fourier> <musrview_show_fourier>n</musrview_show_fourier>
<musrview_show_avg>n</musrview_show_avg> <musrview_show_avg>n</musrview_show_avg>
<musrview_show_one_to_one>n</musrview_show_one_to_one> <musrview_show_one_to_one>n</musrview_show_one_to_one>
<enable_musrt0>y</enable_musrt0> <enable_musrt0>y</enable_musrt0>
<ignore_theme_auto_detection>n</ignore_theme_auto_detection>
<dark_theme_icons_menu>n</dark_theme_icons_menu> <dark_theme_icons_menu>n</dark_theme_icons_menu>
<dark_theme_icons_toolbar>n</dark_theme_icons_toolbar> <dark_theme_icons_toolbar>n</dark_theme_icons_toolbar>
<edit_w>900</edit_w> <edit_w>900</edit_w>

View File

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

View File

@ -637,7 +637,7 @@ void PmuppGui::fileOpen()
this, this,
"muSR Parameter Files", "muSR Parameter Files",
"./", "./",
"db-files (*.db);; All Params (*.msr *.db *.dat);; Msr-Files (*.msr);; dat-Files (*.dat);; All (*)"); "dat-files (*.dat);; db-Files (*.db);; All Params (*.msr *.db *.dat);; Msr-Files (*.msr);; All (*)");
if (list.count() == 0) if (list.count() == 0)
return; return;
@ -973,7 +973,8 @@ void PmuppGui::refresh()
for (int i=0; i<fParamDataHandler->GetNoOfCollections(); i++) { for (int i=0; i<fParamDataHandler->GetNoOfCollections(); i++) {
if (fParamDataHandler->GetCollection(i)->GetName() == label) { // found collection 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; collIdx = i;
break; break;
} }

View File

@ -150,6 +150,8 @@ bool PAdminXMLParser::startElement()
fKeyWord = eMusrviewShowOneToOne; fKeyWord = eMusrviewShowOneToOne;
} else if (qName == "enable_musrt0") { } else if (qName == "enable_musrt0") {
fKeyWord = eEnableMusrT0; fKeyWord = eEnableMusrT0;
} else if (qName == "ignore_theme_auto_detection") {
fKeyWord = eIgnoreThemeAutoDetection;
} else if (qName == "dark_theme_icons_menu") { } else if (qName == "dark_theme_icons_menu") {
fKeyWord = eDarkThemeIconsMenu; fKeyWord = eDarkThemeIconsMenu;
} else if (qName == "dark_theme_icons_toolbar") { } else if (qName == "dark_theme_icons_toolbar") {
@ -158,14 +160,16 @@ bool PAdminXMLParser::startElement()
fKeyWord = eEditW; fKeyWord = eEditW;
} else if (qName == "edit_h") { } else if (qName == "edit_h") {
fKeyWord = eEditH; fKeyWord = eEditH;
} else if (qName =="keep_minuit2_output") { } else if (qName == "keep_minuit2_output") {
fKeyWord = eKeepMinuit2Output; fKeyWord = eKeepMinuit2Output;
} else if (qName == "dump_ascii") { } else if (qName == "dump_ascii") {
fKeyWord = eDumpAscii; fKeyWord = eDumpAscii;
} else if (qName =="dump_root") { } else if (qName == "dump_root") {
fKeyWord = eDumpRoot; fKeyWord = eDumpRoot;
} else if (qName == "estimate_n0") { } else if (qName == "estimate_n0") {
fKeyWord = eEstimateN0; fKeyWord = eEstimateN0;
} else if (qName == "yaml_out") {
fKeyWord = eYamlOut;
} else if (qName == "chisq_per_run_block") { } else if (qName == "chisq_per_run_block") {
fKeyWord = eChisqPreRunBlock; fKeyWord = eChisqPreRunBlock;
} else if (qName == "path_file_name") { } else if (qName == "path_file_name") {
@ -279,7 +283,6 @@ bool PAdminXMLParser::endElement()
bool PAdminXMLParser::characters() bool PAdminXMLParser::characters()
{ {
QString str = fXml.text().toString(); QString str = fXml.text().toString();
if (str.isEmpty()) if (str.isEmpty())
return true; return true;
@ -342,6 +345,13 @@ bool PAdminXMLParser::characters()
flag = false; flag = false;
fAdmin->setEnableMusrT0Flag(flag); fAdmin->setEnableMusrT0Flag(flag);
break; break;
case eIgnoreThemeAutoDetection:
if (str == "y")
flag = true;
else
flag = false;
fAdmin->setIgnoreThemeAutoDetection(flag);
break;
case eDarkThemeIconsMenu: case eDarkThemeIconsMenu:
if (str == "y") if (str == "y")
flag = true; flag = true;
@ -396,6 +406,14 @@ bool PAdminXMLParser::characters()
fAdmin->fMsr2DataParam.estimateN0 = flag; fAdmin->fMsr2DataParam.estimateN0 = flag;
fAdmin->setEstimateN0Flag(flag); fAdmin->setEstimateN0Flag(flag);
break; break;
case eYamlOut:
if (str == "y")
flag = true;
else
flag = false;
fAdmin->fMsr2DataParam.yamlOut = flag;
fAdmin->setYamlOutFlag(flag);
break;
case eChisqPreRunBlock: case eChisqPreRunBlock:
if (str == "y") if (str == "y")
flag = true; flag = true;
@ -615,9 +633,11 @@ void PAdminXMLParser::dump()
std::cout << "debug> title_from_data_file : " << fAdmin->getTitleFromDataFileFlag() << std::endl; 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> chisq_per_run_block : " << fAdmin->getChisqPerRunBlockFlag() << std::endl;
std::cout << "debug> estimate_n0 : " << fAdmin->getEstimateN0Flag() << 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_fourier : " << fAdmin->getMusrviewShowFourierFlag() << std::endl;
std::cout << "debug> musrview_show_avg : " << fAdmin->getMusrviewShowAvgFlag() << std::endl; std::cout << "debug> musrview_show_avg : " << fAdmin->getMusrviewShowAvgFlag() << std::endl;
std::cout << "debug> enable_musrt0 : " << fAdmin->getEnableMusrT0Flag() << std::endl; std::cout << "debug> enable_musrt0 : " << fAdmin->getEnableMusrT0Flag() << std::endl;
std::cout << "debug> ignore_theme_auto_detection : " << fAdmin->getIgnoreThemeAutoDetection() << std::endl;
std::cout << "debug> dark_theme_icons_menu : " << fAdmin->getDarkThemeIconsMenuFlag() << std::endl; std::cout << "debug> dark_theme_icons_menu : " << fAdmin->getDarkThemeIconsMenuFlag() << std::endl;
std::cout << "debug> dark_theme_icons_toolbar : " << fAdmin->getDarkThemeIconsToolbarFlag() << std::endl; std::cout << "debug> dark_theme_icons_toolbar : " << fAdmin->getDarkThemeIconsToolbarFlag() << std::endl;
std::cout << "debug> edit_w : " << fAdmin->getEditWidth() << std::endl; std::cout << "debug> edit_w : " << fAdmin->getEditWidth() << std::endl;
@ -732,29 +752,6 @@ QString PAdminXMLParser::expandPath(const QString &str)
*/ */
PAdmin::PAdmin() : QObject() PAdmin::PAdmin() : QObject()
{ {
fTimeout = 3600;
fFontName = QString("Courier"); // default font
fFontSize = 11; // default font size
fPrefPathName = QString("");
fExecPath = QString("");
fDefaultSavePath = QString("");
fTheoFuncPixmapPath = QString("");
fBeamline = QString("");
fInstitute = QString("");
fFileFormat = QString("");
fMusrviewShowFourier = false;
fMusrviewShowAvg = false;
fTitleFromDataFile = false;
fEnableMusrT0 = false;
fLifetimeCorrection = true;
fEstimateN0 = true;
fChisqPreRunBlock = false;
fMsr2DataParam.runList = QString(""); fMsr2DataParam.runList = QString("");
fMsr2DataParam.runListFileName = QString(""); fMsr2DataParam.runListFileName = QString("");
fMsr2DataParam.msrFileExtension = QString(""); fMsr2DataParam.msrFileExtension = QString("");
@ -764,6 +761,7 @@ PAdmin::PAdmin() : QObject()
fMsr2DataParam.ignoreDataHeaderInfo = false; fMsr2DataParam.ignoreDataHeaderInfo = false;
fMsr2DataParam.keepMinuit2Output = false; fMsr2DataParam.keepMinuit2Output = false;
fMsr2DataParam.estimateN0 = fEstimateN0; fMsr2DataParam.estimateN0 = fEstimateN0;
fMsr2DataParam.yamlOut = false;
fMsr2DataParam.writeColumnData = false; fMsr2DataParam.writeColumnData = false;
fMsr2DataParam.recreateDbFile = false; fMsr2DataParam.recreateDbFile = false;
fMsr2DataParam.chainFit = true; fMsr2DataParam.chainFit = true;
@ -995,6 +993,12 @@ int PAdmin::savePrefs(QString pref_fln)
else else
data[i] = " <estimate_n0>n</estimate_n0>"; 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 (data[i].contains("<musrview_show_fourier>") && data[i].contains("</musrview_show_fourier>")) {
if (fMusrviewShowFourier) if (fMusrviewShowFourier)
data[i] = " <musrview_show_fourier>y</musrview_show_fourier>"; data[i] = " <musrview_show_fourier>y</musrview_show_fourier>";
@ -1013,17 +1017,23 @@ int PAdmin::savePrefs(QString pref_fln)
else else
data[i] = " <enable_musrt0>n</enable_musrt0>"; data[i] = " <enable_musrt0>n</enable_musrt0>";
} }
if (data[i].contains("<ignore_theme_auto_detection>")) {
if (fIgnoreThemeAutoDetection)
data[i] = " <ignore_theme_auto_detection>y</ignore_theme_auto_detection>";
else
data[i] = " <ignore_theme_auto_detection>n</ignore_theme_auto_detection>";
}
if (data[i].contains("<dark_theme_icons_menu>") && data[i].contains("</dark_theme_icons_menu>")) { if (data[i].contains("<dark_theme_icons_menu>") && data[i].contains("</dark_theme_icons_menu>")) {
if (fDarkThemeIconsMenu) if (fDarkThemeIconsMenu)
data[i] = " <dark_theme_icons_menu>y</dark_theme_icons_menu>"; data[i] = " <dark_theme_icons_menu>y</dark_theme_icons_menu>";
else else
data[i] = " <dark_theme_icons_menu>n</dark_theme_icons_menu>"; data[i] = " <dark_theme_icons_menu>n</dark_theme_icons_menu>";
} }
if (data[i].contains("<dark_theme_icons_toolbar>") && data[i].contains("</dark_theme_icons_toolbar>")) { if (data[i].contains("<dark_theme_icons_toolbar>") && data[i].contains("</dark_theme_icons_toolbar>")) {
if (fDarkThemeIconsToolbar) if (fDarkThemeIconsToolbar)
data[i] = " <dark_theme_icons_toolbar>y</dark_theme_icons_toolbar>"; data[i] = " <dark_theme_icons_toolbar>y</dark_theme_icons_toolbar>";
else else
data[i] = " <dark_theme_icons_toolbar>n</dark_theme_icons_toolbar>"; data[i] = " <dark_theme_icons_toolbar>n</dark_theme_icons_toolbar>";
} }
if (data[i].contains("<font_name>") && data[i].contains("</font_name>")) { if (data[i].contains("<font_name>") && data[i].contains("</font_name>")) {
data[i] = QString(" <font_name>%1</font_name>").arg(fFontName); data[i] = QString(" <font_name>%1</font_name>").arg(fFontName);

View File

@ -71,9 +71,9 @@ class PAdminXMLParser
private: private:
enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot, enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot,
eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eYamlOut,
eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0, eMusrviewShowFourier, eMusrviewShowAvg, eMusrviewShowOneToOne, eEnableMusrT0,
eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eEditW, eEditH, eIgnoreThemeAutoDetection, eDarkThemeIconsMenu, eDarkThemeIconsToolbar, eEditW, eEditH,
eFontName, eFontSize, eExecPath, eDefaultSavePath, eFontName, eFontSize, eExecPath, eDefaultSavePath,
eRecentFile, eBeamline, eInstitute, eFileFormat, eLifetimeCorrection, eRecentFile, eBeamline, eInstitute, eFileFormat, eLifetimeCorrection,
eTheoFuncPixmapPath, eFunc, eFuncName, eFuncComment, eFuncLabel, eTheoFuncPixmapPath, eFunc, eFuncName, eFuncComment, eFuncLabel,
@ -125,11 +125,13 @@ class PAdmin : public QObject
bool getMusrviewShowAvgFlag() { return fMusrviewShowAvg; } bool getMusrviewShowAvgFlag() { return fMusrviewShowAvg; }
bool getMusrviewShowOneToOneFlag() { return fMusrviewShowOneToOne; } bool getMusrviewShowOneToOneFlag() { return fMusrviewShowOneToOne; }
bool getEnableMusrT0Flag() { return fEnableMusrT0; } bool getEnableMusrT0Flag() { return fEnableMusrT0; }
bool getYamlOutFlag() { return fYamlOut; }
bool getKeepMinuit2OutputFlag() { return fKeepMinuit2Output; } bool getKeepMinuit2OutputFlag() { return fKeepMinuit2Output; }
bool getDumpAsciiFlag() { return fDumpAscii; } bool getDumpAsciiFlag() { return fDumpAscii; }
bool getDumpRootFlag() { return fDumpRoot; } bool getDumpRootFlag() { return fDumpRoot; }
bool getEstimateN0Flag() { return fEstimateN0; } bool getEstimateN0Flag() { return fEstimateN0; }
bool getChisqPerRunBlockFlag() { return fChisqPreRunBlock; } bool getChisqPerRunBlockFlag() { return fChisqPreRunBlock; }
bool getIgnoreThemeAutoDetection() { return fIgnoreThemeAutoDetection; }
bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu; } bool getDarkThemeIconsMenuFlag() { return fDarkThemeIconsMenu; }
bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar; } bool getDarkThemeIconsToolbarFlag() { return fDarkThemeIconsToolbar; }
int getEditWidth() { return fEditWidth; } int getEditWidth() { return fEditWidth; }
@ -157,7 +159,9 @@ class PAdmin : public QObject
void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; } void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; }
void setDumpRootFlag(const bool flag) { fDumpRoot = flag; } void setDumpRootFlag(const bool flag) { fDumpRoot = flag; }
void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; } void setEstimateN0Flag(const bool flag) { fEstimateN0 = flag; }
void setYamlOutFlag(const bool flag) { fYamlOut = flag; }
void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; } void setChisqPerRunBlockFlag(const bool flag) { fChisqPreRunBlock = flag; }
void setIgnoreThemeAutoDetection(const bool flag) { fIgnoreThemeAutoDetection = flag; }
void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; } void setDarkThemeIconsMenuFlag(const bool flag) { fDarkThemeIconsMenu = flag; }
void setDarkThemeIconsToolbarFlag(const bool flag) { fDarkThemeIconsToolbar = flag; } void setDarkThemeIconsToolbarFlag(const bool flag) { fDarkThemeIconsToolbar = flag; }
void setEditWidth(const int width) { fEditWidth = width; } void setEditWidth(const int width) { fEditWidth = width; }
@ -184,30 +188,32 @@ class PAdmin : public QObject
private: private:
friend class PAdminXMLParser; friend class PAdminXMLParser;
int fTimeout; ///< timeout in seconds int fTimeout{3600}; ///< timeout in seconds
QString fFontName; ///< default font name QString fFontName{QString("Monospace")}; ///< default font name
int fFontSize; ///< default font size int fFontSize{11}; ///< default font size
QString fPrefPathName; ///< path-name of the musredit_startup.xml QString fPrefPathName{QString("")}; ///< path-name of the musredit_startup.xml
QString fExecPath; ///< system path to the musrfit executables QString fExecPath{QString("")}; ///< system path to the musrfit executables
QString fDefaultSavePath; ///< default path where the msr-file should be saved QString fDefaultSavePath{QString("")}; ///< default path where the msr-file should be saved
QString fTheoFuncPixmapPath; ///< path where the default pixmaps can be found QString fTheoFuncPixmapPath{QString("")}; ///< path where the default pixmaps can be found
QVector<QString> fRecentFile; ///< keep vector of recent path-file names QVector<QString> fRecentFile; ///< keep vector of recent path-file names
bool fMusrviewShowFourier; ///< flag indicating if musrview should show at startup data (=false) or Fourier of data (=true). bool fMusrviewShowFourier{false}; ///< flag indicating if musrview should show at startup data (=false) or Fourier of data (=true).
bool fMusrviewShowAvg; ///< flag indicating if musrview should show at startup averaged (=true) or original (=false) data/Fourier. bool fMusrviewShowAvg{false}; ///< flag indicating if musrview should show at startup averaged (=true) or original (=false) data/Fourier.
bool fMusrviewShowOneToOne; ///< flag indicating if theory points are calculate only at the data points (=true) or a higher density theory points is calculated bool fMusrviewShowOneToOne{false}; ///< flag indicating if theory points are calculate only at the data points (=true) or a higher density theory points is calculated
bool fKeepMinuit2Output; ///< flag indicating if the Minuit2 output shall be kept (default: no) bool fKeepMinuit2Output{false}; ///< flag indicating if the Minuit2 output shall be kept (default: no)
bool fDumpAscii; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no). bool fDumpAscii{false}; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no).
bool fDumpRoot; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no). bool fDumpRoot{false}; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no).
bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes). bool fTitleFromDataFile{true}; ///< 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 fChisqPreRunBlock{false}; ///< 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 fEstimateN0{true}; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes).
bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes). bool fYamlOut{false}; ///< flag indicating if the MINUIT2.OUTPUT file should also be written as <msr-file>.yaml output. (default: no).
bool fDarkThemeIconsMenu; ///< flag indicating if dark theme icons shall be used in the menu (default: no) bool fEnableMusrT0{true}; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes).
bool fDarkThemeIconsToolbar; ///< flag indicating if dark theme icons shall be used in the toolbar (default: no) bool fIgnoreThemeAutoDetection{false}; ///< flag indicating that the theme autodetection shall be ignored. (default: no)
bool fDarkThemeIconsMenu{false}; ///< flag indicating if dark theme icons shall be used in the menu (default: no)
bool fDarkThemeIconsToolbar{false}; ///< flag indicating if dark theme icons shall be used in the toolbar (default: no)
int fEditWidth{900}; ///< startup edit width int fEditWidth{900}; ///< startup edit width
int fEditHeight{800}; ///< startup edit height int fEditHeight{800}; ///< startup edit height

View File

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

View File

@ -59,6 +59,12 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
fDarkThemeIconsToolbar_checkBox->setCheckState(Qt::Unchecked); fDarkThemeIconsToolbar_checkBox->setCheckState(Qt::Unchecked);
} }
if (fAdmin->getIgnoreThemeAutoDetection()) {
fIgnoreThemeAutoDetection_checkBox->setCheckState(Qt::Checked);
} else {
fIgnoreThemeAutoDetection_checkBox->setCheckState(Qt::Unchecked);
}
fKeepMn2Output_checkBox->setChecked(fAdmin->getKeepMinuit2OutputFlag()); fKeepMn2Output_checkBox->setChecked(fAdmin->getKeepMinuit2OutputFlag());
if (fAdmin->getDumpAsciiFlag() && !fAdmin->getDumpRootFlag()) { if (fAdmin->getDumpAsciiFlag() && !fAdmin->getDumpRootFlag()) {
@ -76,6 +82,7 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin)
fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag()); fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag());
fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag()); fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag());
fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag()); fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag());
fYamlOut_checkBox->setChecked(fAdmin->getYamlOutFlag());
fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag()); fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag());
fAvg_checkBox->setChecked(fAdmin->getMusrviewShowAvgFlag()); fAvg_checkBox->setChecked(fAdmin->getMusrviewShowAvgFlag());
fOneToOne_checkBox->setChecked(fAdmin->getMusrviewShowOneToOneFlag()); fOneToOne_checkBox->setChecked(fAdmin->getMusrviewShowOneToOneFlag());

View File

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

View File

@ -88,11 +88,11 @@
PTextEdit::PTextEdit( QWidget *parent ) PTextEdit::PTextEdit( QWidget *parent )
: QMainWindow( parent ) : QMainWindow( parent )
{ {
bool gotTheme = getTheme();
// reads and manages the conents of the xml-startup (musredit_startup.xml) file // reads and manages the conents of the xml-startup (musredit_startup.xml) file
fAdmin = std::make_unique<PAdmin>(); fAdmin = std::make_unique<PAdmin>();
bool gotTheme = getTheme();
// set default setting of the fDarkMenuIconIcons only if a theme has been recognized, otherwise take the // set default setting of the fDarkMenuIconIcons only if a theme has been recognized, otherwise take the
// one from the xml startup file. // one from the xml startup file.
if (gotTheme) { if (gotTheme) {
@ -117,8 +117,6 @@ PTextEdit::PTextEdit( QWidget *parent )
} }
// initialize stuff // initialize stuff
//as35 fMusrT0Action = nullptr;
fMsr2DataParam = nullptr; fMsr2DataParam = nullptr;
fFindReplaceData = nullptr; fFindReplaceData = nullptr;
@ -127,6 +125,7 @@ PTextEdit::PTextEdit( QWidget *parent )
setupEditActions(); setupEditActions();
setupTextActions(); setupTextActions();
setupMusrActions(); setupMusrActions();
setupJumpToBlock();
setupHelpActions(); setupHelpActions();
fTabWidget = std::make_unique<QTabWidget>( this ); fTabWidget = std::make_unique<QTabWidget>( this );
@ -135,7 +134,6 @@ PTextEdit::PTextEdit( QWidget *parent )
textFamily(fAdmin->getFontName()); textFamily(fAdmin->getFontName());
textSize(QString("%1").arg(fAdmin->getFontSize())); textSize(QString("%1").arg(fAdmin->getFontSize()));
fFontChanging = false;
QString iconName(""); QString iconName("");
if (fDarkMenuIcon) if (fDarkMenuIcon)
@ -164,12 +162,6 @@ PTextEdit::PTextEdit( QWidget *parent )
*/ */
void PTextEdit::aboutToQuit() void PTextEdit::aboutToQuit()
{ {
/* //as35
if (fMusrT0Action) {
delete fMusrT0Action;
fMusrT0Action = nullptr;
}
*/ //as35
if (fMsr2DataParam) { if (fMsr2DataParam) {
delete fMsr2DataParam; delete fMsr2DataParam;
fMsr2DataParam = nullptr; fMsr2DataParam = nullptr;
@ -965,6 +957,31 @@ void PTextEdit::setupHelpActions()
menu->addAction(a); 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. * <p>load a msr-file.
@ -981,6 +998,7 @@ void PTextEdit::load( const QString &f, const int index )
// create a new text edit object // create a new text edit object
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() ); PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize())); edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
// place the text edit object at the appropriate tab position // place the text edit object at the appropriate tab position
if (index == -1) if (index == -1)
@ -1165,6 +1183,7 @@ void PTextEdit::fileNew()
{ {
PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() ); PSubTextEdit *edit = new PSubTextEdit( fAdmin.get() );
edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize())); edit->setFont(QFont(fAdmin->getFontName(), fAdmin->getFontSize()));
edit->setCenterOnScroll(true);
doConnections( edit ); doConnections( edit );
fTabWidget->addTab( edit, tr( "noname" ) ); fTabWidget->addTab( edit, tr( "noname" ) );
fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit)); fTabWidget->setCurrentIndex(fTabWidget->indexOf(edit));
@ -1398,18 +1417,18 @@ void PTextEdit::fileSavePrefs()
QString msg(""); QString msg("");
QMessageBox msgBox; QMessageBox msgBox;
msgBox.setText("Which Preferences do you want to open?"); msgBox.setText("Which Preferences do you want to open?");
msgBox.addButton("Default", QMessageBox::AcceptRole); QAbstractButton *def = msgBox.addButton("Default", QMessageBox::AcceptRole);
msgBox.addButton("Custom", QMessageBox::AcceptRole); QAbstractButton *cust = msgBox.addButton("Custom", QMessageBox::AcceptRole);
msgBox.setStandardButtons(QMessageBox::Cancel); msgBox.setStandardButtons(QMessageBox::Cancel);
int result = msgBox.exec(); int result = msgBox.exec();
if (result == QMessageBox::Cancel) { if (result == QMessageBox::Cancel) {
return; return;
} else if (result == 0) { // default dir } else if (msgBox.clickedButton() == def) { // default dir
fln = fAdmin->getDefaultPrefPathName(); fln = fAdmin->getDefaultPrefPathName();
msg = QString("Current Default Preferences Path-Name:\n") + fln; msg = QString("Current Default Preferences Path-Name:\n") + fln;
if (QMessageBox::information(this, "INFO", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel) if (QMessageBox::information(this, "INFO", msg, QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
return; return;
} else if (result == 1) { // custom dir } else if (msgBox.clickedButton() == cust) { // custom dir
fln = QFileDialog::getSaveFileName( this, fln = QFileDialog::getSaveFileName( this,
tr( "Save Prefs As" ), "musredit_startup.xml", tr( "Save Prefs As" ), "musredit_startup.xml",
tr( "xml-Files (*.xml);;All Files (*)" ) ); tr( "xml-Files (*.xml);;All Files (*)" ) );
@ -2108,6 +2127,11 @@ void PTextEdit::musrFit()
cmd.append("--estimateN0"); cmd.append("--estimateN0");
} }
// check yamlOut flag
if (fAdmin->getYamlOutFlag()) {
cmd.append("--yaml");
}
// check per-run-block-chisq flag // check per-run-block-chisq flag
if (fAdmin->getChisqPerRunBlockFlag()) { if (fAdmin->getChisqPerRunBlockFlag()) {
cmd.append("--per-run-block-chisq"); cmd.append("--per-run-block-chisq");
@ -2184,6 +2208,7 @@ void PTextEdit::musrMsr2Data()
fMsr2DataParam->keepMinuit2Output = fAdmin->getKeepMinuit2OutputFlag(); fMsr2DataParam->keepMinuit2Output = fAdmin->getKeepMinuit2OutputFlag();
fMsr2DataParam->titleFromDataFile = fAdmin->getTitleFromDataFileFlag(); fMsr2DataParam->titleFromDataFile = fAdmin->getTitleFromDataFileFlag();
fMsr2DataParam->estimateN0 = fAdmin->getEstimateN0Flag(); fMsr2DataParam->estimateN0 = fAdmin->getEstimateN0Flag();
fMsr2DataParam->yamlOut = fAdmin->getYamlOutFlag();
fMsr2DataParam->perRunBlockChisq = fAdmin->getChisqPerRunBlockFlag(); fMsr2DataParam->perRunBlockChisq = fAdmin->getChisqPerRunBlockFlag();
PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data")); PMsr2DataDialog *dlg = new PMsr2DataDialog(fMsr2DataParam, fAdmin->getHelpUrl("msr2data"));
@ -2206,6 +2231,7 @@ void PTextEdit::musrMsr2Data()
fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output); fAdmin->setKeepMinuit2OutputFlag(fMsr2DataParam->keepMinuit2Output);
fAdmin->setTitleFromDataFileFlag(fMsr2DataParam->titleFromDataFile); fAdmin->setTitleFromDataFileFlag(fMsr2DataParam->titleFromDataFile);
fAdmin->setEstimateN0Flag(fMsr2DataParam->estimateN0); fAdmin->setEstimateN0Flag(fMsr2DataParam->estimateN0);
fAdmin->setYamlOutFlag(fMsr2DataParam->yamlOut);
fAdmin->setChisqPerRunBlockFlag(fMsr2DataParam->perRunBlockChisq); fAdmin->setChisqPerRunBlockFlag(fMsr2DataParam->perRunBlockChisq);
// analyze parameters // analyze parameters
@ -2336,6 +2362,11 @@ void PTextEdit::musrMsr2Data()
cmd.append("-e"); 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 // write per-run-block chisq. Add flag only if a fit is done
if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) { if (fMsr2DataParam->perRunBlockChisq && (fMsr2DataParam->fitOnly || fMsr2DataParam->templateRunNo != -1)) {
cmd.append("-p"); cmd.append("-p");
@ -2691,6 +2722,7 @@ void PTextEdit::musrPrefs()
} }
if (dlg->exec() == QDialog::Accepted) { if (dlg->exec() == QDialog::Accepted) {
fAdmin->setIgnoreThemeAutoDetection(dlg->getIgnoreThemeAutoDetection());
fAdmin->setDarkThemeIconsMenuFlag(dlg->getDarkThemeIconsMenuFlag()); fAdmin->setDarkThemeIconsMenuFlag(dlg->getDarkThemeIconsMenuFlag());
fAdmin->setDarkThemeIconsToolbarFlag(dlg->getDarkThemeIconsToolbarFlag()); fAdmin->setDarkThemeIconsToolbarFlag(dlg->getDarkThemeIconsToolbarFlag());
fAdmin->setMusrviewShowFourierFlag(dlg->getMusrviewShowFourierFlag()); fAdmin->setMusrviewShowFourierFlag(dlg->getMusrviewShowFourierFlag());
@ -2713,6 +2745,7 @@ void PTextEdit::musrPrefs()
fAdmin->setTimeout(dlg->getTimeout()); fAdmin->setTimeout(dlg->getTimeout());
fAdmin->setChisqPerRunBlockFlag(dlg->getKeepRunPerBlockChisqFlag()); fAdmin->setChisqPerRunBlockFlag(dlg->getKeepRunPerBlockChisqFlag());
fAdmin->setEstimateN0Flag(dlg->getEstimateN0Flag()); fAdmin->setEstimateN0Flag(dlg->getEstimateN0Flag());
fAdmin->setYamlOutFlag(dlg->getYamlOutFlag());
} }
delete dlg; delete dlg;
@ -3278,12 +3311,35 @@ void PTextEdit::setFileSystemWatcherActive()
fFileSystemWatcherActive = true; 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 * @brief PTextEdit::getTheme
*/ */
bool PTextEdit::getTheme() bool PTextEdit::getTheme()
{ {
if (fAdmin->getIgnoreThemeAutoDetection())
return false;
fDarkMenuIcon = false; // true if theme is dark fDarkMenuIcon = false; // true if theme is dark
fDarkToolBarIcon = false; // needed for ubuntu dark since there the menu icons are dark, however the toolbar icons are plain! fDarkToolBarIcon = false; // needed for ubuntu dark since there the menu icons are dark, however the toolbar icons are plain!
@ -3315,10 +3371,9 @@ bool PTextEdit::getTheme()
if (str.contains("dark", Qt::CaseInsensitive)) { if (str.contains("dark", Qt::CaseInsensitive)) {
fDarkMenuIcon = true; fDarkMenuIcon = true;
if (str.contains("ubuntu", Qt::CaseInsensitive)) { if (str.contains("ubuntu", Qt::CaseInsensitive) ||
fDarkMenuIcon = false; str.contains("xfce", Qt::CaseInsensitive) ||
fDarkToolBarIcon = false; str.contains("mx", Qt::CaseInsensitive)) {
} else if (str.contains("xfce", Qt::CaseInsensitive)) {
fDarkMenuIcon = false; fDarkMenuIcon = false;
fDarkToolBarIcon = false; fDarkToolBarIcon = false;
} else { } else {

View File

@ -30,6 +30,8 @@
#ifndef _PTEXTEDIT_H_ #ifndef _PTEXTEDIT_H_
#define _PTEXTEDIT_H_ #define _PTEXTEDIT_H_
#include <memory>
#include <QAction> #include <QAction>
#include <QMainWindow> #include <QMainWindow>
#include <QString> #include <QString>
@ -46,8 +48,6 @@
#include <QtDebug> #include <QtDebug>
#include <memory>
#include "PAdmin.h" #include "PAdmin.h"
#include "musredit.h" #include "musredit.h"
@ -86,6 +86,7 @@ private:
void setupTextActions(); void setupTextActions();
void setupMusrActions(); void setupMusrActions();
void setupHelpActions(); void setupHelpActions();
void setupJumpToBlock();
void load( const QString &f, const int index=-1 ); void load( const QString &f, const int index=-1 );
PSubTextEdit *currentEditor() const; PSubTextEdit *currentEditor() const;
void doConnections( PSubTextEdit *e ); void doConnections( PSubTextEdit *e );
@ -167,16 +168,18 @@ private slots:
void fileChanged(const QString &fileName); void fileChanged(const QString &fileName);
void setFileSystemWatcherActive(); void setFileSystemWatcherActive();
void jumpToBlock(int idx);
private: private:
bool fDarkMenuIcon; ///< flag indicating if a dark or plain icon shall be used in the menu pull-downs bool fDarkMenuIcon{false}; ///< 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 bool fDarkToolBarIcon{false}; ///< flag indicating if a dark or plain icon shall be used in the toolbar
std::unique_ptr<PAdmin> fAdmin; ///< pointer to the xml-startup file informations. Needed for different purposes like default working- and executable directories etc. std::unique_ptr<PAdmin> fAdmin; ///< pointer to the xml-startup file informations. Needed for different purposes like default working- and executable directories etc.
std::unique_ptr<QFileSystemWatcher> fFileSystemWatcher; ///< checks if msr-files are changing on the disk while being open in musredit. std::unique_ptr<QFileSystemWatcher> fFileSystemWatcher; ///< checks if msr-files are changing on the disk while being open in musredit.
bool fFileSystemWatcherActive; ///< flag to enable/disable the file system watcher bool fFileSystemWatcherActive; ///< flag to enable/disable the file system watcher
QTimer fFileSystemWatcherTimeout; ///< timer used to re-enable file system watcher. Needed to delay the re-enabling QTimer fFileSystemWatcherTimeout; ///< timer used to re-enable file system watcher. Needed to delay the re-enabling
QString fLastDirInUse; ///< string holding the path from where the last file was loaded. QString fLastDirInUse{QString("")}; ///< string holding the path from where the last file was loaded.
QStringList fMusrFTPrevCmd; QStringList fMusrFTPrevCmd;
int fEditW, fEditH; int fEditW{900}, fEditH{800};
QMap<QString, QAction*> fActions; QMap<QString, QAction*> fActions;
std::unique_ptr<QAction> fMusrT0Action; std::unique_ptr<QAction> fMusrT0Action;
@ -186,7 +189,8 @@ private:
std::unique_ptr<QComboBox> fComboFont; ///< combo box for the font selector std::unique_ptr<QComboBox> fComboFont; ///< combo box for the font selector
std::unique_ptr<QComboBox> fComboSize; ///< combo box for the font size 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 bool fFontChanging{false}; ///< 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 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 QMap<PSubTextEdit*, QString> fFilenames; ///< mapper between tab widget object and filename

View File

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

View File

@ -9,8 +9,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>452</width> <width>460</width>
<height>180</height> <height>200</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -20,279 +20,293 @@
<iconset> <iconset>
<normaloff>:/images/musrfit.xpm</normaloff>:/images/musrfit.xpm</iconset> <normaloff>:/images/musrfit.xpm</normaloff>:/images/musrfit.xpm</iconset>
</property> </property>
<widget class="QWidget" name="layoutWidget_0"> <layout class="QHBoxLayout" name="horizontalLayout_3">
<property name="geometry"> <item>
<rect> <layout class="QVBoxLayout" name="verticalLayout">
<x>0</x> <item>
<y>5</y> <widget class="QTabWidget" name="fTabWidget">
<width>451</width> <property name="currentIndex">
<height>171</height> <number>0</number>
</rect> </property>
</property> <widget class="QWidget" name="fGeneral_tab">
<layout class="QVBoxLayout" name="verticalLayout"> <attribute name="title">
<item> <string>general</string>
<widget class="QTabWidget" name="fTabWidget"> </attribute>
<property name="currentIndex"> <widget class="QPushButton" name="fDefaultPath_pushButton">
<number>2</number> <property name="geometry">
</property> <rect>
<widget class="QWidget" name="fGeneral_tab"> <x>10</x>
<attribute name="title"> <y>80</y>
<string>general</string> <width>421</width>
</attribute> <height>31</height>
<widget class="QPushButton" name="fDefaultPath_pushButton"> </rect>
<property name="geometry"> </property>
<rect> <property name="text">
<x>10</x> <string>Change Default Search Paths</string>
<y>70</y> </property>
<width>421</width> </widget>
<height>31</height> <widget class="QWidget" name="">
</rect> <property name="geometry">
</property> <rect>
<property name="text"> <x>10</x>
<string>Change Default Search Paths</string> <y>10</y>
</property> <width>416</width>
<height>61</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="fTimeout_lineEdit"/>
</item>
<item>
<widget class="QLabel" name="fTimeout_label">
<property name="text">
<string>timeout</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>38</width>
<height>30</height>
</size>
</property>
</spacer>
</item>
<item>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<widget class="QCheckBox" name="fIgnoreThemeAutoDetection_checkBox">
<property name="text">
<string>Ignore Theme Auto Detect</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fDarkThemeIconsMenu_checkBox">
<property name="text">
<string>Dark Theme Icons Menu</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="fDarkThemeIconsToolbar_checkBox">
<property name="text">
<string>Dark Theme Icons Toolbar</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget> </widget>
<widget class="QWidget" name="layoutWidget"> <widget class="QWidget" name="fMusrfit_tab">
<property name="geometry"> <attribute name="title">
<rect> <string>musrfit</string>
<x>12</x> </attribute>
<y>10</y> <widget class="QCheckBox" name="fKeepMn2Output_checkBox">
<width>415</width> <property name="geometry">
<height>62</height> <rect>
</rect> <x>10</x>
</property> <y>10</y>
<layout class="QHBoxLayout" name="horizontalLayout_2"> <width>161</width>
<item> <height>23</height>
<widget class="QLineEdit" name="fTimeout_lineEdit"/> </rect>
</item> </property>
<item> <property name="text">
<widget class="QLabel" name="fTimeout_label"> <string>keep minuit2 output</string>
<property name="text"> </property>
<string>timeout</string> </widget>
</property> <widget class="QCheckBox" name="fDumpAscii_checkBox">
</widget> <property name="geometry">
</item> <rect>
<item> <x>10</x>
<spacer name="horizontalSpacer_2"> <y>35</y>
<property name="orientation"> <width>151</width>
<enum>Qt::Horizontal</enum> <height>23</height>
</property> </rect>
<property name="sizeHint" stdset="0"> </property>
<size> <property name="text">
<width>38</width> <string>dump ascii</string>
<height>30</height> </property>
</size> </widget>
</property> <widget class="QCheckBox" name="fDumpRoot_checkBox">
</spacer> <property name="geometry">
</item> <rect>
<item> <x>10</x>
<layout class="QVBoxLayout" name="verticalLayout_2"> <y>60</y>
<item> <width>131</width>
<widget class="QCheckBox" name="fDarkThemeIconsMenu_checkBox"> <height>23</height>
<property name="text"> </rect>
<string>Dark Theme Icons Menu</string> </property>
</property> <property name="text">
</widget> <string>dump root</string>
</item> </property>
<item> </widget>
<widget class="QCheckBox" name="fDarkThemeIconsToolbar_checkBox"> <widget class="QCheckBox" name="fTitleFromData_checkBox">
<property name="text"> <property name="geometry">
<string>Dark Theme Icons Toolbar</string> <rect>
</property> <x>170</x>
</widget> <y>10</y>
</item> <width>161</width>
</layout> <height>23</height>
</item> </rect>
</layout> </property>
<property name="text">
<string>take title from data file</string>
</property>
</widget>
<widget class="QCheckBox" name="fPerRunBlockChisq_checkBox">
<property name="geometry">
<rect>
<x>170</x>
<y>35</y>
<width>181</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>keep per run block chisq</string>
</property>
</widget>
<widget class="QCheckBox" name="fEstimateN0_checkBox">
<property name="geometry">
<rect>
<x>170</x>
<y>60</y>
<width>171</width>
<height>22</height>
</rect>
</property>
<property name="text">
<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">
<string>musrview</string>
</attribute>
<widget class="QCheckBox" name="fFourier_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>421</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>start with Fourier</string>
</property>
</widget>
<widget class="QCheckBox" name="fAvg_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>421</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>start with averaged data/Fourier</string>
</property>
</widget>
<widget class="QCheckBox" name="fOneToOne_checkBox">
<property name="geometry">
<rect>
<x>260</x>
<y>10</y>
<width>181</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>theo at data points only</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrt0_tab">
<attribute name="title">
<string>musrt0</string>
</attribute>
<widget class="QCheckBox" name="fEnableMusrT0_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>131</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>enable it</string>
</property>
</widget>
</widget> </widget>
</widget> </widget>
<widget class="QWidget" name="fMusrfit_tab"> </item>
<attribute name="title"> <item>
<string>musrfit</string> <layout class="QHBoxLayout" name="horizontalLayout">
</attribute> <item>
<widget class="QCheckBox" name="fKeepMn2Output_checkBox"> <widget class="QPushButton" name="fHelp_pushButton">
<property name="geometry"> <property name="text">
<rect> <string>&amp;Help</string>
<x>10</x> </property>
<y>10</y> </widget>
<width>161</width> </item>
<height>23</height> <item>
</rect> <spacer name="horizontalSpacer">
</property> <property name="orientation">
<property name="text"> <enum>Qt::Horizontal</enum>
<string>keep minuit2 output</string> </property>
</property> <property name="sizeHint" stdset="0">
</widget> <size>
<widget class="QCheckBox" name="fDumpAscii_checkBox"> <width>88</width>
<property name="geometry"> <height>20</height>
<rect> </size>
<x>10</x> </property>
<y>35</y> </spacer>
<width>151</width> </item>
<height>23</height> <item>
</rect> <widget class="QPushButton" name="fOk_pushButton">
</property> <property name="text">
<property name="text"> <string>&amp;OK</string>
<string>dump ascii</string> </property>
</property> </widget>
</widget> </item>
<widget class="QCheckBox" name="fDumpRoot_checkBox"> <item>
<property name="geometry"> <widget class="QPushButton" name="fCancel_pushButton">
<rect> <property name="text">
<x>10</x> <string>&amp;Cancel</string>
<y>60</y> </property>
<width>131</width> </widget>
<height>23</height> </item>
</rect> </layout>
</property> </item>
<property name="text"> </layout>
<string>dump root</string> </item>
</property> </layout>
</widget>
<widget class="QCheckBox" name="fTitleFromData_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<y>10</y>
<width>241</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>take title from data file</string>
</property>
</widget>
<widget class="QCheckBox" name="fPerRunBlockChisq_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<y>35</y>
<width>241</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>keep per run block chisq</string>
</property>
</widget>
<widget class="QCheckBox" name="fEstimateN0_checkBox">
<property name="geometry">
<rect>
<x>190</x>
<y>60</y>
<width>241</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>estimate N0</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrview_tab">
<attribute name="title">
<string>musrview</string>
</attribute>
<widget class="QCheckBox" name="fFourier_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>421</width>
<height>22</height>
</rect>
</property>
<property name="text">
<string>start with Fourier</string>
</property>
</widget>
<widget class="QCheckBox" name="fAvg_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>40</y>
<width>421</width>
<height>21</height>
</rect>
</property>
<property name="text">
<string>start with averaged data/Fourier</string>
</property>
</widget>
<widget class="QCheckBox" name="fOneToOne_checkBox">
<property name="geometry">
<rect>
<x>260</x>
<y>10</y>
<width>181</width>
<height>26</height>
</rect>
</property>
<property name="text">
<string>theo at data points only</string>
</property>
</widget>
</widget>
<widget class="QWidget" name="fMusrt0_tab">
<attribute name="title">
<string>musrt0</string>
</attribute>
<widget class="QCheckBox" name="fEnableMusrT0_checkBox">
<property name="geometry">
<rect>
<x>10</x>
<y>10</y>
<width>131</width>
<height>23</height>
</rect>
</property>
<property name="text">
<string>enable it</string>
</property>
</widget>
</widget>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="fHelp_pushButton">
<property name="text">
<string>&amp;Help</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>88</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="fOk_pushButton">
<property name="text">
<string>&amp;OK</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="fCancel_pushButton">
<property name="text">
<string>&amp;Cancel</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</widget> </widget>
<tabstops> <tabstops>
<tabstop>fTabWidget</tabstop> <tabstop>fTabWidget</tabstop>

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 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 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 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 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 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). bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).

View File

@ -14,10 +14,12 @@
<title_from_data_file>y</title_from_data_file> <title_from_data_file>y</title_from_data_file>
<chisq_per_run_block>n</chisq_per_run_block> <chisq_per_run_block>n</chisq_per_run_block>
<estimate_n0>y</estimate_n0> <estimate_n0>y</estimate_n0>
<yaml_out>n</yaml_out>
<musrview_show_fourier>n</musrview_show_fourier> <musrview_show_fourier>n</musrview_show_fourier>
<musrview_show_avg>n</musrview_show_avg> <musrview_show_avg>n</musrview_show_avg>
<musrview_show_one_to_one>n</musrview_show_one_to_one> <musrview_show_one_to_one>n</musrview_show_one_to_one>
<enable_musrt0>y</enable_musrt0> <enable_musrt0>y</enable_musrt0>
<ignore_theme_auto_detection>n</ignore_theme_auto_detection>
<dark_theme_icons_menu>n</dark_theme_icons_menu> <dark_theme_icons_menu>n</dark_theme_icons_menu>
<dark_theme_icons_toolbar>n</dark_theme_icons_toolbar> <dark_theme_icons_toolbar>n</dark_theme_icons_toolbar>
<edit_w>900</edit_w> <edit_w>900</edit_w>

View File

@ -127,6 +127,7 @@ void musrfit_syntax()
std::cout << std::endl << " (ii) if present under $HOME/.musrfit/"; std::cout << std::endl << " (ii) if present under $HOME/.musrfit/";
std::cout << std::endl << " (iii) if present under $MUSRFITPATH/"; std::cout << std::endl << " (iii) if present under $MUSRFITPATH/";
std::cout << std::endl << " (iv) if present under $ROOTSYS/"; 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 << " --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 << " <type> can be 'ascii', 'root'";
std::cout << std::endl << " --timeout <timeout_tag>: overwrites to predefined timeout of " << timeout << " (sec)."; 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; int status;
bool keep_mn2_output = false; bool keep_mn2_output = false;
bool chisq_only = false; bool chisq_only = false;
bool yaml_out = false;
bool title_from_data_file = false; bool title_from_data_file = false;
bool timeout_enabled = true; bool timeout_enabled = true;
bool reset_startup_file = false; bool reset_startup_file = false;
@ -532,6 +534,8 @@ int main(int argc, char *argv[])
startup_options.estimateN0 = true; startup_options.estimateN0 = true;
} else if (!strcmp(argv[i], "-p") || !strcmp(argv[i], "--per-run-block-chisq")) { } else if (!strcmp(argv[i], "-p") || !strcmp(argv[i], "--per-run-block-chisq")) {
startup_options.writeExpectedChisq = true; 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")) { } else if (!strcmp(argv[i], "-n") || !strcmp(argv[i], "--no-of-cores-avail")) {
#ifdef HAVE_GOMP #ifdef HAVE_GOMP
std::cout << std::endl; std::cout << std::endl;
@ -724,7 +728,7 @@ int main(int argc, char *argv[])
// do fitting // do fitting
std::unique_ptr<PFitter> fitter; std::unique_ptr<PFitter> fitter;
if (success) { 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()) { if (fitter->IsValid()) {
fitter->DoFit(); fitter->DoFit();
if (!fitter->IsScanOnly()) if (!fitter->IsScanOnly())

View File

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