116 Commits

Author SHA1 Message Date
bface6bf1e adopted to the newer Qt versions. 2022-11-07 09:48:19 +01:00
e3c2149847 adopted to the newer boost versions. 2022-11-07 09:47:50 +01:00
f3414f687c replaced sprintf -> snprintf throughout. 2022-11-05 20:16:44 +01:00
44aacfca50 adopted from qt5 to qt6. 2022-09-06 20:50:59 +02:00
173d20f05e improved export parameter list behavior. Allow multiple deliminators: ',', ';', ' ' 2022-09-02 14:40:12 +02:00
ccc1dda352 fixed typo. 2022-09-02 14:38:54 +02:00
b4c7780ff5 improved msr<->mlog swap dialog. 2022-09-02 13:53:34 +02:00
2ba6e8a230 make sure that the minimum height of musrStep is not larger than the available screen resolution height. 2022-09-02 13:29:45 +02:00
43b4566870 fixed bug in msr2data global+ according to issue #33 reported on bitbucket. 2022-08-08 18:16:48 +02:00
b1ffba391a lift cmake requirement to 3.17. 2022-07-06 13:48:59 +02:00
804c56fd1f removed obsolete filed. 2022-07-06 13:48:07 +02:00
ae7f1a2168 more work towards a modern cmake. As a first example reworked FFTW3 binding. 2022-07-01 16:18:24 +02:00
3f2e96303a improvement dealing with rpath on macOS. 2022-06-20 15:53:57 +02:00
1b190830e9 fixed typo. 2022-06-01 13:43:01 +02:00
7b19ba8b36 use PFindRun facility now. Cleaned up various little things. 2022-06-01 13:08:07 +02:00
137a3f17c9 move on to modernize towards modern c++. 2022-05-31 12:32:58 +02:00
7e830a0c12 update of the docu. 2022-05-29 12:52:13 +02:00
e0ec00deab update ChangeLog 2022-05-29 11:31:41 +02:00
06d20d4086 adopted to new PSI-BIN lib. Added facility for finding runs via musrfit_startup.xml templates. 2022-05-28 14:10:15 +02:00
56820e498f refactor PSI-BIN lib. Fix a couple of bugs and start to adopt to more modern c++. 2022-05-28 14:08:04 +02:00
eefc49bd25 add search facility for runs via musrfit_startup.xml template entries. 2022-05-28 14:05:55 +02:00
0625bc008f fixed a typo, and tell the user if the file format info is not provided MusrRoot is assumed. 2022-05-27 13:14:30 +02:00
f47fdf7e54 use proper return value (int) rather than bool. 2022-04-29 07:56:38 +02:00
4aa903b879 replace the run-list handling through the already existing handler class PStringNumberList. 2022-04-27 16:45:33 +02:00
57596ca441 fixed several copy/paste errors which prevented sometimes averaging and instead crashed. 2022-04-25 15:32:15 +02:00
5361727583 NeXus: replaced deprecated NXgetnextattr by NXgetnextattra. 2022-04-12 15:01:59 +02:00
9a92ec2d8e improved formated string handling to make compilers happy. 2022-04-11 16:18:36 +02:00
17a31dfcc4 do not ignore the return value of system(cmd) anymore. 2022-04-11 16:10:00 +02:00
9cc1957b2d added necessary include directory info for boost, for PRgeHandler. 2022-04-11 13:28:18 +02:00
faffaec6ac fixed a typo. 2022-03-04 11:25:28 +01:00
3cc36bcb6d Merged in constants (pull request #12)
update the physical constants pertaining to the muon

Approved-by: Andreas Suter
2022-01-11 10:41:59 +00:00
a3bcbefebe use the Particle Data Group's recommended value for the muon lifetime 2022-01-11 11:34:29 +01:00
a13ee27b9a Merged in skewedgauss (pull request #13)
improvements to PTheory::SkewedGauss

Approved-by: Andreas Suter
2022-01-11 07:23:12 +00:00
27fe3ff5fd fix the discontinuity encountered at large t when sigma+/- is large
- Though the discontinuity encountered in the previous version is small (because of the large Gaussain damping terms), it introduced considerable numeric instability when fitting. Consequently, simply zeroing the already heavily damped is sensible and yeilds smooth behaviour of the function.
- Also ensure that the return value for the odd frequency component is always finite.
2022-01-10 17:13:11 +01:00
fdc9ac8e7e improvements to PTheory::SkewedGauss
- Divide the function evaluation into even/odd frequency components. Some additional "helper" terms have been added to aid in this.
- Use a better value to check for floating-point overflow in the evaluation of ROOT::conf_hyperg and return std::numeric_limits<Double_t>::max() when necessary. This extends the function's range of validity to arbitrary time (whereas the previous implementation would fail loudly for large sigma+/-).
- Format the src with clang-format.
2022-01-10 14:20:08 +01:00
c85a12b61e update the physical constants pertaining to the muon
- use the most recent/precise measurement of the muon's lifetime (MuLan experiment at PSI).
- define the gyromagnetic ratio in terms of the latest values for the fundamental physical constants (CODATA 2018).
2022-01-10 13:14:19 +01:00
06389416a6 replace deprecated QFontDatabase by the new static functions. 2021-12-05 16:45:53 +01:00
3a1247e3ec modernized the cmake <-> Qt handling. 2021-12-01 15:25:38 +01:00
c5e5bddd10 try re-create musredit_startup.xml in case it is corrupted. 2021-11-29 16:11:14 +01:00
c44ae75e15 get rid of deprecated dialogs and make them more uniform. 2021-11-29 15:39:34 +01:00
d682004467 remove obsolate qt6 musredit dialog. 2021-11-29 15:20:18 +01:00
7486637998 revision of ChangeLog. 2021-11-05 14:24:38 +01:00
c75427513f adopted the the new dyld on macOS Monterey. 2021-11-05 14:06:20 +01:00
a34e9fe535 add a default y-range to the range option in the PLOT block. 2021-10-30 09:58:49 +02:00
01ff382972 fixed a copy/paste error. 2021-10-30 09:56:15 +02:00
7ff3391d61 fixed a copy/paste error. 2021-10-30 09:53:09 +02:00
c6602fb541 improved the error messages slightly. 2021-10-03 15:04:39 +02:00
8274fb9d54 add option to musrfit that the user can choose from the command line the number of threads to be used for OpenMP. Updated the docu accordingly. 2021-10-02 19:41:45 +02:00
4f0590fe10 allow to inspect how many cores are available for OpenMP. 2021-10-02 10:11:44 +02:00
4f2041c141 allow to set the default size of musredit via the musredit_startup.xml. 2021-10-02 09:26:13 +02:00
df03277c4c removed debug info from phase detection. 2021-09-22 09:54:25 +02:00
76f4e6846a increase version number from 1.7.4 -> 1.7.5 2021-09-22 08:09:46 +02:00
00398c7fa9 fix phases to +-360 degree. 2021-09-22 08:09:18 +02:00
d357b9ad2f add missing include directory path in cmake. Thank's to Akihiro Koda for reporting the bug and proposing the fix. 2021-09-21 07:52:58 +02:00
4cc1dbecd1 increased the PippardFitter version number. 2021-08-19 07:53:11 +02:00
5f4125bca9 added some necessary include paths. 2021-08-19 07:52:22 +02:00
ef4fae3ef7 adopt for proper git-info handling. 2021-08-18 19:17:57 +02:00
d332bffd29 added some docu. 2021-08-18 19:17:18 +02:00
4a2d865282 add the option to dump the nonlocal field values for the ASlibs via the programm dump_nonlocal_field. 2021-08-18 16:57:29 +02:00
c6c7deec9c make PSI bulk MusrRoot files accessible if the file name is generated from the run-number, year, etc. 2021-07-28 13:22:42 +02:00
341fa9f77c Removed MuTransistion from tests directory. 2021-07-20 10:51:10 +02:00
ef1f323f07 fixed another git-revision.h which was forgotten. 2021-07-12 16:30:31 +02:00
47e7ba2c70 some fixes on the qt5 side for a none-git project source. 2021-07-12 16:23:33 +02:00
8faa501db7 more work on the none git source version. 2021-07-12 16:00:19 +02:00
2f11d131c7 some more work on the none git source version. 2021-07-12 15:49:01 +02:00
daa2ea1347 make sure that git repo info is only added if the musrfit project source is indeed a git repo, and not e.g. a download. 2021-07-12 15:34:07 +02:00
f41c633bfe add mupp plotter export function. 2021-07-05 17:43:32 +02:00
5bebe4062d adopted version info for the docu. 2021-06-17 10:28:16 +02:00
a0dd51e1b7 updated the ChangeLog. 2021-06-16 19:57:00 +02:00
dd08eeae12 increased version number. 2021-06-16 19:56:30 +02:00
66fee6a1b3 lift #forward == #backward restriction. 2021-06-16 19:55:43 +02:00
ab29dedb77 lift #forward == #backward restriction. 2021-06-16 17:58:40 +02:00
b2bb863e9d remove obsolete test. 2021-06-16 17:57:28 +02:00
927f2e83c2 improve the readability of the time with packing in the code. 2021-06-07 18:34:36 +02:00
5bd5c08f39 adopted to the not quite standard ISIS NeXus files. 2021-06-05 10:51:19 +02:00
f4232057b8 perform a more robust casting. 2021-06-02 12:29:00 +02:00
90725dbf58 removed unnecessary check. 2021-06-02 12:28:24 +02:00
3b24d512be increased the version number. 2021-06-01 17:31:37 +02:00
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
7089e4b3d6 switched libPhotoMeissner to the new centralized PRgeHandler. 2021-04-01 20:41:00 +02:00
7de55705d2 slightly more modern c++ init style. 2021-04-01 20:38:32 +02:00
56f094dad0 slightly improved the rge handler. 2021-04-01 20:37:08 +02:00
cab8703f85 fix an error number of theory points for the view data. 2021-04-01 20:30:53 +02:00
72c085a0a8 make PRgeHandler to a shared libs. Adopted Nonlocal and PMagProximity accordingly. 2021-04-01 14:26:26 +02:00
113996aa4e changed the user function for nonlocal fitting to the new rge-handler. This breaks the backwards compatibility! 2021-03-30 15:48:51 +02:00
cb0e8d2e65 update of the ChangeLog. 2021-03-30 15:43:26 +02:00
0dc1c4d975 add some boost component checks. Increase the musrfit version number. 2021-03-30 15:41:38 +02:00
21213a45eb add a central rge-handler which can be used by all user function classes. 2021-03-30 15:39:45 +02:00
e6e951e8f4 update the copyright info. 2021-03-29 08:22:38 +02:00
551fa4e4a6 refresh of the setup docu. 2021-03-01 15:40:10 +01:00
6d61cfd4d9 modernized the msr input file. 2021-02-26 15:18:12 +01:00
cc8ac60713 by changing the behaviour of the global parts of the class PUserFcnBase from pure virtual default NeedGlobalPart=false, the code can be simplified in many places. 2021-02-26 15:17:41 +01:00
1372a8b782 xml schema more flexible about the order of 'histos' and 'RunHeader' 2021-02-18 14:59:35 +01:00
27607a2fa1 fix of a typo. 2021-02-18 11:56:39 +01:00
88b4e7600d fixed wrong casting originating from a copy/paste error. 2021-02-18 11:55:34 +01:00
01ce90e97e better version for icons under macosx. 2021-02-16 20:46:52 +01:00
457adc7e7e add macOS BigSur icon to musredit. 2021-02-14 22:13:40 +01:00
90fb81f16a add new method GetTypeOfPath to TMusrRunHeader. It allows deduce the type of a given path-name. 2021-02-06 19:05:40 +01:00
bfd7229252 Merge branch 'root6' of https://git.psi.ch/nemu/musrfit into root6 2021-01-26 10:33:13 +01:00
f9581ae9d5 fix typo. Increase minimal root version from rpm. 2021-01-26 10:21:06 +01:00
cd785b8e5d update of the docu. 2021-01-23 15:58:04 +01:00
9cc9792054 some bug fixing in the cmake chain concerning the new Qt6 stuff. 2021-01-23 10:21:55 +01:00
ad9cf0abf9 remove comment. 2021-01-22 22:25:43 +01:00
415 changed files with 21461 additions and 9370 deletions

View File

@ -1,40 +1,37 @@
# - musrfit
cmake_minimum_required(VERSION 3.9)
# - musrfit
cmake_minimum_required(VERSION 3.17)
if (CMAKE_VERSION GREATER_EQUAL 3.12)
cmake_policy(SET CMP0075 NEW)
endif (CMAKE_VERSION GREATER_EQUAL 3.12)
project(musrfit VERSION 1.6.5 LANGUAGES C CXX)
project(musrfit VERSION 1.8.1 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 ----------------------------
#--- the next two lines are needed that the math functions are found ----------
set(CMAKE_REQUIRED_INCLUDES math.h)
set(CMAKE_REQUIRED_LIBRARIES m)
set(CMAKE_REQUIRED_LIBRARIES m)
include(CheckTypeSize)
include(CheckIncludeFiles)
@ -82,20 +79,28 @@ 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)
find_package(Boost REQUIRED
COMPONENTS
system
filesystem
)
message(STATUS "Boost libs: ${Boost_LIBRARIES}")
#--- check for gsl ------------------------------------------------------------
find_package(GSL REQUIRED)
#--- check for fftw3 ----------------------------------------------------------
find_package(FFTW3 REQUIRED)
if (FFTW3_THREAD_FOUND)
set(HAVE_LIBFFTW3_THREADS 1 CACHE INTERNAL "fftw3_threads are available")
endif (FFTW3_THREAD_FOUND)
if (FFTW3F_THREAD_FOUND)
set(HAVE_LIBFFTW3F_THREADS 1 CACHE INTERNAL "fftw3f_threads are available")
endif (FFTW3F_THREAD_FOUND)
#--- check for libxml2 --------------------------------------------------------
find_package(LibXml2 REQUIRED)
@ -114,23 +119,25 @@ 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)
find_package(Qt6Network CONFIG REQUIRED)
find_package(Qt6Svg CONFIG REQUIRED)
find_package(Qt6PrintSupport CONFIG REQUIRED)
find_package(Qt6PrintSupport CONFIG REQUIRED)
endif (Qt6Core_FOUND)
# try Qt5
find_package(Qt5Core)
if (NOT Qt5Core_FOUND)
find_package(Qt5Widgets CONFIG REQUIRED)
find_package(Qt5Xml CONFIG REQUIRED)
find_package(Qt5Network CONFIG REQUIRED)
find_package(Qt5Svg CONFIG REQUIRED)
find_package(Qt5PrintSupport CONFIG REQUIRED)
endif (NOT Qt5Core_FOUND)
if (NOT Qt6Core_FOUND)
find_package(Qt5Core QUIET)
if (Qt5Core_FOUND)
find_package(Qt5Widgets CONFIG REQUIRED)
find_package(Qt5Xml CONFIG REQUIRED)
find_package(Qt5Network CONFIG REQUIRED)
find_package(Qt5Svg CONFIG REQUIRED)
find_package(Qt5PrintSupport CONFIG REQUIRED)
endif (Qt5Core_FOUND)
endif (NOT Qt6Core_FOUND)
# if Qt6 and Qt5 is not found, try Qt4
if (NOT Qt6Core_FOUND AND NOT Qt5Core_FOUND)
@ -191,8 +198,8 @@ endif (qt_based_tools)
#--- if NeXus check also for HDF4, HDF5, and MXML -----------------------------
if (nexus)
find_package(HDF5 COMPONENTS CXX REQUIRED )
#as35 find_package(HDF4 REQUIRED)
find_package(NeXus REQUIRED)
find_package(HDF4 REQUIRED)
find_package(NEXUS REQUIRED)
add_definitions(-DPNEXUS_ENABLED)
endif (nexus)
@ -203,10 +210,19 @@ endif (nexus)
set(HAVE_CONFIG_H 1 CACHE INTERNAL "config.h is available")
configure_file(${CMAKE_SOURCE_DIR}/cmake/config.h.in ${CMAKE_CURRENT_BINARY_DIR}/config.h)
#--- check if project source is a git repo ------------------------------------
if (EXISTS "${CMAKE_SOURCE_DIR}/.git/HEAD")
message(STATUS "is a git repo")
set(IS_GIT_REPO 1)
else ()
message(STATUS "is NOT a git repo")
set(IS_GIT_REPO 0)
endif ()
#--- propagate to the sub-directories -----------------------------------------
add_subdirectory(src)
#--- write summary of the installation
#--- write summary of the installation
message("")
message("|-----------------------------------------------------------------------|")
message("| |")
@ -223,7 +239,7 @@ message("")
message(" Requirements:")
message(" -------------")
message("")
message(" FFTW3 found in ${FFTW3_INCLUDE_DIR}")
message(" FFTW3 found in ${FFTW3_INCLUDE}")
message(" GSL found in ${GSL_INCLUDE_DIRS}")
message(" BOOST found in ${Boost_INCLUDE_DIRS}")
message(" LibXML2 found in ${LIBXML2_INCLUDE_DIR}")
@ -238,14 +254,14 @@ endif (OpenMP_FOUND)
if (nexus)
message("")
message(" HDF4 found in ${HDF4_INCLUDE_DIRS}")
message(" HDF4 found in ${HDF4_INCLUDE_DIRS}")
message(" HDF5 found in ${HDF5_INCLUDE_DIRS}")
message(" NeXus found in ${NEXUS_INCLUDE_DIR}")
message(" NeXus found in ${NEXUS_INCLUDE_DIR}")
endif (nexus)
message("")
if (qt_based_tools)
if (Qt6Core_FOUND)
if (Qt6Core_FOUND)
message(" Qt found in ${Qt6Core_INCLUDE_DIRS} (Version: ${Qt6Core_VERSION})")
else (Qt6Core_FOUND)
if (Qt5Core_FOUND)
@ -295,6 +311,9 @@ if (BNMRlibs)
else (BNMRlibs)
message(" BNMRlibs : no")
endif (BNMRlibs)
if (DummyUserFcn)
message(" PDummyUserFcn : yes")
endif (DummyUserFcn)
if (qt_based_tools)
if (Qt6Core_FOUND)
@ -334,8 +353,8 @@ message("-----------------------------------------------------------------------
message("")
#--- cpack specific info ......................................................
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} PROJECT_SOURCE_DIR_NATIVE)
file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} PROJECT_BINARY_DIR_NATIVE)
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} PROJECT_SOURCE_DIR_NATIVE)
file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} PROJECT_BINARY_DIR_NATIVE)
string(REPLACE "\\" "\\\\" PROJECT_SOURCE_DIR_NATIVE_D ${PROJECT_SOURCE_DIR_NATIVE})
string(REPLACE "\\" "\\\\" PROJECT_BINARY_DIR_NATIVE_D ${PROJECT_BINARY_DIR_NATIVE})

View File

@ -12,6 +12,51 @@ or
https://bitbucket.org/muonspin/musrfit/commits/all
Release of V1.8.0, 2022/05/22
=============================
new: addRun - allows to add runs and write it to file
refactoring of Class_MuSR_PSI: (i) class variables and methods renamed according to ROOT
rules. (ii) start to modernize to newer c++ standards.
Release of V1.7.6, 2021/10/02
=============================
new: choose number of threads from the commandline for OpenMP.
Release of V1.7.5, 2021/09/22
=============================
make sure that phases stay within +-360 degrees.
Release of V1.7.4, 2021/06/16
=============================
allow in asymmetry fits #forward groups != #backward groups
Release of V1.7.3, 2021/06/01
=============================
making musrfit Apple Silicon M1 ready. Currently there is still an open issue
with NeXus (HDF4 only).
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.
Release of V1.6.5, 2021/01/22
=============================

View File

@ -24,12 +24,12 @@ set (CPACK_SET_DESTDIR "OFF")
set (CPACK_PACKAGE_RELOCATABLE "true")
if (${CPACK_GENERATOR} STREQUAL "RPM")
set (CPACK_RPM_PACKAGE_REQUIRES "root >= 6.16.00")
set (CPACK_RPM_PACKAGE_REQUIRES "root >= 6.22.00")
set (CPACK_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set (CPACK_PACKAGING_INSTALL_PREFIX "@CMAKE_INSTALL_PREFIX@")
set (CPACK_RPM_FILE_NAME "RPM-DEFAULT")
set (CPACK_RPM_PACKAGE_RELEASE "1")
# next variable for RHEL, CentOS, Fedfora
# next variable for RHEL, CentOS, Fedora
set (CPACK_RPM_PACKAGE_RELEASE_DIST "")
set (CPACK_RPM_PACKAGE_LICENSE "GPLv2")
set (CPACK_RPM_PACKAGE_VENDOR "Paul Scherrer Institute - LMU - LEM")

View File

@ -1,7 +1,7 @@
# - Find fftw3 library
# Find the native FFTW3 includes and library
# This module defines
# FFTW3_INCLUDE_DIR, where to find fftw3.h, etc.
# FFTW3_INCLUDE, where to find fftw3.h, etc.
# ---
# FFTW3_LIBRARY, library to link against to use FFTW3
# FFTW3_OMP_LIBRARY, library to link against to use FFTW3_omp
@ -31,17 +31,53 @@
# FFTW3Q_OMP_FOUND, if false, do not try to use OpenMP FFTW3q.
# FFTW3Q_THREADS_FOUND, if false, do not try to use threaded FFTW3q.
find_path(FFTW3_INCLUDE_DIR fftw3.h
function(add_imported_library lib_name library headers)
add_library(FFTW3::${lib_name} UNKNOWN IMPORTED)
set_target_properties(FFTW3::${lib_name} PROPERTIES
IMPORTED_LOCATION ${library}
INTERFACE_INCLUDE_DIRECTORIES ${headers}
)
set(${lib_name}_FOUND 1 CACHE INTERNAL "FFTW3 ${lib_name} found" FORCE)
set(${lib_name}_LIBRARY ${library}
CACHE STRING "Path to FFTW3::${lib_name} library" FORCE)
set(FFTW3_INCLUDE ${headers}
CACHE STRING "Path to FFTW3 headers" FORCE)
mark_as_advanced(FORCE ${lib_name}_LIBRARY)
mark_as_advanced(FORCE FFTW3_INCLUDE)
endfunction()
#as35 if (FFTW3_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3_LIBRARY} ${FFTW3_INCLUDE})
#as35 if (FFTW3_OMP_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3_OMP_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3_THREAD_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3_THRED_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3L_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3L_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3L_OMP_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3L_OMP_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3L_THREAD_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3L_THRED_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3F_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3F_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3F_OMP_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3F_OMP_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3F_THREAD_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3F_THRED_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3Q_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3Q_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3Q_OMP_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3Q_OMP_LIBRARY} ${FFTW3_INCLUDE})
#as35 elseif (FFTW3Q_THREAD_LIBRARY AND FFTW3_INCLUDE)
#as35 add_imported_library(${FFTW3Q_THRED_LIBRARY} ${FFTW3_INCLUDE})
#as35 endif()
#as35 return()
#as35 endif()
find_path(FFTW3_INCLUDE NAMES fftw3.h
HINTS "/usr/include" "/opt/local/include"
)
# find position of fftw3.h from the end
string(FIND "${FFTW3_INCLUDE_DIR}" "/fftw3.h" pos REVERSE)
# truncate the string
string(SUBSTRING "${FFTW3_INCLUDE_DIR}" 0 ${pos} substr)
set(FFTW3_INCLUDE_DIR ${substr})
unset(substr)
find_library(FFTW3_LIBRARY fftw3)
find_library(FFTW3_OMP_LIBRARY fftw3_omp)
find_library(FFTW3_THREAD_LIBRARY fftw3_threads)
@ -58,94 +94,126 @@ find_library(FFTW3Q_THREAD_LIBRARY fftw3q_threads)
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
# all listed variables are TRUE
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
# FFTW3
find_package_handle_standard_args(FFTW3
REQUIRED_VARS FFTW3_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE
)
if (FFTW3_FOUND)
add_imported_library("FFTW3" "${FFTW3_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3_OMP
find_package_handle_standard_args(FFTW3_OMP
REQUIRED_VARS FFTW3_OMP_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3_OMP_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3_OMP_FOUND)
add_imported_library("FFTW3_OMP" "${FFTW3_OMP_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3_THREAD
find_package_handle_standard_args(FFTW3_THREAD
REQUIRED_VARS FFTW3_THREAD_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3_THREAD_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3_THREAD_FOUND)
add_imported_library("FFTW3_THREAD" "${FFTW3_THREAD_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3L
find_package_handle_standard_args(FFTW3L
REQUIRED_VARS FFTW3L_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3L_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3L_FOUND)
add_imported_library("FFTW3L" "${FFTW3L_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3L_OMP
find_package_handle_standard_args(FFTW3L_OMP
REQUIRED_VARS FFTW3L_OMP_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3L_OMP_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3L_OMP_FOUND)
add_imported_library("FFTW3L_OMP" "${FFTW3L_OMP_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3L_THREAD
find_package_handle_standard_args(FFTW3L_THREAD
REQUIRED_VARS FFTW3L_THREAD_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3L_THREAD_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3L_THREAD_FOUND)
add_imported_library("FFTW3L_THREAD" "${FFTW3L_THREAD_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3F
find_package_handle_standard_args(FFTW3F
REQUIRED_VARS FFTW3F_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3F_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3F_FOUND)
add_imported_library("FFTW3F" "${FFTW3F_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3F_OMP
find_package_handle_standard_args(FFTW3F_OMP
REQUIRED_VARS FFTW3F_OMP_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3F_OMP_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3F_OMP_FOUND)
add_imported_library("FFTW3F_OMP" "${FFTW3F_OMP_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3F_THREAD
find_package_handle_standard_args(FFTW3F_THREAD
REQUIRED_VARS FFTW3F_THREAD_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3F_THREAD_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3F_THREAD_FOUND)
add_imported_library("FFTW3F_THREAD" "${FFTW3F_THREAD_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3Q
find_package_handle_standard_args(FFTW3Q
REQUIRED_VARS FFTW3Q_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3Q_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3Q_FOUND)
add_imported_library("FFTW3Q" "${FFTW3Q_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3Q_OMP
find_package_handle_standard_args(FFTW3Q_OMP
REQUIRED_VARS FFTW3Q_OMP_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
REQUIRED_VARS FFTW3Q_OMP_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3Q_OMP_FOUND)
add_imported_library("FFTW3Q_OMP" "${FFTW3Q_OMP_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
# FFTW3Q_THREAD
find_package_handle_standard_args(FFTW3Q_THREAD
REQUIRED_VARS FFTW3Q_THREAD_LIBRARY FFTW3_INCLUDE_DIR
VERSION_VAR "3")
if (NOT FFTW3_FOUND)
unset(FFTW3_LIBRARY)
endif()
if (NOT FFTW3_OMP_FOUND)
unset(FFTW3_OMP_LIBRARY)
endif()
if (NOT FFTW3_THREAD_FOUND)
unset(FFTW3_THREAD_LIBRARY)
REQUIRED_VARS FFTW3Q_THREAD_LIBRARY FFTW3_INCLUDE
HANDLE_COMPONENTS
NAME_MISMATCHED
)
if (FFTW3Q_THREAD_FOUND)
add_imported_library("FFTW3Q_THREAD" "${FFTW3Q_THREAD_LIBRARY}" "${FFTW3_INCLUDE}")
endif()
if (NOT FFTW3L_FOUND)
unset(FFTW3L_LIBRARY)
endif()
if (NOT FFTW3L_OMP_FOUND)
unset(FFTW3L_OMP_LIBRARY)
endif()
if (NOT FFTW3L_THREAD_FOUND)
unset(FFTW3L_THREAD_LIBRARY)
endif()
if (NOT FFTW3F_FOUND)
unset(FFTW3F_LIBRARY)
endif()
if (NOT FFTW3F_OMP_FOUND)
unset(FFTW3F_OMP_LIBRARY)
endif()
if (NOT FFTW3F_THREAD_FOUND)
unset(FFTW3F_THREAD_LIBRARY)
endif()
if (NOT FFTW3Q_FOUND)
unset(FFTW3Q_LIBRARY)
endif()
if (NOT FFTW3Q_OMP_FOUND)
unset(FFTW3Q_OMP_LIBRARY)
endif()
if (NOT FFTW3Q_THREAD_FOUND)
unset(FFTW3Q_THREAD_LIBRARY)
endif()
mark_as_advanced(
FFTW3_INCLUDE_DIR
FFTW3_LIBRARY FFTW3_OMP_LIBRARY FFTW3_THREAD_LIBRARY
FFTW3L_LIBRARY FFTW3L_OMP_LIBRARY FFTW3L_THREAD_LIBRARY
FFTW3F_LIBRARY FFTW3F_OMP_LIBRARY FFTW3F_THREAD_LIBRARY
FFTW3Q_LIBRARY FFTW3Q_OMP_LIBRARY FFTW3Q_THREAD_LIBRARY
)
if (FFTW3_FOUND)
message("-- Found FFTW3: ${FFTW3_INCLUDE_DIR}")
message("-- Found FFTW3: ${FFTW3_INCLUDE}")
endif (FFTW3_FOUND)

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

@ -1,13 +1,14 @@
<?xml version="1.0" encoding="UTF-8"?>
<nonlocal xmlns="http://nemu.web.psi.ch/musrfit/nonlocal">
<comment>
$Id: nonlocal_startup.xml 4047 2009-07-02 13:36:18Z nemu $
nonlocal_startup.xml
</comment>
<nonlocal_par>
<fourier_points>262144</fourier_points>
</nonlocal_par>
<trim_sp_part>
<data_path>profiles/Sn_E</data_path>
<trim_sp>
<data_path>./profiles/</data_path>
<rge_fln_pre>Sn_E</rge_fln_pre>
<energy_list>
<energy>1000</energy>
<energy>2000</energy>
@ -22,5 +23,5 @@
<energy>25000</energy>
<energy>27300</energy>
</energy_list>
</trim_sp_part>
</trim_sp>
</nonlocal>

View File

@ -4,21 +4,21 @@ FITPARAMETER
# Nr. Name Value Step Pos_Error Boundaries
1 one 1 0 none
2 zero 0 0 none
3 Asy 0.2235 -0.0066 0.0072 0 0.33
4 energy 22 0 none
3 Asy 0.2235 -0.0065 0.0072 0 0.33
4 energy 22000 0 none
5 redTemp 0.8683 0 none
6 thickness 5000 0 none
7 ell 12000 0 none
8 xi 94 0 none
9 lambdaL 52.5 -1.4 1.2
9 lambdaL 52.5 -1.3 1.2
10 Bext 47.11 0 none
11 deadLayer 0.00052 -0.00052 6.89563 0 none
11 deadLayer 0.0004 0.0037 none 0 none
12 RateSmear 0.418 -0.015 0.015
13 N0_L 301.61 0.62 none
14 Bkg_L 24.442 0.076 none
13 N0_L 301.6 -1.1 1.2
14 Bkg_L 24.441 -0.092 0.092
15 Phase_L 42.0 -2.2 2.2
16 Alpha_LR 1.0614 -0.0066 0.0064
17 Bkg_R 27.646 -0.090 0.090
16 Alpha_LR 1.0613 -0.0066 0.0064
17 Bkg_R 27.646 -0.089 0.090
18 RelPhase_R 154.4 -1.1 1.1
###############################################################
@ -37,7 +37,6 @@ RUN data/lem10_his_0825 MUE4 PSI ROOT-NPP (name beamline institute data-file-f
fittype 0 (single histogram fit)
norm 13
backgr.fit 14
lifetimecorrection
map 1 2 0 0 0 0 0 0 0 0
forward 1
data 3289 65000
@ -49,7 +48,6 @@ RUN data/lem10_his_0825 MUE4 PSI ROOT-NPP (name beamline institute data-file-f
fittype 0 (single histogram fit)
norm fun1
backgr.fit 17
lifetimecorrection
map 16 18 0 0 0 0 0 0 0 0
forward 3
data 3289 65000
@ -69,23 +67,27 @@ SAVE
###############################################################
PLOT 0 (single histo plot)
lifetimecorrection
runs 1 2
range 0 9 -0.3 0.3
view_packing 500
###############################################################
FOURIER
units Gauss # units either 'Gauss', 'MHz', or 'Mc/s'
units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s'
fourier_power 10
apodization STRONG # NONE, WEAK, MEDIUM, STRONG
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL
phase 8.5
#range_for_phase_correction 50.0 70.0
range 0.0 200.0
range 0 200
###############################################################
STATISTIC --- 2014-11-05 12:34:54
maxLH = 415.6, NDF = 358, maxLH/NDF = 1.160933
STATISTIC --- 2021-03-30 15:04:30
maxLH = 415.6, NDF = 358, maxLH/NDF = 1.160942
expected maxLH = 418.1, NDF = 358, expected maxLH/NDF = 1.168011
run block 1: (NDF/red.maxLH/red.maxLH_e) = (177/1.072511/1.087460)
run block 2: (NDF/red.maxLH/red.maxLH_e) = (175/1.290186/1.289528)

View File

@ -2,23 +2,23 @@ LSCO x=0.195 single
###############################################################
FITPARAMETER
# No Name Value Step Pos_Error Boundaries
1 phase 8.09 0.30 none
2 field 107.08786 0.00052 none
3 lambda 195.5703 0.0029 none 1 none
1 phase 10.34 0.21 none
2 field 112.82363 0.00033 none
3 lambda 170.4570 0.0022 none 1 none
4 xi 4 0 none 0 10
5 asym1 0.1980 0.0011 none 0 0.3
6 rate1 0.7697 0.0063 none
5 asym1 0.19219 -0.00079 0.00079 0 0.3
6 rate1 0.7955 0.0043 none
7 asymBg 0 0 none 0 0.3
8 rateBg 0 0 none 0 none
9 N01 3311.3 1.7 none 0 none
10 bg1 68.70 0.30 none 0 none
11 N02 3577.8 1.7 none 0 none
12 bg2 69.62 0.31 none 0 none
13 relphase 181.63 0.41 none 150 210
9 N01 3313.6 1.2 none 0 none
10 bg1 68.54 0.21 none 0 none
11 N02 3575.9 1.2 none 0 none
12 bg2 69.82 0.22 none 0 none
13 relphase 181.46 0.29 none 150 210
14 zero 0 0 none
15 relasy 1.0325 0.0075 none
15 relasy 1.0365 0.0051 none
16 one 1 0 none
###############################################################
@ -39,52 +39,51 @@ fun3 = par5 * map2
fun4 = par7 * map2
###############################################################
RUN data/deltat_pta_gps_3093 PIM3 PSI PSI-BIN (name beamline institute data-file-format)
GLOBAL
fittype 0 (single histogram fit)
fit 0 8
packing 30
###############################################################
RUN data/deltat_pta_gps_3093 PIM3 PSI PSI-BIN (name beamline institute data-file-format)
map 14 16 0 0 0 0 0 0 0 0
forward 3
norm 9
lifetimecorrection
backgr.fit 10
t0 125.0
data 128 8001
fit 0 8
packing 30
RUN data/deltat_pta_gps_3093 PIM3 PSI PSI-BIN (name beamline institute data-file-format)
fittype 0 (single histogram fit)
map 13 15 0 0 0 0 0 0 0 0
forward 4
norm 11
lifetimecorrection
backgr.fit 12
t0 124.0
data 127 8000
fit 0 8
packing 30
###############################################################
COMMANDS
MAX_LIKELIHOOD
MINIMIZE
#MIGRAD
HESSE
#MINOS
MINOS
SAVE
###############################################################
FOURIER
units Gauss # units either 'Gauss', 'MHz', or 'Mc/s'
units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s'
fourier_power 9
apodization NONE # NONE, WEAK, MEDIUM, STRONG
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL
phase par1
range 0 500
###############################################################
PLOT 0 (single histo plot)
lifetimecorrection
runs 1 2
range 0 4 -0.25 0.25
###############################################################
STATISTIC --- 2013-05-03 09:08:20
chisq = 1200.8, NDF = 415, chisq/NDF = 2.893391
STATISTIC --- 2021-02-26 14:54:47
maxLH = 1497.5, NDF = 415, maxLH/NDF = 3.608471

View File

@ -4,19 +4,19 @@ FITPARAMETER
# No Name Value Step Pos_Error Boundaries
1 field 94.717 0 none
2 deadlayer 10.5 0 none
3 lambda 115.96 -0.92 0.88
3 lambda 115.98 -0.65 0.63
# E = 22keV
4 phase22 25.4956 0 none
5 asym22 0.1047 -0.0029 0.0030 0 0.3
6 rate22 0.559 -0.032 0.033
7 NormL22 753.00 -0.86 0.87
8 BGL22 51.08 -0.13 0.13
9 NormR22 545.93 -0.77 0.76
10 BGR22 38.60 -0.11 0.12
11 relasyR22 1.068 -0.038 0.039 0.2 2
12 relphaR22 162.8 -1.5 1.5 110 210
5 asym22 0.1047 -0.0021 0.0021 0 0.3
6 rate22 0.558 -0.023 0.023
7 NormL22 752.98 -0.61 0.61
8 BGL22 51.114 -0.094 0.094
9 NormR22 545.95 -0.54 0.54
10 BGR22 38.634 -0.082 0.082
11 relasyR22 1.068 -0.027 0.027 0.2 2
12 relphaR22 162.8 -1.1 1.1 110 210
13 energy22 22 0 none
14 one 1 0 none
@ -35,53 +35,48 @@ fun2 = map1 + map5
fun3 = par1 * gamma_mu
###############################################################
RUN data/lem09_his_0916 MUE4 PSI ROOT-NPP (name beamline institute data-file-format)
GLOBAL
fittype 0 (single histogram fit)
norm 7
backgr.fit 8
lifetimecorrection
map 4 5 6 14 15 13 0 0 0 0
forward 1
background 65000 66500
data 3419 63000
t0 3419.0
fit 0.15 10
packing 150
RUN data/lem09_his_0916 MUE4 PSI ROOT-NPP (name beamline institute data-file-format)
fittype 0 (single histogram fit)
norm 9
backgr.fit 10
lifetimecorrection
map 4 5 6 11 12 13 0 0 0 0
forward 3
background 65000 66500
data 3419 63000
t0 3419.0
fit 0.15 10
packing 150
###############################################################
RUN data/lem09_his_0916 MUE4 PSI ROOT-NPP (name beamline institute data-file-format)
norm 7
backgr.fit 8
map 4 5 6 14 15 13 0 0 0 0
forward 1
RUN data/lem09_his_0916 MUE4 PSI ROOT-NPP (name beamline institute data-file-format)
norm 9
backgr.fit 10
map 4 5 6 11 12 13 0 0 0 0
forward 3
###############################################################
COMMANDS
#MAX_LIKELIHOOD
MAX_LIKELIHOOD
MINIMIZE
MINOS
SAVE
###############################################################
FOURIER
units Gauss # units either 'Gauss', 'MHz', or 'Mc/s'
units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s'
fourier_power 10
apodization WEAK # NONE, WEAK, MEDIUM, STRONG
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL
phase par4
range 0 200
###############################################################
PLOT 0 (single histo plot)
runs 1 2
lifetimecorrection
runs 1 2
range 0 4 -0.25 0.25
###############################################################
STATISTIC --- 2013-11-12 10:25:11
chisq = 696.9, NDF = 663, chisq/NDF = 1.051076
STATISTIC --- 2021-02-26 14:50:08
maxLH = 695.5, NDF = 663, maxLH/NDF = 1.049008

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

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

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

View File

@ -0,0 +1,60 @@
#---------------------------------------------------
# get compilation flags from root-config
ROOTCFLAGS = $(shell $(ROOTSYS)/bin/root-config --cflags)
#---------------------------------------------------
OS = LINUX
CXX = g++
CXXFLAGS = -O3 -Wall -Wno-trigraphs -fPIC
LOCALINCLUDE = .
ROOTINCLUDE = $(ROOTSYS)/include
INCLUDES = -I$(LOCALINCLUDE) -I$(ROOTINCLUDE)
LD = g++
LDFLAGS =
SOFLAGS = -O -shared
# the output from the root-config script:
CXXFLAGS += $(ROOTCFLAGS)
LDFLAGS +=
# some definitions: headers (used to generate *Dict* stuff), sources, objects,...
OBJS =
OBJS += TMyFunction.o TMyLibraryDict.o
SHLIB = libTMyLibrary.so
# make the shared lib:
#
all: $(SHLIB)
$(SHLIB): $(OBJS)
@echo "---> Building shared library $(SHLIB) ..."
/bin/rm -f $(SHLIB)
$(LD) $(OBJS) $(SOFLAGS) -o $(SHLIB)
@echo "done"
# clean up: remove all object file (and core files)
# semicolon needed to tell make there is no source
# for this target!
#
clean:; @rm -f $(OBJS) *Dict* core*
@echo "---> removing $(OBJS)"
#
$(OBJS): %.o: %.cpp
$(CXX) $(INCLUDES) $(CXXFLAGS) -c $<
# Generate the ROOT CINT dictionary
TMyLibraryDict.cpp: TMyFunction.h TMyLibraryLinkDef.h
@echo "Generating dictionary $@..."
rootcint -f $@ -c -p -I$(ROOTINCLUDE) $^
install: all
@echo "Installing shared lib: libTApproximation.so"
ifeq ($(OS),LINUX)
cp -pv $(SHLIB) $(ROOTSYS)/lib
cp -pv $(LOCALINCLUDE)/*.h $(ROOTSYS)/include
endif

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 164 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 365 B

View File

@ -0,0 +1,12 @@
var DOCUMENTATION_OPTIONS = {
URL_ROOT: document.getElementById("documentation_options").getAttribute('data-url_root'),
VERSION: '1.7.6',
LANGUAGE: 'None',
COLLAPSE_INDEX: false,
BUILDER: 'html',
FILE_SUFFIX: '.html',
LINK_SUFFIX: '.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt',
NAVIGATION_WITH_KEYS: false
};

371
doc/html/_static/haiku.css Normal file
View File

@ -0,0 +1,371 @@
/*
* haiku.css_t
* ~~~~~~~~~~~
*
* Sphinx stylesheet -- haiku theme.
*
* Adapted from http://haiku-os.org/docs/Haiku-doc.css.
* Original copyright message:
*
* Copyright 2008-2009, Haiku. All rights reserved.
* Distributed under the terms of the MIT License.
*
* Authors:
* Francois Revol <revol@free.fr>
* Stephan Assmus <superstippi@gmx.de>
* Braden Ewing <brewin@gmail.com>
* Humdinger <humdingerb@gmail.com>
*
* :copyright: Copyright 2007-2014 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@import url("basic.css");
html {
margin: 0px;
padding: 0px;
background: #FFF url(bg-page.png) top left repeat-x;
}
body {
line-height: 1.5;
margin: auto;
padding: 0px;
font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
min-width: 59em;
max-width: 70em;
color: #333333;
}
div.footer {
padding: 8px;
font-size: 11px;
text-align: center;
letter-spacing: 0.5px;
}
/* link colors and text decoration */
a:link {
font-weight: bold;
text-decoration: none;
color: #dc3c01;
}
a:visited {
font-weight: bold;
text-decoration: none;
color: #892601;
}
a:hover, a:active {
text-decoration: underline;
color: #ff4500;
}
/* Some headers act as anchors, don't give them a hover effect */
h1 a:hover, a:active {
text-decoration: none;
color: #0c3762;
}
h2 a:hover, a:active {
text-decoration: none;
color: #0c3762;
}
h3 a:hover, a:active {
text-decoration: none;
color: #0c3762;
}
h4 a:hover, a:active {
text-decoration: none;
color: #0c3762;
}
a.headerlink {
color: #a7ce38;
padding-left: 5px;
}
a.headerlink:hover {
color: #a7ce38;
}
/* basic text elements */
div.content {
margin-top: 20px;
margin-left: 40px;
margin-right: 40px;
margin-bottom: 50px;
font-size: 0.9em;
}
/* heading and navigation */
div.header {
position: relative;
left: 0px;
top: 0px;
height: 85px;
/* background: #eeeeee; */
padding: 0 40px;
}
div.header h1 {
font-size: 1.6em;
font-weight: normal;
letter-spacing: 1px;
color: #0c3762;
border: 0;
margin: 0;
padding-top: 15px;
}
div.header h1 a {
font-weight: normal;
color: #0c3762;
}
div.header h2 {
font-size: 1.3em;
font-weight: normal;
letter-spacing: 1px;
text-transform: uppercase;
color: #aaa;
border: 0;
margin-top: -3px;
padding: 0;
}
div.header img.rightlogo {
float: right;
}
div.title {
font-size: 1.3em;
font-weight: bold;
color: #0c3762;
border-bottom: dotted thin #e0e0e0;
margin-bottom: 25px;
}
div.topnav {
/* background: #e0e0e0; */
}
div.topnav p {
margin-top: 0;
margin-left: 40px;
margin-right: 40px;
margin-bottom: 0px;
text-align: right;
font-size: 0.8em;
}
div.bottomnav {
background: #eeeeee;
}
div.bottomnav p {
margin-right: 40px;
text-align: right;
font-size: 0.8em;
}
a.uplink {
font-weight: normal;
}
/* contents box */
table.index {
margin: 0px 0px 30px 30px;
padding: 1px;
border-width: 1px;
border-style: dotted;
border-color: #e0e0e0;
}
table.index tr.heading {
background-color: #e0e0e0;
text-align: center;
font-weight: bold;
font-size: 1.1em;
}
table.index tr.index {
background-color: #eeeeee;
}
table.index td {
padding: 5px 20px;
}
table.index a:link, table.index a:visited {
font-weight: normal;
text-decoration: none;
color: #dc3c01;
}
table.index a:hover, table.index a:active {
text-decoration: underline;
color: #ff4500;
}
/* Haiku User Guide styles and layout */
/* Rounded corner boxes */
/* Common declarations */
div.admonition {
-webkit-border-radius: 10px;
-khtml-border-radius: 10px;
-moz-border-radius: 10px;
border-radius: 10px;
border-style: dotted;
border-width: thin;
border-color: #dcdcdc;
padding: 10px 15px 10px 15px;
margin-bottom: 15px;
margin-top: 15px;
}
div.note {
padding: 10px 15px 10px 80px;
background: #e4ffde url(alert_info_32.png) 15px 15px no-repeat;
min-height: 42px;
}
div.warning {
padding: 10px 15px 10px 80px;
background: #fffbc6 url(alert_warning_32.png) 15px 15px no-repeat;
min-height: 42px;
}
div.seealso {
background: #e4ffde;
}
/* More layout and styles */
h1 {
font-size: 1.3em;
font-weight: bold;
color: #0c3762;
border-bottom: dotted thin #e0e0e0;
margin-top: 30px;
}
h2 {
font-size: 1.2em;
font-weight: normal;
color: #0c3762;
border-bottom: dotted thin #e0e0e0;
margin-top: 30px;
}
h3 {
font-size: 1.1em;
font-weight: normal;
color: #0c3762;
margin-top: 30px;
}
h4 {
font-size: 1.0em;
font-weight: normal;
color: #0c3762;
margin-top: 30px;
}
p {
text-align: justify;
}
p.last {
margin-bottom: 0;
}
ol {
padding-left: 20px;
}
ul {
padding-left: 5px;
margin-top: 3px;
}
li {
line-height: 1.3;
}
div.content ul > li {
-moz-background-clip:border;
-moz-background-inline-policy:continuous;
-moz-background-origin:padding;
background: transparent url(bullet_orange.png) no-repeat scroll left 0.45em;
list-style-image: none;
list-style-type: none;
padding: 0 0 0 1.666em;
margin-bottom: 3px;
}
td {
vertical-align: top;
}
tt {
background-color: #e2e2e2;
font-size: 1.0em;
font-family: monospace;
}
pre {
border-color: #0c3762;
border-style: dotted;
border-width: thin;
margin: 0 0 12px 0;
padding: 0.8em;
background-color: #f0f0f0;
}
hr {
border-top: 1px solid #ccc;
border-bottom: 0;
border-right: 0;
border-left: 0;
margin-bottom: 10px;
margin-top: 20px;
}
/* printer only pretty stuff */
@media print {
.noprint {
display: none;
}
/* for acronyms we want their definitions inlined at print time */
acronym[title]:after {
font-size: small;
content: " (" attr(title) ")";
font-style: italic;
}
/* and not have mozilla dotted underline */
acronym {
border: none;
}
div.topnav, div.bottomnav, div.header, table.index {
display: none;
}
div.content {
margin: 0px;
padding: 0px;
}
html {
background: #FFF;
}
}
.viewcode-back {
font-family: "DejaVu Sans", Arial, Helvetica, sans-serif;
}
div.viewcode-block:target {
background-color: #f4debf;
border-top: 1px solid #ac9;
border-bottom: 1px solid #ac9;
margin: -1px -10px;
padding: 0 12px;
}

10872
doc/html/_static/jquery-3.5.1.js vendored Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,297 @@
/*
* language_data.js
* ~~~~~~~~~~~~~~~~
*
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
* :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
/* Non-minified version JS is _stemmer.js if file is provided */
/**
* Porter Stemmer
*/
var Stemmer = function() {
var step2list = {
ational: 'ate',
tional: 'tion',
enci: 'ence',
anci: 'ance',
izer: 'ize',
bli: 'ble',
alli: 'al',
entli: 'ent',
eli: 'e',
ousli: 'ous',
ization: 'ize',
ation: 'ate',
ator: 'ate',
alism: 'al',
iveness: 'ive',
fulness: 'ful',
ousness: 'ous',
aliti: 'al',
iviti: 'ive',
biliti: 'ble',
logi: 'log'
};
var step3list = {
icate: 'ic',
ative: '',
alize: 'al',
iciti: 'ic',
ical: 'ic',
ful: '',
ness: ''
};
var c = "[^aeiou]"; // consonant
var v = "[aeiouy]"; // vowel
var C = c + "[^aeiouy]*"; // consonant sequence
var V = v + "[aeiou]*"; // vowel sequence
var mgr0 = "^(" + C + ")?" + V + C; // [C]VC... is m>0
var meq1 = "^(" + C + ")?" + V + C + "(" + V + ")?$"; // [C]VC[V] is m=1
var mgr1 = "^(" + C + ")?" + V + C + V + C; // [C]VCVC... is m>1
var s_v = "^(" + C + ")?" + v; // vowel in stem
this.stemWord = function (w) {
var stem;
var suffix;
var firstch;
var origword = w;
if (w.length < 3)
return w;
var re;
var re2;
var re3;
var re4;
firstch = w.substr(0,1);
if (firstch == "y")
w = firstch.toUpperCase() + w.substr(1);
// Step 1a
re = /^(.+?)(ss|i)es$/;
re2 = /^(.+?)([^s])s$/;
if (re.test(w))
w = w.replace(re,"$1$2");
else if (re2.test(w))
w = w.replace(re2,"$1$2");
// Step 1b
re = /^(.+?)eed$/;
re2 = /^(.+?)(ed|ing)$/;
if (re.test(w)) {
var fp = re.exec(w);
re = new RegExp(mgr0);
if (re.test(fp[1])) {
re = /.$/;
w = w.replace(re,"");
}
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1];
re2 = new RegExp(s_v);
if (re2.test(stem)) {
w = stem;
re2 = /(at|bl|iz)$/;
re3 = new RegExp("([^aeiouylsz])\\1$");
re4 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re2.test(w))
w = w + "e";
else if (re3.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
else if (re4.test(w))
w = w + "e";
}
}
// Step 1c
re = /^(.+?)y$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(s_v);
if (re.test(stem))
w = stem + "i";
}
// Step 2
re = /^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step2list[suffix];
}
// Step 3
re = /^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
suffix = fp[2];
re = new RegExp(mgr0);
if (re.test(stem))
w = stem + step3list[suffix];
}
// Step 4
re = /^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/;
re2 = /^(.+?)(s|t)(ion)$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
if (re.test(stem))
w = stem;
}
else if (re2.test(w)) {
var fp = re2.exec(w);
stem = fp[1] + fp[2];
re2 = new RegExp(mgr1);
if (re2.test(stem))
w = stem;
}
// Step 5
re = /^(.+?)e$/;
if (re.test(w)) {
var fp = re.exec(w);
stem = fp[1];
re = new RegExp(mgr1);
re2 = new RegExp(meq1);
re3 = new RegExp("^" + C + v + "[^aeiouwxy]$");
if (re.test(stem) || (re2.test(stem) && !(re3.test(stem))))
w = stem;
}
re = /ll$/;
re2 = new RegExp(mgr1);
if (re.test(w) && re2.test(w)) {
re = /.$/;
w = w.replace(re,"");
}
// and turn initial Y back to y
if (firstch == "y")
w = firstch.toLowerCase() + w.substr(1);
return w;
}
}
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
1748, 1809, 2416, 2473, 2481, 2526, 2601, 2609, 2612, 2615, 2653, 2702,
2706, 2729, 2737, 2740, 2857, 2865, 2868, 2910, 2928, 2948, 2961, 2971,
2973, 3085, 3089, 3113, 3124, 3213, 3217, 3241, 3252, 3295, 3341, 3345,
3369, 3506, 3516, 3633, 3715, 3721, 3736, 3744, 3748, 3750, 3756, 3761,
3781, 3912, 4239, 4347, 4681, 4695, 4697, 4745, 4785, 4799, 4801, 4823,
4881, 5760, 5901, 5997, 6313, 7405, 8024, 8026, 8028, 8030, 8117, 8125,
8133, 8181, 8468, 8485, 8487, 8489, 8494, 8527, 11311, 11359, 11687, 11695,
11703, 11711, 11719, 11727, 11735, 12448, 12539, 43010, 43014, 43019, 43587,
43696, 43713, 64286, 64297, 64311, 64317, 64319, 64322, 64325, 65141];
var i, j, start, end;
for (i = 0; i < singles.length; i++) {
result[singles[i]] = true;
}
var ranges = [[0, 47], [58, 64], [91, 94], [123, 169], [171, 177], [182, 184], [706, 709],
[722, 735], [741, 747], [751, 879], [888, 889], [894, 901], [1154, 1161],
[1318, 1328], [1367, 1368], [1370, 1376], [1416, 1487], [1515, 1519], [1523, 1568],
[1611, 1631], [1642, 1645], [1750, 1764], [1767, 1773], [1789, 1790], [1792, 1807],
[1840, 1868], [1958, 1968], [1970, 1983], [2027, 2035], [2038, 2041], [2043, 2047],
[2070, 2073], [2075, 2083], [2085, 2087], [2089, 2307], [2362, 2364], [2366, 2383],
[2385, 2391], [2402, 2405], [2419, 2424], [2432, 2436], [2445, 2446], [2449, 2450],
[2483, 2485], [2490, 2492], [2494, 2509], [2511, 2523], [2530, 2533], [2546, 2547],
[2554, 2564], [2571, 2574], [2577, 2578], [2618, 2648], [2655, 2661], [2672, 2673],
[2677, 2692], [2746, 2748], [2750, 2767], [2769, 2783], [2786, 2789], [2800, 2820],
[2829, 2830], [2833, 2834], [2874, 2876], [2878, 2907], [2914, 2917], [2930, 2946],
[2955, 2957], [2966, 2968], [2976, 2978], [2981, 2983], [2987, 2989], [3002, 3023],
[3025, 3045], [3059, 3076], [3130, 3132], [3134, 3159], [3162, 3167], [3170, 3173],
[3184, 3191], [3199, 3204], [3258, 3260], [3262, 3293], [3298, 3301], [3312, 3332],
[3386, 3388], [3390, 3423], [3426, 3429], [3446, 3449], [3456, 3460], [3479, 3481],
[3518, 3519], [3527, 3584], [3636, 3647], [3655, 3663], [3674, 3712], [3717, 3718],
[3723, 3724], [3726, 3731], [3752, 3753], [3764, 3772], [3774, 3775], [3783, 3791],
[3802, 3803], [3806, 3839], [3841, 3871], [3892, 3903], [3949, 3975], [3980, 4095],
[4139, 4158], [4170, 4175], [4182, 4185], [4190, 4192], [4194, 4196], [4199, 4205],
[4209, 4212], [4226, 4237], [4250, 4255], [4294, 4303], [4349, 4351], [4686, 4687],
[4702, 4703], [4750, 4751], [4790, 4791], [4806, 4807], [4886, 4887], [4955, 4968],
[4989, 4991], [5008, 5023], [5109, 5120], [5741, 5742], [5787, 5791], [5867, 5869],
[5873, 5887], [5906, 5919], [5938, 5951], [5970, 5983], [6001, 6015], [6068, 6102],
[6104, 6107], [6109, 6111], [6122, 6127], [6138, 6159], [6170, 6175], [6264, 6271],
[6315, 6319], [6390, 6399], [6429, 6469], [6510, 6511], [6517, 6527], [6572, 6592],
[6600, 6607], [6619, 6655], [6679, 6687], [6741, 6783], [6794, 6799], [6810, 6822],
[6824, 6916], [6964, 6980], [6988, 6991], [7002, 7042], [7073, 7085], [7098, 7167],
[7204, 7231], [7242, 7244], [7294, 7400], [7410, 7423], [7616, 7679], [7958, 7959],
[7966, 7967], [8006, 8007], [8014, 8015], [8062, 8063], [8127, 8129], [8141, 8143],
[8148, 8149], [8156, 8159], [8173, 8177], [8189, 8303], [8306, 8307], [8314, 8318],
[8330, 8335], [8341, 8449], [8451, 8454], [8456, 8457], [8470, 8472], [8478, 8483],
[8506, 8507], [8512, 8516], [8522, 8525], [8586, 9311], [9372, 9449], [9472, 10101],
[10132, 11263], [11493, 11498], [11503, 11516], [11518, 11519], [11558, 11567],
[11622, 11630], [11632, 11647], [11671, 11679], [11743, 11822], [11824, 12292],
[12296, 12320], [12330, 12336], [12342, 12343], [12349, 12352], [12439, 12444],
[12544, 12548], [12590, 12592], [12687, 12689], [12694, 12703], [12728, 12783],
[12800, 12831], [12842, 12880], [12896, 12927], [12938, 12976], [12992, 13311],
[19894, 19967], [40908, 40959], [42125, 42191], [42238, 42239], [42509, 42511],
[42540, 42559], [42592, 42593], [42607, 42622], [42648, 42655], [42736, 42774],
[42784, 42785], [42889, 42890], [42893, 43002], [43043, 43055], [43062, 43071],
[43124, 43137], [43188, 43215], [43226, 43249], [43256, 43258], [43260, 43263],
[43302, 43311], [43335, 43359], [43389, 43395], [43443, 43470], [43482, 43519],
[43561, 43583], [43596, 43599], [43610, 43615], [43639, 43641], [43643, 43647],
[43698, 43700], [43703, 43704], [43710, 43711], [43715, 43738], [43742, 43967],
[44003, 44015], [44026, 44031], [55204, 55215], [55239, 55242], [55292, 55295],
[57344, 63743], [64046, 64047], [64110, 64111], [64218, 64255], [64263, 64274],
[64280, 64284], [64434, 64466], [64830, 64847], [64912, 64913], [64968, 65007],
[65020, 65135], [65277, 65295], [65306, 65312], [65339, 65344], [65371, 65381],
[65471, 65473], [65480, 65481], [65488, 65489], [65496, 65497]];
for (i = 0; i < ranges.length; i++) {
start = ranges[i][0];
end = ranges[i][1];
for (j = start; j <= end; j++) {
result[j] = true;
}
}
return result;
})();
function splitQuery(query) {
var result = [];
var start = -1;
for (var i = 0; i < query.length; i++) {
if (splitChars[query.charCodeAt(i)]) {
if (start !== -1) {
result.push(query.slice(start, i));
start = -1;
}
} else if (start === -1) {
start = i;
}
}
if (start !== -1) {
result.push(query.slice(start));
}
return result;
}

View File

@ -0,0 +1,999 @@
// Underscore.js 1.3.1
// (c) 2009-2012 Jeremy Ashkenas, DocumentCloud Inc.
// Underscore is freely distributable under the MIT license.
// Portions of Underscore are inspired or borrowed from Prototype,
// Oliver Steele's Functional, and John Resig's Micro-Templating.
// For all details and documentation:
// http://documentcloud.github.com/underscore
(function() {
// Baseline setup
// --------------
// Establish the root object, `window` in the browser, or `global` on the server.
var root = this;
// Save the previous value of the `_` variable.
var previousUnderscore = root._;
// Establish the object that gets returned to break out of a loop iteration.
var breaker = {};
// Save bytes in the minified (but not gzipped) version:
var ArrayProto = Array.prototype, ObjProto = Object.prototype, FuncProto = Function.prototype;
// Create quick reference variables for speed access to core prototypes.
var slice = ArrayProto.slice,
unshift = ArrayProto.unshift,
toString = ObjProto.toString,
hasOwnProperty = ObjProto.hasOwnProperty;
// All **ECMAScript 5** native function implementations that we hope to use
// are declared here.
var
nativeForEach = ArrayProto.forEach,
nativeMap = ArrayProto.map,
nativeReduce = ArrayProto.reduce,
nativeReduceRight = ArrayProto.reduceRight,
nativeFilter = ArrayProto.filter,
nativeEvery = ArrayProto.every,
nativeSome = ArrayProto.some,
nativeIndexOf = ArrayProto.indexOf,
nativeLastIndexOf = ArrayProto.lastIndexOf,
nativeIsArray = Array.isArray,
nativeKeys = Object.keys,
nativeBind = FuncProto.bind;
// Create a safe reference to the Underscore object for use below.
var _ = function(obj) { return new wrapper(obj); };
// Export the Underscore object for **Node.js**, with
// backwards-compatibility for the old `require()` API. If we're in
// the browser, add `_` as a global object via a string identifier,
// for Closure Compiler "advanced" mode.
if (typeof exports !== 'undefined') {
if (typeof module !== 'undefined' && module.exports) {
exports = module.exports = _;
}
exports._ = _;
} else {
root['_'] = _;
}
// Current version.
_.VERSION = '1.3.1';
// Collection Functions
// --------------------
// The cornerstone, an `each` implementation, aka `forEach`.
// Handles objects with the built-in `forEach`, arrays, and raw objects.
// Delegates to **ECMAScript 5**'s native `forEach` if available.
var each = _.each = _.forEach = function(obj, iterator, context) {
if (obj == null) return;
if (nativeForEach && obj.forEach === nativeForEach) {
obj.forEach(iterator, context);
} else if (obj.length === +obj.length) {
for (var i = 0, l = obj.length; i < l; i++) {
if (i in obj && iterator.call(context, obj[i], i, obj) === breaker) return;
}
} else {
for (var key in obj) {
if (_.has(obj, key)) {
if (iterator.call(context, obj[key], key, obj) === breaker) return;
}
}
}
};
// Return the results of applying the iterator to each element.
// Delegates to **ECMAScript 5**'s native `map` if available.
_.map = _.collect = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeMap && obj.map === nativeMap) return obj.map(iterator, context);
each(obj, function(value, index, list) {
results[results.length] = iterator.call(context, value, index, list);
});
if (obj.length === +obj.length) results.length = obj.length;
return results;
};
// **Reduce** builds up a single result from a list of values, aka `inject`,
// or `foldl`. Delegates to **ECMAScript 5**'s native `reduce` if available.
_.reduce = _.foldl = _.inject = function(obj, iterator, memo, context) {
var initial = arguments.length > 2;
if (obj == null) obj = [];
if (nativeReduce && obj.reduce === nativeReduce) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduce(iterator, memo) : obj.reduce(iterator);
}
each(obj, function(value, index, list) {
if (!initial) {
memo = value;
initial = true;
} else {
memo = iterator.call(context, memo, value, index, list);
}
});
if (!initial) throw new TypeError('Reduce of empty array with no initial value');
return memo;
};
// The right-associative version of reduce, also known as `foldr`.
// Delegates to **ECMAScript 5**'s native `reduceRight` if available.
_.reduceRight = _.foldr = function(obj, iterator, memo, context) {
var initial = arguments.length > 2;
if (obj == null) obj = [];
if (nativeReduceRight && obj.reduceRight === nativeReduceRight) {
if (context) iterator = _.bind(iterator, context);
return initial ? obj.reduceRight(iterator, memo) : obj.reduceRight(iterator);
}
var reversed = _.toArray(obj).reverse();
if (context && !initial) iterator = _.bind(iterator, context);
return initial ? _.reduce(reversed, iterator, memo, context) : _.reduce(reversed, iterator);
};
// Return the first value which passes a truth test. Aliased as `detect`.
_.find = _.detect = function(obj, iterator, context) {
var result;
any(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) {
result = value;
return true;
}
});
return result;
};
// Return all the elements that pass a truth test.
// Delegates to **ECMAScript 5**'s native `filter` if available.
// Aliased as `select`.
_.filter = _.select = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
if (nativeFilter && obj.filter === nativeFilter) return obj.filter(iterator, context);
each(obj, function(value, index, list) {
if (iterator.call(context, value, index, list)) results[results.length] = value;
});
return results;
};
// Return all the elements for which a truth test fails.
_.reject = function(obj, iterator, context) {
var results = [];
if (obj == null) return results;
each(obj, function(value, index, list) {
if (!iterator.call(context, value, index, list)) results[results.length] = value;
});
return results;
};
// Determine whether all of the elements match a truth test.
// Delegates to **ECMAScript 5**'s native `every` if available.
// Aliased as `all`.
_.every = _.all = function(obj, iterator, context) {
var result = true;
if (obj == null) return result;
if (nativeEvery && obj.every === nativeEvery) return obj.every(iterator, context);
each(obj, function(value, index, list) {
if (!(result = result && iterator.call(context, value, index, list))) return breaker;
});
return result;
};
// Determine if at least one element in the object matches a truth test.
// Delegates to **ECMAScript 5**'s native `some` if available.
// Aliased as `any`.
var any = _.some = _.any = function(obj, iterator, context) {
iterator || (iterator = _.identity);
var result = false;
if (obj == null) return result;
if (nativeSome && obj.some === nativeSome) return obj.some(iterator, context);
each(obj, function(value, index, list) {
if (result || (result = iterator.call(context, value, index, list))) return breaker;
});
return !!result;
};
// Determine if a given value is included in the array or object using `===`.
// Aliased as `contains`.
_.include = _.contains = function(obj, target) {
var found = false;
if (obj == null) return found;
if (nativeIndexOf && obj.indexOf === nativeIndexOf) return obj.indexOf(target) != -1;
found = any(obj, function(value) {
return value === target;
});
return found;
};
// Invoke a method (with arguments) on every item in a collection.
_.invoke = function(obj, method) {
var args = slice.call(arguments, 2);
return _.map(obj, function(value) {
return (_.isFunction(method) ? method || value : value[method]).apply(value, args);
});
};
// Convenience version of a common use case of `map`: fetching a property.
_.pluck = function(obj, key) {
return _.map(obj, function(value){ return value[key]; });
};
// Return the maximum element or (element-based computation).
_.max = function(obj, iterator, context) {
if (!iterator && _.isArray(obj)) return Math.max.apply(Math, obj);
if (!iterator && _.isEmpty(obj)) return -Infinity;
var result = {computed : -Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed >= result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Return the minimum element (or element-based computation).
_.min = function(obj, iterator, context) {
if (!iterator && _.isArray(obj)) return Math.min.apply(Math, obj);
if (!iterator && _.isEmpty(obj)) return Infinity;
var result = {computed : Infinity};
each(obj, function(value, index, list) {
var computed = iterator ? iterator.call(context, value, index, list) : value;
computed < result.computed && (result = {value : value, computed : computed});
});
return result.value;
};
// Shuffle an array.
_.shuffle = function(obj) {
var shuffled = [], rand;
each(obj, function(value, index, list) {
if (index == 0) {
shuffled[0] = value;
} else {
rand = Math.floor(Math.random() * (index + 1));
shuffled[index] = shuffled[rand];
shuffled[rand] = value;
}
});
return shuffled;
};
// Sort the object's values by a criterion produced by an iterator.
_.sortBy = function(obj, iterator, context) {
return _.pluck(_.map(obj, function(value, index, list) {
return {
value : value,
criteria : iterator.call(context, value, index, list)
};
}).sort(function(left, right) {
var a = left.criteria, b = right.criteria;
return a < b ? -1 : a > b ? 1 : 0;
}), 'value');
};
// Groups the object's values by a criterion. Pass either a string attribute
// to group by, or a function that returns the criterion.
_.groupBy = function(obj, val) {
var result = {};
var iterator = _.isFunction(val) ? val : function(obj) { return obj[val]; };
each(obj, function(value, index) {
var key = iterator(value, index);
(result[key] || (result[key] = [])).push(value);
});
return result;
};
// Use a comparator function to figure out at what index an object should
// be inserted so as to maintain order. Uses binary search.
_.sortedIndex = function(array, obj, iterator) {
iterator || (iterator = _.identity);
var low = 0, high = array.length;
while (low < high) {
var mid = (low + high) >> 1;
iterator(array[mid]) < iterator(obj) ? low = mid + 1 : high = mid;
}
return low;
};
// Safely convert anything iterable into a real, live array.
_.toArray = function(iterable) {
if (!iterable) return [];
if (iterable.toArray) return iterable.toArray();
if (_.isArray(iterable)) return slice.call(iterable);
if (_.isArguments(iterable)) return slice.call(iterable);
return _.values(iterable);
};
// Return the number of elements in an object.
_.size = function(obj) {
return _.toArray(obj).length;
};
// Array Functions
// ---------------
// Get the first element of an array. Passing **n** will return the first N
// values in the array. Aliased as `head`. The **guard** check allows it to work
// with `_.map`.
_.first = _.head = function(array, n, guard) {
return (n != null) && !guard ? slice.call(array, 0, n) : array[0];
};
// Returns everything but the last entry of the array. Especcialy useful on
// the arguments object. Passing **n** will return all the values in
// the array, excluding the last N. The **guard** check allows it to work with
// `_.map`.
_.initial = function(array, n, guard) {
return slice.call(array, 0, array.length - ((n == null) || guard ? 1 : n));
};
// Get the last element of an array. Passing **n** will return the last N
// values in the array. The **guard** check allows it to work with `_.map`.
_.last = function(array, n, guard) {
if ((n != null) && !guard) {
return slice.call(array, Math.max(array.length - n, 0));
} else {
return array[array.length - 1];
}
};
// Returns everything but the first entry of the array. Aliased as `tail`.
// Especially useful on the arguments object. Passing an **index** will return
// the rest of the values in the array from that index onward. The **guard**
// check allows it to work with `_.map`.
_.rest = _.tail = function(array, index, guard) {
return slice.call(array, (index == null) || guard ? 1 : index);
};
// Trim out all falsy values from an array.
_.compact = function(array) {
return _.filter(array, function(value){ return !!value; });
};
// Return a completely flattened version of an array.
_.flatten = function(array, shallow) {
return _.reduce(array, function(memo, value) {
if (_.isArray(value)) return memo.concat(shallow ? value : _.flatten(value));
memo[memo.length] = value;
return memo;
}, []);
};
// Return a version of the array that does not contain the specified value(s).
_.without = function(array) {
return _.difference(array, slice.call(arguments, 1));
};
// Produce a duplicate-free version of the array. If the array has already
// been sorted, you have the option of using a faster algorithm.
// Aliased as `unique`.
_.uniq = _.unique = function(array, isSorted, iterator) {
var initial = iterator ? _.map(array, iterator) : array;
var result = [];
_.reduce(initial, function(memo, el, i) {
if (0 == i || (isSorted === true ? _.last(memo) != el : !_.include(memo, el))) {
memo[memo.length] = el;
result[result.length] = array[i];
}
return memo;
}, []);
return result;
};
// Produce an array that contains the union: each distinct element from all of
// the passed-in arrays.
_.union = function() {
return _.uniq(_.flatten(arguments, true));
};
// Produce an array that contains every item shared between all the
// passed-in arrays. (Aliased as "intersect" for back-compat.)
_.intersection = _.intersect = function(array) {
var rest = slice.call(arguments, 1);
return _.filter(_.uniq(array), function(item) {
return _.every(rest, function(other) {
return _.indexOf(other, item) >= 0;
});
});
};
// Take the difference between one array and a number of other arrays.
// Only the elements present in just the first array will remain.
_.difference = function(array) {
var rest = _.flatten(slice.call(arguments, 1));
return _.filter(array, function(value){ return !_.include(rest, value); });
};
// Zip together multiple lists into a single array -- elements that share
// an index go together.
_.zip = function() {
var args = slice.call(arguments);
var length = _.max(_.pluck(args, 'length'));
var results = new Array(length);
for (var i = 0; i < length; i++) results[i] = _.pluck(args, "" + i);
return results;
};
// If the browser doesn't supply us with indexOf (I'm looking at you, **MSIE**),
// we need this function. Return the position of the first occurrence of an
// item in an array, or -1 if the item is not included in the array.
// Delegates to **ECMAScript 5**'s native `indexOf` if available.
// If the array is large and already in sort order, pass `true`
// for **isSorted** to use binary search.
_.indexOf = function(array, item, isSorted) {
if (array == null) return -1;
var i, l;
if (isSorted) {
i = _.sortedIndex(array, item);
return array[i] === item ? i : -1;
}
if (nativeIndexOf && array.indexOf === nativeIndexOf) return array.indexOf(item);
for (i = 0, l = array.length; i < l; i++) if (i in array && array[i] === item) return i;
return -1;
};
// Delegates to **ECMAScript 5**'s native `lastIndexOf` if available.
_.lastIndexOf = function(array, item) {
if (array == null) return -1;
if (nativeLastIndexOf && array.lastIndexOf === nativeLastIndexOf) return array.lastIndexOf(item);
var i = array.length;
while (i--) if (i in array && array[i] === item) return i;
return -1;
};
// Generate an integer Array containing an arithmetic progression. A port of
// the native Python `range()` function. See
// [the Python documentation](http://docs.python.org/library/functions.html#range).
_.range = function(start, stop, step) {
if (arguments.length <= 1) {
stop = start || 0;
start = 0;
}
step = arguments[2] || 1;
var len = Math.max(Math.ceil((stop - start) / step), 0);
var idx = 0;
var range = new Array(len);
while(idx < len) {
range[idx++] = start;
start += step;
}
return range;
};
// Function (ahem) Functions
// ------------------
// Reusable constructor function for prototype setting.
var ctor = function(){};
// Create a function bound to a given object (assigning `this`, and arguments,
// optionally). Binding with arguments is also known as `curry`.
// Delegates to **ECMAScript 5**'s native `Function.bind` if available.
// We check for `func.bind` first, to fail fast when `func` is undefined.
_.bind = function bind(func, context) {
var bound, args;
if (func.bind === nativeBind && nativeBind) return nativeBind.apply(func, slice.call(arguments, 1));
if (!_.isFunction(func)) throw new TypeError;
args = slice.call(arguments, 2);
return bound = function() {
if (!(this instanceof bound)) return func.apply(context, args.concat(slice.call(arguments)));
ctor.prototype = func.prototype;
var self = new ctor;
var result = func.apply(self, args.concat(slice.call(arguments)));
if (Object(result) === result) return result;
return self;
};
};
// Bind all of an object's methods to that object. Useful for ensuring that
// all callbacks defined on an object belong to it.
_.bindAll = function(obj) {
var funcs = slice.call(arguments, 1);
if (funcs.length == 0) funcs = _.functions(obj);
each(funcs, function(f) { obj[f] = _.bind(obj[f], obj); });
return obj;
};
// Memoize an expensive function by storing its results.
_.memoize = function(func, hasher) {
var memo = {};
hasher || (hasher = _.identity);
return function() {
var key = hasher.apply(this, arguments);
return _.has(memo, key) ? memo[key] : (memo[key] = func.apply(this, arguments));
};
};
// Delays a function for the given number of milliseconds, and then calls
// it with the arguments supplied.
_.delay = function(func, wait) {
var args = slice.call(arguments, 2);
return setTimeout(function(){ return func.apply(func, args); }, wait);
};
// Defers a function, scheduling it to run after the current call stack has
// cleared.
_.defer = function(func) {
return _.delay.apply(_, [func, 1].concat(slice.call(arguments, 1)));
};
// Returns a function, that, when invoked, will only be triggered at most once
// during a given window of time.
_.throttle = function(func, wait) {
var context, args, timeout, throttling, more;
var whenDone = _.debounce(function(){ more = throttling = false; }, wait);
return function() {
context = this; args = arguments;
var later = function() {
timeout = null;
if (more) func.apply(context, args);
whenDone();
};
if (!timeout) timeout = setTimeout(later, wait);
if (throttling) {
more = true;
} else {
func.apply(context, args);
}
whenDone();
throttling = true;
};
};
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds.
_.debounce = function(func, wait) {
var timeout;
return function() {
var context = this, args = arguments;
var later = function() {
timeout = null;
func.apply(context, args);
};
clearTimeout(timeout);
timeout = setTimeout(later, wait);
};
};
// Returns a function that will be executed at most one time, no matter how
// often you call it. Useful for lazy initialization.
_.once = function(func) {
var ran = false, memo;
return function() {
if (ran) return memo;
ran = true;
return memo = func.apply(this, arguments);
};
};
// Returns the first function passed as an argument to the second,
// allowing you to adjust arguments, run code before and after, and
// conditionally execute the original function.
_.wrap = function(func, wrapper) {
return function() {
var args = [func].concat(slice.call(arguments, 0));
return wrapper.apply(this, args);
};
};
// Returns a function that is the composition of a list of functions, each
// consuming the return value of the function that follows.
_.compose = function() {
var funcs = arguments;
return function() {
var args = arguments;
for (var i = funcs.length - 1; i >= 0; i--) {
args = [funcs[i].apply(this, args)];
}
return args[0];
};
};
// Returns a function that will only be executed after being called N times.
_.after = function(times, func) {
if (times <= 0) return func();
return function() {
if (--times < 1) { return func.apply(this, arguments); }
};
};
// Object Functions
// ----------------
// Retrieve the names of an object's properties.
// Delegates to **ECMAScript 5**'s native `Object.keys`
_.keys = nativeKeys || function(obj) {
if (obj !== Object(obj)) throw new TypeError('Invalid object');
var keys = [];
for (var key in obj) if (_.has(obj, key)) keys[keys.length] = key;
return keys;
};
// Retrieve the values of an object's properties.
_.values = function(obj) {
return _.map(obj, _.identity);
};
// Return a sorted list of the function names available on the object.
// Aliased as `methods`
_.functions = _.methods = function(obj) {
var names = [];
for (var key in obj) {
if (_.isFunction(obj[key])) names.push(key);
}
return names.sort();
};
// Extend a given object with all the properties in passed-in object(s).
_.extend = function(obj) {
each(slice.call(arguments, 1), function(source) {
for (var prop in source) {
obj[prop] = source[prop];
}
});
return obj;
};
// Fill in a given object with default properties.
_.defaults = function(obj) {
each(slice.call(arguments, 1), function(source) {
for (var prop in source) {
if (obj[prop] == null) obj[prop] = source[prop];
}
});
return obj;
};
// Create a (shallow-cloned) duplicate of an object.
_.clone = function(obj) {
if (!_.isObject(obj)) return obj;
return _.isArray(obj) ? obj.slice() : _.extend({}, obj);
};
// Invokes interceptor with the obj, and then returns obj.
// The primary purpose of this method is to "tap into" a method chain, in
// order to perform operations on intermediate results within the chain.
_.tap = function(obj, interceptor) {
interceptor(obj);
return obj;
};
// Internal recursive comparison function.
function eq(a, b, stack) {
// Identical objects are equal. `0 === -0`, but they aren't identical.
// See the Harmony `egal` proposal: http://wiki.ecmascript.org/doku.php?id=harmony:egal.
if (a === b) return a !== 0 || 1 / a == 1 / b;
// A strict comparison is necessary because `null == undefined`.
if (a == null || b == null) return a === b;
// Unwrap any wrapped objects.
if (a._chain) a = a._wrapped;
if (b._chain) b = b._wrapped;
// Invoke a custom `isEqual` method if one is provided.
if (a.isEqual && _.isFunction(a.isEqual)) return a.isEqual(b);
if (b.isEqual && _.isFunction(b.isEqual)) return b.isEqual(a);
// Compare `[[Class]]` names.
var className = toString.call(a);
if (className != toString.call(b)) return false;
switch (className) {
// Strings, numbers, dates, and booleans are compared by value.
case '[object String]':
// Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
// equivalent to `new String("5")`.
return a == String(b);
case '[object Number]':
// `NaN`s are equivalent, but non-reflexive. An `egal` comparison is performed for
// other numeric values.
return a != +a ? b != +b : (a == 0 ? 1 / a == 1 / b : a == +b);
case '[object Date]':
case '[object Boolean]':
// Coerce dates and booleans to numeric primitive values. Dates are compared by their
// millisecond representations. Note that invalid dates with millisecond representations
// of `NaN` are not equivalent.
return +a == +b;
// RegExps are compared by their source patterns and flags.
case '[object RegExp]':
return a.source == b.source &&
a.global == b.global &&
a.multiline == b.multiline &&
a.ignoreCase == b.ignoreCase;
}
if (typeof a != 'object' || typeof b != 'object') return false;
// Assume equality for cyclic structures. The algorithm for detecting cyclic
// structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
var length = stack.length;
while (length--) {
// Linear search. Performance is inversely proportional to the number of
// unique nested structures.
if (stack[length] == a) return true;
}
// Add the first object to the stack of traversed objects.
stack.push(a);
var size = 0, result = true;
// Recursively compare objects and arrays.
if (className == '[object Array]') {
// Compare array lengths to determine if a deep comparison is necessary.
size = a.length;
result = size == b.length;
if (result) {
// Deep compare the contents, ignoring non-numeric properties.
while (size--) {
// Ensure commutative equality for sparse arrays.
if (!(result = size in a == size in b && eq(a[size], b[size], stack))) break;
}
}
} else {
// Objects with different constructors are not equivalent.
if ('constructor' in a != 'constructor' in b || a.constructor != b.constructor) return false;
// Deep compare objects.
for (var key in a) {
if (_.has(a, key)) {
// Count the expected number of properties.
size++;
// Deep compare each member.
if (!(result = _.has(b, key) && eq(a[key], b[key], stack))) break;
}
}
// Ensure that both objects contain the same number of properties.
if (result) {
for (key in b) {
if (_.has(b, key) && !(size--)) break;
}
result = !size;
}
}
// Remove the first object from the stack of traversed objects.
stack.pop();
return result;
}
// Perform a deep comparison to check if two objects are equal.
_.isEqual = function(a, b) {
return eq(a, b, []);
};
// Is a given array, string, or object empty?
// An "empty" object has no enumerable own-properties.
_.isEmpty = function(obj) {
if (_.isArray(obj) || _.isString(obj)) return obj.length === 0;
for (var key in obj) if (_.has(obj, key)) return false;
return true;
};
// Is a given value a DOM element?
_.isElement = function(obj) {
return !!(obj && obj.nodeType == 1);
};
// Is a given value an array?
// Delegates to ECMA5's native Array.isArray
_.isArray = nativeIsArray || function(obj) {
return toString.call(obj) == '[object Array]';
};
// Is a given variable an object?
_.isObject = function(obj) {
return obj === Object(obj);
};
// Is a given variable an arguments object?
_.isArguments = function(obj) {
return toString.call(obj) == '[object Arguments]';
};
if (!_.isArguments(arguments)) {
_.isArguments = function(obj) {
return !!(obj && _.has(obj, 'callee'));
};
}
// Is a given value a function?
_.isFunction = function(obj) {
return toString.call(obj) == '[object Function]';
};
// Is a given value a string?
_.isString = function(obj) {
return toString.call(obj) == '[object String]';
};
// Is a given value a number?
_.isNumber = function(obj) {
return toString.call(obj) == '[object Number]';
};
// Is the given value `NaN`?
_.isNaN = function(obj) {
// `NaN` is the only value for which `===` is not reflexive.
return obj !== obj;
};
// Is a given value a boolean?
_.isBoolean = function(obj) {
return obj === true || obj === false || toString.call(obj) == '[object Boolean]';
};
// Is a given value a date?
_.isDate = function(obj) {
return toString.call(obj) == '[object Date]';
};
// Is the given value a regular expression?
_.isRegExp = function(obj) {
return toString.call(obj) == '[object RegExp]';
};
// Is a given value equal to null?
_.isNull = function(obj) {
return obj === null;
};
// Is a given variable undefined?
_.isUndefined = function(obj) {
return obj === void 0;
};
// Has own property?
_.has = function(obj, key) {
return hasOwnProperty.call(obj, key);
};
// Utility Functions
// -----------------
// Run Underscore.js in *noConflict* mode, returning the `_` variable to its
// previous owner. Returns a reference to the Underscore object.
_.noConflict = function() {
root._ = previousUnderscore;
return this;
};
// Keep the identity function around for default iterators.
_.identity = function(value) {
return value;
};
// Run a function **n** times.
_.times = function (n, iterator, context) {
for (var i = 0; i < n; i++) iterator.call(context, i);
};
// Escape a string for HTML interpolation.
_.escape = function(string) {
return (''+string).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;').replace(/"/g, '&quot;').replace(/'/g, '&#x27;').replace(/\//g,'&#x2F;');
};
// Add your own custom functions to the Underscore object, ensuring that
// they're correctly added to the OOP wrapper as well.
_.mixin = function(obj) {
each(_.functions(obj), function(name){
addToWrapper(name, _[name] = obj[name]);
});
};
// Generate a unique integer id (unique within the entire client session).
// Useful for temporary DOM ids.
var idCounter = 0;
_.uniqueId = function(prefix) {
var id = idCounter++;
return prefix ? prefix + id : id;
};
// By default, Underscore uses ERB-style template delimiters, change the
// following template settings to use alternative delimiters.
_.templateSettings = {
evaluate : /<%([\s\S]+?)%>/g,
interpolate : /<%=([\s\S]+?)%>/g,
escape : /<%-([\s\S]+?)%>/g
};
// When customizing `templateSettings`, if you don't want to define an
// interpolation, evaluation or escaping regex, we need one that is
// guaranteed not to match.
var noMatch = /.^/;
// Within an interpolation, evaluation, or escaping, remove HTML escaping
// that had been previously added.
var unescape = function(code) {
return code.replace(/\\\\/g, '\\').replace(/\\'/g, "'");
};
// JavaScript micro-templating, similar to John Resig's implementation.
// Underscore templating handles arbitrary delimiters, preserves whitespace,
// and correctly escapes quotes within interpolated code.
_.template = function(str, data) {
var c = _.templateSettings;
var tmpl = 'var __p=[],print=function(){__p.push.apply(__p,arguments);};' +
'with(obj||{}){__p.push(\'' +
str.replace(/\\/g, '\\\\')
.replace(/'/g, "\\'")
.replace(c.escape || noMatch, function(match, code) {
return "',_.escape(" + unescape(code) + "),'";
})
.replace(c.interpolate || noMatch, function(match, code) {
return "'," + unescape(code) + ",'";
})
.replace(c.evaluate || noMatch, function(match, code) {
return "');" + unescape(code).replace(/[\r\n\t]/g, ' ') + ";__p.push('";
})
.replace(/\r/g, '\\r')
.replace(/\n/g, '\\n')
.replace(/\t/g, '\\t')
+ "');}return __p.join('');";
var func = new Function('obj', '_', tmpl);
if (data) return func(data, _);
return function(data) {
return func.call(this, data, _);
};
};
// Add a "chain" function, which will delegate to the wrapper.
_.chain = function(obj) {
return _(obj).chain();
};
// The OOP Wrapper
// ---------------
// If Underscore is called as a function, it returns a wrapped object that
// can be used OO-style. This wrapper holds altered versions of all the
// underscore functions. Wrapped objects may be chained.
var wrapper = function(obj) { this._wrapped = obj; };
// Expose `wrapper.prototype` as `_.prototype`
_.prototype = wrapper.prototype;
// Helper function to continue chaining intermediate results.
var result = function(obj, chain) {
return chain ? _(obj).chain() : obj;
};
// A method to easily add functions to the OOP wrapper.
var addToWrapper = function(name, func) {
wrapper.prototype[name] = function() {
var args = slice.call(arguments);
unshift.call(args, this._wrapped);
return result(func.apply(_, args), this._chain);
};
};
// Add all of the Underscore functions to the wrapper object.
_.mixin(_);
// Add all mutator Array functions to the wrapper.
each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
var method = ArrayProto[name];
wrapper.prototype[name] = function() {
var wrapped = this._wrapped;
method.apply(wrapped, arguments);
var length = wrapped.length;
if ((name == 'shift' || name == 'splice') && length === 0) delete wrapped[0];
return result(wrapped, this._chain);
};
});
// Add all accessor Array functions to the wrapper.
each(['concat', 'join', 'slice'], function(name) {
var method = ArrayProto[name];
wrapper.prototype[name] = function() {
return result(method.apply(this._wrapped, arguments), this._chain);
};
});
// Start chaining a wrapped Underscore object.
wrapper.prototype.chain = function() {
this._chain = true;
return this;
};
// Extracts the result from a wrapped and chained object.
wrapper.prototype.value = function() {
return this._wrapped;
};
}).call(this);

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Acknowledgements &mdash; musrfit 1.6.4 documentation</title>
<title>Acknowledgements &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="bugtracking.html" title="Bugtracking"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Acknowledgements</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="bugtracking.html">Bugtracking</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="acknowledgements">
<span id="acknowledgment"></span><span id="index-0"></span><h1>Acknowledgements<a class="headerlink" href="#acknowledgements" title="Permalink to this headline"></a></h1>
<dl class="docutils">
@ -67,57 +64,22 @@ extremely competent way to deal with his projects as well as to deal with the ch
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="musr-root.html"
title="previous chapter">MusrRoot - an Extensible Open File Format for μSR</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="bugtracking.html"
title="next chapter">Bugtracking</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/acknowledgement.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="bugtracking.html">Bugtracking</a>&#160;&#160;»
</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="bugtracking.html" title="Bugtracking"
>next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>any2many - a Universal μSR-file-format converter &mdash; musrfit 1.6.4 documentation</title>
<title>any2many - a Universal μSR-file-format converter &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="musr-root.html" title="MusrRoot - an Extensible Open File Format for μSR"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>any2many - a Universal μSR-file-format converter</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="any2many-a-universal-mgrsr-file-format-converter">
<span id="index-0"></span><h1>any2many - a Universal μSR-file-format converter<a class="headerlink" href="#any2many-a-universal-mgrsr-file-format-converter" title="Permalink to this headline"></a></h1>
<p><tt class="docutils literal"><span class="pre">any2many</span></tt> allows to convert most μSR-file-formats from one to the other.
@ -57,57 +54,22 @@ For a detailed description see <a class="reference internal" href="user-manual.h
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="msr2data.html"
title="previous chapter">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="musr-root.html"
title="next chapter">MusrRoot - an Extensible Open File Format for μSR</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/any2many.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a>&#160;&#160;»
</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="musr-root.html" title="MusrRoot - an Extensible Open File Format for μSR"
>next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Bugtracking &mdash; musrfit 1.6.4 documentation</title>
<title>Bugtracking &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,28 +24,26 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 documentation" href="index.html" />
<link rel="prev" title="Acknowledgements" href="acknowledgement.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="acknowledgement.html" title="Acknowledgements"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Bugtracking</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="acknowledgement.html">Acknowledgements</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="bugtracking">
<span id="index-0"></span><span id="id1"></span><h1>Bugtracking<a class="headerlink" href="#bugtracking" title="Permalink to this headline"></a></h1>
<p>For reporting bugs or requesting new features and improvements please use
@ -54,51 +52,20 @@ or send an e-mail to A. Suter at PSI.</p>
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="acknowledgement.html"
title="previous chapter">Acknowledgements</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/bugtracking.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="acknowledgement.html">Acknowledgements</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="acknowledgement.html" title="Acknowledgements"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>How to Cite musrfit? &mdash; musrfit 1.6.4 documentation</title>
<title>How to Cite musrfit? &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="tutorial.html" title="Tutorial for musrfit"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>How to Cite musrfit?</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="index.html">Welcome to the musrfit documentation!</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="tutorial.html">Tutorial for <tt class="docutils literal"><span class="pre">musrfit</span></tt></a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="how-to-cite-musrfit">
<span id="cite"></span><span id="index-0"></span><h1>How to Cite <tt class="docutils literal"><span class="pre">musrfit</span></tt>?<a class="headerlink" href="#how-to-cite-musrfit" title="Permalink to this headline"></a></h1>
<p>Since quite some effort is going into the development and maintenance of the <tt class="docutils literal"><span class="pre">musrfit</span></tt> package, you should at least acknowledge it in your publication if you have used it to analyze your data. Even better of course is to cite it properly by the reference given beneath</p>
@ -69,57 +66,22 @@
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Welcome to the musrfit documentation!</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="tutorial.html"
title="next chapter">Tutorial for <tt class="docutils literal"><span class="pre">musrfit</span></tt></a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/cite.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="index.html">Welcome to the musrfit documentation!</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="tutorial.html">Tutorial for <tt class="docutils literal"><span class="pre">musrfit</span></tt></a>&#160;&#160;»
</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="tutorial.html" title="Tutorial for musrfit"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to the musrfit documentation!"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -7,15 +7,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Index &mdash; musrfit 1.6.4 documentation</title>
<title>Index &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -25,24 +25,23 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 documentation" href="index.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Index</span></h2>
</div>
<div class="topnav">
<p>
<a class="uplink" href="index.html">Contents</a>
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<h1 id="index">Index</h1>
@ -89,21 +88,25 @@
</dt>
<dt><a href="user-manual.html#index-19">addrun</a>
<dt><a href="user-manual.html#index-20">addrun</a>
</dt>
<dt><a href="user-manual.html#index-36">addt0-asymmetry</a>
<dt><a href="user-manual.html#index-10">addRunApp</a>
</dt>
<dt><a href="user-manual.html#index-35">addt0-single-histo</a>
<dt><a href="user-manual.html#index-37">addt0-asymmetry</a>
</dt>
<dt><a href="user-manual.html#index-36">addt0-single-histo</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-21">alpha-beta</a>
<dt><a href="user-manual.html#index-22">alpha-beta</a>
</dt>
@ -111,11 +114,11 @@
</dt>
<dt><a href="user-manual.html#index-70">asymmetry-fit</a>
<dt><a href="user-manual.html#index-71">asymmetry-fit</a>
</dt>
<dt><a href="user-manual.html#index-71">asymmetry-rrf-fit</a>
<dt><a href="user-manual.html#index-72">asymmetry-rrf-fit</a>
</dt>
</dl></td>
@ -125,19 +128,19 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-23">backgr.fit</a>
<dt><a href="user-manual.html#index-24">backgr.fit</a>
</dt>
<dt><a href="user-manual.html#index-28">backgr.fix</a>
<dt><a href="user-manual.html#index-29">backgr.fix</a>
</dt>
<dt><a href="user-manual.html#index-30">background-asymmetry</a>
<dt><a href="user-manual.html#index-31">background-asymmetry</a>
</dt>
<dt><a href="user-manual.html#index-29">background-single-histo</a>
<dt><a href="user-manual.html#index-30">background-single-histo</a>
</dt>
@ -151,7 +154,7 @@
</dt>
<dt><a href="user-manual.html#index-73">bnmr-asymmetry-fit</a>
<dt><a href="user-manual.html#index-74">bnmr-asymmetry-fit</a>
</dt>
@ -176,14 +179,10 @@
<dt><a href="cite.html#index-0">cite</a>
</dt>
<dt><a href="setup-dks.html#index-2">cuda-install</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="setup-standard.html#index-21">cygwin</a>
<dt><a href="setup-dks.html#index-2">cuda-install</a>
</dt>
</dl></td>
@ -193,11 +192,11 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-32">data-asymmetry</a>
<dt><a href="user-manual.html#index-33">data-asymmetry</a>
</dt>
<dt><a href="user-manual.html#index-31">data-single-histo</a>
<dt><a href="user-manual.html#index-32">data-single-histo</a>
</dt>
@ -205,7 +204,7 @@
</dt>
<dt><a href="user-manual.html#index-42">dks-command-overview</a>
<dt><a href="user-manual.html#index-43">dks-command-overview</a>
</dt>
@ -251,61 +250,61 @@
</dt>
<dt><a href="setup-standard.html#index-30">fink</a>
<dt><a href="setup-standard.html#index-24">fink</a>
</dt>
<dt><a href="user-manual.html#index-38">fit</a>
<dt><a href="user-manual.html#index-39">fit</a>
</dt>
<dt><a href="user-manual.html#index-67">fit-types</a>
<dt><a href="user-manual.html#index-68">fit-types</a>
</dt>
<dt><a href="user-manual.html#index-20">fittype</a>
<dt><a href="user-manual.html#index-21">fittype</a>
</dt>
<dt><a href="user-manual.html#index-26">forward</a>
<dt><a href="user-manual.html#index-27">forward</a>
</dt>
<dt><a href="user-manual.html#index-27">forward-backward</a>
<dt><a href="user-manual.html#index-28">forward-backward</a>
</dt>
<dt><a href="user-manual.html#index-49">fourier-block-apodization</a>
<dt><a href="user-manual.html#index-50">fourier-block-apodization</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-48">fourier-block-dc-corrected</a>
<dt><a href="user-manual.html#index-49">fourier-block-dc-corrected</a>
</dt>
<dt><a href="user-manual.html#index-47">fourier-block-fourier_power</a>
<dt><a href="user-manual.html#index-48">fourier-block-fourier_power</a>
</dt>
<dt><a href="user-manual.html#index-51">fourier-block-phase</a>
<dt><a href="user-manual.html#index-52">fourier-block-phase</a>
</dt>
<dt><a href="user-manual.html#index-50">fourier-block-plot</a>
<dt><a href="user-manual.html#index-51">fourier-block-plot</a>
</dt>
<dt><a href="user-manual.html#index-53">fourier-block-range</a>
<dt><a href="user-manual.html#index-54">fourier-block-range</a>
</dt>
<dt><a href="user-manual.html#index-52">fourier-block-range_for_phase_correction</a>
<dt><a href="user-manual.html#index-53">fourier-block-range_for_phase_correction</a>
</dt>
<dt><a href="user-manual.html#index-46">fourier-block-units</a>
<dt><a href="user-manual.html#index-47">fourier-block-units</a>
</dt>
</dl></td>
@ -383,7 +382,7 @@
</dt>
<dt><a href="user-manual.html#index-24">lifetime</a>
<dt><a href="user-manual.html#index-25">lifetime</a>
</dt>
</dl></td>
@ -415,15 +414,15 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="setup-standard.html#index-27">macports</a>
<dt><a href="setup-standard.html#index-21">macports</a>
</dt>
<dt><a href="user-manual.html#index-25">map</a>
<dt><a href="user-manual.html#index-26">map</a>
</dt>
<dt><a href="user-manual.html#index-16">meta-information</a>
<dt><a href="user-manual.html#index-17">meta-information</a>
</dt>
@ -431,99 +430,99 @@
</dt>
<dt><a href="user-manual.html#index-41">minuit2-command-overview</a>
<dt><a href="user-manual.html#index-42">minuit2-command-overview</a>
</dt>
<dt><a href="user-manual.html#index-40">msr-commands-block</a>
<dt><a href="user-manual.html#index-41">msr-commands-block</a>
</dt>
<dt><a href="user-manual.html#index-44">msr-commands-block-dks</a>
<dt><a href="user-manual.html#index-45">msr-commands-block-dks</a>
</dt>
<dt><a href="user-manual.html#index-11">msr-file-format</a>
<dt><a href="user-manual.html#index-12">msr-file-format</a>
</dt>
<dt><a href="user-manual.html#index-13">msr-fitparameter-block</a>
<dt><a href="user-manual.html#index-14">msr-fitparameter-block</a>
</dt>
<dt><a href="user-manual.html#index-45">msr-fourier-block</a>
<dt><a href="user-manual.html#index-46">msr-fourier-block</a>
</dt>
<dt><a href="user-manual.html#index-15">msr-functions-block</a>
<dt><a href="user-manual.html#index-16">msr-functions-block</a>
</dt>
<dt><a href="user-manual.html#index-17">msr-global-block</a>
<dt><a href="user-manual.html#index-18">msr-global-block</a>
</dt>
<dt><a href="user-manual.html#index-54">msr-plot-block</a>
<dt><a href="user-manual.html#index-55">msr-plot-block</a>
</dt>
<dt><a href="user-manual.html#index-55">msr-plot-block-lifetimecorrection</a>
<dt><a href="user-manual.html#index-56">msr-plot-block-lifetimecorrection</a>
</dt>
<dt><a href="user-manual.html#index-61">msr-plot-block-logx</a>
<dt><a href="user-manual.html#index-62">msr-plot-block-logx</a>
</dt>
<dt><a href="user-manual.html#index-62">msr-plot-block-logy</a>
<dt><a href="user-manual.html#index-63">msr-plot-block-logy</a>
</dt>
<dt><a href="user-manual.html#index-57">msr-plot-block-range</a>
<dt><a href="user-manual.html#index-58">msr-plot-block-range</a>
</dt>
<dt><a href="user-manual.html#index-64">msr-plot-block-rrf_freq</a>
<dt><a href="user-manual.html#index-65">msr-plot-block-rrf_freq</a>
</dt>
<dt><a href="user-manual.html#index-63">msr-plot-block-rrf_packing</a>
<dt><a href="user-manual.html#index-64">msr-plot-block-rrf_packing</a>
</dt>
<dt><a href="user-manual.html#index-65">msr-plot-block-rrf_phase</a>
<dt><a href="user-manual.html#index-66">msr-plot-block-rrf_phase</a>
</dt>
<dt><a href="user-manual.html#index-56">msr-plot-block-runs</a>
<dt><a href="user-manual.html#index-57">msr-plot-block-runs</a>
</dt>
<dt><a href="user-manual.html#index-58">msr-plot-block-sub_ranges</a>
<dt><a href="user-manual.html#index-59">msr-plot-block-sub_ranges</a>
</dt>
<dt><a href="user-manual.html#index-59">msr-plot-block-use_fit_ranges</a>
<dt><a href="user-manual.html#index-60">msr-plot-block-use_fit_ranges</a>
</dt>
<dt><a href="user-manual.html#index-60">msr-plot-block-view_packing</a>
<dt><a href="user-manual.html#index-61">msr-plot-block-view_packing</a>
</dt>
<dt><a href="user-manual.html#index-18">msr-run-block</a>
<dt><a href="user-manual.html#index-19">msr-run-block</a>
</dt>
<dt><a href="user-manual.html#index-66">msr-statistc-block</a>
<dt><a href="user-manual.html#index-67">msr-statistc-block</a>
</dt>
<dt><a href="user-manual.html#index-14">msr-theory-block</a>
<dt><a href="user-manual.html#index-15">msr-theory-block</a>
</dt>
<dt><a href="user-manual.html#index-12">msr-title-block</a>
<dt><a href="user-manual.html#index-13">msr-title-block</a>
</dt>
@ -550,6 +549,8 @@
<dt><a href="mupp.html#index-0">mupp</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="mupp.html#index-1">mupp-gui</a>
</dt>
@ -558,8 +559,6 @@
<dt><a href="mupp.html#index-2">mupp-scripting</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="mupp.html#index-3">mupp-usage</a>
</dt>
@ -569,7 +568,7 @@
</dt>
<dt><a href="setup-standard.html#index-35">musredit-build-macos</a>
<dt><a href="setup-standard.html#index-29">musredit-build-macos</a>
</dt>
@ -581,10 +580,6 @@
</dt>
<dt><a href="setup-standard.html#index-26">musredit-install-windows</a>
</dt>
<dt><a href="musredit.html#index-1">musredit_startup</a>
</dt>
@ -597,11 +592,7 @@
</dt>
<dt><a href="setup-standard.html#index-34">musrfit-build-cmake-macos</a>
</dt>
<dt><a href="setup-standard.html#index-25">musrfit-build-cmake-windows</a>
<dt><a href="setup-standard.html#index-28">musrfit-build-cmake-macos</a>
</dt>
@ -609,15 +600,11 @@
</dt>
<dt><a href="setup-standard.html#index-33">musrfit-build-macos</a>
<dt><a href="setup-standard.html#index-27">musrfit-build-macos</a>
</dt>
<dt><a href="setup-standard.html#index-24">musrfit-build-windows</a>
</dt>
<dt><a href="user-manual.html#index-43">musrfit-command-block-details</a>
<dt><a href="user-manual.html#index-44">musrfit-command-block-details</a>
</dt>
@ -625,7 +612,7 @@
</dt>
<dt><a href="user-manual.html#index-10">musrfit-startup</a>
<dt><a href="user-manual.html#index-11">musrfit-startup</a>
</dt>
@ -707,7 +694,7 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-72">negative-muon-musr-fit</a>
<dt><a href="user-manual.html#index-73">negative-muon-musr-fit</a>
</dt>
@ -715,7 +702,7 @@
</dt>
<dt><a href="setup-standard.html#index-31">nexus-build-fink</a>
<dt><a href="setup-standard.html#index-25">nexus-build-fink</a>
</dt>
@ -725,19 +712,15 @@
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="setup-standard.html#index-28">nexus-build-macports</a>
<dt><a href="setup-standard.html#index-22">nexus-build-macports</a>
</dt>
<dt><a href="setup-standard.html#index-22">nexus-build-windows</a>
<dt><a href="user-manual.html#index-75">non-musr-fit</a>
</dt>
<dt><a href="user-manual.html#index-74">non-musr-fit</a>
</dt>
<dt><a href="user-manual.html#index-22">norm</a>
<dt><a href="user-manual.html#index-23">norm</a>
</dt>
</dl></td>
@ -757,7 +740,7 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-39">packing</a>
<dt><a href="user-manual.html#index-40">packing</a>
</dt>
@ -795,21 +778,21 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="setup-standard.html#index-32">root-build-fink</a>
<dt><a href="user-manual.html#index-79">rge-handler</a>
</dt>
<dt><a href="setup-standard.html#index-26">root-build-fink</a>
</dt>
<dt><a href="setup-standard.html#index-16">root-build-linux</a>
</dt>
<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><a href="setup-standard.html#index-23">root-build-macports</a>
</dt>
@ -831,13 +814,13 @@
</dt>
<dt><a href="user-manual.html#index-68">single-histogram-fit</a>
<dt><a href="user-manual.html#index-69">single-histogram-fit</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-69">single-histogram-rrf-fit</a>
<dt><a href="user-manual.html#index-70">single-histogram-rrf-fit</a>
</dt>
@ -855,15 +838,15 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-34">t0-asymmetry</a>
<dt><a href="user-manual.html#index-35">t0-asymmetry</a>
</dt>
<dt><a href="user-manual.html#index-33">t0-single-histo</a>
<dt><a href="user-manual.html#index-34">t0-single-histo</a>
</dt>
<dt><a href="user-manual.html#index-78">technical-musrfit</a>
<dt><a href="user-manual.html#index-80">technical-musrfit</a>
</dt>
@ -895,15 +878,15 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-75">user-functions</a>
<dt><a href="user-manual.html#index-76">user-functions</a>
</dt>
<dt><a href="user-manual.html#index-77">user-functions-with-global-part</a>
<dt><a href="user-manual.html#index-78">user-functions-with-global-part</a>
</dt>
<dt><a href="user-manual.html#index-76">user-functions-without-global-part</a>
<dt><a href="user-manual.html#index-77">user-functions-without-global-part</a>
</dt>
</dl></td>
@ -951,7 +934,7 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-37">xy-data</a>
<dt><a href="user-manual.html#index-38">xy-data</a>
</dt>
</dl></td>
@ -959,43 +942,18 @@
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<div class="bottomnav">
<p>
<a class="uplink" href="index.html">Contents</a>
</p>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="#" title="General Index"
>index</a></li>
<li><a href="index.html">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.6.4 documentation</title>
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,28 +24,26 @@
<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.4 documentation" href="#" />
<link rel="top" title="musrfit 1.8.0 documentation" href="#" />
<link rel="next" title="How to Cite musrfit?" href="cite.html" />
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="cite.html" title="How to Cite musrfit?"
accesskey="N">next</a> |</li>
<li><a href="#">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="#">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Welcome to the musrfit documentation!</span></h2>
</div>
<div class="topnav">
<p>
<a class="uplink" href="#">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="cite.html">How to Cite <tt class="docutils literal"><span class="pre">musrfit</span></tt>?</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="welcome-to-the-musrfit-documentation">
<h1>Welcome to the musrfit documentation!<a class="headerlink" href="#welcome-to-the-musrfit-documentation" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
@ -135,57 +133,20 @@
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Welcome to the musrfit documentation!</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
<div class="bottomnav">
<p>
<a class="uplink" href="#">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="cite.html">How to Cite <tt class="docutils literal"><span class="pre">musrfit</span></tt>?</a>&#160;&#160;»
</p>
<h4>Next topic</h4>
<p class="topless"><a href="cite.html"
title="next chapter">How to Cite <tt class="docutils literal"><span class="pre">musrfit</span></tt>?</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/index.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="cite.html" title="How to Cite musrfit?"
>next</a> |</li>
<li><a href="#">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<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.4 documentation</title>
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="any2many.html" title="any2many - a Universal μSR-file-format converter"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>msr2data - A Program for Automatically Processing Multiple musrfit msr Files</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="mupp.html">mupp - μSR Parameter Plotter</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="any2many.html">any2many - a Universal μSR-file-format converter</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="msr2data-a-program-for-automatically-processing-multiple-musrfit-msr-files">
<span id="msr2data"></span><span id="index-0"></span><h1>msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files<a class="headerlink" href="#msr2data-a-program-for-automatically-processing-multiple-musrfit-msr-files" title="Permalink to this headline"></a></h1>
<p><tt class="docutils literal"><span class="pre">msr2data</span></tt> (originally written by B. M. Wojek) is a program implemented in <tt class="docutils literal"><span class="pre">C++</span></tt>. Its purpose is
@ -369,77 +366,22 @@ fit serves as template for the second and so on. The template field stays empty
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a><ul>
<li><a class="reference internal" href="#basic-types-of-usage">Basic Types of Usage</a><ul>
<li><a class="reference internal" href="#run-list-file-structure">Run List File Structure</a></li>
</ul>
</li>
<li><a class="reference internal" href="#optional-parameters">Optional Parameters</a></li>
<li><a class="reference internal" href="#the-global-mode">The Global Mode</a><ul>
<li><a class="reference internal" href="#file-generation">File Generation</a></li>
<li><a class="reference internal" href="#parameter-extraction">Parameter Extraction</a></li>
<li><a class="reference internal" href="#the-extended-global-mode">The Extended Global Mode</a></li>
</ul>
</li>
<li><a class="reference internal" href="#known-limitations">Known Limitations</a></li>
<li><a class="reference internal" href="#the-graphical-user-interface-for-msr2data-provided-by-musredit">The Graphical User Interface for msr2data Provided by musredit</a></li>
</ul>
</li>
</ul>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="mupp.html">mupp - μSR Parameter Plotter</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="any2many.html">any2many - a Universal μSR-file-format converter</a>&#160;&#160;»
</p>
<h4>Previous topic</h4>
<p class="topless"><a href="mupp.html"
title="previous chapter">mupp - μSR Parameter Plotter</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="any2many.html"
title="next chapter">any2many - a Universal μSR-file-format converter</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/msr2data.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="any2many.html" title="any2many - a Universal μSR-file-format converter"
>next</a> |</li>
<li class="right" >
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.6.4 documentation</title>
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="msr2data.html" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>mupp - μSR Parameter Plotter</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="musredit.html"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="mupp-mgrsr-parameter-plotter">
<span id="mupp"></span><span id="index-0"></span><h1>mupp - μSR Parameter Plotter<a class="headerlink" href="#mupp-mgrsr-parameter-plotter" title="Permalink to this headline"></a></h1>
<p><tt class="docutils literal"><span class="pre">mupp</span></tt> is a little helper program which allows to quickly plot a collection of msr-file parameters,
@ -266,70 +263,22 @@ SCRIPT COMMANDS:
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">mupp - μSR Parameter Plotter</a><ul>
<li><a class="reference internal" href="#the-graphical-user-interface">The Graphical User Interface</a><ul>
<li><a class="reference internal" href="#define-variable-dialog">Define Variable Dialog</a></li>
</ul>
</li>
<li><a class="reference internal" href="#the-scripting-interface">The Scripting Interface</a></li>
<li><a class="reference internal" href="#the-usage-summary">The Usage Summary</a></li>
</ul>
</li>
</ul>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="musredit.html"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a>&#160;&#160;»
</p>
<h4>Previous topic</h4>
<p class="topless"><a href="musredit.html"
title="previous chapter"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a></p>
<h4>Next topic</h4>
<p class="topless"><a href="msr2data.html"
title="next chapter">msr2data - A Program for Automatically Processing Multiple <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr Files</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/mupp.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="msr2data.html" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files"
>next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<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.4 documentation</title>
<title>MusrRoot - an Extensible Open File Format for μSR &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="acknowledgement.html" title="Acknowledgements"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>MusrRoot - an Extensible Open File Format for μSR</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="any2many.html">any2many - a Universal μSR-file-format converter</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="acknowledgement.html">Acknowledgements</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="musrroot-an-extensible-open-file-format-for-mgrsr">
<span id="musrroot"></span><span id="index-0"></span><h1>MusrRoot - an Extensible Open File Format for μSR<a class="headerlink" href="#musrroot-an-extensible-open-file-format-for-mgrsr" title="Permalink to this headline"></a></h1>
<p>Until 2011 different μSR file formats were used within PSI. The bulk-μSR instruments were
@ -847,88 +844,22 @@ the entry has been added. The last token, <tt class="docutils literal"><span cla
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">MusrRoot - an Extensible Open File Format for μSR</a><ul>
<li><a class="reference internal" href="#some-basics-concerning-root-files">Some Basics Concerning ROOT Files</a></li>
<li><a class="reference internal" href="#id1">MusrRoot an Extensible Open File Format for μSR</a><ul>
<li><a class="reference internal" href="#run-information-contained-in-runheader">Run Information Contained in <tt class="docutils literal"><span class="pre">RunHeader</span></tt></a><ul>
<li><a class="reference internal" href="#runinfo-overview"><tt class="docutils literal"><span class="pre">RunInfo</span></tt> Overview</a></li>
</ul>
</li>
</ul>
</li>
<li><a class="reference internal" href="#tmusrrunheader-concept">TMusrRunHeader Concept</a><ul>
<li><a class="reference internal" href="#user-interface-for-musrroot-run-header">User Interface for MusrRoot Run Header</a><ul>
<li><a class="reference internal" href="#writing-a-musrroot-run-header">Writing a MusrRoot Run Header</a></li>
<li><a class="reference internal" href="#reading-a-musrroot-run-header">Reading a MusrRoot Run Header</a></li>
</ul>
</li>
<li><a class="reference internal" href="#validation-of-a-musrroot-file">Validation of a MusrRoot File</a></li>
</ul>
</li>
<li><a class="reference internal" href="#runinfo-required">RunInfo (Required)</a></li>
<li><a class="reference internal" href="#detectorinfo-required">DetectorInfo (Required)</a></li>
<li><a class="reference internal" href="#sampleenvironmentinfo-required">SampleEnvironmentInfo (Required)</a></li>
<li><a class="reference internal" href="#magneticfieldenvironmentinfo-required">MagneticFieldEnvironmentInfo (Required)</a></li>
<li><a class="reference internal" href="#beamlineinfo-required">BeamlineInfo (Required)</a></li>
<li><a class="reference internal" href="#exhaustive-musrroot-tree-including-everything-required">Exhaustive MusrRoot Tree Including Everything Required</a></li>
<li><a class="reference internal" href="#tmusrrunphysicalquantity-possible-representations">TMusrRunPhysicalQuantity - Possible Representations</a></li>
</ul>
</li>
</ul>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="any2many.html">any2many - a Universal μSR-file-format converter</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="acknowledgement.html">Acknowledgements</a>&#160;&#160;»
</p>
<h4>Previous topic</h4>
<p class="topless"><a href="any2many.html"
title="previous chapter">any2many - a Universal μSR-file-format converter</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="acknowledgement.html"
title="next chapter">Acknowledgements</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/musr-root.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="acknowledgement.html" title="Acknowledgements"
>next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>musredit: the GUI Based Interface to musrfit &mdash; musrfit 1.6.4 documentation</title>
<title>musredit: the GUI Based Interface to musrfit &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,39 +24,36 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>musredit: the GUI Based Interface to musrfit</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="setup-dks.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="mupp.html">mupp - μSR Parameter Plotter</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="musredit-the-gui-based-interface-to-musrfit">
<span id="musredit-sec"></span><span id="index-0"></span><h1><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt><a class="headerlink" href="#musredit-the-gui-based-interface-to-musrfit" title="Permalink to this headline"></a></h1>
<div class="section" id="introduction">
<h2>Introduction<a class="headerlink" href="#introduction" title="Permalink to this headline"></a></h2>
<p><tt class="docutils literal"><span class="pre">musredit</span></tt> is an editor which also provide a graphical user interface to the programs contained in the <tt class="docutils literal"><span class="pre">musrfit</span></tt> suite and are intended
to help the user handle <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr files. It is implemented in <tt class="docutils literal"><span class="pre">C++</span></tt> and use the <a class="reference external" href="https://qt.io">Qt</a> framework. <tt class="docutils literal"><span class="pre">musredit</span></tt> is based on Qt 4.6 or Qt 5.6 (or above).
The Qt 5.6 version of <tt class="docutils literal"><span class="pre">musredit</span></tt> will be actively developed, whereas the Qt 4.x version will only get bug fixing and eventually will be dropped.
to help the user handle <tt class="docutils literal"><span class="pre">musrfit</span></tt> msr files. It is implemented in <tt class="docutils literal"><span class="pre">C++</span></tt> and use the <a class="reference external" href="https://qt.io">Qt</a> framework. <tt class="docutils literal"><span class="pre">musredit</span></tt> is based on Qt 4.6, Qt 5.6 (or above), or Qt6.x.
The Qt 5.6 and Qt 6.x version of <tt class="docutils literal"><span class="pre">musredit</span></tt> will be actively developed, whereas the Qt 4.x version will only get bug fixing and eventually will be dropped.
On this documentation page only the features related to <tt class="docutils literal"><span class="pre">musrfit</span></tt> are described — the basic editor functions which should be self-explanatory are <em>not</em>.
<tt class="docutils literal"><span class="pre">musrgui</span></tt> is an outdated early version of <tt class="docutils literal"><span class="pre">musredit</span></tt> and will not described anymore. If still in use, the user is urged to switch to <tt class="docutils literal"><span class="pre">musredit</span></tt>.</p>
<div class="admonition note">
@ -480,82 +477,22 @@ the corresponding fit parameter value, except the phases where the step will be
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a><ul>
<li><a class="reference internal" href="#introduction">Introduction</a></li>
<li><a class="reference internal" href="#available-executable-configuration-files-and-their-basic-usage">Available Executable, Configuration Files and their Basic Usage</a><ul>
<li><a class="reference internal" href="#musredit-musrgui">musredit (musrgui)</a></li>
<li><a class="reference internal" href="#musredit-startup-xml">musredit_startup.xml</a></li>
</ul>
</li>
<li><a class="reference internal" href="#musredit-features">musredit Features</a></li>
<li><a class="reference internal" href="#id1">musrWiz</a><ul>
<li><a class="reference internal" href="#musrwiz-introduction">musrWiz-Introduction</a></li>
<li><a class="reference internal" href="#musrwiz-theory">musrWiz - Theory</a></li>
<li><a class="reference internal" href="#musrwiz-functions">musrWiz - Functions</a></li>
<li><a class="reference internal" href="#musrwiz-maps">musrWiz - Maps</a></li>
<li><a class="reference internal" href="#musrwiz-fit-parameters">musrWiz - Fit Parameters</a></li>
<li><a class="reference internal" href="#musrwiz-fit-info">musrWiz - Fit Info</a></li>
<li><a class="reference internal" href="#musrwiz-create">musrWiz - Create</a></li>
</ul>
</li>
<li><a class="reference internal" href="#musrstep">musrStep</a></li>
</ul>
</li>
</ul>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="setup-dks.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="mupp.html">mupp - μSR Parameter Plotter</a>&#160;&#160;»
</p>
<h4>Previous topic</h4>
<p class="topless"><a href="setup-dks.html"
title="previous chapter">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="mupp.html"
title="next chapter">mupp - μSR Parameter Plotter</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/musredit.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="mupp.html" title="mupp - μSR Parameter Plotter"
>next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

Binary file not shown.

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Search &mdash; musrfit 1.6.4 documentation</title>
<title>Search &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 documentation" href="index.html" />
<script type="text/javascript">
jQuery(function() { Search.loadIndex("searchindex.js"); });
</script>
@ -35,21 +35,20 @@
</head>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Search</span></h2>
</div>
<div class="topnav">
<p>
<a class="uplink" href="index.html">Contents</a>
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<h1 id="search-documentation">Search</h1>
<div id="fallback" class="admonition warning">
<script type="text/javascript">$('#fallback').hide();</script>
@ -74,27 +73,18 @@
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
</div>
<div class="bottomnav">
<p>
<a class="uplink" href="index.html">Contents</a>
</p>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
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,15 +6,15 @@
<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.4 documentation</title>
<title>Setting up musrfit / DKS: High Speed Fitting with GPUs &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="musredit.html" title="musredit: the GUI Based Interface to musrfit"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Setting up musrfit / DKS: High Speed Fitting with GPUs</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="setup-standard.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="musredit.html"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="setting-up-musrfit-dks-high-speed-fitting-with-gpu-s">
<span id="setup-dks"></span><span id="index-0"></span><h1>Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s<a class="headerlink" href="#setting-up-musrfit-dks-high-speed-fitting-with-gpu-s" title="Permalink to this headline"></a></h1>
<p>In the years 2016/2017 we explored ways to speed up current fitting frameworks, especially <tt class="docutils literal"><span class="pre">musrfit.</span></tt>
@ -255,78 +252,22 @@ The only thing you need <tt class="docutils literal"><span class="pre">DKS</span
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s</a><ul>
<li><a class="reference internal" href="#setting-up-musrfit-dks-for-a-tesla-k40c-nvidia">Setting up <tt class="docutils literal"><span class="pre">musrfit/DKS</span></tt> for a Tesla K40c (NVIDIA)</a><ul>
<li><a class="reference internal" href="#driver-installation-for-the-tesla-k40c">Driver Installation for the Tesla K40c</a></li>
<li><a class="reference internal" href="#installation-of-cuda">Installation of CUDA</a></li>
<li><a class="reference internal" href="#installation-of-dks">Installation of DKS</a></li>
<li><a class="reference internal" href="#installation-of-musrfit-for-dks">Installation of musrfit for DKS</a></li>
</ul>
</li>
<li><a class="reference internal" href="#setting-up-musrfit-dks-for-a-amd-graphic-card-radeon-r9-390x">Setting up <tt class="docutils literal"><span class="pre">musrfit/DKS</span></tt> for a AMD Graphic Card (Radeon R9 390X)</a><ul>
<li><a class="reference internal" href="#driver-installation-for-an-amd-graphic-card-e-g-radeon-r9-390x">Driver Installation for an AMD Graphic Card, <em>e.g.</em> Radeon R9 390X</a></li>
<li><a class="reference internal" href="#amd-app-software-development-kit-sdk-to-enable-opencl-support">AMD APP Software Development Kit (SDK) to enable <tt class="docutils literal"><span class="pre">OpenCL</span></tt> support</a></li>
<li><a class="reference internal" href="#installation-of-dks-and-musrfit">Installation of DKS and musrfit</a></li>
</ul>
</li>
<li><a class="reference internal" href="#setting-up-musrfit-dks-for-macos-for-opencl-support">Setting up <tt class="docutils literal"><span class="pre">musrfit/DKS</span></tt> for macOS for OpenCL support</a></li>
</ul>
</li>
</ul>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="setup-standard.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="musredit.html"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a>&#160;&#160;»
</p>
<h4>Previous topic</h4>
<p class="topless"><a href="setup-standard.html"
title="previous chapter">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="musredit.html"
title="next chapter"><tt class="docutils literal"><span class="pre">musredit</span></tt>: the GUI Based Interface to <tt class="docutils literal"><span class="pre">musrfit</span></tt></a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/setup-dks.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="musredit.html" title="musredit: the GUI Based Interface to musrfit"
>next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.6.4 documentation</title>
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPUs"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Setting up musrfit on Different Platforms</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="user-libs.html">Documentation of user libs (user functions)</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="setup-dks.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="setting-up-musrfit-on-different-platforms">
<span id="musrfit-setup"></span><span id="index-0"></span><h1>Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms<a class="headerlink" href="#setting-up-musrfit-on-different-platforms" title="Permalink to this headline"></a></h1>
<div class="section" id="supported-operating-systems-and-software-requirements">
@ -106,7 +103,7 @@ Currently the <tt class="docutils literal"><span class="pre">MXML</span></tt> su
<p>If <em>optionally</em> the editor and graphical user interface <tt class="docutils literal"><span class="pre">musrgui</span></tt> / <tt class="docutils literal"><span class="pre">musredit</span></tt> is going to be installed there is one further requirement:</p>
<dl class="docutils" id="index-11">
<dt><strong>Qt</strong></dt>
<dd>A cross-platform application and user interface framework. <em>Required version ≥ 4.6</em> (musredit) (see <a class="reference external" href="http://qt.io/">Qt</a>).</dd>
<dd>A cross-platform application and user interface framework. <em>Required version ≥ 4.6</em> (musredit) (see <a class="reference external" href="http://qt.io/">Qt</a>). Currently the <strong>Qt5</strong> is the main development part. Qt6 just kicked in, but is not widely available yet.</dd>
</dl>
<p>Each of the following sections focusing on the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt> on the different operating systems will also give a brief introduction on the installation of the requirements before the actual musrfit installation is described.</p>
</div>
@ -117,15 +114,14 @@ Currently the <tt class="docutils literal"><span class="pre">MXML</span></tt> su
<dt><strong>GNU/Linux</strong></dt>
<dd>No serious problems are currently known. Tested distributions: <a class="reference external" href="https://www.redhat.com/de/technologies/linux-platforms/enterprise-linux">RHEL</a>, <a class="reference external" href="https://getfedora.org/">Fedora</a>,
<a class="reference external" href="https://www.debian.org/">Debian</a>, <a class="reference external" href="https://www.ubuntu.com/">Ubuntu</a>, <a class="reference external" href="https://linuxmint.com/">Mint</a>, <a class="reference external" href="https://en.opensuse.org/Main_Page">openSUSE</a>,
<a class="reference external" href="https://de.manjaro.org/">manjaro</a>, and <a class="reference external" href="https://antergos.com/">antergos</a>.</dd>
and <cite>manjaro &lt;https://de.manjaro.org/&gt;</cite>.</dd>
<dt><strong>Mac OS X/macOS</strong></dt>
<dd>No serious problems are currently known for macOS ≥ 10.6.</dd>
<dd>No serious problems are currently known for macOS ≥ 10.6. <tt class="docutils literal"><span class="pre">musrfit</span></tt> is ARM M1 ready.</dd>
<dt><strong>MS Windows</strong></dt>
<dd><p class="first">Native <em>MS Windows</em> support is currently not available. Potential ways to get <tt class="docutils literal"><span class="pre">musrfit</span></tt> running are:</p>
<ul class="last simple">
<li>via installation of Linux via the Microsoft App store for Windows 10.</li>
<li>via installation of Linux via the Microsoft App store for Windows 10/11 (see <a class="reference external" href="https://docs.microsoft.com/en-us/windows/wsl/install">Install Linux on Windows with WSL</a>).</li>
<li>via installation of the virtual machine on which you install Linux (probably the easiest for most Windows users).</li>
<li>via <a class="reference external" href="https://www.cygwin.com/">cygwin</a>.</li>
</ul>
</dd>
</dl>
@ -141,34 +137,35 @@ the distributor and could be easily installed in the form of binary packages. If
the libraries and the header (dev, devel) files.</p>
<p>On a <a class="reference external" href="https://www.redhat.com/en">Red Hat Linux</a> (or other RPM-package base Linux distributions) system the following command executed as <em>superuser</em>
from the shell will do the trick (never type the &#8216;$&#8217; it is the shell prompt of your system):</p>
<p>For <strong>Qt4</strong>:</p>
<p>For <strong>Qt4</strong> (deprecated):</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ yum install git cmake boost-devel gsl-devel fftw-devel libxml2-devel qt-devel qtwebkit-devel
</pre></div>
</div>
</div></blockquote>
<p>For <strong>Qt5</strong>:</p>
<p>For <strong>Qt5/Qt6</strong>:</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ yum install epel-release
$ yum install git cmake boost-devel gsl-devel fftw-devel libxml2-devel qt5-qtbase-devel qt5-qtsvg-devel qt5-qtwebkit-devel
$ yum install git cmake boost-devel gsl-devel fftw-devel libxml2-devel qt5-qtbase-devel qt5-qtsvg-devel
</pre></div>
</div>
</div></blockquote>
<p>Depending on your distribution <strong>Qt4</strong> is still the default but is likely to be replaced by <strong>Qt5</strong> in the very near future.</p>
<p>If using <tt class="docutils literal"><span class="pre">Qt6</span></tt> replace <tt class="docutils literal"><span class="pre">qt5-qtbase-devel</span> <span class="pre">qt5-qtsvg-devel</span></tt> by <tt class="docutils literal"><span class="pre">qt6-qtbase-devel</span> <span class="pre">qt6-qtsvg-devel</span></tt></p>
<p>When dealing with a distribution that uses the dpkg/apt package manager like <a class="reference external" href="https://www.debian.org/">Debian</a> or <a class="reference external" href="https://www.ubuntu.com/">Ubuntu</a>
the installation would look like:</p>
<p>For <strong>Qt4</strong>:</p>
<p>For <strong>Qt4</strong> (deprecated):</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libgsl-dev libfftw3-dev libxml2-dev libqt4-dev libqtwebkit-dev
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libboost-filesystem-dev libboost-system-dev libgsl-dev libfftw3-dev libxml2-dev libqt4-dev libqtwebkit-dev
</pre></div>
</div>
</div></blockquote>
<p>For <strong>Qt5</strong>:</p>
<p>For <strong>Qt5/Qt6</strong>:</p>
<blockquote>
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libgsl-dev libfftw3-dev libxml2-dev qt5-default qtbase5-dev libqt5svg5-dev libqt5webkit5-dev
<div><div class="highlight-bash"><div class="highlight"><pre><span></span>$ apt-get install git cmake libboost-dev libboost-filesystem-dev libboost-system-dev libgsl-dev libfftw3-dev libxml2-dev qt5-default qtbase5-dev libqt5svg5-dev
</pre></div>
</div>
</div></blockquote>
<p>If using <tt class="docutils literal"><span class="pre">Qt6</span></tt> replace <tt class="docutils literal"><span class="pre">qt5-default</span> <span class="pre">qtbase5-dev</span> <span class="pre">libqt5svg5-dev</span></tt> by <tt class="docutils literal"><span class="pre">qt6-default</span> <span class="pre">qtbase6-dev</span> <span class="pre">libqt6svg6-dev</span></tt></p>
<p>Everyone should know best himself which is the way to install distribution software on the chosen distribution.</p>
<p>In case the distribution does not include the required software it has to be compiled from the source files. This means either to download
the source code from the corresponding website, or to clone the git repo. If you need to follow this line, please check the install details of the corresponding package.</p>
@ -241,9 +238,9 @@ $ <span class="nb">cd</span> Apps
$ git clone http://github.com/root-project/root.git
$ <span class="nb">cd</span> root
$ git tag -l
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-16-00</span>
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-22-06</span>
$ <span class="c1"># or the latest official release number</span>
$ git checkout -b v6-16-00 v6-16-00
$ git checkout -b v6-22-06 v6-22-06
$ <span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$ <span class="c1"># since we are using cmake build now, first we will need to create the build directory.</span>
$ mkdir root_build
@ -339,7 +336,7 @@ switch is not provided is <tt class="docutils literal"><span class="pre">BMWlibs
<dd>Will try to get <tt class="docutils literal"><span class="pre">musredit</span></tt>, <tt class="docutils literal"><span class="pre">musrWiz</span></tt>, <tt class="docutils literal"><span class="pre">musrStep</span></tt>, and <tt class="docutils literal"><span class="pre">mupp</span></tt> installed, if <tt class="docutils literal"><span class="pre">Qt</span></tt> is found.
By default this is enabled. Again &lt;value&gt;=0 means disabled, &lt;value&gt;=1 enabled.</dd>
<dt><strong>-Dqt_version=&lt;value&gt;</strong></dt>
<dd>Allows to specify which <tt class="docutils literal"><span class="pre">Qt</span></tt> version shall be tried. &lt;value&gt; can take the values: <tt class="docutils literal"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5</span></tt>.
<dd>Allows to specify which <tt class="docutils literal"><span class="pre">Qt</span></tt> version shall be tried. &lt;value&gt; can take the values: <tt class="docutils literal"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5,</span> <span class="pre">6</span></tt>.
If the value is set to <tt class="docutils literal"><span class="pre">AUTO</span></tt>, this highest installed version is chosen, otherwise the specified version is used.</dd>
<dt><strong>-Dtry_OpenMP=&lt;value&gt;</strong></dt>
<dd>Will check if <tt class="docutils literal"><span class="pre">OpenMP</span></tt> support is possible, and if yes use it. The default is enabled</dd>
@ -380,23 +377,10 @@ detailed information on this XML file refer to the <a class="reference internal"
<div class="section" id="musredit">
<span id="index-20"></span><h3>musredit<a class="headerlink" href="#musredit" title="Permalink to this headline"></a></h3>
<p>In the latest version of <tt class="docutils literal"><span class="pre">musrfit</span></tt> the configure script tries to determine automatically the highest available <tt class="docutils literal"><span class="pre">Qt</span></tt> version.
In case this is found, the editor <tt class="docutils literal"><span class="pre">musredit</span></tt> is built already together with <tt class="docutils literal"><span class="pre">musrfit</span></tt>.
To install this editor separately, <em>i.e.</em> by &#8220;hand&#8221; do</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit/src/musredit_qt5
$ <span class="c1"># for some distributions you will need qmake-qt5 for the next command</span>
$ qmake musredit.pro
</pre></div>
In case this is found, the editor <tt class="docutils literal"><span class="pre">musredit</span></tt> is built already together with <tt class="docutils literal"><span class="pre">musrfit</span></tt>.</p>
</div>
<p>If everything went fine, <tt class="docutils literal"><span class="pre">musredit</span></tt> can be compiled and installed:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ make
$ make install
</pre></div>
</div>
<p>In case one does not like the executable <tt class="docutils literal"><span class="pre">musredit</span></tt> to be copied to the default installation directory <tt class="docutils literal"><span class="pre">$ROOTSYS/bin</span></tt>
the last <em>make install</em> can be skipped and the executable can be copied somewhere else instead.</p>
</div>
<div class="section" id="musrgui-obsolate">
<h3>musrgui (obsolate)<a class="headerlink" href="#musrgui-obsolate" title="Permalink to this headline"></a></h3>
<div class="section" id="musrgui-deprecated">
<h3>musrgui (deprecated)<a class="headerlink" href="#musrgui-deprecated" title="Permalink to this headline"></a></h3>
<p>If <tt class="docutils literal"><span class="pre">Qt4.6</span></tt> or higher is not available but <tt class="docutils literal"><span class="pre">Qt3</span></tt> is set up <tt class="docutils literal"><span class="pre">musrgui</span></tt> can be installed. For this please
follow the instructions for the <tt class="docutils literal"><span class="pre">musredit</span></tt> installation where simply every <tt class="docutils literal"><span class="pre">musredit</span></tt> occurrence has to
be replaced by <tt class="docutils literal"><span class="pre">musrgui</span></tt>. If there are problems during the <tt class="docutils literal"><span class="pre">qmake</span></tt> step, <em>e.g.</em>
@ -420,14 +404,14 @@ $ musrview test-histo-ROOT-NPP.msr
<h2>MS Windows<a class="headerlink" href="#ms-windows" title="Permalink to this headline"></a></h2>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">The description here is only for the very brave ones. It hasn&#8217;t been tested for quite a while and therefore gives you
rather a flavour of what needs to be done rather than a real instruction how to setup <tt class="docutils literal"><span class="pre">musrfit</span></tt>. If you just need
<tt class="docutils literal"><span class="pre">musrfit</span></tt> to work on a MS Windows platform, it is recommended to install it via a linux virtual machine!</p>
<p class="last">For adventurous guys using Windows 10/11, there is the possibility to activate the built in Ubuntu bash-shell. It allows
to install <tt class="docutils literal"><span class="pre">musrfit</span></tt> as described in the Linux section. For details to setup the Linux sub-system for MS Windows
see <a class="reference external" href="https://docs.microsoft.com/en-us/windows/wsl/install">Install Linux on Windows with WSL</a>.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">For adventurous guys using Windows 10, there is the possibility to activate the built in Ubuntu bash-shell. It allows
to install <tt class="docutils literal"><span class="pre">musrfit</span></tt> as described in the Linux section.</p>
<p class="last">Another possibility is to setup linux as a virtual machine with VirtualBox are other alike tools. This way you separate
Linux / ROOT / musrfit from the default MS Windows system.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
@ -435,257 +419,16 @@ to install <tt class="docutils literal"><span class="pre">musrfit</span></tt> as
in the absolute path or in case you do, do not wonder if some errors occur! msr files, however, might be saved in such
directories like <tt class="docutils literal"><span class="pre">...\My</span> <span class="pre">Documents\...</span></tt></p>
</div>
<p>Under Windows a native installation is not supported but there is the possibility to run musrfit through <a class="reference external" href="https://www.cygwin.com/">cygwin</a>
which has the great advantage that one gains additionally various nice UNIX tools also for other purposes.
Please also be aware of the fact that the X server which is going to be installed with <tt class="docutils literal"><span class="pre">Cygwin</span></tt> has to be started
(<em>e.g.</em> by selecting it from the &#8220;Programs&#8221; folder) before any graphical application (<tt class="docutils literal"><span class="pre">musrview</span></tt>, <tt class="docutils literal"><span class="pre">musrgui</span></tt>, etc.) is started.</p>
<div class="section" id="id5">
<h3>Requirements<a class="headerlink" href="#id5" title="Permalink to this headline"></a></h3>
<div class="section" id="setting-up-cygwin">
<span id="index-21"></span><h4>Setting up Cygwin<a class="headerlink" href="#setting-up-cygwin" title="Permalink to this headline"></a></h4>
<p>For the start go to the Cygwin website, download the setup file and use it to install Cygwin 1.7 or newer. During the installation
process you will be asked where you want to install Cygwin and normally the default choice should just be fine. At some point you
will be asked which packages should be installed. Make sure that you choose at least the following (or packages with revisions close
to the following) in order to fulfill the <tt class="docutils literal"><span class="pre">musrfit</span></tt> requirements and be able to work with this base system:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>a2ps, alternatives, autoconf, automake, base-cygwin, base-files, base-passwd bash, bash-completion,
bc, binutils, bison, boost, boost-devel, bzip2, cmake, colorgcc, coreutils, curl, cygutils, cygwin,
editrights, fftw3, findutils, flex, font-adobe-dpi100, font-adobe-dpi75, font-alias,
font-bitstream-dpi100, font-bitstream-dpi75, font-encodings, font-ibm-type1, font-sun-misc, font-util,
font-xfree86-type1, fontconfig, freeglut, gawk, gcc-tools-autoconf, gcc-tools-automake, gcc4,
gcc4-core, gcc4-fortran, gcc4-g++, gccmakedep, gd, gettext, ghostscript, ghostscript-fonts-std,
giflib, gmp, grep, groff, gsl, gsl-apps, gsl-devel, gv, gzip, inputproto, jasper, jpeg, lapack,
less, libboost, libbz2_1, libcharset1, libcurl4, libfftw3-devel, libfftw3_3, libgcc1, libgd-devel,
libgif-devel, libGL-devel, libGL1, libGLU-devel, libGLU1, libglut-devel, libglut3, libgmp-devel,
libgmp3, libgomp1, libICE-devel, libICE6, libjpeg-devel, libjpeg62, liblapack-devel, libmpfr-devel,
libmpfr1, libncurses-devel, libncurses9, libOSMesa-devel, libOSMesa7, libpng, libpng14, libpng14-devel,
libreadline6, libSM-devel, libSM6, libssh2_1, libstdc++6, libstdc++6-devel, libtiff-devel, libtiff5,
libtool, libX11-devel, libX11_6, libXau-devel, libXau6, libXaw7, libxcb-devel, libxcb-xlib-devel,
libXcursor-devel, libXcursor1, libXdmcp-devel, libXdmcp6, libXext-devel, libXext6, libXfixes-devel,
libXfixes3, libXfont-devel, libXfont1, libXft-devel, libXft2, libXi-devel, libXi6, libxkbfile1,
libxml2, libxml2-devel, libXmu-devel, libXmu6, libXpm-devel, libXpm4, libXrender-devel, libXrender1,
libXt-devel, libXt6, login, m4, make, makedepend, man, mpfr, nano, opengl, openssh, openssl, pdftk,
perl, ping, pkg-config, psutils, python, qt3, qt3-bin, qt3-devel, readline, rebase, rgb, rsync, run,
screen, sed, subversion, tar, tcltk, terminfo, unzip, util-linux, vim, w32api, which,
X-start-menu-icons, xauth, xextproto, xfontsel, xinit, xkbcomp, xkeyboard-config, xkill, xlogo,
xlsfonts, xorg-cf-files, xorg-scripts, xorg-server, xproto, xrdb, xrefresh, xset, xterm, zip, zlib,
zlib-devel, zlib0, libQt3Support4-devel, libQtAssistantClient4-devel, libQtCore4-devel,
libQtDBus4-devel, libQtDesigner4-devel, libQtGui4-devel, libQtHelp4-devel, libQtNetwork4-devel,
libQtOpenGL4-devel, libQtScript4-devel, libQtScriptTools4-devel, libQtSql4-devel, libQtSvg4-devel,
libQtTest4-devel, libQtWebKit4-devel, libQtXml4-devel, libQtXmlPatterns4-devel
</pre></div>
</div>
<p>After these installations already most of the required software is present and the Cygwin shell can be started now for the further steps!
Inside the shell the POSIX naming convention applies, therefore, paths will be given with separating &#8220;/&#8221; instead of &#8220;&#8221; in DOS. The file
structure accessible through this shell can also be accessed through the Windows Explorer — just go to the directory which you specified
as &#8220;cygwin root&#8221; during the installation: this is the equivalent to &#8220;/&#8221; in the shell. By default, the different hard drives or network shares
like <tt class="docutils literal"><span class="pre">C:\</span></tt> can be found at <tt class="docutils literal"><span class="pre">/cygdrive/c/</span></tt> in the shell — the cygdrive prefix can in principle also be changed but for now we stick to the default.</p>
<p>Since later on the boost header files should be used and in the standard Cygwin installation these are found at a version specific location,
the later handling will be easier if a symbolic link to these files is created now in the terminal (in case it had not been present before):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ ln -sf /usr/include/boost-x_yy_z/boost /usr/include/boost
</pre></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">x_yy_z</span></tt> has to be substituted by the correct version number, <em>e.g.</em> <tt class="docutils literal"><span class="pre">1_33_1</span></tt>.</p>
</div>
<div class="section" id="id6">
<h4>Everything but ROOT and NeXus<a class="headerlink" href="#id6" title="Permalink to this headline"></a></h4>
</div>
<div class="section" id="index-22">
<span id="id7"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-22" title="Permalink to this headline"></a></h4>
<p>Only if <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support reading data files in the <tt class="docutils literal"><span class="pre">NeXus</span></tt> format the further required software has
to be set up. Under <tt class="docutils literal"><span class="pre">Cygwin</span></tt> of all the required libraries only <tt class="docutils literal"><span class="pre">HDF5</span></tt> is available. The packages <tt class="docutils literal"><span class="pre">hdf5</span></tt> and
<tt class="docutils literal"><span class="pre">libhdf5-devel</span></tt> can be installed through the <tt class="docutils literal"><span class="pre">Cygwin</span></tt> setup. One should also make sure that <tt class="docutils literal"><span class="pre">bison</span></tt>, <tt class="docutils literal"><span class="pre">flex</span></tt>
and a package containing <tt class="docutils literal"><span class="pre">/usr/lib/librpc.a</span></tt> (<em>e.g.</em> <tt class="docutils literal"><span class="pre">sunrpc</span> <span class="pre">=</span> <span class="pre">4.0-3</span></tt>, but <em>not</em> <tt class="docutils literal"><span class="pre">sunrpc</span> <span class="pre">=</span> <span class="pre">4.0-4</span></tt>) are installed.</p>
<p><strong>Only NeXus Version ≥ 4.4 is support!</strong></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span>
$ mkdir nexus
$ <span class="nb">cd</span> nexus
$ curl http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz -G <span class="p">|</span> tar xz
$ <span class="nb">cd</span> jpeg-6b
$ ./configure --prefix<span class="o">=</span>/usr/local --enable-static
$ make
$ make install
$ <span class="nb">cd</span> ..
$ <span class="c1"># create a directory for the NeXus source code</span>
$ mkdir nexus
$ <span class="nb">cd</span> nexus
$ <span class="c1"># get the source code from the master repository</span>
$ git clone https://github.com/nexusformat/code.git
$ <span class="c1"># next we will build NeXus out-of-source</span>
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake -DENABLE_HDF5<span class="o">=</span><span class="m">1</span> -DENABLE_HDF4<span class="o">=</span><span class="m">1</span> -DENABLE_MXML<span class="o">=</span><span class="m">0</span> ../code
$ make
$ make install
</pre></div>
</div>
</div>
<div class="section" id="index-23">
<span id="id8"></span><h4>ROOT<a class="headerlink" href="#index-23" title="Permalink to this headline"></a></h4>
<p>In order to install the <tt class="docutils literal"><span class="pre">ROOT</span></tt> system, there are two possibilities:</p>
<ul>
<li><p class="first">Download the precompiled Cygwin GCC 4.3 (or newer) package of the most recent <tt class="docutils literal"><span class="pre">ROOT</span></tt> version
from the <a class="reference external" href="https://root.cern.ch/downloading-root">web page</a> and unpack it in a <tt class="docutils literal"><span class="pre">Cygwin</span></tt> shell
(in order to get the line endings correctly) at the final location. Suppose the package has been
downloaded to <tt class="docutils literal"><span class="pre">C:\</span></tt> and the <tt class="docutils literal"><span class="pre">ROOT</span></tt> tree should be in <tt class="docutils literal"><span class="pre">C:\root</span></tt>, this is achieved by:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /cygdrive/c
$ tar xzf root_v5.xx.yy.win32gcc-gcc-4.3.tar.gz
</pre></div>
</div>
</li>
<li><p class="first">If due to some reason there was no precompiled Cygwin GCC 4.3 package available or <tt class="docutils literal"><span class="pre">ROOT</span></tt> should
be built from source, one has to visit the <a class="reference external" href="https://root.cern.ch/downloading-root">web page</a>,
download the &#8216;complete source tree for all systems&#8217; and save it for instance in <tt class="docutils literal"><span class="pre">C:\</span></tt>.
Then go to the Cygwin shell and unpack this source tree, configure it (here using the minimal set of options)
and compile it as follows right below:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /cygdrive/c
$ tar xzf root_v5.xx.yy.source.tar.gz
$ <span class="nb">cd</span> root
$ ./configure win32gcc --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
$ make
</pre></div>
</div>
</li>
<li><p class="first">In order to finalize the <tt class="docutils literal"><span class="pre">ROOT</span></tt> installation and to prepare already the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt> and
<tt class="docutils literal"><span class="pre">musredit</span></tt> this is a good time for setting necessary environment variables for the use in Cygwin. For
accomplishing that put the following lines at the end of the <tt class="docutils literal"><span class="pre">/home/Username/.bashrc</span></tt> (<tt class="docutils literal"><span class="pre">C:\cygwin\home\Username\.bashrc</span></tt>
for the user <tt class="docutils literal"><span class="pre">Username</span></tt> and the <tt class="docutils literal"><span class="pre">cygwin</span> <span class="pre">root</span></tt> at <tt class="docutils literal"><span class="pre">C:\cygwin</span></tt>):</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">DISPLAY</span><span class="o">=</span>:0.0
<span class="nb">export</span> <span class="nv">QTDIR</span><span class="o">=</span>/usr/lib/qt4
<span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span>/cygdrive/c/root
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin:<span class="nv">$QTDIR</span>/bin:/usr/i686-pc-cygwin/bin:<span class="nv">$PATH</span>
<span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
</pre></div>
</div>
</li>
</ul>
<p>Afterwards close the Cygwin shell and reopen it again for the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt>.</p>
</div>
</div>
<div class="section" id="index-24">
<span id="id9"></span><h3>musrfit<a class="headerlink" href="#index-24" title="Permalink to this headline"></a></h3>
<p>First, the most recent source code should be downloaded. The preferred way of doing so is to clone the <tt class="docutils literal"><span class="pre">musrfit</span></tt>
repository via git. Assuming the code should be located in <tt class="docutils literal"><span class="pre">~/musrfit</span></tt> this is achieved most easily calling from the terminal</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span>
$ git clone https://bitbucket.org/muonspin/musrfit.git
</pre></div>
</div>
<p>or</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span>
$ git clone git://gitlab.psi.ch/nemu/musrfit.git
</pre></div>
</div>
<p>If the repository had been checked out already before, one can update the local copy using:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> musrfit
$ git pull
</pre></div>
</div>
<p>As an alternative (if git is not available), the source code can also be downloaded from the following
web-page: <a class="reference external" href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a>.</p>
<div class="section" id="index-25">
<span id="id10"></span><h4>musrfit build with cmake<a class="headerlink" href="#index-25" title="Permalink to this headline"></a></h4>
<p>Currently the following configuration switches for <tt class="docutils literal"><span class="pre">musrfit</span></tt> are available:</p>
<dl class="docutils">
<dt><strong>-DCMAKE_INSTALL_PREFIX=&lt;prefix-path&gt;</strong></dt>
<dd>Specify the installation prefix, <em>i.e.</em> the place where <tt class="docutils literal"><span class="pre">musrfit</span></tt> shall be installed, <em>e.g.</em> <tt class="docutils literal"><span class="pre">$ROOTSYS</span></tt> if already defined (by default: <tt class="docutils literal"><span class="pre">/usr/local</span></tt>)</dd>
<dt><strong>-Dnexus=&lt;value&gt;</strong></dt>
<dd>enable/disable the support of <tt class="docutils literal"><span class="pre">NeXus</span></tt> data files (requires the <tt class="docutils literal"><span class="pre">HDF4</span></tt>, <tt class="docutils literal"><span class="pre">HDF5</span></tt> and <tt class="docutils literal"><span class="pre">NeXus</span></tt> libraries to be installed).
&lt;value&gt;=1 enables <tt class="docutils literal"><span class="pre">NeXus</span></tt>, &lt;value&gt;=0 disables <tt class="docutils literal"><span class="pre">NeXus</span></tt>. The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">NeXus</span></tt> support is disabled.</dd>
<dt><strong>-DASlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">ASlibs</span></tt>.
The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">ASlibs</span></tt> support is <em>disabled</em>. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><em>user libs</em></a>.</dd>
<dt><strong>-DBMWlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">BMWlibs</span></tt>.
The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">BMWlibs</span></tt> support is <em>disabled</em>. For details see Documentation of <a class="reference internal" href="user-libs.html#user-libs"><em>user libs</em></a>.</dd>
<dt><strong>-DBNMRlibs=&lt;value&gt;</strong></dt>
<dd>enable/disable the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>. &lt;value&gt;=1 enables the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>, &lt;value&gt;=0 disables the <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt>.
The default setting, <em>i.e.</em> the switch is not provided is <tt class="docutils literal"><span class="pre">BNMRlibs</span></tt> support is <em>disabled</em>.</dd>
<dt><strong>-Dqt_based_tools=&lt;value&gt;</strong></dt>
<dd>Will try to get <tt class="docutils literal"><span class="pre">musredit</span></tt>, <tt class="docutils literal"><span class="pre">musrWiz</span></tt>, <tt class="docutils literal"><span class="pre">musrStep</span></tt>, and <tt class="docutils literal"><span class="pre">mupp</span></tt> installed, if <tt class="docutils literal"><span class="pre">Qt</span></tt> is found.
By default this is <em>enabled</em>. Again &lt;value&gt;=0 means disabled, &lt;value&gt;=1 enabled.</dd>
<dt><strong>-Dqt_version=&lt;value&gt;</strong></dt>
<dd>Allows to specify which <tt class="docutils literal"><span class="pre">Qt</span></tt> version shall be tried. &lt;value&gt; can take the values: <tt class="docutils literal"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5</span></tt>.
If the value is set to <tt class="docutils literal"><span class="pre">AUTO</span></tt>, this highest installed version is chosen, otherwise the specified version is used.</dd>
<dt><strong>-Dtry_OpenMP=&lt;value&gt;</strong></dt>
<dd>Will check if <tt class="docutils literal"><span class="pre">OpenMP</span></tt> support is possible, and if yes use it. The default is <em>enabled</em>.</dd>
</dl>
<p>Normally it should not be necessary to make use of any of the options except for specifying the installation path with
<tt class="docutils literal"><span class="pre">-DCMAKE_INSTALL_PREFIX</span></tt>. <tt class="docutils literal"><span class="pre">musrfit</span></tt> build with <tt class="docutils literal"><span class="pre">cmake</span></tt> takes the out-of-source approach. Therefore a typical
configuration / make / install process including <tt class="docutils literal"><span class="pre">NeXus</span></tt> support would look like</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> <span class="nv">$HOME</span>/Apps/musrfit
$ mkdir build
$ <span class="nb">cd</span> build
$ cmake ../ -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$ROOTSYS</span> -Dnexus<span class="o">=</span><span class="m">1</span>
<span class="c1"># below it is assumed that multiple cores are present, hence the -j8 option</span>
$ cmake --build ./ --clean-first -- -j8
$ make install
$ /sbin/ldconfig <span class="c1"># (as superuser)</span>
</pre></div>
</div>
</div>
</div>
<div class="section" id="index-26">
<span id="id11"></span><h3>musredit<a class="headerlink" href="#index-26" title="Permalink to this headline"></a></h3>
<p>In the latest version of <tt class="docutils literal"><span class="pre">musrfit</span></tt> the configure script tries to determine automatically if
Qt4.5 or higher is set up on the machine. In case this is found, the editor <tt class="docutils literal"><span class="pre">musredit</span></tt> is built
readily with <tt class="docutils literal"><span class="pre">musrfit</span></tt>. If not, try the following:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> src/musredit
$ qmake-qt4 musredit.pro
</pre></div>
</div>
<p>If everything went fine <tt class="docutils literal"><span class="pre">musredit</span></tt> can be compiled and installed:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ make
$ make install
</pre></div>
</div>
<p>In case one likes to get the editor started just with starting the X server from the Windows start
menu the file <tt class="docutils literal"><span class="pre">~/.startxwinrc</span></tt> with the following contents can be created:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="ch">#!/bin/sh</span>
<span class="nb">export</span> <span class="nv">DISPLAY</span><span class="o">=</span>:0.0
<span class="nb">export</span> <span class="nv">QTDIR</span><span class="o">=</span>/usr/lib/qt4
<span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span>/cygdrive/c/root
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin:<span class="nv">$QTDIR</span>/bin:/usr/i686-pc-cygwin/bin:<span class="nv">$PATH</span>
<span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
musredit <span class="p">&amp;</span>
</pre></div>
</div>
</div>
<div class="section" id="id12">
<h3>musrgui (obsolate)<a class="headerlink" href="#id12" title="Permalink to this headline"></a></h3>
<p>If <tt class="docutils literal"><span class="pre">Qt4.5</span></tt> or higher is not available but <tt class="docutils literal"><span class="pre">Qt3</span></tt> is set up <tt class="docutils literal"><span class="pre">musrgui</span></tt> can be installed. For this
please follow the instructions for the <tt class="docutils literal"><span class="pre">musredit</span></tt> installation where simply every <tt class="docutils literal"><span class="pre">musredit</span></tt> occurrence
has to be replaced by <tt class="docutils literal"><span class="pre">musrgui</span></tt>, and <tt class="docutils literal"><span class="pre">qt4</span></tt> is replaced by <tt class="docutils literal"><span class="pre">qt3</span></tt>.</p>
</div>
<div class="section" id="id13">
<h3>Check the installation<a class="headerlink" href="#id13" title="Permalink to this headline"></a></h3>
<p>In order to perform a quick test for finding out if the installation has been completed successfully,
a few msr files together with the corresponding data files can be found in the <tt class="docutils literal"><span class="pre">musrfit</span></tt> source tree
at doc/examples/.
If <tt class="docutils literal"><span class="pre">musrgui</span></tt> has been installed, just open one of the <tt class="docutils literal"><span class="pre">test-*.msr</span></tt> files in the editor and test
the <tt class="docutils literal"><span class="pre">musrfit</span></tt> functionalities. Otherwise, if only the terminal should be used, as an initial test
for instance the following could be done:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> doc/examples
$ musrview test-histo-ROOT-NPP.msr
</pre></div>
</div>
</div>
<div class="section" id="potential-problems">
<h3>Potential Problems<a class="headerlink" href="#potential-problems" title="Permalink to this headline"></a></h3>
<p>It might be that especially when running on Windows 7 <tt class="docutils literal"><span class="pre">musredit</span></tt> and <tt class="docutils literal"><span class="pre">musrgui</span></tt> produce errors like a
&#8220;STATUS_ACCESS_VIOLATION&#8221;. In this case, try to do the following: Close all Cygwin programs (including
the terminals and X server) and run from a Windows command prompt (cmd)</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ C:<span class="se">\c</span>ygwin<span class="se">\b</span>in<span class="se">\a</span>sh.exe /bin/rebaseall
</pre></div>
</div>
<p>If this does not resolve the problem, try to change the compatibility settings of <tt class="docutils literal"><span class="pre">C:\cygwin\bin\sh.exe</span></tt>
and <tt class="docutils literal"><span class="pre">C:\cygwin\bin\bash.exe</span></tt> so that they are executed with administrator privileges.</p>
</div>
</div>
<div class="section" id="mac-os-x-macos">
<h2>Mac OS X / macOS<a class="headerlink" href="#mac-os-x-macos" title="Permalink to this headline"></a></h2>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">macOS 12 alias <strong>Monterey</strong>: <tt class="docutils literal"><span class="pre">musrfit</span></tt> is ready for <strong>Monterey</strong> on Intel <strong>and</strong> M1 (Apple Silicon) based macs, both running natively.
The <tt class="docutils literal"><span class="pre">DKS</span></tt> version of <tt class="docutils literal"><span class="pre">musrfit</span></tt> for macOS <strong>Monterey</strong> is ready as well.</p>
</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">macOS Catalina is slightly different in some aspects, so if it happens that you have it installed, please
first check <a class="reference internal" href="#note-on-catalina"><em>Notes on macOS Catalina</em></a> before you proceed.</p>
</div>
@ -701,7 +444,7 @@ unistall <tt class="docutils literal"><span class="pre">musrfit</span></tt>, <tt
installation of <a class="reference external" href="https://www.macports.org/">MacPorts</a> / <a class="reference external" href="http://www.finkproject.org/">Fink</a> , <tt class="docutils literal"><span class="pre">ROOT</span></tt>, and <tt class="docutils literal"><span class="pre">musrfit</span></tt> from scratch!</p>
</div>
<div class="section" id="requirements-macports">
<span id="index-27"></span><h3>Requirements (MacPorts)<a class="headerlink" href="#requirements-macports" title="Permalink to this headline"></a></h3>
<span id="index-21"></span><h3>Requirements (MacPorts)<a class="headerlink" href="#requirements-macports" title="Permalink to this headline"></a></h3>
<p>Before proceeding with the usage of the <tt class="docutils literal"><span class="pre">MacPorts</span></tt> system first a few useful tools provided by Apple together
with OS X (on the installation DVD/CDs) should be installed:</p>
<blockquote>
@ -753,13 +496,13 @@ add a new line pointing to your local copy, <em>e.g.</em></p>
</ol>
<p>Then the MacPorts system should be set up and can be used to install additional software.</p>
<p>The installation of the software mentioned above is then done in the terminal:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo port -v install pkgconfig autoconf automake libtool cmake fftw-3 fftw-3-single gsl boost libxml2 qt5 qt5-qtsvg qt5-qtwebengine
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo port -v install pkgconfig autoconf automake libtool cmake fftw-3 fftw-3-single gsl boost libxml2 qt5 qt5-qtsvg
</pre></div>
</div>
<p>With <tt class="docutils literal"><span class="pre">Qt5</span></tt>, <tt class="docutils literal"><span class="pre">musredit</span></tt> will be installed. If it happens that you used <tt class="docutils literal"><span class="pre">musrgui</span></tt> in the past,
please change over to <tt class="docutils literal"><span class="pre">musredit</span></tt> since there will be no further development for <tt class="docutils literal"><span class="pre">musrgui</span></tt> anymore!</p>
<div class="section" id="index-28">
<span id="id14"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-28" title="Permalink to this headline"></a></h4>
<div class="section" id="index-22">
<span id="id6"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-22" title="Permalink to this headline"></a></h4>
<p><em>Only</em> if <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support reading data files in the <tt class="docutils literal"><span class="pre">NeXus</span></tt> format the further required packages are set up:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ sudo port -v install hdf4 hdf5
</pre></div>
@ -780,8 +523,8 @@ $ sudo make install
</pre></div>
</div>
</div>
<div class="section" id="index-29">
<span id="id15"></span><h4>ROOT<a class="headerlink" href="#index-29" title="Permalink to this headline"></a></h4>
<div class="section" id="index-23">
<span id="id7"></span><h4>ROOT<a class="headerlink" href="#index-23" title="Permalink to this headline"></a></h4>
<p><strong>The default ROOT version is based on ROOT 6.xx/yy!</strong></p>
<div class="section" id="root-installed-via-package-installer">
<h5>ROOT installed via package installer<a class="headerlink" href="#root-installed-via-package-installer" title="Permalink to this headline"></a></h5>
@ -792,9 +535,9 @@ it is at the time of writting <tt class="docutils literal"><span class="pre">roo
<tt class="docutils literal"><span class="pre">ROOT</span></tt> will be installed under <tt class="docutils literal"><span class="pre">/Application</span></tt> as owner root. In order to ease your life for the
steps to follow and assuming you are the only guy working on your Mac, you could change the owner and group of the <tt class="docutils literal"><span class="pre">ROOT</span></tt> directory:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">cd</span> /Applications
$ sudo chown -R &lt;username&gt; root_v6.16.00
$ sudo chgrp -R staff root_v6.16.00
$ sudo ln -s root_v6.16.00 root
$ sudo chown -R &lt;username&gt; root_v6.22.00
$ sudo chgrp -R staff root_v6.22.00
$ sudo ln -s root_v6.22.00 root
</pre></div>
</div>
</div>
@ -811,14 +554,14 @@ comments will be added starting with a &#8216;#&#8217; which can be omitted. The
$ git clone http://github.com/root-project/root.git
$ <span class="nb">cd</span> root
$ git tag -l
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-10-xx</span>
$ <span class="c1"># where xx is the highest listed number, e.g. v6-16-00</span>
$ git checkout -b v6-16-00 v6-16-00
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-xx-yy</span>
$ <span class="c1"># where xx is the highest listed number, e.g. v6-22-06</span>
$ git checkout -b v6-22-06 v6-22-06
$ <span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$ <span class="c1"># We will use the cmake out-of-source approach here.</span>
$ mkdir root_build
$ <span class="nb">cd</span> root_build
$ cmake ../ -Dgminimal<span class="o">=</span>ON -Dasimage<span class="o">=</span>ON -Dmathmore<span class="o">=</span>ON -Dminuit2<span class="o">=</span>ON -Dxml<span class="o">=</span>ON -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
$ cmake ../ -Dgminimal<span class="o">=</span><span class="m">1</span> -Dasimage<span class="o">=</span><span class="m">1</span> -Dmathmore<span class="o">=</span><span class="m">1</span> -Dminuit2<span class="o">=</span><span class="m">1</span> -Dxml<span class="o">=</span><span class="m">1</span> -Dopengl<span class="o">=</span><span class="m">1</span> -Dbuiltin_glew<span class="o">=</span><span class="m">1</span> -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
$ <span class="c1"># next will be the make. If running on a multicore CPU you can speed up tremendously by calling</span>
$ <span class="c1"># make with the option -j &lt;number&gt;, where &lt;number&gt; is the number of threads which you want to give,</span>
$ <span class="c1"># e.g. make -j8</span>
@ -858,15 +601,15 @@ into the file <tt class="docutils literal"><span class="pre">~/.MacOSX/environme
<div class="highlight-bash"><div class="highlight"><pre><span></span><span class="nb">export</span> <span class="nv">ROOTSYS</span><span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
<span class="nb">export</span> <span class="nv">MUSRFITPATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin
<span class="nb">export</span> <span class="nv">PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/bin:<span class="nv">$QTDIR</span>/bin:<span class="nv">$PATH</span>
<span class="nb">export</span> <span class="nv">LD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib:<span class="nv">$LD_LIBRARY_PATH</span>
<span class="nb">export</span> <span class="nv">DYLD_LIBRARY_PATH</span><span class="o">=</span><span class="nv">$ROOTSYS</span>/lib:<span class="nv">$DYLD_LIBRARY_PATH</span>
launchctl setenv ROOTSYS <span class="nv">$ROOTSYS</span>
launchctl setenv MUSRFITPATH <span class="nv">$MUSRFITPATH</span>
launchctl setenv PATH <span class="nv">$PATH</span>
launchctl setenv LD_LIBRARY_PATH <span class="nv">$LD_LIBRARY_PATH</span>
launchctl setenv DYLD_LIBRARY_PATH <span class="nv">$DYLD_LIBRARY_PATH</span>
</pre></div>
</div>
<p>After this you will need to &#8220;execute&#8221; <tt class="docutils literal"><span class="pre">.profile</span></tt> before proceeding:</p>
<p>After this you will need to &#8220;execute&#8221; <tt class="docutils literal"><span class="pre">.profile</span></tt> or <tt class="docutils literal"><span class="pre">.zprofile</span></tt> before proceeding:</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>$ <span class="nb">source</span> <span class="nv">$HOME</span>/.profile
</pre></div>
</div>
@ -893,7 +636,7 @@ but no proper fix is available. The workaround to get it right is to install the
</div>
</div>
<div class="section" id="requirements-fink">
<span id="index-30"></span><h3>Requirements (Fink)<a class="headerlink" href="#requirements-fink" title="Permalink to this headline"></a></h3>
<span id="index-24"></span><h3>Requirements (Fink)<a class="headerlink" href="#requirements-fink" title="Permalink to this headline"></a></h3>
<p>Before proceeding with the usage of the <a class="reference external" href="http://www.finkproject.org/">Fink</a> system first a few useful tools provided by Apple together with OS X (on the installation DVD/CDs) should be installed:</p>
<dl class="docutils">
<dt><strong>Xcode</strong></dt>
@ -927,8 +670,7 @@ is necessary to compile a few packages from source since no binary packages are
automatically by the FinkCommander after you have chosen the software packages for installation:</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>autoconf automake cmake boost1.63-nopython boost1.63.nopython-shlibs fftw3 fftw3-shlibs gsl gsl-shlibs
libtool2 libtool2-shlibs libxml2 libxml2-bin libxml2-shlibs pkgconfig qt5-mac-qtbase qt5-mac-qtbase-dev-tools
qt5-mac-qtsvg qt5-mac-qtsvg-shlibs qt5-mac-qtwebengine qt5-mac-qtwebengine-shlibs qt5-mac-qtwebenginecore-shlibs
qt5-mac-qtwebenginewidgets-shlibs
qt5-mac-qtsvg qt5-mac-qtsvg-shlibs
</pre></div>
</div>
<p>Under OS X 10.6 Snow Leopard it will <em>not</em> be possible to install <tt class="docutils literal"><span class="pre">qt3mac</span></tt> since the system is by default a 64-bit
@ -951,8 +693,8 @@ specific location, the later handling will be easier if a symbolic link to this
</pre></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">x_yy_z</span></tt> has to be substituted by the correct version number, <em>e.g.</em> <tt class="docutils literal"><span class="pre">1_63_0</span></tt>.</p>
<div class="section" id="index-31">
<span id="id17"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-31" title="Permalink to this headline"></a></h4>
<div class="section" id="index-25">
<span id="id9"></span><h4>Installation of NeXus requirements (optional)<a class="headerlink" href="#index-25" title="Permalink to this headline"></a></h4>
<p><em>Only</em> if <tt class="docutils literal"><span class="pre">musrfit</span></tt> should support reading data files in the <tt class="docutils literal"><span class="pre">NeXus</span></tt> format the further required
packages can be installed through Fink (check for the most recent versions):</p>
<div class="highlight-python"><div class="highlight"><pre><span></span>libjpeg hdf hdf5-cpp11 hdf5-cpp11-shlibs
@ -974,11 +716,11 @@ $ sudo make install
</pre></div>
</div>
</div>
<div class="section" id="index-32">
<span id="id18"></span><h4>ROOT<a class="headerlink" href="#index-32" title="Permalink to this headline"></a></h4>
<div class="section" id="index-26">
<span id="id10"></span><h4>ROOT<a class="headerlink" href="#index-26" title="Permalink to this headline"></a></h4>
<p><strong>The default ROOT version is based on ROOT 6.xx/yy!</strong></p>
<div class="section" id="id19">
<h5>ROOT installed via package installer<a class="headerlink" href="#id19" title="Permalink to this headline"></a></h5>
<div class="section" id="id11">
<h5>ROOT installed via package installer<a class="headerlink" href="#id11" title="Permalink to this headline"></a></h5>
<p>The lazy way to get <tt class="docutils literal"><span class="pre">ROOT</span></tt> installed is via package installer. If your macOS is directly supported
by the <tt class="docutils literal"><span class="pre">ROOT</span></tt> people you can download the package installer from the <tt class="docutils literal"><span class="pre">ROOT</span></tt> <a class="reference external" href="https://root.cern.ch/downloading-root">download page</a>.
Choose the latest <tt class="docutils literal"><span class="pre">ROOT</span></tt> release and download you macOS version dmg-file, <em>e.g.</em> for macOS 10.13 (High Sierra)
@ -992,8 +734,8 @@ $ sudo ln -s root_v6.16.00 root
</pre></div>
</div>
</div>
<div class="section" id="id21">
<h5>ROOT installed from source<a class="headerlink" href="#id21" title="Permalink to this headline"></a></h5>
<div class="section" id="id13">
<h5>ROOT installed from source<a class="headerlink" href="#id13" title="Permalink to this headline"></a></h5>
<p>The best way to get <tt class="docutils literal"><span class="pre">ROOT</span></tt> exactly the way needed for <tt class="docutils literal"><span class="pre">musrfit</span></tt> is to install it from source.
Before describing it, please make sure that you have installed all required packages listed under
<a class="reference internal" href="#supported-operating-systems"><em>Requested Software</em></a> (<em>e.g.</em> <tt class="docutils literal"><span class="pre">fftw</span></tt>, <tt class="docutils literal"><span class="pre">gsl</span></tt>, etc).</p>
@ -1005,14 +747,14 @@ comments will be added starting with a &#8216;#&#8217; which can be omitted. The
$ git clone http://github.com/root-project/root.git
$ <span class="nb">cd</span> root
$ git tag -l
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-10-xx</span>
$ <span class="c1"># where xx is the highest listed number, e.g. v6-16-00</span>
$ git checkout -b v6-16-00 v6-16-00
$ <span class="c1"># git tag -l will list all available tags. In the next command choose the tag v6-xx-yy</span>
$ <span class="c1"># where xx is the highest listed number, e.g. v6-22-06</span>
$ git checkout -b v6-22-06 v6-22-06
$ <span class="c1"># now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.</span>
$ <span class="c1"># We will use the cmake out-of-source approach here.</span>
$ mkdir root_build
$ <span class="nb">cd</span> root_build
$ cmake ../ -Dgminimal<span class="o">=</span>ON -Dasimage<span class="o">=</span>ON -Dmathmore<span class="o">=</span>ON -Dminuit2<span class="o">=</span>ON -Dxml<span class="o">=</span>ON -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
$ cmake ../ -Dgminimal<span class="o">=</span><span class="m">1</span> -Dasimage<span class="o">=</span><span class="m">1</span> -Dmathmore<span class="o">=</span><span class="m">1</span> -Dminuit2<span class="o">=</span><span class="m">1</span> -Dxml<span class="o">=</span><span class="m">1</span> -Dopengl<span class="o">=</span><span class="m">1</span> -Dbuiltin_glew<span class="o">=</span><span class="m">1</span> -DCMAKE_INSTALL_PREFIX<span class="o">=</span><span class="nv">$HOME</span>/Applications/root/root_exec
$ <span class="c1"># next will be the make. If running on a multicore CPU you can speed up tremendously by calling</span>
$ <span class="c1"># make with the option -j &lt;number&gt;, where &lt;number&gt; is the number of threads which you want to give,</span>
$ <span class="c1"># e.g. make -j8</span>
@ -1023,8 +765,8 @@ $ make install
</div>
<p>For further details see <a class="reference external" href="https://root.cern.ch/building-root">Installing ROOT from Source</a>.</p>
</div>
<div class="section" id="id23">
<h5>Setting up Environment Variables for ROOT and musrfit<a class="headerlink" href="#id23" title="Permalink to this headline"></a></h5>
<div class="section" id="id15">
<h5>Setting up Environment Variables for ROOT and musrfit<a class="headerlink" href="#id15" title="Permalink to this headline"></a></h5>
<p>Since Apple in its wisdom decided that programs started from a shell are treated differently than Apps if it is coming to
system variables, we need to work harder compared to a Linux system.</p>
<p><strong>For Mac OS X &lt; 10.8:</strong></p>
@ -1067,8 +809,8 @@ launchctl setenv LD_LIBRARY_PATH <span class="nv">$LD_LIBRARY_PATH</span>
</div>
</div>
</div>
<div class="section" id="index-33">
<span id="id24"></span><h3>musrfit<a class="headerlink" href="#index-33" title="Permalink to this headline"></a></h3>
<div class="section" id="index-27">
<span id="id16"></span><h3>musrfit<a class="headerlink" href="#index-27" title="Permalink to this headline"></a></h3>
<p>First, the most recent source code should be downloaded. First, the most recent source code should be downloaded.
The preferred way of doing so is to clone the <tt class="docutils literal"><span class="pre">musrfit</span></tt> repository via git. Assuming the code should be located
in <tt class="docutils literal"><span class="pre">~/Applications/musrfit</span></tt> this is achieved most easily calling from the termin</p>
@ -1090,8 +832,8 @@ $ git pull
</div>
<p>As an alternative (<em>if git is not available</em>), the source code can also be downloaded from the following
web-page: <a class="reference external" href="https://bitbucket.org/muonspin/musrfit/downloads">musrfit at bitbucket</a>.</p>
<div class="section" id="index-34">
<span id="id25"></span><h4>musrfit build with cmake<a class="headerlink" href="#index-34" title="Permalink to this headline"></a></h4>
<div class="section" id="index-28">
<span id="id17"></span><h4>musrfit build with cmake<a class="headerlink" href="#index-28" title="Permalink to this headline"></a></h4>
<p>Currently the following configuration switches for <tt class="docutils literal"><span class="pre">musrfit</span></tt> are available:</p>
<dl class="docutils">
<dt><strong>-DCMAKE_INSTALL_PREFIX=&lt;prefix-path&gt;</strong></dt>
@ -1112,7 +854,7 @@ switch is not provided is <tt class="docutils literal"><span class="pre">BMWlibs
<dd>Will try to get <tt class="docutils literal"><span class="pre">musredit</span></tt>, <tt class="docutils literal"><span class="pre">musrWiz</span></tt>, <tt class="docutils literal"><span class="pre">musrStep</span></tt>, and <tt class="docutils literal"><span class="pre">mupp</span></tt> installed, if <tt class="docutils literal"><span class="pre">Qt</span></tt> is found.
By default this is enabled. Again &lt;value&gt;=0 means disabled, &lt;value&gt;=1 enabled.</dd>
<dt><strong>-Dqt_version=&lt;value&gt;</strong></dt>
<dd>Allows to specify which <tt class="docutils literal"><span class="pre">Qt</span></tt> version shall be tried. &lt;value&gt; can take the values: <tt class="docutils literal"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5</span></tt>.
<dd>Allows to specify which <tt class="docutils literal"><span class="pre">Qt</span></tt> version shall be tried. &lt;value&gt; can take the values: <tt class="docutils literal"><span class="pre">AUTO,</span> <span class="pre">3,</span> <span class="pre">4,</span> <span class="pre">5,</span> <span class="pre">6</span></tt>.
If the value is set to <tt class="docutils literal"><span class="pre">AUTO</span></tt>, this highest installed version is chosen, otherwise the specified version is used.</dd>
<dt><strong>-Dtry_OpenMP=&lt;value&gt;</strong></dt>
<dd>Will check if <tt class="docutils literal"><span class="pre">OpenMP</span></tt> support is possible, and if yes use it. The default is enabled</dd>
@ -1131,8 +873,8 @@ $ /sbin/ldconfig <span class="c1"># (as superus
</pre></div>
</div>
</div>
<div class="section" id="id26">
<h4>musrfit last step of the installation<a class="headerlink" href="#id26" title="Permalink to this headline"></a></h4>
<div class="section" id="id18">
<h4>musrfit last step of the installation<a class="headerlink" href="#id18" title="Permalink to this headline"></a></h4>
<p>In order to finish the installation of <tt class="docutils literal"><span class="pre">musrfit</span></tt> two more things should be done:</p>
<ul class="simple">
<li>Define the <tt class="docutils literal"><span class="pre">MUSRFITPATH</span></tt> environment variable containing the path to the <tt class="docutils literal"><span class="pre">musrfit</span></tt> executables and <tt class="docutils literal"><span class="pre">XML</span></tt> files.
@ -1148,8 +890,8 @@ detailed information on this XML file refer to the <a class="reference internal"
</ul>
</div>
</div>
<div class="section" id="index-35">
<span id="id27"></span><h3>musredit<a class="headerlink" href="#index-35" title="Permalink to this headline"></a></h3>
<div class="section" id="index-29">
<span id="id19"></span><h3>musredit<a class="headerlink" href="#index-29" title="Permalink to this headline"></a></h3>
<p>In the latest version of <tt class="docutils literal"><span class="pre">musrfit</span></tt> the configure script tries to determine automatically the highest
available Qt version. In case this is found, the editor <tt class="docutils literal"><span class="pre">musredit</span></tt> is built already together with <tt class="docutils literal"><span class="pre">musrfit</span></tt>.
If not, try the following:</p>
@ -1185,8 +927,8 @@ accomplish that, add the following lines to <tt class="docutils literal"><span c
</pre></div>
</div>
</div>
<div class="section" id="id28">
<h3>Check the installation<a class="headerlink" href="#id28" title="Permalink to this headline"></a></h3>
<div class="section" id="id20">
<h3>Check the installation<a class="headerlink" href="#id20" title="Permalink to this headline"></a></h3>
<p>In order to perform a quick test for finding out if the installation has been completed successfully, a few msr
files together with the corresponding data files can be found in the musrfit source tree at <tt class="docutils literal"><span class="pre">doc/examples/</span></tt>.
If <tt class="docutils literal"><span class="pre">musrgui</span></tt> has been installed, just open one of the <tt class="docutils literal"><span class="pre">test-*.msr</span></tt> files in the editor and test the <tt class="docutils literal"><span class="pre">musrfit</span></tt>
@ -1200,123 +942,22 @@ $ musrview test-histo-ROOT-NPP.msr
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a><ul>
<li><a class="reference internal" href="#supported-operating-systems-and-software-requirements">Supported Operating Systems and Software Requirements</a></li>
<li><a class="reference internal" href="#os-restrictions">OS Restrictions</a></li>
<li><a class="reference internal" href="#gnu-linux">GNU/Linux</a><ul>
<li><a class="reference internal" href="#requirements">Requirements</a><ul>
<li><a class="reference internal" href="#everything-but-root-and-nexus">Everything but ROOT and NeXus</a></li>
<li><a class="reference internal" href="#installation-of-nexus-requirements-optional">Installation of NeXus requirements (optional)</a></li>
<li><a class="reference internal" href="#index-16">ROOT</a></li>
</ul>
</li>
<li><a class="reference internal" href="#musrfit">musrfit</a><ul>
<li><a class="reference internal" href="#musrfit-build-with-cmake">musrfit build with cmake</a></li>
<li><a class="reference internal" href="#musrfit-last-step-of-the-installation">musrfit last step of the installation</a></li>
</ul>
</li>
<li><a class="reference internal" href="#musredit">musredit</a></li>
<li><a class="reference internal" href="#musrgui-obsolate">musrgui (obsolate)</a></li>
<li><a class="reference internal" href="#check-the-installation">Check the installation</a></li>
</ul>
</li>
<li><a class="reference internal" href="#ms-windows">MS Windows</a><ul>
<li><a class="reference internal" href="#id5">Requirements</a><ul>
<li><a class="reference internal" href="#setting-up-cygwin">Setting up Cygwin</a></li>
<li><a class="reference internal" href="#id6">Everything but ROOT and NeXus</a></li>
<li><a class="reference internal" href="#index-22">Installation of NeXus requirements (optional)</a></li>
<li><a class="reference internal" href="#index-23">ROOT</a></li>
</ul>
</li>
<li><a class="reference internal" href="#index-24">musrfit</a><ul>
<li><a class="reference internal" href="#index-25">musrfit build with cmake</a></li>
</ul>
</li>
<li><a class="reference internal" href="#index-26">musredit</a></li>
<li><a class="reference internal" href="#id12">musrgui (obsolate)</a></li>
<li><a class="reference internal" href="#id13">Check the installation</a></li>
<li><a class="reference internal" href="#potential-problems">Potential Problems</a></li>
</ul>
</li>
<li><a class="reference internal" href="#mac-os-x-macos">Mac OS X / macOS</a><ul>
<li><a class="reference internal" href="#requirements-macports">Requirements (MacPorts)</a><ul>
<li><a class="reference internal" href="#index-28">Installation of NeXus requirements (optional)</a></li>
<li><a class="reference internal" href="#index-29">ROOT</a></li>
<li><a class="reference internal" href="#notes-on-macos-catalina">Notes on macOS Catalina</a></li>
</ul>
</li>
<li><a class="reference internal" href="#requirements-fink">Requirements (Fink)</a><ul>
<li><a class="reference internal" href="#index-31">Installation of NeXus requirements (optional)</a></li>
<li><a class="reference internal" href="#index-32">ROOT</a></li>
</ul>
</li>
<li><a class="reference internal" href="#index-33">musrfit</a><ul>
<li><a class="reference internal" href="#index-34">musrfit build with cmake</a></li>
<li><a class="reference internal" href="#id26">musrfit last step of the installation</a></li>
</ul>
</li>
<li><a class="reference internal" href="#index-35">musredit</a></li>
<li><a class="reference internal" href="#musrgui-obsolete">musrgui (obsolete)</a></li>
<li><a class="reference internal" href="#id28">Check the installation</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="user-libs.html">Documentation of user libs (user functions)</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="setup-dks.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s</a>&#160;&#160;»
</p>
<h4>Previous topic</h4>
<p class="topless"><a href="user-libs.html"
title="previous chapter">Documentation of user libs (user functions)</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="setup-dks.html"
title="next chapter">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> / <tt class="docutils literal"><span class="pre">DKS</span></tt>: High Speed Fitting with GPU&#8217;s</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/setup-standard.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="setup-dks.html" title="Setting up musrfit / DKS: High Speed Fitting with GPUs"
>next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Tutorial for musrfit &mdash; musrfit 1.6.4 documentation</title>
<title>Tutorial for musrfit &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="user-manual.html" title="User manual"
accesskey="N">next</a> |</li>
<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.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Tutorial for musrfit</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="cite.html">How to Cite <tt class="docutils literal"><span class="pre">musrfit</span></tt>?</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="user-manual.html">User manual</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="tutorial-for-musrfit">
<span id="index-0"></span><h1>Tutorial for <tt class="docutils literal"><span class="pre">musrfit</span></tt><a class="headerlink" href="#tutorial-for-musrfit" title="Permalink to this headline"></a></h1>
<div class="section" id="single-histogram-fit-tutorial">
@ -381,74 +378,22 @@ For a complete description please refer to the manuals of <a class="reference in
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Tutorial for <tt class="docutils literal"><span class="pre">musrfit</span></tt></a><ul>
<li><a class="reference internal" href="#single-histogram-fit-tutorial">Single-histogram-fit tutorial</a><ul>
<li><a class="reference internal" href="#the-msr-file">The msr file</a></li>
<li><a class="reference internal" href="#determine-t0-and-the-data-range-using-musrt0">Determine t0 and the data range using musrt0</a></li>
<li><a class="reference internal" href="#fit-the-model-to-the-data-using-musrfit">Fit the model to the data using <tt class="docutils literal"><span class="pre">musrfit</span></tt></a></li>
<li><a class="reference internal" href="#view-the-data-and-the-fit-using-musrview">View the data and the fit using <tt class="docutils literal"><span class="pre">musrview</span></tt></a></li>
<li><a class="reference internal" href="#process-multiple-msr-files-using-msr2data">Process multiple msr files using <tt class="docutils literal"><span class="pre">msr2data</span></tt></a></li>
<li><a class="reference internal" href="#further-reading">Further reading</a></li>
</ul>
</li>
<li><a class="reference internal" href="#asymmtery-fit-tutorial">Asymmtery-fit tutorial</a></li>
</ul>
</li>
</ul>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="cite.html">How to Cite <tt class="docutils literal"><span class="pre">musrfit</span></tt>?</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="user-manual.html">User manual</a>&#160;&#160;»
</p>
<h4>Previous topic</h4>
<p class="topless"><a href="cite.html"
title="previous chapter">How to Cite <tt class="docutils literal"><span class="pre">musrfit</span></tt>?</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="user-manual.html"
title="next chapter">User manual</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/tutorial.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="user-manual.html" title="User manual"
>next</a> |</li>
<li class="right" >
<a href="cite.html" title="How to Cite musrfit?"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,15 +6,15 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Documentation of user libs (user functions) &mdash; musrfit 1.6.4 documentation</title>
<title>Documentation of user libs (user functions) &mdash; musrfit 1.8.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/haiku.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT: './',
VERSION: '1.6.4',
VERSION: '1.8.0',
COLLAPSE_INDEX: false,
FILE_SUFFIX: '.html',
HAS_SOURCE: true
@ -24,32 +24,29 @@
<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.4 documentation" href="index.html" />
<link rel="top" title="musrfit 1.8.0 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>
<body>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
accesskey="I">index</a></li>
<li class="right" >
<a href="setup-standard.html" title="Setting up musrfit on Different Platforms"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="user-manual.html" title="User manual"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="header"><h1 class="heading"><a href="index.html">
<span>musrfit 1.8.0 documentation</span></a></h1>
<h2 class="heading"><span>Documentation of user libs (user functions)</span></h2>
</div>
<div class="topnav">
<p>
«&#160;&#160;<a href="user-manual.html">User manual</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="setup-standard.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a>&#160;&#160;»
</p>
<div class="document">
<div class="documentwrapper">
<div class="bodywrapper">
<div class="body">
</div>
<div class="content">
<div class="section" id="documentation-of-user-libs-user-functions">
<span id="user-libs"></span><span id="index-0"></span><h1>Documentation of user libs (user functions)<a class="headerlink" href="#documentation-of-user-libs-user-functions" title="Permalink to this headline"></a></h1>
<div class="section" id="meissner-profiles-vortex-lattice-related-functions-bmw-libs">
@ -600,74 +597,22 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
</div>
</div>
</div>
</div>
<div class="sphinxsidebar">
<div class="sphinxsidebarwrapper">
<h3><a href="index.html">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Documentation of user libs (user functions)</a><ul>
<li><a class="reference internal" href="#meissner-profiles-vortex-lattice-related-functions-bmw-libs">Meissner-Profiles / Vortex-Lattice related functions (BMW libs)</a><ul>
<li><a class="reference internal" href="#libfitpofb">libFitPofB</a></li>
</ul>
</li>
<li><a class="reference internal" href="#nonlocal-superconductivity-related-meissner-screening-functions-as-libs">Nonlocal superconductivity related Meissner screening functions (AS libs)</a></li>
<li><a class="reference internal" href="#functions-to-analyze-bgr-nmr-data-bnmr-libs">Functions to analyze β-NMR data (BNMR libs)</a><ul>
<li><a class="reference internal" href="#libbnmr">libBNMR</a></li>
<li><a class="reference internal" href="#liblineprofile">libLineProfile</a></li>
</ul>
</li>
</ul>
</li>
</ul>
<div class="bottomnav">
<p>
«&#160;&#160;<a href="user-manual.html">User manual</a>
&#160;&#160;::&#160;&#160;
<a class="uplink" href="index.html">Contents</a>
&#160;&#160;::&#160;&#160;
<a href="setup-standard.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a>&#160;&#160;»
</p>
<h4>Previous topic</h4>
<p class="topless"><a href="user-manual.html"
title="previous chapter">User manual</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="setup-standard.html"
title="next chapter">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a></p>
<h3>This Page</h3>
<ul class="this-page-menu">
<li><a href="_sources/user-libs.txt"
rel="nofollow">Show Source</a></li>
</ul>
<div id="searchbox" style="display: none">
<h3>Quick search</h3>
<form class="search" action="search.html" method="get">
<input type="text" name="q" />
<input type="submit" value="Go" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
<p class="searchtip" style="font-size: 90%">
Enter search terms or a module, class or function name.
</p>
</div>
<script type="text/javascript">$('#searchbox').show(0);</script>
</div>
</div>
<div class="clearer"></div>
</div>
<div class="related">
<h3>Navigation</h3>
<ul>
<li class="right" style="margin-right: 10px">
<a href="genindex.html" title="General Index"
>index</a></li>
<li class="right" >
<a href="setup-standard.html" title="Setting up musrfit on Different Platforms"
>next</a> |</li>
<li class="right" >
<a href="user-manual.html" title="User manual"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.6.4 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2020, Andreas Suter.
Last updated on Aug 29, 2020.
&copy; Copyright 2022, Andreas Suter.
Last updated on May 29, 2022.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

File diff suppressed because it is too large Load Diff

View File

@ -9,7 +9,7 @@ elseif (Qt4_FOUND)
add_subdirectory(musredit)
elseif (QT_FOUND)
add_subdirectory(musrgui)
endif (Qt5Core_FOUND)
endif ()
#--- define the musrfit libs --------------------------------------------------
set(MUSRFIT_LIBS ${MUSRFIT_LIBS} mud)
@ -23,48 +23,65 @@ endif (nexus)
set(MUSRFIT_LIBS ${MUSRFIT_LIBS} PMusr)
#--- start create git-revision.h ----------------------------------------------
configure_file(
${CMAKE_SOURCE_DIR}/cmake/configure_musrfit_version_file.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/configure_musrfit_version_file.cmake
@ONLY
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/git-revision.h
COMMAND ${CMAKE_COMMAND} -P
if (IS_GIT_REPO)
configure_file(
${CMAKE_SOURCE_DIR}/cmake/configure_musrfit_version_file.cmake.in
${CMAKE_CURRENT_BINARY_DIR}/configure_musrfit_version_file.cmake
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/configure_musrfit_version_file.cmake
${CMAKE_SOURCE_DIR}/cmake/git-revision.h.in
COMMENT "Configuring git-revision.h"
VERBATIM
)
@ONLY
)
add_custom_command(
OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/git-revision.h
COMMAND ${CMAKE_COMMAND} -P
${CMAKE_CURRENT_BINARY_DIR}/configure_musrfit_version_file.cmake
DEPENDS
${CMAKE_CURRENT_BINARY_DIR}/configure_musrfit_version_file.cmake
${CMAKE_SOURCE_DIR}/cmake/git-revision.h.in
COMMENT "Configuring git-revision.h"
VERBATIM
)
add_custom_target(
configure_musrfit_version ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/git-revision.h
)
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
set(GIT_REV_H "git-revision.h")
else (IS_GIT_REPO)
set(HAVE_GIT_REV_H "")
set(GIT_REV_H "")
endif (IS_GIT_REPO)
add_custom_target(
configure_musrfit_version ALL
DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/git-revision.h
)
#--- end create git-revision.h ------------------------------------------------
#--- add all executables ------------------------------------------------------
add_executable(any2many git-revision.h any2many.cpp)
target_compile_options(any2many BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(addRun ${GIT_REV_H} addRun.cpp)
target_compile_options(addRun BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(addRun
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
)
target_link_libraries(addRun ${ROOT_LIBRARIES} ${MUSRFIT_LIBS} ${Boost_LIBRARIES})
add_executable(any2many ${GIT_REV_H} any2many.cpp)
target_compile_options(any2many BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(any2many
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
)
target_link_libraries(any2many ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
add_executable(dump_header git-revision.h dump_header.cpp)
target_compile_options(dump_header BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(dump_header ${GIT_REV_H} dump_header.cpp)
target_compile_options(dump_header BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(dump_header
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
@ -77,12 +94,11 @@ target_include_directories(dump_header
)
target_link_libraries(dump_header ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
add_executable(msr2data git-revision.h msr2data.cpp)
target_compile_options(msr2data BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(msr2data ${GIT_REV_H} msr2data.cpp)
target_compile_options(msr2data BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(msr2data
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
@ -92,35 +108,33 @@ target_link_libraries(msr2data ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
add_executable(msr2msr msr2msr.cpp)
target_link_libraries(msr2msr ${ROOT_LIBRARIES})
add_executable(musrfit git-revision.h musrfit.cpp)
target_compile_options(musrfit BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(musrfit ${GIT_REV_H} musrfit.cpp)
target_compile_options(musrfit BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(musrfit
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
)
target_link_libraries(musrfit ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
add_executable(musrFT git-revision.h musrFT.cpp)
target_compile_options(musrFT BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(musrFT ${GIT_REV_H} musrFT.cpp)
target_compile_options(musrFT BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(musrFT
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
)
target_link_libraries(musrFT ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
target_link_libraries(musrFT FFTW3::FFTW3 ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
add_executable(musrRootValidation git-revision.h musrRootValidation.cpp)
target_compile_options(musrRootValidation BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(musrRootValidation ${GIT_REV_H} musrRootValidation.cpp)
target_compile_options(musrRootValidation BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(musrRootValidation
BEFORE PRIVATE
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
@ -128,35 +142,33 @@ target_include_directories(musrRootValidation
)
target_link_libraries(musrRootValidation ${ROOT_LIBRARIES} ${MUSRFIT_LIBS} ${LIBXML2_LIBRARIES})
add_executable(musrt0 git-revision.h musrt0.cpp)
target_compile_options(musrt0 BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(musrt0 ${GIT_REV_H} musrt0.cpp)
target_compile_options(musrt0 BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(musrt0
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
)
target_link_libraries(musrt0 ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
add_executable(musrview git-revision.h musrview.cpp)
target_compile_options(musrview BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(musrview ${GIT_REV_H} musrview.cpp)
target_compile_options(musrview BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(musrview
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
)
target_link_libraries(musrview ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
target_link_libraries(musrview FFTW3::FFTW3 ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
add_executable(write_musrRoot_runHeader git-revision.h write_musrRoot_runHeader.cpp)
target_compile_options(write_musrRoot_runHeader BEFORE PRIVATE "-DHAVE_CONFIG_H")
add_executable(write_musrRoot_runHeader ${GIT_REV_H} write_musrRoot_runHeader.cpp)
target_compile_options(write_musrRoot_runHeader BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(write_musrRoot_runHeader
BEFORE PRIVATE
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
@ -168,6 +180,7 @@ target_link_libraries(write_musrRoot_runHeader ${ROOT_LIBRARIES} ${MUSRFIT_LIBS}
#--- installation info --------------------------------------------------------
install(
TARGETS
addRun
any2many
dump_header
msr2data

851
src/addRun.cpp Normal file
View File

@ -0,0 +1,851 @@
/***************************************************************************
addRun.cpp
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2022 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 HAVE_CONFIG_H
#include "config.h"
#endif
#include <cstdio>
#include <cstdlib>
#include <cstring>
#include <iostream>
#include <fstream>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
#include <TString.h>
#ifdef HAVE_GIT_REV_H
#include "git-revision.h"
#endif
#include "PMusr.h"
#include "PStartupHandler.h"
#include "PRunDataHandler.h"
#include "PFindRun.h"
struct PAddRunInfo {
std::string fPathFileName{""};
PIntVector fT0;
std::string fFileFormat{""};
};
//--------------------------------------------------------------------------
/**
* <p>Sends the usage description to the standard output.
*/
void addRun_syntax()
{
std::cout << std::endl;
std::cout << "usage0: addRun [--help | -h] | [--version | -v]" << std::endl;
std::cout << "usage1: addRun <options1> -rl <runList>" << std::endl;
std::cout << "usage2: addRun <options2> -in <inputFile>" << std::endl;
std::cout << std::endl;
std::cout << " <options1>:" << std::endl;
std::cout << " -t0 <ival>: <ival> is a comma separted list of global t0-bin's, or" << std::endl;
std::cout << " <ival> is a comma separted list of '-1', then it is assumed that there is a prompt peak." << std::endl;
std::cout << " Under this condition the t0-bin will be determined automatically by" << std::endl;
std::cout << " the position of the max-value of the corresponing histograms." << std::endl;
std::cout << " If t0's are not provided, t0-bin will be taken from the file." << std::endl;
std::cout << " -f <format>: <format> is the output file format to be used." << std::endl;
std::cout << " For supported formats see below." << std::endl;
std::cout << " -y <year> : the year at which runs were measured. Format yyyy." << std::endl;
std::cout << " If not provided, the current year is used." << std::endl;
std::cout << " -i <instrument> : <instrument> is one of gps, ltf, flame, gpd, hifi, dolly, lem" << std::endl;
std::cout << " -m <dev> : <dev> is pta or tdc (only needed for bulk). Default: tdc" << std::endl;
std::cout << " -o <fln> : output file name." << std::endl;
std::cout << " -rl <runList> can be:" << std::endl ;
std::cout << " (i) <run0> <run1> <run2> ... <runN> : run numbers, e.g. 123 124" << std::endl;
std::cout << " (ii) <run0>-<runN> : a range, e.g. 123-125 -> 123 124 125" << std::endl;
std::cout << " (iii) <run0>:<runN>:<step> : a sequence, e.g. 123:127:2 -> 123 125 127" << std::endl;
std::cout << " <step> will give the step width and has to be a positive number!" << std::endl;
std::cout << " a <runList> can also combine (i)-(iii), e.g. 123 128-130 133, etc." << std::endl;
std::cout << std::endl;
std::cout << " <options2>:" << std::endl;
std::cout << " -f <format>: <format> is file format of the output-file to be used." << std::endl;
std::cout << " -o <fln> : output file name." << std::endl;
std::cout << " -in <inputFile>: the file name of the file containing the necessary run information" << std::endl;
std::cout << " to add runs with various t0's, fgb's, lgb's, different years, etc." << std::endl;
std::cout << " The structure of the <inputFile> is:" << std::endl;
std::cout << " Lines starting with a '%' and empty lines are ignored." << std::endl;
std::cout << " A single run needs to provide the following information:" << std::endl;
std::cout << " file <path-name>: needs to be a full path name" << std::endl;
std::cout << " t0 <t0-bin> : needs to be the t0 bin or " << std::endl;
std::cout << " 0 to take the t0 bin from the file, or" << std::endl;
std::cout << " -1 for automatic determination via prompt peak (see above)." << std::endl;
std::cout << " Example:" << std::endl;
std::cout << " % file 1. 6 histos present, hence 6 t0-bins" << std::endl;
std::cout << " file /home/test/data/deltat_tdc_gps_4324.bin" << std::endl;
std::cout << " t0 401, 400, 399, 400, 358, 400" << std::endl;
std::cout << " % file 2, take t0-bins from the file" << std::endl;
std::cout << " file /home/test/data/deltat_tdc_gps_4325.bin" << std::endl;
std::cout << " % file 3, deduce to t0-bin's from the prompt peak" << std::endl;
std::cout << " file /home/test/data/deltat_tdc_gps_4325.bin" << std::endl;
std::cout << " t0 -1, -1, -1, -1, -1, -1" << std::endl;
std::cout << std::endl;
std::cout << " Supported uSR file formats:" << std::endl;
std::cout << " MusrRoot, PSI-BIN, PSI-MDU, MUD, NeXus" << std::endl;
std::cout << std::endl;
}
//--------------------------------------------------------------------------
/**
* <p> check if the requested format is supported.
*
* @param format requested format string
*
* @return true if supported, false otherwise
*/
bool addRun_checkFormat(std::string &format) {
bool result = false;
boost::to_lower(format);
if (format == "psi-bin")
format = "psibin";
if (format == "psi-mud")
format = "psimdu";
if (format == "musrroot") {
result = true;
} else if (format == "psibin") {
result = true;
} else if (format == "psimdu") {
result = true;
} else if (format == "mud") {
result = true;
} else if (format == "nexus") {
result = true;
} else if (format == "root") {
result = true;
}
return result;
}
//--------------------------------------------------------------------------
/**
* <p>Reads the inputFile to extract the necessary information.
* @param fileName
* @param infoVec
* @return
*/
bool addRun_readInputFiles(const std::string fileName, std::vector<PAddRunInfo> &infoVec)
{
PAddRunInfo info;
char buf[256], str[256];
std::ifstream fin(fileName.c_str(), std::ifstream::in);
std::string line;
char *tok{nullptr};
int status, ival;
bool lastWasFile{false};
while (fin.good()) {
fin.getline(buf, 256);
line = buf;
boost::trim_left(line);
if (line.empty())
continue;
if (line[0] == '%')
continue;
strcpy(buf, line.c_str());
tok = strtok(buf, " ");
if (!strcmp(tok, "file")) {
if (lastWasFile) {
infoVec.push_back(info);
info.fPathFileName = "";
info.fT0.clear();
}
tok = strtok(NULL, " ");
if (tok == NULL) {
std::cerr << std::endl;
std::cerr << "**ERROR** found label 'file' without argument." << std::endl;
std::cerr << std::endl;
fin.close();
return false;
}
info.fPathFileName = tok;
lastWasFile = true;
} else if (!strcmp(tok, "t0")) {
while ((tok = strtok(NULL, ",")) != NULL) {
status = sscanf(tok, "%d%s", &ival, str);
if (status != 1) {
std::cerr << std::endl;
std::cerr << "**ERROR** found t0 argument '" << tok << "' which is not a number." << std::endl;
std::cerr << std::endl;
fin.close();
return false;
}
info.fT0.push_back(ival);
}
} else {
std::cerr << std::endl;
std::cerr << "**ERROR** found unrecognized token '" << tok << "'." << std::endl;
std::cerr << std::endl;
fin.close();
return false;
}
}
infoVec.push_back(info);
fin.close();
// checks
for (int i=0; i<infoVec.size(); i++) {
if (infoVec[i].fPathFileName.empty()) {
std::cerr << std::endl;
std::cerr << "**ERROR** something is wrong with the inputFile. Found empty pathName." << std::endl;
std::cerr << std::endl;
return false;
}
}
return true;
}
//--------------------------------------------------------------------------
/**
* <p>Automatically determines the t0-bin. This assumes that there is a
* prompt peak in the data!
*
* @param vec histo data
* @return maximum of the histo data
*/
UInt_t addRun_getPromptPeakPos(PDoubleVector *vec)
{
UInt_t pos=0;
Double_t max=vec->at(0);
for (UInt_t i=0; i<vec->size(); i++) {
if (max < vec->at(i)) {
max = vec->at(i);
pos = i;
}
}
return pos;
}
//--------------------------------------------------------------------------
/**
* <p>Filters the t0 arguments. Allowed is a comma separeted list of
* integers > -2.
*
* @param argc argument counter
* @param argv argument list
* @param idx argument index from which to start
* @param t0 vector
*
* @return true on success, false otherwise
*/
bool addRun_filter_t0(int argc, char *argv[], int &idx, PIntVector &t0)
{
int pos{idx}, status, ival;
PIntVector tt0;
// collect run list string from input
for (int i=idx; i<argc; i++) {
pos = i;
if ((argv[i][0] == '-') && isalpha(argv[i][1])) { // next command
pos = i-1;
break;
} else {
status = sscanf(argv[i], "%d", &ival);
if (status != 1) {
std::cerr << std::endl;
std::cerr << "**ERROR** found t0 value '" << argv[i] << "' which is not an integer." << std::endl;
std::cerr << std::endl;
return false;
}
tt0.push_back(ival);
}
}
// make sure that t0's > -2
for (int i=0; i<tt0.size(); i++) {
if (tt0[i] <= -2) {
std::cerr << std::endl;
std::cerr << "**ERROR** found t0 value '" << tt0[i] << "' which is out-of-range." << std::endl;
std::cerr << std::endl;
return false;
}
}
idx = pos;
t0 = tt0;
return true;
}
//--------------------------------------------------------------------------
/**
* <p>Filters the runList arguments. Allowed are: (i) run1 run2 ... runN
* (ii) runStart-runEnd, and (iii) runStart:runEnd:step
*
* @param argc argument counter
* @param argv argument list
* @param idx argument index from which to start
* @param runList vector
*
* @return true on success, false otherwise
*/
bool addRun_filter_runList(int argc, char *argv[], int &idx, PUIntVector &runList)
{
int pos{idx};
std::string runStr{""};
// collect run list string from input
for (int i=idx; i<argc; i++) {
pos = i;
if ((argv[i][0] == '-') && isalpha(argv[i][1])) { // next command
pos = i-1;
break;
} else {
runStr += argv[i];
runStr += " ";
}
}
// extract run list from string
PStringNumberList rl(runStr);
std::string errMsg{""};
if (!rl.Parse(errMsg)) {
std::cerr << "**ERROR** in run list: -rl " << runStr << std::endl;
std::cerr << errMsg << std::endl;
return false;
}
runList = rl.GetList();
idx = pos;
return true;
}
//--------------------------------------------------------------------------
/**
* <p>addRun is used to add various runs.
*
* @param argc number of input arguments
* @param argv list of input arguments
*
* @return PMUSR_SUCCESS if everthing went smooth, otherwise and error number
*/
int main(int argc, char *argv[])
{
// check for --help or --version
if (argc == 2) {
if (!strncmp(argv[1], "--help", 128) || !strncmp(argv[1], "-h", 128)) {
addRun_syntax();
return PMUSR_SUCCESS;
} else if (!strncmp(argv[1], "--version", 128) || !strncmp(argv[1], "-v", 128)) {
#ifdef HAVE_CONFIG_H
#ifdef HAVE_GIT_REV_H
std::cout << std::endl << "addRun 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 << "addRun version: " << PACKAGE_VERSION << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#endif
#else
#ifdef HAVE_GIT_REV_H
std::cout << std::endl << "addRun git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#else
std::cout << std::endl << "addRun version: unkown." << std::endl << std::endl;
#endif
#endif
return PMUSR_SUCCESS;
} else {
std::cerr << std::endl;
std::cerr << "**ERROR** missing required input." << std::endl;
std::cerr << std::endl;
addRun_syntax();
return -1;
}
}
// filter arguments
PIntVector t0;
Int_t ival;
UInt_t yearNum{0};
std::string flnOut{""};
std::string format{""}, year{""}, instrument{""}, dev{"tdc"};
PUIntVector runList;
std::string inputFln{""};
int status;
std::vector<PAddRunInfo> addRunInfo;
for (int i=1; i<argc; i++) {
if (!strcmp(argv[i], "-t0")) {
if (i+1 >= argc) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -t0 without value." << std::endl;
std::cerr << std::endl;
return -1;
}
// deal with run-list here
int idx=i+1;
if (!addRun_filter_t0(argc, argv, idx, t0)) {
return -2;
}
i=idx;
} else if (!strcmp(argv[i], "-f")) {
if (i+1 >= argc) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -f without argument." << std::endl;
std::cerr << std::endl;
return -1;
}
format = argv[i+1];
if (!addRun_checkFormat(format)) {
format = "";
std::cerr << std::endl;
std::cerr << "**ERROR** found -f with unsupported format: '" << format << "'" << std::endl;
std::cerr << std::endl;
return -2;
}
i++;
} else if (!strcmp(argv[i], "-y")) {
if (i+1 >= argc) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -y without value." << std::endl;
std::cerr << std::endl;
return -1;
}
status = sscanf(argv[i+1], "%d", &ival);
if (status != 1) {
std::cerr << std::endl;
std::cerr << "**ERROR** found invalid -y value: " << argv[i+1] << "." << std::endl;
std::cerr << std::endl;
return -2;
}
if (1900 - ival > 0) {
std::cerr << std::endl;
std::cerr << "**ERROR** found invalid -y value: " << argv[i+1] << "." << std::endl;
std::cerr << " Format has to be YYYY." << std::endl;
std::cerr << std::endl;
return -2;
}
yearNum = ival;
year = argv[i+1];
i++;
} else if (!strcmp(argv[i], "-i")) {
if (i+1 >= argc) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -i without argument." << std::endl;
std::cerr << std::endl;
return -1;
}
instrument = argv[i+1];
boost::to_lower(instrument);
i++;
} else if (!strcmp(argv[i], "-m")) {
if (i+1 >= argc) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -m without argument." << std::endl;
std::cerr << std::endl;
return -1;
}
std::string str(argv[i+1]);
boost::to_lower(str);
if ((str != "pta") && (str != "tdc")) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -m with unsupported argument '" << argv[i+1] << "'. Possible arguments are 'pta' or 'tdc'." << std::endl;
std::cerr << std::endl;
return -2;
}
dev = str;
i++;
} else if (!strcmp(argv[i], "-o")) {
if (i+1 >= argc) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -o without argument." << std::endl;
std::cerr << std::endl;
return -1;
}
flnOut = argv[i+1];
i++;
} else if (!strcmp(argv[i], "-rl")) {
if (i+1 >= argc) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -rl without argument." << std::endl;
std::cerr << std::endl;
return -1;
}
// deal with run-list here
int idx=i+1;
if (!addRun_filter_runList(argc, argv, idx, runList)) {
return -2;
}
i=idx;
} else if (!strcmp(argv[i], "-in")) {
if (i+1 >= argc) {
std::cerr << std::endl;
std::cerr << "**ERROR** found -in without argument." << std::endl;
std::cerr << std::endl;
return -1;
}
inputFln = argv[i+1];
i++;
} else { // error
std::cerr << std::endl;
std::cerr << "**ERROR** found unexpected command line element '" << argv[i] << "'" << std::endl;
std::cerr << std::endl;
addRun_syntax();
return -1;
}
}
// test for usage1 or usage2
if (inputFln.empty() && (runList.size() == 0)) {
std::cerr << std::endl;
std::cerr << "**ERROR** essential input for usage1 and usage2 is missing." << std::endl;
std::cerr << std::endl;
addRun_syntax();
return -3;
}
if (!inputFln.empty() && (runList.size() > 0)) {
std::cerr << std::endl;
std::cerr << "**ERROR** cannot decide if usage1 or usage2." << std::endl;
std::cerr << std::endl;
addRun_syntax();
return -3;
}
// read startup file
char startup_path_name[128];
TSAXParser *saxParser = new TSAXParser();
PStartupHandler *startupHandler = new PStartupHandler();
if (!startupHandler->StartupFileFound()) {
std::cerr << std::endl << ">> addRun **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data();
std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
} else {
strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data());
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
//status = saxParser->ParseFile(startup_path_name);
// parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PStartupHandler.cpp for the definition)
status = parseXmlFile(saxParser, startup_path_name);
// check for parse errors
if (status) { // error
std::cerr << std::endl << ">> addRun **WARNING** Reading/parsing musrfit_startup.xml failed.";
std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
} else {
startupHandler->CheckLists();
}
}
// additional tests needed for usage1 (currently for PSI use only)
if (runList.size() > 0) {
if (t0.empty()) {
std::cout << ">> t0 not provided.";
} else {
std::cout << ">> t0: ";
for (int i=0; i<t0.size(); i++)
std::cout << t0[i] << ", ";
}
std::cout << std::endl;
std::cout << ">> format: " << format << std::endl;
std::cout << ">> year: " << year << std::endl;
std::cout << ">> instrument: " << instrument << std::endl;
std::cout << ">> fln out: " << flnOut << std::endl;
std::cout << ">> runList: ";
for (int i=0; i<runList.size(); i++)
std::cout << runList[i] << ", ";
std::cout << std::endl;
PAddRunInfo addRun;
addRun.fT0 = t0;
addRun.fFileFormat = format;
// construct file names
for (int i=0; i<runList.size(); i++) {
PFindRun findRun(startupHandler->GetDataPathList(), startupHandler->GetRunNameTemplateList(), instrument, yearNum, runList[i]);
if (findRun.FoundPathName()) {
std::cout << ">> found path name: " << findRun.GetPathName() << std::endl;
addRun.fPathFileName = findRun.GetPathName();
addRunInfo.push_back(addRun);
} else {
std::cout << "**WARNING** run: " << runList[i] << " for instrument '" << instrument << "' and year '" << year << "' not found" << std::endl;
}
}
}
// additional tests needed for usage2
if (!inputFln.empty()) {
// check if file exists
if (!boost::filesystem::exists(inputFln)) {
std::cerr << std::endl;
std::cerr << "**ERROR** file '" << inputFln << "' seems not to exist." << std::endl;
std::cerr << std::endl;
return -1;
}
// read input-file and data sets
if (!addRun_readInputFiles(inputFln, addRunInfo)) {
return -2;
}
}
for (int i=0; i<addRunInfo.size(); i++) {
std::cout << ">> run " << i+1 << ": " << std::endl;
std::cout << ">> fln : " << addRunInfo[i].fPathFileName << std::endl;
if (addRunInfo[i].fT0.empty()) {
std::cout << ">> t0 not provided.";
} else {
std::cout << ">> t0: ";
for (int j=0; j<addRunInfo[i].fT0.size(); j++) {
std::cout << addRunInfo[i].fT0[j] << ", ";
}
}
std::cout << std::endl;
}
// load the files
std::vector<PRunDataHandler*> runDataHandler;
runDataHandler.resize(addRunInfo.size());
Bool_t isGood{true};
for (UInt_t i=0; i<runDataHandler.size(); i++) {
if (startupHandler != nullptr) {
runDataHandler[i] = new PRunDataHandler(addRunInfo[i].fPathFileName, addRunInfo[i].fFileFormat, startupHandler->GetDataPathList());
if (runDataHandler[i] == nullptr) {
isGood = false;
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PRunDataHandler (i=" << i << ")." << std::endl;
std::cerr << std::endl;
break;
}
runDataHandler[i]->ReadData();
if (!runDataHandler[i]->IsAllDataAvailable()) {
isGood = false;
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't read data for PRunDataHandler (i=" << i << ")." << std::endl;
std::cerr << std::endl;
break;
}
} else {
runDataHandler[i] = new PRunDataHandler(addRunInfo[i].fPathFileName, addRunInfo[i].fFileFormat);
if (runDataHandler[i] == nullptr) {
isGood = false;
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PRunDataHandler (i=" << i << ")." << std::endl;
std::cerr << std::endl;
break;
}
runDataHandler[i]->ReadData();
if (!runDataHandler[i]->IsAllDataAvailable()) {
isGood = false;
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't read data for PRunDataHandler (i=" << i << ")." << std::endl;
std::cerr << std::endl;
break;
}
}
}
// make sure that the number of provided t0's are matching the number of histos from the run-file
// 1st make sure all the runs have the same number run data (==1 here)
PAny2ManyInfo *info{nullptr};
PRunDataHandler *dataOut{nullptr};
if (isGood) {
for (UInt_t i=1; i<runDataHandler.size(); i++) {
if (runDataHandler[0]->GetNoOfRunData() != runDataHandler[i]->GetNoOfRunData()) {
isGood = false;
std::cerr << std::endl;
std::cerr << "**ERROR** can only handle same number of run data per run handler." << std::endl;
std::cerr << std::endl;
break;
}
}
info = new PAny2ManyInfo();
if (info == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PAny2ManyInfo." << std::endl;
std::cerr << std::endl;
isGood = false;
}
}
if (isGood) {
// prepare for the new added run data sets
info->outFormat = format;
info->year = year;
info->outFileName = flnOut;
dataOut = new PRunDataHandler(info);
if (dataOut == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PRunDataHandler for the output file." << std::endl;
std::cerr << std::endl;
isGood = false;
}
}
if (isGood) {
// check that all runs have the same number of histograms
for (UInt_t i=1; i<runDataHandler.size(); i++) {
if (runDataHandler[0]->GetRunData()->GetNoOfHistos() != runDataHandler[0]->GetRunData()->GetNoOfHistos()) {
std::cerr << std::endl;
std::cerr << "**ERROR** can only add runs with the same number of histograms." << std::endl;
std::cerr << std::endl;
isGood = false;
}
}
}
if (isGood) {
// add all the runs
// take first run as the reference for the data
std::vector<PDoubleVector*> addedHistos;
addedHistos.resize(runDataHandler[0]->GetRunData()->GetNoOfHistos());
for (UInt_t i=0; i<runDataHandler[0]->GetRunData()->GetNoOfHistos(); i++) {
addedHistos[i] = runDataHandler[0]->GetRunData()->GetDataSet(i, false)->GetData();
}
// get the t0's for all the reference histos
PIntVector t0Vec;
t0Vec.resize(runDataHandler[0]->GetRunData()->GetNoOfHistos());
if (addRunInfo[0].fT0.empty()) { // i.e. take t0's from data file
for (UInt_t i=0; i<runDataHandler[0]->GetRunData()->GetNoOfHistos(); i++) {
t0Vec[i] = runDataHandler[0]->GetRunData()->GetT0Bin(i+1);
}
addRunInfo[0].fT0 = t0Vec;
} else { // t0 vector present
// make sure that the number of t0's fit the number of histos
if (addRunInfo[0].fT0.size() < runDataHandler[0]->GetRunData()->GetNoOfHistos()) {
UInt_t counts=runDataHandler[0]->GetRunData()->GetNoOfHistos()-addRunInfo[0].fT0.size();
for (UInt_t i=0; i<counts; i++)
addRunInfo[0].fT0.push_back(0);
}
// check t0 data
for (UInt_t i=0; i<addRunInfo[0].fT0.size(); i++) {
if (addRunInfo[0].fT0[i] == 0) { // get t0 from file
addRunInfo[0].fT0[i] = runDataHandler[0]->GetRunData()->GetT0Bin(i+1);
} else if (addRunInfo[0].fT0[i] == -1) { // get t0 from prompt peak
addRunInfo[0].fT0[i] = addRun_getPromptPeakPos(runDataHandler[0]->GetRunData()->GetDataSet(i, false)->GetData());
}
}
}
// loop over the remaining runs, determine t0's if needed and add the data
for (int i=1; i<runDataHandler.size(); i++) {
// get the t0's for all the histos of a run to be added
PIntVector t0Vec;
t0Vec.resize(runDataHandler[i]->GetRunData()->GetNoOfHistos());
if (addRunInfo[i].fT0.empty()) { // i.e. take t0's from data file
for (UInt_t j=0; j<runDataHandler[i]->GetRunData()->GetNoOfHistos(); j++) {
t0Vec[j] = runDataHandler[i]->GetRunData()->GetT0Bin(j+1);
}
addRunInfo[i].fT0 = t0Vec;
} else { // t0 vector present
// make sure that the number of t0's fit the number of histos
if (addRunInfo[i].fT0.size() < runDataHandler[i]->GetRunData()->GetNoOfHistos()) {
UInt_t counts=runDataHandler[i]->GetRunData()->GetNoOfHistos()-addRunInfo[i].fT0.size();
for (UInt_t j=0; j<counts; j++)
addRunInfo[i].fT0.push_back(0);
}
// check t0 data
for (UInt_t j=0; j<addRunInfo[i].fT0.size(); j++) {
if (addRunInfo[i].fT0[j] == 0) { // get t0 from file
addRunInfo[i].fT0[j] = runDataHandler[i]->GetRunData()->GetT0Bin(j+1);
} else if (addRunInfo[i].fT0[j] == -1) { // get t0 from prompt peak
addRunInfo[i].fT0[j] = addRun_getPromptPeakPos(runDataHandler[i]->GetRunData()->GetDataSet(j, false)->GetData());
}
}
}
// calculate the offset due to potential differences in t0's between runs
PIntVector diff;
diff.resize(addRunInfo[i].fT0.size());
for (UInt_t j=0; j<diff.size(); j++) {
diff[j] = addRunInfo[i].fT0[j] - addRunInfo[0].fT0[j];
}
// add all the to be added histos of all remaining runs
PDoubleVector *addData{nullptr};
Int_t idx;
for (int j=0; j<runDataHandler[i]->GetRunData()->GetNoOfHistos(); j++) { // loop over all histos
addData = runDataHandler[i]->GetRunData()->GetDataSet(j, false)->GetData();
for (int k=0; k<addedHistos[j]->size(); k++) { // loop over all elements of a histo
idx = k + diff[j];
if ((idx >= 0) && (idx < addData->size())) {
addedHistos[j]->at(k) += addData->at(idx);
}
}
}
}
// feed all the necessary information for the data file
PRawRunData *rawRunData = new PRawRunData();
rawRunData = runDataHandler[0]->GetRunData(); // copy all
rawRunData->SetGenerator("addRun");
// overwrite the t0 values with the new ones
for (UInt_t i=0; i<rawRunData->GetNoOfHistos(); i++) {
rawRunData->GetDataSet(i, false)->SetTimeZeroBin(addRunInfo[0].fT0[i]);
}
// write histos
for (UInt_t i=0; i<rawRunData->GetNoOfHistos(); i++) {
rawRunData->GetDataSet(i, false)->SetData(*addedHistos[i]);
}
// feed run data handler with new data
if (dataOut->SetRunData(rawRunData)) {
// write output file
dataOut->WriteData();
}
}
// clean up
if (startupHandler) {
delete startupHandler;
}
if (info) {
delete info;
}
if (dataOut) {
delete dataOut;
}
for (int i=0; i<runDataHandler.size(); i++) {
if (runDataHandler[i])
delete runDataHandler[i];
}
runDataHandler.clear();
return PMUSR_SUCCESS;
}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -41,7 +41,10 @@
#include <TString.h>
#include <TSAXParser.h>
#ifdef HAVE_GIT_REV_H
#include "git-revision.h"
#endif
#include "PMusr.h"
#include "PStartupHandler.h"
#include "PRunDataHandler.h"
@ -63,9 +66,12 @@ void any2many_syntax()
std::cout << std::endl << " e.g. 2010/lem10_his_0111.root 2010/lem10_his_0112.root";
std::cout << std::endl << " -o <outputFileName> : this option only makes sense, if <filenameList-input>";
std::cout << std::endl << " is a single input file name!";
std::cout << std::endl << " -r <runList-input> : where <runList-input> is a list of run numbers";
std::cout << std::endl << " separated by spaces ' ' of the form: <run1> <run2> <run3>";
std::cout << std::endl << " etc., or a sequence of runs <runStart>-<runEnd>, e.g. 111-222";
std::cout << std::endl << " -r <runList-input> : can be:";
std::cout << std::endl << " (i) <run0>, <run1>, <run2>, ... <runN> : run numbers, e.g. 123 124";
std::cout << std::endl << " (ii) <run0>-<runN> : a range, e.g. 123-125 -> 123 124 125";
std::cout << std::endl << " (iii) <run0>:<runN>:<step> : a sequence, e.g. 123:127:2 -> 123 125 127";
std::cout << std::endl << " <step> will give the step width and has to be a positive number!";
std::cout << std::endl << " a <runList> can also combine (i)-(iii), e.g. 123 128-130 133, etc.";
std::cout << std::endl << " -t <in-template> <out-template> : ";
std::cout << std::endl << " <in-/out-template> : template file name. Needed for run-lists in";
std::cout << std::endl << " order to generate the proper file names. The following template";
@ -197,9 +203,17 @@ 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;
#ifdef HAVE_GIT_REV_H
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 version: " << PACKAGE_VERSION << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#endif
#else
#ifdef HAVE_GIT_REV_H
std::cout << std::endl << "any2many git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#else
std::cout << std::endl << "any2many version: unkown." << std::endl << std::endl;
#endif
#endif
} else {
any2many_syntax();
@ -269,34 +283,30 @@ int main(int argc, char *argv[])
}
} else if (!strcmp(argv[i], "-r")) {
if (i+1 < argc) {
// first check for run list sequence of the form <runStartNo>-<runEndNo>
int startNo, endNo;
status = sscanf(argv[i+1], "%d-%d", &startNo, &endNo);
if (status == 2) { // this is run list sequence
if (endNo < startNo) {
ival = startNo;
startNo = endNo;
endNo = ival;
}
for (int j=startNo; j<=endNo; j++)
info.runList.push_back(j);
i++;
} else { // check for run list of the form <run1> <run2> ... <runN>
bool done = false;
int j = i+1;
do {
status = sscanf(argv[j], "%d", &ival);
if (status == 1) {
info.runList.push_back(ival);
j++;
} else {
done = true;
}
} while (!done && (j<argc));
i = j-1;
if (j >= argc) // make sure that counter is still in range
int pos{i+1};
std::string runStr{""};
// collect run list string from input
for (int j=i+1; j<argc; j++) {
pos = j;
if ((argv[j][0] == '-') && isalpha(argv[j][1])) { // next command
pos = j-1;
break;
} else {
runStr += argv[j];
runStr += " ";
}
}
// extract run list from string
PStringNumberList rl(runStr);
std::string errMsg{""};
if (!rl.Parse(errMsg)) {
std::cerr << "**ERROR** in run list: -rl " << runStr << std::endl;
std::cerr << errMsg << std::endl;
return PMUSR_WRONG_STARTUP_SYNTAX;
}
info.runList = rl.GetList();
// move the argument counter to the proper position
i = pos;
} else {
std::cerr << std::endl << ">> any2many **ERROR** found input option '-r' without any arguments" << std::endl;
show_syntax = true;

View File

@ -1,4 +1,4 @@
#--- build the PMusr and PUserFcnBase libs ------------------------------------
#--- build the PMusr, PUserFcnBase, and PRgeHandler libs ----------------------
#--- generate necessary dictionaries ------------------------------------------
set(MUSRFIT_INC ${CMAKE_SOURCE_DIR}/src/include)
@ -12,7 +12,7 @@ root_generate_dictionary(
PFourierCanvas.h
OPTIONS
-I${MUSRFIT_INC}
-I${FFTW3_INCLUDE_DIR}
-I${FFTW3_INCLUDE}
-inlineInputHeader
LINKDEF ${MUSRFIT_INC}/PFourierCanvasLinkDef.h
MODULE PFourierCanvas
@ -22,7 +22,7 @@ root_generate_dictionary(
PMusrCanvas.h
LINKDEF ${MUSRFIT_INC}/PMusrCanvasLinkDef.h
OPTIONS
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE_DIR} -I${MUSRFIT_INC}
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-inlineInputHeader
MODULE PMusrCanvas
)
@ -31,7 +31,7 @@ root_generate_dictionary(
PMusrT0.h
LINKDEF ${MUSRFIT_INC}/PMusrT0LinkDef.h
OPTIONS
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE_DIR} -I${MUSRFIT_INC}
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-inlineInputHeader
MODULE PMusrT0
)
@ -40,7 +40,7 @@ root_generate_dictionary(
PStartupHandler.h
LINKDEF ${MUSRFIT_INC}/PStartupHandlerLinkDef.h
OPTIONS
-I${FFTW3_INCLUDE_DIR} -I${MUSRFIT_INC}
-I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
-inlineInputHeader
MODULE PStartupHandler
)
@ -50,9 +50,22 @@ root_generate_dictionary(
LINKDEF ${MUSRFIT_INC}/PUserFcnBaseLinkDef.h
OPTIONS
-inlineInputHeader
-I${FFTW3_INCLUDE_DIR} -I${MUSRFIT_INC}
-I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
MODULE PUserFcnBase
)
root_generate_dictionary(
PRgeHandlerDict
PRgeHandler.h
OPTIONS
-I${NONLOCAL_INC}
-I${MUSRFIT_INC}
-I${FFTW3_INCLUDE}
-I${CMAKE_CURRENT_SOURCE_DIR}
-inlineInputHeader
LINKDEF ${MUSRFIT_INC}/PRgeHandlerLinkDef.h
MODULE PRgeHandler
)
#--- create pkg-config info ---------------------------------------------------
set(prefix "${CMAKE_INSTALL_PREFIX}")
@ -64,9 +77,12 @@ set(MUSR_LIBRARY_NAME "PMusr")
configure_file("PMusr.pc.in" "PMusr.pc" @ONLY)
set(USERFCN_LIBRARY_NAME "PUserFcnBase")
configure_file("PUserFcnBase.pc.in" "PUserFcnBase.pc" @ONLY)
set(PRGEHANDLER_LIBRARY_NAME "PRgeHandler")
configure_file("PRgeHandler.pc.in" "PRgeHandler.pc" @ONLY)
#--- lib creation -------------------------------------------------------------
add_library(PMusr SHARED
PFindRun.cpp
PFitter.cpp
PFitterFcn.cpp
PFourier.cpp
@ -102,7 +118,7 @@ add_library(PMusr SHARED
target_include_directories(
PMusr BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
$<BUILD_INTERFACE:${MUSRFIT_INC}>
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/MusrRoot>
@ -117,6 +133,11 @@ add_library(PUserFcnBase SHARED
PUserFcnBaseDict.cxx
)
add_library(PRgeHandler SHARED
PRgeHandler.cpp
PRgeHandlerDict.cxx
)
#--- set target properties, e.g. version --------------------------------------
set_target_properties(PMusr
PROPERTIES
@ -126,11 +147,28 @@ set_target_properties(PUserFcnBase
PROPERTIES
VERSION ${MUSR_VERSION}
)
set_target_properties(PRgeHandler
PROPERTIES
VERSION ${MUSR_VERSION}
)
#--- make sure that the include directory is found ----------------------------
target_include_directories(
PUserFcnBase BEFORE PRIVATE $<BUILD_INTERFACE:${MUSRFIT_INC}>
PUserFcnBase BEFORE PRIVATE
$<BUILD_INTERFACE:${MUSRFIT_INC}>
)
target_include_directories(
PRgeHandler BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<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})
@ -138,7 +176,8 @@ endif (OpenMP_FOUND)
#--- add library dependencies -------------------------------------------------
set(DependOnLibs ${ROOT_LIBARIES})
set(DependOnLibs ${DependOnLibs} ${FFTW3_LIBRARY})
#set(DependOnLibs ${DependOnLibs} ${FFTW3_LIBRARY})
set(DependOnLibs ${DependOnLibs} FFTW3::FFTW3)
set(DependOnLibs ${DependOnLibs} PUserFcnBase)
set(DependOnLibs ${DependOnLibs} mud)
set(DependOnLibs ${DependOnLibs} TMusrRunHeader)
@ -157,11 +196,15 @@ if (OpenMP_FOUND)
endif (OpenMP_FOUND)
target_link_libraries(PUserFcnBase ${ROOT_LIBRARIES})
target_link_libraries(PMusr ${DependOnLibs})
target_link_libraries(PRgeHandler ${Boost_LIBRARIES} ${ROOT_LIBRARIES})
target_link_libraries(PMusr ${Boost_LIBRARIES} ${DependOnLibs})
#--- install PUserFcnBase solib -----------------------------------------------
install(TARGETS PUserFcnBase DESTINATION lib)
#--- install PRgeHandler solib -----------------------------------------------
install(TARGETS PRgeHandler DESTINATION lib)
#--- install PMusr solib ------------------------------------------------------
install(TARGETS PMusr DESTINATION lib)
@ -173,6 +216,8 @@ install(
${CMAKE_CURRENT_BINARY_DIR}/libPMusrCanvas.rootmap
${CMAKE_CURRENT_BINARY_DIR}/libPMusrT0_rdict.pcm
${CMAKE_CURRENT_BINARY_DIR}/libPMusrT0.rootmap
${CMAKE_CURRENT_BINARY_DIR}/libPRgeHandler_rdict.pcm
${CMAKE_CURRENT_BINARY_DIR}/libPRgeHandler.rootmap
${CMAKE_CURRENT_BINARY_DIR}/libPStartupHandler_rdict.pcm
${CMAKE_CURRENT_BINARY_DIR}/libPStartupHandler.rootmap
${CMAKE_CURRENT_BINARY_DIR}/libPUserFcnBase_rdict.pcm
@ -195,6 +240,7 @@ install(
${MUSRFIT_INC}/PMusr.h
${MUSRFIT_INC}/PMusrT0.h
${MUSRFIT_INC}/PPrepFourier.h
${MUSRFIT_INC}/PRgeHandler.h
${MUSRFIT_INC}/PRunAsymmetry.h
${MUSRFIT_INC}/PRunAsymmetryBNMR.h
${MUSRFIT_INC}/PRunAsymmetryRRF.h
@ -214,6 +260,7 @@ install(
#--- install pkg-config info --------------------------------------------------
install(
FILES ${CMAKE_CURRENT_BINARY_DIR}/PUserFcnBase.pc
${CMAKE_CURRENT_BINARY_DIR}/PRgeHandler.pc
${CMAKE_CURRENT_BINARY_DIR}/PMusr.pc
DESTINATION lib/pkgconfig
)

149
src/classes/PFindRun.cpp Normal file
View File

@ -0,0 +1,149 @@
/***************************************************************************
PFindRun.cpp
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2022 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 <iostream>
#include <boost/filesystem.hpp>
#include "PFindRun.h"
//----------------------------------------------------------------------------
/**
* @brief PFindRun::PFindRun
* @param runNameTemplateList
*/
PFindRun::PFindRun(const PStringVector path, const PRunNameTemplateList runNameTemplateList) :
fPath(path), fRunNameTemplateList(runNameTemplateList)
{
// nothing to be done here
}
//----------------------------------------------------------------------------
/**
* @brief PFindRun::PFindRun
*
* @param path
* @param runNameTemplateList
* @param instrument
* @param year
* @param run
*/
PFindRun::PFindRun(const PStringVector path, const PRunNameTemplateList runNameTemplateList,
const TString &instrument, const UInt_t year, const UInt_t run) :
fPath(path), fRunNameTemplateList(runNameTemplateList), fInstrument(instrument), fYear(year), fRun(run)
{
// nothing to be done here
}
//----------------------------------------------------------------------------
/**
* @brief PFindRun::DumpTemplateList
*/
void PFindRun::DumpTemplateList()
{
std::cout << "debug> instrument: " << fInstrument << std::endl;
std::cout << "debug> year: " << fYear << std::endl;
std::cout << "debug> run: " << fRun << std::endl;
std::cout << "debug> ++++" << std::endl;
std::cout << "debug> run name template list:" << std::endl;
for (UInt_t i=0; i<fRunNameTemplateList.size(); i++) {
std::cout << i << ": instrument: " << fRunNameTemplateList[i].instrument << ", template: " << fRunNameTemplateList[i].runNameTemplate << std::endl;
}
std::cout << "debug> ++++" << std::endl;
}
//----------------------------------------------------------------------------
/**
* @brief PFindRun::CreatePathName
* @param path
* @param runNameTemplate
* @return
*/
TString PFindRun::CreatePathName(const TString path, const TString runNameTemplate)
{
TString pathName{""};
TString runName = runNameTemplate;
TString yearStr = TString::Format("%d", fYear);
TString yyStr;
if (fYear < 2000)
yyStr = TString::Format("%02d", fYear-1900);
else
yyStr = TString::Format("%02d", fYear-2000);
runName.ReplaceAll("%yyyy%", yearStr);
runName.ReplaceAll("%yy%", yyStr);
// run handling slightly more complicated, since various number of digits possible
Int_t idx=-1;
TString rr{""};
for (Int_t i=2; i<10; i++) {
rr ="%";
for (Int_t j=0; j<i; j++)
rr += "r";
rr += "%";
if (runName.Index(rr) != -1) {
idx = i;
break;
}
}
TString format = TString::Format("%%0%dd", idx);
TString runStr = TString::Format(format, fRun);
if (idx != -1)
runName.ReplaceAll(rr, runStr);
pathName = path;
pathName += "/";
pathName += runName;
return pathName;
}
//----------------------------------------------------------------------------
/**
* @brief PFindRun::FoundPathName
* @return
*/
Bool_t PFindRun::FoundPathName()
{
// find instrument name in path list
TString pathName{""};
for (Int_t i=0; i<fPath.size(); i++) {
if (fPath[i].Index(fInstrument) != -1) {
for (Int_t j=0; j<fRunNameTemplateList.size(); j++) {
if (fRunNameTemplateList[j].instrument == fInstrument) {
pathName = CreatePathName(fPath[i], fRunNameTemplateList[j].runNameTemplate);
if (boost::filesystem::exists(pathName.Data())) {
fPathName = pathName;
return true;
}
}
}
}
}
return false;
}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -313,6 +313,9 @@ PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bo
return;
}
// create phase bool array
GetPhaseParams();
// create fit function object
fFitterFcn = new PFitterFcn(runListCollection, fUseChi2);
if (!fFitterFcn) {
@ -346,6 +349,209 @@ PFitter::~PFitter()
}
}
//--------------------------------------------------------------------------
// GetPhaseParams (private)
//--------------------------------------------------------------------------
/**
* <p>Checks which parameters are phases. This information is needed to
* restrict the phases to the intervall -360 to +360 degrees.
*/
void PFitter::GetPhaseParams()
{
fPhase.resize(fRunInfo->GetNoOfParams());
for (unsigned int i=0; i<fPhase.size(); i++)
fPhase[i] = false;
// analyze theory block for parameters. Phases are present in the following
// default functions:
// user functions cannot be checked!
PMsrLines *theo = fRunInfo->GetMsrTheory();
TObjArray *tok = nullptr;
TObjString *ostr = nullptr;
TString str;
int pos = -1;
for (unsigned int i=0; i<theo->size(); i++) {
pos = -1;
TString line = theo->at(i).fLine;
if (line.Contains("TFieldCos") || line.Contains("tf ") ||
line.Contains("bessel") || line.Contains("b ") ||
line.Contains("skewedGss") || line.Contains("skg ") ||
line.Contains("staticNKTF") || line.Contains("snktf ") ||
line.Contains("dynamicNKTF") || line.Contains("dnktf ")) { // phase is 1st param
pos = 1;
}
if (line.Contains("internFld") || line.Contains("if ") ||
line.Contains("internBsl") || line.Contains("ib ")) { // phase is 2nd param
pos = 2;
}
if (line.Contains("muMinusExpTF") || line.Contains("mmsetf ")) { // phase is 5th param
pos = 5;
}
if (pos == -1)
continue;
// extract phase token
tok = line.Tokenize(" \t");
if (tok == nullptr) {
std::cerr << "PFitter::GetPhaseParams(): **ERROR** couldn't tokenize theory line string." << std::endl;
return;
}
if (tok->GetEntries() > pos) {
ostr = dynamic_cast<TObjString*>(tok->At(pos));
str = ostr->GetString();
}
// clean up
delete tok;
tok = nullptr;
// decode phase token. It can be funX, mapX, or a number
if (str.Contains("fun")) { // function
PIntVector parVec = GetParFromFun(str);
for (int i=0; i<parVec.size(); i++) {
if (parVec[i] <= fRunInfo->GetNoOfParams())
fPhase[parVec[i]-1] = true;
}
} else if (str.Contains("map")) { // map
PIntVector parVec = GetParFromMap(str);
for (int i=0; i<parVec.size(); i++) {
if (parVec[i] <= fRunInfo->GetNoOfParams())
fPhase[parVec[i]-1] = true;
}
} else { // must be a number
int idx = str.Atoi();
if (idx == 0) { // something went wrong, str is not an integer
std::cerr << "PFitter::GetPhaseParams(): **ERROR** str=" << str.View() << " is not an integer!" << std::endl;
return;
}
idx -= 1; // param start at 1, vector at 0
if (idx >= fRunInfo->GetNoOfParams()) { // idx is out-of-range
std::cerr << "PFitter::GetPhaseParams(): **ERROR** idx=" << idx << " is > #param = " << fRunInfo->GetNoOfParams() << "!" << std::endl;
return;
}
fPhase[idx] = true;
}
}
}
//--------------------------------------------------------------------------
// GetParFromFun (private)
//--------------------------------------------------------------------------
/**
* <p>Extract from string funX the function number. Base on the function number
* the paramter numbers will be collected.
*
* @param funStr string of the form funX, where X is the function number
* @return a vector of all the parameter numbers related to funX
*/
PIntVector PFitter::GetParFromFun(const TString funStr)
{
PIntVector parVec;
PMsrLines *funList = fRunInfo->GetMsrFunctions();
TObjArray *tok = nullptr;
TObjString *ostr = nullptr;
TString str;
for (int i=0; i<funList->size(); i++) {
if (funList->at(i).fLine.Contains(funStr)) {
// tokenize function string
tok = funList->at(i).fLine.Tokenize(" =+-*/");
if (tok == nullptr) {
std::cerr << "PFitter::GetParFromFun(): **ERROR** couldn't tokenize function string." << std::endl;
return parVec;
}
for (int j=1; j<tok->GetEntries(); j++) {
ostr = dynamic_cast<TObjString*>(tok->At(j));
str = ostr->GetString();
// parse tok for parX
if (str.Contains("par")) {
// find start idx of par in token
Ssiz_t idx = str.Index("par");
idx += 3;
TString parStr("");
do {
parStr += str[idx];
} while (isdigit(str[idx++]));
parVec.push_back(parStr.Atoi());
}
// parse tok for mapX
if (str.Contains("map")) {
// find start idx of par in token
Ssiz_t idx = str.Index("map");
idx += 3;
TString mapStr("map");
do {
mapStr += str[idx];
} while (isdigit(str[idx++]));
PIntVector mapParVec = GetParFromMap(mapStr);
for (int k=0; k<mapParVec.size(); k++) {
parVec.push_back(mapParVec[k]);
}
}
}
// clean up
delete tok;
tok = nullptr;
}
}
return parVec;
}
//--------------------------------------------------------------------------
// GetParFromMap (private)
//--------------------------------------------------------------------------
/**
* <p>Extract from string mapX the map number. Based on the map number the
* parameter numbers will be collected.
*
* @param mapStr string of the form mapX, where X is the map number
* @return a vector of all the parameter numbers related to mapX
*/
PIntVector PFitter::GetParFromMap(const TString mapStr)
{
PIntVector parVec;
TString str = mapStr;
str.Remove(0,3); // remove map from string
int idx=str.Atoi();
if (idx == 0) {
std::cerr << "PFitter::GetParFromMap(): **ERROR** couldn't get propper index from mapX!" << std::endl;
return parVec;
}
idx -= 1; // map starts at 1, map vector at 0
// go through all the runs and collect the parameters from the map vectors
PMsrRunList *runList = fRunInfo->GetMsrRunList();
if (runList == nullptr) {
std::cerr << "PFitter::GetParFromMap(): **ERROR** couldn't get required run list information!" << std::endl;
return parVec;
}
PIntVector *map = nullptr;
for (int i=0; i<runList->size(); i++) {
map = runList->at(i).GetMap();
if (map == nullptr) {
std::cerr << "PFitter::GetParFromMap(): **ERROR** couldn't get required map information (idx=" << i << ")!" << std::endl;
parVec.clear();
return parVec;
}
if (idx >= map->size()) {
std::cerr << "PFitter::GetParFromMap(): **ERROR** requested map index (idx=" << idx << ") out-of-range (" << map->size() << ")!" << std::endl;
parVec.clear();
return parVec;
}
parVec.push_back(map->at(idx));
}
return parVec;
}
//--------------------------------------------------------------------------
// DoFit
//--------------------------------------------------------------------------
@ -524,7 +730,7 @@ Bool_t PFitter::DoFit()
// debugging information
#ifdef HAVE_GOMP
std::cout << std::endl << ">> Number of available threads for the function optimization: " << omp_get_num_procs() << std::endl;
std::cout << std::endl << ">> Number of available threads for the function optimization: " << omp_get_max_threads() << std::endl;
#endif
// real fit wanted
@ -1608,7 +1814,12 @@ Bool_t PFitter::ExecuteMigrad()
// fill run info
for (UInt_t i=0; i<fParams.size(); i++) {
fRunInfo->SetMsrParamValue(i, min.UserState().Value(i));
Double_t dval = min.UserState().Value(i);
if (fPhase[i]) {
Int_t m = (Int_t)(dval/360.0);
dval = dval - m*360.0;
}
fRunInfo->SetMsrParamValue(i, dval);
fRunInfo->SetMsrParamStep(i, min.UserState().Error(i));
fRunInfo->SetMsrParamPosErrorPresent(i, false);
}
@ -1684,7 +1895,12 @@ Bool_t PFitter::ExecuteMinimize()
// fill run info
for (UInt_t i=0; i<fParams.size(); i++) {
fRunInfo->SetMsrParamValue(i, min.UserState().Value(i));
Double_t dval = min.UserState().Value(i);
if (fPhase[i]) {
Int_t m = (Int_t)(dval/360.0);
dval = dval - m*360.0;
}
fRunInfo->SetMsrParamValue(i, dval);
fRunInfo->SetMsrParamStep(i, min.UserState().Error(i));
fRunInfo->SetMsrParamPosErrorPresent(i, false);
}
@ -1840,7 +2056,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) {
@ -2388,7 +2608,12 @@ Bool_t PFitter::ExecuteSimplex()
// fill run info
for (UInt_t i=0; i<fParams.size(); i++) {
fRunInfo->SetMsrParamValue(i, min.UserState().Value(i));
Double_t dval = min.UserState().Value(i);
if (fPhase[i]) {
Int_t m = (Int_t)(dval/360.0);
dval = dval - m*360.0;
}
fRunInfo->SetMsrParamValue(i, dval);
fRunInfo->SetMsrParamStep(i, min.UserState().Error(i));
fRunInfo->SetMsrParamPosErrorPresent(i, false);
}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2019 by Bastian M. Wojek / Andreas Suter *
* Copyright (C) 2009-2021 by Bastian M. Wojek / Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -1308,7 +1308,9 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
std::ostringstream oss;
oss << path << "musrfit" << " " << *fRunVectorIter << "-OneRunFit" << fFileExtension << ".msr";
std::cout << std::endl << ">> msr2data: **INFO** Calling " << oss.str() << std::endl;
system(oss.str().c_str());
if (system(oss.str().c_str()) == -1) {
std::cerr << std::endl << "**ERROR** system call: " << oss.str().c_str() << " failed." << std::endl;
}
++fRunVectorIter;
}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -1827,12 +1827,7 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, std::map<UInt_t, TString
if (fGlobal.GetFitRange(j) == -1)
break;
UInt_t neededWidth = 7;
UInt_t neededPrec = 2;
if (fGlobal.GetFitRange(j) > 0.0) { // global fit range present
LastSignificant(fGlobal.GetFitRange(j));
} else { // global fit range absent
neededPrec = LastSignificant(fRuns[i].GetFitRange(j));
}
UInt_t neededPrec = LastSignificant(fGlobal.GetFitRange(j));
fout.width(neededWidth);
fout.precision(neededPrec);
fout << std::left << std::fixed << fGlobal.GetFitRange(j);
@ -3868,7 +3863,7 @@ Bool_t PMsrHandler::FilterNumber(TString str, const Char_t *filter, Int_t offset
Char_t *cstr, filterStr[32];
cstr = new Char_t[str.Sizeof()];
strncpy(cstr, str.Data(), str.Sizeof());
sprintf(filterStr, "%s%%d", filter);
snprintf(filterStr, sizeof(filterStr), "%s%%d", filter);
// get number if present
found = sscanf(cstr, filterStr, &no_found);
@ -6334,16 +6329,7 @@ Bool_t PMsrHandler::CheckHistoGrouping()
{
Bool_t result = true;
for (UInt_t i=0; i<fRuns.size(); i++) {
if (fRuns[i].GetFitType() == MSR_FITTYPE_ASYM || fRuns[i].GetFitType() == MSR_FITTYPE_BNMR) {
if (fRuns[i].GetForwardHistoNoSize() != fRuns[i].GetBackwardHistoNoSize()) {
std::cerr << std::endl << ">> PMsrHandler::CheckHistoGrouping: **ERROR** # of forward histos != # of backward histos.";
std::cerr << std::endl << ">> Run #" << i+1;
std::cerr << std::endl;
result = false;
break;
}
}
for (UInt_t i=0; i<fRuns.size(); i++) {
// check grouping entries are not identical, e.g. forward 1 1 2
if (fRuns[i].GetForwardHistoNoSize() > 1) {
for (UInt_t j=0; j<fRuns[i].GetForwardHistoNoSize(); j++) {
@ -6623,7 +6609,7 @@ UInt_t PMsrHandler::LastSignificant(Double_t dval, UInt_t precLimit)
char str[128];
sprintf(str, "%lf", dval);
snprintf(str, sizeof(str), "%lf", dval);
// find decimal point
for (UInt_t i=0; i<strlen(str); i++) {
@ -6668,13 +6654,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) {
@ -6732,9 +6723,9 @@ TString PMsrHandler::BeautifyFourierPhaseParameterString()
if (phaseIter) {
if (phaseRef != -1) {
str = TString::Format("parR(%d, %d, %d)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
str = TString::Format("parR(%d, %d, %lu)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
} else {
str = TString::Format("par(%d, %d, %d)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
str = TString::Format("par(%d, %d, %lu)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
}
} else {
str = TString("");

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -543,7 +543,7 @@ void PMusrCanvas::UpdateParamTheoryPad()
for (UInt_t i=0; i<param.size(); i++) {
str = "";
accuracy = GetNeededAccuracy(param[i]);
sprintf(accStr, "%%.%dlf", accuracy);
snprintf(accStr, sizeof(accStr), "%%.%dlf", accuracy);
// parameter no
str += param[i].fNo;
if (param[i].fNo<10)
@ -556,9 +556,9 @@ void PMusrCanvas::UpdateParamTheoryPad()
str += " ";
// parameter value
if (round(param[i].fValue)-param[i].fValue==0)
sprintf(cnum, "%.1lf", param[i].fValue);
snprintf(cnum, sizeof(cnum), "%.1lf", param[i].fValue);
else
sprintf(cnum, accStr, param[i].fValue);
snprintf(cnum, sizeof(cnum), accStr, param[i].fValue);
str += cnum;
for (Int_t j=0; j<9-(Int_t)strlen(cnum); j++) // fill spaces
str += " ";
@ -572,22 +572,22 @@ void PMusrCanvas::UpdateParamTheoryPad()
if ((fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*fabs(param[i].fStep)) &&
(fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*param[i].fPosError)) {
if (round(err)-err==0)
sprintf(cnum, "%.1lf", err);
snprintf(cnum, sizeof(cnum), "%.1lf", err);
else
sprintf(cnum, accStr, err);
snprintf(cnum, sizeof(cnum), accStr, err);
} else {
sprintf(accStr, "%%.%dlf!!", accuracy);
snprintf(accStr, sizeof(accStr), "%%.%dlf!!", accuracy);
if (round(err)-err==0)
sprintf(cnum, "%.1lf!!", err);
snprintf(cnum, sizeof(cnum), "%.1lf!!", err);
else
sprintf(cnum, accStr, err);
snprintf(cnum, sizeof(cnum), accStr, err);
}
str += cnum;
} else { // minos was not used
if (round(param[i].fStep)-param[i].fStep==0)
sprintf(cnum, "%.1lf", param[i].fStep);
snprintf(cnum, sizeof(cnum), "%.1lf", param[i].fStep);
else
sprintf(cnum, accStr, param[i].fStep);
snprintf(cnum, sizeof(cnum), accStr, param[i].fStep);
str += cnum;
}
ypos = 0.98-i*yoffset;
@ -936,13 +936,13 @@ void PMusrCanvas::UpdateInfoPad()
tstr += TString("??,");
} else if (ddvec->size() == 1){
tstr += TString("T=");
sprintf(sval, "%0.2lf", ddvec->at(0).first);
snprintf(sval, sizeof(sval), "%0.2lf", ddvec->at(0).first);
tstr += TString(sval) + TString("K,");
} else {
for(UInt_t i(0); i<ddvec->size(); ++i){
sprintf(sval, "T%u=", i);
snprintf(sval, sizeof(sval), "T%u=", i);
tstr += TString(sval);
sprintf(sval, "%0.2lf", ddvec->at(i).first);
snprintf(sval, sizeof(sval), "%0.2lf", ddvec->at(i).first);
tstr += TString(sval) + TString("K,");
}
}
@ -953,10 +953,10 @@ void PMusrCanvas::UpdateInfoPad()
tstr += TString("??,");
} else {
if (dval < 1.0e4) { // Gauss makes sense as a unit
sprintf(sval, "%0.2lf", dval);
snprintf(sval, sizeof(sval), "%0.2lf", dval);
tstr += TString(sval) + TString("G,");
} else { // Tesla makes sense as a unit
sprintf(sval, "%0.2lf", dval/1.0e4);
snprintf(sval, sizeof(sval), "%0.2lf", dval/1.0e4);
tstr += TString(sval) + TString("T,");
}
}
@ -967,10 +967,10 @@ void PMusrCanvas::UpdateInfoPad()
tstr += TString("??,");
} else {
if (dval < 1.0e3) { // keV makes sense as a unit
sprintf(sval, "%0.2lf", dval);
snprintf(sval, sizeof(sval), "%0.2lf", dval);
tstr += TString(sval) + TString("keV,");
} else { // MeV makes sense as a unit
sprintf(sval, "%0.2lf", dval/1.0e3);
snprintf(sval, sizeof(sval), "%0.2lf", dval/1.0e3);
tstr += TString(sval) + TString("MeV,");
}
}
@ -1225,7 +1225,6 @@ void PMusrCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *selected)
PlotFourierDifference();
break;
case kFourierDiff: // show difference between the Fourier data and the Fourier theory
CleanupFourierDifference();
HandleFourierDifference();
PlotFourierDifference();
break;
@ -1580,13 +1579,13 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat)
}
if (fStartWithFourier)
sprintf(ext, "_%d_F", fPlotNumber);
snprintf(ext, sizeof(ext), "_%d_F", fPlotNumber);
else
sprintf(ext, "_%d", fPlotNumber);
snprintf(ext, sizeof(ext), "_%d", fPlotNumber);
str.Replace(idx, size, ext, strlen(ext));
idx += strlen(ext);
size = strlen(ext);
sprintf(ext, ".%s", graphicsFormat);
snprintf(ext, sizeof(ext), ".%s", graphicsFormat);
str.Replace(idx, size, ext, strlen(ext));
std::cout << std::endl << ">> SaveGraphicsAndQuit: " << str.Data() << std::endl;
@ -3866,7 +3865,7 @@ void PMusrCanvas::HandleAverage()
}
if (fData[0].diffFourierRe != nullptr) {
name = TString(fData[0].diffFourierRe->GetTitle()) + "_avg";
fDataAvg.diff = new TH1F(name, name, fData[0].diffFourierRe->GetNbinsX(),
fDataAvg.diffFourierRe = new TH1F(name, name, fData[0].diffFourierRe->GetNbinsX(),
fData[0].diffFourierRe->GetXaxis()->GetXmin(),
fData[0].diffFourierRe->GetXaxis()->GetXmax());
}
@ -4126,10 +4125,10 @@ void PMusrCanvas::HandleAverage()
fDataAvg.diffFourierPhase->SetBinContent(i, dval/fData.size());
}
// set marker color, line color, maker size, marker type
fDataAvg.diffFourierPhase->SetMarkerColor(fData[0].dataFourierPhase->GetMarkerColor());
fDataAvg.diffFourierPhase->SetLineColor(fData[0].dataFourierPhase->GetLineColor());
fDataAvg.diffFourierPhase->SetMarkerSize(fData[0].dataFourierPhase->GetMarkerSize());
fDataAvg.diffFourierPhase->SetMarkerStyle(fData[0].dataFourierPhase->GetMarkerStyle());
fDataAvg.diffFourierPhase->SetMarkerColor(fData[0].diffFourierPhase->GetMarkerColor());
fDataAvg.diffFourierPhase->SetLineColor(fData[0].diffFourierPhase->GetLineColor());
fDataAvg.diffFourierPhase->SetMarkerSize(fData[0].diffFourierPhase->GetMarkerSize());
fDataAvg.diffFourierPhase->SetMarkerStyle(fData[0].diffFourierPhase->GetMarkerStyle());
}
if (fDataAvg.diffFourierPhaseOptReal != nullptr) {
for (Int_t i=0; i<fData[0].diffFourierPhaseOptReal->GetNbinsX(); i++) {
@ -6540,7 +6539,7 @@ UInt_t PMusrCanvas::GetNeededAccuracy(PMsrParamStructure param)
if (param.fStep == 0.0) { // check if fit parameter is a constant, i.e. step==0
char str[128];
sprintf(str, "%lf", param.fValue);
snprintf(str, sizeof(str), "%lf", param.fValue);
// find decimal point
for (UInt_t i=0; i<strlen(str); i++) {

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

603
src/classes/PRgeHandler.cpp Normal file
View File

@ -0,0 +1,603 @@
/***************************************************************************
PRgeHandler.cpp
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-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 <fstream>
#include <iostream>
#include <vector>
#include <string>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
#include "PRgeHandler.h"
ClassImpQ(PXmlRgeHandler)
//--------------------------------------------------------------------------
// OnStartDocument
//--------------------------------------------------------------------------
/**
* <p>Called on start of the XML file reading. Initializes all necessary variables.
*/
void PXmlRgeHandler::OnStartDocument()
{
fKey = eEmpty;
}
//--------------------------------------------------------------------------
// OnEndDocument
//--------------------------------------------------------------------------
/**
* <p>Called on end of XML file reading.
*/
void PXmlRgeHandler::OnEndDocument()
{
if (!fIsValid)
return;
// check if anything was set
if (fTrimSpDataPath.empty()) {
std::string err = "<data_path> content is missing!";
fIsValid = false;
OnError(err.c_str());
}
if (fTrimSpFlnPre.empty()) {
std::string err = "<rge_fln_pre> content is missing!";
fIsValid = false;
OnError(err.c_str());
}
if (fTrimSpDataEnergyList.size()==0) {
std::string err = "no implantation energies present!";
fIsValid = false;
OnError(err.c_str());
}
}
//--------------------------------------------------------------------------
// OnStartElement
//--------------------------------------------------------------------------
/**
* <p>Called when a XML start element is found. Filters out the needed elements
* and sets a proper key.
*
* \param str XML element name
* \param attributes not used
*/
void PXmlRgeHandler::OnStartElement(const Char_t *str, const TList *attributes)
{
if (!strcmp(str, "trim_sp")) {
isTrimSp=true;
} else if (!strcmp(str, "data_path") && isTrimSp) {
fKey = eDataPath;
} else if (!strcmp(str, "rge_fln_pre") && isTrimSp) {
fKey = eFlnPre;
} else if (!strcmp(str, "energy") && isTrimSp) {
fKey = eEnergy;
}
}
//--------------------------------------------------------------------------
// OnEndElement
//--------------------------------------------------------------------------
/**
* <p>Called when a XML end element is found. Resets the handler key.
*
* \param str not used
*/
void PXmlRgeHandler::OnEndElement(const Char_t *str)
{
if (!strcmp(str, "trim_sp")) {
isTrimSp=false;
}
fKey = eEmpty;
}
//--------------------------------------------------------------------------
// OnCharacters
//--------------------------------------------------------------------------
/**
* <p>Content of a given XML element. Filters out the data and feeds them to
* the internal variables.
*
* \param str XML element string
*/
void PXmlRgeHandler::OnCharacters(const Char_t *str)
{
int ival;
std::string msg(""), sstr(str);
size_t pos;
switch(fKey) {
case eDataPath:
fTrimSpDataPath=str;
break;
case eFlnPre:
fTrimSpFlnPre=str;
break;
case eEnergy:
try {
ival = std::stoi(str, &pos);
} catch(std::invalid_argument& e) {
fIsValid = false;
msg = "The found energy '" + sstr + "' which is not a number";
OnError(msg.c_str());
} catch(std::out_of_range& e) {
fIsValid = false;
msg = "The found energy '" + sstr + "' which is out-of-range.";
OnError(msg.c_str());
} catch(...) {
fIsValid = false;
msg = "The found energy '" + sstr + "' which generates an error.";
OnError(msg.c_str());
}
if (pos != sstr.length()) {
fIsValid = false;
msg = "The found energy '" + sstr + "' which is not an integer";
OnError(msg.c_str());
}
fTrimSpDataEnergyList.push_back(ival);
break;
default:
break;
}
}
//--------------------------------------------------------------------------
// OnComment
//--------------------------------------------------------------------------
/**
* <p>Called when a XML comment is found. Not used.
*
* \param str not used.
*/
void PXmlRgeHandler::OnComment(const Char_t *str)
{
// nothing to be done for now
}
//--------------------------------------------------------------------------
// OnWarning
//--------------------------------------------------------------------------
/**
* <p>Called when the XML parser emits a warning.
*
* \param str warning string
*/
void PXmlRgeHandler::OnWarning(const Char_t *str)
{
std::cerr << std::endl << "PXmlRgeHandler **WARNING** " << str;
std::cerr << std::endl;
}
//--------------------------------------------------------------------------
// OnError
//--------------------------------------------------------------------------
/**
* <p>Called when the XML parser emits an error.
*
* \param str error string
*/
void PXmlRgeHandler::OnError(const Char_t *str)
{
std::cerr << std::endl << "PXmlRgeHandler **ERROR** " << str;
std::cerr << std::endl;
}
//--------------------------------------------------------------------------
// OnFatalError
//--------------------------------------------------------------------------
/**
* <p>Called when the XML parser emits a fatal error.
*
* \param str fatal error string
*/
void PXmlRgeHandler::OnFatalError(const Char_t *str)
{
std::cerr << std::endl << "PXmlRgeHandler **FATAL ERROR** " << str;
std::cerr << std::endl;
}
//--------------------------------------------------------------------------
// OnCdataBlock
//--------------------------------------------------------------------------
/**
* <p>Not used.
*
* \param str not used
* \param len not used
*/
void PXmlRgeHandler::OnCdataBlock(const Char_t *str, Int_t len)
{
// nothing to be done for now
}
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
ClassImp(PRgeHandler)
//--------------------------------------------------------------------------
// Ctor
//--------------------------------------------------------------------------
/**
* @brief PRgeHandler::PRgeHandler
* @param fln
*/
PRgeHandler::PRgeHandler(const std::string fln)
{
// make sure there is an xml-startup file name
if (fln.empty()) { // fln not given
std::cerr << std::endl;
std::cerr << "**ERROR** NO xml file name provided." << std::endl;
std::cerr << std::endl;
fValid=false;
return;
}
// read the startup xml-file to extract the necessary rge infos.
if (!boost::filesystem::exists(fln)) {
std::cerr << std::endl;
std::cerr << "**ERROR** xml file named: " << fln << " does not exist." << std::endl;
std::cerr << std::endl;
fValid=false;
return;
}
// create the rge xml handler
PXmlRgeHandler *xmlRge = new PXmlRgeHandler();
if (xmlRge == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PXmlRgeHandler." << std::endl;
std::cerr << std::endl;
fValid=false;
return;
}
// create the SAX parser
TSAXParser *saxParser = new TSAXParser();
if (saxParser == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke TSAXParser." << std::endl;
std::cerr << std::endl;
fValid=false;
return;
}
saxParser->SetStopOnError();
// connect SAX parser and rge handler
saxParser->ConnectToHandler("PXmlRgeHandler", xmlRge);
int status = saxParser->ParseFile(fln.c_str());
if (status != 0) {
std::cerr << std::endl;
std::cerr << "**ERROR** parsing the xml-file: " << fln << "." << std::endl;
std::cerr << std::endl;
fValid=false;
return;
}
if (xmlRge->IsValid())
fValid = true;
else
fValid = false;
// read the rge-file(s) content if everything went fine so far
std::string rgeFln;
PRgeData dataSet;
if (fValid) {
const PIntVector energy = xmlRge->GetTrimSpDataVectorList();
for (int i=0; i<energy.size(); i++) {
// construct the file name
rgeFln = xmlRge->GetTrimSpDataPath();
if (rgeFln[rgeFln.size()-1] != '/')
rgeFln += "/";
rgeFln += xmlRge->GetTrimSpFlnPre();
rgeFln += std::to_string(energy[i]);
rgeFln += ".rge";
if (!boost::filesystem::exists(rgeFln)) {
fValid = false;
std::cerr << std::endl;
std::cerr << "**ERROR** rge-file: " << rgeFln << " not found." << std::endl;
std::cerr << std::endl;
break;
}
// init data set
dataSet.energy = energy[i];
dataSet.depth.clear();
dataSet.amplitude.clear();
if (!ReadRgeFile(rgeFln, dataSet)) {
fValid = false;
std::cerr << std::endl;
std::cerr << "**ERROR** read error in rge-file: " << rgeFln << " not found." << std::endl;
std::cerr << std::endl;
break;
}
// get the total number of particles
double tot=0.0;
for (int j=0; j<dataSet.amplitude.size(); j++)
tot += dataSet.amplitude[j];
dataSet.noOfParticles = tot;
// sum_j nn dzz == 1, (dzz_j = depth[j]-depth[j-1])
dataSet.nn.resize(dataSet.amplitude.size());
tot = 0.0;
double zz=0.0; // "previous" zz (since depth[j]-depth[j-1] != const) it needs to be done this way.
for (int j=0; j<dataSet.nn.size(); j++) {
tot += dataSet.amplitude[j] * (dataSet.depth[j] - zz);
zz = dataSet.depth[j];
}
for (int j=0; j<dataSet.nn.size(); j++) {
dataSet.nn[j] = dataSet.amplitude[j] / tot;
}
fData.push_back(dataSet);
}
}
delete saxParser;
delete xmlRge;
}
//--------------------------------------------------------------------------
// ReadRgeFile
//--------------------------------------------------------------------------
/**
* <p>Read the content of a rge-file.
*
* @param fln file name of the rge-file
* @return true on success.
*/
bool PRgeHandler::ReadRgeFile(const std::string fln, PRgeData &data)
{
std::ifstream fin(fln);
if (!fin.is_open())
return false;
std::string line, msg;
std::vector<std::string> tok;
Double_t zz, nn;
size_t pos;
int lineNo=0;
while (fin.good() && fValid) {
std::getline(fin, line);
lineNo++;
boost::algorithm::trim(line);
if (line.empty())
continue;
if (!std::isdigit(line[0]))
continue;
tok.clear();
boost::algorithm::split(tok, line, boost::algorithm::is_any_of(" \t"), boost::algorithm::token_compress_on);
if (tok.size() != 2) {
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ", unexpected number of tokens (" << tok.size() << ")." << std::endl;
std::cerr << std::endl;
fin.close();
return false;
}
// check distance
try {
zz = std::stod(tok[0], &pos);
} catch(std::invalid_argument& e) {
fValid = false;
msg = "The found depth '" + tok[0] + "' which is not a number";
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ": lineNo: " << lineNo << std::endl;
std::cerr << " " << msg << std::endl;
std::cerr << std::endl;
} catch(std::out_of_range& e) {
fValid = false;
msg = "The found depth '" + tok[0] + "' which is out-of-range.";
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ": lineNo: " << lineNo << std::endl;
std::cerr << " " << msg << std::endl;
std::cerr << std::endl;
} catch(...) {
fValid = false;
msg = "The found depth '" + tok[0] + "' which generates an error.";
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ": lineNo: " << lineNo << std::endl;
std::cerr << " " << msg << std::endl;
std::cerr << std::endl;
}
if (pos != tok[0].length()) {
fValid = false;
msg = "The found depth '" + tok[0] + "' which is not an number.";
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ": lineNo: " << lineNo << std::endl;
std::cerr << " " << msg << std::endl;
std::cerr << std::endl;
}
// check number of implanted particles
try {
nn = std::stod(tok[1], &pos);
} catch(std::invalid_argument& e) {
fValid = false;
msg = "The found #particles '" + tok[1] + "' which is not a number";
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ": lineNo: " << lineNo << std::endl;
std::cerr << " " << msg << std::endl;
std::cerr << std::endl;
} catch(std::out_of_range& e) {
fValid = false;
msg = "The found #particles '" + tok[1] + "' which is out-of-range.";
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ": lineNo: " << lineNo << std::endl;
std::cerr << " " << msg << std::endl;
std::cerr << std::endl;
} catch(...) {
fValid = false;
msg = "The found #particles '" + tok[1] + "' which generates an error.";
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ": lineNo: " << lineNo << std::endl;
std::cerr << " " << msg << std::endl;
std::cerr << std::endl;
}
if (pos != tok[1].length()) {
fValid = false;
msg = "The found #particles '" + tok[1] + "' which is not an integer.";
std::cerr << std::endl;
std::cerr << "**ERROR** in rge-file: " << fln << ": lineNo: " << lineNo << std::endl;
std::cerr << " " << msg << std::endl;
std::cerr << std::endl;
}
data.depth.push_back(zz/10.0); // distance in nm
data.amplitude.push_back(nn);
}
fin.close();
return true;
}
//--------------------------------------------------------------------------
// GetZmax via energy
//--------------------------------------------------------------------------
/**
* <p>Get maximal depth for a given energy.
*
* @param energy energy in (eV)
* @return zMax if energy is found, -1 otherwise.
*/
Double_t PRgeHandler::GetZmax(const Double_t energy)
{
int idx=-1;
for (int i=0; i<fData.size(); i++) {
if (fabs(fData[i].energy-energy) < 1.0) {
idx = i;
break;
}
}
if (idx != -1)
return GetZmax(idx);
return -1.0;
}
//--------------------------------------------------------------------------
// GetZmax via index
//--------------------------------------------------------------------------
/**
* <p>Get maximal depth for a given index.
*
* @param idx index for which zMax is requested.
* @return zMax if idx is in range, -1 otherwise.
*/
Double_t PRgeHandler::GetZmax(const Int_t idx)
{
if ((idx < 0) || (idx >= fData.size()))
return -1.0;
return fData[idx].depth[fData[idx].depth.size()-1];
}
//--------------------------------------------------------------------------
// Get_n via energy
//--------------------------------------------------------------------------
/**
* <p>Get the normalized n(E,z) value.
*
* @param energy (eV)
* @param z (nm)
* @return n(E,z) if energy and z are in proper range, -1.0 otherwise.
*/
Double_t PRgeHandler::Get_n(const Double_t energy, const Double_t z)
{
int idx=-1;
for (int i=0; i<fData.size(); i++) {
if (fabs(fData[i].energy-energy) < 1.0) {
idx = i;
break;
}
}
if (idx == -1)
return 0.0;
return Get_n(idx, z);
}
//--------------------------------------------------------------------------
// Get_n via index
//--------------------------------------------------------------------------
/**
* <p>Get the normalized n(idx,z) value.
*
* @param idx index of the rge-dataset
* @param z (nm)
* @return n(idx,z) if idx and z are in proper range, -1.0 otherwise.
*/
Double_t PRgeHandler::Get_n(const Int_t idx, const Double_t z)
{
if ((idx < 0) || (idx >= fData.size()))
return 0.0;
if ((z < 0.0) || (z > GetZmax(idx)))
return 0.0;
int pos=0;
for (int i=0; i<fData[idx].depth.size(); i++) {
if (z <= fData[idx].depth[i]) {
pos = i-1;
break;
}
}
Double_t nn=0.0;
if (pos < 0) {
nn = fData[idx].nn[0] * z/(fData[idx].depth[1]-fData[idx].depth[0]);
} else { // linear interpolation
nn = fData[idx].nn[pos] +
(fData[idx].nn[pos+1] - fData[idx].nn[pos]) *
(z-fData[idx].depth[pos])/(fData[idx].depth[pos+1]-fData[idx].depth[pos]);
}
return nn;
}
//--------------------------------------------------------------------------
// GetEnergyIndex
//--------------------------------------------------------------------------
/**
* <p>Get the energy index by providing an energy in (eV).
*
* @param energy in (eV).
* @return energy index if energy was found, -1 otherwise.
*/
Int_t PRgeHandler::GetEnergyIndex(const Double_t energy)
{
int idx=-1;
for (int i=0; i<fData.size(); i++) {
if (fabs(fData[i].energy-energy) < 1.0) {
idx = i;
break;
}
}
return idx;
}

View File

@ -0,0 +1,10 @@
prefix=@prefix@
exec_prefix=@exec_prefix@
libdir=@libdir@
includedir=@includedir@
Name: PRgeHandler
Description: C++ shared library providing the support for handling of TrimSP rge-files
Version: @MUSR_VERSION@
Libs: -L${libdir} -l@PRGEHANDLER_LIBRARY_NAME@
Cflags: -I${includedir}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -602,17 +602,7 @@ Bool_t PRunAsymmetry::PrepareData()
return false;
}
}
if (forwardHistoNo.size() != backwardHistoNo.size()) {
std::cerr << std::endl << ">> PRunAsymmetry::PrepareData(): **PANIC ERROR**:";
std::cerr << std::endl << ">> # of forward histograms different from # of backward histograms.";
std::cerr << std::endl << ">> Will quit :-(";
std::cerr << std::endl;
// clean up
forwardHistoNo.clear();
backwardHistoNo.clear();
return false;
}
// keep the time resolution in (us)
fTimeResolution = runData->GetTimeResolution()/1.0e3;
std::cout.precision(10);
@ -626,11 +616,13 @@ Bool_t PRunAsymmetry::PrepareData()
// keep the histo of each group at this point (addruns handled below)
std::vector<PDoubleVector> forward, backward;
forward.resize(forwardHistoNo.size()); // resize to number of groups
backward.resize(backwardHistoNo.size()); // resize to numer of groups
for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
forward[i].resize(runData->GetDataBin(forwardHistoNo[i])->size());
backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size());
forward[i] = *runData->GetDataBin(forwardHistoNo[i]);
}
backward.resize(backwardHistoNo.size()); // resize to number of groups
for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size());
backward[i] = *runData->GetDataBin(backwardHistoNo[i]);
}
@ -676,9 +668,11 @@ Bool_t PRunAsymmetry::PrepareData()
// set forward/backward histo data of the first group
fForward.resize(forward[0].size());
fBackward.resize(backward[0].size());
for (UInt_t i=0; i<fForward.size(); i++) {
fForward[i] = forward[0][i];
}
fBackward.resize(backward[0].size());
for (UInt_t i=0; i<fBackward.size(); i++) {
fBackward[i] = backward[0][i];
}
@ -781,7 +775,21 @@ Bool_t PRunAsymmetry::PrepareData()
*/
Bool_t PRunAsymmetry::SubtractFixBkg()
{
if (fRunInfo->GetBkgFix(0) == PMUSR_UNDEFINED) {
std::cerr << "PRunAsymmetry::SubtractFixBkg(): **ERROR** no fixed bkg for forward set. Will do nothing here." << std::endl;
return false;
}
if (fRunInfo->GetBkgFix(1) == PMUSR_UNDEFINED) {
std::cerr << "PRunAsymmetry::SubtractFixBkg(): **ERROR** no fixed bkg for backward set. Will do nothing here." << std::endl;
std::cerr << " you need an entry like:" << std::endl;
std::cerr << " backgr.fix 2 3" << std::endl;
std::cerr << " i.e. two entries for forward and backward." << std::endl;
return false;
}
Double_t dval;
for (UInt_t i=0; i<fForward.size(); i++) {
// keep the error, and make sure that the bin is NOT empty
if (fForward[i] != 0.0)
@ -1005,8 +1013,8 @@ Bool_t PRunAsymmetry::PrepareFitData()
Double_t asym;
Double_t f, b, ef, eb;
// fill data time start, and step
// data start at data_start-t0 shifted by (pack-1)/2
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(fGoodBins[0])-fT0s[0]+static_cast<Double_t>(fPacking-1)/2.0));
// data start time = (binStart - 0.5) + pack/2 - t0, with pack and binStart used as double
fData.SetDataTimeStart(fTimeResolution*((static_cast<Double_t>(fGoodBins[0])-0.5) + static_cast<Double_t>(fPacking)/2.0 - static_cast<Double_t>(fT0s[0])));
fData.SetDataTimeStep(fTimeResolution*static_cast<Double_t>(fPacking));
for (UInt_t i=0; i<noOfBins; i++) {
// to make the formulae more readable
@ -1207,8 +1215,8 @@ Bool_t PRunAsymmetry::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2])
Double_t asym;
Double_t f, b, ef, eb, alpha = 1.0, beta = 1.0;
// set data time start, and step
// data start at data_start-t0
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(start[0])-t0[0]+static_cast<Double_t>(packing-1)/2.0));
// data start time = (binStart - 0.5) + pack/2 - t0, with pack and binStart used as double
fData.SetDataTimeStart(fTimeResolution*((static_cast<Double_t>(start[0])-0.5) + static_cast<Double_t>(packing)/2.0 - static_cast<Double_t>(t0[0])));
fData.SetDataTimeStep(fTimeResolution*static_cast<Double_t>(packing));
// get the proper alpha and beta
@ -1297,11 +1305,11 @@ Bool_t PRunAsymmetry::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2])
// calculate theory
Double_t time;
UInt_t size = runData->GetDataBin(histoNo[0])->size();
UInt_t size = runData->GetDataBin(histoNo[0])->size()/packing;
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
if (fTheoAsData) { // cacluate theory only at the data points
if (fTheoAsData) { // calculate theory only at the data points
fData.SetTheoryTimeStep(fData.GetDataTimeStep());
} else {
// finer binning for the theory (8 times as many points = factor)
@ -1586,8 +1594,8 @@ Bool_t PRunAsymmetry::PrepareRRFViewData(PRawRunData* runData, UInt_t histoNo[2]
}
// set data time start, and step
// data start at data_start-t0
fData.SetDataTimeStart(fTimeResolution*(start[0]-t0[0]+static_cast<Double_t>(packing-1)/2.0));
// data start time = (binStart - 0.5) + pack/2 - t0, with pack and binStart used as double
fData.SetDataTimeStart(fTimeResolution*((static_cast<Double_t>(start[0])-0.5) + static_cast<Double_t>(packing)/2.0 - static_cast<Double_t>(t0[0])));
fData.SetDataTimeStep(fTimeResolution*static_cast<Double_t>(packing));
// ------------------------------------------------------------
@ -1663,7 +1671,7 @@ Bool_t PRunAsymmetry::PrepareRRFViewData(PRawRunData* runData, UInt_t histoNo[2]
//--------------------------------------------------------------------------
/**
* <p>Get the proper t0 for the single histogram run.
* -# the t0 vector size = number of detectors (grouping) for forward.
* -# the t0 vector size = number of detectors (grouping) for forward + backward.
* -# initialize t0's with -1
* -# fill t0's from RUN block
* -# if t0's are missing (i.e. t0 == -1), try to fill from the GLOBAL block.
@ -1684,7 +1692,11 @@ Bool_t PRunAsymmetry::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalB
// feed all T0's
// first init T0's, T0's are stored as (forward T0, backward T0, etc.)
fT0s.clear();
fT0s.resize(2*forwardHistoNo.size());
// this strange fT0 size estimate is needed in case #forw histos != #back histos
size_t size = 2*forwardHistoNo.size();
if (backwardHistoNo.size() > forwardHistoNo.size())
size = 2*backwardHistoNo.size();
fT0s.resize(size);
for (UInt_t i=0; i<fT0s.size(); i++) {
fT0s[i] = -1.0;
}
@ -1751,6 +1763,8 @@ Bool_t PRunAsymmetry::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalB
std::cerr << std::endl;
return false;
}
}
for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
if ((fT0s[2*i+1] < 0) || (fT0s[2*i+1] > static_cast<Int_t>(runData->GetDataBin(backwardHistoNo[i])->size()))) {
std::cerr << std::endl << ">> PRunAsymmetry::PrepareData(): **ERROR** t0 data bin (" << fT0s[2*i+1] << ") doesn't make any sense!";
std::cerr << std::endl << ">> backwardHistoNo " << backwardHistoNo[i];

View File

@ -9,7 +9,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2018-2019 by Zaher Salman *
* Copyright (C) 2018-2021 by Zaher Salman *
* zaher.salman@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -640,6 +640,7 @@ Bool_t PRunAsymmetryBNMR::PrepareData()
return false;
}
}
/* //as35
if (forwardHistoNo.size() != backwardHistoNo.size()) {
std::cerr << std::endl << ">> PRunAsymmetryBNMR::PrepareData(): **PANIC ERROR**:";
std::cerr << std::endl << ">> # of forward histograms different from # of backward histograms.";
@ -650,7 +651,8 @@ Bool_t PRunAsymmetryBNMR::PrepareData()
backwardHistoNo.clear();
return false;
}
*/ //as35
// keep the time resolution in (s)
fTimeResolution = runData->GetTimeResolution()/1.0e3;
std::cout.precision(10);
@ -664,11 +666,13 @@ Bool_t PRunAsymmetryBNMR::PrepareData()
// keep the histo of each group at this point (addruns handled below)
std::vector<PDoubleVector> forward, backward;
forward.resize(forwardHistoNo.size()); // resize to number of groups
backward.resize(backwardHistoNo.size()); // resize to numer of groups
for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
forward[i].resize(runData->GetDataBin(forwardHistoNo[i])->size());
backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size());
forward[i] = *runData->GetDataBin(forwardHistoNo[i]);
}
backward.resize(backwardHistoNo.size()); // resize to number of groups
for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size());
backward[i] = *runData->GetDataBin(backwardHistoNo[i]);
}
@ -712,15 +716,18 @@ Bool_t PRunAsymmetryBNMR::PrepareData()
}
}
// set forward/backward histo data of the first group
// set forward histo data of the first group
fForwardp.resize(forward[0].size());
fBackwardp.resize(backward[0].size());
fForwardm.resize(forward[0].size());
fBackwardm.resize(backward[0].size());
for (UInt_t i=0; i<fForwardp.size(); i++) {
fForwardp[i] = forward[0][i];
fBackwardp[i] = backward[0][i];
fForwardm[i] = forward[1][i];
}
// set backward histo data of the first group
fBackwardp.resize(backward[0].size());
fBackwardm.resize(backward[0].size());
for (UInt_t i=0; i<fBackwardp.size(); i++) {
fBackwardp[i] = backward[0][i];
fBackwardm[i] = backward[1][i];
}
@ -1478,7 +1485,7 @@ Bool_t PRunAsymmetryBNMR::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
if (fTheoAsData) { // cacluate theory only at the data points
if (fTheoAsData) { // calculate theory only at the data points
fData.SetTheoryTimeStep(fData.GetDataTimeStep());
} else {
// finer binning for the theory (8 times as many points = factor)
@ -1529,7 +1536,11 @@ Bool_t PRunAsymmetryBNMR::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *glo
// feed all T0's
// first init T0's, T0's are stored as (forward T0, backward T0, etc.)
fT0s.clear();
fT0s.resize(2*forwardHistoNo.size());
// this strange fT0 size estimate is needed in case #forw histos != #back histos
size_t size = 2*forwardHistoNo.size();
if (backwardHistoNo.size() > forwardHistoNo.size())
size = 2*backwardHistoNo.size();
fT0s.resize(size);
for (UInt_t i=0; i<fT0s.size(); i++) {
fT0s[i] = -1.0;
}
@ -1596,6 +1607,8 @@ Bool_t PRunAsymmetryBNMR::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *glo
std::cerr << std::endl;
return false;
}
}
for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
if ((fT0s[2*i+1] < 0) || (fT0s[2*i+1] > static_cast<Int_t>(runData->GetDataBin(backwardHistoNo[i])->size()))) {
std::cerr << std::endl << ">> PRunAsymmetryBNMR::PrepareData(): **ERROR** t0 data bin (" << fT0s[2*i+1] << ") doesn't make any sense!";
std::cerr << std::endl << ">> backwardHistoNo " << backwardHistoNo[i];

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -584,16 +584,6 @@ Bool_t PRunAsymmetryRRF::PrepareData()
return false;
}
}
if (forwardHistoNo.size() != backwardHistoNo.size()) {
std::cerr << std::endl << ">> PRunAsymmetryRRF::PrepareData(): **PANIC ERROR**:";
std::cerr << std::endl << ">> # of forward histograms different from # of backward histograms.";
std::cerr << std::endl << ">> Will quit :-(";
std::cerr << std::endl;
// clean up
forwardHistoNo.clear();
backwardHistoNo.clear();
return false;
}
// keep the time resolution in (us)
fTimeResolution = runData->GetTimeResolution()/1.0e3;
@ -608,11 +598,13 @@ Bool_t PRunAsymmetryRRF::PrepareData()
// keep the histo of each group at this point (addruns handled below)
std::vector<PDoubleVector> forward, backward;
forward.resize(forwardHistoNo.size()); // resize to number of groups
backward.resize(backwardHistoNo.size()); // resize to numer of groups
for (UInt_t i=0; i<forwardHistoNo.size(); i++) {
forward[i].resize(runData->GetDataBin(forwardHistoNo[i])->size());
backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size());
forward[i] = *runData->GetDataBin(forwardHistoNo[i]);
}
backward.resize(backwardHistoNo.size()); // resize to number of groups
for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size());
backward[i] = *runData->GetDataBin(backwardHistoNo[i]);
}
@ -1232,7 +1224,7 @@ Bool_t PRunAsymmetryRRF::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]
UInt_t size = runData->GetDataBin(histoNo[0])->size();
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
if (fTheoAsData) { // cacluate theory only at the data points
if (fTheoAsData) { // calculate theory only at the data points
fData.SetTheoryTimeStep(fData.GetDataTimeStep());
} else {
// finer binning for the theory (8 times as many points = factor)
@ -1281,7 +1273,11 @@ Bool_t PRunAsymmetryRRF::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *glob
// feed all T0's
// first init T0's, T0's are stored as (forward T0, backward T0, etc.)
fT0s.clear();
fT0s.resize(2*forwardHistoNo.size());
// this strange fT0 size estimate is needed in case #forw histos != #back histos
size_t size = 2*forwardHistoNo.size();
if (backwardHistoNo.size() > forwardHistoNo.size())
size = 2*backwardHistoNo.size();
fT0s.resize(size);
for (UInt_t i=0; i<fT0s.size(); i++) {
fT0s[i] = -1.0;
}
@ -1348,6 +1344,8 @@ Bool_t PRunAsymmetryRRF::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *glob
std::cerr << std::endl;
return false;
}
}
for (UInt_t i=0; i<backwardHistoNo.size(); i++) {
if ((fT0s[2*i+1] < 0) || (fT0s[2*i+1] > static_cast<Int_t>(runData->GetDataBin(backwardHistoNo[i])->size()))) {
std::cerr << std::endl << ">> PRunAsymmetryRRF::PrepareData(): **ERROR** t0 data bin (" << fT0s[2*i+1] << ") doesn't make any sense!";
std::cerr << std::endl << ">> backwardHistoNo " << backwardHistoNo[i];

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2022 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -275,6 +275,21 @@ void PRunDataHandler::ReadData()
else
fAllDataAvailable = true;
} else if (!fRunPathName.IsWhitespace()) { // i.e. file name triggered
if (fFileFormat == "") { // try to guess the file format if fromat hasn't been provided
TString ext=fRunPathName;
Ssiz_t pos=ext.Last('.');
ext.Remove(0, pos+1);
if (!ext.CompareTo("bin", TString::kIgnoreCase))
fFileFormat = "psibin";
else if (!ext.CompareTo("root", TString::kIgnoreCase))
fFileFormat = "musrroot";
else if (!ext.CompareTo("msr", TString::kIgnoreCase))
fFileFormat = "mud";
else if (!ext.CompareTo("nxs", TString::kIgnoreCase))
fFileFormat = "nexus";
else if (!ext.CompareTo("mdu", TString::kIgnoreCase))
fFileFormat = "psimdu";
}
if ((fFileFormat == "MusrRoot") || (fFileFormat == "musrroot")) {
fAllDataAvailable = ReadRootFile();
} else if ((fFileFormat == "NeXus") || (fFileFormat == "nexus")) {
@ -310,15 +325,102 @@ void PRunDataHandler::ConvertData()
fAllDataAvailable = true;
}
//--------------------------------------------------------------------------
// SetRunData
//--------------------------------------------------------------------------
/**
* <p>Set a raw run data set.
*
* @param data pointer to the raw run data set
* @param idx index to where to write it.
*
* @return true in case of success, false otherwise.
*/
Bool_t PRunDataHandler::SetRunData(PRawRunData *data, UInt_t idx)
{
if ((idx == 0) && (fData.size() == 0)) {
fData.resize(1);
}
if (idx >= fData.size()) {
std::cerr << std::endl << ">>PRunDataHandler::SetRunData(): **ERROR** idx=" << idx << " is out-of-range (0.." << fData.size() << ")." << std::endl;
return false;
}
fData[idx] = *data;
return true;
}
//--------------------------------------------------------------------------
// WriteData
//--------------------------------------------------------------------------
/**
* <p>Write data. This routine is used to write a single file.
*/
void PRunDataHandler::WriteData()
Bool_t PRunDataHandler::WriteData(TString fileName)
{
if ((fAny2ManyInfo == nullptr) && (fileName="")) {
std::cerr << std::endl << ">> PRunDataHandler::WriteData(): **ERROR** insufficient information: no fileName nor fAny2ManyInfo object.";
std::cerr << std::endl << " Cannot write data under this conditions." << std::endl;
return false;
}
// get output file format tag, first try via fAny2ManyInfo
Int_t outTag = A2M_UNDEFINED;
if (fAny2ManyInfo != nullptr) {
if (!fAny2ManyInfo->outFormat.CompareTo("musrroot", TString::kIgnoreCase))
outTag = A2M_MUSR_ROOT;
else if (!fAny2ManyInfo->outFormat.CompareTo("psibin", TString::kIgnoreCase))
outTag = A2M_PSIBIN;
else if (!fAny2ManyInfo->outFormat.CompareTo("psimdu", TString::kIgnoreCase))
outTag = A2M_PSIMDU;
else if (!fAny2ManyInfo->outFormat.CompareTo("mud",TString::kIgnoreCase))
outTag = A2M_MUD;
else if (fAny2ManyInfo->outFormat.BeginsWith("nexus", TString::kIgnoreCase))
outTag = A2M_NEXUS;
else
outTag = A2M_UNDEFINED;
} else { // only fileName is given, try to guess from the extension
// STILL MISSING
}
if (outTag == A2M_UNDEFINED) {
std::cerr << std::endl << ">> PRunDataHandler::WriteData(): **ERROR** no valid output data file format found: '" << fAny2ManyInfo->outFormat.Data() << "'" << std::endl;
return false;
}
Bool_t success{true};
switch (outTag) {
case A2M_MUSR_ROOT:
if (fAny2ManyInfo->outFileName.Length() == 0)
success = WriteMusrRootFile(fileName);
else
success = WriteMusrRootFile(fAny2ManyInfo->outFileName);
break;
case A2M_PSIBIN:
case A2M_PSIMDU:
if (fAny2ManyInfo->outFileName.Length() == 0)
success = WritePsiBinFile(fileName);
else
success = WritePsiBinFile(fAny2ManyInfo->outFileName);
break;
case A2M_MUD:
if (fAny2ManyInfo->outFileName.Length() == 0)
success = WriteMudFile(fileName);
else
success = WriteMudFile(fAny2ManyInfo->outFileName);
break;
case A2M_NEXUS:
if (fAny2ManyInfo->outFileName.Length() == 0)
success = WriteNexusFile(fileName);
else
success = WriteNexusFile(fAny2ManyInfo->outFileName);
break;
default:
break;
}
return success;
}
//--------------------------------------------------------------------------
@ -721,28 +823,34 @@ Bool_t PRunDataHandler::ReadWriteFilesList()
else // bzip2
fln += TString(".tar.bz2");
if (fAny2ManyInfo->compressionTag == 1) // gzip
sprintf(cmd, "tar -zcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
snprintf(cmd, sizeof(cmd), "tar -zcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
else // bzip2
sprintf(cmd, "tar -jcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
system(cmd);
snprintf(cmd, sizeof(cmd), "tar -jcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
if (system(cmd) == -1) {
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
}
} else {
fln += TString(".tar");
for (UInt_t i=0; i<fAny2ManyInfo->outPathFileName.size(); i++) {
if (i==0) {
sprintf(cmd, "tar -cf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
snprintf(cmd, sizeof(cmd), "tar -cf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
} else {
sprintf(cmd, "tar -rf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
snprintf(cmd, sizeof(cmd), "tar -rf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
}
if (system(cmd) == -1) {
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
}
system(cmd);
}
if (fAny2ManyInfo->compressionTag == 1) { // gzip
sprintf(cmd, "gzip %s", fln.Data());
snprintf(cmd, sizeof(cmd), "gzip %s", fln.Data());
fln += ".gz";
} else {
sprintf(cmd, "bzip2 -z %s", fln.Data());
snprintf(cmd, sizeof(cmd), "bzip2 -z %s", fln.Data());
fln += ".bz2";
}
system(cmd);
if (system(cmd) == -1) {
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
}
}
// check if the compressed file shall be streamed to the stdout
@ -1534,7 +1642,7 @@ Bool_t PRunDataHandler::ReadRootFile()
// get all the data
Char_t histoName[32];
for (Int_t i=0; i<noOfHistos; i++) {
sprintf(histoName, "hDecay%02d", i);
snprintf(histoName, sizeof(histoName), "hDecay%02d", i);
TH1F *histo = dynamic_cast<TH1F*>(folder->FindObjectAny(histoName));
if (!histo) {
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **ERROR** Couldn't get histo " << histoName;
@ -1563,14 +1671,14 @@ Bool_t PRunDataHandler::ReadRootFile()
histoData.clear();
}
// check if any post pileup histos are present at all (this is not the case for LEM data 2006 and earlier)
sprintf(histoName, "hDecay%02d", POST_PILEUP_HISTO_OFFSET);
snprintf(histoName, sizeof(histoName), "hDecay%02d", POST_PILEUP_HISTO_OFFSET);
if (!folder->FindObjectAny(histoName)) {
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **WARNING** Couldn't get histo " << histoName;
std::cerr << std::endl << ">> most probably this is an old (2006 or earlier) LEM file without post pileup histos.";
std::cerr << std::endl;
} else {
for (Int_t i=0; i<noOfHistos; i++) {
sprintf(histoName, "hDecay%02d", i+POST_PILEUP_HISTO_OFFSET);
snprintf(histoName, sizeof(histoName), "hDecay%02d", i+POST_PILEUP_HISTO_OFFSET);
TH1F *histo = dynamic_cast<TH1F*>(folder->FindObjectAny(histoName));
if (!histo) {
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **ERROR** Couldn't get histo " << histoName;
@ -2677,7 +2785,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
Bool_t success;
// read psi bin file
status = psiBin.read(fRunPathName.Data());
status = psiBin.Read(fRunPathName.Data());
switch (status) {
case 0: // everything perfect
success = true;
@ -2766,32 +2874,32 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
// keep run name
runData.SetRunName(fRunName);
// get run title
runData.SetRunTitle(TString(psiBin.get_comment().c_str())); // run title
runData.SetRunTitle(TString(psiBin.GetComment().c_str())); // run title
// get run number
runData.SetRunNumber(psiBin.get_runNumber_int());
runData.SetRunNumber(psiBin.GetRunNumberInt());
// get setup
runData.SetSetup(TString(psiBin.get_comment().c_str()));
runData.SetSetup(TString(psiBin.GetComment().c_str()));
// get sample
runData.SetSample(TString(psiBin.get_sample().c_str()));
runData.SetSample(TString(psiBin.GetSample().c_str()));
// get orientation
runData.SetOrientation(TString(psiBin.get_orient().c_str()));
runData.SetOrientation(TString(psiBin.GetOrient().c_str()));
// get comment
runData.SetComment(TString(psiBin.get_comment().c_str()));
runData.SetComment(TString(psiBin.GetComment().c_str()));
// set LEM specific information to default value since it is not in the file and not used...
runData.SetEnergy(PMUSR_UNDEFINED);
runData.SetTransport(PMUSR_UNDEFINED);
// get field
Double_t scale = 0.0;
if (psiBin.get_field().rfind("G") != std::string::npos)
if (psiBin.GetField().rfind("G") != std::string::npos)
scale = 1.0;
if (psiBin.get_field().rfind("T") != std::string::npos)
if (psiBin.GetField().rfind("T") != std::string::npos)
scale = 1.0e4;
status = sscanf(psiBin.get_field().c_str(), "%lf", &dval);
status = sscanf(psiBin.GetField().c_str(), "%lf", &dval);
if (status == 1)
runData.SetField(scale*dval);
// get temperature
PDoubleVector tempVec(psiBin.get_temperatures_vector());
PDoubleVector tempDevVec(psiBin.get_devTemperatures_vector());
PDoubleVector tempVec(psiBin.GetTemperaturesVector());
PDoubleVector tempDevVec(psiBin.GetDevTemperaturesVector());
if ((tempVec.size() > 1) && (tempDevVec.size() > 1) && tempVec[0] && tempVec[1]) {
// take only the first two values for now...
//maybe that's not enough - e.g. in older GPD data I saw the "correct values in the second and third entry..."
@ -2801,16 +2909,16 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
tempVec.clear();
tempDevVec.clear();
} else {
status = sscanf(psiBin.get_temp().c_str(), "%lfK", &dval);
status = sscanf(psiBin.GetTemp().c_str(), "%lfK", &dval);
if (status == 1)
runData.SetTemperature(0, dval, 0.0);
}
// get time resolution (ns)
runData.SetTimeResolution(psiBin.get_binWidth_ns());
runData.SetTimeResolution(psiBin.GetBinWidthNanoSec());
// get start/stop time
std::vector<std::string> sDateTime = psiBin.get_timeStart_vector();
std::vector<std::string> sDateTime = psiBin.GetTimeStartVector();
if (sDateTime.size() < 2) {
std::cerr << std::endl << ">> **WARNING** psi-bin file: couldn't obtain run start date/time" << std::endl;
}
@ -2824,7 +2932,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
runData.SetStartTime(sDateTime[1]);
sDateTime.clear();
sDateTime = psiBin.get_timeStop_vector();
sDateTime = psiBin.GetTimeStopVector();
if (sDateTime.size() < 2) {
std::cerr << std::endl << ">> **WARNING** psi-bin file: couldn't obtain run stop date/time" << std::endl;
}
@ -2839,7 +2947,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
sDateTime.clear();
// get t0's
PIntVector t0 = psiBin.get_t0_vector();
PIntVector t0 = psiBin.GetT0Vector();
if (t0.empty()) {
std::cerr << std::endl << ">> **ERROR** psi-bin file: couldn't obtain any t0's";
@ -2848,7 +2956,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
}
// get first good bin
PIntVector fgb = psiBin.get_firstGood_vector();
PIntVector fgb = psiBin.GetFirstGoodVector();
if (fgb.empty()) {
std::cerr << std::endl << ">> **ERROR** psi-bin file: couldn't obtain any fgb's";
std::cerr << std::endl;
@ -2856,7 +2964,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
}
// get last good bin
PIntVector lgb = psiBin.get_lastGood_vector();
PIntVector lgb = psiBin.GetLastGoodVector();
if (lgb.empty()) {
std::cerr << std::endl << ">> **ERROR** psi-bin file: couldn't obtain any lgb's";
std::cerr << std::endl;
@ -2866,13 +2974,12 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
// fill raw data
PRawRunDataSet dataSet;
PDoubleVector histoData;
Int_t *histo;
for (Int_t i=0; i<psiBin.get_numberHisto_int(); i++) {
histo = psiBin.get_histo_array_int(i);
for (Int_t j=0; j<psiBin.get_histoLength_bin(); j++) {
std::vector<Int_t> histo;
for (Int_t i=0; i<psiBin.GetNumberHistoInt(); i++) {
histo = psiBin.GetHistoArrayInt(i);
for (Int_t j=0; j<psiBin.GetHistoLengthBin(); j++) {
histoData.push_back(histo[j]);
}
delete[] histo;
// estimate T0 from maximum of the data
Double_t maxVal = 0.0;
@ -2885,7 +2992,7 @@ Bool_t PRunDataHandler::ReadPsiBinFile()
}
dataSet.Clear();
dataSet.SetName(psiBin.get_nameHisto(i).c_str());
dataSet.SetName(psiBin.GetNameHisto(i).c_str());
dataSet.SetHistoNo(i+1); // i.e. hist numbering starts at 1
if (i < static_cast<Int_t>(t0.size()))
dataSet.SetTimeZeroBin(t0[i]);
@ -4569,7 +4676,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln)
return false;
}
size = dataSet->GetData()->size();
sprintf(str, "hDecay%02d", static_cast<Int_t>(i));
snprintf(str, sizeof(str), "hDecay%02d", static_cast<Int_t>(i));
histo = new TH1F(str, str, size+1, -0.5, static_cast<Double_t>(size)+0.5);
for (UInt_t j=0; j<size; j++) {
histo->SetBinContent(j+1, dataSet->GetData()->at(j));
@ -4587,7 +4694,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln)
return false;
}
size = dataSet->GetData()->size();
sprintf(str, "hDecay%02d", static_cast<Int_t>(i));
snprintf(str, sizeof(str), "hDecay%02d", static_cast<Int_t>(i));
histo = new TH1F(str, str, static_cast<UInt_t>(size/fAny2ManyInfo->rebin)+1, -0.5, static_cast<Double_t>(size)/static_cast<Double_t>(fAny2ManyInfo->rebin)+0.5);
dataCount = 0;
for (UInt_t j=0; j<size; j++) {
@ -5189,15 +5296,15 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln)
// fill header information
// run number
psibin.put_runNumber_int(fData[0].GetRunNumber());
psibin.PutRunNumberInt(fData[0].GetRunNumber());
// length of histograms
UInt_t histo0 = 1;
if (fAny2ManyInfo->groupHistoList.size() != 0) { // red/green list found
histo0 = fAny2ManyInfo->groupHistoList[0]+1; // take the first available red/green entry
}
psibin.put_histoLength_bin(static_cast<int>(fData[0].GetDataBin(histo0)->size()/fAny2ManyInfo->rebin));
psibin.PutHistoLengthBin(static_cast<int>(fData[0].GetDataBin(histo0)->size()/fAny2ManyInfo->rebin));
// number of histograms
psibin.put_numberHisto_int(static_cast<int>(fData[0].GetNoOfHistos()));
psibin.PutNumberHistoInt(static_cast<int>(fData[0].GetNoOfHistos()));
// run title = sample (10 char) / temp (10 char) / field (10 char) / orientation (10 char)
char cstr[11];
// sample
@ -5206,35 +5313,35 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln)
else
strcpy(cstr, "??");
cstr[10] = '\0';
psibin.put_sample(cstr);
psibin.PutSample(cstr);
// temp
if (fData[0].GetNoOfTemperatures() > 0)
snprintf(cstr, 10, "%.1f K", fData[0].GetTemperature(0));
else
strcpy(cstr, "?? K");
cstr[10] = '\0';
psibin.put_temp(cstr);
psibin.PutTemp(cstr);
// field
if (fData[0].GetField() > 0)
snprintf(cstr, 10, "%.1f G", fData[0].GetField());
else
strcpy(cstr, "?? G");
cstr[10] = '\0';
psibin.put_field(cstr);
psibin.PutField(cstr);
// orientation
if (fData[0].GetOrientation()->Length() > 0)
strncpy(cstr, fData[0].GetOrientation()->Data(), 10);
else
strcpy(cstr, "??");
cstr[10] = '\0';
psibin.put_orient(cstr);
psibin.PutOrient(cstr);
// setup
if (fData[0].GetSetup()->Length() > 0)
strncpy(cstr, fData[0].GetSetup()->Data(), 10);
else
strcpy(cstr, "??");
cstr[10] = '\0';
psibin.put_setup(cstr);
psibin.PutSetup(cstr);
// handle PSI-BIN start/stop Time/Date. PSI-BIN requires: Time -> HH:MM:SS, and Date -> DD-MMM-YY
// internally given: Time -> HH:MM:SS, and Date -> YYYY-MM-DD
@ -5245,7 +5352,7 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln)
int year, month, day;
// 28-Aug-2014, TP: the following line does not work, it generates the wrong date
//dt.Set(fData[0].GetStartDateTime());
//dt.Set(fData[0].GetStartDateTime()); //as35
// the following generates the correct date entry
date.Append(*fData[0].GetStartDate());
sscanf((const char*)date.Data(),"%04d-%02d-%02d", &year, &month, &day);
@ -5262,7 +5369,7 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln)
strncpy(cstr, fData[0].GetStartTime()->Data(), 8);
cstr[8] = '\0';
svec.push_back(cstr);
psibin.put_timeStart_vector(svec);
psibin.PutTimeStartVector(svec);
svec.clear();
// run stop date
@ -5285,32 +5392,32 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln)
strncpy(cstr, fData[0].GetStopTime()->Data(), 8);
cstr[8] = '\0';
svec.push_back(cstr);
psibin.put_timeStop_vector(svec);
psibin.PutTimeStopVector(svec);
svec.clear();
// number of measured temperatures
psibin.put_numberTemperature_int(fData[0].GetNoOfTemperatures());
psibin.PutNumberTemperatureInt(fData[0].GetNoOfTemperatures());
// mean temperatures
std::vector<double> dvec;
for (UInt_t i=0; i<fData[0].GetNoOfTemperatures(); i++)
dvec.push_back(fData[0].GetTemperature(i));
psibin.put_temperatures_vector(dvec);
psibin.PutTemperaturesVector(dvec);
// standard deviation of temperatures
dvec.clear();
for (UInt_t i=0; i<fData[0].GetNoOfTemperatures(); i++)
dvec.push_back(fData[0].GetTempError(i));
psibin.put_devTemperatures_vector(dvec);
psibin.PutDevTemperaturesVector(dvec);
// write comment
psibin.put_comment(fData[0].GetRunTitle()->Data());
psibin.PutComment(fData[0].GetRunTitle()->Data());
// write time resolution
psibin.put_binWidth_ns(fData[0].GetTimeResolution()*fAny2ManyInfo->rebin);
psibin.PutBinWidthNanoSec(fData[0].GetTimeResolution()*fAny2ManyInfo->rebin);
// write scaler dummies
psibin.put_numberScaler_int(0);
psibin.PutNumberScalerInt(0);
// feed detector related info like, histogram names, t0, fgb, lgb
Int_t ival = 0;
@ -5328,16 +5435,16 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln)
str = dataSet->GetName();
if (!str.CompareTo("n/a"))
str.Form("Detector%3d", i+1);
psibin.put_nameHisto(str.Data(), i);
psibin.PutNameHisto(str.Data(), i);
// time zero bin
ival = static_cast<Int_t>(dataSet->GetTimeZeroBin()/fAny2ManyInfo->rebin);
psibin.put_t0_int(i, ival);
psibin.PutT0Int(i, ival);
// first good bin
ival = static_cast<Int_t>(dataSet->GetFirstGoodBin()/fAny2ManyInfo->rebin);
psibin.put_firstGood_int(i, ival);
psibin.PutFirstGoodInt(i, ival);
// last good bin
ival = static_cast<Int_t>(dataSet->GetLastGoodBin()/fAny2ManyInfo->rebin);
psibin.put_lastGood_int(i, ival);
psibin.PutLastGoodInt(i, ival);
}
// feed histos
@ -5380,19 +5487,19 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln)
}
}
}
status = psibin.put_histo_array_int(histos);
status = psibin.PutHistoArrayInt(histos, 2); // tag 2 means: lift histo length restriction on only make sure it is < 32512
if (status != 0) {
std::cerr << std::endl << ">> PRunDataHandler::WritePsiBinFile(): " << psibin.ConsistencyStatus() << std::endl;
return false;
}
if (!psibin.CheckDataConsistency()) {
if (!psibin.CheckDataConsistency(2)) {
std::cerr << std::endl << ">> PRunDataHandler::WritePsiBinFile(): " << psibin.ConsistencyStatus() << std::endl;
return false;
}
// write data to file
status = psibin.write(fln.Data());
status = psibin.Write(fln.Data());
if (status != 0) {
std::cerr << std::endl << ">> PRunDataHandler::WritePsiBinFile(): " << psibin.WriteStatus() << std::endl;
@ -5451,9 +5558,9 @@ Bool_t PRunDataHandler::WriteMudFile(TString fln)
MUD_setOrient(fd, (char *)fData[0].GetOrientation()->Data());
MUD_setDas(fd, dummy);
MUD_setExperimenter(fd, dummy);
sprintf(info, "%lf+-%lf (K)", fData[0].GetTemperature(0), fData[0].GetTempError(0));
snprintf(info, sizeof(info), "%lf+-%lf (K)", fData[0].GetTemperature(0), fData[0].GetTempError(0));
MUD_setTemperature(fd, info);
sprintf(info, "%lf", fData[0].GetField());
snprintf(info, sizeof(info), "%lf", fData[0].GetField());
MUD_setField(fd, info);
// generate the histograms
@ -5953,6 +6060,9 @@ TString PRunDataHandler::GenerateOutputFileName(const TString fileName, const TS
TString fln = fileName;
ok = true;
if (fAny2ManyInfo == nullptr)
return fln;
// generate output file name if needed
if (!fAny2ManyInfo->useStandardOutput || (fAny2ManyInfo->compressionTag > 0)) {
if (fln.Length() == 0) {
@ -6109,7 +6219,7 @@ TString PRunDataHandler::FileNameFromTemplate(TString &fileNameTemplate, Int_t r
if (idx == str.Length()) { // 'r' only
TString runStr("");
char fmt[128];
sprintf(fmt , "%%0%dd", str.Length());
snprintf(fmt, sizeof(fmt), "%%0%dd", str.Length());
runStr.Form(fmt, run);
result += runStr;
} else { // not only 'r'

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -604,8 +604,8 @@ Bool_t PRunMuMinus::PrepareFitData(PRawRunData* runData, const UInt_t histoNo)
Int_t t0 = static_cast<Int_t>(fT0s[0]);
Double_t value = 0.0;
// data start at data_start-t0
// time shifted so that packing is included correctly, i.e. t0 == t0 after packing
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(fGoodBins[0])-static_cast<Double_t>(t0)+static_cast<Double_t>(fPacking-1)/2.0));
// data start time = (binStart - 0.5) + pack/2 - t0, with pack and binStart used as double
fData.SetDataTimeStart(fTimeResolution*((static_cast<Double_t>(fGoodBins[0])-0.5) + static_cast<Double_t>(fPacking)/2.0 - static_cast<Double_t>(t0)));
fData.SetDataTimeStep(fTimeResolution*fPacking);
for (Int_t i=fGoodBins[0]; i<fGoodBins[1]; i++) {
if (fPacking == 1) {
@ -710,9 +710,8 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
// everything looks fine, hence fill data set
Int_t t0 = static_cast<Int_t>(fT0s[0]);
Double_t value = 0.0;
// data start at data_start-t0
// time shifted so that packing is included correctly, i.e. t0 == t0 after packing
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(start)-static_cast<Double_t>(t0)+static_cast<Double_t>(packing-1)/2.0));
// data start time = (binStart - 0.5) + pack/2 - t0, with pack and binStart used as double
fData.SetDataTimeStart(fTimeResolution*((static_cast<Double_t>(start)-0.5) + static_cast<Double_t>(packing)/2.0 - static_cast<Double_t>(t0)));
fData.SetDataTimeStep(fTimeResolution*packing);
for (Int_t i=start; i<end; i++) {
@ -758,7 +757,7 @@ Bool_t PRunMuMinus::PrepareRawViewData(PRawRunData* runData, const UInt_t histoN
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
if (fTheoAsData) { // cacluate theory only at the data points
if (fTheoAsData) { // calculate theory only at the data points
fData.SetTheoryTimeStep(fData.GetDataTimeStep());
} else {
// finer binning for the theory (8 times as many points = factor)

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -888,7 +888,7 @@ Bool_t PRunSingleHisto::PrepareFitData(PRawRunData* runData, const UInt_t histoN
normalizer = fPacking * (fTimeResolution * 1.0e3); // fTimeResolution us->ns
// data start at data_start-t0
// time shifted so that packing is included correctly, i.e. t0 == t0 after packing
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(fGoodBins[0])-static_cast<Double_t>(t0)+static_cast<Double_t>(fPacking-1)/2.0));
fData.SetDataTimeStart(fTimeResolution*((static_cast<Double_t>(fGoodBins[0])-0.5) + static_cast<Double_t>(fPacking)/2.0 - static_cast<Double_t>(t0)));
fData.SetDataTimeStep(fTimeResolution*fPacking);
for (Int_t i=fGoodBins[0]; i<fGoodBins[1]; i++) {
if (fPacking == 1) {
@ -991,9 +991,8 @@ Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t hi
// everything looks fine, hence fill data set
Int_t t0 = static_cast<Int_t>(fT0s[0]);
Double_t value = 0.0;
// data start at data_start-t0
// time shifted so that packing is included correctly, i.e. t0 == t0 after packing
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(start)-static_cast<Double_t>(t0)+static_cast<Double_t>(packing-1)/2.0));
// data start time = (binStart - 0.5) + pack/2 - t0, with pack and binStart used as double
fData.SetDataTimeStart(fTimeResolution*((static_cast<Double_t>(start)-0.5) + static_cast<Double_t>(packing)/2.0 - static_cast<Double_t>(t0)));
fData.SetDataTimeStep(fTimeResolution*packing);
for (Int_t i=start; i<end; i++) {
@ -1074,7 +1073,7 @@ Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t hi
UInt_t size = fForward.size();
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
if (fTheoAsData) { // cacluate theory only at the data points
if (fTheoAsData) { // calculate theory only at the data points
fData.SetTheoryTimeStep(fData.GetDataTimeStep());
} else {
// finer binning for the theory (8 times as many points = factor)
@ -1247,8 +1246,8 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
Double_t rrf_val = 0.0;
Double_t time = 0.0;
// data start at data_start-t0 shifted by (pack-1)/2
fData.SetDataTimeStart(fTimeResolution*(static_cast<Double_t>(start)-static_cast<Double_t>(t0)+static_cast<Double_t>(packing-1)/2.0));
// data start time = (binStart - 0.5) + pack/2 - t0, with pack and binStart used as double
fData.SetDataTimeStart(fTimeResolution*((static_cast<Double_t>(start)-0.5) + static_cast<Double_t>(packing)/2.0 - static_cast<Double_t>(t0)));
fData.SetDataTimeStep(fTimeResolution*packing);
// data is always normalized to (per nsec!!)
@ -1257,7 +1256,8 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
for (Int_t i=start; i<end; i++) {
if (((i-start) % packing == 0) && (i != start)) { // fill data
value *= dataNorm;
time = ((static_cast<Double_t>(i)-static_cast<Double_t>(packing-1)/2.0)-t0)*fTimeResolution;
// since the packing counter is already at the end of the bin, the time needs be shifted back by pack*time_resolution
time = (((static_cast<Double_t>(i)-0.5) + static_cast<Double_t>(packing)/2.0 - static_cast<Double_t>(t0)))*fTimeResolution - static_cast<Double_t>(packing)*fTimeResolution;
expval = TMath::Exp(+time/tau)/N0;
fData.AppendValue(-1.0+expval*(value-bkg));
fData.AppendErrorValue(expval*TMath::Sqrt(value*dataNorm));
@ -1315,13 +1315,13 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo
// calculate theory
Double_t theoryValue;
UInt_t size = fForward.size();
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
UInt_t size = fForward.size()/packing;
const Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
UInt_t rebinRRF = 0;
if (wRRF == 0) { // no RRF
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
if (fTheoAsData) { // cacluate theory only at the data points
if (fTheoAsData) { // calculate theory only at the data points
fData.SetTheoryTimeStep(fData.GetDataTimeStep());
} else {
// finer binning for the theory (8 times as many points = factor)

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -762,7 +762,7 @@ Bool_t PRunSingleHistoRRF::PrepareViewData(PRawRunData* runData, const UInt_t hi
UInt_t size = fForward.size();
Int_t factor = 8; // 8 times more points for the theory (if fTheoAsData == false)
fData.SetTheoryTimeStart(fData.GetDataTimeStart());
if (fTheoAsData) { // cacluate theory only at the data points
if (fTheoAsData) { // calculate theory only at the data points
fData.SetTheoryTimeStep(fData.GetDataTimeStep());
} else {
// finer binning for the theory (8 times as many points = factor)

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -37,6 +37,8 @@
#include <TObjArray.h>
#include <TObjString.h>
#include <TColor.h>
#include <TList.h>
#include <TXMLAttr.h>
#include "PStartupHandler.h"
@ -112,7 +114,7 @@ PStartupHandler::PStartupHandler()
// check if the startup file is found under $HOME/.musrfit
home = getenv("HOME");
if (home != nullptr) {
sprintf(startup_path_name, "%s/.musrfit/musrfit_startup.xml", home);
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
if (StartupFileExists(startup_path_name)) {
fStartupFilePath = TString(startup_path_name);
fStartupFileFound = true;
@ -123,7 +125,7 @@ PStartupHandler::PStartupHandler()
// check if the MUSRFITPATH system variable is set
pmusrpath = getenv("MUSRFITPATH");
if (pmusrpath != nullptr) {
sprintf(startup_path_name, "%s/musrfit_startup.xml", pmusrpath);
snprintf(startup_path_name, sizeof(startup_path_name), "%s/musrfit_startup.xml", pmusrpath);
if (StartupFileExists(startup_path_name)) {
fStartupFilePath = TString(startup_path_name);
fStartupFileFound = true;
@ -133,9 +135,9 @@ PStartupHandler::PStartupHandler()
if (!fStartupFileFound) { // MUSRFITPATH not set or empty, will try $ROOTSYS/bin
home = getenv("ROOTSYS");
if (home != nullptr) {
sprintf(musrpath, "%s/bin", home);
snprintf(musrpath, sizeof(musrpath), "%s/bin", home);
std::cerr << std::endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << std::endl;
sprintf(startup_path_name, "%s/musrfit_startup.xml", musrpath);
snprintf(startup_path_name, sizeof(startup_path_name), "%s/musrfit_startup.xml", musrpath);
if (StartupFileExists(startup_path_name)) {
fStartupFilePath = TString(startup_path_name);
fStartupFileFound = true;
@ -151,7 +153,7 @@ PStartupHandler::PStartupHandler()
} else {
home = getenv("HOME");
if (home != nullptr) {
sprintf(startup_path_name, "%s/.musrfit/musrfit_startup.xml", home);
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
if (StartupFileExists(startup_path_name)) {
fStartupFilePath = TString(startup_path_name);
fStartupFileFound = true;
@ -173,6 +175,7 @@ PStartupHandler::~PStartupHandler()
fDataPathList.clear();
fMarkerList.clear();
fColorList.clear();
fRunNameTemplate.clear();
}
//--------------------------------------------------------------------------
@ -224,6 +227,15 @@ void PStartupHandler::OnStartElement(const Char_t *str, const TList *attributes)
{
if (!strcmp(str, "data_path")) {
fKey = eDataPath;
} else if (!strcmp(str, "run_name_template")) {
fKey = eRunNameTemplate;
TXMLAttr *attr;
TIter next(attributes);
while ((attr = (TXMLAttr*) next())) {
if (!strcmp(attr->GetName(), "inst")) {
fCurrentInstrumentName = attr->GetValue();
}
}
} else if (!strcmp(str, "marker")) {
fKey = eMarker;
} else if (!strcmp(str, "color")) {
@ -272,12 +284,19 @@ void PStartupHandler::OnCharacters(const Char_t *str)
TString tstr;
Int_t color, r, g, b, ival;
PRunNameTemplate tmpl;
switch (fKey) {
case eDataPath:
// check that str is a valid path
// add str to the path list
fDataPathList.push_back(str);
break;
case eRunNameTemplate:
tmpl.instrument = fCurrentInstrumentName;
tmpl.runNameTemplate = str;
fRunNameTemplate.push_back(tmpl);
fCurrentInstrumentName="???";
break;
case eMarker:
// check that str is a number
tstr = TString(str);
@ -601,7 +620,7 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
// first check that $HOME/.musrfit exists and if NOT create it
struct stat info;
sprintf(startup_path_name, "%s/.musrfit", home);
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit", home);
if (!stat(startup_path_name, &info)) {
if (!(info.st_mode & S_IFDIR))
return false;
@ -613,7 +632,7 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
}
// set path-name for musrfit_startup.xml
sprintf(startup_path_name, "%s/.musrfit/musrfit_startup.xml", home);
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
std::ofstream fout(startup_path_name, std::ofstream::out);
if (!fout.is_open()) {
@ -636,6 +655,54 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/alc</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/hifi</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/lem</data_path>" << std::endl;
fout << " <!-- Dolly/PSI -->" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pie1/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pie3/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/deltat_tdc_dolly_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/root/deltat_tdc_dolly_%rrrr%.root</run_name_template>" << std::endl;
fout << " <!-- Flame/PSI -->" << std::endl;
fout << " <run_name_template inst=\"flame\">d%yyyy%/tdc/root/deltat_tdc_flame_%yyyy%_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <!-- GPD/PSI -->" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_mue1_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_fq_si_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_strobo_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_hp_ni_ht_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_hp_ni_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_ccr2_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_gpd_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_janis_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_janis_gpd_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_pta_gpd_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/deltat_tdc_gpd_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/root/deltat_tdc_gpd_%rrrr%.root</run_name_template>" << std::endl;
fout << " <!-- GPS/PSI -->" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_ccr_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_he3_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_stutt_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_flc2_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_oven_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_oven2_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_pta_gps_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/deltat_tdc_gps_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/root/deltat_tdc_gps_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
fout << " <!-- HAL-9500/PSI == HIFI/PSI -->" << std::endl;
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/deltat_hifi_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/tdc_hifi_%yyyy%_%rrrrr%.mdu</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/root/deltat_tdc_hifi_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
fout << " <!-- LTF/PSI -->" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/deltat_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/deltat_pta_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/pta/deltat_pta_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/tdc/deltat_tdc_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <!-- LEM/PSI -->" << std::endl;
fout << " <run_name_template inst=\"lem\">%yyyy%/lem%yy%_his_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"lem\">d%yyyy%/tdc/lem%yy%_his_%rrrr%.root</run_name_template>" << std::endl;
fout << " <fourier_settings>" << std::endl;
fout << " <units>Gauss</units>" << std::endl;
fout << " <fourier_power>0</fourier_power>" << std::endl;

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -841,12 +841,12 @@ void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock)
if (static_cast<UInt_t>(tokens->GetEntries()) < fgTheoDataBase[idx].fNoOfParam + 1)
return;
// make tidy string
sprintf(substr, "%-10s", fgTheoDataBase[idx].fName.Data());
snprintf(substr, sizeof(substr), "%-10s", fgTheoDataBase[idx].fName.Data());
tidy = TString(substr);
for (Int_t j=1; j<tokens->GetEntries(); j++) {
ostr = dynamic_cast<TObjString*>(tokens->At(j));
str = ostr->GetString();
sprintf(substr, "%6s", str.Data());
snprintf(substr, sizeof(substr), "%6s", str.Data());
tidy += TString(substr);
}
if (fgTheoDataBase[idx].fComment.Length() != 0) {
@ -913,7 +913,7 @@ void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
for (Int_t j=1; j<max; j++) {
ostr = dynamic_cast<TObjString*>(tokens->At(j));
str = ostr->GetString();
sprintf(substr, "%6s", str.Data());
snprintf(substr, sizeof(substr), "%6s", str.Data());
tidy += TString(substr);
}
@ -2160,51 +2160,73 @@ Double_t PTheory::InternalBessel(Double_t t, const PDoubleVector& paramValues, c
* \param paramValues parameter values
* \param funcValues vector with the functions (i.e. functions of the parameters)
*/
Double_t PTheory::SkewedGauss(Double_t t, const PDoubleVector& paramValues, const PDoubleVector& funcValues) const
{
// expected parameters: phase frequency sigma- sigma+ [tshift]
Double_t PTheory::SkewedGauss(Double_t t, const PDoubleVector &paramValues,
const PDoubleVector &funcValues) const {
// Expected parameters: phase, frequency, sigma-, sigma+, [tshift].
// To be stored in the array "val" as:
// val[0] = phase
// val[1] = frequency
// val[2] = sigma-
// val[3] = sigma+
// val[4] = tshift [optional]
Double_t val[5];
Double_t skg;
// Check that we have the correct number of fit parameters.
assert(fParamNo.size() <= 5);
// check if FUNCTIONS are used
for (UInt_t i=0; i<fParamNo.size(); i++) {
// Check if FUNCTIONS are used.
for (UInt_t i = 0; i < fParamNo.size(); i++) {
if (fParamNo[i] < MSR_PARAM_FUN_OFFSET) { // parameter or resolved map
val[i] = paramValues[fParamNo[i]];
} else { // function
val[i] = funcValues[fParamNo[i]-MSR_PARAM_FUN_OFFSET];
val[i] = funcValues[fParamNo[i] - MSR_PARAM_FUN_OFFSET];
}
}
// Apply the tshift (if required).
Double_t tt = t;
if (fParamNo.size() == 5) {
tt = t - val[4];
}
Double_t tt;
if (fParamNo.size() == 4) // no tshift
tt = t;
else // tshift present
tt = t-val[4];
// Evaluate the skewed Gaussian!
// val[2] = sigma-, val[3] = sigma+
Double_t zp = fabs(val[3])*tt/SQRT_TWO; // sigma+
Double_t zm = fabs(val[2])*tt/SQRT_TWO; // sigma-
Double_t gp = TMath::Exp(-0.5*TMath::Power(tt*val[3], 2.0)); // gauss sigma+
Double_t gm = TMath::Exp(-0.5*TMath::Power(tt*val[2], 2.0)); // gauss sigma-
Double_t wp = fabs(val[3])/(fabs(val[2])+fabs(val[3])); // sigma+ / (sigma+ + sigma-)
Double_t wm = 1.0-wp;
Double_t phase = DEG_TO_RAD*val[0];
Double_t freq = TWO_PI*val[1];
// First, calculate some "helper" terms.
Double_t sigma_p = std::abs(val[3]);
Double_t sigma_m = std::abs(val[2]);
Double_t arg_p = sigma_p * tt;
Double_t arg_m = sigma_m * tt;
Double_t z_p = arg_p / SQRT_TWO; // sigma+
Double_t z_m = arg_m / SQRT_TWO; // sigma-
Double_t g_p = TMath::Exp(-0.5 * arg_p * arg_p); // gauss sigma+
Double_t g_m = TMath::Exp(-0.5 * arg_m * arg_m); // gauss sigma-
Double_t w_p = sigma_p / (sigma_p + sigma_m);
Double_t w_m = 1.0 - w_p;
Double_t phase = DEG_TO_RAD * val[0];
Double_t freq = TWO_PI * val[1];
if ((zp >= 25.0) || (zm >= 25.0)) // needed to prevent crash of 1F1
skg = 2.0e6;
else if (fabs(val[2]) == fabs(val[3])) // sigma+ == sigma- -> Gaussian
skg = TMath::Cos(phase+freq*tt) * gp;
else
skg = TMath::Cos(phase+freq*tt) * (wm*gm + wp*gp) +
TMath::Sin(phase+freq*tt) * (wm*gm*2.0*zm/SQRT_PI*ROOT::Math::conf_hyperg(0.5,1.5,zm*zm) -
wp*gp*2.0*zp/SQRT_PI*ROOT::Math::conf_hyperg(0.5,1.5,zp*zp));
// Evalute the EVEN frequency component of the skewed Gaussian.
Double_t skg_cos = TMath::Cos(phase + freq * tt) * (w_m * g_m + w_p * g_p);
return skg;
// Evalute the ODD frequency component of the skewed Gaussian.
constexpr Double_t z_max = 26.7776;
// Note: the check against z_max is needed to prevent floating-point overflow
// in the return value of ROOT::Math::conf_hyperg(1/2, 3/2, z * z)
// (i.e., confluent hypergeometric function of the first kind, 1F1).
// In the case that z > z_max, return zero (otherwise there is some
// numeric discontinuity at later times).
Double_t skg_sin =
TMath::Sin(phase + freq * tt) *
((z_m > z_max) or (z_p > z_max)
? 0.0
: (w_m * g_m * 2.0 * z_m / SQRT_PI) *
ROOT::Math::conf_hyperg(0.5, 1.5, z_m * z_m) -
(w_p * g_p * 2.0 * z_p / SQRT_PI) *
ROOT::Math::conf_hyperg(0.5, 1.5, z_p * z_p));
// Return the skewed Gaussian: skg = skg_cos + skg_sin.
// Also check that skg_sin is finite!
return skg_cos + (std::isfinite(skg_sin) ? skg_sin : 0.0);
}
//--------------------------------------------------------------------------

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -34,26 +34,6 @@
ClassImp(PUserFcnBase)
//--------------------------------------------------------------------------
// Constructor
//--------------------------------------------------------------------------
/**
* <p>Constructor
*/
PUserFcnBase::PUserFcnBase()
{
}
//--------------------------------------------------------------------------
// Destructor
//--------------------------------------------------------------------------
/**
* <p>Destructor
*/
PUserFcnBase::~PUserFcnBase()
{
}
//--------------------------------------------------------------------------
// This function is a replacement for the ParseFile method of TSAXParser.
// It is needed because in certain environments ParseFile does not work but ParseBuffer does.

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter *
* Copyright (C) 2007-2022 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -53,7 +53,11 @@
#include <TFolder.h>
#include <TString.h>
#ifdef HAVE_GIT_REV_H
#include "git-revision.h"
#endif
#include "PFindRun.h"
#include "PStartupHandler.h"
#include "TMusrRunHeader.h"
#include "TLemRunHeader.h"
@ -69,7 +73,7 @@
//------------------------------------------------------------------------
/**
*
* <p>dump help to stdout.
*/
void dump_header_syntax()
{
@ -84,16 +88,15 @@ void dump_header_syntax()
std::cout << std::endl << " -rn, --runNo <runNo> : run number of the header to be dumped.";
std::cout << std::endl << " -fn, --fileName <fileName> : muSR data file name.";
std::cout << std::endl << " -ff, --fileFormat <fileFormat> : where <fileFormat> can be:";
std::cout << std::endl << " MusrRoot, NeXus, ROOT (old LEM), PSI-BIN, PSI-MDU, MUD, WKM";
std::cout << std::endl << " MusrRoot (default), NeXus, ROOT (old LEM), PSI-BIN, PSI-MDU, MUD, WKM";
std::cout << std::endl << " NeXus is only supported if enabled.";
std::cout << std::endl << " -y, --year <year> : <year> has to be 4 digit, e.g. 2005, if provided it is used to";
std::cout << std::endl << " generate the file name for the given <runNo>, otherwise the current";
std::cout << std::endl << " year is used. If a file name is given, this option has no effect.";
std::cout << std::endl << " -s, --summary : this option is used for LE-uSR data sets only. It will, additionally";
std::cout << std::endl << " to the header information, print the summary file content.";
std::cout << std::endl << " --psi-bulk <opt> : where <opt> consists of two items: (i) pta or tdc, ";
std::cout << std::endl << " (ii) gps | ltf | dolly | gpd | hifi. This is needed in combination with";
std::cout << std::endl << " the file formats PSI-BIN and PSI-MDU.";
std::cout << std::endl << " -i, --instrument <inst> : where <inst> is the requested instrument:";
std::cout << std::endl << " lem (default) | gps | ltf | dolly | gpd | hifi.";
std::cout << std::endl << " -h, --help : will show this help";
std::cout << std::endl << " -v, --version : will show the current version.";
std::cout << std::endl << std::endl;
@ -101,13 +104,21 @@ void dump_header_syntax()
//------------------------------------------------------------------------
/**
* <p>dumps header of a ROOT file.
*
* @param fileName file name of the ROOT file
* @param summary bool, if true dump the summary
*
* @return 0 on success, otherwise 1.
*/
int dump_header_root(const std::string fileName, const std::string fileFormat, const bool summary)
int dump_header_root(const std::string fileName, const bool summary)
{
TFile f(fileName.c_str());
if (f.IsZombie()) {
return false;
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke ROOT/MusrRoot file object." << std::endl;
std::cerr << std::endl;
return 1;
}
UInt_t fileType = DH_MUSR_ROOT;
@ -139,7 +150,7 @@ int dump_header_root(const std::string fileName, const std::string fileFormat, c
}
std::cout << std::endl << "-------------------";
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = " << fileFormat;
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = ROOT (PSI LEM).";
std::cout << std::endl << "-------------------";
std::cout << std::endl << "Run Title : " << runHeader->GetRunTitle().GetString().Data();
std::cout << std::endl << "Run Number : " << runHeader->GetRunNumber();
@ -228,15 +239,31 @@ int dump_header_root(const std::string fileName, const std::string fileFormat, c
//------------------------------------------------------------------------
/**
* <p>dumps the header information of a NeXus file.
*
* @param fileName file name of the NeXus file.
*
* @return 0 on success, 1 otherwise
*/
int dump_header_nexus(const std::string fileName) {
#ifdef PNEXUS_ENABLED
PNeXus *nxs_file = new PNeXus(fileName.c_str());
if (nxs_file == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke NeXus file object." << std::endl;
std::cerr << std::endl;
return 1;
}
if (nxs_file->IsValid(false)) {
nxs_file->Dump();
} else {
std::cerr << std::endl;
std::cerr << "**ERROR** found invalid NeXus file." << std::endl;
std::cerr << std::endl;
return 1;
}
if (nxs_file)
@ -250,7 +277,11 @@ int dump_header_nexus(const std::string fileName) {
//------------------------------------------------------------------------
/**
* <p>dump the instrument specific info for the PSI-BIN format.
*
* @param fileName file name of the PSI-BIN.
*
* @return string vector with the instrument specific info.
*/
std::vector<std::string> dump_header_instrument_info(std::string fileName)
{
@ -309,7 +340,12 @@ std::vector<std::string> dump_header_instrument_info(std::string fileName)
//------------------------------------------------------------------------
/**
* <p>dump the header information of a PSI-BIN file.
*
* @param fileName file name of the PSI-BIN
* @param fileFormat either PSI-BIN or PSI-MDU
*
* @return 0 on success, 1 otherwise
*/
int dump_header_psi_bin(const std::string fileName, const std::string fileFormat)
{
@ -318,7 +354,7 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat
bool success = false;
// read psi bin file
status = psiBin.read(fileName.c_str());
status = psiBin.Read(fileName.c_str());
switch (status) {
case 0: // everything perfect
success = true;
@ -354,15 +390,15 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat
std::cout << std::endl << "-------------------";
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = " << fileFormat;
std::cout << std::endl << "-------------------";
std::cout << std::endl << "Run Title : " << psiBin.get_comment();
std::cout << std::endl << "Run Number : " << psiBin.get_runNumber_int();
vstr = psiBin.get_timeStart_vector();
std::cout << std::endl << "Run Title : " << psiBin.GetComment();
std::cout << std::endl << "Run Number : " << psiBin.GetRunNumberInt();
vstr = psiBin.GetTimeStartVector();
if (vstr.size() < 2) {
std::cout << std::endl << "**ERROR** couldn't obtain \"Run Start Time\" will quit." << std::endl << std::endl;
return 1;
}
std::cout << std::endl << "Run Start Time : " << vstr[0] << "; " << vstr[1];
vstr = psiBin.get_timeStop_vector();
vstr = psiBin.GetTimeStopVector();
if (vstr.size() < 2) {
std::cout << std::endl << "**ERROR** couldn't obtain \"Run Stop Time\" will quit." << std::endl << std::endl;
return 1;
@ -379,31 +415,31 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat
std::cout << std::endl << "Muon Beam Momentum : " << vstr[2];
std::cout << std::endl << "Muon Species : " << vstr[3];
std::cout << std::endl << "Muon Source : " << vstr[4];
std::cout << std::endl << "Setup : " << psiBin.get_comment();
std::cout << std::endl << "Setup : " << psiBin.GetComment();
std::cout << std::endl << "Comment : n/a";
std::cout << std::endl << "Sample Name : " << psiBin.get_sample();
std::cout << std::endl << "Sample Orientation : " << psiBin.get_orient();
dVal = psiBin.get_temperatures_vector();
dErrVal = psiBin.get_devTemperatures_vector();
std::cout << std::endl << "Sample Name : " << psiBin.GetSample();
std::cout << std::endl << "Sample Orientation : " << psiBin.GetOrient();
dVal = psiBin.GetTemperaturesVector();
dErrVal = psiBin.GetDevTemperaturesVector();
if (dVal.size() != dErrVal.size()) {
std::cout << std::endl << "Sample Temperature : " << psiBin.get_temp();
std::cout << std::endl << "Sample Temperature : " << psiBin.GetTemp();
} else {
for (unsigned int i=0; i<dVal.size(); i++) {
std::cout << std::endl << "Sample Temp. " << i+1 << " : " << dVal[i] << " (" << dErrVal[i] << ") K";
}
}
std::cout << std::endl << "Sample Mag. Field : " << psiBin.get_field();
std::cout << std::endl << "No of Histos : " << psiBin.get_numberHisto_int();
std::cout << std::endl << "Time Resolution : " << psiBin.get_binWidth_ns() << " ns";
for (int i=0; i<psiBin.get_numberHisto_int(); i++) {
std::cout << std::endl << "Sample Mag. Field : " << psiBin.GetField();
std::cout << std::endl << "No of Histos : " << psiBin.GetNumberHistoInt();
std::cout << std::endl << "Time Resolution : " << psiBin.GetBinWidthNanoSec() << " ns";
for (int i=0; i<psiBin.GetNumberHistoInt(); i++) {
std::cout << std::endl << "-------------------";
std::cout << std::endl << "Histo No : " << i;
std::cout << std::endl << "Histo Name : " << psiBin.get_nameHisto(i);
std::cout << std::endl << "Histo Length : " << psiBin.get_histoLength_bin();
std::cout << std::endl << "Time Zero Bin : " << psiBin.get_t0_int(i);
std::cout << std::endl << "First Good Bin : " << psiBin.get_firstGood_int(i);
std::cout << std::endl << "Last Good Bin : " << psiBin.get_lastGood_int(i);
std::cout << std::endl << "No of Events : " << psiBin.get_eventsHisto_long(i);
std::cout << std::endl << "Histo Name : " << psiBin.GetNameHisto(i);
std::cout << std::endl << "Histo Length : " << psiBin.GetHistoLengthBin();
std::cout << std::endl << "Time Zero Bin : " << psiBin.GetT0Int(i);
std::cout << std::endl << "First Good Bin : " << psiBin.GetFirstGoodInt(i);
std::cout << std::endl << "Last Good Bin : " << psiBin.GetLastGoodInt(i);
std::cout << std::endl << "No of Events : " << psiBin.GetEventsHistoLong(i);
}
std::cout << std::endl << "-------------------" << std::endl << std::endl;
@ -412,9 +448,12 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat
//------------------------------------------------------------------------
/**
* <p>dump the header information of a MUD file.
* @param fileName file name of the MUD file
*
* @return 0 on success, 1 otherwise
*/
int dump_header_mud(const std::string fileName, const std::string fileFormat)
int dump_header_mud(const std::string fileName)
{
int fh;
UINT32 type, val;
@ -430,7 +469,7 @@ int dump_header_mud(const std::string fileName, const std::string fileFormat)
}
std::cout << std::endl << "-------------------";
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = " << fileFormat;
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = MUD";
std::cout << std::endl << "-------------------";
// run title
success = MUD_getTitle( fh, str, sizeof(str) );
@ -447,7 +486,8 @@ int dump_header_mud(const std::string fileName, const std::string fileFormat)
// start time
time_t tval;
struct tm *dt;
success = MUD_getTimeBegin( fh, (UINT32*)&tval );
success = MUD_getTimeBegin( fh, &val );
tval = static_cast<time_t>(val);
if (success) {
dt = localtime(static_cast<const time_t*>(&tval));
assert(dt);
@ -457,7 +497,8 @@ int dump_header_mud(const std::string fileName, const std::string fileFormat)
std::cout << std::endl << "Run Start Time : ???";
}
// stop time
success = MUD_getTimeEnd( fh, (UINT32*)&tval );
success = MUD_getTimeEnd( fh, &val );
tval = static_cast<time_t>(val);
if (success) {
dt = localtime(static_cast<const time_t*>(&tval));
assert(dt);
@ -588,9 +629,12 @@ int dump_header_mud(const std::string fileName, const std::string fileFormat)
//------------------------------------------------------------------------
/**
* <p>dump the header information of a WKM file.
* @param fileName file name of the WKM file.
*
* @return 0 on success, 1 otherwise
*/
int dump_header_wkm(const std::string fileName, const std::string fileFormat)
int dump_header_wkm(const std::string fileName)
{
std::ifstream fin(fileName.c_str(), std::ifstream::in);
if (!fin.is_open()) {
@ -598,7 +642,7 @@ int dump_header_wkm(const std::string fileName, const std::string fileFormat)
return 1;
}
std::cout << std::endl << "-------------------";
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = " << fileFormat;
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = WKM";
std::cout << std::endl << "-------------------";
char header[256];
while (fin.good()) {
@ -615,9 +659,11 @@ int dump_header_wkm(const std::string fileName, const std::string fileFormat)
//------------------------------------------------------------------------
/**
* @brief is_number
* @param s
* @return
* <p>checks if a string is a number
*
* @param s number string to be checked
*
* @return true if 's' is a number, false otherwise
*/
bool dump_is_number(const char *s)
{
@ -637,8 +683,9 @@ bool dump_is_number(const char *s)
//------------------------------------------------------------------------
/**
* @brief dump_current_year
* @return
* <p>reads the current year from the system and converts it to a string.
*
* @return the current year as a string.
*/
int dump_current_year()
{
@ -655,105 +702,13 @@ int dump_current_year()
//------------------------------------------------------------------------
/**
* @brief dump_create_fln
* @param runNo
* @param year
* @param fileFormat
* @return
*/
std::string dump_create_fln(std::string runNo, std::string year, std::string fileFormat, bool pta, std::string instrument)
{
std::string result = "??";
int yearShort=0;
int iRunNo=0;
if (fileFormat.empty())
fileFormat = "MusrRoot";
// make sure that a 'legal' file format has been found
if (!boost::iequals(fileFormat, "MusrRoot") &&
!boost::iequals(fileFormat, "NeXus") &&
!boost::iequals(fileFormat, "ROOT") &&
!boost::iequals(fileFormat, "PSI-BIN") &&
!boost::iequals(fileFormat, "PSI-MDU") &&
!boost::iequals(fileFormat, "MDU") &&
!boost::iequals(fileFormat, "WKM")) {
return result;
}
// if year is an empty string get the current year
int yy=-1;
std::stringstream ss;
if (year.empty()) {
yy = dump_current_year();
ss << yy;
year = ss.str();
}
yy = atoi(year.c_str());
if (yy > 2000)
yearShort = yy - 2000;
else
yearShort = yy - 1900;
iRunNo = atoi(runNo.c_str());
char fln[64];
char ptatdc[8];
if (pta)
strcpy(ptatdc, "pta");
else
strcpy(ptatdc, "tdc");
if (boost::iequals(fileFormat, "MusrRoot") || boost::iequals(fileFormat, "ROOT")) {
snprintf(fln, sizeof(fln), "lem%02d_his_%04d.root", yearShort, iRunNo);
} else if (boost::iequals(fileFormat, "NeXus")) {
snprintf(fln, sizeof(fln), "%s.nxs", runNo.c_str());
} else if (boost::iequals(fileFormat, "PSI-BIN")) {
snprintf(fln, sizeof(fln), "deltat_%s_%s_%04d.bin", ptatdc, instrument.c_str(), iRunNo);
} else if (boost::iequals(fileFormat, "PSI-MDU")) {
snprintf(fln, sizeof(fln), "%s_%s_%s_%05d.mdu", ptatdc, instrument.c_str(), year.c_str(), iRunNo);
} else if (boost::iequals(fileFormat, "MUD")) {
snprintf(fln, sizeof(fln), "%06d.msr", iRunNo);
} else if (boost::iequals(fileFormat, "WKM")) {
}
result = fln;
return result;
}
//------------------------------------------------------------------------
/**
* @brief dump_file_exists
* @param pathName
* @return
*/
bool dump_file_exists(const std::string pathName)
{
bool exists = true;
int res = access(pathName.c_str(), R_OK);
if (res < 0) {
if (errno == ENOENT) {
// file does not exist
exists = false;
} else if (errno == EACCES) {
// file exists but is not readable
exists = false;
} else {
// FAIL
exists = false;
}
}
return exists;
}
//------------------------------------------------------------------------
/**
* @brief main
* @param argc
* @param argv
* @return
* <p>dump_header allows to dump the header (meta) information for various
* muSR specific file formats.
*
* @param argc argument count
* @param argv argument list
*
* @return 0 on success, 1 otherwise
*/
int main(int argc, char *argv[])
{
@ -766,8 +721,7 @@ int main(int argc, char *argv[])
std::string fileName("");
std::string fileFormat("");
std::string year("");
bool pta(false);
std::string instrument("");
std::string instrument("lem");
bool summary(false);
for (int i=1; i<argc; i++) {
@ -776,9 +730,17 @@ 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;
#ifdef HAVE_GIT_REV_H
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 version: " << PACKAGE_VERSION << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#endif
#else
#ifdef HAVE_GIT_REV_H
std::cout << std::endl << "dump_header git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#else
std::cout << std::endl << "dump_header version: unknown" << std::endl << std::endl;
#endif
#endif
return 0;
} else if (!strcmp(argv[i], "-rn") || !strcmp(argv[i], "--runNo")) {
@ -850,29 +812,20 @@ int main(int argc, char *argv[])
i++;
} else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--summary")) {
summary = true;
} else if (!strcmp(argv[i], "--psi-bulk")) {
if (i+2 >= argc) {
std::cerr << std::endl << "**ERROR** found --psi-bulk with insufficient input!" << std::endl;
} else if (!strcmp(argv[i], "-i") || !strcmp(argv[i], "--instrument")) {
if (i+1 >= argc) {
std::cerr << std::endl << "**ERROR** found option --instrument without <instrument> input!" << std::endl;
dump_header_syntax();
return 1;
}
if (!strcmp(argv[i+1], "pta"))
pta = true;
else if (!strcmp(argv[i+1], "tdc"))
pta = false;
else {
std::cerr << std::endl << "**ERROR** found --psi-bulk with 1st argument '" << argv[i+1] << "'! Allowed is 'pta' or 'tdc'." << std::endl;
if (strcmp(argv[i+1], "lem") && strcmp(argv[i+1], "gps") && strcmp(argv[i+1], "ltf") &&
strcmp(argv[i+1], "dolly") && strcmp(argv[i+1], "gpd") && strcmp(argv[i+1], "hifi")) {
std::cerr << std::endl << "**ERROR** found --instrument with unkown instrument name: '" << argv[i+1] << "'!" << std::endl;
dump_header_syntax();
return 1;
}
if (strcmp(argv[i+2], "gps") && strcmp(argv[i+2], "ltf") && strcmp(argv[i+2], "dolly") &&
strcmp(argv[i+2], "gpd") && strcmp(argv[i+2], "hifi")) {
std::cerr << std::endl << "**ERROR** found --psi-bulk with 2nd argument '" << argv[i+1] << "'! This is an unkown instrument." << std::endl;
dump_header_syntax();
return 1;
}
instrument = argv[i+2];
i += 2;
instrument = argv[i+1];
i++;
} else {
std::cerr << std::endl << "**ERROR** found unkown option '" << argv[i] << "'." << std::endl;
dump_header_syntax();
@ -932,67 +885,25 @@ int main(int argc, char *argv[])
}
}
// runNo given, hence try to create the necessary file name based on the provided information
if (runNo != "") {
std::string str = dump_create_fln(runNo, year, fileFormat, pta, instrument);
if (str == "??") {
std::cerr << std::endl << "**ERROR** couldn't get a proper file name." << std::endl;
return 1;
}
fileName = str;
}
bool found_fln = false;
// try to find path-file-name via run name templates
std::string pathFln("");
// 1st check if the file name is the full path-file name and the file exists
pathFln = fileName;
if (dump_file_exists(pathFln))
found_fln = true;
// 2nd check if the file name is found in the current directory
if (!found_fln) {
pathFln = "./" + fileName;
if (dump_file_exists(pathFln))
found_fln = true;
}
// 3rd check if file name is found in any default search paths if not already found in the current directory
if (!found_fln) {
PStringVector pathList = startupHandler->GetDataPathList();
for (unsigned int i=0; i<pathList.size(); i++) {
if (boost::iequals(fileFormat, "MusrRoot") || boost::iequals(fileFormat, "ROOT") ||
boost::iequals(fileFormat, "WKM")) {
pathFln = pathList[i] + "/" + year + "/" + fileName;
} else {
if (pta)
pathFln = pathList[i] + "/d" + year + "/pta/" + fileName;
else
pathFln = pathList[i] + "/d" + year + "/tdc/" + fileName;
}
if (dump_file_exists(pathFln)) {
found_fln = true;
break;
}
if (fileName == "") { // only look for runs if the file name is not explicitly given
int yy = static_cast<int>(strtod(year.c_str(), static_cast<char**>(nullptr)));
int run = static_cast<int>(strtod(runNo.c_str(), static_cast<char**>(nullptr)));
PFindRun findRun(startupHandler->GetDataPathList(), startupHandler->GetRunNameTemplateList(), instrument, yy, run);
if (findRun.FoundPathName()) {
pathFln = findRun.GetPathName().Data();
} else {
std::cout << "debug> Couldn't find run: " << run << " for instrument " << instrument << ", and year: " << year << std::endl;
return 1;
}
}
if (!found_fln) {
std::cerr << "**ERROR** couldn't find any appropriate file." << std::endl;
// cleanup
if (saxParser) {
delete saxParser;
saxParser = 0;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
return 1;
} else { // file name explicitly provided, hence use this as pathFln
pathFln = fileName;
}
// if file format is not given explicitly try to guess it based on the file name extension
if ((fileFormat == "") && (fileName != "")) {
std::string fln(fileName);
if (fileFormat == "") {
std::string fln(pathFln);
boost::to_lower(fln);
if (fln.find(".root") != std::string::npos)
fileFormat = "MusrRoot"; // could be old ROOT (LEM) as well
@ -1018,7 +929,7 @@ int main(int argc, char *argv[])
boost::to_lower(fileFormat);
if (boost::iequals(fileFormat, "MusrRoot") || boost::iequals(fileFormat, "ROOT")) {
dump_header_root(pathFln, fileFormat, summary);
dump_header_root(pathFln, summary);
} else if (boost::iequals(fileFormat, "NeXus")) {
#ifdef PNEXUS_ENABLED
dump_header_nexus(pathFln);
@ -1028,9 +939,9 @@ int main(int argc, char *argv[])
} else if (boost::iequals(fileFormat, "PSI-BIN") || boost::iequals(fileFormat, "PSI-MDU")) {
dump_header_psi_bin(pathFln, fileFormat);
} else if (boost::iequals(fileFormat, "MUD")) {
dump_header_mud(pathFln, fileFormat);
dump_header_mud(pathFln);
} else if (boost::iequals(fileFormat, "WKM")) {
dump_header_wkm(pathFln, fileFormat);
dump_header_wkm(pathFln);
}
// cleanup

View File

@ -11,7 +11,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter, Bastian M. Wojek *
* Copyright (C) 2007-2021 by Andreas Suter, Bastian M. Wojek *
* *
* *
* This program is free software; you can redistribute it and/or modify *
@ -403,7 +403,7 @@ void BMWStartupHandler::CheckLists()
<< "BMWStartupHandler::CheckLists: Most probably this will go wrong and should therefore be fixed in the xml-file!" << std::endl;
char eChar[5];
for(unsigned int i(0); i<fEnergyList.size(); i++) {
sprintf(eChar, "%02.1f", fEnergyList[i]);
snprintf(eChar, sizeof(eChar), "%02.1f", fEnergyList[i]);
fEnergyLabelList.push_back(std::string(eChar));
}
}

View File

@ -11,7 +11,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2020 by Andreas Suter, Bastian M. Wojek *
* Copyright (C) 2007-2021 by Andreas Suter, Bastian M. Wojek *
* *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -47,7 +47,6 @@ set_target_properties(BMWtools
#--- make sure that the include directory is found ----------------------------
target_include_directories(
BMWtools BEFORE PRIVATE
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CUBA_INC}>
$<BUILD_INTERFACE:${MUSRFIT_INC}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>

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

@ -1,16 +1,14 @@
/***************************************************************************
PNL_RgeHandler.h
PDummyUserFcn.h
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
$Id$
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2019 by Andreas Suter *
* Copyright (C) 2013-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -29,27 +27,55 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#ifndef _PNL_RGEHANDLER_H_
#define _PNL_RGEHANDLER_H_
#ifndef _PDUMMYUSERFNC_H_
#define _PDUMMYUSERFNC_H_
#include "PNonlocal.h"
#include <vector>
class PNL_RgeHandler
#include "PUserFcnBase.h"
class PDummyUserFcnGlobal
{
public:
PNL_RgeHandler(const PStringVector &rgeDataPathList, const PDoubleVector &rgeDataEnergyList);
virtual ~PNL_RgeHandler();
PDummyUserFcnGlobal();
virtual ~PDummyUserFcnGlobal();
virtual Bool_t IsValid() { return fIsValid; }
virtual Int_t GetRgeEnergyIndex(const Double_t energy);
virtual Double_t GetRgeValue(const Double_t energy, const Double_t dist);
virtual Double_t GetRgeValue(const Int_t index, const Double_t dist);
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 fIsValid;
PNL_RgeDataList fRgeDataList;
Bool_t fValid{true};
virtual Bool_t LoadRgeData(const PStringVector &rgeDataPathList, const PDoubleVector &rgeDataEnergyList);
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)
};
#endif // _PNL_RGEHANDLER_H_
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

@ -1,16 +1,15 @@
/***************************************************************************
PSimulateMuTransitionLinkDef.h
PDummyUserFcnLinkDef.h
Author: Thomas Prokscha
Date: 25-Feb-2010
$Id$
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2010 by Thomas Prokscha, Paul Scherrer Institut *
* 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 *
@ -28,13 +27,13 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
// changed for root6
#ifdef __CINT__
#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
#pragma link C++ class PSimulateMuTransition+;
#pragma link C++ class PDummyUserFcnGlobal+;
#pragma link C++ class PDummyUserFcn+;
#endif

View File

@ -0,0 +1,76 @@
# - 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${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:${MUSRFIT_INC}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
)
#--- add library dependencies -------------------------------------------------
target_link_libraries(PDummyUserFcn ${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

@ -7,7 +7,7 @@ root_generate_dictionary(
PMagProximityFitterDict
PMagProximityFitter.h
OPTIONS
-I${FFTW3_INCLUDE_DIR}
-I${FFTW3_INCLUDE}
-I${MUSRFIT_INC}
-I${CMAKE_CURRENT_SOURCE_DIR}
-inlineInputHeader
@ -38,14 +38,13 @@ configure_file("PMagProximityFitter.pc.in" "PMagProximityFitter.pc" @ONLY)
add_library(PMagProximityFitter SHARED
PMagProximityFitter.cpp
PMagProximityFitterDict.cxx
PMPRgeHandler.cpp
PMPStartupHandler.cpp
PMPStartupHandlerDict.cxx
)
#--- make sure that the include directory is found ----------------------------
target_include_directories(
PMagProximityFitter BEFORE PRIVATE
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
$<BUILD_INTERFACE:${MUSRFIT_INC}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)
@ -57,7 +56,7 @@ set_target_properties(PMagProximityFitter
)
#--- add library dependencies -------------------------------------------------
target_link_libraries(PMagProximityFitter ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} PUserFcnBase)
target_link_libraries(PMagProximityFitter FFTW3::FFTW3 ${ROOT_LIBRARIES} PRgeHandler PUserFcnBase)
#--- install PMagProximityFitter solib ----------------------------------------
install(TARGETS PMagProximityFitter DESTINATION lib)
@ -76,7 +75,6 @@ install(
FILES
PMagProximity.h
PMagProximityFitter.h
PMPRgeHandler.h
PMPStartupHandler.h
DESTINATION
include

View File

@ -1,212 +0,0 @@
/***************************************************************************
PMPRgeHandler.cpp
Author: Andreas Suter
e-mail: andreas.suter@psi.ch
***************************************************************************/
/***************************************************************************
* Copyright (C) 2011-2019 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 <iostream>
#include <fstream>
#include "PMPRgeHandler.h"
//--------------------------------------------------------------------------
// Constructor
//--------------------------------------------------------------------------
/**
*
*/
PMPRgeHandler::PMPRgeHandler(const PStringVector &rgeDataPathList, const PDoubleVector &rgeDataEnergyList)
{
fIsValid = false;
fIsValid = LoadRgeData(rgeDataPathList, rgeDataEnergyList);
}
//--------------------------------------------------------------------------
// Destructor
//--------------------------------------------------------------------------
/**
*
*/
PMPRgeHandler::~PMPRgeHandler()
{
fRgeDataList.clear();
}
//--------------------------------------------------------------------------
// GetRgeEnergyIndex
//--------------------------------------------------------------------------
/**
*
* \param energy in (keV)
*/
Int_t PMPRgeHandler::GetRgeEnergyIndex(const Double_t energy)
{
Int_t idx = -1;
for (UInt_t i=0; i<fRgeDataList.size(); i++) {
if (energy == fRgeDataList[i].energy) {
idx = i;
break;
}
}
return idx;
}
//--------------------------------------------------------------------------
// GetRgeValue
//--------------------------------------------------------------------------
/**
*
* \param energy in (keV)
* \param dist in (nm)
*/
Double_t PMPRgeHandler::GetRgeValue(const Int_t index, const Double_t dist)
{
Double_t rgeVal = 0.0;
UInt_t distIdx = static_cast<UInt_t>(dist/(fRgeDataList[index].stoppingDistance[1]-fRgeDataList[index].stoppingDistance[0]));
if (distIdx >= fRgeDataList[index].stoppingDistance.size()) {
rgeVal = 0.0;
} else {
rgeVal = fRgeDataList[index].stoppingAmplitude[distIdx] +
(fRgeDataList[index].stoppingAmplitude[distIdx+1] - fRgeDataList[index].stoppingAmplitude[distIdx]) *
(dist-fRgeDataList[index].stoppingDistance[distIdx])/(fRgeDataList[index].stoppingDistance[distIdx+1]-fRgeDataList[index].stoppingDistance[distIdx]);
}
return rgeVal;
}
//--------------------------------------------------------------------------
// GetRgeValue
//--------------------------------------------------------------------------
/**
*
* \param energy in (keV)
* \param dist in (nm)
*/
Double_t PMPRgeHandler::GetRgeValue(const Double_t energy, const Double_t dist)
{
// check if energy is present in rge data list
Int_t idx = -1;
for (UInt_t i=0; i<fRgeDataList.size(); i++) {
if (energy == fRgeDataList[i].energy) {
idx = i;
break;
}
}
// energy not found
if (idx == -1)
return -1.0;
return GetRgeValue(idx, dist);
}
//--------------------------------------------------------------------------
// LoadRgeData
//--------------------------------------------------------------------------
/**
*
*/
Bool_t PMPRgeHandler::LoadRgeData(const PStringVector &rgeDataPathList, const PDoubleVector &rgeDataEnergyList)
{
std::ifstream fin;
PMPRgeData data;
Int_t idx=0;
TString dataName, tstr;
char line[512];
int result;
double dist, val;
for (UInt_t i=0; i<rgeDataPathList.size(); i++) {
// open rge-file for reading
fin.open(rgeDataPathList[i].Data(), std::iostream::in);
if (!fin.is_open()) {
std::cout << std::endl << "PMPRgeHandler::LoadRgeData **ERROR**";
std::cout << std::endl << " Could not open file " << rgeDataPathList[i].Data();
std::cout << std::endl;
return false;
}
// keep energy (in keV)
data.energy = rgeDataEnergyList[i]/1000.0;
// read msr-file
idx = 0;
while (!fin.eof()) {
// read a line
fin.getline(line, sizeof(line));
idx++;
// ignore first line
if (idx <= 1)
continue;
// ignore empty lines
tstr = line;
if (tstr.IsWhitespace())
continue;
// get values
result = sscanf(line, "%lf %lf", &dist, &val);
// check if data are valid
if (result != 2) {
fin.close();
return false;
}
// feed fRgeDataList
data.stoppingDistance.push_back(dist/10.0); // keep distancies in (nm)
data.stoppingAmplitude.push_back(val);
}
// normalize stopping distribution
Double_t norm = 0.0;
for (UInt_t j=0; j<data.stoppingAmplitude.size(); j++)
norm += data.stoppingAmplitude[j];
norm *= (data.stoppingDistance[1] - data.stoppingDistance[0]);
for (UInt_t j=0; j<data.stoppingAmplitude.size(); j++)
data.stoppingAmplitude[j] /= norm;
// keep data
fRgeDataList.push_back(data);
// clean up
data.stoppingAmplitude.clear();
data.stoppingDistance.clear();
fin.close();
}
return true;
}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2011-2019 by Andreas Suter *
* Copyright (C) 2011-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2011-2019 by Andreas Suter *
* Copyright (C) 2011-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2011-2019 by Andreas Suter *
* Copyright (C) 2011-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2011-2019 by Andreas Suter *
* Copyright (C) 2011-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -50,11 +50,11 @@ typedef std::vector<Double_t> PDoubleVector;
/**
* <p>
*/
typedef struct {
struct PMPRgeData {
Double_t energy;
PDoubleVector stoppingDistance;
PDoubleVector stoppingAmplitude;
} PMPRgeData;
};
//-------------------------------------------------------------
/**

View File

@ -10,7 +10,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2011-2019 by Andreas Suter *
* Copyright (C) 2011-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -89,7 +89,7 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
}
// load all the TRIM.SP rge-files
fRgeHandler = new PMPRgeHandler(fStartupHandler->GetTrimSpDataPathList(), fStartupHandler->GetTrimSpDataVectorList());
fRgeHandler = new PRgeHandler();
if (!fRgeHandler->IsValid()) {
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2019 by Andreas Suter *
* Copyright (C) 2009-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -32,7 +32,7 @@
#include "PUserFcnBase.h"
#include "PMPStartupHandler.h"
#include "PMPRgeHandler.h"
#include "PRgeHandler.h"
class PMagProximityFitterGlobal
{
@ -42,15 +42,15 @@ class PMagProximityFitterGlobal
Bool_t IsValid() { return fValid; }
virtual void CalculateField(const std::vector<Double_t> &param) const;
virtual Int_t GetEnergyIndex(const Double_t energy) { return fRgeHandler->GetRgeEnergyIndex(energy); }
virtual Double_t GetMuonStoppingDensity(const Int_t energyIndex, const Double_t z) const { return fRgeHandler->GetRgeValue(energyIndex, z); }
virtual Int_t GetEnergyIndex(const Double_t energy) { return fRgeHandler->GetEnergyIndex(energy); }
virtual Double_t GetMuonStoppingDensity(const Int_t energyIndex, const Double_t z) const { return fRgeHandler->Get_n(energyIndex, z); }
virtual Double_t GetMagneticField(const Double_t z) const;
private:
Bool_t fValid;
PMPStartupHandler *fStartupHandler;
PMPRgeHandler *fRgeHandler;
PRgeHandler *fRgeHandler;
mutable std::vector<Double_t> fPreviousParam;

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2011-2019 by Andreas Suter *
* Copyright (C) 2011-2021 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

@ -3,13 +3,14 @@
<comment>
contains meta file infromation of the needed trim.sp files.
</comment>
<trim_sp_part>
<data_path>/mnt/home/nemu/analysis/2010/EuS-Co/trimsp2/EuS-Co_E</data_path>
<trim_sp>
<data_path>/afs/psi.ch/project/nemu/analysis/2010/EuS-Co/trimsp2</data_path>
<rge_fln_pre>EuS-Co_E</rge_fln_pre>
<energy_list>
<energy>5030</energy>
<energy>6330</energy>
<energy>7530</energy>
<energy>8730</energy>
</energy_list>
</trim_sp_part>
</trim_sp>
</mag_proximity>

View File

@ -5,7 +5,7 @@ set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "\$\{prefix\}")
set(libdir "\$\{exec_prefix\}/lib")
set(includedir "\$\{prefix\}/include")
set(PSIBIN_VERSION "0.1.0")
set(PSIBIN_VERSION "0.2.0")
set(PSIBIN_LIBRARY_NAME "Class_MuSR_PSI")
configure_file("Class_MuSR_PSI.pc.in" "Class_MuSR_PSI.pc" @ONLY)

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More