Compare commits
90 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 901fda9298 | |||
| 7115c0027c | |||
| 7d5aaf6429 | |||
| 79b05cced7 | |||
| 08350a2fde | |||
| 22b1ad7f2f | |||
| bb8bdafddd | |||
| d5e305411f | |||
| 50187b0c65 | |||
| d7908573b8 | |||
| 9aae350c13 | |||
| 390b9770ca | |||
| ba939574a4 | |||
| c50e4a3a06 | |||
| f00f188f0b | |||
| 5a2f45c083 | |||
| 4136806847 | |||
| 6a41458310 | |||
| d70fd34345 | |||
| 3858cc723a | |||
| a6f5b956bf | |||
| 86ecfc84af | |||
| 8cb4fc7221 | |||
| 95d087164d | |||
| 8f3ad0c61d | |||
| 49d42c93ba | |||
| df379b834e | |||
| 3bb004ea2d | |||
| fc478d27c7 | |||
| c690965025 | |||
| 300c9200df | |||
| 4dcef1a835 | |||
| 4519a0b76e | |||
| 3aecdbf0a8 | |||
| dfa8852cfe | |||
| 29fbb4a62b | |||
| de8b02b94d | |||
| dd2f743b3a | |||
| d5dbc12175 | |||
| 643be9738f | |||
| 88b5e492dd | |||
| 810306cb2a | |||
| 43cb8b2460 | |||
| ceb9673330 | |||
| da0b356e3b | |||
| b262ee33c5 | |||
| 12888be4c9 | |||
| 867ac4895b | |||
| a6c9120d06 | |||
| 417901e271 | |||
| 8d1dcef2de | |||
| 30fbd8eb67 | |||
| 76dbd757e3 | |||
| c894c21bf3 | |||
| 008ca7210a | |||
| 60f11dfc0e | |||
| 3aaca28c87 | |||
| d4f0855b19 | |||
| 9d173203ff | |||
| 00c980af68 | |||
| fb9d6e917c | |||
| 2eb0cf28d5 | |||
| 8b054b77b9 | |||
| 4e29ad6898 | |||
| 4ac7a7d01c | |||
| 65efb389c3 | |||
| 83c8f6630c | |||
| 227bfb7419 | |||
| 70eb0397df | |||
| 3c02c6073a | |||
| b3e4d247f0 | |||
| 6aaed94adf | |||
| c3e9c03920 | |||
| 909fa6519d | |||
| 3eea73f07a | |||
| f66c832d56 | |||
| 4de660788d | |||
| 990e280c8f | |||
| af3c8832fe | |||
| 7615e791d3 | |||
| 394ea01d37 | |||
| d19d7b59c8 | |||
| 7dc0a237dc | |||
| 1b4b9cc238 | |||
| 123acec405 | |||
| eaa2ba8faf | |||
| 8b9ac6e5b1 | |||
| 2601e80c8a | |||
| 1b91d8b281 | |||
| db54db3394 |
@@ -1,7 +1,12 @@
|
||||
# - musrfit
|
||||
cmake_minimum_required(VERSION 3.17)
|
||||
|
||||
project(musrfit VERSION 1.9.10 LANGUAGES C CXX)
|
||||
# cmake: use BoostConfig.cmake instead of FindBoost
|
||||
if (CMAKE_VERSION GREATER_EQUAL "3.3")
|
||||
cmake_policy(SET CMP0167 NEW)
|
||||
endif ()
|
||||
|
||||
project(musrfit VERSION 1.10.0 LANGUAGES C CXX)
|
||||
|
||||
#--- musrfit specific options -------------------------------------------------
|
||||
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
|
||||
@@ -206,13 +211,40 @@ if (qt_based_tools)
|
||||
endif (qt_version STREQUAL 3)
|
||||
endif (qt_based_tools)
|
||||
|
||||
#--- if NeXus check also for HDF4, HDF5, and MXML -----------------------------
|
||||
#--- if NeXus check also for HDF4 (optional), HDF5 ----------------------------
|
||||
if (nexus)
|
||||
find_package(HDF5 COMPONENTS CXX REQUIRED)
|
||||
if (HAVE_HDF4)
|
||||
find_package(HDF4 REQUIRED)
|
||||
#--- check for HDF4 -----------------------------------------------------------
|
||||
# Find HDF4 manually (pkg-config often doesn't have hdf4)
|
||||
find_path(HDF4_INCLUDE_DIR
|
||||
NAMES mfhdf.h
|
||||
PATHS /usr/include /usr/local/include
|
||||
PATH_SUFFIXES hdf
|
||||
)
|
||||
|
||||
find_library(HDF4_DF_LIBRARY
|
||||
NAMES df libdf
|
||||
PATHS /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib
|
||||
)
|
||||
|
||||
find_library(HDF4_MFHDF_LIBRARY
|
||||
NAMES mfhdf libmfhdf
|
||||
PATHS /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib
|
||||
)
|
||||
|
||||
if (HDF4_INCLUDE_DIR AND HDF4_DF_LIBRARY AND HDF4_MFHDF_LIBRARY)
|
||||
set(HDF4_FOUND TRUE)
|
||||
set(HDF4_INCLUDE_DIRS ${HDF4_INCLUDE_DIR})
|
||||
set(HDF4_LIBRARIES ${HDF4_MFHDF_LIBRARY} ${HDF4_DF_LIBRARY})
|
||||
message(STATUS "Found HDF4: ${HDF4_INCLUDE_DIR}")
|
||||
message(STATUS " HDF4 libraries: ${HDF4_LIBRARIES}")
|
||||
else()
|
||||
message(FATAL_ERROR "HDF4 library not found. Please install libhdf4-dev or hdf-devel")
|
||||
endif()
|
||||
|
||||
add_definitions(-DHAVE_HDF4)
|
||||
endif (HAVE_HDF4)
|
||||
find_package(NEXUS REQUIRED)
|
||||
add_definitions(-DPNEXUS_ENABLED)
|
||||
endif (nexus)
|
||||
|
||||
@@ -234,13 +266,15 @@ endif ()
|
||||
|
||||
#--- start create git-revision.h ----------------------------------------------
|
||||
if (IS_GIT_REPO)
|
||||
execute_process(COMMAND sh ${CMAKE_SOURCE_DIR}/src/git_revision.sh)
|
||||
add_custom_target(git_revision ALL
|
||||
COMMAND sh ${CMAKE_SOURCE_DIR}/src/git_revision.sh ${CMAKE_BINARY_DIR}/src
|
||||
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
|
||||
COMMENT "Checking git revision"
|
||||
)
|
||||
|
||||
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
||||
set(GIT_REV_H "git-revision.h")
|
||||
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
||||
else (IS_GIT_REPO)
|
||||
set(HAVE_GIT_REV_H "")
|
||||
set(GIT_REV_H "")
|
||||
set(HAVE_GIT_REV_H "")
|
||||
endif (IS_GIT_REPO)
|
||||
|
||||
#--- end create git-revision.h ------------------------------------------------
|
||||
@@ -271,6 +305,10 @@ set(CMAKE_INSTALL_RPATH "${rpath}")
|
||||
#--- propagate to the sub-directories -----------------------------------------
|
||||
add_subdirectory(src)
|
||||
|
||||
#--- testing ------------------------------------------------------------------
|
||||
enable_testing()
|
||||
add_subdirectory(tests)
|
||||
|
||||
#--- write summary of the installation
|
||||
cmake_host_system_information(RESULT PROCESSOR QUERY PROCESSOR_DESCRIPTION)
|
||||
|
||||
@@ -315,7 +353,6 @@ if (nexus)
|
||||
message(" HDF4 not present.")
|
||||
endif (HAVE_HDF4)
|
||||
message(" HDF5 found in ${HDF5_INCLUDE_DIRS}, Version: ${HDF5_VERSION}")
|
||||
message(" NeXus found in ${NEXUS_INCLUDE_DIR}, Version: ${NEXUS_VERSION_STRING}")
|
||||
endif (nexus)
|
||||
|
||||
message("")
|
||||
|
||||
@@ -12,6 +12,13 @@ or
|
||||
|
||||
https://bitbucket.org/muonspin/musrfit
|
||||
|
||||
Release of V1.10.0, 2026/02/21
|
||||
==============================
|
||||
|
||||
ditch the use of the NeXus lib. NeXus files are now directly read via hdf4/5
|
||||
add deadtime correction of pulsed sources, assuming the relevant parameters are
|
||||
present in the file.
|
||||
|
||||
Release of V1.9.10, 2026/01/16
|
||||
==============================
|
||||
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
## Process this file with cmake
|
||||
#=============================================================================
|
||||
# NeXus - Neutron & X-ray Common Data Format
|
||||
#
|
||||
# CMakeLists for building the NeXus library and applications.
|
||||
#
|
||||
# Copyright (C) 2011 Stephen Rankin
|
||||
#
|
||||
# This library is free software; you can redistribute it and/or modify it
|
||||
# under the terms of the GNU Lesser General Public License as published by the
|
||||
# Free Software Foundation; either version 2 of the License, or (at your
|
||||
# option) any later version.
|
||||
#
|
||||
# This library 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 Lesser General Public License
|
||||
# for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this library; if not, write to the Free Software Foundation,
|
||||
# Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
|
||||
#
|
||||
# For further information, see <http://www.nexusformat.org>
|
||||
#
|
||||
#
|
||||
#=============================================================================
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# find the runtime binaries of the HDF4 library
|
||||
#------------------------------------------------------------------------------
|
||||
find_library(HDF4_DF_LIBRARY NAMES df hdf
|
||||
HINTS ENV HDF4_ROOT
|
||||
PATH_SUFFIXES hdf)
|
||||
|
||||
|
||||
if(HDF4_DF_LIBRARY MATCHES HDF4_DF_LIBRARY-NOTFOUND)
|
||||
message(FATAL_ERROR "Could not find HDF4 DF library!")
|
||||
else()
|
||||
get_filename_component(HDF4_LIBRARY_DIRS ${HDF4_DF_LIBRARY} PATH)
|
||||
message(STATUS "Found HDF4 DF library: ${HDF4_DF_LIBRARY}")
|
||||
message(STATUS "HDF4 libary path: ${HDF4_LIBRARY_DIRS}")
|
||||
endif()
|
||||
|
||||
find_library(HDF4_MFHDF_LIBRARY NAMES mfhdf
|
||||
HINTS ENV HDF4_ROOT
|
||||
PATH_SUFFIXES hdf)
|
||||
|
||||
if(HDF4_MFHDF_LIBRARY MATCHES HDF4_MFHDF_LIBRARY-NOTFOUND)
|
||||
message(FATAL_ERROR "Could not find HDF5 MFHDF library!")
|
||||
else()
|
||||
message(STATUS "Found HDF4 MFHDF library: ${HDF4_MFHDF_LIBRARY}")
|
||||
endif()
|
||||
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# find the HDF4 header file
|
||||
#------------------------------------------------------------------------------
|
||||
find_path(HDF4_INCLUDE_DIRS mfhdf.h
|
||||
HINTS ENV HDF4_ROOT
|
||||
PATH_SUFFIXES hdf)
|
||||
|
||||
if(HDF4_INCLUDE_DIRS MATCHES HDF4_INCLUDE_DIRS-NOTFOUND)
|
||||
message(FATAL_ERROR "Could not find HDF4 header files")
|
||||
else()
|
||||
message(STATUS "Found HDF4 header files in: ${HDF4_INCLUDE_DIRS}")
|
||||
endif()
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# search for additional packages required to link against HDF4
|
||||
#------------------------------------------------------------------------------
|
||||
find_package(JPEG REQUIRED)
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
# add libraries to the link list for NAPI
|
||||
#------------------------------------------------------------------------------
|
||||
get_filename_component(LIB_EXT ${HDF4_DF_LIBRARY} EXT)
|
||||
if(LIB_EXT MATCHES .a)
|
||||
message(STATUS "HDF4 DF library is static")
|
||||
list(APPEND NAPI_LINK_LIBS "-Wl,-whole-archive" ${HDF4_DF_LIBRARY} "-Wl,-no-whole-archive")
|
||||
else()
|
||||
list(APPEND NAPI_LINK_LIBS ${HDF4_DF_LIBRARY})
|
||||
endif()
|
||||
|
||||
|
||||
get_filename_component(LIB_EXT ${HDF4_MFHDF_LIBRARY} EXT)
|
||||
if(LIB_EXT MATCHES .a)
|
||||
message(STATUS "HDF4 MFHDF library is static")
|
||||
list(APPEND NAPI_LINK_LIBS "-Wl,-whole-archive" ${HDF4_MFHDF_LIBRARY} "-Wl,-no-whole-archive")
|
||||
else()
|
||||
list(APPEND NAPI_LINK_LIBS ${HDF4_MFHDF_LIBRARY})
|
||||
endif()
|
||||
|
||||
list(APPEND NAPI_LINK_LIBS jpeg)
|
||||
|
||||
include_directories ( SYSTEM ${HDF4_INCLUDE_DIRS} )
|
||||
link_directories(${HDF4_LIBRARY_DIRS})
|
||||
@@ -1,34 +0,0 @@
|
||||
# - find MXML
|
||||
# find the MXML lib and includes
|
||||
# This module defines
|
||||
# LIBMXML_INCLUDE_DIR, where to find mxml.h
|
||||
# LIBMXML_LIBRARY, library to link against
|
||||
# LIBMXML_FOUND, if false, do not try to use the MXML lib
|
||||
|
||||
find_path(LIBMXML_INCLUDE_DIR mxml.h
|
||||
HINT "/usr/include"
|
||||
)
|
||||
# find position of mxml.h from the end
|
||||
string(FIND "${LIBMXML_INCLUDE_DIR}" "/mxml.h" pos REVERSE)
|
||||
# truncate the string
|
||||
string(SUBSTRING "${LIBMXML_INCLUDE_DIR}" 0 ${pos} substr)
|
||||
set(LIBMXML_INCLUDE_DIR ${substr})
|
||||
unset(substr)
|
||||
|
||||
find_library(LIBMXML_LIBRARY mxml)
|
||||
|
||||
# get version string
|
||||
# currently do not know from where to get it automatically
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set LIBMXML_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(MXML
|
||||
REQUIRED_VARS LIBMXML_LIBRARY LIBMXML_INCLUDE_DIR)
|
||||
|
||||
if (NOT LIBMXML_FOUND)
|
||||
unset(LIBMXML_LIBRARY)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(LIBMXML_INCLUDE_DIR LIBMXML_LIBRARY)
|
||||
|
||||
@@ -1,45 +0,0 @@
|
||||
# - Find NeXus library
|
||||
# Find the native NEXUS includes and library
|
||||
# This module defines
|
||||
# NEXUS_INCLUDE_DIR, where to find NeXus.h, etc.
|
||||
# NEXUS_LIBRARY, library to link against to use NEXUS
|
||||
# NEXUS_FOUND, if false, do not try to use NEXUS.
|
||||
|
||||
find_path(NEXUS_INCLUDE_DIR napi.h
|
||||
HINTS "/usr/local/include" "/opt/nexus/include" "/usr/local/include/nexus"
|
||||
)
|
||||
# find position of napi.h from the end
|
||||
string(FIND "${NEXUS_INCLUDE_DIR}" "/napi.h" pos REVERSE)
|
||||
# truncate the string
|
||||
string(SUBSTRING "${NEXUS_INCLUDE_DIR}" 0 ${pos} substr)
|
||||
set(NEXUS_INCLUDE_DIR ${substr})
|
||||
unset(substr)
|
||||
|
||||
find_library(NEXUS_LIBRARY NeXus
|
||||
HINTS "/usr/lib" "/usr/lib64" "/usr/local/lib" "/usr/local/lib64" "/opt/nexus/lib")
|
||||
|
||||
# get version string
|
||||
if (NEXUS_INCLUDE_DIR AND EXISTS ${NEXUS_INCLUDE_DIR}/napi.h)
|
||||
file(STRINGS "${NEXUS_INCLUDE_DIR}/napi.h" NEXUS_version_str
|
||||
REGEX "^#define[\t ]+NEXUS_VERSION[\t ].*")
|
||||
|
||||
string(REGEX REPLACE "^#define[\t ]+NEXUS_VERSION[\t ]+\"([^\"]*).*"
|
||||
"\\1" NEXUS_VERSION_STRING "${NEXUS_version_str}")
|
||||
unset(NEXUS_version_str)
|
||||
endif()
|
||||
|
||||
# handle the QUIETLY and REQUIRED arguments and set NEXUS_FOUND to TRUE if
|
||||
# all listed variables are TRUE
|
||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||
FIND_PACKAGE_HANDLE_STANDARD_ARGS(NEXUS
|
||||
REQUIRED_VARS NEXUS_LIBRARY NEXUS_INCLUDE_DIR
|
||||
VERSION_VAR NEXUS_VERSION_STRING)
|
||||
|
||||
if (NOT NEXUS_FOUND)
|
||||
unset(NEXUS_LIBRARY)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(NEXUS_INCLUDE_DIR NEXUS_LIBRARY)
|
||||
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
Binary file not shown.
BIN
doc/examples/data/emu00139040.nxs
Normal file
BIN
doc/examples/data/emu00139040.nxs
Normal file
Binary file not shown.
BIN
doc/examples/data/lem15_his_2992.root
Normal file
BIN
doc/examples/data/lem15_his_2992.root
Normal file
Binary file not shown.
BIN
doc/examples/data/lem15_his_2993.root
Normal file
BIN
doc/examples/data/lem15_his_2993.root
Normal file
Binary file not shown.
BIN
doc/examples/data/lem15_his_2994.root
Normal file
BIN
doc/examples/data/lem15_his_2994.root
Normal file
Binary file not shown.
@@ -1,34 +1,34 @@
|
||||
nc-ZnO T=80 F=69
|
||||
Ag_T=100_F=20
|
||||
###############################################################
|
||||
FITPARAMETER
|
||||
# No Name Value Step Pos_Error Boundaries
|
||||
1 alpha 0.88008 -0.00063 0.00063
|
||||
2 asym 0.1708 -0.0017 0.0017 0 0.3
|
||||
3 phase 3.90 -0.38 0.38 0 100
|
||||
4 field 71.003 -0.036 0.036 0 none
|
||||
5 rate 0.1526 -0.0024 0.0024 0 100
|
||||
6 beta 1.231 -0.046 0.047
|
||||
1 alpha 1.02344 -0.00095 0.00095
|
||||
2 asym 0.23676 -0.00098 0.00098 0 0.3
|
||||
3 phase 0 0 none 0 100
|
||||
4 field 20.300 -0.010 0.010 0 none
|
||||
5 rate 0.0040 -0.0013 0.0013 0 100
|
||||
|
||||
###############################################################
|
||||
THEORY
|
||||
asymmetry 2
|
||||
TFieldCos 3 fun1 (phase frequency)
|
||||
generExpo 5 6 (rate exponent)
|
||||
simplExpo 5 (rate)
|
||||
|
||||
###############################################################
|
||||
FUNCTIONS
|
||||
fun1 = gamma_mu * par4
|
||||
|
||||
###############################################################
|
||||
RUN data/EMU00005989_v2 EMU ISIS NEXUS (name beamline institute data-file-format)
|
||||
RUN data/emu00139040 EMU ISIS NEXUS (name beamline institute data-file-format)
|
||||
fittype 2 (asymmetry fit)
|
||||
alpha 1
|
||||
map 0 0 0 0 0 0 0 0 0 0
|
||||
forward 1-16
|
||||
backward 17-32
|
||||
forward 1-48
|
||||
backward 49-96
|
||||
backgr.fix 0 0
|
||||
data 40 1500 40 1500
|
||||
fit 0.2 14
|
||||
data 10 2048 10 2048
|
||||
deadtime-cor file
|
||||
fit 0.144 14
|
||||
packing 1
|
||||
|
||||
###############################################################
|
||||
@@ -39,19 +39,19 @@ 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 STRONG # NONE, WEAK, MEDIUM, STRONG
|
||||
plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
|
||||
plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL
|
||||
range 0 100
|
||||
phase par2
|
||||
|
||||
###############################################################
|
||||
PLOT 2 (asymmetry plot)
|
||||
runs 1
|
||||
range 0 14 -0.22 0.22
|
||||
view_packing 5
|
||||
range 0 14 -0.32 0.32
|
||||
view_packing 10
|
||||
|
||||
###############################################################
|
||||
STATISTIC --- 2012-03-20 10:28:41
|
||||
chisq = 796.7, NDF = 846, chisq/NDF = 0.941749
|
||||
STATISTIC --- 2026-02-21 13:10:28
|
||||
chisq = 1166.4, NDF = 863, chisq/NDF = 1.351562
|
||||
|
||||
@@ -1,49 +1,50 @@
|
||||
nc-ZnO T=80 F=69
|
||||
Ag_T=100_F=20
|
||||
###############################################################
|
||||
FITPARAMETER
|
||||
# No Name Value Step Pos_Error Boundaries
|
||||
1 zero 0 0 none
|
||||
2 phase 2.81 -0.30 0.30 0 100
|
||||
3 field 70.998 -0.025 0.025 0 none
|
||||
4 asym 0.1700 -0.0011 0.0012 0 0.3
|
||||
5 rate 0.1523 -0.0017 0.0017 0 100
|
||||
6 beta 1.255 -0.033 0.033
|
||||
7 Norm_L 2410.44 -0.83 0.83
|
||||
8 BG_L 0 0 none 0 none
|
||||
9 Norm_R 2121.43 -0.77 0.77 0 none
|
||||
10 BG_R 0 0 none 0 none
|
||||
11 relPhase 182.29 -0.31 0.31 0 none
|
||||
1 phaseL 0 0 none
|
||||
2 field 20.3390 -0.0085 0.0086 0 none
|
||||
3 asym 0.23461 -0.00051 0.00051 0 0.3
|
||||
4 rate 0.0239 -0.0040 0.0035 0 100
|
||||
5 Norm_L 1151.24 -0.53 0.53
|
||||
6 BG_L 0 0 none 0 none
|
||||
7 Norm_R 1178.60 -0.58 0.58 0 none
|
||||
8 BG_R 0 0 none 0 none
|
||||
9 relPhase 178.49 -0.20 0.20 0 none
|
||||
|
||||
###############################################################
|
||||
THEORY
|
||||
asymmetry 4
|
||||
generExpo 5 6 (rate exponent)
|
||||
asymmetry 3
|
||||
simpleGss 4 (rate)
|
||||
TFieldCos fun1 fun2 (phase frequency)
|
||||
|
||||
###############################################################
|
||||
FUNCTIONS
|
||||
fun1 = par2 + map1
|
||||
fun2 = gamma_mu * par3
|
||||
fun1 = par1 + map1
|
||||
fun2 = gamma_mu * par2
|
||||
|
||||
###############################################################
|
||||
GLOBAL
|
||||
fittype 0 (single histogram fit)
|
||||
data 40 1500
|
||||
fit 0.2 14
|
||||
data 5 2048
|
||||
t0 10.0
|
||||
deadtime-cor file
|
||||
fit 0.144 30
|
||||
packing 1
|
||||
|
||||
###############################################################
|
||||
RUN data/EMU00005989_v2 XXXX ISIS NEXUS (name beamline institute data-file-format)
|
||||
RUN data/emu00139040 EMU ISIS NEXUS (name beamline institute data-file-format)
|
||||
norm 5
|
||||
backgr.fit 6
|
||||
map 1 0 0 0 0 0 0 0 0 0
|
||||
forward 1-48
|
||||
#deadtime-cor file
|
||||
|
||||
RUN data/emu00139040 XXXX ISIS NEXUS (name beamline institute data-file-format)
|
||||
norm 7
|
||||
backgr.fit 8
|
||||
map 1 0 0 0 0 0 0 0 0 0
|
||||
forward 1-16
|
||||
|
||||
RUN data/EMU00005989_v2 XXXX ISIS NEXUS (name beamline institute data-file-format)
|
||||
norm 9
|
||||
backgr.fit 10
|
||||
map 11 0 0 0 0 0 0 0 0 0
|
||||
forward 17-32
|
||||
map 9 0 0 0 0 0 0 0 0 0
|
||||
forward 49-96
|
||||
|
||||
###############################################################
|
||||
COMMANDS
|
||||
@@ -59,15 +60,15 @@ fourier_power 11
|
||||
apodization STRONG # NONE, WEAK, MEDIUM, STRONG
|
||||
plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL
|
||||
range 0 200
|
||||
phase parR2 par11
|
||||
phase parR1, par9
|
||||
|
||||
###############################################################
|
||||
PLOT 0 (single histo plot)
|
||||
lifetimecorrection
|
||||
runs 1 2
|
||||
range 0 14 -0.22 0.22
|
||||
view_packing 2
|
||||
range 0 20 -0.35 0.35
|
||||
view_packing 10
|
||||
|
||||
###############################################################
|
||||
STATISTIC --- 2019-03-12 18:08:05
|
||||
maxLH = 2585.1, NDF = 1696, maxLH/NDF = 1.524236
|
||||
STATISTIC --- 2026-02-21 13:06:21
|
||||
maxLH = 4233.1, NDF = 3726, maxLH/NDF = 1.136107
|
||||
|
||||
78
doc/examples/test-histo-ROOT-PPC-ADDRUN.msr
Normal file
78
doc/examples/test-histo-ROOT-PPC-ADDRUN.msr
Normal file
@@ -0,0 +1,78 @@
|
||||
LSCO(x=0.125), T=45.00 K, E=2.97 keV, B=~4(G)/0.11(A), Tr/Sa=15.02/11.30 kV, RAL-RAR=-0.01 kV, SR=-45.00
|
||||
###############################################################
|
||||
FITPARAMETER
|
||||
# Nr. Name Value Step Pos_Error Boundaries
|
||||
1 Asy 0.14561 -0.00047 0.00047 0 0.5
|
||||
2 Rate 0.1508 -0.0017 0.0017 0 10
|
||||
3 Field 29.450 -0.027 0.027 0 none
|
||||
4 N0_L 3076.3 -1.0 1.0
|
||||
5 Bkg_L 12.882 -0.071 0.071
|
||||
6 Phase_L -34.89 -0.31 0.31
|
||||
7 alpha_LR 1.16481 -0.00055 0.00055
|
||||
8 Bkg_R 17.876 -0.080 0.079
|
||||
9 RelPhase_R 163.31 -0.31 0.31
|
||||
10 Zero 0 0 none
|
||||
|
||||
###############################################################
|
||||
THEORY
|
||||
asymmetry 1
|
||||
simplExpo 2 (rate)
|
||||
TFieldCos fun3 fun1 (phase frequency)
|
||||
|
||||
###############################################################
|
||||
FUNCTIONS
|
||||
fun1 = par3 * gamma_mu
|
||||
fun2 = par7 * par4
|
||||
fun3 = par6 + map1
|
||||
|
||||
###############################################################
|
||||
GLOBAL
|
||||
data 2791 66601
|
||||
fit 0.1 12
|
||||
packing 50
|
||||
|
||||
###############################################################
|
||||
RUN data/lem15_his_2992 MUE4 PSI MUSR-ROOT (name beamline institute data-file-format)
|
||||
ADDRUN data/lem15_his_2993 MUE4 PSI MUSR-ROOT (name beamline institute data-file-format)
|
||||
ADDRUN data/lem15_his_2994 MUE4 PSI MUSR-ROOT (name beamline institute data-file-format)
|
||||
fittype 0 (single histogram fit)
|
||||
norm 4
|
||||
backgr.fit 5
|
||||
map 10 0 0 0 0 0 0 0 0 0
|
||||
forward 21 25
|
||||
|
||||
RUN data/lem15_his_2992 MUE4 PSI MUSR-ROOT (name beamline institute data-file-format)
|
||||
ADDRUN data/lem15_his_2993 MUE4 PSI MUSR-ROOT (name beamline institute data-file-format)
|
||||
ADDRUN data/lem15_his_2994 MUE4 PSI MUSR-ROOT (name beamline institute data-file-format)
|
||||
fittype 0 (single histogram fit)
|
||||
norm fun2
|
||||
backgr.fit 8
|
||||
map 9 0 0 0 0 0 0 0 0 0
|
||||
forward 23 27
|
||||
|
||||
###############################################################
|
||||
COMMANDS
|
||||
MAX_LIKELIHOOD
|
||||
MINIMIZE
|
||||
MINOS
|
||||
SAVE
|
||||
|
||||
###############################################################
|
||||
PLOT 0 (single histo plot)
|
||||
lifetimecorrection
|
||||
runs 1 2
|
||||
range 0 12 -0.2 0.2
|
||||
view_packing 500
|
||||
|
||||
###############################################################
|
||||
FOURIER
|
||||
units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s'
|
||||
fourier_power 12
|
||||
apodization STRONG # NONE, WEAK, MEDIUM, STRONG
|
||||
plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL
|
||||
phase par6
|
||||
range 0 700
|
||||
|
||||
###############################################################
|
||||
STATISTIC --- 2026-02-20 16:12:06
|
||||
maxLH = 2888.7, NDF = 2429, maxLH/NDF = 1.189249
|
||||
@@ -38,7 +38,7 @@ PROJECT_NAME = musrfit
|
||||
# could be handy for archiving the generated documentation or if some version
|
||||
# control system is used.
|
||||
|
||||
PROJECT_NUMBER = 1.9.9
|
||||
PROJECT_NUMBER = 1.10.0
|
||||
|
||||
# Using the PROJECT_BRIEF tag one can provide an optional one line description
|
||||
# for a project that appears at the top of each page and should give viewer a
|
||||
@@ -923,6 +923,18 @@ INPUT = musrfit.dox \
|
||||
../src/classes/PUserFcn.cpp \
|
||||
../src/external/MusrRoot/TMusrRunHeader.h \
|
||||
../src/external/MusrRoot/TMusrRunHeader.cpp \
|
||||
../src/external/nexus/PNeXus.h \
|
||||
../src/external/nexus/PNeXus.cpp \
|
||||
../src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.h \
|
||||
../src/external/MuSR_software/Class_MuSR_PSI/MuSR_td_PSI_bin.cpp \
|
||||
../src/external/mud/src/mud.h \
|
||||
../src/external/mud/src/mud_all.c \
|
||||
../src/external/mud/src/mud.c \
|
||||
../src/external/mud/src/mud_encode.c \
|
||||
../src/external/mud/src/mud_friendly.c \
|
||||
../src/external/mud/src/mud_gen.c \
|
||||
../src/external/mud/src/mud_new.c \
|
||||
../src/external/mud/src/mud_tri_ti.c \
|
||||
../src/addRun.cpp \
|
||||
../src/any2many.cpp \
|
||||
../src/dump_header.cpp \
|
||||
@@ -2241,7 +2253,7 @@ INCLUDE_FILE_PATTERNS =
|
||||
# recursively expanded use the := operator instead of the = operator.
|
||||
# This tag requires that the tag ENABLE_PREPROCESSING is set to YES.
|
||||
|
||||
PREDEFINED =
|
||||
PREDEFINED = HAVE_HDF4
|
||||
|
||||
# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then this
|
||||
# tag can be used to specify a list of macro names that should be expanded. The
|
||||
|
||||
@@ -23,7 +23,7 @@ endif (nexus)
|
||||
set(MUSRFIT_LIBS ${MUSRFIT_LIBS} PMusr)
|
||||
|
||||
#--- add all executables ------------------------------------------------------
|
||||
add_executable(addRun ${GIT_REV_H} addRun.cpp)
|
||||
add_executable(addRun addRun.cpp)
|
||||
target_compile_options(addRun BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(addRun
|
||||
BEFORE PRIVATE
|
||||
@@ -34,7 +34,7 @@ target_include_directories(addRun
|
||||
)
|
||||
target_link_libraries(addRun ${ROOT_LIBRARIES} ${MUSRFIT_LIBS} ${Boost_LIBRARIES})
|
||||
|
||||
add_executable(any2many ${GIT_REV_H} any2many.cpp)
|
||||
add_executable(any2many any2many.cpp)
|
||||
target_compile_options(any2many BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(any2many
|
||||
BEFORE PRIVATE
|
||||
@@ -45,12 +45,13 @@ target_include_directories(any2many
|
||||
)
|
||||
target_link_libraries(any2many ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||
|
||||
add_executable(dump_header ${GIT_REV_H} dump_header.cpp)
|
||||
add_executable(dump_header 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:${NEXUS_INCLUDE_DIR}>
|
||||
$<BUILD_INTERFACE:${HDF4_INCLUDE_DIRS}>
|
||||
$<BUILD_INTERFACE:${HDF5_INCLUDE_DIRS}>
|
||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||
@@ -62,7 +63,7 @@ target_include_directories(dump_header
|
||||
)
|
||||
target_link_libraries(dump_header ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||
|
||||
add_executable(msr2data ${GIT_REV_H} msr2data.cpp)
|
||||
add_executable(msr2data msr2data.cpp)
|
||||
target_compile_options(msr2data BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(msr2data
|
||||
BEFORE PRIVATE
|
||||
@@ -76,7 +77,7 @@ target_link_libraries(msr2data ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||
add_executable(msr2msr msr2msr.cpp)
|
||||
target_link_libraries(msr2msr ${ROOT_LIBRARIES})
|
||||
|
||||
add_executable(musrfit ${GIT_REV_H} musrfit.cpp)
|
||||
add_executable(musrfit musrfit.cpp)
|
||||
target_compile_options(musrfit BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(musrfit
|
||||
BEFORE PRIVATE
|
||||
@@ -87,7 +88,7 @@ target_include_directories(musrfit
|
||||
)
|
||||
target_link_libraries(musrfit ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||
|
||||
add_executable(musrFT ${GIT_REV_H} musrFT.cpp)
|
||||
add_executable(musrFT musrFT.cpp)
|
||||
target_compile_options(musrFT BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(musrFT
|
||||
BEFORE PRIVATE
|
||||
@@ -99,7 +100,7 @@ target_include_directories(musrFT
|
||||
)
|
||||
target_link_libraries(musrFT FFTW3::FFTW3 ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||
|
||||
add_executable(musrRootValidation ${GIT_REV_H} musrRootValidation.cpp)
|
||||
add_executable(musrRootValidation musrRootValidation.cpp)
|
||||
target_compile_options(musrRootValidation BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(musrRootValidation
|
||||
BEFORE PRIVATE
|
||||
@@ -110,7 +111,7 @@ target_include_directories(musrRootValidation
|
||||
)
|
||||
target_link_libraries(musrRootValidation ${ROOT_LIBRARIES} ${MUSRFIT_LIBS} ${LIBXML2_LIBRARIES})
|
||||
|
||||
add_executable(musrt0 ${GIT_REV_H} musrt0.cpp)
|
||||
add_executable(musrt0 musrt0.cpp)
|
||||
target_compile_options(musrt0 BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(musrt0
|
||||
BEFORE PRIVATE
|
||||
@@ -121,7 +122,7 @@ target_include_directories(musrt0
|
||||
)
|
||||
target_link_libraries(musrt0 ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||
|
||||
add_executable(musrview ${GIT_REV_H} musrview.cpp)
|
||||
add_executable(musrview musrview.cpp)
|
||||
target_compile_options(musrview BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||
target_include_directories(musrview
|
||||
BEFORE PRIVATE
|
||||
@@ -133,7 +134,7 @@ target_include_directories(musrview
|
||||
)
|
||||
target_link_libraries(musrview FFTW3::FFTW3 ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||
|
||||
add_executable(write_musrRoot_runHeader ${GIT_REV_H} write_musrRoot_runHeader.cpp)
|
||||
add_executable(write_musrRoot_runHeader 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
|
||||
@@ -145,6 +146,20 @@ target_include_directories(write_musrRoot_runHeader
|
||||
)
|
||||
target_link_libraries(write_musrRoot_runHeader ${ROOT_LIBRARIES} ${MUSRFIT_LIBS} ${LIBXML2_LIBRARIES})
|
||||
|
||||
#--- ensure git-revision.h is regenerated before compiling --------------------
|
||||
if (IS_GIT_REPO)
|
||||
add_dependencies(addRun git_revision)
|
||||
add_dependencies(any2many git_revision)
|
||||
add_dependencies(dump_header git_revision)
|
||||
add_dependencies(msr2data git_revision)
|
||||
add_dependencies(musrfit git_revision)
|
||||
add_dependencies(musrFT git_revision)
|
||||
add_dependencies(musrRootValidation git_revision)
|
||||
add_dependencies(musrt0 git_revision)
|
||||
add_dependencies(musrview git_revision)
|
||||
add_dependencies(write_musrRoot_runHeader git_revision)
|
||||
endif (IS_GIT_REPO)
|
||||
|
||||
#--- installation info --------------------------------------------------------
|
||||
install(
|
||||
TARGETS
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -82,7 +82,7 @@ set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "\$\{prefix\}")
|
||||
set(libdir "\$\{exec_prefix\}/lib")
|
||||
set(includedir "\$\{prefix\}/include")
|
||||
set(MUSR_VERSION "1.7.0")
|
||||
set(MUSR_VERSION "1.8.0")
|
||||
set(MUSR_LIBRARY_NAME "PMusr")
|
||||
configure_file("PMusr.pc.in" "PMusr.pc" @ONLY)
|
||||
set(USERFCN_LIBRARY_NAME "PUserFcnBase")
|
||||
@@ -131,13 +131,15 @@ target_include_directories(
|
||||
PMusr BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
|
||||
$<BUILD_INTERFACE:${HDF4_INCLUDE_DIRS}>
|
||||
$<BUILD_INTERFACE:${HDF5_INCLUDE_DIRS}>
|
||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/MusrRoot>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/TLemRunHeader>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/MuSR_software/Class_MuSR_PSI>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/mud/src>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/nexus>
|
||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||
)
|
||||
|
||||
add_library(PUserFcnBase SHARED
|
||||
@@ -151,6 +153,7 @@ add_library(PRgeHandler SHARED
|
||||
)
|
||||
|
||||
#--- set target properties, e.g. version --------------------------------------
|
||||
target_compile_options(PMusr BEFORE PRIVATE "-DHAVE_CONFIG_H")
|
||||
set_target_properties(PMusr
|
||||
PROPERTIES
|
||||
VERSION ${MUSR_VERSION}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Bastian M. Wojek / Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Bastian M. Wojek / Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -814,6 +814,10 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
||||
fout.width(16);
|
||||
fout << std::left << "packing";
|
||||
fout << fGlobal.GetPacking() << std::endl;
|
||||
} else if (sstr.BeginsWith("deadtime-cor")) {
|
||||
fout.width(16);
|
||||
fout << std::left << "deadtime-cor";
|
||||
fout << fGlobal.GetDeadTimeCorrection() << std::endl;
|
||||
} else {
|
||||
fout << str.Data() << std::endl;
|
||||
}
|
||||
@@ -1157,6 +1161,10 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
|
||||
fout.width(16);
|
||||
fout << std::left << "packing";
|
||||
fout << fRuns[runNo].GetPacking() << std::endl;
|
||||
} else if (sstr.BeginsWith("deadtime-cor")) {
|
||||
fout.width(16);
|
||||
fout << std::left << "deadtime-cor";
|
||||
fout << fRuns[runNo].GetDeadTimeCorrection() << std::endl;
|
||||
} else {
|
||||
fout << str.Data() << std::endl;
|
||||
}
|
||||
@@ -3334,6 +3342,20 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines)
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
} else if (iter->fLine.BeginsWith("deadtime-cor", TString::kIgnoreCase)) { // deadtime correction
|
||||
if (tokens->GetEntries() < 2) {
|
||||
error = true;
|
||||
} else {
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||
str = ostr->GetString();
|
||||
if (!str.CompareTo("no", TString::kIgnoreCase) ||
|
||||
!str.CompareTo("file", TString::kIgnoreCase) ||
|
||||
!str.CompareTo("estimate", TString::kIgnoreCase)) {
|
||||
global.SetDeadTimeCorrection(str);
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// clean up
|
||||
@@ -3931,6 +3953,27 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
|
||||
}
|
||||
}
|
||||
|
||||
// deadtime-correction -----------------------------------
|
||||
if (iter->fLine.BeginsWith("deadtime-cor", TString::kIgnoreCase)) { // deadtime correction
|
||||
|
||||
runLinePresent = false; // this is needed to make sure that a run line is present before and ADDRUN is following
|
||||
|
||||
if (tokens->GetEntries() < 2) {
|
||||
error = true;
|
||||
} else {
|
||||
ostr = dynamic_cast<TObjString*>(tokens->At(1));
|
||||
str = ostr->GetString();
|
||||
if (!str.CompareTo("no", TString::kIgnoreCase) ||
|
||||
!str.CompareTo("file", TString::kIgnoreCase) ||
|
||||
!str.CompareTo("estimate", TString::kIgnoreCase)) {
|
||||
param.SetDeadTimeCorrection(str);
|
||||
} else {
|
||||
error = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// xy-data -----------------------------------------------
|
||||
if (line.BeginsWith("xy-data", TString::kIgnoreCase)) {
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -721,6 +721,22 @@ PRawRunDataSet* PRawRunData::GetDataSet(const UInt_t idx, Bool_t wantHistoNo)
|
||||
return fData.GetSet(idx);
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// DeadTimeCorrectionReady (public)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* <p>Checks if deadtime correction information is sufficient to apply it.
|
||||
* This means that fNumberOfGoodFrames must be present and the deadtime
|
||||
* parameter vector.
|
||||
*
|
||||
* @return true if ready to apply deadtime correctio, false otherwise
|
||||
*/
|
||||
const Bool_t PRawRunData::DeadTimeCorrectionReady()
|
||||
{
|
||||
if ((fNumberOfGoodFrames > 0) && (fDeadTimeParam.size() > 0))
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SetRingAnode (public)
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -712,16 +712,26 @@ Bool_t PRunAsymmetry::PrepareData()
|
||||
forward[i].resize(runData->GetDataBin(forwardHistoNo[i])->size());
|
||||
forward[i] = *runData->GetDataBin(forwardHistoNo[i]);
|
||||
}
|
||||
// check if a dead time correction has to be done
|
||||
// this will be done automatically in the function itself, which also
|
||||
// checks in the global and run section
|
||||
DeadTimeCorrection(forward, forwardHistoNo);
|
||||
|
||||
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]);
|
||||
}
|
||||
// check if a dead time correction has to be done
|
||||
// this will be done automatically in the function itself, which also
|
||||
// checks in the global and run section
|
||||
DeadTimeCorrection(backward, backwardHistoNo);
|
||||
|
||||
// check if addrun's are present, and if yes add data
|
||||
// check if there are runs to be added to the current one
|
||||
if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present
|
||||
PRawRunData *addRunData;
|
||||
std::vector<PDoubleVector> addForward, addBackward;
|
||||
for (UInt_t i=1; i<fRunInfo->GetRunNameSize(); i++) {
|
||||
// get run to be added to the main one
|
||||
addRunData = fRawData->GetRunData(*(fRunInfo->GetRunName(i)));
|
||||
@@ -731,6 +741,22 @@ Bool_t PRunAsymmetry::PrepareData()
|
||||
return false;
|
||||
}
|
||||
|
||||
// dead time correction handling
|
||||
addForward.clear();
|
||||
addForward.resize(forwardHistoNo.size());
|
||||
for (UInt_t j=0; j<forwardHistoNo.size(); j++) {
|
||||
addForward[j].resize(addRunData->GetDataBin(forwardHistoNo[j])->size());
|
||||
addForward[j] = *addRunData->GetDataBin(forwardHistoNo[j]);
|
||||
}
|
||||
DeadTimeCorrection(addForward, forwardHistoNo);
|
||||
addBackward.clear();
|
||||
addBackward.resize(backwardHistoNo.size());
|
||||
for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
|
||||
addBackward[j].resize(addRunData->GetDataBin(backwardHistoNo[j])->size());
|
||||
addBackward[j] = *addRunData->GetDataBin(backwardHistoNo[j]);
|
||||
}
|
||||
DeadTimeCorrection(addBackward, backwardHistoNo);
|
||||
|
||||
// add forward run
|
||||
UInt_t addRunSize;
|
||||
for (UInt_t k=0; k<forwardHistoNo.size(); k++) { // fill each group
|
||||
@@ -739,7 +765,7 @@ Bool_t PRunAsymmetry::PrepareData()
|
||||
// make sure that the index stays in the proper range
|
||||
if ((static_cast<Int_t>(j)+static_cast<Int_t>(fAddT0s[i-1][2*k])-static_cast<Int_t>(fT0s[2*k]) >= 0) &&
|
||||
(j+static_cast<Int_t>(fAddT0s[i-1][2*k])-static_cast<Int_t>(fT0s[2*k]) < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(forwardHistoNo[k])->at(j+static_cast<Int_t>(fAddT0s[i-1][2*k])-static_cast<Int_t>(fT0s[2*k]));
|
||||
forward[k][j] += addForward[k][j+static_cast<Int_t>(fAddT0s[i-1][2*k])-static_cast<Int_t>(fT0s[2*k])];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -751,7 +777,7 @@ Bool_t PRunAsymmetry::PrepareData()
|
||||
// make sure that the index stays in the proper range
|
||||
if ((static_cast<Int_t>(j)+static_cast<Int_t>(fAddT0s[i-1][2*k+1])-static_cast<Int_t>(fT0s[2*k+1]) >= 0) &&
|
||||
(j+static_cast<Int_t>(fAddT0s[i-1][2*k+1])-static_cast<Int_t>(fT0s[2*k+1]) < addRunSize)) {
|
||||
backward[k][j] += addRunData->GetDataBin(backwardHistoNo[k])->at(j+static_cast<Int_t>(fAddT0s[i-1][2*k+1])-static_cast<Int_t>(fT0s[2*k+1]));
|
||||
backward[k][j] += addBackward[k][j+static_cast<Int_t>(fAddT0s[i-1][2*k+1])-static_cast<Int_t>(fT0s[2*k+1])];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -9,7 +9,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2018-2025 by Zaher Salman *
|
||||
* Copyright (C) 2018-2026 by Zaher Salman *
|
||||
* zaher.salman@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -707,16 +707,26 @@ Bool_t PRunAsymmetryRRF::PrepareData()
|
||||
forward[i].resize(runData->GetDataBin(forwardHistoNo[i])->size());
|
||||
forward[i] = *runData->GetDataBin(forwardHistoNo[i]);
|
||||
}
|
||||
// check if a dead time correction has to be done
|
||||
// this will be done automatically in the function itself, which also
|
||||
// checks in the global and run section
|
||||
DeadTimeCorrection(forward, forwardHistoNo);
|
||||
|
||||
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]);
|
||||
}
|
||||
// check if a dead time correction has to be done
|
||||
// this will be done automatically in the function itself, which also
|
||||
// checks in the global and run section
|
||||
DeadTimeCorrection(forward, forwardHistoNo);
|
||||
|
||||
// check if addrun's are present, and if yes add data
|
||||
// check if there are runs to be added to the current one
|
||||
if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present
|
||||
PRawRunData *addRunData;
|
||||
std::vector<PDoubleVector> addForward, addBackward;
|
||||
for (UInt_t i=1; i<fRunInfo->GetRunNameSize(); i++) {
|
||||
// get run to be added to the main one
|
||||
addRunData = fRawData->GetRunData(*(fRunInfo->GetRunName(i)));
|
||||
@@ -726,6 +736,22 @@ Bool_t PRunAsymmetryRRF::PrepareData()
|
||||
return false;
|
||||
}
|
||||
|
||||
// dead time correction handling
|
||||
addForward.clear();
|
||||
addForward.resize(forwardHistoNo.size());
|
||||
for (UInt_t j=0; j<forwardHistoNo.size(); j++) {
|
||||
addForward[j].resize(addRunData->GetDataBin(forwardHistoNo[j])->size());
|
||||
addForward[j] = *addRunData->GetDataBin(forwardHistoNo[j]);
|
||||
}
|
||||
DeadTimeCorrection(addForward, forwardHistoNo);
|
||||
addBackward.clear();
|
||||
addBackward.resize(backwardHistoNo.size());
|
||||
for (UInt_t j=0; j<backwardHistoNo.size(); j++) {
|
||||
addBackward[j].resize(addRunData->GetDataBin(backwardHistoNo[j])->size());
|
||||
addBackward[j] = *addRunData->GetDataBin(backwardHistoNo[j]);
|
||||
}
|
||||
DeadTimeCorrection(addBackward, backwardHistoNo);
|
||||
|
||||
// add forward run
|
||||
UInt_t addRunSize;
|
||||
for (UInt_t k=0; k<forwardHistoNo.size(); k++) { // fill each group
|
||||
@@ -733,7 +759,7 @@ Bool_t PRunAsymmetryRRF::PrepareData()
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(forwardHistoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(forwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]);
|
||||
forward[k][j] += addForward[k][j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]];
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -744,7 +770,7 @@ Bool_t PRunAsymmetryRRF::PrepareData()
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(backwardHistoNo[k])->size(); j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if (((Int_t)j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) {
|
||||
backward[k][j] += addRunData->GetDataBin(backwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]);
|
||||
backward[k][j] += addBackward[k][j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -159,6 +159,57 @@ PRunBase::~PRunBase()
|
||||
fFuncValues.clear();
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// DeadTimeCorrection (protected)
|
||||
//--------------------------------------------------------------------------
|
||||
/**
|
||||
* \brief carry out dead time correction
|
||||
*
|
||||
* \param histos histograms to be corrected
|
||||
* \param histoNo histogram numbers
|
||||
*/
|
||||
void PRunBase::DeadTimeCorrection(std::vector<PDoubleVector> &histos, PUIntVector &histoNo)
|
||||
{
|
||||
PRawRunData* runData = fRawData->GetRunData(*fRunInfo->GetRunName());
|
||||
|
||||
if (!runData->DeadTimeCorrectionReady()) {
|
||||
std::cerr << std::endl << "**WARNING** PRunBase::DeadTimeCorrection: missing input for dead time correction" << std::endl;
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// check if a dead time correction has to be done
|
||||
// first check the global block
|
||||
TString dtcg = fMsrInfo->GetMsrGlobal()->GetDeadTimeCorrection();
|
||||
Int_t dtcg_tag = 0; // 0=no, 1=file, 2=estimate
|
||||
if (dtcg.Contains("file", TString::kIgnoreCase)) {
|
||||
dtcg_tag = 1;
|
||||
} else if (dtcg.Contains("estimate", TString::kIgnoreCase)) {
|
||||
dtcg_tag = 2;
|
||||
}
|
||||
// now check each run
|
||||
TString dtcr{"no"};
|
||||
Bool_t needToCheck{true};
|
||||
for (UInt_t i=0; i<histoNo.size(); i++) {
|
||||
dtcr = fRunInfo->GetDeadTimeCorrection();
|
||||
if (dtcr.Contains("file", TString::kIgnoreCase) || (dtcg_tag != 0)) {
|
||||
if (runData->DeadTimeCorrectionReady()) {
|
||||
needToCheck = false;
|
||||
// Dead time correction: n_true = n_obs / (1 - n_obs * t_dt / (good_frames * dt))
|
||||
Double_t n_true;
|
||||
Int_t gf = runData->GetNumberOfGoodFrames();
|
||||
std::vector<float> t_dt = runData->GetDeadTimeParam();
|
||||
for (UInt_t j=0; j<histos[i].size(); j++) {
|
||||
n_true = histos[i][j] / (1.0 - histos[i][j] * t_dt[histoNo[i]] / (gf * fTimeResolution));
|
||||
histos[i][j] = n_true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if ((dtcr.Contains("estimate", TString::kIgnoreCase) || (dtcg_tag != 0)) && needToCheck) {
|
||||
std::cerr << std::endl << "**INFO** deadtime correction estimate not yet implemented." << std::endl;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//--------------------------------------------------------------------------
|
||||
// SetFitRange (public)
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -1069,10 +1069,16 @@ Bool_t PRunSingleHisto::PrepareData()
|
||||
forward[i] = *runData->GetDataBin(histoNo[i]);
|
||||
}
|
||||
|
||||
// check if a dead time correction has to be done
|
||||
// this will be done automatically in the function itself, which also
|
||||
// checks in the global and run section
|
||||
DeadTimeCorrection(forward, histoNo);
|
||||
|
||||
// check if there are runs to be added to the current one
|
||||
if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present
|
||||
PRawRunData *addRunData;
|
||||
for (UInt_t i=1; i<fRunInfo->GetRunNameSize(); i++) {
|
||||
std::vector<PDoubleVector> addForward;
|
||||
for (UInt_t i=1; i<fRunInfo->GetRunNameSize(); i++) { // loop over all ADDRUN's
|
||||
|
||||
// get run to be added to the main one
|
||||
addRunData = fRawData->GetRunData(*fRunInfo->GetRunName(i));
|
||||
@@ -1082,15 +1088,23 @@ Bool_t PRunSingleHisto::PrepareData()
|
||||
return false;
|
||||
}
|
||||
|
||||
addForward.clear();
|
||||
addForward.resize(histoNo.size()); // resize to number of groups
|
||||
for (UInt_t j=0; j<histoNo.size(); j++) {
|
||||
addForward[j].resize(addRunData->GetDataBin(histoNo[j])->size());
|
||||
addForward[j] = *addRunData->GetDataBin(histoNo[j]);
|
||||
}
|
||||
DeadTimeCorrection(addForward, histoNo);
|
||||
|
||||
// add forward run
|
||||
UInt_t addRunSize;
|
||||
for (UInt_t k=0; k<histoNo.size(); k++) { // fill each group
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices
|
||||
addRunSize = addForward[k].size();
|
||||
for (UInt_t j=0; j<addRunSize; j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((static_cast<Int_t>(j)+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]) >= 0) &&
|
||||
(j+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]) < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]));
|
||||
forward[k][j] += addForward[k][j+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k])];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -767,6 +767,7 @@ Bool_t PRunSingleHistoRRF::PrepareData()
|
||||
// check if there are runs to be added to the current one
|
||||
if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present
|
||||
PRawRunData *addRunData;
|
||||
std::vector<PDoubleVector> addForward;
|
||||
for (UInt_t i=1; i<fRunInfo->GetRunNameSize(); i++) {
|
||||
|
||||
// get run to be added to the main one
|
||||
@@ -777,15 +778,23 @@ Bool_t PRunSingleHistoRRF::PrepareData()
|
||||
return false;
|
||||
}
|
||||
|
||||
addForward.clear();
|
||||
addForward.resize(histoNo.size()); // resize to number of groups
|
||||
for (UInt_t j=0; j<histoNo.size(); j++) {
|
||||
addForward[j].resize(addRunData->GetDataBin(histoNo[j])->size());
|
||||
addForward[j] = *addRunData->GetDataBin(histoNo[j]);
|
||||
}
|
||||
DeadTimeCorrection(addForward, histoNo);
|
||||
|
||||
// add forward run
|
||||
UInt_t addRunSize;
|
||||
for (UInt_t k=0; k<histoNo.size(); k++) { // fill each group
|
||||
addRunSize = addRunData->GetDataBin(histoNo[k])->size();
|
||||
for (UInt_t j=0; j<addRunData->GetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices
|
||||
addRunSize = addForward[k].size();
|
||||
for (UInt_t j=0; j<addRunSize; j++) { // loop over the bin indices
|
||||
// make sure that the index stays in the proper range
|
||||
if ((static_cast<Int_t>(j)+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]) >= 0) &&
|
||||
(j+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]) < addRunSize)) {
|
||||
forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k]));
|
||||
forward[k][j] += addForward[k][j+static_cast<Int_t>(fAddT0s[i-1][k])-static_cast<Int_t>(fT0s[k])];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
@@ -37,6 +37,7 @@
|
||||
#include <cstring>
|
||||
#include <ctime>
|
||||
#include <cassert>
|
||||
#include <cstddef>
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
@@ -270,9 +271,14 @@ int dump_header_root(const std::string fileName, const bool summary, const bool
|
||||
}
|
||||
|
||||
// summary as well?
|
||||
if (summary && (fileType == DH_MUSR_ROOT)) {
|
||||
if (summary && ((fileType == DH_MUSR_ROOT) || (fileType == DH_MUSR_ROOT_DIR))) {
|
||||
TObjArray *runSum=nullptr;
|
||||
runSum = static_cast<TObjArray*>(folder->FindObject("RunSummary"));
|
||||
|
||||
if (fileType == DH_MUSR_ROOT) // TFolder
|
||||
runSum = static_cast<TObjArray*>(folder->FindObject("RunSummary"));
|
||||
else // TDirectory
|
||||
f.GetObject("RunHeader/RunSummary", runSum);
|
||||
|
||||
if (!runSum) { // something is wrong!!
|
||||
std::cerr << std::endl << "**ERROR** Couldn't obtain RunSummary " << fileName << std::endl;
|
||||
f.Close();
|
||||
@@ -360,15 +366,39 @@ int dump_header_root(const std::string fileName, const bool summary, const bool
|
||||
int dump_header_nexus(const std::string fileName, const bool counts) {
|
||||
|
||||
#ifdef PNEXUS_ENABLED
|
||||
std::unique_ptr<PNeXus> nxs_file = std::make_unique<PNeXus>(fileName.c_str());
|
||||
nxs::HDFType type = nxs::checkHDFType(fileName);
|
||||
|
||||
if (nxs_file->IsValid(false)) {
|
||||
nxs_file->Dump(counts);
|
||||
} else {
|
||||
std::cerr << std::endl;
|
||||
std::cerr << "**ERROR** found invalid NeXus file." << std::endl;
|
||||
std::cerr << std::endl;
|
||||
return 1;
|
||||
// check for type errors, missing enabled HDF4
|
||||
switch (type) {
|
||||
case nxs::HDFType::HDF4:
|
||||
std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): HDF4 file." << std::endl;
|
||||
#ifndef HAVE_HDF4
|
||||
std::cerr << std::endl << ">> PRunDataHandler::ReadNexusFile(): **ERROR**, HDF4 is not enabled." << std::endl;
|
||||
return 1;
|
||||
#endif
|
||||
break;
|
||||
case nxs::HDFType::HDF5:
|
||||
std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): HDF5 file." << std::endl;
|
||||
break;
|
||||
case nxs::HDFType::Unknown:
|
||||
std::cerr << std::endl << ">> PRunDataHandler::ReadNexusFile(): Not a valid NeXus file." << std::endl;
|
||||
return 1;
|
||||
}
|
||||
|
||||
if (type == nxs::HDFType::HDF4) {
|
||||
#ifdef HAVE_HDF4
|
||||
std::unique_ptr<nxH4::PNeXus> nxs_file = std::make_unique<nxH4::PNeXus>(fileName);
|
||||
if (nxs_file == nullptr) {
|
||||
std::cerr << std::endl << "**ERROR** allocation of nxH4::PNeXus object failed." << std::endl;
|
||||
}
|
||||
nxs_file->Dump();
|
||||
#endif
|
||||
} else { // HDF5
|
||||
std::unique_ptr<nxH5::PNeXus> nxs_file = std::make_unique<nxH5::PNeXus>(fileName);
|
||||
if (nxs_file == nullptr) {
|
||||
std::cerr << std::endl << "**ERROR** allocation of nxH5::PNeXus object failed." << std::endl;
|
||||
}
|
||||
nxs_file->Dump();
|
||||
}
|
||||
#else
|
||||
std::cout << std::endl << "NeXus not enabled, hence the header information cannot be dumped." << std::endl << std::endl;
|
||||
|
||||
2
src/external/BMWtools/BMWStartupHandler.cpp
vendored
2
src/external/BMWtools/BMWStartupHandler.cpp
vendored
@@ -11,7 +11,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter, Bastian M. Wojek *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter, Bastian M. Wojek *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/BMWtools/BMWStartupHandler.h
vendored
2
src/external/BMWtools/BMWStartupHandler.h
vendored
@@ -11,7 +11,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter, Bastian M. Wojek *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter, Bastian M. Wojek *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/LF_GL/PGKT_LF.cpp
vendored
2
src/external/LF_GL/PGKT_LF.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/LF_GL/PGKT_LF.h
vendored
2
src/external/LF_GL/PGKT_LF.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/LF_GL/PLGKT_LF.cpp
vendored
2
src/external/LF_GL/PLGKT_LF.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/LF_GL/PLGKT_LF.h
vendored
2
src/external/LF_GL/PLGKT_LF.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2025 by Andreas Suter *
|
||||
* Copyright (C) 2011-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2025 by Andreas Suter *
|
||||
* Copyright (C) 2011-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2025 by Andreas Suter *
|
||||
* Copyright (C) 2011-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/MagProximity/PMagProximity.h
vendored
2
src/external/MagProximity/PMagProximity.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2025 by Andreas Suter *
|
||||
* Copyright (C) 2011-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2025 by Andreas Suter *
|
||||
* Copyright (C) 2011-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2011-2025 by Andreas Suter *
|
||||
* Copyright (C) 2011-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
2
src/external/MusrRoot/TMusrRunHeader.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/MusrRoot/TMusrRunHeader.h
vendored
2
src/external/MusrRoot/TMusrRunHeader.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/Nonlocal/PNL_PippardFitter.cpp
vendored
2
src/external/Nonlocal/PNL_PippardFitter.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/Nonlocal/PNL_PippardFitter.h
vendored
2
src/external/Nonlocal/PNL_PippardFitter.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/Nonlocal/PNL_StartupHandler.cpp
vendored
2
src/external/Nonlocal/PNL_StartupHandler.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/Nonlocal/PNL_StartupHandler.h
vendored
2
src/external/Nonlocal/PNL_StartupHandler.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
5
src/external/Nonlocal/prog/CMakeLists.txt
vendored
5
src/external/Nonlocal/prog/CMakeLists.txt
vendored
@@ -2,6 +2,11 @@
|
||||
|
||||
cmake_minimum_required(VERSION 3.15)
|
||||
|
||||
# cmake: use BoostConfig.cmake instead of FindBoost
|
||||
if (CMAKE_VERSION GREATER_EQUAL "3.3")
|
||||
cmake_policy(SET CMP0167 NEW)
|
||||
endif()
|
||||
|
||||
project(dump_nonlocal_field VERSION 1.0.0 LANGUAGES C CXX)
|
||||
|
||||
#--- check for git ------------------------------------------------------------
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2009-2025 by Andreas Suter *
|
||||
* Copyright (C) 2009-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2008-2025 by Bastian M. Wojek, Andreas Suter *
|
||||
* Copyright (C) 2008-2026 by Bastian M. Wojek, Andreas Suter *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/libGbGLF/PGbGLF.cpp
vendored
2
src/external/libGbGLF/PGbGLF.cpp
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/libGbGLF/PGbGLF.h
vendored
2
src/external/libGbGLF/PGbGLF.h
vendored
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2007-2025 by Andreas Suter *
|
||||
* Copyright (C) 2007-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
2
src/external/libGbGLF/PGbGLFLinkDef.h
vendored
2
src/external/libGbGLF/PGbGLFLinkDef.h
vendored
@@ -7,7 +7,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2016-2025 by Andreas Suter *
|
||||
* Copyright (C) 2016-2026 by Andreas Suter *
|
||||
* *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* Copyright (C) 2013-2025 by Andreas Suter *
|
||||
* Copyright (C) 2013-2026 by Andreas Suter *
|
||||
* andreas.suter@psi.ch *
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
|
||||
18
src/external/nexus/CMakeLists.txt
vendored
18
src/external/nexus/CMakeLists.txt
vendored
@@ -1,13 +1,11 @@
|
||||
# - PNeXus library ------------------------------------------------------------
|
||||
|
||||
include_directories(${NEXUS_INCLUDE_DIR}) # to get the nexus headers
|
||||
|
||||
#--- create pkg-config info ---------------------------------------------------
|
||||
set(prefix "${CMAKE_INSTALL_PREFIX}")
|
||||
set(exec_prefix "\$\{prefix\}")
|
||||
set(libdir "\$\{exec_prefix\}/lib")
|
||||
set(includedir "\$\{prefix\}/include")
|
||||
set(PNEXUS_VERSION "0.9.0")
|
||||
set(PNEXUS_VERSION "1.0.0")
|
||||
set(PNEXUS_LIBRARY_NAME "PNeXus")
|
||||
configure_file("PNeXus.pc.in" "PNeXus.pc" @ONLY)
|
||||
|
||||
@@ -23,12 +21,20 @@ set_target_properties(PNeXus
|
||||
)
|
||||
|
||||
#--- make sure that the include directory is found ----------------------------
|
||||
target_include_directories(
|
||||
PNeXus BEFORE PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
target_include_directories(PNeXus
|
||||
BEFORE PRIVATE $<BUILD_INTERFACE:${HDF4_INCLUDE_DIRS}>
|
||||
BEFORE PRIVATE $<BUILD_INTERFACE:${HDF5_INCLUDE_DIRS}>
|
||||
BEFORE PRIVATE $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||
)
|
||||
|
||||
#--- add library dependencies -------------------------------------------------
|
||||
target_link_libraries(PNeXus ${NEXUS_LIBRARY})
|
||||
if (HAVE_HDF4)
|
||||
set(HDF_LIBS ${HDF4_LIBRARIES} ${HDF5_LIBRARIES})
|
||||
else (HAVE_HDF4)
|
||||
set(HDF_LIBS ${HDF5_LIBRARIES})
|
||||
endif (HAVE_HDF4)
|
||||
message(STATUS "as35> HDF_LIBS: ${HDF_LIBS}")
|
||||
target_link_libraries(PNeXus ${HDF_LIBS} ${ROOT_LIBRARIES})
|
||||
|
||||
#--- install PNeXus solib -----------------------------------------------------
|
||||
install(TARGETS PNeXus DESTINATION lib)
|
||||
|
||||
11024
src/external/nexus/PNeXus.cpp
vendored
11024
src/external/nexus/PNeXus.cpp
vendored
File diff suppressed because it is too large
Load Diff
2576
src/external/nexus/PNeXus.h
vendored
2576
src/external/nexus/PNeXus.h
vendored
File diff suppressed because it is too large
Load Diff
69
src/external/nexus/README.Cygwin
vendored
69
src/external/nexus/README.Cygwin
vendored
@@ -1,69 +0,0 @@
|
||||
2011/04/13 -- BMW
|
||||
|
||||
Under Cygwin of all the required libraries for NeXus only HDF5 is available.
|
||||
The packages <hdf5> and <libhdf5-devel> can be installed through the Cygwin setup.
|
||||
One should also make sure that <bison>, <flex> and a package containing "/usr/lib/librpc.a" (e.g. <sunrpc> = 4.0-3) are installed.
|
||||
|
||||
All other libraries have to be built from the sources:
|
||||
|
||||
* JPEG-6b
|
||||
URL: http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz
|
||||
Configure options: --prefix=/usr/local --enable-static
|
||||
|
||||
* MXML 2.5
|
||||
URL: http://ftp.easysw.com/pub/mxml/2.5/mxml-2.5.tar.gz
|
||||
Configure options: --prefix=/usr/local --enable-static
|
||||
|
||||
* HDF 4.2.5
|
||||
URL: http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.5.tar.gz
|
||||
Configure options: --prefix=/usr/local --enable-static --disable-fortran --with-jpeg=/usr/local
|
||||
|
||||
* NeXus 4.2.1
|
||||
URL: http://download.nexusformat.org/kits/nexus-4.2.1.tar.gz
|
||||
Configure options: --prefix=/usr/local --with-hdf4=/usr/local --with-hdf5=/usr --with-xml=/usr/local
|
||||
|
||||
The version numbers and source-code locations might of course change with time but should be easily adjustable.
|
||||
|
||||
If one is confident enough that all requirements to build the above packages are fullfilled, one could also try to run the following lines as a script.
|
||||
However, there is absolutely no warranty that it works.
|
||||
|
||||
---
|
||||
|
||||
#!/bin/sh
|
||||
|
||||
cd
|
||||
mkdir nexus
|
||||
cd nexus
|
||||
curl http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz -G | tar xz
|
||||
cd jpeg-6b
|
||||
./configure --prefix=/usr/local --enable-static
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
curl http://ftp.easysw.com/pub/mxml/2.5/mxml-2.5.tar.gz -G | tar xz
|
||||
cd mxml-2.5
|
||||
./configure --prefix=/usr/local --enable-static
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
curl http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.5.tar.gz -G | tar xz
|
||||
cd hdf-4.2.5
|
||||
./configure --prefix=/usr/local --enable-static --disable-fortran --with-jpeg=/usr/local
|
||||
make
|
||||
make install
|
||||
cd ..
|
||||
curl http://download.nexusformat.org/kits/nexus-4.2.1.tar.gz -G | tar xz
|
||||
./configure --prefix=/usr/local --with-hdf4=/usr/local --with-hdf5=/usr --with-xml=/usr/local
|
||||
make
|
||||
make install
|
||||
|
||||
---
|
||||
|
||||
In order to obtain NeXus support in musrfit after installing the above libraries, musrfit has to be configured with the options
|
||||
"--enable-static --enable-NeXus"
|
||||
|
||||
Further information on how to set up musrfit under Cygwin can be found here:
|
||||
https://intranet.psi.ch/MUSR/MusrFitSetup#A_4_MS_Windows
|
||||
http://lmu.web.psi.ch/facilities/software/musrfit/user/intranet.psi.ch/MUSR/MusrFitSetup.html#A_4_MS_Windows
|
||||
|
||||
EOF
|
||||
1206
src/external/nexus/Usage.md
vendored
Normal file
1206
src/external/nexus/Usage.md
vendored
Normal file
File diff suppressed because it is too large
Load Diff
149
src/external/nexus/examples/hdf4/CMakeLists.txt
vendored
Normal file
149
src/external/nexus/examples/hdf4/CMakeLists.txt
vendored
Normal file
@@ -0,0 +1,149 @@
|
||||
# - h4nexus
|
||||
cmake_minimum_required(VERSION 3.26)
|
||||
|
||||
project(h4nexus VERSION 0.1.0 LANGUAGES CXX)
|
||||
|
||||
#--- set C++ standard ---------------------------------------------------------
|
||||
set(CMAKE_CXX_STANDARD 17)
|
||||
set(CMAKE_CXX_STANDARD_REQUIRED ON)
|
||||
set(CMAKE_CXX_EXTENSIONS OFF)
|
||||
|
||||
#--- set a default build type if none was specified ---------------------------
|
||||
set(default_build_type "Release")
|
||||
|
||||
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 ()
|
||||
|
||||
#--- check for pkg-config -----------------------------------------------------
|
||||
find_package(PkgConfig REQUIRED)
|
||||
|
||||
#--- check for git ------------------------------------------------------------
|
||||
find_package(Git REQUIRED)
|
||||
|
||||
#--- check for HDF4 -----------------------------------------------------------
|
||||
# Find HDF4 manually (pkg-config often doesn't have hdf4)
|
||||
find_path(HDF4_INCLUDE_DIR
|
||||
NAMES mfhdf.h
|
||||
PATHS /usr/include /usr/local/include
|
||||
PATH_SUFFIXES hdf
|
||||
)
|
||||
|
||||
find_library(HDF4_DF_LIBRARY
|
||||
NAMES df libdf
|
||||
PATHS /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib
|
||||
)
|
||||
|
||||
find_library(HDF4_MFHDF_LIBRARY
|
||||
NAMES mfhdf libmfhdf
|
||||
PATHS /usr/lib64 /usr/lib /usr/local/lib64 /usr/local/lib
|
||||
)
|
||||
|
||||
if (HDF4_INCLUDE_DIR AND HDF4_DF_LIBRARY AND HDF4_MFHDF_LIBRARY)
|
||||
set(HDF4_FOUND TRUE)
|
||||
set(HDF4_INCLUDE_DIRS ${HDF4_INCLUDE_DIR})
|
||||
set(HDF4_LIBRARIES ${HDF4_MFHDF_LIBRARY} ${HDF4_DF_LIBRARY})
|
||||
message(STATUS "Found HDF4: ${HDF4_INCLUDE_DIR}")
|
||||
message(STATUS " HDF4 libraries: ${HDF4_LIBRARIES}")
|
||||
else ()
|
||||
message(FATAL_ERROR "HDF4 library not found. Please install libhdf4-dev or hdf-devel")
|
||||
endif ()
|
||||
|
||||
include_directories(${HDF4_INCLUDE_DIRS})
|
||||
|
||||
#--- check for HDF5 -----------------------------------------------------------
|
||||
find_package(HDF5 REQUIRED COMPONENTS CXX)
|
||||
if(NOT HDF5_FOUND)
|
||||
message(FATAL_ERROR "HDF5 C++ library not found")
|
||||
endif()
|
||||
include_directories(${HDF5_INCLUDE_DIRS})
|
||||
|
||||
#--- check for ROOT -----------------------------------------------------------
|
||||
find_package(ROOT 6.36 REQUIRED COMPONENTS Minuit2)
|
||||
if (ROOT_miniut2_FOUND)
|
||||
execute_process(COMMAND root-config --bindir OUTPUT_VARIABLE ROOT_BINDIR)
|
||||
string(STRIP ${ROOT_BINDIR} ROOT_BINDIR)
|
||||
execute_process(COMMAND root-config --version OUTPUT_VARIABLE ROOT_VERSION)
|
||||
string(STRIP ${ROOT_VERSION} ROOT_VERSION)
|
||||
message("-- Found ROOT: ${ROOT_BINDIR} (found version: ${ROOT_VERSION})")
|
||||
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
|
||||
include(${ROOT_USE_FILE})
|
||||
endif (ROOT_miniut2_FOUND)
|
||||
|
||||
#--- all checks done -> feed config.h -----------------------------------------
|
||||
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 ()
|
||||
|
||||
#--- start create git-revision.h ----------------------------------------------
|
||||
if (IS_GIT_REPO)
|
||||
execute_process(COMMAND sh ${CMAKE_SOURCE_DIR}/git_revision.sh ${CMAKE_BINARY_DIR})
|
||||
|
||||
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)
|
||||
|
||||
#--- end create git-revision.h ------------------------------------------------
|
||||
|
||||
#--- write summary of the installation
|
||||
cmake_host_system_information(RESULT PROCESSOR QUERY PROCESSOR_DESCRIPTION)
|
||||
|
||||
message("")
|
||||
message("|-----------------------------------------------------------------------|")
|
||||
message("| |")
|
||||
message("| Summary |")
|
||||
message("| |")
|
||||
message("|-----------------------------------------------------------------------|")
|
||||
message("")
|
||||
message(" System: ${CMAKE_HOST_SYSTEM_NAME} ${CMAKE_SYSTEM_PROCESSOR} - ${CMAKE_HOST_SYSTEM_VERSION}")
|
||||
message(" Processor: ${PROCESSOR} (${CMAKE_SYSTEM_PROCESSOR})")
|
||||
message(" ----------")
|
||||
message("")
|
||||
message(" h4nexus Version: ${h4nexus_VERSION}")
|
||||
message(" ----------------")
|
||||
message("")
|
||||
message(" Build Type: ${CMAKE_BUILD_TYPE}")
|
||||
message(" -----------")
|
||||
message("")
|
||||
message(" Requirements:")
|
||||
message(" -------------")
|
||||
message("")
|
||||
message(" HDF4 found in ${HDF4_INCLUDE_DIRS}")
|
||||
message(" ROOT found in ${ROOT_INCLUDE_DIRS}, Version: ${ROOT_VERSION}")
|
||||
message("")
|
||||
message(" Installation directories:")
|
||||
message(" -------------------------")
|
||||
message("")
|
||||
message(" Programs : ${CMAKE_INSTALL_PREFIX}/bin")
|
||||
message("")
|
||||
message("-------------------------------------------------------------------------")
|
||||
message("")
|
||||
|
||||
#--- h4nexus executable -------------------------------------------------------
|
||||
add_executable(h4nexus
|
||||
../../PNeXus.cpp
|
||||
main.cpp)
|
||||
target_compile_options(h4nexus BEFORE PRIVATE "-DHAVE_HDF4 -DHAVE_CONFIG_H" ${HAVE_GIT_REV_H})
|
||||
target_include_directories(h4nexus
|
||||
BEFORE PRIVATE
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/build>
|
||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/../..>
|
||||
$<BUILD_INTERFACE:${ROOT_INCLUDE_DIRS}>
|
||||
)
|
||||
target_link_libraries(h4nexus ${HDF4_LIBRARIES} ${HDF5_LIBRARIES} ${ROOT_LIBRARIES})
|
||||
7
src/external/nexus/examples/hdf4/cmake/config.h.in
vendored
Normal file
7
src/external/nexus/examples/hdf4/cmake/config.h.in
vendored
Normal file
@@ -0,0 +1,7 @@
|
||||
/* config.h.in. Generated from CMakeLists.txt */
|
||||
|
||||
/* Define to 1 if you have the <config.h> file. */
|
||||
#cmakedefine HAVE_CONFIG_H @HAVE_CONFIG_H@
|
||||
|
||||
/* h4nexus version */
|
||||
#define H4NEXUS_VERSION "@h4nexus_VERSION@"
|
||||
155
src/external/nexus/examples/hdf4/docu/README.md
vendored
Normal file
155
src/external/nexus/examples/hdf4/docu/README.md
vendored
Normal file
@@ -0,0 +1,155 @@
|
||||
# h4nexus - handle muSR-NeXus files via HDF4 only
|
||||
|
||||
## Contents
|
||||
|
||||
Tests and classes to handle muSR-NeXus files directly via the HDF4 C API.
|
||||
|
||||
This project provides the same API as h5nexus but uses HDF4 instead of HDF5 for handling NeXus files.
|
||||
|
||||
## Features
|
||||
|
||||
- **Read and write NeXus HDF4 files** with a clean C++ API
|
||||
- **Case-insensitive path lookup** for datasets and groups
|
||||
- **Type-safe data handling** using template classes
|
||||
- **Dead time correction calculation** for muon detector data using ROOT Minuit2
|
||||
- **Compatible API with h5nexus** for easy migration
|
||||
|
||||
## Key Classes
|
||||
|
||||
- `nxH4::PNeXus` - Main class for reading/writing NeXus HDF4 files
|
||||
- `nxH4::PNXdata<T>` - Template class for storing dataset content with attributes
|
||||
- `nxH4::PNeXusDeadTime` - Dead time correction calculator for muon detector data
|
||||
|
||||
## Requirements
|
||||
|
||||
- CMake >= 3.26
|
||||
- C++17 compatible compiler
|
||||
- HDF4 library (libhdf4-dev or hdf-devel)
|
||||
- ROOT >= 6.36 with Minuit2 component
|
||||
- pkg-config
|
||||
|
||||
## Building
|
||||
|
||||
```bash
|
||||
mkdir build
|
||||
cd build
|
||||
cmake ..
|
||||
make
|
||||
```
|
||||
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
make install
|
||||
```
|
||||
|
||||
This will install:
|
||||
- Library: `libh4nexus.so` in `${CMAKE_INSTALL_PREFIX}/lib`
|
||||
- Executable: `h4nexus` in `${CMAKE_INSTALL_PREFIX}/bin`
|
||||
- Header: `PNeXus.h` in `${CMAKE_INSTALL_PREFIX}/include/h4nexus`
|
||||
|
||||
## Usage
|
||||
|
||||
### Command Line
|
||||
|
||||
```bash
|
||||
# Display help
|
||||
h4nexus --help
|
||||
|
||||
# Read and display a NeXus HDF4 file
|
||||
h4nexus --fn input.nxs
|
||||
|
||||
# Read with debug output
|
||||
h4nexus --fn input.nxs --debug
|
||||
|
||||
# Calculate dead time corrections
|
||||
h4nexus --fn input.nxs --dead_time_estimate
|
||||
|
||||
# Write output file
|
||||
h4nexus --fn input.nxs --out output.nxs
|
||||
```
|
||||
|
||||
### Programmatic Usage
|
||||
|
||||
```cpp
|
||||
#include <h4nexus/PNeXus.h>
|
||||
|
||||
// Read a NeXus file
|
||||
nxH4::PNeXus nexus("data.nxs");
|
||||
|
||||
// Access datasets
|
||||
auto counts_data = nexus.GetDataset<int>("/raw_data_1/detector_1/counts");
|
||||
const auto& counts = counts_data.GetData();
|
||||
const auto& dims = counts_data.GetDimensions();
|
||||
|
||||
// Dump file contents
|
||||
nexus.Dump();
|
||||
|
||||
// Write to new file
|
||||
nexus.WriteNexusFile("output.nxs", 2); // IDF version 2
|
||||
```
|
||||
|
||||
### Creating Files from Scratch
|
||||
|
||||
```cpp
|
||||
nxH4::PNeXus nxs_out;
|
||||
|
||||
// Add datasets
|
||||
std::vector<int> counts(16*66000, 0);
|
||||
nxs_out.AddDataset<int>("/raw_data_1/detector_1/counts",
|
||||
counts, {1, 16, 66000},
|
||||
nxH4::H4DataType::INT32);
|
||||
|
||||
// Add attributes
|
||||
nxs_out.AddDatasetAttribute<int>("/raw_data_1/detector_1/counts",
|
||||
"units", std::string("counts"));
|
||||
|
||||
// Add group attributes
|
||||
nxs_out.AddGroupAttribute("/raw_data_1", "NX_class", std::string("NXentry"));
|
||||
|
||||
// Write file
|
||||
nxs_out.WriteNexusFile("output.nxs");
|
||||
```
|
||||
|
||||
## API Compatibility with h5nexus
|
||||
|
||||
The h4nexus API is designed to be compatible with h5nexus. The main differences are:
|
||||
|
||||
- Namespace: `nxH4::` instead of `nxH5::`
|
||||
- Data types: `H4DataType` enum instead of `H5::DataType`
|
||||
- Dimensions: Uses `uint32_t` instead of `hsize_t`
|
||||
|
||||
Code migration typically requires only:
|
||||
1. Changing namespace from `nxH5` to `nxH4`
|
||||
2. Changing `H5::PredType::NATIVE_INT` to `nxH4::H4DataType::INT32` (etc.)
|
||||
3. Changing dimension types from `hsize_t` to `uint32_t`
|
||||
|
||||
## Supported Data Types
|
||||
|
||||
- `H4DataType::INT32` - 32-bit signed integer
|
||||
- `H4DataType::FLOAT32` - 32-bit floating point
|
||||
- `H4DataType::FLOAT64` - 64-bit floating point
|
||||
- `H4DataType::CHAR8` - 8-bit character/string
|
||||
- `H4DataType::UINT32` - 32-bit unsigned integer
|
||||
- `H4DataType::INT16` - 16-bit signed integer
|
||||
- `H4DataType::UINT16` - 16-bit unsigned integer
|
||||
- `H4DataType::INT8` - 8-bit signed integer
|
||||
- `H4DataType::UINT8` - 8-bit unsigned integer
|
||||
|
||||
## Differences from HDF5
|
||||
|
||||
HDF4 has some limitations compared to HDF5:
|
||||
- No true hierarchical groups (simulated using naming conventions)
|
||||
- Less flexible attribute handling
|
||||
- Different maximum name lengths
|
||||
- C API instead of C++ API
|
||||
|
||||
The h4nexus library abstracts these differences to provide a similar interface to h5nexus.
|
||||
|
||||
## License
|
||||
|
||||
GNU General Public License v2 (GPLv2)
|
||||
|
||||
## Contacts
|
||||
|
||||
Andreas Suter <andreas.suter@psi.ch>
|
||||
35
src/external/nexus/examples/hdf4/git_revision.sh
vendored
Executable file
35
src/external/nexus/examples/hdf4/git_revision.sh
vendored
Executable file
@@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Script to create git-revision.h with current git information
|
||||
# Usage: git_revision.sh [output_directory]
|
||||
|
||||
output_dir="${1:-.}"
|
||||
output_file="${output_dir}/git-revision.h"
|
||||
|
||||
# Check if we're in a git repository
|
||||
if ! git rev-parse --git-dir > /dev/null 2>&1; then
|
||||
echo "Not in a git repository, skipping git-revision.h generation"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Get git information
|
||||
git_branch=$(git rev-parse --abbrev-ref HEAD 2>/dev/null)
|
||||
git_hash=$(git rev-parse --short HEAD 2>/dev/null)
|
||||
git_date=$(git log -1 --format=%cd --date=short 2>/dev/null)
|
||||
|
||||
# Create header file
|
||||
cat > "$output_file" << EOF
|
||||
// This file is auto-generated by git_revision.sh
|
||||
// Do not edit manually
|
||||
|
||||
#ifndef GIT_REVISION_H
|
||||
#define GIT_REVISION_H
|
||||
|
||||
#define GIT_BRANCH "$git_branch"
|
||||
#define GIT_HASH "$git_hash"
|
||||
#define GIT_DATE "$git_date"
|
||||
|
||||
#endif // GIT_REVISION_H
|
||||
EOF
|
||||
|
||||
echo "Generated $output_file"
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user