14 Commits
v1.7 ... v1.7.3

Author SHA1 Message Date
eae35a750d updated mud to the newest version and made it Apple Silicon M1 ready. 2021-06-01 17:09:37 +02:00
8cce005fd5 add info on how musrfit is compiled Debug or Release. 2021-05-21 07:44:50 +02:00
86459e586d changed MuSR_td_PSI_bin in order to read old data. Not yet tested. 2021-04-19 11:58:24 +02:00
32c892cad4 add README files for the DummyUsrFcn with an example. 2021-04-19 08:09:53 +02:00
93c537ba22 update of ChangeLog. Increase version number. 2021-04-16 20:53:56 +02:00
5eed60937a add a full dummy user function class with a global part. This can be used as a starting point to develop new polarization functions. Currently no rge-handling present. 2021-04-16 18:32:30 +02:00
f775ef3545 Fix out-of-bound bug pointed out by Ryan McFadden. 2021-04-13 07:33:14 +02:00
fb85d025bb add missing Qt6 flag for the case the user wants to choose himself. 2021-04-13 07:31:01 +02:00
8271192f63 make sure that group has indeed any elements. 2021-04-12 07:50:37 +02:00
cac1415c3e update of the docu. 2021-04-09 15:41:52 +02:00
692e7e44db propagate ROOT_GRTEQ_24 properly to the compile options. 2021-04-09 11:08:35 +02:00
911c31fb1e applies already for 6.24-rc which is 6.23.99, hence the odd adaptation. 2021-04-09 11:07:14 +02:00
c06f510aff changes needed since upcoming ROOT6.24 (minuit2) will break the backward compatibility. 2021-04-09 10:03:34 +02:00
38b289b99f add ROOT version information for better diagnostics. 2021-04-09 09:33:08 +02:00
58 changed files with 1446 additions and 848 deletions

View File

@ -5,30 +5,31 @@ if (CMAKE_VERSION GREATER_EQUAL 3.12)
cmake_policy(SET CMP0075 NEW)
endif (CMAKE_VERSION GREATER_EQUAL 3.12)
project(musrfit VERSION 1.7.0 LANGUAGES C CXX)
project(musrfit VERSION 1.7.2 LANGUAGES C CXX)
#--- musrfit specific options -------------------------------------------------
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
option(ASlibs "build optional ASlibs" OFF)
option(BMWlibs "build optional BMWlibs" OFF)
option(BNMRlibs "build optional beta-NMR libs" OFF)
option(DummyUserFcn "build optional dummy user function" OFF)
option(qt_based_tools "try to install Qt based tools (musredit, musrWiz, musrStep, mupp)" ON)
option(try_OpenMP "try to use OpenMP if available" ON)
# define qt_version with possible values 'auto' or version '3', '4', '5'
# define qt_version with possible values 'auto' or version '3', '4', '5', '6'
set(qt_version AUTO CACHE STRING "provide a specific Qt version to be used.")
set_property(CACHE qt_version PROPERTY STRINGS AUTO 3 4 5)
set_property(CACHE qt_version PROPERTY STRINGS AUTO 3 4 5 6)
#--- set a default build type if none was specified ---------------------------
set(default_build_type "Release")
if(NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
STRING "Choose the type of build." FORCE)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS
"Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
endif ()
#--- perform some checks and generate the config.h ----------------------------
@ -82,6 +83,15 @@ if (ROOT_mathmore_FOUND)
include(${ROOT_USE_FILE})
endif (ROOT_mathmore_FOUND)
#--- the next check is need to set a flag, since root 6.24 (minuit2) breaks
#--- the backwards compatibility. ---------------------------------------------
if (ROOT_VERSION VERSION_LESS "6.23")
set(ROOT_GRTEQ_24 0)
else ()
set(ROOT_GRTEQ_24 1)
endif ()
set(ROOT_GRTEQ_24 ${ROOT_GRTEQ_24} CACHE INTERNAL "ROOT Version check")
#--- check for boost ----------------------------------------------------------
find_package(Boost REQUIRED
COMPONENTS
@ -119,7 +129,7 @@ if (qt_based_tools)
# check for any Qt, i.e. AUTO
if (qt_version STREQUAL AUTO)
# try Qt6
find_package(Qt6Core)
find_package(Qt6Core QUIET)
if (Qt6Core_FOUND)
find_package(Qt6Widgets CONFIG REQUIRED)
find_package(Qt6Xml CONFIG REQUIRED)
@ -129,7 +139,7 @@ if (qt_based_tools)
endif (Qt6Core_FOUND)
# try Qt5
if (NOT Qt6Core_FOUND)
find_package(Qt5Core)
find_package(Qt5Core QUIET)
if (Qt5Core_FOUND)
find_package(Qt5Widgets CONFIG REQUIRED)
find_package(Qt5Xml CONFIG REQUIRED)
@ -302,6 +312,9 @@ if (BNMRlibs)
else (BNMRlibs)
message(" BNMRlibs : no")
endif (BNMRlibs)
if (DummyUserFcn)
message(" PDummyUserFcn : yes")
endif (DummyUserFcn)
if (qt_based_tools)
if (Qt6Core_FOUND)

View File

@ -12,7 +12,19 @@ or
https://bitbucket.org/muonspin/musrfit/commits/all
Release of V1.7.0, 2021/03/30
Release of V1.7.2, 2021/04/16
=============================
add a full dummy user function class with a global part. This can be used as
a starting point to develop new polarization functions.
Currently no rge-handling present.
Release of V1.7.1, 2021/04/09
=============================
update of the docu. More version info. Dealing with the upcoming ROOT V6.24.
Release of V1.7.0, 2021/04/30
=============================
Centralize the rge-handling for user functions.

View File

@ -1,6 +1,11 @@
// config.h
#define PACKAGE_VERSION "@PROJECT_VERSION@"
#define ROOT_VERSION_USED "@ROOT_VERSION@"
#define BUILD_TYPE "@CMAKE_BUILD_TYPE@"
// define to 1 if minor ROOT6 version is >= 24
#define ROOT_GRTEQ_24 @ROOT_GRTEQ_24@
// define to 1 if you have <alloca.h> and it should be used
#cmakedefine HAVE_ALLOCA_H 1

View File

@ -0,0 +1,18 @@
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Simple Example for a User Function *with* a Global Part
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
The source code is found under
<musrfit-dir>src/external/DummyUserFcn
For details see there.
This dummy user function implements an exp(-lambda*t)
in the global part. This is the most efficient way,
since the function time vector is only calculated once
when the parameter (lambda) changes. For all the
subsequent calls a lookup table is used to return the
value of the user function.

View File

@ -0,0 +1,73 @@
FeSe 9p4 TF100 p107apr09_sample*1p02
###############################################################
FITPARAMETER
# Nr. Name Value Step Pos_Error Boundaries
1 Asy 0.2622 -0.0014 0.0014 0 0.33
2 Rate 0.3188 -0.0044 0.0044
3 Field 97.853 -0.056 0.056 0 200
4 Phase_L 178.95 -0.41 0.41
5 Phase_R 1.75 -0.39 0.39
6 N0_L 1097.9 -1.0 1.0
7 N0_R 1159.7 -1.0 1.0
8 Bkg_L 54.47 -0.20 0.20
9 Bkg_R 46.70 -0.19 0.19
###############################################################
THEORY
asymmetry 1
userFcn libPDummyUserFcn PDummyUserFcn 2 (rate)
TFieldCos map1 fun1 (phase frequency)
###############################################################
FUNCTIONS
fun1 = par3 * gamma_mu
###############################################################
GLOBAL
fittype 0 (single histogram fit)
fit 0 8.2
packing 1
###############################################################
RUN ../data/deltat_pta_gpd_0423 PIE1 PSI PSI-BIN (name beamline institute data-file-format)
norm 6
backgr.fit 8
map 4 0 0 0 0 0 0 0 0 0
forward 1
data 165 7965
t0 162.0
RUN ../data/deltat_pta_gpd_0423 PIE1 PSI PSI-BIN (name beamline institute data-file-format)
norm 7
backgr.fit 9
map 5 0 0 0 0 0 0 0 0 0
forward 2
data 205 7965
t0 202.0
###############################################################
COMMANDS
SCALE_N0_BKG TRUE
MINIMIZE
MINOS
SAVE
###############################################################
PLOT 0 (single histo plot)
lifetimecorrection
runs 1 2
range 0.0 9.5 -0.3 0.3
view_packing 25
###############################################################
FOURIER
units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s'
fourier_power 12
apodization NONE # NONE, WEAK, MEDIUM, STRONG
plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
phase par4 par5
range 0.0 200.0
###############################################################
STATISTIC --- 2015-01-05 14:09:47
chisq = 663.9, NDF = 515, chisq/NDF = 1.289169

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Acknowledgements &mdash; musrfit 1.6.5 documentation</title>
<title>Acknowledgements &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="Bugtracking" href="bugtracking.html" />
<link rel="prev" title="MusrRoot - an Extensible Open File Format for μSR" href="musr-root.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="musr-root.html" title="MusrRoot - an Extensible Open File Format for μSR"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -112,12 +112,12 @@ extremely competent way to deal with his projects as well as to deal with the ch
<li class="right" >
<a href="musr-root.html" title="MusrRoot - an Extensible Open File Format for μSR"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>any2many - a Universal μSR-file-format converter &mdash; musrfit 1.6.5 documentation</title>
<title>any2many - a Universal μSR-file-format converter &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="MusrRoot - an Extensible Open File Format for μSR" href="musr-root.html" />
<link rel="prev" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files" href="msr2data.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="msr2data.html" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -102,12 +102,12 @@ For a detailed description see <a class="reference internal" href="user-manual.h
<li class="right" >
<a href="msr2data.html" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bugtracking &mdash; musrfit 1.6.5 documentation</title>
<title>Bugtracking &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="prev" title="Acknowledgements" href="acknowledgement.html" />
</head>
<body>
@ -37,7 +37,7 @@
<li class="right" >
<a href="acknowledgement.html" title="Acknowledgements"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -93,12 +93,12 @@ or send an e-mail to A. Suter at PSI.</p>
<li class="right" >
<a href="acknowledgement.html" title="Acknowledgements"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>How to Cite musrfit? &mdash; musrfit 1.6.5 documentation</title>
<title>How to Cite musrfit? &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="Tutorial for musrfit" href="tutorial.html" />
<link rel="prev" title="Welcome to the musrfit documentation!" href="index.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="index.html" title="Welcome to the musrfit documentation!"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -114,12 +114,12 @@
<li class="right" >
<a href="index.html" title="Welcome to the musrfit documentation!"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -7,7 +7,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &mdash; musrfit 1.6.5 documentation</title>
<title>Index &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -15,7 +15,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
</head>
<body>
<div class="related">
@ -34,7 +34,7 @@
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
accesskey="I">index</a></li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -795,6 +795,10 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-78">rge-handler</a>
</dt>
<dt><a href="setup-standard.html#index-32">root-build-fink</a>
</dt>
@ -802,12 +806,12 @@
<dt><a href="setup-standard.html#index-16">root-build-linux</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="setup-standard.html#index-29">root-build-macports</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="setup-standard.html#index-23">root-build-windows</a>
</dt>
@ -863,7 +867,7 @@
</dt>
<dt><a href="user-manual.html#index-78">technical-musrfit</a>
<dt><a href="user-manual.html#index-79">technical-musrfit</a>
</dt>
@ -990,12 +994,12 @@
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
>index</a></li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Mar 01, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.6.5 documentation</title>
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="#" />
<link rel="top" title="musrfit 1.7.1 documentation" href="#" />
<link rel="next" title="How to Cite musrfit?" href="cite.html" />
</head>
<body>
@ -37,7 +37,7 @@
<li class="right" >
<a href="cite.html" title="How to Cite musrfit?"
accesskey="N">next</a> |</li>
<li><a href="#">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="#">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -180,12 +180,12 @@
<li class="right" >
<a href="cite.html" title="How to Cite musrfit?"
>next</a> |</li>
<li><a href="#">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="#">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Mar 01, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files &mdash; musrfit 1.6.5 documentation</title>
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="any2many - a Universal μSR-file-format converter" href="any2many.html" />
<link rel="prev" title="mupp - μSR Parameter Plotter" href="mupp.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -434,12 +434,12 @@ fit serves as template for the second and so on. The template field stays empty
<li class="right" >
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.6.5 documentation</title>
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files" href="msr2data.html" />
<link rel="prev" title="musredit: the GUI Based Interface to musrfit" href="musredit.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="musredit.html" title="musredit: the GUI Based Interface to musrfit"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -324,12 +324,12 @@ SCRIPT COMMANDS:
<li class="right" >
<a href="musredit.html" title="musredit: the GUI Based Interface to musrfit"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>MusrRoot - an Extensible Open File Format for μSR &mdash; musrfit 1.6.5 documentation</title>
<title>MusrRoot - an Extensible Open File Format for μSR &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="Acknowledgements" href="acknowledgement.html" />
<link rel="prev" title="any2many - a Universal μSR-file-format converter" href="any2many.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="any2many.html" title="any2many - a Universal μSR-file-format converter"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -923,12 +923,12 @@ the entry has been added. The last token, <tt class="docutils literal"><span cla
<li class="right" >
<a href="any2many.html" title="any2many - a Universal μSR-file-format converter"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>musredit: the GUI Based Interface to musrfit &mdash; musrfit 1.6.5 documentation</title>
<title>musredit: the GUI Based Interface to musrfit &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="mupp - μSR Parameter Plotter" href="mupp.html" />
<link rel="prev" title="Setting up musrfit / DKS: High Speed Fitting with GPUs" href="setup-dks.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPUs"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -550,12 +550,12 @@ the corresponding fit parameter value, except the phases where the step will be
<li class="right" >
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPUs"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

Binary file not shown.

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &mdash; musrfit 1.6.5 documentation</title>
<title>Search &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,7 +25,7 @@
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/searchtools.js"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
@ -41,7 +41,7 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -89,12 +89,12 @@
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Mar 01, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

File diff suppressed because one or more lines are too long

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Setting up musrfit / DKS: High Speed Fitting with GPUs &mdash; musrfit 1.6.5 documentation</title>
<title>Setting up musrfit / DKS: High Speed Fitting with GPUs &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="musredit: the GUI Based Interface to musrfit" href="musredit.html" />
<link rel="prev" title="Setting up musrfit on Different Platforms" href="setup-standard.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="setup-standard.html" title="Setting up musrfit on Different Platforms"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -321,12 +321,12 @@ The only thing you need <tt class="docutils literal"><span class="pre">DKS</span
<li class="right" >
<a href="setup-standard.html" title="Setting up musrfit on Different Platforms"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.6.5 documentation</title>
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="Setting up musrfit / DKS: High Speed Fitting with GPUs" href="setup-dks.html" />
<link rel="prev" title="Documentation of user libs (user functions)" href="user-libs.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="user-libs.html" title="Documentation of user libs (user functions)"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -1302,12 +1302,12 @@ $ musrview test-histo-ROOT-NPP.msr
<li class="right" >
<a href="user-libs.html" title="Documentation of user libs (user functions)"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Mar 01, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tutorial for musrfit &mdash; musrfit 1.6.5 documentation</title>
<title>Tutorial for musrfit &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="User manual" href="user-manual.html" />
<link rel="prev" title="How to Cite musrfit?" href="cite.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="cite.html" title="How to Cite musrfit?"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -443,12 +443,12 @@ For a complete description please refer to the manuals of <a class="reference in
<li class="right" >
<a href="cite.html" title="How to Cite musrfit?"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documentation of user libs (user functions) &mdash; musrfit 1.6.5 documentation</title>
<title>Documentation of user libs (user functions) &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="Setting up musrfit on Different Platforms" href="setup-standard.html" />
<link rel="prev" title="User manual" href="user-manual.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="user-manual.html" title="User manual"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -662,12 +662,12 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<li class="right" >
<a href="user-manual.html" title="User manual"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Jan 23, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>User manual &mdash; musrfit 1.6.5 documentation</title>
<title>User manual &mdash; musrfit 1.7.1 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -14,7 +14,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.5',
VERSION: '1.7.1',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,7 +24,7 @@
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.6.5 documentation" href="index.html" />
<link rel="top" title="musrfit 1.7.1 documentation" href="index.html" />
<link rel="next" title="Documentation of user libs (user functions)" href="user-libs.html" />
<link rel="prev" title="Tutorial for musrfit" href="tutorial.html" />
</head>
@ -41,7 +41,7 @@
<li class="right" >
<a href="tutorial.html" title="Tutorial for musrfit"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
@ -2450,9 +2450,152 @@ parallelized and the operator() is expected to evaluate to reasonable values for
In case this cannot be ensured, the parallelization can be disabled by <em>&#8211;disable-omp</em> on the configure level of the program installation.</p>
</div>
</div>
<div class="section" id="rge-file-handler-for-low-energy-mgrsr">
<span id="rge-handler"></span><span id="index-78"></span><h3>rge-file handler for Low-Energy μSR<a class="headerlink" href="#rge-file-handler-for-low-energy-mgrsr" title="Permalink to this headline"></a></h3>
<p>In the case of LE-μSR, the muon stopping distribution might have a profound impact on the muon polarization function <span class="math">\(P(t)\)</span>. In case of transverse field μSR measurements it can be written as</p>
<div class="math">
\[P(t) = \int_0^\infty n(z) \cos(\gamma_\mu B(z) t + \varphi) \, dz\]</div>
<p>where <span class="math">\(n(z)\)</span> is the normaized muon stopping distribution obtained from the Monte-Carlo code <tt class="docutils literal"><span class="pre">TRIM.SP</span></tt>. Normalized means</p>
<div class="math">
\[\int_0^\infty n(z) \, dz = 1.\]</div>
<p><span class="math">\(\gamma_\mu = 2 \pi \times 135.54\)</span> MHz/T is the gyromagnetic ratio of the muon and <span class="math">\(\varphi\)</span>
is the initial phase of the muon spins with respect to the positron detector. Typically <span class="math">\(B(z)\)</span> is the function which needs to be dealt with in a specific user function. A simple example would be the Meissner screening of a superconductor, for which</p>
<div class="math">
\[B(z) = B_0\, \exp(-z/\lambda),\]</div>
<p>with <span class="math">\(B_0\)</span> being the applied magnetic field, and <span class="math">\(\lambda\)</span> is the magnetic penetration depth.</p>
<p>This means that one needs to deal with the <span class="math">\(n(z)\)</span> objects in all these user functions. <span class="math">\(n(z)\)</span> does not only depend on the depth, but also on the implantation energy <span class="math">\(E_{\rm impl}\)</span>. For a real experiment this means that one is calculating a collection (various energies) of muon stopping distribution profiles with <tt class="docutils literal"><span class="pre">TRIM.SP</span></tt>. In the language of <tt class="docutils literal"><span class="pre">TRIM.SP</span></tt>, these files are called rge-files.</p>
<p>Since this is often needed in a detailed analysis of LE-μSR spectra, there is a special rge-file handler class implemented which deals with the loading, normalization and interpolation of these <span class="math">\(n(z, E_{\rm impl})\)</span> objects. The essential user-interface of this class with the name <tt class="docutils literal"><span class="pre">PRgeHandler</span></tt> is given
here:</p>
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="k">class</span> <span class="nc">PRgeHandler</span> <span class="o">:</span> <span class="k">public</span> <span class="n">TObject</span>
<span class="p">{</span>
<span class="k">public</span><span class="o">:</span>
<span class="n">PRgeHandler</span><span class="p">(</span><span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">fln</span><span class="o">=</span><span class="s">&quot;&quot;</span><span class="p">);</span>
<span class="k">virtual</span> <span class="o">~</span><span class="n">PRgeHandler</span><span class="p">()</span> <span class="p">{}</span>
<span class="k">virtual</span> <span class="kt">bool</span> <span class="n">IsValid</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="n">fValid</span><span class="p">;</span> <span class="p">}</span>
<span class="k">virtual</span> <span class="n">PRgeDataList</span> <span class="n">GetRgeData</span><span class="p">()</span> <span class="p">{</span> <span class="k">return</span> <span class="n">fData</span><span class="p">;</span> <span class="p">}</span>
<span class="k">virtual</span> <span class="n">Double_t</span> <span class="n">GetZmax</span><span class="p">(</span><span class="k">const</span> <span class="n">Double_t</span> <span class="n">energy</span><span class="p">);</span>
<span class="k">virtual</span> <span class="n">Double_t</span> <span class="nf">GetZmax</span><span class="p">(</span><span class="k">const</span> <span class="n">Int_t</span> <span class="n">idx</span><span class="p">);</span>
<span class="k">virtual</span> <span class="n">Double_t</span> <span class="nf">Get_n</span><span class="p">(</span><span class="k">const</span> <span class="n">Double_t</span> <span class="n">energy</span><span class="p">,</span> <span class="k">const</span> <span class="n">Double_t</span> <span class="n">z</span><span class="p">);</span>
<span class="k">virtual</span> <span class="n">Double_t</span> <span class="nf">Get_n</span><span class="p">(</span><span class="k">const</span> <span class="n">Int_t</span> <span class="n">idx</span><span class="p">,</span> <span class="k">const</span> <span class="n">Double_t</span> <span class="n">z</span><span class="p">);</span>
<span class="k">virtual</span> <span class="n">Int_t</span> <span class="nf">GetEnergyIndex</span><span class="p">(</span><span class="k">const</span> <span class="n">Double_t</span> <span class="n">energy</span><span class="p">);</span>
<span class="k">private</span><span class="o">:</span>
<span class="kt">bool</span> <span class="n">fValid</span><span class="p">{</span><span class="nb">false</span><span class="p">};</span>
<span class="n">PRgeDataList</span> <span class="n">fData</span><span class="p">;</span>
<span class="k">virtual</span> <span class="kt">bool</span> <span class="nf">ReadRgeFile</span><span class="p">(</span><span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">string</span> <span class="n">fln</span><span class="p">,</span> <span class="n">PRgeData</span> <span class="o">&amp;</span><span class="n">data</span><span class="p">);</span>
<span class="p">};</span>
</pre></div>
</div>
<p>The rge-file objects are loaded internally (see below) and can easily be accessed via this interface. The <span class="math">\(n(z, E_{\rm impl})\)</span> data can either be accessed via <tt class="docutils literal"><span class="pre">Get_n(const</span> <span class="pre">Double_t</span> <span class="pre">energy,</span> <span class="pre">const</span> <span class="pre">Double_t</span> <span class="pre">z)</span></tt>, i.e. via the implantation energy (given in eV), or via <tt class="docutils literal"><span class="pre">Get_n(const</span> <span class="pre">Int_t</span> <span class="pre">idx,</span> <span class="pre">const</span> <span class="pre">Double_t</span> <span class="pre">z)</span></tt> with the index <tt class="docutils literal"><span class="pre">idx</span></tt> which is the energy index of the collection. Both this routines deliver <span class="math">\(n(z, E_{\rm impl})\)</span> in normalized form. The on via the energy index is slightly more efficient. The routine <tt class="docutils literal"><span class="pre">GetEnergyIndex(const</span> <span class="pre">Double_t</span> <span class="pre">energy)</span></tt> allows the get the proper energy index of the collection.</p>
<p>In order that class can find the rge-files at runtime, a xml-file is needed when calling the constructor. Very often, specific user-function need some additional input which is not delivered via the msr-files, but via a startup xml-file. In this case the rge-file will be just a part of the startup xml-file. For instance in the case of the Nonlocal Meissner screening user-function class, this looks like this</p>
<div class="highlight-xml"><div class="highlight"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="nt">&lt;nonlocal</span> <span class="na">xmlns=</span><span class="s">&quot;http://nemu.web.psi.ch/musrfit/nonlocal&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;comment&gt;</span>
Fourier and TrimSp information
<span class="nt">&lt;/comment&gt;</span>
<span class="nt">&lt;nonlocal_par&gt;</span>
<span class="nt">&lt;fourier_points&gt;</span>262144<span class="nt">&lt;/fourier_points&gt;</span>
<span class="nt">&lt;/nonlocal_par&gt;</span>
<span class="nt">&lt;trim_sp&gt;</span>
<span class="nt">&lt;data_path&gt;</span>./profiles/<span class="nt">&lt;/data_path&gt;</span>
<span class="nt">&lt;rge_fln_pre&gt;</span>Sn_E<span class="nt">&lt;/rge_fln_pre&gt;</span>
<span class="nt">&lt;energy_list&gt;</span>
<span class="nt">&lt;energy&gt;</span>1000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>2000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>4000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>6000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>8000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>10000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>12000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>14100<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>18000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>22000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>25000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>27300<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;/energy_list&gt;</span>
<span class="nt">&lt;/trim_sp&gt;</span>
<span class="nt">&lt;/nonlocal&gt;</span>
</pre></div>
</div>
<p>The relevant portion for the rge-file handler class is starting with the xml tag <tt class="docutils literal"><span class="pre">&lt;trim_sp&gt;</span></tt> and contains four further tags:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">&lt;data_path&gt;</span></tt>: Here the path where to find the rge-files needs to be given</li>
<li><tt class="docutils literal"><span class="pre">&lt;rge_fln_pre&gt;</span></tt>: Start portion of the rge-file name.</li>
<li><tt class="docutils literal"><span class="pre">&lt;energy_list&gt;</span></tt>: This will embrace all the implantation energies available.</li>
<li><tt class="docutils literal"><span class="pre">&lt;energy&gt;</span></tt>: A single energy (in eV)</li>
</ul>
<p>In the given example the files are searched for in the sub-directory call <tt class="docutils literal"><span class="pre">profiles</span></tt> of the current directory. The rge-files have file names like
<tt class="docutils literal"><span class="pre">Sn_E1000.rge</span></tt>, <tt class="docutils literal"><span class="pre">Sn_E2000.rge</span></tt>, etc.</p>
<p>In the aforementioned Nonlocal Meissner screening class, in the constructor you will find the following invocation of the rge-handler object:</p>
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">PNL_PippardFitterGlobal</span><span class="o">::</span><span class="n">PNL_PippardFitterGlobal</span><span class="p">()</span>
<span class="p">{</span>
<span class="p">...</span>
<span class="c1">// load all the TRIM.SP rge-files</span>
<span class="n">fRgeHandler</span> <span class="o">=</span> <span class="k">new</span> <span class="n">PRgeHandler</span><span class="p">(</span><span class="s">&quot;./nonlocal_startup.xml&quot;</span><span class="p">);</span>
<span class="k">if</span> <span class="p">(</span><span class="o">!</span><span class="n">fRgeHandler</span><span class="o">-&gt;</span><span class="n">IsValid</span><span class="p">())</span> <span class="p">{</span>
<span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;&gt;&gt; PNL_PippardFitterGlobal::PNL_PippardFitterGlobal **PANIC ERROR**&quot;</span><span class="p">;</span>
<span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;&gt;&gt; rge data handler too unhappy. Will terminate unfriendly, sorry.&quot;</span><span class="p">;</span>
<span class="n">std</span><span class="o">::</span><span class="n">cout</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="n">fValid</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span>
<span class="p">}</span>
<span class="p">...</span>
<span class="p">}</span>
</pre></div>
</div>
<p>And in the <tt class="docutils literal"><span class="pre">operator()</span></tt> function call which calculates the muon spin polarization, it will look like this</p>
<div class="highlight-c++"><div class="highlight"><pre><span></span><span class="n">Double_t</span> <span class="n">PNL_PippardFitter</span><span class="o">::</span><span class="k">operator</span><span class="p">()(</span><span class="n">Double_t</span> <span class="n">t</span><span class="p">,</span> <span class="k">const</span> <span class="n">std</span><span class="o">::</span><span class="n">vector</span><span class="o">&lt;</span><span class="n">Double_t</span><span class="o">&gt;</span> <span class="o">&amp;</span><span class="n">param</span><span class="p">)</span> <span class="k">const</span>
<span class="p">{</span>
<span class="p">...</span>
<span class="c1">// calculate field if parameter have changed</span>
<span class="n">fPippardFitterGlobal</span><span class="o">-&gt;</span><span class="n">CalculateField</span><span class="p">(</span><span class="n">param</span><span class="p">);</span>
<span class="n">Int_t</span> <span class="n">energyIndex</span> <span class="o">=</span> <span class="n">fPippardFitterGlobal</span><span class="o">-&gt;</span><span class="n">GetEnergyIndex</span><span class="p">(</span><span class="n">param</span><span class="p">[</span><span class="mi">0</span><span class="p">]);</span>
<span class="k">if</span> <span class="p">(</span><span class="n">energyIndex</span> <span class="o">==</span> <span class="o">-</span><span class="mi">1</span><span class="p">)</span> <span class="p">{</span> <span class="c1">// energy not found</span>
<span class="n">std</span><span class="o">::</span><span class="n">cerr</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span> <span class="o">&lt;&lt;</span> <span class="s">&quot;&gt;&gt; PNL_PippardFitter::operator() energy &quot;</span> <span class="o">&lt;&lt;</span> <span class="n">param</span><span class="p">[</span><span class="mi">0</span><span class="p">]</span> <span class="o">&lt;&lt;</span> <span class="s">&quot; not found. Will terminate.&quot;</span> <span class="o">&lt;&lt;</span> <span class="n">std</span><span class="o">::</span><span class="n">endl</span><span class="p">;</span>
<span class="n">assert</span><span class="p">(</span><span class="mi">0</span><span class="p">);</span>
<span class="p">}</span>
<span class="p">...</span>
<span class="c1">// calcualte polarization</span>
<span class="n">Bool_t</span> <span class="n">done</span> <span class="o">=</span> <span class="nb">false</span><span class="p">;</span>
<span class="n">Double_t</span> <span class="n">pol</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">,</span> <span class="n">dPol</span> <span class="o">=</span> <span class="mf">0.0</span><span class="p">;</span>
<span class="n">Double_t</span> <span class="n">z</span><span class="o">=</span><span class="mf">0.0</span><span class="p">;</span>
<span class="n">Int_t</span> <span class="n">terminate</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="n">Double_t</span> <span class="n">dz</span> <span class="o">=</span> <span class="mf">1.0</span><span class="p">;</span>
<span class="k">do</span> <span class="p">{</span>
<span class="k">if</span> <span class="p">(</span><span class="n">z</span> <span class="o">&lt;</span> <span class="n">param</span><span class="p">[</span><span class="mi">8</span><span class="p">])</span> <span class="p">{</span> <span class="c1">// z &lt; dead-layer</span>
<span class="n">dPol</span> <span class="o">=</span> <span class="n">fPippardFitterGlobal</span><span class="o">-&gt;</span><span class="n">GetMuonStoppingDensity</span><span class="p">(</span><span class="n">energyIndex</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span> <span class="o">*</span> <span class="n">cos</span><span class="p">(</span><span class="n">GAMMA_MU</span> <span class="o">*</span> <span class="n">param</span><span class="p">[</span><span class="mi">6</span><span class="p">]</span> <span class="o">*</span> <span class="n">t</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="mi">7</span><span class="p">]</span> <span class="o">*</span> <span class="n">DEGREE2RAD</span><span class="p">);</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="n">dPol</span> <span class="o">=</span> <span class="n">fPippardFitterGlobal</span><span class="o">-&gt;</span><span class="n">GetMuonStoppingDensity</span><span class="p">(</span><span class="n">energyIndex</span><span class="p">,</span> <span class="n">z</span><span class="p">)</span> <span class="o">*</span> <span class="n">cos</span><span class="p">(</span><span class="n">GAMMA_MU</span> <span class="o">*</span> <span class="n">param</span><span class="p">[</span><span class="mi">6</span><span class="p">]</span> <span class="o">*</span> <span class="n">fPippardFitterGlobal</span><span class="o">-&gt;</span><span class="n">GetMagneticField</span><span class="p">(</span><span class="n">z</span><span class="o">-</span><span class="n">param</span><span class="p">[</span><span class="mi">8</span><span class="p">])</span> <span class="o">*</span> <span class="n">t</span> <span class="o">+</span> <span class="n">param</span><span class="p">[</span><span class="mi">7</span><span class="p">]</span> <span class="o">*</span> <span class="n">DEGREE2RAD</span><span class="p">);</span>
<span class="p">}</span>
<span class="n">z</span> <span class="o">+=</span> <span class="n">dz</span><span class="p">;</span>
<span class="n">pol</span> <span class="o">+=</span> <span class="n">dPol</span><span class="p">;</span>
<span class="c1">// change in polarization is very small hence start termination counting</span>
<span class="k">if</span> <span class="p">(</span><span class="n">fabs</span><span class="p">(</span><span class="n">dPol</span><span class="p">)</span> <span class="o">&lt;</span> <span class="mf">1.0e-9</span><span class="p">)</span> <span class="p">{</span>
<span class="n">terminate</span><span class="o">++</span><span class="p">;</span>
<span class="p">}</span> <span class="k">else</span> <span class="p">{</span>
<span class="n">terminate</span> <span class="o">=</span> <span class="mi">0</span><span class="p">;</span>
<span class="p">}</span>
<span class="k">if</span> <span class="p">(</span><span class="n">terminate</span> <span class="o">&gt;</span> <span class="mi">10</span><span class="p">)</span> <span class="c1">// polarization died out hence one can stop</span>
<span class="n">done</span> <span class="o">=</span> <span class="nb">true</span><span class="p">;</span>
<span class="p">}</span> <span class="k">while</span> <span class="p">(</span><span class="o">!</span><span class="n">done</span><span class="p">);</span>
<span class="k">return</span> <span class="n">pol</span><span class="o">*</span><span class="n">dz</span><span class="p">;</span>
<span class="p">}</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="technical-description-of-the-musrfit-framework">
<span id="technical-musrfit"></span><span id="index-78"></span><h2>Technical Description of the musrfit framework<a class="headerlink" href="#technical-description-of-the-musrfit-framework" title="Permalink to this headline"></a></h2>
<span id="technical-musrfit"></span><span id="index-79"></span><h2>Technical Description of the musrfit framework<a class="headerlink" href="#technical-description-of-the-musrfit-framework" title="Permalink to this headline"></a></h2>
<p>A technical description of the musrfit framework can be found on its own <a class="reference external" href="http://lmu.web.psi.ch/musrfit/technical/index.html">docu</a>.</p>
</div>
</div>
@ -2505,6 +2648,7 @@ In case this cannot be ensured, the parallelization can be disabled by <em>&#821
<li><a class="reference internal" href="#id38">User Functions</a><ul>
<li><a class="reference internal" href="#user-function-without-global-user-function-object-access">User Function without global user-function-object access</a></li>
<li><a class="reference internal" href="#user-function-with-global-user-function-object-access">User Function with global user-function-object access</a></li>
<li><a class="reference internal" href="#rge-file-handler-for-low-energy-mgrsr">rge-file handler for Low-Energy μSR</a></li>
</ul>
</li>
<li><a class="reference internal" href="#technical-description-of-the-musrfit-framework">Technical Description of the musrfit framework</a></li>
@ -2552,12 +2696,12 @@ In case this cannot be ensured, the parallelization can be disabled by <em>&#821
<li class="right" >
<a href="tutorial.html" title="Tutorial for musrfit"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.5 documentation</a> &raquo;</li>
<li><a href="index.html">musrfit 1.7.1 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2021, Andreas Suter.
Last updated on Feb 26, 2021.
Last updated on Apr 09, 2021.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -197,7 +197,7 @@ int main(int argc, char *argv[])
any2many_syntax();
else if (strstr(argv[1], "--v")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "any2many version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "any2many version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "any2many git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif

View File

@ -159,6 +159,11 @@ target_include_directories(
PRgeHandler BEFORE PRIVATE $<BUILD_INTERFACE:${MUSRFIT_INC}>
)
#--- add ROOT Version >= 6.24 compile options if needed -----------------------
if (ROOT_GRTEQ_24)
target_compile_options(PMusr BEFORE PRIVATE "-DROOT_GRTEQ_24")
endif(ROOT_GRTEQ_24)
#--- add OpenMP compile options if needed -------------------------------------
if (OpenMP_FOUND)
target_compile_options(PMusr PUBLIC ${OpenMP_CXX_FLAGS})

View File

@ -1840,7 +1840,11 @@ Bool_t PFitter::ExecutePrintLevel(UInt_t lineNo)
return false;
}
#ifdef ROOT_GRTEQ_24
ROOT::Minuit2::MnPrint::SetGlobalLevel(fPrintLevel);
#else
ROOT::Minuit2::MnPrint::SetLevel(fPrintLevel);
#endif
// clean up
if (tokens) {

View File

@ -6668,13 +6668,18 @@ void PMsrHandler::MakeDetectorGroupingString(TString str, PIntVector &group, TSt
str = "";
}
if (group.size()==0)
return;
UInt_t i=0, j=0;
do {
j = i;
while (group[j]+1 == group[j+1]) {
j++;
if (j == group.size()-1)
break;
if (j+1 < group.size()) {
while (group[j]+1 == group[j+1]) {
j++;
if (j == group.size()-1)
break;
}
}
if (j >= i+2) {

View File

@ -776,7 +776,7 @@ int main(int argc, char *argv[])
return 0;
} else if (!strcmp(argv[i], "--version") || !strcmp(argv[i], "-v")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "dump_header version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "dump_header version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "dump_header git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif

View File

@ -29,3 +29,7 @@ if (nexus)
add_subdirectory(nexus)
endif (nexus)
if (DummyUserFcn)
add_subdirectory(DummyUserFcn)
endif (DummyUserFcn)

View File

@ -0,0 +1 @@
add_subdirectory(src)

99
src/external/DummyUserFcn/README vendored Normal file
View File

@ -0,0 +1,99 @@
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
Simple Example for a User Function *with* a Global Part
/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/
This is a full implementation of a user function with a global part.
For a general intro to user function, please check the manual under
http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#id38
The implemented user function is
exp(-lambda*t)
with lambda, being the only parameter.
Short description of the PDummyUserFcn and PDummyUserFcnGlobal classes.
PDummyUserFcn:
-------------
This class derives from the PUserFcnBase which is necessary to make this
user function available to musrfit.
The three functions:
virtual Bool_t NeedGlobalPart() const { return true; }
virtual void SetGlobalPart(std::vector<void*> &globalPart, UInt_t idx);
virtual Bool_t GlobalPartIsValid() const;
are used to bind the global part of the user function.
The method
virtual Double_t operator()(Double_t t, const std::vector<Double_t> &param) const;
is called by musrfit when evaluate the function.
The private variables:
Bool_t fValid{true};
Bool_t fInvokedGlobal{false};
Int_t fIdxGlobal;
PDummyUserFcnGlobal *fDummyUserFcnGlobal{nullptr};
have the following purpose:
fValid is a boolean variable holding the state of the user function.
If true, it means that the user function is useable. In case
something would go wrong during the initialization stage fValid
is set to false, and no calculation will take place!
fInvokedGlobal is a boolean variable which is set to true is the global
part of the user function is properly invoked.
fIdxGlobal holds the index of the global user function part.
PDummyUserFcnGlobal:
-------------------
This class holds the gloabl user function part, which handles the actual
calculation of the user function.
CalculatePol(const std::vector<Double_t> &param) const; -> carries out the
necessary calculations of this user function. This is ONLY carried
out if the parameter set has changed!
GetPolValue(const Double_t t) const; -> This is used in the operator() of
the user function to get the value of the user function (here a
value of a polarization function exp()).
mutable std::vector<Double_t> fPreviousParam; -> holds the previous
parmeter set in order to check if a parameter set has changed.
mutable std::vector<Double_t> fPol; -> lookup table for the polarization
function for the current parameter set.
How to build:
------------
When configure musrfit, there is a switch DummyUserFcn available which
needs to be enabled (default: OFF), e.g.
cmake ../ -DCMAKE_INSTALL_PREFIX=$ROOTSYS -Dnexus=1 -DDummyUserFcn=1
Files:
-----
CMakeLists.txt <- this File is needed to allow to build an install
this dummy example with the cmake build system.
inc/PDummyUserFcn.h <- header file definig the needed classes for
the user function and its globale part.
inc/PDummyUserFcnLinkDef.h <- Needed as a glue to generate the necessary
root dictionaries.
src/CMakeLists.txt <- needed for the cmake build/install process.
src/PDummyUserFcn.cpp <- source code which implements all the necessary
parts of the user function.
src/PDummyUserFcn.pc.in <- cmake input file to generate the propoer
pkg-config file for the library

View File

@ -0,0 +1,81 @@
/***************************************************************************
PDummyUserFcn.h
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2013-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _PDUMMYUSERFNC_H_
#define _PDUMMYUSERFNC_H_
#include <vector>
#include "PUserFcnBase.h"
class PDummyUserFcnGlobal
{
public:
PDummyUserFcnGlobal();
virtual ~PDummyUserFcnGlobal();
Bool_t IsValid() { return fValid; }
virtual void CalculatePol(const std::vector<Double_t> &param) const;
virtual Double_t GetPolValue(const Double_t t) const;
private:
Bool_t fValid{true};
mutable std::vector<Double_t> fPreviousParam;
mutable Double_t fTimeStep{1.0e-3}; // time in (us), time step 1 (ns) here
mutable std::vector<Double_t> fPol;
ClassDef(PDummyUserFcnGlobal, 1)
};
class PDummyUserFcn : public PUserFcnBase
{
public:
PDummyUserFcn() {}
virtual ~PDummyUserFcn();
virtual Bool_t NeedGlobalPart() const { return true; }
virtual void SetGlobalPart(std::vector<void*> &globalPart, UInt_t idx);
virtual Bool_t GlobalPartIsValid() const;
virtual Double_t operator()(Double_t t, const std::vector<Double_t> &param) const;
private:
Bool_t fValid{true};
Bool_t fInvokedGlobal{false};
Int_t fIdxGlobal;
PDummyUserFcnGlobal *fDummyUserFcnGlobal{nullptr};
// definition of the class for the ROOT dictionary
ClassDef(PDummyUserFcn, 1)
};
#endif // _PDUMMYUSERFNC_H_

View File

@ -0,0 +1,39 @@
/***************************************************************************
PDummyUserFcnLinkDef.h
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2013-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class PDummyUserFcnGlobal+;
#pragma link C++ class PDummyUserFcn+;
#endif

View File

@ -0,0 +1,78 @@
# - DummyUserFcn library --------------------------------------------------------
#--- generate necessary dictionaries ------------------------------------------
set(MUSRFIT_INC ${CMAKE_SOURCE_DIR}/src/include)
set(DUMMY_USER_FUNC_INC ${CMAKE_CURRENT_SOURCE_DIR}/../inc)
# ROOT requires that the dictonary header files are found at configuration time.
# Hence, target_include_directories cannot be used here because, targets are
# setup only afterwards.
include_directories(${DUMMY_USER_FUNC_INC})
root_generate_dictionary(
PDummyUserFcnDict
PDummyUserFcn.h
OPTIONS
-I${FFTW3_INCLUDE_DIR}
-I${MUSRFIT_INC}
-I${DUMMY_USER_FUNC_INC}
-inlineInputHeader
LINKDEF ${DUMMY_USER_FUNC_INC}/PDummyUserFcnLinkDef.h
MODULE PDummyUserFcn
)
#--- create pkg-config info ---------------------------------------------------
set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "\$\{prefix\}")
set(libdir "\$\{exec_prefix\}/lib")
set(includedir "\$\{prefix\}/include")
set(P_DUMMY_USER_FUNC_VERSION "1.0.0")
set(P_DUMMY_USER_FUNC_LIBRARY_NAME "PDummyUserFcn")
configure_file("PDummyUserFcn.pc.in" "PDummyUserFcn.pc" @ONLY)
#--- lib creation -------------------------------------------------------------
add_library(PDummyUserFcn SHARED
PDummyUserFcn.cpp
PDummyUserFcnDict.cxx
)
#--- set target properties, e.g. version --------------------------------------
set_target_properties(PDummyUserFcn
PROPERTIES
VERSION ${P_DUMMY_USER_FUNC_VERSION}
)
#--- make sure that the include directory is found ----------------------------
target_include_directories(
PDummyUserFcn BEFORE PRIVATE
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${MUSRFIT_INC}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
)
#--- add library dependencies -------------------------------------------------
target_link_libraries(PDummyUserFcn ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} PUserFcnBase)
#--- install PDummyUserFcn solib -------------------------------------------------
install(TARGETS PDummyUserFcn DESTINATION lib)
#--- install root pcm's and rootmaps ------------------------------------------
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/libPDummyUserFcn_rdict.pcm
${CMAKE_CURRENT_BINARY_DIR}/libPDummyUserFcn.rootmap
DESTINATION lib
)
#--- install PDummyUserFcn header ------------------------------------------------
install(
FILES
${CMAKE_CURRENT_SOURCE_DIR}/../inc/PDummyUserFcn.h
DESTINATION
include
)
#--- install pkg-config info --------------------------------------------------
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/PDummyUserFcn.pc
DESTINATION lib/pkgconfig
)

View File

@ -0,0 +1,227 @@
/***************************************************************************
PDummyUserFcn.cpp
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include <cassert>
#include <cmath>
#include <iostream>
#include <TMath.h>
#include "PDummyUserFcn.h"
ClassImp(PDummyUserFcnGlobal)
//--------------------------------------------------------------------------
// Constructor
//--------------------------------------------------------------------------
/**
* <p>Here would go all the stuff which will be needed by the global part.
* For instance specific information which come from a startup XML file.
* This could be case if muon-stopping information is needed for the
* calculation, or any other user function specific stuff which is not
* part of the parameters which will be propagated from the msr-file.
*/
PDummyUserFcnGlobal::PDummyUserFcnGlobal()
{
// nothing needed here for the dummy
}
//--------------------------------------------------------------------------
// Destructor
//--------------------------------------------------------------------------
/**
*
*/
PDummyUserFcnGlobal::~PDummyUserFcnGlobal()
{
fPreviousParam.clear();
fPol.clear();
}
//--------------------------------------------------------------------------
// CalculatePol (public)
//--------------------------------------------------------------------------
/**
* <p>Calculates the polarization function for the dummy user function.
* For the Dummy this is just an exp(-lambda t), where lambda is comming
* from the param.
*
* \param param the parameter for this user function
*/
void PDummyUserFcnGlobal::CalculatePol(const std::vector<Double_t> &param) const
{
// param: [0] lambda
// check that param is new and hence a calculation is needed
Bool_t newParams = false;
if (fPreviousParam.size() == 0) {
for (UInt_t i=0; i<param.size(); i++)
fPreviousParam.push_back(param[i]);
newParams = true;
} else {
assert(param.size() == fPreviousParam.size());
for (UInt_t i=0; i<param.size(); i++) {
if (param[i] != fPreviousParam[i]) {
newParams = true;
break;
}
}
}
if (!newParams)
return;
// keep parameters
for (UInt_t i=0; i<param.size(); i++)
fPreviousParam[i] = param[i];
// calculate the "polarization" in the time interval t = [0, 20] us
Double_t dt = fTimeStep, t = 0.0;
Int_t noOfPoints = 20.0 / dt;
fPol.resize(noOfPoints); // this makes sure that the polarization vector is long enough
for (Int_t i=0; i<noOfPoints; i++) {
t = i*dt;
fPol[i] = exp(-param[0] * i * dt);
}
}
//--------------------------------------------------------------------------
// GetMagneticField
//--------------------------------------------------------------------------
/**
*
*/
Double_t PDummyUserFcnGlobal::GetPolValue(const Double_t t) const
{
Double_t result = -1.0;
if (t < 0)
return 1.0;
if (t >= 20.0)
return 0.0;
Int_t idx = (Int_t)(t/fTimeStep);
if ((idx >=0) && (idx < fPol.size()))
result = fPol[idx];
return result;
}
//++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ClassImp(PDummyUserFcn)
//--------------------------------------------------------------------------
// Destructor
//--------------------------------------------------------------------------
/**
*
*/
PDummyUserFcn::~PDummyUserFcn()
{
if ((fDummyUserFcnGlobal != nullptr) && fInvokedGlobal) {
delete fDummyUserFcnGlobal;
fDummyUserFcnGlobal = nullptr;
}
}
//--------------------------------------------------------------------------
// SetGlobalPart (public)
//--------------------------------------------------------------------------
/**
* <p>
*
* <b>return:</b>
*
* \param globalPart
* \param idx
*/
void PDummyUserFcn::SetGlobalPart(std::vector<void*> &globalPart, UInt_t idx)
{
fIdxGlobal = static_cast<Int_t>(idx);
if ((Int_t)globalPart.size() <= fIdxGlobal) {
fDummyUserFcnGlobal = new PDummyUserFcnGlobal();
if (fDummyUserFcnGlobal == nullptr) {
fValid = false;
std::cerr << std::endl << ">> PDummyUserFcn::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << std::endl;
} else if (!fDummyUserFcnGlobal->IsValid()) {
fValid = false;
std::cerr << std::endl << ">> PDummyUserFcn::SetGlobalPart(): **ERROR** initialization of global user function object failed, sorry ..." << std::endl;
} else {
fValid = true;
fInvokedGlobal = true;
globalPart.resize(fIdxGlobal+1);
globalPart[fIdxGlobal] = dynamic_cast<PDummyUserFcnGlobal*>(fDummyUserFcnGlobal);
}
} else {
fValid = true;
fDummyUserFcnGlobal = (PDummyUserFcnGlobal*)globalPart[fIdxGlobal];
}
}
//--------------------------------------------------------------------------
// GlobalPartIsValid (public)
//--------------------------------------------------------------------------
/**
* <p>
*
* <b>return:</b>
*/
Bool_t PDummyUserFcn::GlobalPartIsValid() const
{
return (fValid && fDummyUserFcnGlobal->IsValid());
}
//--------------------------------------------------------------------------
// operator()
//--------------------------------------------------------------------------
/**
*
*/
Double_t PDummyUserFcn::operator()(Double_t t, const std::vector<Double_t> &param) const
{
// param: [0] lambda
assert(param.size() == 1);
// for negative time return polarization == 1
if (t <= 0.0)
return 1.0;
// calculate field if parameter have changed
fDummyUserFcnGlobal->CalculatePol(param);
// return the lookup table value
return fDummyUserFcnGlobal->GetPolValue(t);
}

View File

@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: PDummyUserFcn
Description: C++ shared library providing the spin valve fitter class
Version: @P_DUMMY_USER_FUNC_VERSION@
Libs: -L${libdir} -l@P_DUMMY_USER_FUNC_LIBRARY_NAME@
Cflags: -I${includedir}

View File

@ -116,6 +116,13 @@ MuSR_td_PSI_bin::MuSR_td_PSI_bin()
file_name.close();
delete [] buffer_file;
if (format_id[0] == '1') {
if (format_id[1] != 'N') {
std::cout << "**WARNING** found '" << format_id << "'. Will change it to '1N'" << std::endl;
format_id[1] = 'N';
}
}
// file may either be PSI binary format
if (strncmp(format_id,"1N",2) == 0)
{
@ -306,6 +313,9 @@ int MuSR_td_PSI_bin::readbin(const char * fileName)
strncpy(format_id,buffer_file,2);
format_id[2] = '\0';
if (format_id[1] != 'N') // the warning is already issued in read()
format_id[1] = 'N';
if (strcmp(format_id,"1N") != 0)
{
file_name.close();

View File

@ -23,10 +23,10 @@
* v1.2 08-Oct-2000 [D. Arseneau] Add MUD_setSizes
* v1.3 22-Apr-2003 [D. Arseneau] Add MUD_openInOut
* 25-Nov-2009 [D. Arseneau] Handle larger size_t
* 04-May-2016 [D. Arseneau] Edits for C++ use
*/
#include <stdio.h>
#include "mud.h"
#ifdef NO_STDARG
@ -35,11 +35,10 @@
#include <stdarg.h>
#endif /* NO_STDARG */
/* #define DEBUG 1 /* un-comment for debug */
/* #define DEBUG 1 */ /* un-comment for debug */
FILE*
MUD_openInput( inFile )
char* inFile;
MUD_openInput( char* inFile )
{
FILE* fin;
@ -53,8 +52,7 @@ MUD_openInput( inFile )
/* This is the same as MUD_openInput except for access mode */
FILE*
MUD_openInOut( inFile )
char* inFile;
MUD_openInOut( char* inFile )
{
FILE* fin;
@ -68,8 +66,7 @@ MUD_openInOut( inFile )
FILE*
MUD_openOutput( outFile )
char* outFile;
MUD_openOutput( char* outFile )
{
FILE* fout;
@ -83,8 +80,7 @@ MUD_openOutput( outFile )
void
MUD_free( pMUD )
void* pMUD;
MUD_free( void* pMUD )
{
if( pMUD != NULL ) MUD_free( ((MUD_SEC*)pMUD)->core.pNext );
else return;
@ -101,10 +97,7 @@ MUD_free( pMUD )
BOOL
MUD_encode( pBuf, pMUD, io_opt )
BUF* pBuf;
void* pMUD;
MUD_IO_OPT io_opt;
MUD_encode( BUF* pBuf, void* pMUD, MUD_IO_OPT io_opt )
{
if( pMUD == NULL ) return( TRUE );
@ -130,7 +123,7 @@ MUD_encode( pBuf, pMUD, io_opt )
printf( "MUD_encode: buf.buf = %08X\n", pBuf->buf );
#endif /* DEBUG */
MUD_CORE_proc( MUD_ENCODE, pBuf, pMUD );
MUD_CORE_proc( MUD_ENCODE, pBuf, (MUD_SEC*)pMUD );
(*((MUD_SEC*)pMUD)->core.proc)( MUD_ENCODE, pBuf, (void*)pMUD );
if( ( MUD_secID( pMUD ) == MUD_SEC_GRP_ID ) &&
@ -155,8 +148,7 @@ MUD_encode( pBuf, pMUD, io_opt )
void*
MUD_decode( pBuf )
BUF* pBuf;
MUD_decode( BUF* pBuf )
{
MUD_SEC* pMUD;
MUD_SEC mud;
@ -199,23 +191,20 @@ MUD_decode( pBuf )
int
MUD_getSize( pMUD )
void* pMUD;
MUD_getSize( void* pMUD )
{
return( MUD_CORE_proc( MUD_GET_SIZE, NULL, pMUD ) +
(*((MUD_SEC*)pMUD)->core.proc)( MUD_GET_SIZE, NULL, (void*)pMUD ) );
return( MUD_CORE_proc( MUD_GET_SIZE, NULL, (MUD_SEC*)pMUD ) +
(*((MUD_SEC*)pMUD)->core.proc)( MUD_GET_SIZE, NULL, pMUD ) );
}
void
MUD_show( pMUD, io_opt )
void* pMUD;
MUD_IO_OPT io_opt;
MUD_show( void* pMUD, MUD_IO_OPT io_opt )
{
if( pMUD == NULL ) return;
MUD_CORE_proc( MUD_SHOW, NULL, pMUD );
(*((MUD_SEC*)pMUD)->core.proc)( MUD_SHOW, NULL, (void*)pMUD );
MUD_CORE_proc( MUD_SHOW, NULL, (MUD_SEC*)pMUD );
(*((MUD_SEC*)pMUD)->core.proc)( MUD_SHOW, NULL, pMUD );
printf( "\n" );
@ -233,14 +222,12 @@ MUD_show( pMUD, io_opt )
}
void
MUD_heads( pMUD, io_opt )
void* pMUD;
MUD_IO_OPT io_opt;
MUD_heads( void* pMUD, MUD_IO_OPT io_opt )
{
if( pMUD == NULL ) return;
MUD_CORE_proc( MUD_HEADS, NULL, pMUD );
(*((MUD_SEC*)pMUD)->core.proc)( MUD_HEADS, NULL, (void*)pMUD );
MUD_CORE_proc( MUD_HEADS, NULL, (MUD_SEC*)pMUD );
(*((MUD_SEC*)pMUD)->core.proc)( MUD_HEADS, NULL, pMUD );
if( ( MUD_secID( pMUD ) == MUD_SEC_GRP_ID ) &&
( io_opt == MUD_ALL ) )
@ -260,8 +247,7 @@ MUD_heads( pMUD, io_opt )
* MUD_writeEnd() - called after all writes to file
*/
BOOL
MUD_writeEnd( fout )
FILE* fout;
MUD_writeEnd( FILE* fout )
{
MUD_SEC_EOF* pMUD_eof;
@ -282,9 +268,7 @@ MUD_writeEnd( fout )
* MUD_writeFile() - use for completely assembled groups/sections
*/
BOOL
MUD_writeFile( fout, pMUD_head )
FILE* fout;
void* pMUD_head;
MUD_writeFile( FILE* fout, void* pMUD_head )
{
rewind( fout );
if( !MUD_write( fout, pMUD_head, MUD_ALL ) ) return( FALSE );
@ -296,10 +280,7 @@ MUD_writeFile( fout, pMUD_head )
* MUD_write() - use for completely assembled groups/sections
*/
BOOL
MUD_write( fout, pMUD, io_opt )
FILE* fout;
void* pMUD;
MUD_IO_OPT io_opt;
MUD_write( FILE* fout, void* pMUD, MUD_IO_OPT io_opt )
{
BUF buf;
@ -328,12 +309,8 @@ MUD_write( fout, pMUD, io_opt )
* MUD_writeEnd()
*/
BOOL
MUD_writeGrpStart( fout, pMUD_parentGrp,
pMUD_grp, numMems )
FILE* fout;
MUD_SEC_GRP* pMUD_parentGrp;
MUD_SEC_GRP* pMUD_grp;
int numMems;
MUD_writeGrpStart( FILE* fout, MUD_SEC_GRP* pMUD_parentGrp,
MUD_SEC_GRP* pMUD_grp, int numMems )
{
pMUD_grp->pParent = pMUD_parentGrp;
@ -352,9 +329,7 @@ MUD_writeGrpStart( fout, pMUD_parentGrp,
void
addIndex( pMUD_grp, pMUD )
MUD_SEC_GRP* pMUD_grp;
void* pMUD;
addIndex( MUD_SEC_GRP* pMUD_grp, void* pMUD )
{
MUD_INDEX** ppMUD_index;
@ -373,10 +348,7 @@ addIndex( pMUD_grp, pMUD )
* MUD_writeGrpMem() - use for writes of unassembled groups
*/
BOOL
MUD_writeGrpMem( fout, pMUD_grp, pMUD )
FILE* fout;
MUD_SEC_GRP* pMUD_grp;
void* pMUD;
MUD_writeGrpMem( FILE* fout, MUD_SEC_GRP* pMUD_grp, void* pMUD )
{
((MUD_SEC*)pMUD)->core.size = MUD_getSize( pMUD );
@ -401,9 +373,7 @@ MUD_writeGrpMem( fout, pMUD_grp, pMUD )
* MUD_writeGrpEnd() - use for writes of unassembled groups
*/
BOOL
MUD_writeGrpEnd( fout, pMUD_grp )
FILE* fout;
MUD_SEC_GRP* pMUD_grp;
MUD_writeGrpEnd( FILE* fout, MUD_SEC_GRP* pMUD_grp )
{
int pos;
@ -425,8 +395,7 @@ MUD_writeGrpEnd( fout, pMUD_grp )
void*
MUD_readFile( fin )
FILE* fin;
MUD_readFile( FILE* fin )
{
rewind( fin );
@ -435,9 +404,7 @@ MUD_readFile( fin )
void*
MUD_read( fin, io_opt )
FILE* fin;
MUD_IO_OPT io_opt;
MUD_read( FILE* fin, MUD_IO_OPT io_opt )
{
BUF buf;
MUD_SEC* pMUD_new;
@ -455,11 +422,13 @@ MUD_read( fin, io_opt )
*/
if( ( pos = ftell( fin ) ) == EOF ) return( NULL );
if( fread( &size, 4, 1, fin ) == 0 ) return( NULL );
#if !defined(__arm64)
bdecode_4( &size, &size ); /* byte ordering !!! */
#endif // !defined(__arm64)
if( fseek( fin, pos, 0 ) == EOF ) return( NULL );
#ifdef DEBUG
printf( "MUD_read: got %d\n", size );
printf( "MUD_read: got %lu\n", (unsigned long)(size) );
printf( " pos = %d\n", pos );
printf( " reading the section ...\n" );
#endif /* DEBUG */
@ -572,8 +541,7 @@ MUD_read( fin, io_opt )
*/
UINT32
MUD_setSizes( pMUD )
void* pMUD;
MUD_setSizes( void* pMUD )
{
MUD_SEC* pMember;
MUD_INDEX* pGrpIndex;
@ -624,8 +592,7 @@ MUD_setSizes( pMUD )
MUD_SEC*
MUD_peekCore( fin )
FILE* fin;
MUD_peekCore( FILE* fin )
{
static MUD_SEC mud;
int pos;
@ -847,12 +814,8 @@ MUD_fseek( FILE* fio, ... )
MUD_SEC*
fseekNext( fio, pMUD_parent,
secID, instanceID )
FILE* fio;
MUD_SEC_GRP* pMUD_parent;
UINT32 secID;
UINT32 instanceID;
fseekNext( FILE* fio, MUD_SEC_GRP* pMUD_parent,
UINT32 secID, UINT32 instanceID )
{
MUD_SEC* pMUD;
MUD_INDEX* pMUD_index;
@ -920,8 +883,7 @@ fseekNext( fio, pMUD_parent,
int
MUD_fseekFirst( fio )
FILE* fio;
MUD_fseekFirst( FILE* fio )
{
int size;
@ -935,9 +897,7 @@ MUD_fseekFirst( fio )
void
MUD_add( ppMUD_head, pMUD_new )
void** ppMUD_head;
void* pMUD_new;
MUD_add( void** ppMUD_head, void* pMUD_new )
{
MUD_SEC** ppMUD;
@ -952,8 +912,7 @@ MUD_add( ppMUD_head, pMUD_new )
int
MUD_totSize( pMUD )
void* pMUD;
MUD_totSize( void* pMUD )
{
return( ( MUD_secID( pMUD ) == MUD_SEC_GRP_ID ) ?
MUD_size( pMUD ) + ((MUD_SEC_GRP*)pMUD)->memSize :
@ -962,14 +921,13 @@ MUD_totSize( pMUD )
void
MUD_addToGroup( pMUD_grp, pMUD )
MUD_SEC_GRP* pMUD_grp;
void* pMUD;
MUD_addToGroup( MUD_SEC_GRP* pMUD_grp, void* pMUD )
{
MUD_SEC** ppMUD;
if( pMUD == NULL ) return;
/* possible addition: ((MUD_SEC*)pMUD)->core.pNext = NULL; */
((MUD_SEC*)pMUD)->core.size = MUD_getSize( pMUD );
for( ppMUD = &pMUD_grp->pMem;
@ -985,9 +943,7 @@ MUD_addToGroup( pMUD_grp, pMUD )
void
MUD_assignCore( pMUD1, pMUD2 )
MUD_SEC* pMUD1;
MUD_SEC* pMUD2;
MUD_assignCore( MUD_SEC* pMUD1, MUD_SEC* pMUD2 )
{
bcopy( &pMUD1->core.size, &pMUD2->core.size,
MUD_CORE_proc( MUD_GET_SIZE, NULL, NULL ) );
@ -995,10 +951,7 @@ MUD_assignCore( pMUD1, pMUD2 )
int
MUD_CORE_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC* pMUD;
MUD_CORE_proc( MUD_OPT op, BUF* pBuf, MUD_SEC* pMUD )
{
int size;
@ -1019,12 +972,13 @@ MUD_CORE_proc( op, pBuf, pMUD )
case MUD_GET_SIZE:
size = 3*sizeof(UINT32);
#ifdef DEBUG
printf("MUD_CORE_proc: MUD_GET_SIZE returns size=%d\n",size);
printf("MUD_CORE_proc: MUD_GET_SIZE returns size=%d\n",size);
#endif /* DEBUG */
return( size );
case MUD_SHOW:
printf( " CORE: size=[%ld], secID=[0x%08lX], instanceID=[0x%08lX]\n",
pMUD->core.size, pMUD->core.secID, pMUD->core.instanceID );
printf( " CORE: size=[%lu], secID=[0x%08lX], instanceID=[0x%08lX]\n",
(unsigned long)(pMUD->core.size), (unsigned long)(pMUD->core.secID),
(unsigned long)(pMUD->core.instanceID) );
break;
case MUD_HEADS:
break;
@ -1034,10 +988,7 @@ MUD_CORE_proc( op, pBuf, pMUD )
int
MUD_INDEX_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_INDEX* pMUD;
MUD_INDEX_proc( MUD_OPT op, BUF* pBuf, MUD_INDEX* pMUD )
{
int size;
@ -1065,8 +1016,9 @@ MUD_INDEX_proc( op, pBuf, pMUD )
size = 3*sizeof(UINT32);
return( size );
case MUD_SHOW:
printf( " INDEX: offset=[%ld], secID=[0x%08lX], instanceID=[0x%08lX]\n",
pMUD->offset, pMUD->secID, pMUD->instanceID );
printf( " INDEX: offset=[%lu], secID=[0x%08lX], instanceID=[0x%08lX]\n",
(unsigned long)(pMUD->offset), (unsigned long)(pMUD->secID),
(unsigned long)(pMUD->instanceID) );
break;
case MUD_HEADS:
break;

View File

@ -1,19 +1,39 @@
#ifndef _MUD_H_
#define _MUD_H_
#ifdef __cplusplus
extern "C" {
#endif
/*
* v1.2
* mud.h Declarations for MUD
* v1.3
*
* Copyright (C) 1994-2021 TRIUMF (Vancouver, Canada)
*
* Authors: T. Whidden, D. Arseneau, S. Daviel
*
* Released under the GNU LGPL - see http://www.gnu.org/licenses
*
* This program is free software; you can distribute it and/or modify it under
* the terms of the Lesser GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or any later version.
* Accordingly, this program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
* or FITNESS FOR A PARTICULAR PURPOSE. See the Lesser GNU General Public License
* for more details.
*
* revisions:
* 01-mar-2000 DJA add UNKNOWN section, with no ID
* 11-oct-2000 DJA add MUD_FMT_RAL_ID; MUD_setSizes
* 22-Apr-2003 DJA add MUD_openReadWrite, MUD_openInOut
* 25-Nov-2009 DJA 64-bit linux
* 25-Jun-2017 DJA Allow use in C++ (ROOT); shared lib.
* 14-Aug-2019 DJA Use stdint.h, casts in printf
*/
#ifdef __cplusplus
extern "C" {
#endif
#ifdef __CINT__
typedef char* caddr_t;
#endif /* __CINT __ */
/*
* FORMAT IDs - Must be unique!
* format of ID is: 0xLLFFSSSS
@ -94,31 +114,49 @@ extern "C" {
#include <stddef.h>
#include <sys/types.h>
#ifndef NOSTDINT
/* If there is no stdint.h, define NOSTDINT, as with "make NOSTDINT=1" */
#include <stdint.h>
#endif
/*
* MUD types
*/
#ifdef _STDINT_H
typedef int STATUS;
typedef int8_t INT8;
typedef uint8_t UINT8;
typedef int16_t INT16;
typedef uint16_t UINT16;
typedef int32_t INT32;
typedef uint32_t UINT32;
typedef float REAL32;
typedef double REAL64;
#else /*no stding.h */
typedef int STATUS;
typedef char INT8;
typedef unsigned char UINT8;
typedef short INT16;
typedef unsigned short UINT16;
#if defined(__alpha) || defined(__x86_64__) || defined(__amd64) || defined(__ia64)
#if defined(__alpha) || defined(__linux) || defined(__MACH__) || defined(__arm64)
typedef int INT32;
typedef unsigned int UINT32;
#else
typedef long INT32;
typedef unsigned long UINT32;
#endif /* defined(__alpha) || defined(__x86_64__) || defined(__amd64) || defined(__ia64) */
#endif /* __alpha || __linux || __MACH__*/
typedef float REAL32;
typedef double REAL64;
#if (defined(__alpha)&&defined(vms)) || defined(__BORLANDC__) || defined(__TURBOC__)
typedef char* caddr_t;
#endif
#endif /* _STDINT_HNOSTDINT */
typedef UINT32 TIME;
#ifndef BOOL_DEFINED
#define BOOL_DEFINED
typedef UINT32 BOOL;
#endif
#if (defined(__alpha)&&defined(vms)) || defined(__BORLANDC__) || defined(__TURBOC__)
typedef char* caddr_t;
#endif
#ifndef FALSE
#define FALSE 0
@ -146,10 +184,10 @@ typedef char* caddr_t;
/*
* c_utils.h, Defines for C utilities
*/
#if defined(vms) || defined(__MSDOS__) || defined(_MSC_VER)
#if defined(vms) || defined(__MSDOS__)
#define bcopy( b1, b2, len ) memcpy(b2,b1,len)
#define bzero( b, len ) memset(b,(char)0,len)
#endif /* vms || __MSDOS__ || _MSC_VER */
#endif /* vms || __MSDOS__ */
#ifndef _C_UTILS_H_ /* conflict with c_utils.h */
#define _max( a, b ) ( ( (a) > (b) ) ? (a) : (b) )
#define _min( a, b ) ( ( (a) < (b) ) ? (a) : (b) )
@ -157,11 +195,12 @@ typedef char* caddr_t;
#define _swap32( l ) (((UINT32)l>>16)+((UINT32)l<<16))
#define _swap16( s ) (((UINT16)s>>8)+((UINT16)s<<8))
#endif
#define _free(objp) if(objp!=NULL){free(objp);objp=NULL;}
#define _roundUp( n, r ) ( (r) * (int)( ((n)+(r)-1) / (r) ) )
#define _free(objp) if((void*)(objp)!=(void*)NULL){free((void*)(objp));objp=NULL;}
#define _roundUp( n, r ) ( (r) * (int)( ((n)+(r)-1) / (r) ) )
#define zalloc( n ) memset((void*)malloc(n),0,n)
#if defined(vms) || (defined(mips)&&!defined(__sgi)) || ((defined(__MSDOS__) || defined(_MSC_VER))&&defined(__STDC__))
#if defined(vms) || (defined(mips)&&!defined(__sgi)) || (defined(__MSDOS__)&&defined(__STDC__))
#define strdup( s ) strcpy((char*)malloc(strlen(s)+1),s)
#endif /* vms || mips&&!sgi */
/*#endif */
@ -388,8 +427,7 @@ typedef struct {
#define MUD_instanceID( pM ) (((MUD_SEC*)pM)->core.instanceID)
#if defined(__MSDOS__) || defined(__i386__) || defined(__i586__) || defined(__i686__) || defined(vax) || defined(__alpha) || defined(__x86_64__) || defined(__amd64) \
|| (defined(__mips)&&!defined(__sgi))
#if defined(__MSDOS__) || defined(__i386__) || defined(__i586__) || defined(__i686__) || defined(vax) || defined(__alpha) || defined(__amd64) || defined(__arm64) || (defined(__mips)&&!defined(__sgi))
#define MUD_LITTLE_ENDIAN 1
#else
#define MUD_BIG_ENDIAN 1
@ -524,9 +562,9 @@ int MUD_SEC_GEN_HIST_unpack _ANSI_ARGS_(( int num , int inBinSize , void* inHist
int MUD_SEC_TRI_TI_RUN_DESC_proc _ANSI_ARGS_(( MUD_OPT op , BUF *pBuf , MUD_SEC_TRI_TI_RUN_DESC *pMUD ));
/* gmf_time.c */
void GMF_MKTIME _ANSI_ARGS_(( time_t* out , INT32* input ));
void GMF_TIME _ANSI_ARGS_(( time_t* out ));
void GMF_LOCALTIME _ANSI_ARGS_(( time_t* in , INT32 *out ));
void GMF_MKTIME _ANSI_ARGS_(( TIME* out , INT32* input ));
void GMF_TIME _ANSI_ARGS_(( TIME* out ));
void GMF_LOCALTIME _ANSI_ARGS_(( TIME* in , INT32 *out ));
/* mud_friendly.c */
int MUD_openRead _ANSI_ARGS_(( char* filename, UINT32* pType ));

View File

@ -27,13 +27,8 @@
int
MUD_SEC_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC* pMUD;
MUD_SEC_proc( MUD_OPT op, BUF* pBuf, MUD_SEC* pMUD )
{
int size;
switch( op )
{
case MUD_FREE:
@ -55,13 +50,8 @@ MUD_SEC_proc( op, pBuf, pMUD )
int
MUD_SEC_EOF_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_EOF* pMUD;
MUD_SEC_EOF_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_EOF* pMUD )
{
int size;
switch( op )
{
case MUD_FREE:
@ -83,10 +73,7 @@ MUD_SEC_EOF_proc( op, pBuf, pMUD )
int
MUD_SEC_FIXED_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_FIXED* pMUD;
MUD_SEC_FIXED_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_FIXED* pMUD )
{
int size;
@ -106,8 +93,8 @@ MUD_SEC_FIXED_proc( op, pBuf, pMUD )
size = 2*sizeof( UINT32 );
return( size );
case MUD_SHOW:
printf( " MUD_SEC_FIXED: fileSize=[%ld], formatID=[0x%08lX]\n",
pMUD->fileSize, pMUD->formatID );
printf( " MUD_SEC_FIXED: fileSize=[%lu], formatID=[0x%08lX]\n",
(unsigned long)(pMUD->fileSize), (unsigned long)(pMUD->formatID) );
break;
case MUD_HEADS:
break;
@ -117,10 +104,7 @@ MUD_SEC_FIXED_proc( op, pBuf, pMUD )
int
MUD_SEC_GRP_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_GRP* pMUD;
MUD_SEC_GRP_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_GRP* pMUD )
{
int size;
int i;
@ -160,7 +144,7 @@ MUD_SEC_GRP_proc( op, pBuf, pMUD )
return( size );
case MUD_SHOW:
printf( " MUD_SEC_GRP: num=[%ld], memSize=%ld\n",
pMUD->num, pMUD->memSize );
(long int)(pMUD->num), (long int)(pMUD->memSize) );
for( pMUD_index = pMUD->pMemIndex;
pMUD_index != NULL;
pMUD_index = pMUD_index->pNext )
@ -178,10 +162,7 @@ MUD_SEC_GRP_proc( op, pBuf, pMUD )
int
MUD_SEC_CMT_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_CMT* pMUD;
MUD_SEC_CMT_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_CMT* pMUD )
{
int size;
char tempStr1[32];
@ -221,8 +202,9 @@ MUD_SEC_CMT_proc( op, pBuf, pMUD )
return( size );
case MUD_SHOW:
printf( " MUD_SEC_CMT: \n" );
printf( " number:[%ld], prevReply:[%ld], nextReply:[%ld]\n",
pMUD->ID, pMUD->prevReplyID, pMUD->nextReplyID );
printf( " number:[%lu], prevReply:[%lu], nextReply:[%lu]\n",
(unsigned long)(pMUD->ID), (unsigned long)(pMUD->prevReplyID),
(unsigned long)(pMUD->nextReplyID) );
bintime = pMUD->time;
strncpy( tempStr1, ctime( &bintime ), sizeof(tempStr1) );
tempStr1[strlen(tempStr1)-1] = '\0';
@ -232,11 +214,11 @@ MUD_SEC_CMT_proc( op, pBuf, pMUD )
if( pMUD->comment ) printf( " comment:\"%s\"\n", pMUD->comment );
break;
case MUD_HEADS:
printf( "Comment number %ld. ", pMUD->ID );
printf( "Comment number %lu. ", (unsigned long)(pMUD->ID) );
if( pMUD->prevReplyID > 0 )
printf(" Re: #%ld. ", pMUD->prevReplyID );
printf(" Re: #%lu. ", (unsigned long)(pMUD->prevReplyID) );
if( pMUD->nextReplyID > 0 )
printf(" Next: #%ld.", pMUD->nextReplyID );
printf(" Next: #%lu.", (unsigned long)(pMUD->nextReplyID) );
printf( "\n" );
bintime = pMUD->time;
strncpy( tempStr1, ctime( &bintime ), sizeof(tempStr1) );
@ -251,13 +233,8 @@ MUD_SEC_CMT_proc( op, pBuf, pMUD )
int
MUD_SEC_UNKNOWN_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_UNKNOWN* pMUD;
MUD_SEC_UNKNOWN_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_UNKNOWN* pMUD )
{
int size;
switch( op )
{
case MUD_FREE:

View File

@ -21,15 +21,11 @@
* license (unrestricted use).
*/
#include <stdio.h>
#include "mud.h"
void
bdecode_2( b, p )
void* b;
void* p;
bdecode_2( void* b, void* p )
{
#ifdef MUD_BIG_ENDIAN
UINT16 i;
@ -42,9 +38,7 @@ bdecode_2( b, p )
}
void
bencode_2( b, p )
void* b;
void* p;
bencode_2( void* b, void* p )
{
#ifdef MUD_BIG_ENDIAN
UINT16 i;
@ -63,9 +57,7 @@ bencode_2( b, p )
}
void
bdecode_4( b, p )
void* b;
void* p;
bdecode_4( void* b,void* p )
{
#ifdef MUD_BIG_ENDIAN
UINT32 i;
@ -78,9 +70,7 @@ bdecode_4( b, p )
}
void
bencode_4( b, p )
void* b;
void* p;
bencode_4( void* b, void* p )
{
#ifdef MUD_BIG_ENDIAN
UINT32 i;
@ -93,9 +83,7 @@ bencode_4( b, p )
}
void
bdecode_8( b, p )
void* b;
void* p;
bdecode_8( void* b, void* p )
{
#ifdef MUD_BIG_ENDIAN
UINT32 i[2], i2[2];
@ -109,9 +97,7 @@ bdecode_8( b, p )
}
void
bencode_8( b, p )
void* b;
void* p;
bencode_8( void* b, void* p )
{
#ifdef MUD_BIG_ENDIAN
UINT32 i[2], i2[2];
@ -126,9 +112,7 @@ bencode_8( b, p )
void
decode_str( pB, ps )
BUF* pB;
char** ps;
decode_str( BUF* pB, char** ps )
{
MUD_STR_LEN_TYPE len;
@ -153,9 +137,7 @@ decode_str( pB, ps )
void
encode_str( pB, ps )
BUF* pB;
char** ps;
encode_str( BUF* pB, char** ps )
{
MUD_STR_LEN_TYPE len;
@ -223,16 +205,13 @@ static struct sgl_limits {
#endif /* !VMS */
void
bencode_float( buf, fp )
char* buf;
float* fp;
bencode_float( char* buf, float* fp )
{
#ifndef VMS
struct ieee_single is;
struct vax_single vs;
struct sgl_limits *lim;
int i;
UINT16 sa[2], sb[2];
#endif /* !VMS */
#ifdef VMS
@ -262,9 +241,7 @@ shipit:
}
void
encode_float( pBuf, fp )
BUF* pBuf;
float* fp;
encode_float( BUF* pBuf, float* fp )
{
bencode_float( &(pBuf->buf[pBuf->pos]), fp );
pBuf->pos += 4;
@ -272,9 +249,7 @@ encode_float( pBuf, fp )
}
void
bdecode_float( buf, fp )
char* buf;
float* fp;
bdecode_float( char* buf, float* fp )
{
#ifndef VMS
struct ieee_single *isp;
@ -315,9 +290,7 @@ shipit:
}
void
decode_float( pBuf, fp )
BUF* pBuf;
float* fp;
decode_float( BUF* pBuf, float* fp )
{
bdecode_float( &(pBuf->buf[pBuf->pos]), fp );
pBuf->pos += 4;
@ -392,16 +365,13 @@ static struct dbl_limits {
void
bencode_double( buf, dp )
char* buf;
double* dp;
bencode_double( char* buf, double* dp )
{
#ifndef VMS
struct ieee_double id;
struct vax_double vd;
register struct dbl_limits *lim;
int i;
UINT16 sa[4], sb[4];
#endif /* !VMS */
#ifdef VMS
@ -434,9 +404,7 @@ shipit:
}
void
encode_double( pBuf, fp )
BUF* pBuf;
double* fp;
encode_double( BUF* pBuf, double* fp )
{
bencode_double( &(pBuf->buf[pBuf->pos]), fp );
pBuf->pos += 8;
@ -444,16 +412,13 @@ encode_double( pBuf, fp )
}
void
bdecode_double( buf, dp )
char* buf;
double* dp;
bdecode_double( char* buf, double* dp )
{
#ifndef VMS
struct ieee_double id, *idp;
struct ieee_double *idp;
struct vax_double vd;
register struct dbl_limits *lim;
int i;
UINT16 sa[4], sb[4];
#endif /* !VMS */
#ifdef VMS
@ -486,9 +451,7 @@ shipit:
}
void
decode_double( pBuf, fp )
BUF* pBuf;
double* fp;
decode_double( BUF* pBuf, double* fp )
{
bdecode_double( &(pBuf->buf[pBuf->pos]), fp );
pBuf->pos += 8;

File diff suppressed because it is too large Load Diff

View File

@ -30,7 +30,7 @@
#include <math.h>
#include "mud.h"
/* #define DEBUG 1 /* (un)comment for debug */
/* #define DEBUG 1 */ /* (un)comment for debug */
#define PACK_OP 1
#define UNPACK_OP 2
static int pack_op;
@ -42,15 +42,11 @@ static void next_few_bins _ANSI_ARGS_(( int num_tot, int inBinSize, void* pHistD
int
MUD_SEC_GEN_RUN_DESC_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_GEN_RUN_DESC* pMUD;
MUD_SEC_GEN_RUN_DESC_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_GEN_RUN_DESC* pMUD )
{
int size;
char tempStr1[32];
char tempStr2[32];
int imin,isec;
time_t bintime;
switch( op )
@ -124,16 +120,16 @@ MUD_SEC_GEN_RUN_DESC_proc( op, pBuf, pMUD )
return( size );
case MUD_SHOW:
printf( " MUD_SEC_GEN_RUN_DESC: expt:[%ld], run:[%ld]\n",
pMUD->exptNumber, pMUD->runNumber );
(long)(pMUD->exptNumber), (long)(pMUD->runNumber) );
bintime = pMUD->timeBegin;
strncpy( tempStr1, ctime( &bintime ), sizeof(tempStr1) );
tempStr1[strlen(tempStr1)-1] = '\0';
bintime = pMUD->timeEnd;
strncpy( tempStr2, ctime( &bintime ), sizeof(tempStr2) );
tempStr2[strlen(tempStr2)-1] = '\0';
printf( " timeBegin:[%s] [%ld]\n", tempStr1, pMUD->timeBegin );
printf( " timeEnd:[%s] [%ld]\n", tempStr2, pMUD->timeEnd );
printf( " elapsedSec:[%ld]\n", pMUD->elapsedSec );
printf( " timeBegin:[%s] [%lu]\n", tempStr1, (unsigned long)(pMUD->timeBegin) );
printf( " timeEnd:[%s] [%lu]\n", tempStr2, (unsigned long)(pMUD->timeEnd) );
printf( " elapsedSec:[%ld]\n", (long)(pMUD->elapsedSec) );
if( pMUD->title ) printf( " title:\"%s\"\n", pMUD->title );
if( pMUD->lab ) printf( " lab:\"%s\"\n", pMUD->lab );
if( pMUD->area ) printf( " area:\"%s\"\n", pMUD->area );
@ -152,8 +148,8 @@ MUD_SEC_GEN_RUN_DESC_proc( op, pBuf, pMUD )
printf( " field:\"%s\"\n", pMUD->field );
break;
case MUD_HEADS:
printf( "Run number: %ld\n", pMUD->runNumber );
printf( " exper num: %ld\n", pMUD->exptNumber );
printf( "Run number: %ld\n", (long)(pMUD->runNumber) );
printf( " exper num: %ld\n", (long)(pMUD->exptNumber) );
if( pMUD->experimenter )
printf( " operator: %s\n", pMUD->experimenter );
if( pMUD->method ) printf( " method: %s\n", pMUD->method );
@ -165,9 +161,9 @@ MUD_SEC_GEN_RUN_DESC_proc( op, pBuf, pMUD )
tempStr2[strlen(tempStr2)-1] = '\0';
printf( " began: %s\n ended: %s\n",
tempStr1, tempStr2 );
printf( " elapsed: %ld:%.2d:%.2d (%ld seconds)\n",
(pMUD->elapsedSec/3600), ((pMUD->elapsedSec%3600)/60), (pMUD->elapsedSec%60),
pMUD->elapsedSec );
printf( " elapsed: %ld:%.2d:%.2d (%lu seconds)\n",
(long)(pMUD->elapsedSec/3600), ((pMUD->elapsedSec%3600)/60), (pMUD->elapsedSec%60),
(unsigned long)(pMUD->elapsedSec) );
if( pMUD->title )
{
if( strlen( pMUD->title ) > 63 && strlen( pMUD->title ) < 80 )
@ -197,10 +193,7 @@ MUD_SEC_GEN_RUN_DESC_proc( op, pBuf, pMUD )
int
MUD_SEC_GEN_HIST_HDR_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_GEN_HIST_HDR* pMUD;
MUD_SEC_GEN_HIST_HDR_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_GEN_HIST_HDR* pMUD )
{
int size;
UINT32 fsBin;
@ -246,28 +239,28 @@ MUD_SEC_GEN_HIST_HDR_proc( op, pBuf, pMUD )
size += sizeof( MUD_STR_LEN_TYPE ) + _strlen( pMUD->title );
return( size );
case MUD_SHOW:
printf( " MUD_SEC_GEN_HIST_HDR: histType:[0x%08lX]\n", pMUD->histType );
printf( " nBytes:[%ld], nBins:[%ld], nEvents:[%ld]\n",
pMUD->nBytes, pMUD->nBins, pMUD->nEvents );
printf( " MUD_SEC_GEN_HIST_HDR: histType:[0x%08lX]\n", (unsigned long)(pMUD->histType) );
printf( " nBytes:[%ld], nBins:[%ld], nEvents:[%lu]\n",
(long)(pMUD->nBytes), (long)(pMUD->nBins), (unsigned long)(pMUD->nEvents) );
printf( " bytesPerBin:[%ld], fsPerBin:[%ld], t0_ps:[%ld], t0_bin:[%ld]\n",
pMUD->bytesPerBin, pMUD->fsPerBin, pMUD->t0_ps, pMUD->t0_bin );
(long)(pMUD->bytesPerBin), (long)(pMUD->fsPerBin), (long)(pMUD->t0_ps), (long)(pMUD->t0_bin) );
printf( " goodBin1:[%ld], goodBin2:[%ld], bkgd1:[%ld], bkgd2:[%ld]\n",
pMUD->goodBin1, pMUD->goodBin2, pMUD->bkgd1, pMUD->bkgd2 );
(long)(pMUD->goodBin1), (long)(pMUD->goodBin2), (long)(pMUD->bkgd1), (long)(pMUD->bkgd2) );
if( pMUD->title ) printf( " title:\"%s\"\n", pMUD->title );
break;
case MUD_HEADS:
if( pMUD->title ) printf( "Hist title: %s\n", pMUD->title );
printf( " nBins: %ld, nEvents: %ld, ",
pMUD->nBins, pMUD->nEvents );
printf( " nBins: %ld, nEvents: %lu, ",
(long)(pMUD->nBins), (unsigned long)(pMUD->nEvents) );
fsBin = pMUD->fsPerBin;
if( fsBin < 16 )
{
nsBin = 0.078125 * pow( (double)2.0, (double)fsBin );
printf( "ns_per_Bin: %.lf\n", nsBin );
printf( "ns_per_Bin: %.6lf\n", nsBin );
}
else if( fsBin < 29 )
{
nsBin = 0.048828125 * pow( (double)2.0, (double)fsBin - 16 );
nsBin = 0.048828125 * pow( (double)2.0, (double)(fsBin - 16) );
printf( "ns_per_Bin: %.9lf\n", nsBin );
}
else
@ -277,9 +270,9 @@ MUD_SEC_GEN_HIST_HDR_proc( op, pBuf, pMUD )
}
printf( " t0_ps: %ld, t0_bin: %ld\n",
pMUD->t0_ps, pMUD->t0_bin );
(long)(pMUD->t0_ps), (long)(pMUD->t0_bin) );
printf( " goodBin1: %ld, goodBin2: %ld, bkgd1: %ld, bkgd2: %ld\n",
pMUD->goodBin1, pMUD->goodBin2, pMUD->bkgd1, pMUD->bkgd2 );
(long)(pMUD->goodBin1), (long)(pMUD->goodBin2), (long)(pMUD->bkgd1), (long)(pMUD->bkgd2) );
break;
}
return( 1 );
@ -287,10 +280,7 @@ MUD_SEC_GEN_HIST_HDR_proc( op, pBuf, pMUD )
int
MUD_SEC_GEN_HIST_DAT_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_GEN_HIST_DAT* pMUD;
MUD_SEC_GEN_HIST_DAT_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_GEN_HIST_DAT* pMUD )
{
int size;
@ -313,7 +303,7 @@ MUD_SEC_GEN_HIST_DAT_proc( op, pBuf, pMUD )
size += pMUD->nBytes;
return( size );
case MUD_SHOW:
printf( " MUD_SEC_GEN_HIST_DAT: nBytes:[%ld]\n", pMUD->nBytes );
printf( " MUD_SEC_GEN_HIST_DAT: nBytes:[%ld]\n", (long)(pMUD->nBytes) );
break;
case MUD_HEADS:
break;
@ -323,10 +313,7 @@ MUD_SEC_GEN_HIST_DAT_proc( op, pBuf, pMUD )
int
MUD_SEC_GEN_SCALER_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_GEN_SCALER* pMUD;
MUD_SEC_GEN_SCALER_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_GEN_SCALER* pMUD )
{
int size;
@ -350,15 +337,16 @@ MUD_SEC_GEN_SCALER_proc( op, pBuf, pMUD )
size += sizeof( MUD_STR_LEN_TYPE ) + _strlen( pMUD->label );
return( size );
case MUD_SHOW:
printf( " MUD_SEC_GEN_SCALER: counts[1]:[%ld], counts[0]:[%ld]\n",
pMUD->counts[1], pMUD->counts[0] );
printf( " MUD_SEC_GEN_SCALER: counts[1]:[%lu], counts[0]:[%lu]\n",
(unsigned long)(pMUD->counts[1]), (unsigned long)(pMUD->counts[0]) );
if( pMUD->label ) printf( " label:\"%s\"\n", pMUD->label );
break;
case MUD_HEADS:
printf( " Scaler " );
if( pMUD->label ) printf( "%8s", pMUD->label );
else printf( "??? " );
printf( " total: %11ld, recent: %ld\n", pMUD->counts[0], pMUD->counts[1] );
printf( " total: %11lu, recent: %lu\n",
(unsigned long)(pMUD->counts[0]), (unsigned long)(pMUD->counts[1]) );
break;
}
return( 1 );
@ -366,10 +354,7 @@ MUD_SEC_GEN_SCALER_proc( op, pBuf, pMUD )
int
MUD_SEC_GEN_IND_VAR_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_GEN_IND_VAR* pMUD;
MUD_SEC_GEN_IND_VAR_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_GEN_IND_VAR* pMUD )
{
int size;
@ -431,10 +416,7 @@ MUD_SEC_GEN_IND_VAR_proc( op, pBuf, pMUD )
int
MUD_SEC_GEN_ARRAY_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_GEN_ARRAY* pMUD;
MUD_SEC_GEN_ARRAY_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_GEN_ARRAY* pMUD )
{
int size;
int i;
@ -538,8 +520,8 @@ MUD_SEC_GEN_ARRAY_proc( op, pBuf, pMUD )
case MUD_SHOW:
printf( " MUD_SEC_GEN_ARRAY: \n" );
printf( " num:[%ld], elemSize:[%ld], type:[%ld], hasTime:[%ld], nBytes:[%ld]\n",
pMUD->num, pMUD->elemSize, pMUD->type, pMUD->hasTime,
pMUD->nBytes );
(long)(pMUD->num), (long)(pMUD->elemSize), (long)(pMUD->type), (long)(pMUD->hasTime),
(long)(pMUD->nBytes) );
break;
case MUD_HEADS:
break;
@ -549,42 +531,27 @@ MUD_SEC_GEN_ARRAY_proc( op, pBuf, pMUD )
int
MUD_SEC_GEN_HIST_pack( num, inBinSize, inHist, outBinSize, outHist )
int num;
int inBinSize;
void* inHist;
int outBinSize;
void* outHist;
MUD_SEC_GEN_HIST_pack( int num, int inBinSize, void* inHist, int outBinSize, void* outHist )
{
pack_op = PACK_OP;
return( MUD_SEC_GEN_HIST_dopack( num, inBinSize, inHist, outBinSize, outHist ) );
}
int
MUD_SEC_GEN_HIST_unpack( num, inBinSize, inHist, outBinSize, outHist )
int num;
int inBinSize;
void* inHist;
int outBinSize;
void* outHist;
MUD_SEC_GEN_HIST_unpack( int num, int inBinSize, void* inHist, int outBinSize, void* outHist )
{
pack_op = UNPACK_OP;
return( MUD_SEC_GEN_HIST_dopack( num, inBinSize, inHist, outBinSize, outHist ) );
}
static int
MUD_SEC_GEN_HIST_dopack( num, inBinSize, inHist, outBinSize, outHist )
int num;
int inBinSize;
void* inHist;
int outBinSize;
void* outHist;
MUD_SEC_GEN_HIST_dopack( int num, int inBinSize, void* inHist, int outBinSize, void* outHist )
{
int i;
int outLen = 0;
MUD_VAR_BIN_LEN_TYPE num_temp;
int bin, inLoc, outLoc;
int inLen_temp, outLen_temp;
int outLen_temp;
MUD_VAR_BIN_SIZ_TYPE outBinSize_now, outBinSize_next;
MUD_VAR_BIN_SIZ_TYPE inBinSize_temp;
UINT8 c, *pc;
@ -935,8 +902,7 @@ MUD_SEC_GEN_HIST_dopack( num, inBinSize, inHist, outBinSize, outHist )
static int
n_bytes_needed( val )
UINT32 val;
n_bytes_needed( UINT32 val )
{
if( val & 0xFFFF0000 ) return( 4 );
else if( val & 0x0000FF00 ) return( 2 );
@ -946,10 +912,7 @@ n_bytes_needed( val )
static UINT32
varBinArray( pHistData, binSize, index )
void* pHistData;
int binSize;
int index;
varBinArray( void* pHistData, int binSize, int index )
{
UINT8 c;
UINT16 s;
@ -991,17 +954,8 @@ varBinArray( pHistData, binSize, index )
static void
next_few_bins( num_tot, inBinSize,
pHistData,
outBinSize_now,
pNum_next,
pOutBinSize_next )
int num_tot;
int inBinSize;
void* pHistData;
int outBinSize_now;
MUD_VAR_BIN_LEN_TYPE* pNum_next;
MUD_VAR_BIN_SIZ_TYPE* pOutBinSize_next;
next_few_bins( int num_tot, int inBinSize, void* pHistData, int outBinSize_now,
MUD_VAR_BIN_LEN_TYPE* pNum_next, MUD_VAR_BIN_SIZ_TYPE* pOutBinSize_next )
{
int val;
MUD_VAR_BIN_LEN_TYPE num_next;

View File

@ -27,13 +27,11 @@
* v1.2a 01-Mar-2000 DA Add handling of unidentified sections (don't quit)
*/
#include "mud.h"
MUD_SEC*
MUD_new( secID, instanceID )
UINT32 secID;
UINT32 instanceID;
MUD_new( UINT32 secID, UINT32 instanceID )
{
MUD_SEC* pMUD_new;
MUD_PROC proc;
@ -43,78 +41,78 @@ MUD_new( secID, instanceID )
{
case MUD_SEC_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC ) );
proc = MUD_SEC_proc;
proc = (MUD_PROC)MUD_SEC_proc;
sizeOf = sizeof( MUD_SEC );
break;
case MUD_SEC_FIXED_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_FIXED ) );
proc = MUD_SEC_FIXED_proc;
proc = (MUD_PROC)MUD_SEC_FIXED_proc;
sizeOf = sizeof( MUD_SEC_FIXED );
break;
case MUD_SEC_GRP_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_GRP ) );
proc = MUD_SEC_GRP_proc;
proc = (MUD_PROC)MUD_SEC_GRP_proc;
sizeOf = sizeof( MUD_SEC_GRP );
break;
case MUD_SEC_EOF_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_EOF ) );
proc = MUD_SEC_EOF_proc;
proc = (MUD_PROC)MUD_SEC_EOF_proc;
sizeOf = sizeof( MUD_SEC_EOF );
break;
case MUD_SEC_CMT_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_CMT ) );
proc = MUD_SEC_CMT_proc;
proc = (MUD_PROC)MUD_SEC_CMT_proc;
sizeOf = sizeof( MUD_SEC_CMT );
break;
case MUD_SEC_GEN_RUN_DESC_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_GEN_RUN_DESC ) );
proc = MUD_SEC_GEN_RUN_DESC_proc;
proc = (MUD_PROC)MUD_SEC_GEN_RUN_DESC_proc;
sizeOf = sizeof( MUD_SEC_GEN_RUN_DESC );
break;
case MUD_SEC_GEN_HIST_HDR_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_GEN_HIST_HDR ) );
proc = MUD_SEC_GEN_HIST_HDR_proc;
proc = (MUD_PROC)MUD_SEC_GEN_HIST_HDR_proc;
sizeOf = sizeof( MUD_SEC_GEN_HIST_HDR );
break;
case MUD_SEC_GEN_HIST_DAT_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_GEN_HIST_DAT ) );
proc = MUD_SEC_GEN_HIST_DAT_proc;
proc = (MUD_PROC)MUD_SEC_GEN_HIST_DAT_proc;
sizeOf = sizeof( MUD_SEC_GEN_HIST_DAT );
break;
case MUD_SEC_GEN_SCALER_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_GEN_SCALER ) );
proc = MUD_SEC_GEN_SCALER_proc;
proc = (MUD_PROC)MUD_SEC_GEN_SCALER_proc;
sizeOf = sizeof( MUD_SEC_GEN_SCALER );
break;
case MUD_SEC_GEN_IND_VAR_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_GEN_IND_VAR ) );
proc = MUD_SEC_GEN_IND_VAR_proc;
proc = (MUD_PROC)MUD_SEC_GEN_IND_VAR_proc;
sizeOf = sizeof( MUD_SEC_GEN_IND_VAR );
break;
case MUD_SEC_GEN_ARRAY_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_GEN_ARRAY ) );
proc = MUD_SEC_GEN_ARRAY_proc;
proc = (MUD_PROC)MUD_SEC_GEN_ARRAY_proc;
sizeOf = sizeof( MUD_SEC_GEN_ARRAY );
break;
case MUD_SEC_TRI_TI_RUN_DESC_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_TRI_TI_RUN_DESC ) );
proc = MUD_SEC_TRI_TI_RUN_DESC_proc;
proc = (MUD_PROC)MUD_SEC_TRI_TI_RUN_DESC_proc;
sizeOf = sizeof( MUD_SEC_TRI_TI_RUN_DESC );
break;
/*
case MUD_SEC_CAMP_NUM_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_CAMP_NUM ) );
proc = MUD_SEC_CAMP_NUM_proc;
proc = (MUD_PROC)MUD_SEC_CAMP_NUM_proc;
sizeOf = sizeof( MUD_SEC_CAMP_NUM );
break;
case MUD_SEC_CAMP_STR_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_CAMP_STR ) );
proc = MUD_SEC_CAMP_STR_proc;
proc = (MUD_PROC)MUD_SEC_CAMP_STR_proc;
sizeOf = sizeof( MUD_SEC_CAMP_STR );
break;
case MUD_SEC_CAMP_SEL_ID:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_CAMP_SEL ) );
proc = MUD_SEC_CAMP_SEL_proc;
proc = (MUD_PROC)MUD_SEC_CAMP_SEL_proc;
sizeOf = sizeof( MUD_SEC_CAMP_SEL );
break;
*/
@ -122,7 +120,7 @@ MUD_new( secID, instanceID )
/* add action for unknown */
default:
pMUD_new = (MUD_SEC*)zalloc( sizeof( MUD_SEC_UNKNOWN ) );
proc = MUD_SEC_UNKNOWN_proc;
proc = (MUD_PROC)MUD_SEC_UNKNOWN_proc;
sizeOf = sizeof( MUD_SEC_UNKNOWN );
break;
@ -138,4 +136,3 @@ MUD_new( secID, instanceID )
return( pMUD_new );
}

View File

@ -27,10 +27,7 @@
int
MUD_SEC_TRI_TI_RUN_DESC_proc( op, pBuf, pMUD )
MUD_OPT op;
BUF* pBuf;
MUD_SEC_TRI_TI_RUN_DESC* pMUD;
MUD_SEC_TRI_TI_RUN_DESC_proc( MUD_OPT op, BUF* pBuf, MUD_SEC_TRI_TI_RUN_DESC* pMUD )
{
int size;
char tempStr1[32];
@ -115,8 +112,8 @@ MUD_SEC_TRI_TI_RUN_DESC_proc( op, pBuf, pMUD )
size += sizeof( MUD_STR_LEN_TYPE ) + _strlen( pMUD->comment3 );
return( size );
case MUD_SHOW:
printf( " MUD_SEC_TRI_TI_RUN_DESC: expt:[%ld], run:[%ld]\n",
pMUD->exptNumber, pMUD->runNumber );
printf( " MUD_SEC_TRI_TI_RUN_DESC: expt:[%lu], run:[%lu]\n",
(unsigned long)(pMUD->exptNumber), (unsigned long)(pMUD->runNumber) );
bintime = pMUD->timeBegin;
strncpy( tempStr1, ctime( &bintime ), sizeof(tempStr1) );
tempStr1[strlen(tempStr1)-1] = '\0';
@ -125,7 +122,7 @@ MUD_SEC_TRI_TI_RUN_DESC_proc( op, pBuf, pMUD )
tempStr2[strlen(tempStr2)-1] = '\0';
printf( " timeBegin:[%s]\n", tempStr1 );
printf( " timeEnd:[%s]\n", tempStr2 );
printf( " elapsedSec:[%ld]\n", pMUD->elapsedSec );
printf( " elapsedSec:[%lu]\n", (unsigned long)(pMUD->elapsedSec) );
if( pMUD->title ) printf( " title:\"%s\"\n", pMUD->title );
if( pMUD->lab ) printf( " lab:\"%s\"\n", pMUD->lab );
if( pMUD->area ) printf( " area:\"%s\"\n", pMUD->area );
@ -148,8 +145,8 @@ MUD_SEC_TRI_TI_RUN_DESC_proc( op, pBuf, pMUD )
printf( " comment3:\"%s\"\n", pMUD->comment3 );
break;
case MUD_HEADS:
printf( "Run number: %ld\n", pMUD->runNumber );
printf( " exper num: %ld\n", pMUD->exptNumber );
printf( "Run number: %lu\n", (unsigned long)(pMUD->runNumber) );
printf( " exper num: %lu\n", (unsigned long)(pMUD->exptNumber) );
if( pMUD->experimenter )
printf( " operator: %s\n", pMUD->experimenter );
if( pMUD->method )
@ -162,9 +159,9 @@ MUD_SEC_TRI_TI_RUN_DESC_proc( op, pBuf, pMUD )
tempStr2[strlen(tempStr2)-1] = '\0';
printf( " began: %s\n ended: %s\n",
tempStr1, tempStr2 );
printf( " elapsed: %ld:%.2d:%.2d (%ld seconds)\n",
(pMUD->elapsedSec/3600), ((pMUD->elapsedSec%3600)/60), (pMUD->elapsedSec%60),
pMUD->elapsedSec );
printf( " elapsed: %ld:%.2d:%.2d (%lu seconds)\n",
(long)(pMUD->elapsedSec/3600), ((pMUD->elapsedSec%3600)/60), (pMUD->elapsedSec%60),
(unsigned long)(pMUD->elapsedSec) );
if( pMUD->title ) printf( " title: %s\n", pMUD->title );
if( pMUD->sample ) printf( " sample: %s\n", pMUD->sample );
if( pMUD->orient ) printf( " orient: %s\n", pMUD->orient );

View File

@ -512,7 +512,7 @@ int main(int argc, char *argv[])
return 0;
} else if (!strcmp(argv[1], "--version")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "msr2data version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "msr2data version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "msr2data git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif

View File

@ -297,7 +297,7 @@ Int_t musrFT_parse_options(Int_t argc, Char_t *argv[], musrFT_startup_param &sta
tstr = argv[i];
if (tstr.BeginsWith("--version")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "musrFT version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "musrFT version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "musrFT git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif

View File

@ -574,7 +574,7 @@ int main(int argc, char *argv[])
} else if (argc==2) {
if (!strcmp(argv[1], "--version")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "musrRootValidation version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "musrRootValidation version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "musrRootValidation git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif

View File

@ -1,9 +1,5 @@
#--- musredit for Qt > 5.0 ----------------------------------------------------
#--- check if Qt5WebEngine or Qt5WebKit is present ----------------------------
#find_package(Qt5WebEngine QUIET)
#find_package(Qt5WebKit QUIET)
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Svg Qt5::PrintSupport)
set(musredit_src
@ -110,35 +106,13 @@ else (APPLE)
)
endif (APPLE)
# set necessary tags depending if QtWebEngine, QtWebKit,
# or none of both are given
if (Qt5WebKit_FOUND)
target_compile_options(musredit
BEFORE PRIVATE
-DHAVE_QT_WEB_KIT
)
endif (Qt5WebKit_FOUND)
if (Qt5WebEngine_FOUND)
target_compile_options(musredit
BEFORE PRIVATE
-DHAVE_QT_WEB_ENGINE
)
endif (Qt5WebEngine_FOUND)
if (Qt5NoWeb)
target_compile_options(musredit
BEFORE PRIVATE
-DHAVE_QT_NO_WEB
)
endif (Qt5NoWeb)
target_include_directories(musredit
BEFORE PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../../..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
)

View File

@ -27,6 +27,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "config.h"
#include "git-revision.h"
#include "PMusrEditAbout.h"
@ -40,6 +41,8 @@ PMusrEditAbout::PMusrEditAbout(QWidget *parent) : QDialog(parent)
fGitBranch_label->setText(QString("git-branch: %1").arg(GIT_BRANCH));
fGitRev_label->setText(QString("git-rev: %1").arg(GIT_CURRENT_SHA1));
fMusrfitVersion_label->setText(QString("musrfit-version: %1 (%2)").arg(PACKAGE_VERSION).arg(BUILD_TYPE));
fRootVersion_label->setText(QString("ROOT-version: %1").arg(ROOT_VERSION_USED));
setModal(true);
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>395</width>
<height>225</height>
<height>331</height>
</rect>
</property>
<property name="windowTitle">
@ -17,13 +17,13 @@
<iconset>
<normaloff>:/images/musrfit.xpm</normaloff>:/images/musrfit.xpm</iconset>
</property>
<widget class="QWidget" name="layoutWidget">
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>13</x>
<y>13</y>
<x>14</x>
<y>14</y>
<width>371</width>
<height>201</height>
<height>311</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -44,6 +44,26 @@ p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:24pt; font-weight:400; font-style:italic;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;musredit ...&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fMusrfitVersion_label">
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>musrfit-version:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
@ -80,6 +100,23 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fRootVersion_label">
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>ROOT-version:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fDetails_label">
<property name="text">

View File

@ -111,6 +111,7 @@ target_include_directories(musredit
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../../..>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../../include>
)

View File

@ -27,6 +27,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "config.h"
#include "git-revision.h"
#include "PMusrEditAbout.h"
@ -40,6 +41,8 @@ PMusrEditAbout::PMusrEditAbout(QWidget *parent) : QDialog(parent)
fGitBranch_label->setText(QString("git-branch: %1").arg(GIT_BRANCH));
fGitRev_label->setText(QString("git-rev: %1").arg(GIT_CURRENT_SHA1));
fMusrfitVersion_label->setText(QString("musrfit-version: %1 (%2)").arg(PACKAGE_VERSION).arg(BUILD_TYPE));
fRootVersion_label->setText(QString("ROOT-version: %1").arg(ROOT_VERSION_USED));
setModal(true);
}

View File

@ -7,7 +7,7 @@
<x>0</x>
<y>0</y>
<width>395</width>
<height>225</height>
<height>331</height>
</rect>
</property>
<property name="windowTitle">
@ -17,13 +17,13 @@
<iconset>
<normaloff>:/images/musrfit.xpm</normaloff>:/images/musrfit.xpm</iconset>
</property>
<widget class="QWidget" name="layoutWidget">
<widget class="QWidget" name="">
<property name="geometry">
<rect>
<x>13</x>
<y>13</y>
<x>14</x>
<y>14</y>
<width>371</width>
<height>201</height>
<height>311</height>
</rect>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
@ -44,6 +44,26 @@ p, li { white-space: pre-wrap; }
&lt;/style&gt;&lt;/head&gt;&lt;body style=&quot; font-family:'Sans Serif'; font-size:24pt; font-weight:400; font-style:italic;&quot;&gt;
&lt;p align=&quot;center&quot; style=&quot; margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;&quot;&gt;musredit ...&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fMusrfitVersion_label">
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>musrfit-version:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
@ -80,6 +100,23 @@ p, li { white-space: pre-wrap; }
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fRootVersion_label">
<property name="font">
<font>
<weight>75</weight>
<italic>true</italic>
<bold>true</bold>
</font>
</property>
<property name="text">
<string>ROOT-version:</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="fDetails_label">
<property name="text">

View File

@ -464,7 +464,7 @@ int main(int argc, char *argv[])
if (argc == 2) {
if (!strcmp(argv[1], "--version")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "musrfit version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "musrfit version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "musrfit git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif

View File

@ -237,7 +237,7 @@ Int_t main(Int_t argc, Char_t *argv[])
for (int i=1; i<argc; i++) {
if (!strcmp(argv[i], "--version")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "musrt0 version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "musrt0 version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "musrt0 git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif

View File

@ -135,7 +135,7 @@ int main(int argc, char *argv[])
}
} else if (!strcmp(argv[i], "--version")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "musrview version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "musrview version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "musrview git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif

View File

@ -61,9 +61,9 @@ int main(int argc, char *argv[])
if (!strcmp(argv[1], "--version")) {
#ifdef HAVE_CONFIG_H
std::cout << std::endl << "write_musrRoot_runHeader version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "write_musrRoot_runHeader version: " << PACKAGE_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "write_musrRoot_runHeader git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
std::cout << std::endl << "write_musrRoot_runHeader git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#endif
return 0;
}