Compare commits
16 Commits
Author | SHA1 | Date | |
---|---|---|---|
bface6bf1e | |||
e3c2149847 | |||
f3414f687c | |||
44aacfca50 | |||
173d20f05e | |||
ccc1dda352 | |||
b4c7780ff5 | |||
2ba6e8a230 | |||
43b4566870 | |||
b1ffba391a | |||
804c56fd1f | |||
ae7f1a2168 | |||
3f2e96303a | |||
1b190830e9 | |||
7b19ba8b36 | |||
137a3f17c9 |
@ -1,11 +1,7 @@
|
|||||||
# - musrfit
|
# - musrfit
|
||||||
cmake_minimum_required(VERSION 3.9)
|
cmake_minimum_required(VERSION 3.17)
|
||||||
|
|
||||||
if (CMAKE_VERSION GREATER_EQUAL 3.12)
|
project(musrfit VERSION 1.8.1 LANGUAGES C CXX)
|
||||||
cmake_policy(SET CMP0075 NEW)
|
|
||||||
endif (CMAKE_VERSION GREATER_EQUAL 3.12)
|
|
||||||
|
|
||||||
project(musrfit VERSION 1.8.0 LANGUAGES C CXX)
|
|
||||||
|
|
||||||
#--- musrfit specific options -------------------------------------------------
|
#--- musrfit specific options -------------------------------------------------
|
||||||
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
|
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
|
||||||
@ -21,7 +17,7 @@ set_property(CACHE qt_version PROPERTY STRINGS AUTO 3 4 5 6)
|
|||||||
|
|
||||||
#--- set a default build type if none was specified ---------------------------
|
#--- set a default build type if none was specified ---------------------------
|
||||||
set(default_build_type "Release")
|
set(default_build_type "Release")
|
||||||
|
|
||||||
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
if (NOT CMAKE_BUILD_TYPE AND NOT CMAKE_CONFIGURATION_TYPES)
|
||||||
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
message(STATUS "Setting build type to '${default_build_type}' as none was specified.")
|
||||||
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
set(CMAKE_BUILD_TYPE "${default_build_type}" CACHE
|
||||||
@ -35,7 +31,7 @@ endif ()
|
|||||||
|
|
||||||
#--- the next two lines are needed that the math functions are found ----------
|
#--- the next two lines are needed that the math functions are found ----------
|
||||||
set(CMAKE_REQUIRED_INCLUDES math.h)
|
set(CMAKE_REQUIRED_INCLUDES math.h)
|
||||||
set(CMAKE_REQUIRED_LIBRARIES m)
|
set(CMAKE_REQUIRED_LIBRARIES m)
|
||||||
|
|
||||||
include(CheckTypeSize)
|
include(CheckTypeSize)
|
||||||
include(CheckIncludeFiles)
|
include(CheckIncludeFiles)
|
||||||
@ -84,17 +80,17 @@ if (ROOT_mathmore_FOUND)
|
|||||||
endif (ROOT_mathmore_FOUND)
|
endif (ROOT_mathmore_FOUND)
|
||||||
|
|
||||||
#--- the next check is need to set a flag, since root 6.24 (minuit2) breaks
|
#--- the next check is need to set a flag, since root 6.24 (minuit2) breaks
|
||||||
#--- the backwards compatibility. ---------------------------------------------
|
#--- the backwards compatibility. ---------------------------------------------
|
||||||
if (ROOT_VERSION VERSION_LESS "6.23")
|
if (ROOT_VERSION VERSION_LESS "6.23")
|
||||||
set(ROOT_GRTEQ_24 0)
|
set(ROOT_GRTEQ_24 0)
|
||||||
else ()
|
else ()
|
||||||
set(ROOT_GRTEQ_24 1)
|
set(ROOT_GRTEQ_24 1)
|
||||||
endif ()
|
endif ()
|
||||||
set(ROOT_GRTEQ_24 ${ROOT_GRTEQ_24} CACHE INTERNAL "ROOT Version check")
|
set(ROOT_GRTEQ_24 ${ROOT_GRTEQ_24} CACHE INTERNAL "ROOT Version check")
|
||||||
|
|
||||||
#--- check for boost ----------------------------------------------------------
|
#--- check for boost ----------------------------------------------------------
|
||||||
find_package(Boost REQUIRED
|
find_package(Boost REQUIRED
|
||||||
COMPONENTS
|
COMPONENTS
|
||||||
system
|
system
|
||||||
filesystem
|
filesystem
|
||||||
)
|
)
|
||||||
@ -105,12 +101,6 @@ find_package(GSL REQUIRED)
|
|||||||
|
|
||||||
#--- check for fftw3 ----------------------------------------------------------
|
#--- check for fftw3 ----------------------------------------------------------
|
||||||
find_package(FFTW3 REQUIRED)
|
find_package(FFTW3 REQUIRED)
|
||||||
if (FFTW3_THREAD_FOUND)
|
|
||||||
set(HAVE_LIBFFTW3_THREADS 1 CACHE INTERNAL "fftw3_threads are available")
|
|
||||||
endif (FFTW3_THREAD_FOUND)
|
|
||||||
if (FFTW3F_THREAD_FOUND)
|
|
||||||
set(HAVE_LIBFFTW3F_THREADS 1 CACHE INTERNAL "fftw3f_threads are available")
|
|
||||||
endif (FFTW3F_THREAD_FOUND)
|
|
||||||
|
|
||||||
#--- check for libxml2 --------------------------------------------------------
|
#--- check for libxml2 --------------------------------------------------------
|
||||||
find_package(LibXml2 REQUIRED)
|
find_package(LibXml2 REQUIRED)
|
||||||
@ -135,7 +125,7 @@ if (qt_based_tools)
|
|||||||
find_package(Qt6Xml CONFIG REQUIRED)
|
find_package(Qt6Xml CONFIG REQUIRED)
|
||||||
find_package(Qt6Network CONFIG REQUIRED)
|
find_package(Qt6Network CONFIG REQUIRED)
|
||||||
find_package(Qt6Svg CONFIG REQUIRED)
|
find_package(Qt6Svg CONFIG REQUIRED)
|
||||||
find_package(Qt6PrintSupport CONFIG REQUIRED)
|
find_package(Qt6PrintSupport CONFIG REQUIRED)
|
||||||
endif (Qt6Core_FOUND)
|
endif (Qt6Core_FOUND)
|
||||||
# try Qt5
|
# try Qt5
|
||||||
if (NOT Qt6Core_FOUND)
|
if (NOT Qt6Core_FOUND)
|
||||||
@ -209,7 +199,7 @@ endif (qt_based_tools)
|
|||||||
if (nexus)
|
if (nexus)
|
||||||
find_package(HDF5 COMPONENTS CXX REQUIRED )
|
find_package(HDF5 COMPONENTS CXX REQUIRED )
|
||||||
find_package(HDF4 REQUIRED)
|
find_package(HDF4 REQUIRED)
|
||||||
find_package(NeXus REQUIRED)
|
find_package(NEXUS REQUIRED)
|
||||||
add_definitions(-DPNEXUS_ENABLED)
|
add_definitions(-DPNEXUS_ENABLED)
|
||||||
endif (nexus)
|
endif (nexus)
|
||||||
|
|
||||||
@ -232,7 +222,7 @@ endif ()
|
|||||||
#--- propagate to the sub-directories -----------------------------------------
|
#--- propagate to the sub-directories -----------------------------------------
|
||||||
add_subdirectory(src)
|
add_subdirectory(src)
|
||||||
|
|
||||||
#--- write summary of the installation
|
#--- write summary of the installation
|
||||||
message("")
|
message("")
|
||||||
message("|-----------------------------------------------------------------------|")
|
message("|-----------------------------------------------------------------------|")
|
||||||
message("| |")
|
message("| |")
|
||||||
@ -249,7 +239,7 @@ message("")
|
|||||||
message(" Requirements:")
|
message(" Requirements:")
|
||||||
message(" -------------")
|
message(" -------------")
|
||||||
message("")
|
message("")
|
||||||
message(" FFTW3 found in ${FFTW3_INCLUDE_DIR}")
|
message(" FFTW3 found in ${FFTW3_INCLUDE}")
|
||||||
message(" GSL found in ${GSL_INCLUDE_DIRS}")
|
message(" GSL found in ${GSL_INCLUDE_DIRS}")
|
||||||
message(" BOOST found in ${Boost_INCLUDE_DIRS}")
|
message(" BOOST found in ${Boost_INCLUDE_DIRS}")
|
||||||
message(" LibXML2 found in ${LIBXML2_INCLUDE_DIR}")
|
message(" LibXML2 found in ${LIBXML2_INCLUDE_DIR}")
|
||||||
@ -264,14 +254,14 @@ endif (OpenMP_FOUND)
|
|||||||
|
|
||||||
if (nexus)
|
if (nexus)
|
||||||
message("")
|
message("")
|
||||||
message(" HDF4 found in ${HDF4_INCLUDE_DIRS}")
|
message(" HDF4 found in ${HDF4_INCLUDE_DIRS}")
|
||||||
message(" HDF5 found in ${HDF5_INCLUDE_DIRS}")
|
message(" HDF5 found in ${HDF5_INCLUDE_DIRS}")
|
||||||
message(" NeXus found in ${NEXUS_INCLUDE_DIR}")
|
message(" NeXus found in ${NEXUS_INCLUDE_DIR}")
|
||||||
endif (nexus)
|
endif (nexus)
|
||||||
|
|
||||||
message("")
|
message("")
|
||||||
if (qt_based_tools)
|
if (qt_based_tools)
|
||||||
if (Qt6Core_FOUND)
|
if (Qt6Core_FOUND)
|
||||||
message(" Qt found in ${Qt6Core_INCLUDE_DIRS} (Version: ${Qt6Core_VERSION})")
|
message(" Qt found in ${Qt6Core_INCLUDE_DIRS} (Version: ${Qt6Core_VERSION})")
|
||||||
else (Qt6Core_FOUND)
|
else (Qt6Core_FOUND)
|
||||||
if (Qt5Core_FOUND)
|
if (Qt5Core_FOUND)
|
||||||
@ -363,8 +353,8 @@ message("-----------------------------------------------------------------------
|
|||||||
message("")
|
message("")
|
||||||
|
|
||||||
#--- cpack specific info ......................................................
|
#--- cpack specific info ......................................................
|
||||||
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} PROJECT_SOURCE_DIR_NATIVE)
|
file(TO_NATIVE_PATH ${PROJECT_SOURCE_DIR} PROJECT_SOURCE_DIR_NATIVE)
|
||||||
file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} PROJECT_BINARY_DIR_NATIVE)
|
file(TO_NATIVE_PATH ${PROJECT_BINARY_DIR} PROJECT_BINARY_DIR_NATIVE)
|
||||||
string(REPLACE "\\" "\\\\" PROJECT_SOURCE_DIR_NATIVE_D ${PROJECT_SOURCE_DIR_NATIVE})
|
string(REPLACE "\\" "\\\\" PROJECT_SOURCE_DIR_NATIVE_D ${PROJECT_SOURCE_DIR_NATIVE})
|
||||||
string(REPLACE "\\" "\\\\" PROJECT_BINARY_DIR_NATIVE_D ${PROJECT_BINARY_DIR_NATIVE})
|
string(REPLACE "\\" "\\\\" PROJECT_BINARY_DIR_NATIVE_D ${PROJECT_BINARY_DIR_NATIVE})
|
||||||
|
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
# - Find fftw3 library
|
# - Find fftw3 library
|
||||||
# Find the native FFTW3 includes and library
|
# Find the native FFTW3 includes and library
|
||||||
# This module defines
|
# This module defines
|
||||||
# FFTW3_INCLUDE_DIR, where to find fftw3.h, etc.
|
# FFTW3_INCLUDE, where to find fftw3.h, etc.
|
||||||
# ---
|
# ---
|
||||||
# FFTW3_LIBRARY, library to link against to use FFTW3
|
# FFTW3_LIBRARY, library to link against to use FFTW3
|
||||||
# FFTW3_OMP_LIBRARY, library to link against to use FFTW3_omp
|
# FFTW3_OMP_LIBRARY, library to link against to use FFTW3_omp
|
||||||
@ -31,17 +31,53 @@
|
|||||||
# FFTW3Q_OMP_FOUND, if false, do not try to use OpenMP FFTW3q.
|
# FFTW3Q_OMP_FOUND, if false, do not try to use OpenMP FFTW3q.
|
||||||
# FFTW3Q_THREADS_FOUND, if false, do not try to use threaded FFTW3q.
|
# FFTW3Q_THREADS_FOUND, if false, do not try to use threaded FFTW3q.
|
||||||
|
|
||||||
find_path(FFTW3_INCLUDE_DIR fftw3.h
|
function(add_imported_library lib_name library headers)
|
||||||
|
add_library(FFTW3::${lib_name} UNKNOWN IMPORTED)
|
||||||
|
set_target_properties(FFTW3::${lib_name} PROPERTIES
|
||||||
|
IMPORTED_LOCATION ${library}
|
||||||
|
INTERFACE_INCLUDE_DIRECTORIES ${headers}
|
||||||
|
)
|
||||||
|
set(${lib_name}_FOUND 1 CACHE INTERNAL "FFTW3 ${lib_name} found" FORCE)
|
||||||
|
set(${lib_name}_LIBRARY ${library}
|
||||||
|
CACHE STRING "Path to FFTW3::${lib_name} library" FORCE)
|
||||||
|
set(FFTW3_INCLUDE ${headers}
|
||||||
|
CACHE STRING "Path to FFTW3 headers" FORCE)
|
||||||
|
mark_as_advanced(FORCE ${lib_name}_LIBRARY)
|
||||||
|
mark_as_advanced(FORCE FFTW3_INCLUDE)
|
||||||
|
endfunction()
|
||||||
|
|
||||||
|
#as35 if (FFTW3_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 if (FFTW3_OMP_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3_OMP_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3_THREAD_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3_THRED_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3L_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3L_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3L_OMP_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3L_OMP_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3L_THREAD_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3L_THRED_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3F_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3F_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3F_OMP_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3F_OMP_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3F_THREAD_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3F_THRED_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3Q_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3Q_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3Q_OMP_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3Q_OMP_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 elseif (FFTW3Q_THREAD_LIBRARY AND FFTW3_INCLUDE)
|
||||||
|
#as35 add_imported_library(${FFTW3Q_THRED_LIBRARY} ${FFTW3_INCLUDE})
|
||||||
|
#as35 endif()
|
||||||
|
#as35 return()
|
||||||
|
#as35 endif()
|
||||||
|
|
||||||
|
find_path(FFTW3_INCLUDE NAMES fftw3.h
|
||||||
HINTS "/usr/include" "/opt/local/include"
|
HINTS "/usr/include" "/opt/local/include"
|
||||||
)
|
)
|
||||||
|
|
||||||
# find position of fftw3.h from the end
|
|
||||||
string(FIND "${FFTW3_INCLUDE_DIR}" "/fftw3.h" pos REVERSE)
|
|
||||||
# truncate the string
|
|
||||||
string(SUBSTRING "${FFTW3_INCLUDE_DIR}" 0 ${pos} substr)
|
|
||||||
set(FFTW3_INCLUDE_DIR ${substr})
|
|
||||||
unset(substr)
|
|
||||||
|
|
||||||
find_library(FFTW3_LIBRARY fftw3)
|
find_library(FFTW3_LIBRARY fftw3)
|
||||||
find_library(FFTW3_OMP_LIBRARY fftw3_omp)
|
find_library(FFTW3_OMP_LIBRARY fftw3_omp)
|
||||||
find_library(FFTW3_THREAD_LIBRARY fftw3_threads)
|
find_library(FFTW3_THREAD_LIBRARY fftw3_threads)
|
||||||
@ -58,94 +94,126 @@ find_library(FFTW3Q_THREAD_LIBRARY fftw3q_threads)
|
|||||||
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
|
# handle the QUIETLY and REQUIRED arguments and set FFTW3_FOUND to TRUE if
|
||||||
# all listed variables are TRUE
|
# all listed variables are TRUE
|
||||||
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
include(${CMAKE_ROOT}/Modules/FindPackageHandleStandardArgs.cmake)
|
||||||
|
|
||||||
|
# FFTW3
|
||||||
find_package_handle_standard_args(FFTW3
|
find_package_handle_standard_args(FFTW3
|
||||||
REQUIRED_VARS FFTW3_LIBRARY FFTW3_INCLUDE_DIR
|
DEFAULT_MSG FFTW3_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
)
|
||||||
|
if (FFTW3_FOUND)
|
||||||
|
add_imported_library("FFTW3" "${FFTW3_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3_OMP
|
||||||
find_package_handle_standard_args(FFTW3_OMP
|
find_package_handle_standard_args(FFTW3_OMP
|
||||||
REQUIRED_VARS FFTW3_OMP_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3_OMP_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3_OMP_FOUND)
|
||||||
|
add_imported_library("FFTW3_OMP" "${FFTW3_OMP_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3_THREAD
|
||||||
find_package_handle_standard_args(FFTW3_THREAD
|
find_package_handle_standard_args(FFTW3_THREAD
|
||||||
REQUIRED_VARS FFTW3_THREAD_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3_THREAD_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3_THREAD_FOUND)
|
||||||
|
add_imported_library("FFTW3_THREAD" "${FFTW3_THREAD_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3L
|
||||||
find_package_handle_standard_args(FFTW3L
|
find_package_handle_standard_args(FFTW3L
|
||||||
REQUIRED_VARS FFTW3L_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3L_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3L_FOUND)
|
||||||
|
add_imported_library("FFTW3L" "${FFTW3L_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3L_OMP
|
||||||
find_package_handle_standard_args(FFTW3L_OMP
|
find_package_handle_standard_args(FFTW3L_OMP
|
||||||
REQUIRED_VARS FFTW3L_OMP_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3L_OMP_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3L_OMP_FOUND)
|
||||||
|
add_imported_library("FFTW3L_OMP" "${FFTW3L_OMP_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3L_THREAD
|
||||||
find_package_handle_standard_args(FFTW3L_THREAD
|
find_package_handle_standard_args(FFTW3L_THREAD
|
||||||
REQUIRED_VARS FFTW3L_THREAD_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3L_THREAD_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3L_THREAD_FOUND)
|
||||||
|
add_imported_library("FFTW3L_THREAD" "${FFTW3L_THREAD_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3F
|
||||||
find_package_handle_standard_args(FFTW3F
|
find_package_handle_standard_args(FFTW3F
|
||||||
REQUIRED_VARS FFTW3F_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3F_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3F_FOUND)
|
||||||
|
add_imported_library("FFTW3F" "${FFTW3F_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3F_OMP
|
||||||
find_package_handle_standard_args(FFTW3F_OMP
|
find_package_handle_standard_args(FFTW3F_OMP
|
||||||
REQUIRED_VARS FFTW3F_OMP_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3F_OMP_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3F_OMP_FOUND)
|
||||||
|
add_imported_library("FFTW3F_OMP" "${FFTW3F_OMP_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3F_THREAD
|
||||||
find_package_handle_standard_args(FFTW3F_THREAD
|
find_package_handle_standard_args(FFTW3F_THREAD
|
||||||
REQUIRED_VARS FFTW3F_THREAD_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3F_THREAD_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3F_THREAD_FOUND)
|
||||||
|
add_imported_library("FFTW3F_THREAD" "${FFTW3F_THREAD_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3Q
|
||||||
find_package_handle_standard_args(FFTW3Q
|
find_package_handle_standard_args(FFTW3Q
|
||||||
REQUIRED_VARS FFTW3Q_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3Q_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3Q_FOUND)
|
||||||
|
add_imported_library("FFTW3Q" "${FFTW3Q_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3Q_OMP
|
||||||
find_package_handle_standard_args(FFTW3Q_OMP
|
find_package_handle_standard_args(FFTW3Q_OMP
|
||||||
REQUIRED_VARS FFTW3Q_OMP_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3Q_OMP_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
|
)
|
||||||
|
if (FFTW3Q_OMP_FOUND)
|
||||||
|
add_imported_library("FFTW3Q_OMP" "${FFTW3Q_OMP_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
|
endif()
|
||||||
|
|
||||||
|
# FFTW3Q_THREAD
|
||||||
find_package_handle_standard_args(FFTW3Q_THREAD
|
find_package_handle_standard_args(FFTW3Q_THREAD
|
||||||
REQUIRED_VARS FFTW3Q_THREAD_LIBRARY FFTW3_INCLUDE_DIR
|
REQUIRED_VARS FFTW3Q_THREAD_LIBRARY FFTW3_INCLUDE
|
||||||
VERSION_VAR "3")
|
HANDLE_COMPONENTS
|
||||||
|
NAME_MISMATCHED
|
||||||
if (NOT FFTW3_FOUND)
|
)
|
||||||
unset(FFTW3_LIBRARY)
|
if (FFTW3Q_THREAD_FOUND)
|
||||||
endif()
|
add_imported_library("FFTW3Q_THREAD" "${FFTW3Q_THREAD_LIBRARY}" "${FFTW3_INCLUDE}")
|
||||||
if (NOT FFTW3_OMP_FOUND)
|
|
||||||
unset(FFTW3_OMP_LIBRARY)
|
|
||||||
endif()
|
|
||||||
if (NOT FFTW3_THREAD_FOUND)
|
|
||||||
unset(FFTW3_THREAD_LIBRARY)
|
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
if (NOT FFTW3L_FOUND)
|
|
||||||
unset(FFTW3L_LIBRARY)
|
|
||||||
endif()
|
|
||||||
if (NOT FFTW3L_OMP_FOUND)
|
|
||||||
unset(FFTW3L_OMP_LIBRARY)
|
|
||||||
endif()
|
|
||||||
if (NOT FFTW3L_THREAD_FOUND)
|
|
||||||
unset(FFTW3L_THREAD_LIBRARY)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT FFTW3F_FOUND)
|
|
||||||
unset(FFTW3F_LIBRARY)
|
|
||||||
endif()
|
|
||||||
if (NOT FFTW3F_OMP_FOUND)
|
|
||||||
unset(FFTW3F_OMP_LIBRARY)
|
|
||||||
endif()
|
|
||||||
if (NOT FFTW3F_THREAD_FOUND)
|
|
||||||
unset(FFTW3F_THREAD_LIBRARY)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
if (NOT FFTW3Q_FOUND)
|
|
||||||
unset(FFTW3Q_LIBRARY)
|
|
||||||
endif()
|
|
||||||
if (NOT FFTW3Q_OMP_FOUND)
|
|
||||||
unset(FFTW3Q_OMP_LIBRARY)
|
|
||||||
endif()
|
|
||||||
if (NOT FFTW3Q_THREAD_FOUND)
|
|
||||||
unset(FFTW3Q_THREAD_LIBRARY)
|
|
||||||
endif()
|
|
||||||
|
|
||||||
mark_as_advanced(
|
|
||||||
FFTW3_INCLUDE_DIR
|
|
||||||
FFTW3_LIBRARY FFTW3_OMP_LIBRARY FFTW3_THREAD_LIBRARY
|
|
||||||
FFTW3L_LIBRARY FFTW3L_OMP_LIBRARY FFTW3L_THREAD_LIBRARY
|
|
||||||
FFTW3F_LIBRARY FFTW3F_OMP_LIBRARY FFTW3F_THREAD_LIBRARY
|
|
||||||
FFTW3Q_LIBRARY FFTW3Q_OMP_LIBRARY FFTW3Q_THREAD_LIBRARY
|
|
||||||
)
|
|
||||||
|
|
||||||
if (FFTW3_FOUND)
|
if (FFTW3_FOUND)
|
||||||
message("-- Found FFTW3: ${FFTW3_INCLUDE_DIR}")
|
message("-- Found FFTW3: ${FFTW3_INCLUDE}")
|
||||||
endif (FFTW3_FOUND)
|
endif (FFTW3_FOUND)
|
||||||
|
@ -60,7 +60,6 @@ target_compile_options(addRun BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H
|
|||||||
target_include_directories(addRun
|
target_include_directories(addRun
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
@ -72,7 +71,6 @@ target_compile_options(any2many BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV
|
|||||||
target_include_directories(any2many
|
target_include_directories(any2many
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
@ -84,7 +82,6 @@ target_compile_options(dump_header BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_
|
|||||||
target_include_directories(dump_header
|
target_include_directories(dump_header
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
@ -102,7 +99,6 @@ target_compile_options(msr2data BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV
|
|||||||
target_include_directories(msr2data
|
target_include_directories(msr2data
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIRS}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
@ -117,7 +113,6 @@ target_compile_options(musrfit BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_
|
|||||||
target_include_directories(musrfit
|
target_include_directories(musrfit
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
@ -129,18 +124,17 @@ target_compile_options(musrFT BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H
|
|||||||
target_include_directories(musrFT
|
target_include_directories(musrFT
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
)
|
)
|
||||||
target_link_libraries(musrFT ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
target_link_libraries(musrFT FFTW3::FFTW3 ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||||
|
|
||||||
add_executable(musrRootValidation ${GIT_REV_H} musrRootValidation.cpp)
|
add_executable(musrRootValidation ${GIT_REV_H} musrRootValidation.cpp)
|
||||||
target_compile_options(musrRootValidation BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
target_compile_options(musrRootValidation BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||||
target_include_directories(musrRootValidation
|
target_include_directories(musrRootValidation
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
@ -153,7 +147,6 @@ target_compile_options(musrt0 BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H
|
|||||||
target_include_directories(musrt0
|
target_include_directories(musrt0
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
@ -165,18 +158,17 @@ target_compile_options(musrview BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV
|
|||||||
target_include_directories(musrview
|
target_include_directories(musrview
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
)
|
)
|
||||||
target_link_libraries(musrview ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
target_link_libraries(musrview FFTW3::FFTW3 ${ROOT_LIBRARIES} ${MUSRFIT_LIBS})
|
||||||
|
|
||||||
add_executable(write_musrRoot_runHeader ${GIT_REV_H} write_musrRoot_runHeader.cpp)
|
add_executable(write_musrRoot_runHeader ${GIT_REV_H} write_musrRoot_runHeader.cpp)
|
||||||
target_compile_options(write_musrRoot_runHeader BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
target_compile_options(write_musrRoot_runHeader BEFORE PRIVATE "-DHAVE_CONFIG_H" "${HAVE_GIT_REV_H}")
|
||||||
target_include_directories(write_musrRoot_runHeader
|
target_include_directories(write_musrRoot_runHeader
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/include>
|
||||||
|
@ -12,7 +12,7 @@ root_generate_dictionary(
|
|||||||
PFourierCanvas.h
|
PFourierCanvas.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
LINKDEF ${MUSRFIT_INC}/PFourierCanvasLinkDef.h
|
LINKDEF ${MUSRFIT_INC}/PFourierCanvasLinkDef.h
|
||||||
MODULE PFourierCanvas
|
MODULE PFourierCanvas
|
||||||
@ -22,7 +22,7 @@ root_generate_dictionary(
|
|||||||
PMusrCanvas.h
|
PMusrCanvas.h
|
||||||
LINKDEF ${MUSRFIT_INC}/PMusrCanvasLinkDef.h
|
LINKDEF ${MUSRFIT_INC}/PMusrCanvasLinkDef.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE_DIR} -I${MUSRFIT_INC}
|
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
MODULE PMusrCanvas
|
MODULE PMusrCanvas
|
||||||
)
|
)
|
||||||
@ -31,7 +31,7 @@ root_generate_dictionary(
|
|||||||
PMusrT0.h
|
PMusrT0.h
|
||||||
LINKDEF ${MUSRFIT_INC}/PMusrT0LinkDef.h
|
LINKDEF ${MUSRFIT_INC}/PMusrT0LinkDef.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE_DIR} -I${MUSRFIT_INC}
|
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
MODULE PMusrT0
|
MODULE PMusrT0
|
||||||
)
|
)
|
||||||
@ -40,7 +40,7 @@ root_generate_dictionary(
|
|||||||
PStartupHandler.h
|
PStartupHandler.h
|
||||||
LINKDEF ${MUSRFIT_INC}/PStartupHandlerLinkDef.h
|
LINKDEF ${MUSRFIT_INC}/PStartupHandlerLinkDef.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR} -I${MUSRFIT_INC}
|
-I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
MODULE PStartupHandler
|
MODULE PStartupHandler
|
||||||
)
|
)
|
||||||
@ -50,7 +50,7 @@ root_generate_dictionary(
|
|||||||
LINKDEF ${MUSRFIT_INC}/PUserFcnBaseLinkDef.h
|
LINKDEF ${MUSRFIT_INC}/PUserFcnBaseLinkDef.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
-I${FFTW3_INCLUDE_DIR} -I${MUSRFIT_INC}
|
-I${FFTW3_INCLUDE} -I${MUSRFIT_INC}
|
||||||
MODULE PUserFcnBase
|
MODULE PUserFcnBase
|
||||||
)
|
)
|
||||||
root_generate_dictionary(
|
root_generate_dictionary(
|
||||||
@ -59,7 +59,7 @@ root_generate_dictionary(
|
|||||||
OPTIONS
|
OPTIONS
|
||||||
-I${NONLOCAL_INC}
|
-I${NONLOCAL_INC}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${CMAKE_CURRENT_SOURCE_DIR}
|
-I${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
LINKDEF ${MUSRFIT_INC}/PRgeHandlerLinkDef.h
|
LINKDEF ${MUSRFIT_INC}/PRgeHandlerLinkDef.h
|
||||||
@ -118,7 +118,7 @@ add_library(PMusr SHARED
|
|||||||
target_include_directories(
|
target_include_directories(
|
||||||
PMusr BEFORE PRIVATE
|
PMusr BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/MusrRoot>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/MusrRoot>
|
||||||
@ -176,7 +176,8 @@ endif (OpenMP_FOUND)
|
|||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
set(DependOnLibs ${ROOT_LIBARIES})
|
set(DependOnLibs ${ROOT_LIBARIES})
|
||||||
set(DependOnLibs ${DependOnLibs} ${FFTW3_LIBRARY})
|
#set(DependOnLibs ${DependOnLibs} ${FFTW3_LIBRARY})
|
||||||
|
set(DependOnLibs ${DependOnLibs} FFTW3::FFTW3)
|
||||||
set(DependOnLibs ${DependOnLibs} PUserFcnBase)
|
set(DependOnLibs ${DependOnLibs} PUserFcnBase)
|
||||||
set(DependOnLibs ${DependOnLibs} mud)
|
set(DependOnLibs ${DependOnLibs} mud)
|
||||||
set(DependOnLibs ${DependOnLibs} TMusrRunHeader)
|
set(DependOnLibs ${DependOnLibs} TMusrRunHeader)
|
||||||
|
@ -1827,12 +1827,7 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, std::map<UInt_t, TString
|
|||||||
if (fGlobal.GetFitRange(j) == -1)
|
if (fGlobal.GetFitRange(j) == -1)
|
||||||
break;
|
break;
|
||||||
UInt_t neededWidth = 7;
|
UInt_t neededWidth = 7;
|
||||||
UInt_t neededPrec = 2;
|
UInt_t neededPrec = LastSignificant(fGlobal.GetFitRange(j));
|
||||||
if (fGlobal.GetFitRange(j) > 0.0) { // global fit range present
|
|
||||||
LastSignificant(fGlobal.GetFitRange(j));
|
|
||||||
} else { // global fit range absent
|
|
||||||
neededPrec = LastSignificant(fRuns[i].GetFitRange(j));
|
|
||||||
}
|
|
||||||
fout.width(neededWidth);
|
fout.width(neededWidth);
|
||||||
fout.precision(neededPrec);
|
fout.precision(neededPrec);
|
||||||
fout << std::left << std::fixed << fGlobal.GetFitRange(j);
|
fout << std::left << std::fixed << fGlobal.GetFitRange(j);
|
||||||
@ -3868,7 +3863,7 @@ Bool_t PMsrHandler::FilterNumber(TString str, const Char_t *filter, Int_t offset
|
|||||||
Char_t *cstr, filterStr[32];
|
Char_t *cstr, filterStr[32];
|
||||||
cstr = new Char_t[str.Sizeof()];
|
cstr = new Char_t[str.Sizeof()];
|
||||||
strncpy(cstr, str.Data(), str.Sizeof());
|
strncpy(cstr, str.Data(), str.Sizeof());
|
||||||
sprintf(filterStr, "%s%%d", filter);
|
snprintf(filterStr, sizeof(filterStr), "%s%%d", filter);
|
||||||
|
|
||||||
// get number if present
|
// get number if present
|
||||||
found = sscanf(cstr, filterStr, &no_found);
|
found = sscanf(cstr, filterStr, &no_found);
|
||||||
@ -6614,7 +6609,7 @@ UInt_t PMsrHandler::LastSignificant(Double_t dval, UInt_t precLimit)
|
|||||||
|
|
||||||
char str[128];
|
char str[128];
|
||||||
|
|
||||||
sprintf(str, "%lf", dval);
|
snprintf(str, sizeof(str), "%lf", dval);
|
||||||
|
|
||||||
// find decimal point
|
// find decimal point
|
||||||
for (UInt_t i=0; i<strlen(str); i++) {
|
for (UInt_t i=0; i<strlen(str); i++) {
|
||||||
|
@ -543,7 +543,7 @@ void PMusrCanvas::UpdateParamTheoryPad()
|
|||||||
for (UInt_t i=0; i<param.size(); i++) {
|
for (UInt_t i=0; i<param.size(); i++) {
|
||||||
str = "";
|
str = "";
|
||||||
accuracy = GetNeededAccuracy(param[i]);
|
accuracy = GetNeededAccuracy(param[i]);
|
||||||
sprintf(accStr, "%%.%dlf", accuracy);
|
snprintf(accStr, sizeof(accStr), "%%.%dlf", accuracy);
|
||||||
// parameter no
|
// parameter no
|
||||||
str += param[i].fNo;
|
str += param[i].fNo;
|
||||||
if (param[i].fNo<10)
|
if (param[i].fNo<10)
|
||||||
@ -556,9 +556,9 @@ void PMusrCanvas::UpdateParamTheoryPad()
|
|||||||
str += " ";
|
str += " ";
|
||||||
// parameter value
|
// parameter value
|
||||||
if (round(param[i].fValue)-param[i].fValue==0)
|
if (round(param[i].fValue)-param[i].fValue==0)
|
||||||
sprintf(cnum, "%.1lf", param[i].fValue);
|
snprintf(cnum, sizeof(cnum), "%.1lf", param[i].fValue);
|
||||||
else
|
else
|
||||||
sprintf(cnum, accStr, param[i].fValue);
|
snprintf(cnum, sizeof(cnum), accStr, param[i].fValue);
|
||||||
str += cnum;
|
str += cnum;
|
||||||
for (Int_t j=0; j<9-(Int_t)strlen(cnum); j++) // fill spaces
|
for (Int_t j=0; j<9-(Int_t)strlen(cnum); j++) // fill spaces
|
||||||
str += " ";
|
str += " ";
|
||||||
@ -572,22 +572,22 @@ void PMusrCanvas::UpdateParamTheoryPad()
|
|||||||
if ((fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*fabs(param[i].fStep)) &&
|
if ((fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*fabs(param[i].fStep)) &&
|
||||||
(fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*param[i].fPosError)) {
|
(fabs(fabs(param[i].fStep) - param[i].fPosError) < 0.1*param[i].fPosError)) {
|
||||||
if (round(err)-err==0)
|
if (round(err)-err==0)
|
||||||
sprintf(cnum, "%.1lf", err);
|
snprintf(cnum, sizeof(cnum), "%.1lf", err);
|
||||||
else
|
else
|
||||||
sprintf(cnum, accStr, err);
|
snprintf(cnum, sizeof(cnum), accStr, err);
|
||||||
} else {
|
} else {
|
||||||
sprintf(accStr, "%%.%dlf!!", accuracy);
|
snprintf(accStr, sizeof(accStr), "%%.%dlf!!", accuracy);
|
||||||
if (round(err)-err==0)
|
if (round(err)-err==0)
|
||||||
sprintf(cnum, "%.1lf!!", err);
|
snprintf(cnum, sizeof(cnum), "%.1lf!!", err);
|
||||||
else
|
else
|
||||||
sprintf(cnum, accStr, err);
|
snprintf(cnum, sizeof(cnum), accStr, err);
|
||||||
}
|
}
|
||||||
str += cnum;
|
str += cnum;
|
||||||
} else { // minos was not used
|
} else { // minos was not used
|
||||||
if (round(param[i].fStep)-param[i].fStep==0)
|
if (round(param[i].fStep)-param[i].fStep==0)
|
||||||
sprintf(cnum, "%.1lf", param[i].fStep);
|
snprintf(cnum, sizeof(cnum), "%.1lf", param[i].fStep);
|
||||||
else
|
else
|
||||||
sprintf(cnum, accStr, param[i].fStep);
|
snprintf(cnum, sizeof(cnum), accStr, param[i].fStep);
|
||||||
str += cnum;
|
str += cnum;
|
||||||
}
|
}
|
||||||
ypos = 0.98-i*yoffset;
|
ypos = 0.98-i*yoffset;
|
||||||
@ -936,13 +936,13 @@ void PMusrCanvas::UpdateInfoPad()
|
|||||||
tstr += TString("??,");
|
tstr += TString("??,");
|
||||||
} else if (ddvec->size() == 1){
|
} else if (ddvec->size() == 1){
|
||||||
tstr += TString("T=");
|
tstr += TString("T=");
|
||||||
sprintf(sval, "%0.2lf", ddvec->at(0).first);
|
snprintf(sval, sizeof(sval), "%0.2lf", ddvec->at(0).first);
|
||||||
tstr += TString(sval) + TString("K,");
|
tstr += TString(sval) + TString("K,");
|
||||||
} else {
|
} else {
|
||||||
for(UInt_t i(0); i<ddvec->size(); ++i){
|
for(UInt_t i(0); i<ddvec->size(); ++i){
|
||||||
sprintf(sval, "T%u=", i);
|
snprintf(sval, sizeof(sval), "T%u=", i);
|
||||||
tstr += TString(sval);
|
tstr += TString(sval);
|
||||||
sprintf(sval, "%0.2lf", ddvec->at(i).first);
|
snprintf(sval, sizeof(sval), "%0.2lf", ddvec->at(i).first);
|
||||||
tstr += TString(sval) + TString("K,");
|
tstr += TString(sval) + TString("K,");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -953,10 +953,10 @@ void PMusrCanvas::UpdateInfoPad()
|
|||||||
tstr += TString("??,");
|
tstr += TString("??,");
|
||||||
} else {
|
} else {
|
||||||
if (dval < 1.0e4) { // Gauss makes sense as a unit
|
if (dval < 1.0e4) { // Gauss makes sense as a unit
|
||||||
sprintf(sval, "%0.2lf", dval);
|
snprintf(sval, sizeof(sval), "%0.2lf", dval);
|
||||||
tstr += TString(sval) + TString("G,");
|
tstr += TString(sval) + TString("G,");
|
||||||
} else { // Tesla makes sense as a unit
|
} else { // Tesla makes sense as a unit
|
||||||
sprintf(sval, "%0.2lf", dval/1.0e4);
|
snprintf(sval, sizeof(sval), "%0.2lf", dval/1.0e4);
|
||||||
tstr += TString(sval) + TString("T,");
|
tstr += TString(sval) + TString("T,");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -967,10 +967,10 @@ void PMusrCanvas::UpdateInfoPad()
|
|||||||
tstr += TString("??,");
|
tstr += TString("??,");
|
||||||
} else {
|
} else {
|
||||||
if (dval < 1.0e3) { // keV makes sense as a unit
|
if (dval < 1.0e3) { // keV makes sense as a unit
|
||||||
sprintf(sval, "%0.2lf", dval);
|
snprintf(sval, sizeof(sval), "%0.2lf", dval);
|
||||||
tstr += TString(sval) + TString("keV,");
|
tstr += TString(sval) + TString("keV,");
|
||||||
} else { // MeV makes sense as a unit
|
} else { // MeV makes sense as a unit
|
||||||
sprintf(sval, "%0.2lf", dval/1.0e3);
|
snprintf(sval, sizeof(sval), "%0.2lf", dval/1.0e3);
|
||||||
tstr += TString(sval) + TString("MeV,");
|
tstr += TString(sval) + TString("MeV,");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1579,13 +1579,13 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (fStartWithFourier)
|
if (fStartWithFourier)
|
||||||
sprintf(ext, "_%d_F", fPlotNumber);
|
snprintf(ext, sizeof(ext), "_%d_F", fPlotNumber);
|
||||||
else
|
else
|
||||||
sprintf(ext, "_%d", fPlotNumber);
|
snprintf(ext, sizeof(ext), "_%d", fPlotNumber);
|
||||||
str.Replace(idx, size, ext, strlen(ext));
|
str.Replace(idx, size, ext, strlen(ext));
|
||||||
idx += strlen(ext);
|
idx += strlen(ext);
|
||||||
size = strlen(ext);
|
size = strlen(ext);
|
||||||
sprintf(ext, ".%s", graphicsFormat);
|
snprintf(ext, sizeof(ext), ".%s", graphicsFormat);
|
||||||
str.Replace(idx, size, ext, strlen(ext));
|
str.Replace(idx, size, ext, strlen(ext));
|
||||||
|
|
||||||
std::cout << std::endl << ">> SaveGraphicsAndQuit: " << str.Data() << std::endl;
|
std::cout << std::endl << ">> SaveGraphicsAndQuit: " << str.Data() << std::endl;
|
||||||
@ -6539,7 +6539,7 @@ UInt_t PMusrCanvas::GetNeededAccuracy(PMsrParamStructure param)
|
|||||||
if (param.fStep == 0.0) { // check if fit parameter is a constant, i.e. step==0
|
if (param.fStep == 0.0) { // check if fit parameter is a constant, i.e. step==0
|
||||||
char str[128];
|
char str[128];
|
||||||
|
|
||||||
sprintf(str, "%lf", param.fValue);
|
snprintf(str, sizeof(str), "%lf", param.fValue);
|
||||||
|
|
||||||
// find decimal point
|
// find decimal point
|
||||||
for (UInt_t i=0; i<strlen(str); i++) {
|
for (UInt_t i=0; i<strlen(str); i++) {
|
||||||
|
@ -823,9 +823,9 @@ Bool_t PRunDataHandler::ReadWriteFilesList()
|
|||||||
else // bzip2
|
else // bzip2
|
||||||
fln += TString(".tar.bz2");
|
fln += TString(".tar.bz2");
|
||||||
if (fAny2ManyInfo->compressionTag == 1) // gzip
|
if (fAny2ManyInfo->compressionTag == 1) // gzip
|
||||||
sprintf(cmd, "tar -zcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
|
snprintf(cmd, sizeof(cmd), "tar -zcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
|
||||||
else // bzip2
|
else // bzip2
|
||||||
sprintf(cmd, "tar -jcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
|
snprintf(cmd, sizeof(cmd), "tar -jcf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[0].Data());
|
||||||
if (system(cmd) == -1) {
|
if (system(cmd) == -1) {
|
||||||
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
|
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
|
||||||
}
|
}
|
||||||
@ -833,19 +833,19 @@ Bool_t PRunDataHandler::ReadWriteFilesList()
|
|||||||
fln += TString(".tar");
|
fln += TString(".tar");
|
||||||
for (UInt_t i=0; i<fAny2ManyInfo->outPathFileName.size(); i++) {
|
for (UInt_t i=0; i<fAny2ManyInfo->outPathFileName.size(); i++) {
|
||||||
if (i==0) {
|
if (i==0) {
|
||||||
sprintf(cmd, "tar -cf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
|
snprintf(cmd, sizeof(cmd), "tar -cf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
|
||||||
} else {
|
} else {
|
||||||
sprintf(cmd, "tar -rf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
|
snprintf(cmd, sizeof(cmd), "tar -rf %s %s", fln.Data(), fAny2ManyInfo->outPathFileName[i].Data());
|
||||||
}
|
}
|
||||||
if (system(cmd) == -1) {
|
if (system(cmd) == -1) {
|
||||||
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
|
std::cerr << "**ERROR** cmd: " << cmd << " failed." << std::endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (fAny2ManyInfo->compressionTag == 1) { // gzip
|
if (fAny2ManyInfo->compressionTag == 1) { // gzip
|
||||||
sprintf(cmd, "gzip %s", fln.Data());
|
snprintf(cmd, sizeof(cmd), "gzip %s", fln.Data());
|
||||||
fln += ".gz";
|
fln += ".gz";
|
||||||
} else {
|
} else {
|
||||||
sprintf(cmd, "bzip2 -z %s", fln.Data());
|
snprintf(cmd, sizeof(cmd), "bzip2 -z %s", fln.Data());
|
||||||
fln += ".bz2";
|
fln += ".bz2";
|
||||||
}
|
}
|
||||||
if (system(cmd) == -1) {
|
if (system(cmd) == -1) {
|
||||||
@ -1642,7 +1642,7 @@ Bool_t PRunDataHandler::ReadRootFile()
|
|||||||
// get all the data
|
// get all the data
|
||||||
Char_t histoName[32];
|
Char_t histoName[32];
|
||||||
for (Int_t i=0; i<noOfHistos; i++) {
|
for (Int_t i=0; i<noOfHistos; i++) {
|
||||||
sprintf(histoName, "hDecay%02d", i);
|
snprintf(histoName, sizeof(histoName), "hDecay%02d", i);
|
||||||
TH1F *histo = dynamic_cast<TH1F*>(folder->FindObjectAny(histoName));
|
TH1F *histo = dynamic_cast<TH1F*>(folder->FindObjectAny(histoName));
|
||||||
if (!histo) {
|
if (!histo) {
|
||||||
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **ERROR** Couldn't get histo " << histoName;
|
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **ERROR** Couldn't get histo " << histoName;
|
||||||
@ -1671,14 +1671,14 @@ Bool_t PRunDataHandler::ReadRootFile()
|
|||||||
histoData.clear();
|
histoData.clear();
|
||||||
}
|
}
|
||||||
// check if any post pileup histos are present at all (this is not the case for LEM data 2006 and earlier)
|
// check if any post pileup histos are present at all (this is not the case for LEM data 2006 and earlier)
|
||||||
sprintf(histoName, "hDecay%02d", POST_PILEUP_HISTO_OFFSET);
|
snprintf(histoName, sizeof(histoName), "hDecay%02d", POST_PILEUP_HISTO_OFFSET);
|
||||||
if (!folder->FindObjectAny(histoName)) {
|
if (!folder->FindObjectAny(histoName)) {
|
||||||
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **WARNING** Couldn't get histo " << histoName;
|
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **WARNING** Couldn't get histo " << histoName;
|
||||||
std::cerr << std::endl << ">> most probably this is an old (2006 or earlier) LEM file without post pileup histos.";
|
std::cerr << std::endl << ">> most probably this is an old (2006 or earlier) LEM file without post pileup histos.";
|
||||||
std::cerr << std::endl;
|
std::cerr << std::endl;
|
||||||
} else {
|
} else {
|
||||||
for (Int_t i=0; i<noOfHistos; i++) {
|
for (Int_t i=0; i<noOfHistos; i++) {
|
||||||
sprintf(histoName, "hDecay%02d", i+POST_PILEUP_HISTO_OFFSET);
|
snprintf(histoName, sizeof(histoName), "hDecay%02d", i+POST_PILEUP_HISTO_OFFSET);
|
||||||
TH1F *histo = dynamic_cast<TH1F*>(folder->FindObjectAny(histoName));
|
TH1F *histo = dynamic_cast<TH1F*>(folder->FindObjectAny(histoName));
|
||||||
if (!histo) {
|
if (!histo) {
|
||||||
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **ERROR** Couldn't get histo " << histoName;
|
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **ERROR** Couldn't get histo " << histoName;
|
||||||
@ -4676,7 +4676,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
size = dataSet->GetData()->size();
|
size = dataSet->GetData()->size();
|
||||||
sprintf(str, "hDecay%02d", static_cast<Int_t>(i));
|
snprintf(str, sizeof(str), "hDecay%02d", static_cast<Int_t>(i));
|
||||||
histo = new TH1F(str, str, size+1, -0.5, static_cast<Double_t>(size)+0.5);
|
histo = new TH1F(str, str, size+1, -0.5, static_cast<Double_t>(size)+0.5);
|
||||||
for (UInt_t j=0; j<size; j++) {
|
for (UInt_t j=0; j<size; j++) {
|
||||||
histo->SetBinContent(j+1, dataSet->GetData()->at(j));
|
histo->SetBinContent(j+1, dataSet->GetData()->at(j));
|
||||||
@ -4694,7 +4694,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
size = dataSet->GetData()->size();
|
size = dataSet->GetData()->size();
|
||||||
sprintf(str, "hDecay%02d", static_cast<Int_t>(i));
|
snprintf(str, sizeof(str), "hDecay%02d", static_cast<Int_t>(i));
|
||||||
histo = new TH1F(str, str, static_cast<UInt_t>(size/fAny2ManyInfo->rebin)+1, -0.5, static_cast<Double_t>(size)/static_cast<Double_t>(fAny2ManyInfo->rebin)+0.5);
|
histo = new TH1F(str, str, static_cast<UInt_t>(size/fAny2ManyInfo->rebin)+1, -0.5, static_cast<Double_t>(size)/static_cast<Double_t>(fAny2ManyInfo->rebin)+0.5);
|
||||||
dataCount = 0;
|
dataCount = 0;
|
||||||
for (UInt_t j=0; j<size; j++) {
|
for (UInt_t j=0; j<size; j++) {
|
||||||
@ -5558,9 +5558,9 @@ Bool_t PRunDataHandler::WriteMudFile(TString fln)
|
|||||||
MUD_setOrient(fd, (char *)fData[0].GetOrientation()->Data());
|
MUD_setOrient(fd, (char *)fData[0].GetOrientation()->Data());
|
||||||
MUD_setDas(fd, dummy);
|
MUD_setDas(fd, dummy);
|
||||||
MUD_setExperimenter(fd, dummy);
|
MUD_setExperimenter(fd, dummy);
|
||||||
sprintf(info, "%lf+-%lf (K)", fData[0].GetTemperature(0), fData[0].GetTempError(0));
|
snprintf(info, sizeof(info), "%lf+-%lf (K)", fData[0].GetTemperature(0), fData[0].GetTempError(0));
|
||||||
MUD_setTemperature(fd, info);
|
MUD_setTemperature(fd, info);
|
||||||
sprintf(info, "%lf", fData[0].GetField());
|
snprintf(info, sizeof(info), "%lf", fData[0].GetField());
|
||||||
MUD_setField(fd, info);
|
MUD_setField(fd, info);
|
||||||
|
|
||||||
// generate the histograms
|
// generate the histograms
|
||||||
@ -6219,7 +6219,7 @@ TString PRunDataHandler::FileNameFromTemplate(TString &fileNameTemplate, Int_t r
|
|||||||
if (idx == str.Length()) { // 'r' only
|
if (idx == str.Length()) { // 'r' only
|
||||||
TString runStr("");
|
TString runStr("");
|
||||||
char fmt[128];
|
char fmt[128];
|
||||||
sprintf(fmt , "%%0%dd", str.Length());
|
snprintf(fmt, sizeof(fmt), "%%0%dd", str.Length());
|
||||||
runStr.Form(fmt, run);
|
runStr.Form(fmt, run);
|
||||||
result += runStr;
|
result += runStr;
|
||||||
} else { // not only 'r'
|
} else { // not only 'r'
|
||||||
|
@ -114,7 +114,7 @@ PStartupHandler::PStartupHandler()
|
|||||||
// check if the startup file is found under $HOME/.musrfit
|
// check if the startup file is found under $HOME/.musrfit
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
if (home != nullptr) {
|
if (home != nullptr) {
|
||||||
sprintf(startup_path_name, "%s/.musrfit/musrfit_startup.xml", home);
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
|
||||||
if (StartupFileExists(startup_path_name)) {
|
if (StartupFileExists(startup_path_name)) {
|
||||||
fStartupFilePath = TString(startup_path_name);
|
fStartupFilePath = TString(startup_path_name);
|
||||||
fStartupFileFound = true;
|
fStartupFileFound = true;
|
||||||
@ -125,7 +125,7 @@ PStartupHandler::PStartupHandler()
|
|||||||
// check if the MUSRFITPATH system variable is set
|
// check if the MUSRFITPATH system variable is set
|
||||||
pmusrpath = getenv("MUSRFITPATH");
|
pmusrpath = getenv("MUSRFITPATH");
|
||||||
if (pmusrpath != nullptr) {
|
if (pmusrpath != nullptr) {
|
||||||
sprintf(startup_path_name, "%s/musrfit_startup.xml", pmusrpath);
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/musrfit_startup.xml", pmusrpath);
|
||||||
if (StartupFileExists(startup_path_name)) {
|
if (StartupFileExists(startup_path_name)) {
|
||||||
fStartupFilePath = TString(startup_path_name);
|
fStartupFilePath = TString(startup_path_name);
|
||||||
fStartupFileFound = true;
|
fStartupFileFound = true;
|
||||||
@ -135,9 +135,9 @@ PStartupHandler::PStartupHandler()
|
|||||||
if (!fStartupFileFound) { // MUSRFITPATH not set or empty, will try $ROOTSYS/bin
|
if (!fStartupFileFound) { // MUSRFITPATH not set or empty, will try $ROOTSYS/bin
|
||||||
home = getenv("ROOTSYS");
|
home = getenv("ROOTSYS");
|
||||||
if (home != nullptr) {
|
if (home != nullptr) {
|
||||||
sprintf(musrpath, "%s/bin", home);
|
snprintf(musrpath, sizeof(musrpath), "%s/bin", home);
|
||||||
std::cerr << std::endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << std::endl;
|
std::cerr << std::endl << "**WARNING** MUSRFITPATH environment variable not set will try " << musrpath << std::endl;
|
||||||
sprintf(startup_path_name, "%s/musrfit_startup.xml", musrpath);
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/musrfit_startup.xml", musrpath);
|
||||||
if (StartupFileExists(startup_path_name)) {
|
if (StartupFileExists(startup_path_name)) {
|
||||||
fStartupFilePath = TString(startup_path_name);
|
fStartupFilePath = TString(startup_path_name);
|
||||||
fStartupFileFound = true;
|
fStartupFileFound = true;
|
||||||
@ -153,7 +153,7 @@ PStartupHandler::PStartupHandler()
|
|||||||
} else {
|
} else {
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
if (home != nullptr) {
|
if (home != nullptr) {
|
||||||
sprintf(startup_path_name, "%s/.musrfit/musrfit_startup.xml", home);
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
|
||||||
if (StartupFileExists(startup_path_name)) {
|
if (StartupFileExists(startup_path_name)) {
|
||||||
fStartupFilePath = TString(startup_path_name);
|
fStartupFilePath = TString(startup_path_name);
|
||||||
fStartupFileFound = true;
|
fStartupFileFound = true;
|
||||||
@ -620,7 +620,7 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
|
|||||||
// first check that $HOME/.musrfit exists and if NOT create it
|
// first check that $HOME/.musrfit exists and if NOT create it
|
||||||
struct stat info;
|
struct stat info;
|
||||||
|
|
||||||
sprintf(startup_path_name, "%s/.musrfit", home);
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit", home);
|
||||||
if (!stat(startup_path_name, &info)) {
|
if (!stat(startup_path_name, &info)) {
|
||||||
if (!(info.st_mode & S_IFDIR))
|
if (!(info.st_mode & S_IFDIR))
|
||||||
return false;
|
return false;
|
||||||
@ -632,7 +632,7 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// set path-name for musrfit_startup.xml
|
// set path-name for musrfit_startup.xml
|
||||||
sprintf(startup_path_name, "%s/.musrfit/musrfit_startup.xml", home);
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
|
||||||
|
|
||||||
std::ofstream fout(startup_path_name, std::ofstream::out);
|
std::ofstream fout(startup_path_name, std::ofstream::out);
|
||||||
if (!fout.is_open()) {
|
if (!fout.is_open()) {
|
||||||
|
@ -841,12 +841,12 @@ void PTheory::MakeCleanAndTidyTheoryBlock(PMsrLines *fullTheoryBlock)
|
|||||||
if (static_cast<UInt_t>(tokens->GetEntries()) < fgTheoDataBase[idx].fNoOfParam + 1)
|
if (static_cast<UInt_t>(tokens->GetEntries()) < fgTheoDataBase[idx].fNoOfParam + 1)
|
||||||
return;
|
return;
|
||||||
// make tidy string
|
// make tidy string
|
||||||
sprintf(substr, "%-10s", fgTheoDataBase[idx].fName.Data());
|
snprintf(substr, sizeof(substr), "%-10s", fgTheoDataBase[idx].fName.Data());
|
||||||
tidy = TString(substr);
|
tidy = TString(substr);
|
||||||
for (Int_t j=1; j<tokens->GetEntries(); j++) {
|
for (Int_t j=1; j<tokens->GetEntries(); j++) {
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(j));
|
ostr = dynamic_cast<TObjString*>(tokens->At(j));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
sprintf(substr, "%6s", str.Data());
|
snprintf(substr, sizeof(substr), "%6s", str.Data());
|
||||||
tidy += TString(substr);
|
tidy += TString(substr);
|
||||||
}
|
}
|
||||||
if (fgTheoDataBase[idx].fComment.Length() != 0) {
|
if (fgTheoDataBase[idx].fComment.Length() != 0) {
|
||||||
@ -913,7 +913,7 @@ void PTheory::MakeCleanAndTidyPolynom(UInt_t i, PMsrLines *fullTheoryBlock)
|
|||||||
for (Int_t j=1; j<max; j++) {
|
for (Int_t j=1; j<max; j++) {
|
||||||
ostr = dynamic_cast<TObjString*>(tokens->At(j));
|
ostr = dynamic_cast<TObjString*>(tokens->At(j));
|
||||||
str = ostr->GetString();
|
str = ostr->GetString();
|
||||||
sprintf(substr, "%6s", str.Data());
|
snprintf(substr, sizeof(substr), "%6s", str.Data());
|
||||||
tidy += TString(substr);
|
tidy += TString(substr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
* Copyright (C) 2007-2021 by Andreas Suter *
|
* Copyright (C) 2007-2022 by Andreas Suter *
|
||||||
* andreas.suter@psi.ch *
|
* andreas.suter@psi.ch *
|
||||||
* *
|
* *
|
||||||
* This program is free software; you can redistribute it and/or modify *
|
* This program is free software; you can redistribute it and/or modify *
|
||||||
@ -57,6 +57,7 @@
|
|||||||
#include "git-revision.h"
|
#include "git-revision.h"
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#include "PFindRun.h"
|
||||||
#include "PStartupHandler.h"
|
#include "PStartupHandler.h"
|
||||||
#include "TMusrRunHeader.h"
|
#include "TMusrRunHeader.h"
|
||||||
#include "TLemRunHeader.h"
|
#include "TLemRunHeader.h"
|
||||||
@ -72,7 +73,7 @@
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
*
|
* <p>dump help to stdout.
|
||||||
*/
|
*/
|
||||||
void dump_header_syntax()
|
void dump_header_syntax()
|
||||||
{
|
{
|
||||||
@ -94,9 +95,8 @@ void dump_header_syntax()
|
|||||||
std::cout << std::endl << " year is used. If a file name is given, this option has no effect.";
|
std::cout << std::endl << " year is used. If a file name is given, this option has no effect.";
|
||||||
std::cout << std::endl << " -s, --summary : this option is used for LE-uSR data sets only. It will, additionally";
|
std::cout << std::endl << " -s, --summary : this option is used for LE-uSR data sets only. It will, additionally";
|
||||||
std::cout << std::endl << " to the header information, print the summary file content.";
|
std::cout << std::endl << " to the header information, print the summary file content.";
|
||||||
std::cout << std::endl << " --psi-bulk <opt> : where <opt> consists of two items: (i) pta or tdc, ";
|
std::cout << std::endl << " -i, --instrument <inst> : where <inst> is the requested instrument:";
|
||||||
std::cout << std::endl << " (ii) gps | ltf | dolly | gpd | hifi. This is needed in combination with";
|
std::cout << std::endl << " lem (default) | gps | ltf | dolly | gpd | hifi.";
|
||||||
std::cout << std::endl << " the file formats PSI-BIN and PSI-MDU.";
|
|
||||||
std::cout << std::endl << " -h, --help : will show this help";
|
std::cout << std::endl << " -h, --help : will show this help";
|
||||||
std::cout << std::endl << " -v, --version : will show the current version.";
|
std::cout << std::endl << " -v, --version : will show the current version.";
|
||||||
std::cout << std::endl << std::endl;
|
std::cout << std::endl << std::endl;
|
||||||
@ -104,13 +104,21 @@ void dump_header_syntax()
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
* <p>dumps header of a ROOT file.
|
||||||
*
|
*
|
||||||
|
* @param fileName file name of the ROOT file
|
||||||
|
* @param summary bool, if true dump the summary
|
||||||
|
*
|
||||||
|
* @return 0 on success, otherwise 1.
|
||||||
*/
|
*/
|
||||||
int dump_header_root(const std::string fileName, const std::string fileFormat, const bool summary)
|
int dump_header_root(const std::string fileName, const bool summary)
|
||||||
{
|
{
|
||||||
TFile f(fileName.c_str());
|
TFile f(fileName.c_str());
|
||||||
if (f.IsZombie()) {
|
if (f.IsZombie()) {
|
||||||
return false;
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "**ERROR** couldn't invoke ROOT/MusrRoot file object." << std::endl;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
UInt_t fileType = DH_MUSR_ROOT;
|
UInt_t fileType = DH_MUSR_ROOT;
|
||||||
@ -142,7 +150,7 @@ int dump_header_root(const std::string fileName, const std::string fileFormat, c
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::cout << std::endl << "-------------------";
|
std::cout << std::endl << "-------------------";
|
||||||
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = " << fileFormat;
|
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = ROOT (PSI LEM).";
|
||||||
std::cout << std::endl << "-------------------";
|
std::cout << std::endl << "-------------------";
|
||||||
std::cout << std::endl << "Run Title : " << runHeader->GetRunTitle().GetString().Data();
|
std::cout << std::endl << "Run Title : " << runHeader->GetRunTitle().GetString().Data();
|
||||||
std::cout << std::endl << "Run Number : " << runHeader->GetRunNumber();
|
std::cout << std::endl << "Run Number : " << runHeader->GetRunNumber();
|
||||||
@ -231,15 +239,31 @@ int dump_header_root(const std::string fileName, const std::string fileFormat, c
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
* <p>dumps the header information of a NeXus file.
|
||||||
*
|
*
|
||||||
|
* @param fileName file name of the NeXus file.
|
||||||
|
*
|
||||||
|
* @return 0 on success, 1 otherwise
|
||||||
*/
|
*/
|
||||||
int dump_header_nexus(const std::string fileName) {
|
int dump_header_nexus(const std::string fileName) {
|
||||||
|
|
||||||
#ifdef PNEXUS_ENABLED
|
#ifdef PNEXUS_ENABLED
|
||||||
PNeXus *nxs_file = new PNeXus(fileName.c_str());
|
PNeXus *nxs_file = new PNeXus(fileName.c_str());
|
||||||
|
|
||||||
|
if (nxs_file == nullptr) {
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "**ERROR** couldn't invoke NeXus file object." << std::endl;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
if (nxs_file->IsValid(false)) {
|
if (nxs_file->IsValid(false)) {
|
||||||
nxs_file->Dump();
|
nxs_file->Dump();
|
||||||
|
} else {
|
||||||
|
std::cerr << std::endl;
|
||||||
|
std::cerr << "**ERROR** found invalid NeXus file." << std::endl;
|
||||||
|
std::cerr << std::endl;
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nxs_file)
|
if (nxs_file)
|
||||||
@ -253,7 +277,11 @@ int dump_header_nexus(const std::string fileName) {
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
* <p>dump the instrument specific info for the PSI-BIN format.
|
||||||
*
|
*
|
||||||
|
* @param fileName file name of the PSI-BIN.
|
||||||
|
*
|
||||||
|
* @return string vector with the instrument specific info.
|
||||||
*/
|
*/
|
||||||
std::vector<std::string> dump_header_instrument_info(std::string fileName)
|
std::vector<std::string> dump_header_instrument_info(std::string fileName)
|
||||||
{
|
{
|
||||||
@ -312,7 +340,12 @@ std::vector<std::string> dump_header_instrument_info(std::string fileName)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
* <p>dump the header information of a PSI-BIN file.
|
||||||
*
|
*
|
||||||
|
* @param fileName file name of the PSI-BIN
|
||||||
|
* @param fileFormat either PSI-BIN or PSI-MDU
|
||||||
|
*
|
||||||
|
* @return 0 on success, 1 otherwise
|
||||||
*/
|
*/
|
||||||
int dump_header_psi_bin(const std::string fileName, const std::string fileFormat)
|
int dump_header_psi_bin(const std::string fileName, const std::string fileFormat)
|
||||||
{
|
{
|
||||||
@ -415,9 +448,12 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
* <p>dump the header information of a MUD file.
|
||||||
|
* @param fileName file name of the MUD file
|
||||||
*
|
*
|
||||||
|
* @return 0 on success, 1 otherwise
|
||||||
*/
|
*/
|
||||||
int dump_header_mud(const std::string fileName, const std::string fileFormat)
|
int dump_header_mud(const std::string fileName)
|
||||||
{
|
{
|
||||||
int fh;
|
int fh;
|
||||||
UINT32 type, val;
|
UINT32 type, val;
|
||||||
@ -433,7 +469,7 @@ int dump_header_mud(const std::string fileName, const std::string fileFormat)
|
|||||||
}
|
}
|
||||||
|
|
||||||
std::cout << std::endl << "-------------------";
|
std::cout << std::endl << "-------------------";
|
||||||
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = " << fileFormat;
|
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = MUD";
|
||||||
std::cout << std::endl << "-------------------";
|
std::cout << std::endl << "-------------------";
|
||||||
// run title
|
// run title
|
||||||
success = MUD_getTitle( fh, str, sizeof(str) );
|
success = MUD_getTitle( fh, str, sizeof(str) );
|
||||||
@ -593,9 +629,12 @@ int dump_header_mud(const std::string fileName, const std::string fileFormat)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
* <p>dump the header information of a WKM file.
|
||||||
|
* @param fileName file name of the WKM file.
|
||||||
*
|
*
|
||||||
|
* @return 0 on success, 1 otherwise
|
||||||
*/
|
*/
|
||||||
int dump_header_wkm(const std::string fileName, const std::string fileFormat)
|
int dump_header_wkm(const std::string fileName)
|
||||||
{
|
{
|
||||||
std::ifstream fin(fileName.c_str(), std::ifstream::in);
|
std::ifstream fin(fileName.c_str(), std::ifstream::in);
|
||||||
if (!fin.is_open()) {
|
if (!fin.is_open()) {
|
||||||
@ -603,7 +642,7 @@ int dump_header_wkm(const std::string fileName, const std::string fileFormat)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
std::cout << std::endl << "-------------------";
|
std::cout << std::endl << "-------------------";
|
||||||
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = " << fileFormat;
|
std::cout << std::endl << "fileName = " << fileName << ", fileFormat = WKM";
|
||||||
std::cout << std::endl << "-------------------";
|
std::cout << std::endl << "-------------------";
|
||||||
char header[256];
|
char header[256];
|
||||||
while (fin.good()) {
|
while (fin.good()) {
|
||||||
@ -620,9 +659,11 @@ int dump_header_wkm(const std::string fileName, const std::string fileFormat)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief is_number
|
* <p>checks if a string is a number
|
||||||
* @param s
|
*
|
||||||
* @return
|
* @param s number string to be checked
|
||||||
|
*
|
||||||
|
* @return true if 's' is a number, false otherwise
|
||||||
*/
|
*/
|
||||||
bool dump_is_number(const char *s)
|
bool dump_is_number(const char *s)
|
||||||
{
|
{
|
||||||
@ -642,8 +683,9 @@ bool dump_is_number(const char *s)
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief dump_current_year
|
* <p>reads the current year from the system and converts it to a string.
|
||||||
* @return
|
*
|
||||||
|
* @return the current year as a string.
|
||||||
*/
|
*/
|
||||||
int dump_current_year()
|
int dump_current_year()
|
||||||
{
|
{
|
||||||
@ -660,109 +702,13 @@ int dump_current_year()
|
|||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* @brief dump_create_fln
|
* <p>dump_header allows to dump the header (meta) information for various
|
||||||
* @param runNo
|
* muSR specific file formats.
|
||||||
* @param year
|
*
|
||||||
* @param fileFormat
|
* @param argc argument count
|
||||||
* @return
|
* @param argv argument list
|
||||||
*/
|
*
|
||||||
std::string dump_create_fln(std::string runNo, std::string year, std::string fileFormat, bool pta, std::string instrument)
|
* @return 0 on success, 1 otherwise
|
||||||
{
|
|
||||||
std::string result = "??";
|
|
||||||
int yearShort=0;
|
|
||||||
int iRunNo=0;
|
|
||||||
|
|
||||||
if (fileFormat.empty())
|
|
||||||
fileFormat = "MusrRoot";
|
|
||||||
|
|
||||||
// make sure that a 'legal' file format has been found
|
|
||||||
if (!boost::iequals(fileFormat, "MusrRoot") &&
|
|
||||||
!boost::iequals(fileFormat, "NeXus") &&
|
|
||||||
!boost::iequals(fileFormat, "ROOT") &&
|
|
||||||
!boost::iequals(fileFormat, "PSI-BIN") &&
|
|
||||||
!boost::iequals(fileFormat, "PSI-MDU") &&
|
|
||||||
!boost::iequals(fileFormat, "MDU") &&
|
|
||||||
!boost::iequals(fileFormat, "WKM")) {
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
// if year is an empty string get the current year
|
|
||||||
int yy=-1;
|
|
||||||
std::stringstream ss;
|
|
||||||
if (year.empty()) {
|
|
||||||
yy = dump_current_year();
|
|
||||||
ss << yy;
|
|
||||||
year = ss.str();
|
|
||||||
}
|
|
||||||
yy = atoi(year.c_str());
|
|
||||||
if (yy > 2000)
|
|
||||||
yearShort = yy - 2000;
|
|
||||||
else
|
|
||||||
yearShort = yy - 1900;
|
|
||||||
|
|
||||||
iRunNo = atoi(runNo.c_str());
|
|
||||||
|
|
||||||
char fln[64];
|
|
||||||
char ptatdc[8];
|
|
||||||
memset(ptatdc, '\0', sizeof(ptatdc));
|
|
||||||
if (pta)
|
|
||||||
strcpy(ptatdc, "pta");
|
|
||||||
else
|
|
||||||
strcpy(ptatdc, "tdc");
|
|
||||||
if (boost::iequals(fileFormat, "MusrRoot") || boost::iequals(fileFormat, "ROOT")) {
|
|
||||||
if (instrument == "") // i.e. LEM
|
|
||||||
snprintf(fln, sizeof(fln), "lem%02d_his_%04d.root", yearShort, iRunNo);
|
|
||||||
else
|
|
||||||
snprintf(fln, sizeof(fln), "deltat_%s_%s_%s_%04d.root", ptatdc, instrument.c_str(), year.c_str(), iRunNo);
|
|
||||||
} else if (boost::iequals(fileFormat, "NeXus")) {
|
|
||||||
snprintf(fln, sizeof(fln), "%s.nxs", runNo.c_str());
|
|
||||||
} else if (boost::iequals(fileFormat, "PSI-BIN")) {
|
|
||||||
snprintf(fln, sizeof(fln), "deltat_%s_%s_%04d.bin", ptatdc, instrument.c_str(), iRunNo);
|
|
||||||
} else if (boost::iequals(fileFormat, "PSI-MDU")) {
|
|
||||||
snprintf(fln, sizeof(fln), "%s_%s_%s_%05d.mdu", ptatdc, instrument.c_str(), year.c_str(), iRunNo);
|
|
||||||
} else if (boost::iequals(fileFormat, "MUD")) {
|
|
||||||
snprintf(fln, sizeof(fln), "%06d.msr", iRunNo);
|
|
||||||
} else if (boost::iequals(fileFormat, "WKM")) {
|
|
||||||
|
|
||||||
}
|
|
||||||
result = fln;
|
|
||||||
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief dump_file_exists
|
|
||||||
* @param pathName
|
|
||||||
* @return
|
|
||||||
*/
|
|
||||||
bool dump_file_exists(const std::string pathName)
|
|
||||||
{
|
|
||||||
bool exists = true;
|
|
||||||
|
|
||||||
int res = access(pathName.c_str(), R_OK);
|
|
||||||
if (res < 0) {
|
|
||||||
if (errno == ENOENT) {
|
|
||||||
// file does not exist
|
|
||||||
exists = false;
|
|
||||||
} else if (errno == EACCES) {
|
|
||||||
// file exists but is not readable
|
|
||||||
exists = false;
|
|
||||||
} else {
|
|
||||||
// FAIL
|
|
||||||
exists = false;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return exists;
|
|
||||||
}
|
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
|
||||||
/**
|
|
||||||
* @brief main
|
|
||||||
* @param argc
|
|
||||||
* @param argv
|
|
||||||
* @return
|
|
||||||
*/
|
*/
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
@ -775,8 +721,7 @@ int main(int argc, char *argv[])
|
|||||||
std::string fileName("");
|
std::string fileName("");
|
||||||
std::string fileFormat("");
|
std::string fileFormat("");
|
||||||
std::string year("");
|
std::string year("");
|
||||||
bool pta(false);
|
std::string instrument("lem");
|
||||||
std::string instrument("");
|
|
||||||
bool summary(false);
|
bool summary(false);
|
||||||
|
|
||||||
for (int i=1; i<argc; i++) {
|
for (int i=1; i<argc; i++) {
|
||||||
@ -867,29 +812,20 @@ int main(int argc, char *argv[])
|
|||||||
i++;
|
i++;
|
||||||
} else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--summary")) {
|
} else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--summary")) {
|
||||||
summary = true;
|
summary = true;
|
||||||
} else if (!strcmp(argv[i], "--psi-bulk")) {
|
} else if (!strcmp(argv[i], "-i") || !strcmp(argv[i], "--instrument")) {
|
||||||
if (i+2 >= argc) {
|
if (i+1 >= argc) {
|
||||||
std::cerr << std::endl << "**ERROR** found --psi-bulk with insufficient input!" << std::endl;
|
std::cerr << std::endl << "**ERROR** found option --instrument without <instrument> input!" << std::endl;
|
||||||
dump_header_syntax();
|
dump_header_syntax();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (!strcmp(argv[i+1], "pta"))
|
if (strcmp(argv[i+1], "lem") && strcmp(argv[i+1], "gps") && strcmp(argv[i+1], "ltf") &&
|
||||||
pta = true;
|
strcmp(argv[i+1], "dolly") && strcmp(argv[i+1], "gpd") && strcmp(argv[i+1], "hifi")) {
|
||||||
else if (!strcmp(argv[i+1], "tdc"))
|
std::cerr << std::endl << "**ERROR** found --instrument with unkown instrument name: '" << argv[i+1] << "'!" << std::endl;
|
||||||
pta = false;
|
|
||||||
else {
|
|
||||||
std::cerr << std::endl << "**ERROR** found --psi-bulk with 1st argument '" << argv[i+1] << "'! Allowed is 'pta' or 'tdc'." << std::endl;
|
|
||||||
dump_header_syntax();
|
dump_header_syntax();
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if (strcmp(argv[i+2], "gps") && strcmp(argv[i+2], "ltf") && strcmp(argv[i+2], "dolly") &&
|
instrument = argv[i+1];
|
||||||
strcmp(argv[i+2], "gpd") && strcmp(argv[i+2], "hifi")) {
|
i++;
|
||||||
std::cerr << std::endl << "**ERROR** found --psi-bulk with 2nd argument '" << argv[i+2] << "'! This is an unkown instrument." << std::endl;
|
|
||||||
dump_header_syntax();
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
instrument = argv[i+2];
|
|
||||||
i += 2;
|
|
||||||
} else {
|
} else {
|
||||||
std::cerr << std::endl << "**ERROR** found unkown option '" << argv[i] << "'." << std::endl;
|
std::cerr << std::endl << "**ERROR** found unkown option '" << argv[i] << "'." << std::endl;
|
||||||
dump_header_syntax();
|
dump_header_syntax();
|
||||||
@ -949,70 +885,25 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// runNo given, hence try to create the necessary file name based on the provided information
|
// try to find path-file-name via run name templates
|
||||||
if (runNo != "") {
|
|
||||||
std::string str = dump_create_fln(runNo, year, fileFormat, pta, instrument);
|
|
||||||
if (str == "??") {
|
|
||||||
std::cerr << std::endl << "**ERROR** couldn't get a proper file name." << std::endl;
|
|
||||||
return 1;
|
|
||||||
}
|
|
||||||
fileName = str;
|
|
||||||
}
|
|
||||||
|
|
||||||
bool found_fln = false;
|
|
||||||
std::string pathFln("");
|
std::string pathFln("");
|
||||||
// 1st check if the file name is the full path-file name and the file exists
|
if (fileName == "") { // only look for runs if the file name is not explicitly given
|
||||||
pathFln = fileName;
|
int yy = static_cast<int>(strtod(year.c_str(), static_cast<char**>(nullptr)));
|
||||||
if (dump_file_exists(pathFln))
|
int run = static_cast<int>(strtod(runNo.c_str(), static_cast<char**>(nullptr)));
|
||||||
found_fln = true;
|
PFindRun findRun(startupHandler->GetDataPathList(), startupHandler->GetRunNameTemplateList(), instrument, yy, run);
|
||||||
|
if (findRun.FoundPathName()) {
|
||||||
// 2nd check if the file name is found in the current directory
|
pathFln = findRun.GetPathName().Data();
|
||||||
if (!found_fln) {
|
} else {
|
||||||
pathFln = "./" + fileName;
|
std::cout << "debug> Couldn't find run: " << run << " for instrument " << instrument << ", and year: " << year << std::endl;
|
||||||
if (dump_file_exists(pathFln))
|
return 1;
|
||||||
found_fln = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
// 3rd check if file name is found in any default search paths if not already found in the current directory
|
|
||||||
if (!found_fln) {
|
|
||||||
PStringVector pathList = startupHandler->GetDataPathList();
|
|
||||||
for (unsigned int i=0; i<pathList.size(); i++) {
|
|
||||||
if (boost::iequals(fileFormat, "MusrRoot") || boost::iequals(fileFormat, "ROOT") ||
|
|
||||||
boost::iequals(fileFormat, "WKM")) {
|
|
||||||
if (instrument == "") // i.e. LEM
|
|
||||||
pathFln = pathList[i] + "/" + year + "/" + fileName;
|
|
||||||
else
|
|
||||||
pathFln = pathList[i] + "/d" + year + "/tdc/root/" + fileName;
|
|
||||||
} else {
|
|
||||||
if (pta)
|
|
||||||
pathFln = pathList[i] + "/d" + year + "/pta/" + fileName;
|
|
||||||
else
|
|
||||||
pathFln = pathList[i] + "/d" + year + "/tdc/" + fileName;
|
|
||||||
}
|
|
||||||
if (dump_file_exists(pathFln)) {
|
|
||||||
found_fln = true;
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
} else { // file name explicitly provided, hence use this as pathFln
|
||||||
|
pathFln = fileName;
|
||||||
if (!found_fln) {
|
|
||||||
std::cerr << "**ERROR** couldn't find any appropriate file." << std::endl;
|
|
||||||
// cleanup
|
|
||||||
if (saxParser) {
|
|
||||||
delete saxParser;
|
|
||||||
saxParser = 0;
|
|
||||||
}
|
|
||||||
if (startupHandler) {
|
|
||||||
delete startupHandler;
|
|
||||||
startupHandler = nullptr;
|
|
||||||
}
|
|
||||||
return 1;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// if file format is not given explicitly try to guess it based on the file name extension
|
// if file format is not given explicitly try to guess it based on the file name extension
|
||||||
if ((fileFormat == "") && (fileName != "")) {
|
if (fileFormat == "") {
|
||||||
std::string fln(fileName);
|
std::string fln(pathFln);
|
||||||
boost::to_lower(fln);
|
boost::to_lower(fln);
|
||||||
if (fln.find(".root") != std::string::npos)
|
if (fln.find(".root") != std::string::npos)
|
||||||
fileFormat = "MusrRoot"; // could be old ROOT (LEM) as well
|
fileFormat = "MusrRoot"; // could be old ROOT (LEM) as well
|
||||||
@ -1038,7 +929,7 @@ int main(int argc, char *argv[])
|
|||||||
boost::to_lower(fileFormat);
|
boost::to_lower(fileFormat);
|
||||||
|
|
||||||
if (boost::iequals(fileFormat, "MusrRoot") || boost::iequals(fileFormat, "ROOT")) {
|
if (boost::iequals(fileFormat, "MusrRoot") || boost::iequals(fileFormat, "ROOT")) {
|
||||||
dump_header_root(pathFln, fileFormat, summary);
|
dump_header_root(pathFln, summary);
|
||||||
} else if (boost::iequals(fileFormat, "NeXus")) {
|
} else if (boost::iequals(fileFormat, "NeXus")) {
|
||||||
#ifdef PNEXUS_ENABLED
|
#ifdef PNEXUS_ENABLED
|
||||||
dump_header_nexus(pathFln);
|
dump_header_nexus(pathFln);
|
||||||
@ -1048,9 +939,9 @@ int main(int argc, char *argv[])
|
|||||||
} else if (boost::iequals(fileFormat, "PSI-BIN") || boost::iequals(fileFormat, "PSI-MDU")) {
|
} else if (boost::iequals(fileFormat, "PSI-BIN") || boost::iequals(fileFormat, "PSI-MDU")) {
|
||||||
dump_header_psi_bin(pathFln, fileFormat);
|
dump_header_psi_bin(pathFln, fileFormat);
|
||||||
} else if (boost::iequals(fileFormat, "MUD")) {
|
} else if (boost::iequals(fileFormat, "MUD")) {
|
||||||
dump_header_mud(pathFln, fileFormat);
|
dump_header_mud(pathFln);
|
||||||
} else if (boost::iequals(fileFormat, "WKM")) {
|
} else if (boost::iequals(fileFormat, "WKM")) {
|
||||||
dump_header_wkm(pathFln, fileFormat);
|
dump_header_wkm(pathFln);
|
||||||
}
|
}
|
||||||
|
|
||||||
// cleanup
|
// cleanup
|
||||||
|
2
src/external/BMWtools/BMWStartupHandler.cpp
vendored
2
src/external/BMWtools/BMWStartupHandler.cpp
vendored
@ -403,7 +403,7 @@ void BMWStartupHandler::CheckLists()
|
|||||||
<< "BMWStartupHandler::CheckLists: Most probably this will go wrong and should therefore be fixed in the xml-file!" << std::endl;
|
<< "BMWStartupHandler::CheckLists: Most probably this will go wrong and should therefore be fixed in the xml-file!" << std::endl;
|
||||||
char eChar[5];
|
char eChar[5];
|
||||||
for(unsigned int i(0); i<fEnergyList.size(); i++) {
|
for(unsigned int i(0); i<fEnergyList.size(); i++) {
|
||||||
sprintf(eChar, "%02.1f", fEnergyList[i]);
|
snprintf(eChar, sizeof(eChar), "%02.1f", fEnergyList[i]);
|
||||||
fEnergyLabelList.push_back(std::string(eChar));
|
fEnergyLabelList.push_back(std::string(eChar));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
1
src/external/BMWtools/CMakeLists.txt
vendored
1
src/external/BMWtools/CMakeLists.txt
vendored
@ -47,7 +47,6 @@ set_target_properties(BMWtools
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
BMWtools BEFORE PRIVATE
|
BMWtools BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${CUBA_INC}>
|
$<BUILD_INTERFACE:${CUBA_INC}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
|
4
src/external/DummyUserFcn/src/CMakeLists.txt
vendored
4
src/external/DummyUserFcn/src/CMakeLists.txt
vendored
@ -12,7 +12,6 @@ root_generate_dictionary(
|
|||||||
PDummyUserFcnDict
|
PDummyUserFcnDict
|
||||||
PDummyUserFcn.h
|
PDummyUserFcn.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${DUMMY_USER_FUNC_INC}
|
-I${DUMMY_USER_FUNC_INC}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
@ -44,13 +43,12 @@ set_target_properties(PDummyUserFcn
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
PDummyUserFcn BEFORE PRIVATE
|
PDummyUserFcn BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
|
||||||
)
|
)
|
||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
target_link_libraries(PDummyUserFcn ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} PUserFcnBase)
|
target_link_libraries(PDummyUserFcn ${ROOT_LIBRARIES} PUserFcnBase)
|
||||||
|
|
||||||
#--- install PDummyUserFcn solib -------------------------------------------------
|
#--- install PDummyUserFcn solib -------------------------------------------------
|
||||||
install(TARGETS PDummyUserFcn DESTINATION lib)
|
install(TARGETS PDummyUserFcn DESTINATION lib)
|
||||||
|
6
src/external/MagProximity/CMakeLists.txt
vendored
6
src/external/MagProximity/CMakeLists.txt
vendored
@ -7,7 +7,7 @@ root_generate_dictionary(
|
|||||||
PMagProximityFitterDict
|
PMagProximityFitterDict
|
||||||
PMagProximityFitter.h
|
PMagProximityFitter.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${CMAKE_CURRENT_SOURCE_DIR}
|
-I${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
@ -44,7 +44,7 @@ add_library(PMagProximityFitter SHARED
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
PMagProximityFitter BEFORE PRIVATE
|
PMagProximityFitter BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
)
|
)
|
||||||
@ -56,7 +56,7 @@ set_target_properties(PMagProximityFitter
|
|||||||
)
|
)
|
||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
target_link_libraries(PMagProximityFitter ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} PRgeHandler PUserFcnBase)
|
target_link_libraries(PMagProximityFitter FFTW3::FFTW3 ${ROOT_LIBRARIES} PRgeHandler PUserFcnBase)
|
||||||
|
|
||||||
#--- install PMagProximityFitter solib ----------------------------------------
|
#--- install PMagProximityFitter solib ----------------------------------------
|
||||||
install(TARGETS PMagProximityFitter DESTINATION lib)
|
install(TARGETS PMagProximityFitter DESTINATION lib)
|
||||||
|
4
src/external/MagProximity/PMagProximity.h
vendored
4
src/external/MagProximity/PMagProximity.h
vendored
@ -50,11 +50,11 @@ typedef std::vector<Double_t> PDoubleVector;
|
|||||||
/**
|
/**
|
||||||
* <p>
|
* <p>
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMPRgeData {
|
||||||
Double_t energy;
|
Double_t energy;
|
||||||
PDoubleVector stoppingDistance;
|
PDoubleVector stoppingDistance;
|
||||||
PDoubleVector stoppingAmplitude;
|
PDoubleVector stoppingAmplitude;
|
||||||
} PMPRgeData;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
6
src/external/Nonlocal/CMakeLists.txt
vendored
6
src/external/Nonlocal/CMakeLists.txt
vendored
@ -14,7 +14,7 @@ root_generate_dictionary(
|
|||||||
PNL_PippardFitterDict
|
PNL_PippardFitterDict
|
||||||
PNL_PippardFitter.h
|
PNL_PippardFitter.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${NONLOCAL_INC}
|
-I${NONLOCAL_INC}
|
||||||
-I${CMAKE_CURRENT_SOURCE_DIR}
|
-I${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
@ -52,7 +52,7 @@ add_library(PNL_PippardFitter SHARED
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
PNL_PippardFitter BEFORE PRIVATE
|
PNL_PippardFitter BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
||||||
)
|
)
|
||||||
@ -64,7 +64,7 @@ set_target_properties(PNL_PippardFitter
|
|||||||
)
|
)
|
||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
target_link_libraries(PNL_PippardFitter ${Boost_LIBRARIES} ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} PRgeHandler PUserFcnBase)
|
target_link_libraries(PNL_PippardFitter ${Boost_LIBRARIES} FFTW3::FFTW3 ${ROOT_LIBRARIES} PRgeHandler PUserFcnBase)
|
||||||
|
|
||||||
#--- install PNL_PippardFitter solib ------------------------------------------
|
#--- install PNL_PippardFitter solib ------------------------------------------
|
||||||
install(TARGETS PNL_PippardFitter DESTINATION lib)
|
install(TARGETS PNL_PippardFitter DESTINATION lib)
|
||||||
|
40
src/external/TLemRunHeader/TLemRunHeader.cxx
vendored
40
src/external/TLemRunHeader/TLemRunHeader.cxx
vendored
@ -91,7 +91,7 @@ void TLemRunHeader::SetStopTimeString(const Char_t *stop){
|
|||||||
void TLemRunHeader::SetModeratorHV(Float_t modHV, Float_t error){
|
void TLemRunHeader::SetModeratorHV(Float_t modHV, Float_t error){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s, "05 Moderator HV: %8.2f(%5.2f)", modHV, error);
|
snprintf(s, sizeof(s), "05 Moderator HV: %8.2f(%5.2f)", modHV, error);
|
||||||
str = s;
|
str = s;
|
||||||
fModeratorHVString.SetString(str);
|
fModeratorHVString.SetString(str);
|
||||||
fModeratorHV = modHV;
|
fModeratorHV = modHV;
|
||||||
@ -101,7 +101,7 @@ void TLemRunHeader::SetModeratorHV(Float_t modHV, Float_t error){
|
|||||||
void TLemRunHeader::SetSampleHV(Float_t value, Float_t error){
|
void TLemRunHeader::SetSampleHV(Float_t value, Float_t error){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s,"06 Sample HV: %8.2f(%5.2f)", value, error);
|
snprintf(s, sizeof(s), "06 Sample HV: %8.2f(%5.2f)", value, error);
|
||||||
str = s;
|
str = s;
|
||||||
fSampleHVString.SetString(str);
|
fSampleHVString.SetString(str);
|
||||||
fSampleHV = value;
|
fSampleHV = value;
|
||||||
@ -111,7 +111,7 @@ void TLemRunHeader::SetSampleHV(Float_t value, Float_t error){
|
|||||||
void TLemRunHeader::SetImpEnergy(Float_t value){
|
void TLemRunHeader::SetImpEnergy(Float_t value){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s,"07 Impl. Energy: %8.2f", value);
|
snprintf(s, sizeof(s), "07 Impl. Energy: %8.2f", value);
|
||||||
str = s;
|
str = s;
|
||||||
fImpEnergyString.SetString(str);
|
fImpEnergyString.SetString(str);
|
||||||
fImpEnergy = value;
|
fImpEnergy = value;
|
||||||
@ -120,7 +120,7 @@ void TLemRunHeader::SetImpEnergy(Float_t value){
|
|||||||
void TLemRunHeader::SetSampleTemperature(Float_t value, Float_t error){
|
void TLemRunHeader::SetSampleTemperature(Float_t value, Float_t error){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s,"08 Sample T: %8.2f(%5.2f)", value, error);
|
snprintf(s, sizeof(s), "08 Sample T: %8.2f(%5.2f)", value, error);
|
||||||
str = s;
|
str = s;
|
||||||
fSampleTemperatureString.SetString(str);
|
fSampleTemperatureString.SetString(str);
|
||||||
fSampleTemperature = value;
|
fSampleTemperature = value;
|
||||||
@ -130,7 +130,7 @@ void TLemRunHeader::SetSampleTemperature(Float_t value, Float_t error){
|
|||||||
void TLemRunHeader::SetSampleBField(Float_t value, Float_t error){
|
void TLemRunHeader::SetSampleBField(Float_t value, Float_t error){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s,"09 Sample B: %8.2f(%5.2f)", value, error);
|
snprintf(s, sizeof(s), "09 Sample B: %8.2f(%5.2f)", value, error);
|
||||||
str = s;
|
str = s;
|
||||||
fSampleBFieldString.SetString(str);
|
fSampleBFieldString.SetString(str);
|
||||||
fSampleBField = value;
|
fSampleBField = value;
|
||||||
@ -140,7 +140,7 @@ void TLemRunHeader::SetSampleBField(Float_t value, Float_t error){
|
|||||||
void TLemRunHeader::SetTimeResolution(Float_t value){
|
void TLemRunHeader::SetTimeResolution(Float_t value){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s,"10 Time Res.: %10.7f", value);
|
snprintf(s, sizeof(s), "10 Time Res.: %10.7f", value);
|
||||||
str = s;
|
str = s;
|
||||||
fTimeResolutionString.SetString(str);
|
fTimeResolutionString.SetString(str);
|
||||||
fTimeResolution = value;
|
fTimeResolution = value;
|
||||||
@ -149,7 +149,7 @@ void TLemRunHeader::SetTimeResolution(Float_t value){
|
|||||||
void TLemRunHeader::SetNChannels(Int_t value){
|
void TLemRunHeader::SetNChannels(Int_t value){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s,"11 N Channels: %8d", value);
|
snprintf(s, sizeof(s), "11 N Channels: %8d", value);
|
||||||
str = s;
|
str = s;
|
||||||
fNChannelsString.SetString(str);
|
fNChannelsString.SetString(str);
|
||||||
fNChannels = value;
|
fNChannels = value;
|
||||||
@ -158,7 +158,7 @@ void TLemRunHeader::SetNChannels(Int_t value){
|
|||||||
void TLemRunHeader::SetNHist(Int_t value){
|
void TLemRunHeader::SetNHist(Int_t value){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s,"12 N Histograms: %6d", value);
|
snprintf(s, sizeof(s), "12 N Histograms: %6d", value);
|
||||||
str = s;
|
str = s;
|
||||||
fNHistString.SetString(str);
|
fNHistString.SetString(str);
|
||||||
fNHist = value;
|
fNHist = value;
|
||||||
@ -168,7 +168,7 @@ void TLemRunHeader::SetNHist(Int_t value){
|
|||||||
void TLemRunHeader::SetOffsetPPCHistograms(UInt_t value){
|
void TLemRunHeader::SetOffsetPPCHistograms(UInt_t value){
|
||||||
TString str;
|
TString str;
|
||||||
char s[80];
|
char s[80];
|
||||||
sprintf(s,"13 Offset PPC Histograms: %6d", value);
|
snprintf(s, sizeof(s), "13 Offset PPC Histograms: %6d", value);
|
||||||
str = s;
|
str = s;
|
||||||
fOffsetPPCHistogramsString.SetString(str);
|
fOffsetPPCHistogramsString.SetString(str);
|
||||||
fOffsetPPCHistograms = value;
|
fOffsetPPCHistograms = value;
|
||||||
@ -364,25 +364,25 @@ void TLemRunHeader::DrawHeader() const {
|
|||||||
strcpy(str, "Run Stop: ");
|
strcpy(str, "Run Stop: ");
|
||||||
strcat(str, runStop);
|
strcat(str, runStop);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "Run Number: %10d", GetRunNumber());
|
snprintf(str, sizeof(str), "Run Number: %10d", GetRunNumber());
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "Moderator HV: %10.2f kV", fModeratorHV);
|
snprintf(str, sizeof(str), "Moderator HV: %10.2f kV", fModeratorHV);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "Sample HV: %10.2f kV", fSampleHV);
|
snprintf(str, sizeof(str), "Sample HV: %10.2f kV", fSampleHV);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "Impl. Energy: %10.2f keV", fImpEnergy);
|
snprintf(str, sizeof(str), "Impl. Energy: %10.2f keV", fImpEnergy);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "Sample T: %10.2f K", fSampleTemperature);
|
snprintf(str, sizeof(str), "Sample T: %10.2f K", fSampleTemperature);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "Sample B: %10.2f G", fSampleBField);
|
snprintf(str, sizeof(str), "Sample B: %10.2f G", fSampleBField);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "Time Res.: %10.7f ns", fTimeResolution);
|
snprintf(str, sizeof(str), "Time Res.: %10.7f ns", fTimeResolution);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "N Channels: %10d", fNChannels);
|
snprintf(str, sizeof(str), "N Channels: %10d", fNChannels);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "N Histograms: %10d", fNHist);
|
snprintf(str, sizeof(str), "N Histograms: %10d", fNHist);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
sprintf(str, "Offset PPC Histograms: %10d", fOffsetPPCHistograms);
|
snprintf(str, sizeof(str), "Offset PPC Histograms: %10d", fOffsetPPCHistograms);
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
strcpy(str, "Cuts: ");
|
strcpy(str, "Cuts: ");
|
||||||
strcat(str, cuts);
|
strcat(str, cuts);
|
||||||
@ -393,7 +393,7 @@ void TLemRunHeader::DrawHeader() const {
|
|||||||
|
|
||||||
strcpy(str,"t0: ");
|
strcpy(str,"t0: ");
|
||||||
for (Int_t i=0; i<fNHist; i++){
|
for (Int_t i=0; i<fNHist; i++){
|
||||||
sprintf(helpstr, " %7.2f ", fTimeZero[i]);
|
snprintf(helpstr, sizeof(helpstr), " %7.2f ", fTimeZero[i]);
|
||||||
strcat(str, helpstr);
|
strcat(str, helpstr);
|
||||||
}
|
}
|
||||||
text = pt->AddText(str);
|
text = pt->AddText(str);
|
||||||
|
1
src/external/libBNMR/CMakeLists.txt
vendored
1
src/external/libBNMR/CMakeLists.txt
vendored
@ -14,7 +14,6 @@ root_generate_dictionary(
|
|||||||
TBNMRDict
|
TBNMRDict
|
||||||
TBNMR.h
|
TBNMR.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
LINKDEF TBNMRLinkDef.h
|
LINKDEF TBNMRLinkDef.h
|
||||||
|
@ -11,7 +11,7 @@ root_generate_dictionary(
|
|||||||
LineProfileDict
|
LineProfileDict
|
||||||
LineProfile.h
|
LineProfile.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
LINKDEF LineProfileLinkDef.h
|
LINKDEF LineProfileLinkDef.h
|
||||||
MODULE LineProfile
|
MODULE LineProfile
|
||||||
|
@ -13,7 +13,7 @@ root_generate_dictionary(
|
|||||||
TCalcMeanFieldsLEMDict
|
TCalcMeanFieldsLEMDict
|
||||||
TCalcMeanFieldsLEM.h
|
TCalcMeanFieldsLEM.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${BMW_TOOLS_INC}
|
-I${BMW_TOOLS_INC}
|
||||||
-I${POFB_INC}
|
-I${POFB_INC}
|
||||||
@ -48,7 +48,7 @@ set_target_properties(CalcMeanFieldsLEM
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
CalcMeanFieldsLEM BEFORE PRIVATE
|
CalcMeanFieldsLEM BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
||||||
$<BUILD_INTERFACE:${POFB_INC}>
|
$<BUILD_INTERFACE:${POFB_INC}>
|
||||||
@ -57,7 +57,7 @@ target_include_directories(
|
|||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
target_link_libraries(CalcMeanFieldsLEM
|
target_link_libraries(CalcMeanFieldsLEM
|
||||||
${FFTW3_LIBRARY} ${ROOT_LIBRARIES} BMWtools FitPofB PUserFcnBase
|
FFTW3::FFTW3 ${ROOT_LIBRARIES} BMWtools FitPofB PUserFcnBase
|
||||||
)
|
)
|
||||||
|
|
||||||
#--- install CalcMeanFieldsLEM solib ------------------------------------------
|
#--- install CalcMeanFieldsLEM solib ------------------------------------------
|
||||||
|
@ -101,7 +101,7 @@ double TMeanFieldsForScHalfSpace::operator()(double E, const std::vector<double>
|
|||||||
if (E > energies.back())
|
if (E > energies.back())
|
||||||
return CalcMeanB(energies.back(), BofZ);
|
return CalcMeanB(energies.back(), BofZ);
|
||||||
|
|
||||||
energyIter = find_if(energies.begin(), energies.end(), bind2nd( greater<double>(), E));
|
energyIter = find_if(energies.begin(), energies.end(), [E](const double ee){ return E < ee; }); //as35: bind2nd( greater<double>(), E));
|
||||||
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
||||||
|
|
||||||
double E1(*(energyIter - 1));
|
double E1(*(energyIter - 1));
|
||||||
@ -201,7 +201,7 @@ double TMeanFieldsForScSingleLayer::operator()(double E, const std::vector<doubl
|
|||||||
if (E > energies.back())
|
if (E > energies.back())
|
||||||
return CalcMeanB(energies.back(), interfaces, weights, BofZ);
|
return CalcMeanB(energies.back(), interfaces, weights, BofZ);
|
||||||
|
|
||||||
energyIter = find_if(energies.begin(), energies.end(), bind2nd( greater<double>(), E));
|
energyIter = find_if(energies.begin(), energies.end(), [E](const double ee){ return E < ee; }); //as35: bind2nd( greater<double>(), E));
|
||||||
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
||||||
|
|
||||||
double E1(*(energyIter - 1));
|
double E1(*(energyIter - 1));
|
||||||
@ -310,7 +310,7 @@ double TMeanFieldsForScBilayer::operator()(double E, const std::vector<double> &
|
|||||||
if (E > energies.back())
|
if (E > energies.back())
|
||||||
return CalcMeanB(energies.back(), interfaces, weights, BofZ, width);
|
return CalcMeanB(energies.back(), interfaces, weights, BofZ, width);
|
||||||
|
|
||||||
energyIter = find_if(energies.begin(), energies.end(), bind2nd( greater<double>(), E));
|
energyIter = find_if(energies.begin(), energies.end(), [E](const double ee){ return E < ee; }); //as35: bind2nd( greater<double>(), E));
|
||||||
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
||||||
|
|
||||||
double E1(*(energyIter - 1));
|
double E1(*(energyIter - 1));
|
||||||
@ -425,7 +425,7 @@ double TMeanFieldsForScTrilayer::operator()(double E, const std::vector<double>
|
|||||||
if (E > energies.back())
|
if (E > energies.back())
|
||||||
return CalcMeanB(energies.back(), interfaces, weights, BofZ);
|
return CalcMeanB(energies.back(), interfaces, weights, BofZ);
|
||||||
|
|
||||||
energyIter = find_if(energies.begin(), energies.end(), bind2nd( greater<double>(), E));
|
energyIter = find_if(energies.begin(), energies.end(), [E](const double ee){ return E < ee; }); //as35: bind2nd( greater<double>(), E));
|
||||||
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
||||||
|
|
||||||
double E1(*(energyIter - 1));
|
double E1(*(energyIter - 1));
|
||||||
@ -530,7 +530,7 @@ double TMeanFieldsForScTrilayerWithInsulator::operator()(double E, const std::ve
|
|||||||
if (E > energies.back())
|
if (E > energies.back())
|
||||||
return CalcMeanB(energies.back(), interfaces, weights, BofZ);
|
return CalcMeanB(energies.back(), interfaces, weights, BofZ);
|
||||||
|
|
||||||
energyIter = find_if(energies.begin(), energies.end(), bind2nd( greater<double>(), E));
|
energyIter = find_if(energies.begin(), energies.end(), [E](const double ee){ return E < ee; }); //as35: bind2nd( greater<double>(), E));
|
||||||
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
// cout << *(energyIter - 1) << " " << *(energyIter) << endl;
|
||||||
|
|
||||||
double E1(*(energyIter - 1));
|
double E1(*(energyIter - 1));
|
||||||
|
2
src/external/libCuba/src/common/Fork.c
vendored
2
src/external/libCuba/src/common/Fork.c
vendored
@ -75,7 +75,7 @@ Extern void SUFFIX(cubafork)(Spin **pspin)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( cubaverb_ ) {
|
if( cubaverb_ ) {
|
||||||
sprintf(out, "using %d cores %d accelerators via "
|
snprintf(out, sizeof(out), "using %d cores %d accelerators via "
|
||||||
#ifdef HAVE_SHMGET
|
#ifdef HAVE_SHMGET
|
||||||
"shared memory",
|
"shared memory",
|
||||||
#else
|
#else
|
||||||
|
2
src/external/libCuba/src/common/Parallel.c
vendored
2
src/external/libCuba/src/common/Parallel.c
vendored
@ -47,7 +47,7 @@ static inline void DoSampleParallel(This *t, number n, creal *x, real *f
|
|||||||
t->neval += n;
|
t->neval += n;
|
||||||
|
|
||||||
if( VERBOSE > 2 ) {
|
if( VERBOSE > 2 ) {
|
||||||
sprintf(out, "sampling " NUMBER " points each on %d cores",
|
snprintf(out, sizeof(out), "sampling " NUMBER " points each on %d cores",
|
||||||
pcores, ncores);
|
pcores, ncores);
|
||||||
Print(out);
|
Print(out);
|
||||||
}
|
}
|
||||||
|
6
src/external/libCuba/src/common/stddecl.h
vendored
6
src/external/libCuba/src/common/stddecl.h
vendored
@ -94,7 +94,7 @@ enum { uninitialized = 0x61627563 };
|
|||||||
var = atoi(env); \
|
var = atoi(env); \
|
||||||
if( cubaverb_ ) { \
|
if( cubaverb_ ) { \
|
||||||
char out[64]; \
|
char out[64]; \
|
||||||
sprintf(out, "env " name " = %d", (int)var); \
|
snprintf(out, sizeof(out), "env " name " = %d", (int)var); \
|
||||||
Print(out); \
|
Print(out); \
|
||||||
} \
|
} \
|
||||||
} \
|
} \
|
||||||
@ -280,7 +280,7 @@ enum { signature = 0x41425543 };
|
|||||||
} \
|
} \
|
||||||
if( ini | statemsg ) { \
|
if( ini | statemsg ) { \
|
||||||
char s[512]; \
|
char s[512]; \
|
||||||
sprintf(s, ini ? \
|
snprintf(s, sizeof(s), ini ? \
|
||||||
"\nError restoring state from %s, starting from scratch." : \
|
"\nError restoring state from %s, starting from scratch." : \
|
||||||
"\nRestored state from %s.", (t)->statefile); \
|
"\nRestored state from %s.", (t)->statefile); \
|
||||||
Print(s); \
|
Print(s); \
|
||||||
@ -307,7 +307,7 @@ enum { signature = 0x41425543 };
|
|||||||
} \
|
} \
|
||||||
if( fail | statemsg ) { \
|
if( fail | statemsg ) { \
|
||||||
char s[512]; \
|
char s[512]; \
|
||||||
sprintf(s, fail ? \
|
snprintf(s, sizeof(s), fail ? \
|
||||||
"\nError saving state to %s." : \
|
"\nError saving state to %s." : \
|
||||||
"\nSaved state to %s.", (t)->statefile); \
|
"\nSaved state to %s.", (t)->statefile); \
|
||||||
Print(s); \
|
Print(s); \
|
||||||
|
22
src/external/libCuba/src/divonne/Integrate.c
vendored
22
src/external/libCuba/src/divonne/Integrate.c
vendored
@ -36,7 +36,7 @@ static int Integrate(This *t, real *integral, real *error, real *prob)
|
|||||||
int fail;
|
int fail;
|
||||||
|
|
||||||
if( VERBOSE > 1 ) {
|
if( VERBOSE > 1 ) {
|
||||||
sprintf(out, "Divonne input parameters:\n"
|
snprintf(out, sizeof(out), "Divonne input parameters:\n"
|
||||||
" ndim " COUNT "\n ncomp " COUNT "\n"
|
" ndim " COUNT "\n ncomp " COUNT "\n"
|
||||||
ML_NOT(" nvec " NUMBER "\n")
|
ML_NOT(" nvec " NUMBER "\n")
|
||||||
" epsrel " REAL "\n epsabs " REAL "\n"
|
" epsrel " REAL "\n epsabs " REAL "\n"
|
||||||
@ -189,7 +189,7 @@ if( StateWriteTest(t) ) { \
|
|||||||
WriteState(t);
|
WriteState(t);
|
||||||
|
|
||||||
if( VERBOSE ) {
|
if( VERBOSE ) {
|
||||||
char *oe = out + sprintf(out, "\n"
|
char *oe = out + snprintf(out, sizeof(out), "\n"
|
||||||
"Iteration " COUNT " (pass " COUNT "): " COUNT " regions\n"
|
"Iteration " COUNT " (pass " COUNT "): " COUNT " regions\n"
|
||||||
NUMBER7 " integrand evaluations so far,\n"
|
NUMBER7 " integrand evaluations so far,\n"
|
||||||
NUMBER7 " in optimizing regions,\n"
|
NUMBER7 " in optimizing regions,\n"
|
||||||
@ -197,7 +197,7 @@ if( StateWriteTest(t) ) { \
|
|||||||
state->iter, state->pass, t->nregions,
|
state->iter, state->pass, t->nregions,
|
||||||
t->neval, t->neval_opt, t->neval_cut);
|
t->neval, t->neval_opt, t->neval_cut);
|
||||||
for( comp = 0; comp < t->ncomp; ++comp )
|
for( comp = 0; comp < t->ncomp; ++comp )
|
||||||
oe += sprintf(oe, "\n[" COUNT "] "
|
oe += snprintf(oe, sizeof(out), "\n[" COUNT "] "
|
||||||
REAL " +- " REAL,
|
REAL " +- " REAL,
|
||||||
comp + 1, SHOW(integral[comp]), SHOW(error[comp]));
|
comp + 1, SHOW(integral[comp]), SHOW(error[comp]));
|
||||||
Print(out);
|
Print(out);
|
||||||
@ -255,7 +255,7 @@ if( StateWriteTest(t) ) { \
|
|||||||
SamplesAlloc(t, &t->samples[1]);
|
SamplesAlloc(t, &t->samples[1]);
|
||||||
|
|
||||||
if( VERBOSE ) {
|
if( VERBOSE ) {
|
||||||
sprintf(out, "\nMain integration on " COUNT
|
snprintf(out, sizeof(out), "\nMain integration on " COUNT
|
||||||
" regions with " NUMBER " samples per region.",
|
" regions with " NUMBER " samples per region.",
|
||||||
t->nregions, t->samples[1].neff);
|
t->nregions, t->samples[1].neff);
|
||||||
Print(out);
|
Print(out);
|
||||||
@ -325,7 +325,7 @@ refine:
|
|||||||
can_adjust = false;
|
can_adjust = false;
|
||||||
|
|
||||||
if( VERBOSE > 2 ) {
|
if( VERBOSE > 2 ) {
|
||||||
sprintf(out, "Sampling remaining " COUNT
|
snprintf(out, sizeof(out), "Sampling remaining " COUNT
|
||||||
" regions with " NUMBER " points per region.",
|
" regions with " NUMBER " points per region.",
|
||||||
t->nregions, t->samples[1].neff);
|
t->nregions, t->samples[1].neff);
|
||||||
Print(out);
|
Print(out);
|
||||||
@ -369,7 +369,7 @@ refine:
|
|||||||
if( VERBOSE > 2 ) {
|
if( VERBOSE > 2 ) {
|
||||||
cchar *msg = "\nRegion (" REALF ") - (" REALF ")";
|
cchar *msg = "\nRegion (" REALF ") - (" REALF ")";
|
||||||
for( B = (b = region->bounds) + t->ndim; b < B; ++b ) {
|
for( B = (b = region->bounds) + t->ndim; b < B; ++b ) {
|
||||||
oe += sprintf(oe, msg, b->lower, b->upper);
|
oe += snprintf(oe, sizeof(out), msg, b->lower, b->upper);
|
||||||
msg = "\n (" REALF ") - (" REALF ")";
|
msg = "\n (" REALF ") - (" REALF ")";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -408,12 +408,12 @@ refine:
|
|||||||
if( VERBOSE > 2 ) {
|
if( VERBOSE > 2 ) {
|
||||||
#define Out2(f, r) SHOW((r)->avg), SHOW(res->spread/t->samples[f].neff), SHOW((r)->err)
|
#define Out2(f, r) SHOW((r)->avg), SHOW(res->spread/t->samples[f].neff), SHOW((r)->err)
|
||||||
#define Out(f) Out2(f, &tot->phase[f])
|
#define Out(f) Out2(f, &tot->phase[f])
|
||||||
oe += sprintf(oe, "\n[" COUNT "] "
|
oe += snprintf(oe, sizeof(out), "\n[" COUNT "] "
|
||||||
REAL " +- " REAL "(" REAL ")\n "
|
REAL " +- " REAL "(" REAL ")\n "
|
||||||
REAL " +- " REAL "(" REAL ")", ++comp, Out(0), Out(1));
|
REAL " +- " REAL "(" REAL ")", ++comp, Out(0), Out(1));
|
||||||
if( todo == 3 ) oe += sprintf(oe, "\n "
|
if( todo == 3 ) oe += snprintf(oe, sizeof(out), "\n "
|
||||||
REAL " +- " REAL "(" REAL ")", Out2(2, res));
|
REAL " +- " REAL "(" REAL ")", Out2(2, res));
|
||||||
oe += sprintf(oe, " \tchisq " REAL, SHOW(chisq));
|
oe += snprintf(oe, sizeof(out), " \tchisq " REAL, SHOW(chisq));
|
||||||
}
|
}
|
||||||
|
|
||||||
tot->integral += avg;
|
tot->integral += avg;
|
||||||
@ -440,9 +440,9 @@ refine:
|
|||||||
}
|
}
|
||||||
|
|
||||||
if( VERBOSE > 2 ) {
|
if( VERBOSE > 2 ) {
|
||||||
char *oe = out + sprintf(out, "\nTotals:");
|
char *oe = out + snprintf(out, sizeof(out), "\nTotals:");
|
||||||
for( tot = state->totals, comp = 0; tot < Tot; ++tot, ++comp )
|
for( tot = state->totals, comp = 0; tot < Tot; ++tot, ++comp )
|
||||||
oe += sprintf(oe, "\n[" COUNT "] "
|
oe += snprintf(oe, sizeof(out), "\n[" COUNT "] "
|
||||||
REAL " +- " REAL " \tchisq " REAL " (" COUNT " df)",
|
REAL " +- " REAL " \tchisq " REAL " (" COUNT " df)",
|
||||||
comp + 1, SHOW(integral[comp]), SHOW(error[comp]),
|
comp + 1, SHOW(integral[comp]), SHOW(error[comp]),
|
||||||
SHOW(tot->chisq), df);
|
SHOW(tot->chisq), df);
|
||||||
|
10
src/external/libFitPofB/classes/CMakeLists.txt
vendored
10
src/external/libFitPofB/classes/CMakeLists.txt
vendored
@ -13,7 +13,7 @@ root_generate_dictionary(
|
|||||||
TLondon1DDict
|
TLondon1DDict
|
||||||
TLondon1D.h
|
TLondon1D.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${BMW_TOOLS_INC}
|
-I${BMW_TOOLS_INC}
|
||||||
-I${FIT_P_OF_B_INC}
|
-I${FIT_P_OF_B_INC}
|
||||||
@ -25,7 +25,7 @@ root_generate_dictionary(
|
|||||||
TVortexDict
|
TVortexDict
|
||||||
TVortex.h
|
TVortex.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${BMW_TOOLS_INC}
|
-I${BMW_TOOLS_INC}
|
||||||
-I${FIT_P_OF_B_INC}
|
-I${FIT_P_OF_B_INC}
|
||||||
@ -37,7 +37,7 @@ root_generate_dictionary(
|
|||||||
TSkewedGssDict
|
TSkewedGssDict
|
||||||
TSkewedGss.h
|
TSkewedGss.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${BMW_TOOLS_INC}
|
-I${BMW_TOOLS_INC}
|
||||||
-I${POFB_INC}
|
-I${POFB_INC}
|
||||||
@ -82,7 +82,7 @@ set_target_properties(FitPofB
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
FitPofB BEFORE PRIVATE
|
FitPofB BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/TLemRunHeader>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}/src/external/TLemRunHeader>
|
||||||
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
||||||
@ -101,7 +101,7 @@ if (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
|||||||
endif (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
endif (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
||||||
target_link_libraries(FitPofB
|
target_link_libraries(FitPofB
|
||||||
${gomp}
|
${gomp}
|
||||||
${FFTW3_LIBRARY} ${FFTW3F_LIBRARY} ${ROOT_LIBRARIES}
|
FFTW3::FFTW3 FFTW3::FFTW3F ${ROOT_LIBRARIES}
|
||||||
TLemRunHeader PUserFcnBase BMWtools
|
TLemRunHeader PUserFcnBase BMWtools
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -317,7 +317,7 @@ void TPofBCalc::Calculate(const TBofZCalc *BofZ, const TTrimSPData *dataTrimSP,
|
|||||||
seconds = time (NULL);
|
seconds = time (NULL);
|
||||||
|
|
||||||
char debugfile[50];
|
char debugfile[50];
|
||||||
int n = sprintf (debugfile, "test_Bz_%ld_%f.dat", seconds, fBmin);
|
int n = snprintf (debugfile, sizeof(debugfile), "test_Bz_%ld_%f.dat", seconds, fBmin);
|
||||||
|
|
||||||
if (n > 0) {
|
if (n > 0) {
|
||||||
ofstream of(debugfile);
|
ofstream of(debugfile);
|
||||||
@ -330,10 +330,10 @@ void TPofBCalc::Calculate(const TBofZCalc *BofZ, const TTrimSPData *dataTrimSP,
|
|||||||
}
|
}
|
||||||
|
|
||||||
char debugfile1[50];
|
char debugfile1[50];
|
||||||
int n1 = sprintf (debugfile1, "test_NZ_%ld_%f.dat", seconds, para[2]);
|
int n1 = snprintf (debugfile1, sizeof(debugfile1), "test_NZ_%ld_%f.dat", seconds, para[2]);
|
||||||
|
|
||||||
char debugfile2[50];
|
char debugfile2[50];
|
||||||
int n2 = sprintf (debugfile2, "test_NZgss_%ld_%f.dat", seconds, para[2]);
|
int n2 = snprintf (debugfile2, sizeof(debugfile2), "test_NZgss_%ld_%f.dat", seconds, para[2]);
|
||||||
|
|
||||||
if (n1 > 0) {
|
if (n1 > 0) {
|
||||||
ofstream of1(debugfile1);
|
ofstream of1(debugfile1);
|
||||||
|
@ -357,7 +357,7 @@ void TPofTCalc::FakeData(const string &rootOutputFileName, const std::vector<dou
|
|||||||
// create run info folder and content
|
// create run info folder and content
|
||||||
TFolder *runInfoFolder = new TFolder("RunInfo", "Run Info");
|
TFolder *runInfoFolder = new TFolder("RunInfo", "Run Info");
|
||||||
TLemRunHeader *runHeader = new TLemRunHeader();
|
TLemRunHeader *runHeader = new TLemRunHeader();
|
||||||
//sprintf(str, "Fake Data generated from %s", pBFileName.Data());
|
//snprintf(str, sizeof(str), "Fake Data generated from %s", pBFileName.Data());
|
||||||
runHeader->SetRunTitle("Fake Data");
|
runHeader->SetRunTitle("Fake Data");
|
||||||
if (optPar && (optPar->size() > 1)) { // set energy and field if they were specified
|
if (optPar && (optPar->size() > 1)) { // set energy and field if they were specified
|
||||||
runHeader->SetImpEnergy((*optPar)[1]);
|
runHeader->SetImpEnergy((*optPar)[1]);
|
||||||
|
6
src/external/libGapIntegrals/CMakeLists.txt
vendored
6
src/external/libGapIntegrals/CMakeLists.txt
vendored
@ -12,7 +12,7 @@ root_generate_dictionary(
|
|||||||
TGapIntegralsDict
|
TGapIntegralsDict
|
||||||
TGapIntegrals.h
|
TGapIntegrals.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${BMW_TOOLS_INC}
|
-I${BMW_TOOLS_INC}
|
||||||
-I${CMAKE_CURRENT_SOURCE_DIR}
|
-I${CMAKE_CURRENT_SOURCE_DIR}
|
||||||
@ -47,7 +47,7 @@ set_target_properties(GapIntegrals
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
GapIntegrals BEFORE PRIVATE
|
GapIntegrals BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
@ -55,7 +55,7 @@ target_include_directories(
|
|||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
target_link_libraries(GapIntegrals
|
target_link_libraries(GapIntegrals
|
||||||
${GSL_LIBRARIES} ${FFTW3F_LIBRARY} ${ROOT_LIBRARIES}
|
${GSL_LIBRARIES} FFTW3::FFTW3F ${ROOT_LIBRARIES}
|
||||||
PUserFcnBase cuba BMWtools
|
PUserFcnBase cuba BMWtools
|
||||||
)
|
)
|
||||||
|
|
||||||
|
4
src/external/libGbGLF/CMakeLists.txt
vendored
4
src/external/libGbGLF/CMakeLists.txt
vendored
@ -31,7 +31,7 @@ add_library(PGbGLF SHARED
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
PGbGLF BEFORE PRIVATE
|
PGbGLF BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_SOURCE_DIR}>
|
||||||
)
|
)
|
||||||
@ -43,7 +43,7 @@ set_target_properties(PGbGLF
|
|||||||
)
|
)
|
||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
target_link_libraries(PGbGLF ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} PUserFcnBase)
|
target_link_libraries(PGbGLF FFTW3::FFTW3 ${ROOT_LIBRARIES} PUserFcnBase)
|
||||||
|
|
||||||
#--- install PGbGLF solib -----------------------------------------------------
|
#--- install PGbGLF solib -----------------------------------------------------
|
||||||
install(TARGETS PGbGLF DESTINATION lib)
|
install(TARGETS PGbGLF DESTINATION lib)
|
||||||
|
6
src/external/libLFRelaxation/CMakeLists.txt
vendored
6
src/external/libLFRelaxation/CMakeLists.txt
vendored
@ -12,7 +12,7 @@ root_generate_dictionary(
|
|||||||
TLFRelaxationDict
|
TLFRelaxationDict
|
||||||
TLFRelaxation.h
|
TLFRelaxation.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${BMW_TOOLS_INC}
|
-I${BMW_TOOLS_INC}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
@ -46,7 +46,7 @@ set_target_properties(LFRelaxation
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
LFRelaxation BEFORE PRIVATE
|
LFRelaxation BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
@ -63,7 +63,7 @@ if (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
|||||||
endif (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
endif (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
||||||
target_link_libraries(LFRelaxation
|
target_link_libraries(LFRelaxation
|
||||||
${gomp}
|
${gomp}
|
||||||
${GSL_LIBRARIES} ${FFTW3F_LIBRARY}
|
${GSL_LIBRARIES} FFTW3::FFTW3F
|
||||||
${ROOT_LIBRARIES} PUserFcnBase cuba BMWtools
|
${ROOT_LIBRARIES} PUserFcnBase cuba BMWtools
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -12,7 +12,7 @@ root_generate_dictionary(
|
|||||||
PPhotoMeissnerDict
|
PPhotoMeissnerDict
|
||||||
PPhotoMeissner.h
|
PPhotoMeissner.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${GSL_INCLUDE_DIRS}
|
-I${GSL_INCLUDE_DIRS}
|
||||||
-I${ROOT_INCLUDE_DIRS}
|
-I${ROOT_INCLUDE_DIRS}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
@ -46,7 +46,7 @@ set_target_properties(PPhotoMeissner
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
PPhotoMeissner BEFORE PRIVATE
|
PPhotoMeissner BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${GSL_INCLUDE_DIRS}>
|
$<BUILD_INTERFACE:${GSL_INCLUDE_DIRS}>
|
||||||
$<BUILD_INTERFACE:${ROOT_INCLUDE_DIRS}>
|
$<BUILD_INTERFACE:${ROOT_INCLUDE_DIRS}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
@ -55,7 +55,7 @@ target_include_directories(
|
|||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
target_link_libraries(PPhotoMeissner
|
target_link_libraries(PPhotoMeissner
|
||||||
${FFTW3_LIBRARY} ${GSL_LIBRARY} ${ROOT_LIBRARIES} PRgeHandler PUserFcnBase
|
FFTW3::FFTW3 ${GSL_LIBRARY} ${ROOT_LIBRARIES} PRgeHandler PUserFcnBase
|
||||||
)
|
)
|
||||||
|
|
||||||
#--- install PPhotoMeissner solib ---------------------------------------------
|
#--- install PPhotoMeissner solib ---------------------------------------------
|
||||||
|
@ -163,7 +163,7 @@ int generateRgeFln(const string prefix, const string elist, vector<string> &rgeF
|
|||||||
}
|
}
|
||||||
ival = start;
|
ival = start;
|
||||||
do {
|
do {
|
||||||
sprintf(istr, "%d", ival);
|
snprintf(istr, sizeof(istr), "%d", ival);
|
||||||
str = prefix + istr + ".rge";
|
str = prefix + istr + ".rge";
|
||||||
rgeFln.push_back(str);
|
rgeFln.push_back(str);
|
||||||
ival += step;
|
ival += step;
|
||||||
|
@ -12,7 +12,7 @@ root_generate_dictionary(
|
|||||||
PSkewedLorentzianDict
|
PSkewedLorentzianDict
|
||||||
PSkewedLorentzian.h
|
PSkewedLorentzian.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${SPIN_VALVE_INC}
|
-I${SPIN_VALVE_INC}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
@ -55,13 +55,13 @@ set_target_properties(PSpinValve
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
PSpinValve BEFORE PRIVATE
|
PSpinValve BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../include>
|
||||||
)
|
)
|
||||||
|
|
||||||
#--- add library dependencies -------------------------------------------------
|
#--- add library dependencies -------------------------------------------------
|
||||||
target_link_libraries(PSpinValve ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} PUserFcnBase)
|
target_link_libraries(PSpinValve FFTW3::FFTW3 ${ROOT_LIBRARIES} PUserFcnBase)
|
||||||
|
|
||||||
#--- install PSpinValve solib -------------------------------------------------
|
#--- install PSpinValve solib -------------------------------------------------
|
||||||
install(TARGETS PSpinValve DESTINATION lib)
|
install(TARGETS PSpinValve DESTINATION lib)
|
||||||
|
6
src/external/libZFRelaxation/CMakeLists.txt
vendored
6
src/external/libZFRelaxation/CMakeLists.txt
vendored
@ -12,7 +12,7 @@ root_generate_dictionary(
|
|||||||
ZFRelaxationDict
|
ZFRelaxationDict
|
||||||
ZFRelaxation.h
|
ZFRelaxation.h
|
||||||
OPTIONS
|
OPTIONS
|
||||||
-I${FFTW3_INCLUDE_DIR}
|
-I${FFTW3_INCLUDE}
|
||||||
-I${MUSRFIT_INC}
|
-I${MUSRFIT_INC}
|
||||||
-I${BMW_TOOLS_INC}
|
-I${BMW_TOOLS_INC}
|
||||||
-inlineInputHeader
|
-inlineInputHeader
|
||||||
@ -46,7 +46,7 @@ set_target_properties(ZFRelaxation
|
|||||||
#--- make sure that the include directory is found ----------------------------
|
#--- make sure that the include directory is found ----------------------------
|
||||||
target_include_directories(
|
target_include_directories(
|
||||||
ZFRelaxation BEFORE PRIVATE
|
ZFRelaxation BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
|
||||||
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
$<BUILD_INTERFACE:${MUSRFIT_INC}>
|
||||||
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
$<BUILD_INTERFACE:${BMW_TOOLS_INC}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
|
||||||
@ -62,7 +62,7 @@ if (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
|||||||
set(gomp gomp)
|
set(gomp gomp)
|
||||||
endif (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
endif (OpenMP_FOUND AND (${CMAKE_HOST_SYSTEM_NAME} STREQUAL Linux))
|
||||||
target_link_libraries(ZFRelaxation
|
target_link_libraries(ZFRelaxation
|
||||||
${gomp} ${FFTW3_LIBRARY} ${ROOT_LIBRARIES} PUserFcnBase cuba BMWtools
|
${gomp} FFTW3::FFTW3 ${ROOT_LIBRARIES} PUserFcnBase cuba BMWtools
|
||||||
)
|
)
|
||||||
|
|
||||||
#--- install ZFRelaxation solib -----------------------------------------------
|
#--- install ZFRelaxation solib -----------------------------------------------
|
||||||
|
@ -67,14 +67,14 @@
|
|||||||
/**
|
/**
|
||||||
* <p>Structure holding all necessary Fourier histograms.
|
* <p>Structure holding all necessary Fourier histograms.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PFourierCanvasDataSet {
|
||||||
TH1F *dataFourierRe; ///< real part of the Fourier transform of the data histogram
|
TH1F *dataFourierRe; ///< real part of the Fourier transform of the data histogram
|
||||||
TH1F *dataFourierIm; ///< imaginary part of the Fourier transform of the data histogram
|
TH1F *dataFourierIm; ///< imaginary part of the Fourier transform of the data histogram
|
||||||
TH1F *dataFourierPwr; ///< power spectrum of the Fourier transform of the data histogram
|
TH1F *dataFourierPwr; ///< power spectrum of the Fourier transform of the data histogram
|
||||||
TH1F *dataFourierPhase; ///< phase spectrum of the Fourier transform of the data histogram
|
TH1F *dataFourierPhase; ///< phase spectrum of the Fourier transform of the data histogram
|
||||||
TH1F *dataFourierPhaseOptReal; ///< phase otpimized real Fourier transform of the data histogram
|
TH1F *dataFourierPhaseOptReal; ///< phase otpimized real Fourier transform of the data histogram
|
||||||
std::vector<Double_t> optPhase; ///< optimal phase which maximizes the real Fourier
|
std::vector<Double_t> optPhase; ///< optimal phase which maximizes the real Fourier
|
||||||
} PFourierCanvasDataSet;
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -526,10 +526,10 @@ typedef std::vector<PRawRunData> PRawRunDataList;
|
|||||||
/**
|
/**
|
||||||
* <p>Helper structure for parsing. Keeps a msr-file line string and the corresponding line number.
|
* <p>Helper structure for parsing. Keeps a msr-file line string and the corresponding line number.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMsrLineStructure {
|
||||||
Int_t fLineNo; ///< original line number of the msr-file
|
Int_t fLineNo; ///< original line number of the msr-file
|
||||||
TString fLine; ///< msr-file line
|
TString fLine; ///< msr-file line
|
||||||
} PMsrLineStructure;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@ -541,7 +541,7 @@ typedef std::vector<PMsrLineStructure> PMsrLines;
|
|||||||
/**
|
/**
|
||||||
* <p>Handles the information of a parameter.
|
* <p>Handles the information of a parameter.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMsrParamStructure{
|
||||||
Int_t fNoOfParams; ///< how many parameters are given
|
Int_t fNoOfParams; ///< how many parameters are given
|
||||||
Int_t fNo; ///< parameter number
|
Int_t fNo; ///< parameter number
|
||||||
TString fName; ///< name
|
TString fName; ///< name
|
||||||
@ -554,7 +554,7 @@ typedef struct {
|
|||||||
Bool_t fUpperBoundaryPresent; ///< flag showing if an upper boundary is present
|
Bool_t fUpperBoundaryPresent; ///< flag showing if an upper boundary is present
|
||||||
Double_t fUpperBoundary; ///< upper boundary for the fit parameter
|
Double_t fUpperBoundary; ///< upper boundary for the fit parameter
|
||||||
Bool_t fIsGlobal; ///< flag showing if the parameter is a global one (used for msr2data global)
|
Bool_t fIsGlobal; ///< flag showing if the parameter is a global one (used for msr2data global)
|
||||||
} PMsrParamStructure;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@ -756,7 +756,7 @@ typedef std::vector<PMsrRunBlock> PMsrRunList;
|
|||||||
/**
|
/**
|
||||||
* <p>Holds the information of the Fourier block
|
* <p>Holds the information of the Fourier block
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMsrFourierStructure {
|
||||||
Bool_t fFourierBlockPresent; ///< flag indicating if a Fourier block is present in the msr-file
|
Bool_t fFourierBlockPresent; ///< flag indicating if a Fourier block is present in the msr-file
|
||||||
Int_t fUnits; ///< flag used to indicate the units. 1=field units (G); 2=field units (T); 3=frequency units (MHz); 4=Mc/s
|
Int_t fUnits; ///< flag used to indicate the units. 1=field units (G); 2=field units (T); 3=frequency units (MHz); 4=Mc/s
|
||||||
Bool_t fDCCorrected; ///< if set true, the dc offset of the signal/theory will be removed before the FFT is made.
|
Bool_t fDCCorrected; ///< if set true, the dc offset of the signal/theory will be removed before the FFT is made.
|
||||||
@ -769,13 +769,13 @@ typedef struct {
|
|||||||
Double_t fRangeForPhaseCorrection[2]; ///< field/frequency range for automatic phase correction
|
Double_t fRangeForPhaseCorrection[2]; ///< field/frequency range for automatic phase correction
|
||||||
Double_t fPlotRange[2]; ///< field/frequency plot range
|
Double_t fPlotRange[2]; ///< field/frequency plot range
|
||||||
Double_t fPhaseIncrement; ///< phase increment for manual phase optimization
|
Double_t fPhaseIncrement; ///< phase increment for manual phase optimization
|
||||||
} PMsrFourierStructure;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Holds the information of a single plot block
|
* <p>Holds the information of a single plot block
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMsrPlotStructure{
|
||||||
Int_t fPlotType; ///< plot type
|
Int_t fPlotType; ///< plot type
|
||||||
Bool_t fLifeTimeCorrection; ///< needed for single histo. If yes, only the asymmetry is shown, otherweise the positron spectrum
|
Bool_t fLifeTimeCorrection; ///< needed for single histo. If yes, only the asymmetry is shown, otherweise the positron spectrum
|
||||||
Bool_t fUseFitRanges; ///< yes -> use the fit ranges to plot the data, no (default) -> use range information if present
|
Bool_t fUseFitRanges; ///< yes -> use the fit ranges to plot the data, no (default) -> use range information if present
|
||||||
@ -792,7 +792,7 @@ typedef struct {
|
|||||||
UInt_t fRRFUnit; ///< RRF frequency unit. 0=kHz, 1=MHz, 2=Mc/s, 3=Gauss, 4=Tesla
|
UInt_t fRRFUnit; ///< RRF frequency unit. 0=kHz, 1=MHz, 2=Mc/s, 3=Gauss, 4=Tesla
|
||||||
Int_t fRRFPhaseParamNo; ///< parameter number if used instead of a RRF phase value
|
Int_t fRRFPhaseParamNo; ///< parameter number if used instead of a RRF phase value
|
||||||
Double_t fRRFPhase; ///< RRF phase
|
Double_t fRRFPhase; ///< RRF phase
|
||||||
} PMsrPlotStructure;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@ -804,7 +804,7 @@ typedef std::vector<PMsrPlotStructure> PMsrPlotList;
|
|||||||
/**
|
/**
|
||||||
* <p>Holds the informations for the statistics block.
|
* <p>Holds the informations for the statistics block.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMsrStatisticStructure {
|
||||||
Bool_t fValid; ///< flag showing if the statistics block is valid, i.e. a fit took place which converged
|
Bool_t fValid; ///< flag showing if the statistics block is valid, i.e. a fit took place which converged
|
||||||
PMsrLines fStatLines; ///< statistics block in msr-file clear text
|
PMsrLines fStatLines; ///< statistics block in msr-file clear text
|
||||||
TString fDate; ///< string holding fitting date and time
|
TString fDate; ///< string holding fitting date and time
|
||||||
@ -815,13 +815,13 @@ typedef struct {
|
|||||||
Double_t fMinExpected; ///< expected total chi2 or max. likelihood
|
Double_t fMinExpected; ///< expected total chi2 or max. likelihood
|
||||||
PDoubleVector fMinExpectedPerHisto; ///< expected pre histo chi2 or max. likelihood
|
PDoubleVector fMinExpectedPerHisto; ///< expected pre histo chi2 or max. likelihood
|
||||||
PUIntVector fNdfPerHisto; ///< number of degrees of freedom per histo
|
PUIntVector fNdfPerHisto; ///< number of degrees of freedom per histo
|
||||||
} PMsrStatisticStructure;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Holds the informations for the any2many converter program
|
* <p>Holds the informations for the any2many converter program
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PAny2ManyInfo {
|
||||||
Bool_t useStandardOutput{false}; ///< flag showing if the converted shall be sent to the standard output
|
Bool_t useStandardOutput{false}; ///< flag showing if the converted shall be sent to the standard output
|
||||||
TString inFormat{""}; ///< holds the information about the input data file format
|
TString inFormat{""}; ///< holds the information about the input data file format
|
||||||
TString outFormat{""}; ///< holds the information about the output data file format
|
TString outFormat{""}; ///< holds the information about the output data file format
|
||||||
@ -838,16 +838,16 @@ typedef struct {
|
|||||||
UInt_t compressionTag{0}; ///< 0=no compression, 1=gzip compression, 2=bzip2 compression
|
UInt_t compressionTag{0}; ///< 0=no compression, 1=gzip compression, 2=bzip2 compression
|
||||||
TString compressFileName{""}; ///< holds the name of the outputfile name in case of compression is used
|
TString compressFileName{""}; ///< holds the name of the outputfile name in case of compression is used
|
||||||
UInt_t idf{0}; ///< IDF version for NeXus files.
|
UInt_t idf{0}; ///< IDF version for NeXus files.
|
||||||
} PAny2ManyInfo;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>Holds information given at startup
|
* <p>Holds information given at startup
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PStartupOptions {
|
||||||
Bool_t writeExpectedChisq; ///< if set to true, expected chisq and chisq per block will be written
|
Bool_t writeExpectedChisq; ///< if set to true, expected chisq and chisq per block will be written
|
||||||
Bool_t estimateN0; ///< if set to true, for single histogram fits N0 will be estimated
|
Bool_t estimateN0; ///< if set to true, for single histogram fits N0 will be estimated
|
||||||
} PStartupOptions;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@ -878,10 +878,10 @@ class PStringNumberList {
|
|||||||
/**
|
/**
|
||||||
* <p> Run name template structure.
|
* <p> Run name template structure.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PRunNameTemplate {
|
||||||
TString instrument{""};
|
TString instrument{""};
|
||||||
TString runNameTemplate{""};
|
TString runNameTemplate{""};
|
||||||
} PRunNameTemplate;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------
|
//-------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -118,7 +118,7 @@ class PMusrCanvasPlotRange : public TObject
|
|||||||
* <p>Structure holding all necessary histograms for a single plot block entry for
|
* <p>Structure holding all necessary histograms for a single plot block entry for
|
||||||
* fit types: asymmetry fit and single histogram fit.
|
* fit types: asymmetry fit and single histogram fit.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMusrCanvasDataSet {
|
||||||
TH1F *data; ///< data histogram
|
TH1F *data; ///< data histogram
|
||||||
TH1F *dataFourierRe; ///< real part of the Fourier transform of the data histogram
|
TH1F *dataFourierRe; ///< real part of the Fourier transform of the data histogram
|
||||||
TH1F *dataFourierIm; ///< imaginary part of the Fourier transform of the data histogram
|
TH1F *dataFourierIm; ///< imaginary part of the Fourier transform of the data histogram
|
||||||
@ -139,7 +139,7 @@ typedef struct {
|
|||||||
TH1F *diffFourierPhaseOptReal; ///< phase optimized real part spectrum Fourier transform of the diff histogram
|
TH1F *diffFourierPhaseOptReal; ///< phase optimized real part spectrum Fourier transform of the diff histogram
|
||||||
PMusrCanvasPlotRange *dataRange; ///< keep the msr-file plot data range
|
PMusrCanvasPlotRange *dataRange; ///< keep the msr-file plot data range
|
||||||
UInt_t diffFourierTag; ///< 0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra)
|
UInt_t diffFourierTag; ///< 0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra)
|
||||||
} PMusrCanvasDataSet;
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@ -152,7 +152,7 @@ typedef std::vector<PMusrCanvasDataSet> PMusrCanvasDataList;
|
|||||||
* <p>Structure holding all necessary error graphs for a single plot block entry for
|
* <p>Structure holding all necessary error graphs for a single plot block entry for
|
||||||
* fit types: non-muSR fit.
|
* fit types: non-muSR fit.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMusrCanvasNonMusrDataSet {
|
||||||
TGraphErrors *data; ///< data error graph
|
TGraphErrors *data; ///< data error graph
|
||||||
TGraphErrors *dataFourierRe; ///< real part of the Fourier transform of the data error graph
|
TGraphErrors *dataFourierRe; ///< real part of the Fourier transform of the data error graph
|
||||||
TGraphErrors *dataFourierIm; ///< imaginary part of the Fourier transform of the data error graph
|
TGraphErrors *dataFourierIm; ///< imaginary part of the Fourier transform of the data error graph
|
||||||
@ -170,7 +170,7 @@ typedef struct {
|
|||||||
TGraphErrors *diffFourierPhase; ///< phase spectrum of the Fourier transform of the diff error graph
|
TGraphErrors *diffFourierPhase; ///< phase spectrum of the Fourier transform of the diff error graph
|
||||||
PMusrCanvasPlotRange *dataRange; ///< keep the msr-file plot data range
|
PMusrCanvasPlotRange *dataRange; ///< keep the msr-file plot data range
|
||||||
UInt_t diffFourierTag; ///< 0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra)
|
UInt_t diffFourierTag; ///< 0=not relevant, 1=d-f (Fourier of difference time spectra), 2=f-d (difference of Fourier spectra)
|
||||||
} PMusrCanvasNonMusrDataSet;
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
@ -182,11 +182,11 @@ typedef std::vector<PMusrCanvasNonMusrDataSet> PMusrCanvasNonMusrDataList;
|
|||||||
/**
|
/**
|
||||||
* <p> data structure needed for ascii dump within musrview.
|
* <p> data structure needed for ascii dump within musrview.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMusrCanvasAsciiDump {
|
||||||
PDoubleVector dataX; ///< x-axis data set
|
PDoubleVector dataX; ///< x-axis data set
|
||||||
PDoubleVector data; ///< y-axis data set
|
PDoubleVector data; ///< y-axis data set
|
||||||
PDoubleVector dataErr; ///< error of the y-axis data set
|
PDoubleVector dataErr; ///< error of the y-axis data set
|
||||||
} PMusrCanvasAsciiDump;
|
};
|
||||||
|
|
||||||
//------------------------------------------------------------------------
|
//------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -43,14 +43,14 @@
|
|||||||
* <p>Data structure holding raw time domain uSR data together with some
|
* <p>Data structure holding raw time domain uSR data together with some
|
||||||
* necessary meta information.
|
* necessary meta information.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct musrFT_data {
|
||||||
Int_t dataSetTag; ///< tag to label the data set. Needed for average-per-data-set
|
Int_t dataSetTag; ///< tag to label the data set. Needed for average-per-data-set
|
||||||
TString info; ///< keeps all the meta information
|
TString info; ///< keeps all the meta information
|
||||||
Double_t timeResolution; ///< time resolution in (usec)
|
Double_t timeResolution; ///< time resolution in (usec)
|
||||||
Int_t t0; ///< keep the t0 bin
|
Int_t t0; ///< keep the t0 bin
|
||||||
Double_t timeRange[2]; ///< time range to be used, given in (usec).
|
Double_t timeRange[2]; ///< time range to be used, given in (usec).
|
||||||
PDoubleVector rawData; ///< a single time domain data vector
|
PDoubleVector rawData; ///< a single time domain data vector
|
||||||
} musrFT_data;
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -43,13 +43,13 @@
|
|||||||
/**
|
/**
|
||||||
* <p>Keep a single rge table from TrimSP for a given energy.
|
* <p>Keep a single rge table from TrimSP for a given energy.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PRgeData {
|
||||||
Double_t energy;
|
Double_t energy;
|
||||||
PDoubleVector depth;
|
PDoubleVector depth;
|
||||||
PDoubleVector amplitude;
|
PDoubleVector amplitude;
|
||||||
PDoubleVector nn; // normalized int n(z) dz = 1 amplitudes
|
PDoubleVector nn; // normalized int n(z) dz = 1 amplitudes
|
||||||
Double_t noOfParticles;
|
Double_t noOfParticles;
|
||||||
} PRgeData;
|
};
|
||||||
|
|
||||||
//-----------------------------------------------------------------------------
|
//-----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -78,8 +78,9 @@ void msr2msr_syntax()
|
|||||||
* - false otherwise
|
* - false otherwise
|
||||||
*
|
*
|
||||||
* \param str msr-file line
|
* \param str msr-file line
|
||||||
|
* \param size size of str
|
||||||
*/
|
*/
|
||||||
bool msr2msr_run(char *str)
|
bool msr2msr_run(char *str, const std::size_t size)
|
||||||
{
|
{
|
||||||
// not the RUN line itself, hence nothing to be done
|
// not the RUN line itself, hence nothing to be done
|
||||||
if (!strstr(str, "RUN"))
|
if (!strstr(str, "RUN"))
|
||||||
@ -109,27 +110,27 @@ bool msr2msr_run(char *str)
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (tokens->GetEntries() == 5) { // already a new msr file, do only add the proper run comment
|
if (tokens->GetEntries() == 5) { // already a new msr file, do only add the proper run comment
|
||||||
sprintf(str, "%s (name beamline institute data-file-format)", line.Data());
|
snprintf(str, size, "%s (name beamline institute data-file-format)", line.Data());
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (run.Contains("NEMU")) {
|
if (run.Contains("NEMU")) {
|
||||||
ostr[0] = dynamic_cast<TObjString*>(tokens->At(1)); // file name
|
ostr[0] = dynamic_cast<TObjString*>(tokens->At(1)); // file name
|
||||||
sprintf(str, "RUN %s MUE4 PSI WKM (name beamline institute data-file-format)", ostr[0]->GetString().Data());
|
snprintf(str, size, "RUN %s MUE4 PSI WKM (name beamline institute data-file-format)", ostr[0]->GetString().Data());
|
||||||
} else if (run.Contains("PSI")) {
|
} else if (run.Contains("PSI")) {
|
||||||
ostr[0] = dynamic_cast<TObjString*>(tokens->At(1)); // file name
|
ostr[0] = dynamic_cast<TObjString*>(tokens->At(1)); // file name
|
||||||
ostr[1] = dynamic_cast<TObjString*>(tokens->At(2)); // beamline
|
ostr[1] = dynamic_cast<TObjString*>(tokens->At(2)); // beamline
|
||||||
sprintf(str, "RUN %s %s PSI PSI-BIN (name beamline institute data-file-format)",
|
snprintf(str, size, "RUN %s %s PSI PSI-BIN (name beamline institute data-file-format)",
|
||||||
ostr[0]->GetString().Data(), ostr[1]->GetString().Data());
|
ostr[0]->GetString().Data(), ostr[1]->GetString().Data());
|
||||||
} else if (run.Contains("TRIUMF")) {
|
} else if (run.Contains("TRIUMF")) {
|
||||||
ostr[0] = dynamic_cast<TObjString*>(tokens->At(1)); // file name
|
ostr[0] = dynamic_cast<TObjString*>(tokens->At(1)); // file name
|
||||||
ostr[1] = dynamic_cast<TObjString*>(tokens->At(2)); // beamline
|
ostr[1] = dynamic_cast<TObjString*>(tokens->At(2)); // beamline
|
||||||
sprintf(str, "RUN %s %s TRIUMF MUD (name beamline institute data-file-format)",
|
snprintf(str, size, "RUN %s %s TRIUMF MUD (name beamline institute data-file-format)",
|
||||||
ostr[0]->GetString().Data(), ostr[1]->GetString().Data());
|
ostr[0]->GetString().Data(), ostr[1]->GetString().Data());
|
||||||
} else if (run.Contains("RAL")) {
|
} else if (run.Contains("RAL")) {
|
||||||
ostr[0] = dynamic_cast<TObjString*>(tokens->At(1)); // file name
|
ostr[0] = dynamic_cast<TObjString*>(tokens->At(1)); // file name
|
||||||
ostr[1] = dynamic_cast<TObjString*>(tokens->At(2)); // beamline
|
ostr[1] = dynamic_cast<TObjString*>(tokens->At(2)); // beamline
|
||||||
sprintf(str, "RUN %s %s RAL NEXUS (name beamline institute data-file-format)",
|
snprintf(str, size, "RUN %s %s RAL NEXUS (name beamline institute data-file-format)",
|
||||||
ostr[0]->GetString().Data(), ostr[1]->GetString().Data());
|
ostr[0]->GetString().Data(), ostr[1]->GetString().Data());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -175,7 +176,7 @@ bool msr2msr_param(char *str)
|
|||||||
for (unsigned int i=0; i<4; i++)
|
for (unsigned int i=0; i<4; i++)
|
||||||
ostr[i] = dynamic_cast<TObjString*>(tokens->At(i));
|
ostr[i] = dynamic_cast<TObjString*>(tokens->At(i));
|
||||||
// number
|
// number
|
||||||
sprintf(sstr, "%10s", ostr[0]->GetString().Data());
|
snprintf(sstr, sizeof(sstr), "%10s", ostr[0]->GetString().Data());
|
||||||
// name
|
// name
|
||||||
strcat(sstr, " ");
|
strcat(sstr, " ");
|
||||||
strcat(sstr, ostr[1]->GetString().Data());
|
strcat(sstr, ostr[1]->GetString().Data());
|
||||||
@ -206,7 +207,7 @@ bool msr2msr_param(char *str)
|
|||||||
for (unsigned int i=0; i<6; i++)
|
for (unsigned int i=0; i<6; i++)
|
||||||
ostr[i] = dynamic_cast<TObjString*>(tokens->At(i));
|
ostr[i] = dynamic_cast<TObjString*>(tokens->At(i));
|
||||||
// number
|
// number
|
||||||
sprintf(sstr, "%10s", ostr[0]->GetString().Data());
|
snprintf(sstr, sizeof(sstr), "%10s", ostr[0]->GetString().Data());
|
||||||
// name
|
// name
|
||||||
strcat(sstr, " ");
|
strcat(sstr, " ");
|
||||||
strcat(sstr, ostr[1]->GetString().Data());
|
strcat(sstr, ostr[1]->GetString().Data());
|
||||||
@ -480,7 +481,7 @@ void msr2msr_replace(char *str, int paramNo)
|
|||||||
|
|
||||||
memset(temp, 0, sizeof(temp));
|
memset(temp, 0, sizeof(temp));
|
||||||
|
|
||||||
sprintf(no, "%d", paramNo);
|
snprintf(no, sizeof(no), "%d", paramNo);
|
||||||
|
|
||||||
int j=0;
|
int j=0;
|
||||||
for (unsigned int i=0; i<strlen(str); i++) {
|
for (unsigned int i=0; i<strlen(str); i++) {
|
||||||
@ -573,7 +574,7 @@ bool msr2msr_finalize_theory(char *fln, int theoryTag, int noOfAddionalParams)
|
|||||||
|
|
||||||
|
|
||||||
// cp __temp.msr fln
|
// cp __temp.msr fln
|
||||||
sprintf(str, "cp __temp.msr %s", fln);
|
snprintf(str, sizeof(str), "cp __temp.msr %s", fln);
|
||||||
if (system(str) == -1) {
|
if (system(str) == -1) {
|
||||||
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
|
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
|
||||||
return false;
|
return false;
|
||||||
@ -598,8 +599,9 @@ bool msr2msr_finalize_theory(char *fln, int theoryTag, int noOfAddionalParams)
|
|||||||
* - false otherwise
|
* - false otherwise
|
||||||
*
|
*
|
||||||
* \param str msr-file statistic block line
|
* \param str msr-file statistic block line
|
||||||
|
* \param size size of str
|
||||||
*/
|
*/
|
||||||
bool msr2msr_statistic(char *str) {
|
bool msr2msr_statistic(char *str, const std::size_t size) {
|
||||||
bool success = true;
|
bool success = true;
|
||||||
|
|
||||||
char *pstr;
|
char *pstr;
|
||||||
@ -621,7 +623,7 @@ bool msr2msr_statistic(char *str) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (success) {
|
if (success) {
|
||||||
sprintf(str, " chisq = %lf, NDF = %d, chisq/NDF = %lf", chisq, static_cast<int>(chisq/chisqred), chisqred);
|
snprintf(str, size, " chisq = %lf, NDF = %d, chisq/NDF = %lf", chisq, static_cast<int>(chisq/chisqred), chisqred);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -691,10 +693,10 @@ int main(int argc, char *argv[])
|
|||||||
success = msr2msr_theory(str, theoryTag, noOfAddionalParams);
|
success = msr2msr_theory(str, theoryTag, noOfAddionalParams);
|
||||||
break;
|
break;
|
||||||
case MSR_TAG_RUN:
|
case MSR_TAG_RUN:
|
||||||
success = msr2msr_run(str);
|
success = msr2msr_run(str, sizeof(str));
|
||||||
break;
|
break;
|
||||||
case MSR_TAG_STATISTIC:
|
case MSR_TAG_STATISTIC:
|
||||||
success = msr2msr_statistic(str);
|
success = msr2msr_statistic(str, sizeof(str));
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
break;
|
break;
|
||||||
@ -709,7 +711,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
// check if conversion seems to be OK
|
// check if conversion seems to be OK
|
||||||
if (!success) {
|
if (!success) {
|
||||||
sprintf(str, "rm -rf %s", argv[2]);
|
snprintf(str, sizeof(str), "rm -rf %s", argv[2]);
|
||||||
if (system(str) == -1) {
|
if (system(str) == -1) {
|
||||||
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
|
std::cerr << "**ERROR** cmd: " << str << " failed." << std::endl;
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -38,11 +38,11 @@
|
|||||||
#include "PVarHandler.h"
|
#include "PVarHandler.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PmuppPlotEntry {
|
||||||
int collIdx; ///< collection index
|
int collIdx; ///< collection index
|
||||||
QString xLabel; ///< x-axis label
|
QString xLabel; ///< x-axis label
|
||||||
QVector<QString> yLabel; ///< y-axis label(s)
|
QVector<QString> yLabel; ///< y-axis label(s)
|
||||||
} PmuppPlotEntry;
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -50,20 +50,20 @@
|
|||||||
#define P_MENU_ID_ABOUT 10002
|
#define P_MENU_ID_ABOUT 10002
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PDataPoint {
|
||||||
Double_t y;
|
Double_t y;
|
||||||
Double_t eYpos;
|
Double_t eYpos;
|
||||||
Double_t eYneg;
|
Double_t eYneg;
|
||||||
} PDataPoint;
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PDataCollection {
|
||||||
TString name; // collection name
|
TString name; // collection name
|
||||||
TString xLabel;
|
TString xLabel;
|
||||||
PStringVector yLabel;
|
PStringVector yLabel;
|
||||||
PDoubleVector xValue;
|
PDoubleVector xValue;
|
||||||
std::vector< std::vector<PDataPoint> > yValue;
|
std::vector< std::vector<PDataPoint> > yValue;
|
||||||
} PDataCollection;
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
class PMuppCanvas : public TObject, public TQObject
|
class PMuppCanvas : public TObject, public TQObject
|
||||||
|
@ -103,7 +103,7 @@ PMuppStartupHandler::PMuppStartupHandler()
|
|||||||
// check if the startup file is found under $HOME/.musrfit/mupp
|
// check if the startup file is found under $HOME/.musrfit/mupp
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
if (home != 0) {
|
if (home != 0) {
|
||||||
sprintf(startup_path_name, "%s/.musrfit/mupp/mupp_startup.xml", home);
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/mupp/mupp_startup.xml", home);
|
||||||
if (StartupFileExists(startup_path_name)) {
|
if (StartupFileExists(startup_path_name)) {
|
||||||
fStartupFilePath = TString(startup_path_name);
|
fStartupFilePath = TString(startup_path_name);
|
||||||
fStartupFileFound = true;
|
fStartupFileFound = true;
|
||||||
|
@ -62,7 +62,7 @@ namespace mupp
|
|||||||
Iterator line_start = get_pos(err_pos, line);
|
Iterator line_start = get_pos(err_pos, line);
|
||||||
const char *homeStr = getenv("HOME");
|
const char *homeStr = getenv("HOME");
|
||||||
char fln[1024];
|
char fln[1024];
|
||||||
sprintf(fln, "%s/.musrfit/mupp/mupp_err.log", homeStr);
|
snprintf(fln, sizeof(fln), "%s/.musrfit/mupp/mupp_err.log", homeStr);
|
||||||
std::ofstream fout(fln, std::ofstream::app);
|
std::ofstream fout(fln, std::ofstream::app);
|
||||||
if (err_pos != last) {
|
if (err_pos != last) {
|
||||||
fout << message << what << ':' << std::endl;
|
fout << message << what << ':' << std::endl;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include "PExpression.hpp"
|
#include "PExpression.hpp"
|
||||||
#include "PErrorHandler.hpp"
|
#include "PErrorHandler.hpp"
|
||||||
#include "PAnnotation.hpp"
|
#include "PAnnotation.hpp"
|
||||||
#include <boost/spirit/include/phoenix_function.hpp>
|
#include <boost/phoenix/function.hpp>
|
||||||
|
|
||||||
namespace mupp { namespace parser
|
namespace mupp { namespace parser
|
||||||
{
|
{
|
||||||
|
@ -42,9 +42,9 @@
|
|||||||
|
|
||||||
#include <boost/function.hpp>
|
#include <boost/function.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/spirit/include/phoenix_core.hpp>
|
#include <boost/phoenix/core.hpp>
|
||||||
#include <boost/spirit/include/phoenix_function.hpp>
|
#include <boost/phoenix/function.hpp>
|
||||||
#include <boost/spirit/include/phoenix_operator.hpp>
|
#include <boost/phoenix/operator.hpp>
|
||||||
|
|
||||||
namespace mupp { namespace prog {
|
namespace mupp { namespace prog {
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
#include <QDoubleValidator>
|
#include <QDoubleValidator>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QScreen>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@ -175,6 +177,12 @@ PMusrStep::PMusrStep(const char *fln, QWidget *parent) :
|
|||||||
height = 20*fParamVec.size();
|
height = 20*fParamVec.size();
|
||||||
else
|
else
|
||||||
height = 900;
|
height = 900;
|
||||||
|
// make sure that the minimal height is not larger than the screen resolution height
|
||||||
|
QScreen *screen = QGuiApplication::primaryScreen();
|
||||||
|
int hh = screen->geometry().height();
|
||||||
|
if (height > hh)
|
||||||
|
height = hh - 70;
|
||||||
|
|
||||||
setMinimumSize(400, height);
|
setMinimumSize(400, height);
|
||||||
|
|
||||||
// populate dialog
|
// populate dialog
|
||||||
@ -536,7 +544,7 @@ int PMusrStep::writeMsrFile()
|
|||||||
bool paramBlock = false;
|
bool paramBlock = false;
|
||||||
do {
|
do {
|
||||||
line = getLine(data, idx);
|
line = getLine(data, idx);
|
||||||
if ((idx == -1) || (idx == data.count())) {
|
if ((idx == -1) || (idx == data.size())) {
|
||||||
done = true;
|
done = true;
|
||||||
} else {
|
} else {
|
||||||
if (line.startsWith("FITPARAMETER")) {
|
if (line.startsWith("FITPARAMETER")) {
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
|
|
||||||
typedef struct {
|
struct PParam {
|
||||||
QString number;
|
QString number;
|
||||||
QString name;
|
QString name;
|
||||||
QString value;
|
QString value;
|
||||||
@ -46,7 +46,7 @@ typedef struct {
|
|||||||
QString posErr;
|
QString posErr;
|
||||||
QString boundLow;
|
QString boundLow;
|
||||||
QString boundHigh;
|
QString boundHigh;
|
||||||
} PParam;
|
};
|
||||||
|
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
class PModSelect : public QDialog
|
class PModSelect : public QDialog
|
||||||
|
@ -70,13 +70,13 @@
|
|||||||
#define T0_ENTER_WIZ 2
|
#define T0_ENTER_WIZ 2
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PParamGui {
|
||||||
QLineEdit *paramName;
|
QLineEdit *paramName;
|
||||||
QLineEdit *paramVal;
|
QLineEdit *paramVal;
|
||||||
QLineEdit *paramStep;
|
QLineEdit *paramStep;
|
||||||
QLineEdit *paramBoundLow;
|
QLineEdit *paramBoundLow;
|
||||||
QLineEdit *paramBoundHigh;
|
QLineEdit *paramBoundHigh;
|
||||||
} PParamGui;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
class PMsrData
|
class PMsrData
|
||||||
@ -192,7 +192,7 @@ class PIntroPage : public QWizardPage
|
|||||||
PIntroPage(PAdmin *admin, PMsrData *data, QWidget *parent=0);
|
PIntroPage(PAdmin *admin, PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleInstituteChanged(int idx);
|
void handleInstituteChanged(int idx);
|
||||||
@ -223,8 +223,8 @@ class PTheoPage : public QWizardPage
|
|||||||
PTheoPage(PAdmin *admin, PMsrData *data, QWidget *parent=0);
|
PTheoPage(PAdmin *admin, PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void templateState(int);
|
void templateState(int);
|
||||||
@ -269,9 +269,9 @@ class PFuncPage : public QWizardPage
|
|||||||
PFuncPage(PMsrData *data, QWidget *parent=0);
|
PFuncPage(PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
void cleanupPage();
|
void cleanupPage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showTheo();
|
void showTheo();
|
||||||
@ -295,8 +295,8 @@ class PMapPage : public QWizardPage
|
|||||||
PMapPage(PMsrData *data, QWidget *parent=0);
|
PMapPage(PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showTheo();
|
void showTheo();
|
||||||
@ -318,8 +318,8 @@ class PParamPage : public QWizardPage
|
|||||||
PParamPage(PMsrData *data, QWidget *parent=0);
|
PParamPage(PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showTheo();
|
void showTheo();
|
||||||
@ -341,8 +341,8 @@ class PFitInfoPage : public QWizardPage
|
|||||||
PFitInfoPage(PMsrData *data, QWidget *parent=0);
|
PFitInfoPage(PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PMsrData *fMsrData;
|
PMsrData *fMsrData;
|
||||||
|
@ -67,9 +67,9 @@ class PParam {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PFunc {
|
||||||
int number;
|
int number;
|
||||||
QString fun;
|
QString fun;
|
||||||
} PFunc;
|
};
|
||||||
|
|
||||||
#endif // _MUSRWIZ_H_
|
#endif // _MUSRWIZ_H_
|
||||||
|
@ -45,14 +45,14 @@ class PAdmin;
|
|||||||
* <p>This structure is keeping informations necessary to handle musrfit
|
* <p>This structure is keeping informations necessary to handle musrfit
|
||||||
* theory functions (see also <code>http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-theory-block</code>).
|
* theory functions (see also <code>http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-theory-block</code>).
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PTheory {
|
||||||
QString name;
|
QString name;
|
||||||
QString comment;
|
QString comment;
|
||||||
QString label;
|
QString label;
|
||||||
QString pixmapName;
|
QString pixmapName;
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
int params;
|
int params;
|
||||||
} PTheory;
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -103,7 +103,7 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>returns the msr2data relavant parameters from the GUI.
|
* <p>returns the msr2data relevant parameters from the GUI.
|
||||||
*/
|
*/
|
||||||
PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
|
PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
|
||||||
{
|
{
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QRegExp>
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
@ -2287,7 +2288,11 @@ void PTextEdit::musrMsr2Data()
|
|||||||
// parameter export list
|
// parameter export list
|
||||||
if (!fMsr2DataParam->paramList.isEmpty()) {
|
if (!fMsr2DataParam->paramList.isEmpty()) {
|
||||||
cmd.append("paramList");
|
cmd.append("paramList");
|
||||||
QStringList list = fMsr2DataParam->paramList.split(' ');
|
#if (QT_VERSION < QT_VERSION_CHECK(5, 14, 0))
|
||||||
|
QStringList list = fMsr2DataParam->paramList.split(QRegExp("[(\\s|,|;)]"), QString::SkipEmptyParts);
|
||||||
|
#else
|
||||||
|
QStringList list = fMsr2DataParam->paramList.split(QRegExp("[(\\s|,|;)]"), Qt::SkipEmptyParts);
|
||||||
|
#endif
|
||||||
for (int i=0; i<list.size(); i++)
|
for (int i=0; i<list.size(); i++)
|
||||||
cmd.append(list[i]);
|
cmd.append(list[i]);
|
||||||
}
|
}
|
||||||
@ -2859,13 +2864,16 @@ void PTextEdit::musrSwapMsrMlog()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (QMessageBox::information(this, "INFO",
|
||||||
|
QString("Will now swap files: %1 <-> %2").arg(currentFileName).arg(swapFileName),
|
||||||
|
QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
||||||
|
return;
|
||||||
|
|
||||||
// check if the file needs to be saved
|
// check if the file needs to be saved
|
||||||
if (fTabWidget->tabText(fTabWidget->currentIndex()).indexOf("*") > 0) { // needs to be saved first
|
if (fTabWidget->tabText(fTabWidget->currentIndex()).indexOf("*") > 0) { // needs to be saved first
|
||||||
fileSave();
|
fileSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
QMessageBox::information(nullptr, "INFO", QString("Will now swap files: %1 <-> %2").arg(currentFileName).arg(swapFileName));
|
|
||||||
|
|
||||||
// swap files
|
// swap files
|
||||||
|
|
||||||
// copy currentFile -> tempFile
|
// copy currentFile -> tempFile
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
* parameters to handle <code>msr2data</code>. For a detailed description of the meaning of these
|
* parameters to handle <code>msr2data</code>. For a detailed description of the meaning of these
|
||||||
* parameters see <code>msr2data --help</code> and the online documentation.
|
* parameters see <code>msr2data --help</code> and the online documentation.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMsr2DataParam {
|
||||||
QString runList; ///< list of run numbers (usage 3 of msr2data)
|
QString runList; ///< list of run numbers (usage 3 of msr2data)
|
||||||
QString runListFileName; ///< run list filename (usage 4 of msr2data)
|
QString runListFileName; ///< run list filename (usage 4 of msr2data)
|
||||||
QString msrFileExtension; ///< msr filename extension, e.g. '0100_h13.msr' -> '_h13'
|
QString msrFileExtension; ///< msr filename extension, e.g. '0100_h13.msr' -> '_h13'
|
||||||
@ -61,13 +61,13 @@ typedef struct {
|
|||||||
bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).
|
bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).
|
||||||
bool global; ///< flag: true = 'global' option
|
bool global; ///< flag: true = 'global' option
|
||||||
bool globalPlus; ///< flag: true = 'global+' option
|
bool globalPlus; ///< flag: true = 'global+' option
|
||||||
} PMsr2DataParam;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* This structure is used to handle find (and replace) within <code>musredit</code> properly.
|
* This structure is used to handle find (and replace) within <code>musredit</code> properly.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PFindReplaceData {
|
||||||
QString findText; ///< text to be found
|
QString findText; ///< text to be found
|
||||||
QString replaceText; ///< replacement string
|
QString replaceText; ///< replacement string
|
||||||
bool caseSensitive; ///< true = case sensitive
|
bool caseSensitive; ///< true = case sensitive
|
||||||
@ -76,6 +76,6 @@ typedef struct {
|
|||||||
bool findBackwards; ///< true = reversed search
|
bool findBackwards; ///< true = reversed search
|
||||||
bool selectedText; ///< true = handle only the selected text
|
bool selectedText; ///< true = handle only the selected text
|
||||||
bool promptOnReplace; ///< true = request on OK from the user before performing the replace action
|
bool promptOnReplace; ///< true = request on OK from the user before performing the replace action
|
||||||
} PFindReplaceData;
|
};
|
||||||
|
|
||||||
#endif // _MUSREDIT_H_
|
#endif // _MUSREDIT_H_
|
||||||
|
@ -42,18 +42,18 @@ set(GENERATED_HEADER_FILES
|
|||||||
set_property(SOURCE mupp_version.h PROPERTY SKIP_AUTOMOC ON) # needed for cmake 3.x
|
set_property(SOURCE mupp_version.h PROPERTY SKIP_AUTOMOC ON) # needed for cmake 3.x
|
||||||
|
|
||||||
set(MUPP_SOURCE_FILES
|
set(MUPP_SOURCE_FILES
|
||||||
mupp.cpp
|
mupp.cpp
|
||||||
PmuppAdmin.cpp
|
PmuppAdmin.cpp
|
||||||
Pmupp.cpp
|
Pmupp.cpp
|
||||||
PmuppScript.cpp
|
PmuppScript.cpp
|
||||||
PmuppGui.cpp
|
PmuppGui.cpp
|
||||||
PVarDialog.cpp
|
PVarDialog.cpp
|
||||||
)
|
)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
set(RESOURCE_FILES icons/mupp.icns)
|
set(RESOURCE_FILES icons/mupp.icns)
|
||||||
add_executable(mupp
|
add_executable(mupp
|
||||||
MACOSX_BUNDLE ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES}
|
MACOSX_BUNDLE ${GENERATED_HEADER_FILES} ${MUPP_SOURCE_FILES}
|
||||||
mupp.qrc ${RESOURCE_FILES}
|
mupp.qrc ${RESOURCE_FILES}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
@ -62,24 +62,24 @@ endif (APPLE)
|
|||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
||||||
else (IS_GIT_REPO)
|
else (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
#--- compiler option to workaround a little cast problem for some
|
#--- compiler option to workaround a little cast problem for some
|
||||||
#--- boost/compiler combinations ----------------------------------------------
|
#--- boost/compiler combinations ----------------------------------------------
|
||||||
target_compile_options(mupp
|
target_compile_options(mupp
|
||||||
PRIVATE
|
PRIVATE
|
||||||
"-fpermissive"
|
"-fpermissive"
|
||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
#--- add the variable related sources -----------------------------------------
|
#--- add the variable related sources -----------------------------------------
|
||||||
add_subdirectory(var)
|
add_subdirectory(var)
|
||||||
|
|
||||||
#--- add the necessary header includes ----------------------------------------
|
#--- add the necessary header includes ----------------------------------------
|
||||||
target_include_directories(mupp
|
target_include_directories(mupp
|
||||||
BEFORE PRIVATE
|
BEFORE PRIVATE
|
||||||
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
|
||||||
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../..>
|
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}/../..>
|
||||||
@ -104,6 +104,7 @@ if (APPLE)
|
|||||||
MACOSX_FRAMEWORK_IDENTIFIER ch.psi.mupp
|
MACOSX_FRAMEWORK_IDENTIFIER ch.psi.mupp
|
||||||
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
||||||
RESOURCE "${RESOURCE_FILES}"
|
RESOURCE "${RESOURCE_FILES}"
|
||||||
|
INSTALL_RPATH "${Qt6_DIR}/../.."
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
|
@ -38,11 +38,11 @@
|
|||||||
#include "PVarHandler.h"
|
#include "PVarHandler.h"
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PmuppPlotEntry {
|
||||||
int collIdx; ///< collection index
|
int collIdx; ///< collection index
|
||||||
QString xLabel; ///< x-axis label
|
QString xLabel; ///< x-axis label
|
||||||
QVector<QString> yLabel; ///< y-axis label(s)
|
QVector<QString> yLabel; ///< y-axis label(s)
|
||||||
} PmuppPlotEntry;
|
};
|
||||||
|
|
||||||
//----------------------------------------------------------------------------
|
//----------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -50,20 +50,20 @@
|
|||||||
#define P_MENU_ID_ABOUT 10002
|
#define P_MENU_ID_ABOUT 10002
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PDataPoint {
|
||||||
Double_t y;
|
Double_t y;
|
||||||
Double_t eYpos;
|
Double_t eYpos;
|
||||||
Double_t eYneg;
|
Double_t eYneg;
|
||||||
} PDataPoint;
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PDataCollection {
|
||||||
TString name; // collection name
|
TString name; // collection name
|
||||||
TString xLabel;
|
TString xLabel;
|
||||||
PStringVector yLabel;
|
PStringVector yLabel;
|
||||||
PDoubleVector xValue;
|
PDoubleVector xValue;
|
||||||
std::vector< std::vector<PDataPoint> > yValue;
|
std::vector< std::vector<PDataPoint> > yValue;
|
||||||
} PDataCollection;
|
};
|
||||||
|
|
||||||
//--------------------------------------------------------------------------
|
//--------------------------------------------------------------------------
|
||||||
class PMuppCanvas : public TObject, public TQObject
|
class PMuppCanvas : public TObject, public TQObject
|
||||||
|
@ -103,7 +103,7 @@ PMuppStartupHandler::PMuppStartupHandler()
|
|||||||
// check if the startup file is found under $HOME/.musrfit/mupp
|
// check if the startup file is found under $HOME/.musrfit/mupp
|
||||||
home = getenv("HOME");
|
home = getenv("HOME");
|
||||||
if (home != 0) {
|
if (home != 0) {
|
||||||
sprintf(startup_path_name, "%s/.musrfit/mupp/mupp_startup.xml", home);
|
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/mupp/mupp_startup.xml", home);
|
||||||
if (StartupFileExists(startup_path_name)) {
|
if (StartupFileExists(startup_path_name)) {
|
||||||
fStartupFilePath = TString(startup_path_name);
|
fStartupFilePath = TString(startup_path_name);
|
||||||
fStartupFileFound = true;
|
fStartupFileFound = true;
|
||||||
|
@ -62,7 +62,7 @@ namespace mupp
|
|||||||
Iterator line_start = get_pos(err_pos, line);
|
Iterator line_start = get_pos(err_pos, line);
|
||||||
const char *homeStr = getenv("HOME");
|
const char *homeStr = getenv("HOME");
|
||||||
char fln[1024];
|
char fln[1024];
|
||||||
sprintf(fln, "%s/.musrfit/mupp/mupp_err.log", homeStr);
|
snprintf(fln, sizeof(fln), "%s/.musrfit/mupp/mupp_err.log", homeStr);
|
||||||
std::ofstream fout(fln, std::ofstream::app);
|
std::ofstream fout(fln, std::ofstream::app);
|
||||||
if (err_pos != last) {
|
if (err_pos != last) {
|
||||||
fout << message << what << ':' << std::endl;
|
fout << message << what << ':' << std::endl;
|
||||||
|
@ -33,7 +33,7 @@
|
|||||||
#include "PExpression.hpp"
|
#include "PExpression.hpp"
|
||||||
#include "PErrorHandler.hpp"
|
#include "PErrorHandler.hpp"
|
||||||
#include "PAnnotation.hpp"
|
#include "PAnnotation.hpp"
|
||||||
#include <boost/spirit/include/phoenix_function.hpp>
|
#include <boost/phoenix/function.hpp>
|
||||||
|
|
||||||
namespace mupp { namespace parser
|
namespace mupp { namespace parser
|
||||||
{
|
{
|
||||||
|
@ -42,9 +42,9 @@
|
|||||||
|
|
||||||
#include <boost/function.hpp>
|
#include <boost/function.hpp>
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
#include <boost/spirit/include/phoenix_core.hpp>
|
#include <boost/phoenix/core.hpp>
|
||||||
#include <boost/spirit/include/phoenix_function.hpp>
|
#include <boost/phoenix/function.hpp>
|
||||||
#include <boost/spirit/include/phoenix_operator.hpp>
|
#include <boost/phoenix/operator.hpp>
|
||||||
|
|
||||||
namespace mupp { namespace prog {
|
namespace mupp { namespace prog {
|
||||||
///////////////////////////////////////////////////////////////////////////
|
///////////////////////////////////////////////////////////////////////////
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
||||||
else (IS_GIT_REPO)
|
else (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
#--- instruct CMake to run moc automatically when needed ----------------------
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
@ -29,7 +29,7 @@ if (APPLE)
|
|||||||
${macosx_icon}
|
${macosx_icon}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(musrStep
|
add_executable(musrStep
|
||||||
${musrStep_src}
|
${musrStep_src}
|
||||||
musrStep.qrc
|
musrStep.qrc
|
||||||
)
|
)
|
||||||
@ -46,7 +46,7 @@ target_include_directories(musrStep
|
|||||||
|
|
||||||
target_compile_options(musrStep
|
target_compile_options(musrStep
|
||||||
PRIVATE
|
PRIVATE
|
||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(musrStep PRIVATE ${qt_libs})
|
target_link_libraries(musrStep PRIVATE ${qt_libs})
|
||||||
@ -62,6 +62,7 @@ if (APPLE)
|
|||||||
MACOSX_BUNDLE_GUI_IDENTIFIER "ch.psi.lmu.musrStep"
|
MACOSX_BUNDLE_GUI_IDENTIFIER "ch.psi.lmu.musrStep"
|
||||||
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
||||||
RESOURCE ${macosx_icon}
|
RESOURCE ${macosx_icon}
|
||||||
|
INSTALL_RPATH "${Qt6_DIR}/../.."
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
@ -74,4 +75,3 @@ else (APPLE)
|
|||||||
RUNTIME DESTINATION bin
|
RUNTIME DESTINATION bin
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
|
@ -39,6 +39,8 @@
|
|||||||
#include <QDoubleValidator>
|
#include <QDoubleValidator>
|
||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QPixmap>
|
#include <QPixmap>
|
||||||
|
#include <QGuiApplication>
|
||||||
|
#include <QScreen>
|
||||||
|
|
||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
|
|
||||||
@ -175,6 +177,11 @@ PMusrStep::PMusrStep(const char *fln, QWidget *parent) :
|
|||||||
height = 20*fParamVec.size();
|
height = 20*fParamVec.size();
|
||||||
else
|
else
|
||||||
height = 900;
|
height = 900;
|
||||||
|
// make sure that the minimal height is not larger than the screen resolution height
|
||||||
|
QScreen *screen = QGuiApplication::primaryScreen();
|
||||||
|
int hh = screen->geometry().height();
|
||||||
|
if (height > hh)
|
||||||
|
height = hh - 70;
|
||||||
setMinimumSize(400, height);
|
setMinimumSize(400, height);
|
||||||
|
|
||||||
// populate dialog
|
// populate dialog
|
||||||
@ -532,7 +539,7 @@ int PMusrStep::writeMsrFile()
|
|||||||
bool paramBlock = false;
|
bool paramBlock = false;
|
||||||
do {
|
do {
|
||||||
line = getLine(data, idx);
|
line = getLine(data, idx);
|
||||||
if ((idx == -1) || (idx == data.count())) {
|
if ((idx == -1) || (idx == data.size())) {
|
||||||
done = true;
|
done = true;
|
||||||
} else {
|
} else {
|
||||||
if (line.startsWith("FITPARAMETER")) {
|
if (line.startsWith("FITPARAMETER")) {
|
||||||
|
@ -38,7 +38,7 @@
|
|||||||
#include <QLabel>
|
#include <QLabel>
|
||||||
#include <QCheckBox>
|
#include <QCheckBox>
|
||||||
|
|
||||||
typedef struct {
|
struct PParam {
|
||||||
QString number;
|
QString number;
|
||||||
QString name;
|
QString name;
|
||||||
QString value;
|
QString value;
|
||||||
@ -46,7 +46,7 @@ typedef struct {
|
|||||||
QString posErr;
|
QString posErr;
|
||||||
QString boundLow;
|
QString boundLow;
|
||||||
QString boundHigh;
|
QString boundHigh;
|
||||||
} PParam;
|
};
|
||||||
|
|
||||||
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
|
||||||
class PModSelect : public QDialog
|
class PModSelect : public QDialog
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
||||||
else (IS_GIT_REPO)
|
else (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
#--- instruct CMake to run moc automatically when needed ----------------------
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
@ -30,10 +30,10 @@ if (APPLE)
|
|||||||
add_executable(musrWiz MACOSX_BUNDLE
|
add_executable(musrWiz MACOSX_BUNDLE
|
||||||
${musrWiz_src}
|
${musrWiz_src}
|
||||||
musrWiz.qrc
|
musrWiz.qrc
|
||||||
${macosx_icon}
|
${macosx_icon}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(musrWiz
|
add_executable(musrWiz
|
||||||
${musrWiz_src}
|
${musrWiz_src}
|
||||||
musrWiz.qrc
|
musrWiz.qrc
|
||||||
)
|
)
|
||||||
@ -50,7 +50,7 @@ target_include_directories(musrWiz
|
|||||||
|
|
||||||
target_compile_options(musrWiz
|
target_compile_options(musrWiz
|
||||||
PRIVATE
|
PRIVATE
|
||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(musrWiz PRIVATE ${qt_libs})
|
target_link_libraries(musrWiz PRIVATE ${qt_libs})
|
||||||
@ -66,6 +66,7 @@ if (APPLE)
|
|||||||
MACOSX_BUNDLE_GUI_IDENTIFIER "ch.psi.lmu.musrWiz"
|
MACOSX_BUNDLE_GUI_IDENTIFIER "ch.psi.lmu.musrWiz"
|
||||||
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
||||||
RESOURCE ${macosx_icon}
|
RESOURCE ${macosx_icon}
|
||||||
|
INSTALL_RPATH "${Qt6_DIR}/../.."
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
|
@ -70,13 +70,13 @@
|
|||||||
#define T0_ENTER_WIZ 2
|
#define T0_ENTER_WIZ 2
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PParamGui {
|
||||||
QLineEdit *paramName;
|
QLineEdit *paramName;
|
||||||
QLineEdit *paramVal;
|
QLineEdit *paramVal;
|
||||||
QLineEdit *paramStep;
|
QLineEdit *paramStep;
|
||||||
QLineEdit *paramBoundLow;
|
QLineEdit *paramBoundLow;
|
||||||
QLineEdit *paramBoundHigh;
|
QLineEdit *paramBoundHigh;
|
||||||
} PParamGui;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
class PMsrData
|
class PMsrData
|
||||||
@ -192,7 +192,7 @@ class PIntroPage : public QWizardPage
|
|||||||
PIntroPage(PAdmin *admin, PMsrData *data, QWidget *parent=0);
|
PIntroPage(PAdmin *admin, PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void handleInstituteChanged(int idx);
|
void handleInstituteChanged(int idx);
|
||||||
@ -223,8 +223,8 @@ class PTheoPage : public QWizardPage
|
|||||||
PTheoPage(PAdmin *admin, PMsrData *data, QWidget *parent=0);
|
PTheoPage(PAdmin *admin, PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void templateState(int);
|
void templateState(int);
|
||||||
@ -269,9 +269,9 @@ class PFuncPage : public QWizardPage
|
|||||||
PFuncPage(PMsrData *data, QWidget *parent=0);
|
PFuncPage(PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
void cleanupPage();
|
void cleanupPage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showTheo();
|
void showTheo();
|
||||||
@ -295,8 +295,8 @@ class PMapPage : public QWizardPage
|
|||||||
PMapPage(PMsrData *data, QWidget *parent=0);
|
PMapPage(PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showTheo();
|
void showTheo();
|
||||||
@ -318,8 +318,8 @@ class PParamPage : public QWizardPage
|
|||||||
PParamPage(PMsrData *data, QWidget *parent=0);
|
PParamPage(PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void showTheo();
|
void showTheo();
|
||||||
@ -341,8 +341,8 @@ class PFitInfoPage : public QWizardPage
|
|||||||
PFitInfoPage(PMsrData *data, QWidget *parent=0);
|
PFitInfoPage(PMsrData *data, QWidget *parent=0);
|
||||||
|
|
||||||
int nextId() const Q_DECL_OVERRIDE;
|
int nextId() const Q_DECL_OVERRIDE;
|
||||||
void initializePage();
|
void initializePage() override;
|
||||||
bool validatePage();
|
bool validatePage() override;
|
||||||
|
|
||||||
private:
|
private:
|
||||||
PMsrData *fMsrData;
|
PMsrData *fMsrData;
|
||||||
|
@ -67,9 +67,9 @@ class PParam {
|
|||||||
};
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------
|
//-------------------------------------------------------------------
|
||||||
typedef struct {
|
struct PFunc {
|
||||||
int number;
|
int number;
|
||||||
QString fun;
|
QString fun;
|
||||||
} PFunc;
|
};
|
||||||
|
|
||||||
#endif // _MUSRWIZ_H_
|
#endif // _MUSRWIZ_H_
|
||||||
|
@ -2,9 +2,9 @@
|
|||||||
|
|
||||||
#--- check if project source is repo ------------------------------------------
|
#--- check if project source is repo ------------------------------------------
|
||||||
if (IS_GIT_REPO)
|
if (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
|
||||||
else (IS_GIT_REPO)
|
else (IS_GIT_REPO)
|
||||||
set(HAVE_GIT_REV_H "")
|
set(HAVE_GIT_REV_H "")
|
||||||
endif (IS_GIT_REPO)
|
endif (IS_GIT_REPO)
|
||||||
|
|
||||||
#--- instruct CMake to run moc automatically when needed ----------------------
|
#--- instruct CMake to run moc automatically when needed ----------------------
|
||||||
@ -63,7 +63,7 @@ set(musredit_ui
|
|||||||
forms/PGetFourierBlockDialog.ui
|
forms/PGetFourierBlockDialog.ui
|
||||||
forms/PGetPlotBlockDialog.ui
|
forms/PGetPlotBlockDialog.ui
|
||||||
forms/PMsr2DataDialog.ui
|
forms/PMsr2DataDialog.ui
|
||||||
forms/PChangeDefaultPathsDialog.ui
|
forms/PChangeDefaultPathsDialog.ui
|
||||||
)
|
)
|
||||||
|
|
||||||
if (APPLE)
|
if (APPLE)
|
||||||
@ -72,7 +72,7 @@ if (APPLE)
|
|||||||
else()
|
else()
|
||||||
set(macosx_icon_name musredit.icns)
|
set(macosx_icon_name musredit.icns)
|
||||||
endif()
|
endif()
|
||||||
set(macosx_icon "icons/${macosx_icon_name}")
|
set(macosx_icon "icons/${macosx_icon_name}")
|
||||||
add_executable(musredit MACOSX_BUNDLE
|
add_executable(musredit MACOSX_BUNDLE
|
||||||
${musredit_src}
|
${musredit_src}
|
||||||
${musredit_ui}
|
${musredit_ui}
|
||||||
@ -80,7 +80,7 @@ if (APPLE)
|
|||||||
${macosx_icon}
|
${macosx_icon}
|
||||||
)
|
)
|
||||||
else (APPLE)
|
else (APPLE)
|
||||||
add_executable(musredit
|
add_executable(musredit
|
||||||
${musredit_src}
|
${musredit_src}
|
||||||
${musredit_ui}
|
${musredit_ui}
|
||||||
musredit.qrc
|
musredit.qrc
|
||||||
@ -99,7 +99,7 @@ target_include_directories(musredit
|
|||||||
|
|
||||||
target_compile_options(musredit
|
target_compile_options(musredit
|
||||||
PRIVATE
|
PRIVATE
|
||||||
"${HAVE_GIT_REV_H}"
|
"${HAVE_GIT_REV_H}"
|
||||||
)
|
)
|
||||||
|
|
||||||
target_link_libraries(musredit PRIVATE ${qt_libs})
|
target_link_libraries(musredit PRIVATE ${qt_libs})
|
||||||
@ -115,6 +115,7 @@ if (APPLE)
|
|||||||
MACOSX_BUNDLE_GUI_IDENTIFIER "ch.psi.lmu.musredit"
|
MACOSX_BUNDLE_GUI_IDENTIFIER "ch.psi.lmu.musredit"
|
||||||
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
MACOSX_BUNDLE_COPYRIGHT "Andreas Suter"
|
||||||
RESOURCE ${macosx_icon}
|
RESOURCE ${macosx_icon}
|
||||||
|
INSTALL_RPATH "${Qt6_DIR}/../.."
|
||||||
)
|
)
|
||||||
endif (APPLE)
|
endif (APPLE)
|
||||||
|
|
||||||
@ -138,4 +139,3 @@ install(
|
|||||||
${CMAKE_INSTALL_PREFIX}/share/doc/musrfit
|
${CMAKE_INSTALL_PREFIX}/share/doc/musrfit
|
||||||
MESSAGE_NEVER
|
MESSAGE_NEVER
|
||||||
)
|
)
|
||||||
|
|
||||||
|
@ -45,14 +45,14 @@ class PAdmin;
|
|||||||
* <p>This structure is keeping informations necessary to handle musrfit
|
* <p>This structure is keeping informations necessary to handle musrfit
|
||||||
* theory functions (see also <code>http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-theory-block</code>).
|
* theory functions (see also <code>http://lmu.web.psi.ch/musrfit/user/html/user-manual.html#the-theory-block</code>).
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PTheory {
|
||||||
QString name;
|
QString name;
|
||||||
QString comment;
|
QString comment;
|
||||||
QString label;
|
QString label;
|
||||||
QString pixmapName;
|
QString pixmapName;
|
||||||
QPixmap pixmap;
|
QPixmap pixmap;
|
||||||
int params;
|
int params;
|
||||||
} PTheory;
|
};
|
||||||
|
|
||||||
//---------------------------------------------------------------------------
|
//---------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
|
@ -103,7 +103,7 @@ PMsr2DataDialog::PMsr2DataDialog(PMsr2DataParam *msr2DataParam, const QString he
|
|||||||
|
|
||||||
//----------------------------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* <p>returns the msr2data relavant parameters from the GUI.
|
* <p>returns the msr2data relevant parameters from the GUI.
|
||||||
*/
|
*/
|
||||||
PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
|
PMsr2DataParam* PMsr2DataDialog::getMsr2DataParam()
|
||||||
{
|
{
|
||||||
|
@ -61,6 +61,7 @@
|
|||||||
#include <QFileSystemWatcher>
|
#include <QFileSystemWatcher>
|
||||||
#include <QDesktopServices>
|
#include <QDesktopServices>
|
||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#include <QtDebug>
|
#include <QtDebug>
|
||||||
|
|
||||||
@ -2288,7 +2289,7 @@ void PTextEdit::musrMsr2Data()
|
|||||||
// parameter export list
|
// parameter export list
|
||||||
if (!fMsr2DataParam->paramList.isEmpty()) {
|
if (!fMsr2DataParam->paramList.isEmpty()) {
|
||||||
cmd.append("paramList");
|
cmd.append("paramList");
|
||||||
QStringList list = fMsr2DataParam->paramList.split(' ');
|
QStringList list = fMsr2DataParam->paramList.split(QRegularExpression("[(\\s|,|;)]"), Qt::SkipEmptyParts);
|
||||||
for (int i=0; i<list.size(); i++)
|
for (int i=0; i<list.size(); i++)
|
||||||
cmd.append(list[i]);
|
cmd.append(list[i]);
|
||||||
}
|
}
|
||||||
@ -2848,13 +2849,16 @@ void PTextEdit::musrSwapMsrMlog()
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (QMessageBox::information(this, "INFO",
|
||||||
|
QString("Will now swap files: %1 <-> %2").arg(currentFileName).arg(swapFileName),
|
||||||
|
QMessageBox::Ok, QMessageBox::Cancel) == QMessageBox::Cancel)
|
||||||
|
return;
|
||||||
|
|
||||||
// check if the file needs to be saved
|
// check if the file needs to be saved
|
||||||
if (fTabWidget->tabText(fTabWidget->currentIndex()).indexOf("*") > 0) { // needs to be saved first
|
if (fTabWidget->tabText(fTabWidget->currentIndex()).indexOf("*") > 0) { // needs to be saved first
|
||||||
fileSave();
|
fileSave();
|
||||||
}
|
}
|
||||||
|
|
||||||
QMessageBox::information(nullptr, "INFO", QString("Will now swap files: %1 <-> %2").arg(currentFileName).arg(swapFileName));
|
|
||||||
|
|
||||||
// swap files
|
// swap files
|
||||||
|
|
||||||
// copy currentFile -> tempFile
|
// copy currentFile -> tempFile
|
||||||
|
@ -40,7 +40,7 @@
|
|||||||
* parameters to handle <code>msr2data</code>. For a detailed description of the meaning of these
|
* parameters to handle <code>msr2data</code>. For a detailed description of the meaning of these
|
||||||
* parameters see <code>msr2data --help</code> and the online documentation.
|
* parameters see <code>msr2data --help</code> and the online documentation.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PMsr2DataParam {
|
||||||
QString runList; ///< list of run numbers (usage 3 of msr2data)
|
QString runList; ///< list of run numbers (usage 3 of msr2data)
|
||||||
QString runListFileName; ///< run list filename (usage 4 of msr2data)
|
QString runListFileName; ///< run list filename (usage 4 of msr2data)
|
||||||
QString msrFileExtension; ///< msr filename extension, e.g. '0100_h13.msr' -> '_h13'
|
QString msrFileExtension; ///< msr filename extension, e.g. '0100_h13.msr' -> '_h13'
|
||||||
@ -61,13 +61,13 @@ typedef struct {
|
|||||||
bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).
|
bool fitOnly; ///< flag: true = just perform the fits wihtout generating any msr-files ('fit' in msr2data).
|
||||||
bool global; ///< flag: true = 'global' option
|
bool global; ///< flag: true = 'global' option
|
||||||
bool globalPlus; ///< flag: true = 'global+' option
|
bool globalPlus; ///< flag: true = 'global+' option
|
||||||
} PMsr2DataParam;
|
};
|
||||||
|
|
||||||
//-------------------------------------------------------------------------------------------------
|
//-------------------------------------------------------------------------------------------------
|
||||||
/**
|
/**
|
||||||
* This structure is used to handle find (and replace) within <code>musredit</code> properly.
|
* This structure is used to handle find (and replace) within <code>musredit</code> properly.
|
||||||
*/
|
*/
|
||||||
typedef struct {
|
struct PFindReplaceData {
|
||||||
QString findText; ///< text to be found
|
QString findText; ///< text to be found
|
||||||
QString replaceText; ///< replacement string
|
QString replaceText; ///< replacement string
|
||||||
bool caseSensitive; ///< true = case sensitive
|
bool caseSensitive; ///< true = case sensitive
|
||||||
@ -76,6 +76,6 @@ typedef struct {
|
|||||||
bool findBackwards; ///< true = reversed search
|
bool findBackwards; ///< true = reversed search
|
||||||
bool selectedText; ///< true = handle only the selected text
|
bool selectedText; ///< true = handle only the selected text
|
||||||
bool promptOnReplace; ///< true = request on OK from the user before performing the replace action
|
bool promptOnReplace; ///< true = request on OK from the user before performing the replace action
|
||||||
} PFindReplaceData;
|
};
|
||||||
|
|
||||||
#endif // _MUSREDIT_H_
|
#endif // _MUSREDIT_H_
|
||||||
|
@ -283,10 +283,10 @@ void musrfit_write_root(TFile &f, TString fln, PRunData *data, int runCounter)
|
|||||||
char name[128];
|
char name[128];
|
||||||
|
|
||||||
TString title = fln.Copy();
|
TString title = fln.Copy();
|
||||||
sprintf(name, "_%d", runCounter);
|
snprintf(name, sizeof(name), "_%d", runCounter);
|
||||||
title.ReplaceAll(".root", name);
|
title.ReplaceAll(".root", name);
|
||||||
|
|
||||||
sprintf(name, "c%d", runCounter);
|
snprintf(name, sizeof(name),"c%d", runCounter);
|
||||||
|
|
||||||
TCanvas *c = new TCanvas(name, title.Data(), 10, 10, 800, 600);
|
TCanvas *c = new TCanvas(name, title.Data(), 10, 10, 800, 600);
|
||||||
|
|
||||||
|
@ -85,7 +85,7 @@ PDumpOutputHandler::~PDumpOutputHandler()
|
|||||||
}
|
}
|
||||||
if (fProc->isRunning()) { // try low level kill
|
if (fProc->isRunning()) { // try low level kill
|
||||||
char cmd[128];
|
char cmd[128];
|
||||||
sprintf(cmd, "kill -9 %ld", fProcPID);
|
snprintf(cmd, sizeof(cnd), "kill -9 %ld", fProcPID);
|
||||||
system(cmd);
|
system(cmd);
|
||||||
}
|
}
|
||||||
if (fProc) {
|
if (fProc) {
|
||||||
|
@ -88,7 +88,7 @@ PFitOutputHandler::~PFitOutputHandler()
|
|||||||
}
|
}
|
||||||
if (fProc->isRunning()) { // try low level kill
|
if (fProc->isRunning()) { // try low level kill
|
||||||
char cmd[128];
|
char cmd[128];
|
||||||
sprintf(cmd, "kill -9 %ld", fProcPID);
|
snprintf(cmd, sizeof(cmd), "kill -9 %ld", fProcPID);
|
||||||
system(cmd);
|
system(cmd);
|
||||||
}
|
}
|
||||||
if (fProc) {
|
if (fProc) {
|
||||||
|
@ -396,7 +396,7 @@ int main(int argc, char *argv[])
|
|||||||
char canvasName[32];
|
char canvasName[32];
|
||||||
for (unsigned int i=0; i<canvasVector.size(); i++) {
|
for (unsigned int i=0; i<canvasVector.size(); i++) {
|
||||||
// check if canvas is still there before calling the destructor **TO BE DONE**
|
// check if canvas is still there before calling the destructor **TO BE DONE**
|
||||||
sprintf(canvasName, "fMainCanvas%d", i);
|
snprintf(canvasName, sizeof(canvasName), "fMainCanvas%d", i);
|
||||||
if (gROOT->GetListOfCanvases()->FindObject(canvasName) != nullptr) {
|
if (gROOT->GetListOfCanvases()->FindObject(canvasName) != nullptr) {
|
||||||
canvasVector[i]->~PMusrCanvas();
|
canvasVector[i]->~PMusrCanvas();
|
||||||
}
|
}
|
||||||
|
@ -168,9 +168,9 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
char fln[128];
|
char fln[128];
|
||||||
if (gaussian)
|
if (gaussian)
|
||||||
sprintf(fln, "dynKT_LF_w0_%1.1f_width%1.1f_nu%1.1f_N%d_G.dat", param[0], param[1], param[2], N);
|
snprintf(fln, sizeof(fln), "dynKT_LF_w0_%1.1f_width%1.1f_nu%1.1f_N%d_G.dat", param[0], param[1], param[2], N);
|
||||||
else
|
else
|
||||||
sprintf(fln, "dynKT_LF_w0_%1.1f_width%1.1f_nu%1.1f_N%d_L.dat", param[0], param[1], param[2], N);
|
snprintf(fln, sizeof(fln), "dynKT_LF_w0_%1.1f_width%1.1f_nu%1.1f_N%d_L.dat", param[0], param[1], param[2], N);
|
||||||
|
|
||||||
const double H = Tmax/N;
|
const double H = Tmax/N;
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ int main(int argc, char *argv[])
|
|||||||
// get data histo
|
// get data histo
|
||||||
char histoName[32];
|
char histoName[32];
|
||||||
// read first the data which are NOT post pileup corrected
|
// read first the data which are NOT post pileup corrected
|
||||||
sprintf(histoName, "hDecay%02d", histoNo);
|
snprintf(histoName, sizeof(histoName), "hDecay%02d", histoNo);
|
||||||
TH1F *histo = dynamic_cast<TH1F*>(folder->FindObjectAny(histoName));
|
TH1F *histo = dynamic_cast<TH1F*>(folder->FindObjectAny(histoName));
|
||||||
if (!histo) {
|
if (!histo) {
|
||||||
cout << endl << "PRunDataHandler::ReadRootFile: Couldn't get histo " << histoName;
|
cout << endl << "PRunDataHandler::ReadRootFile: Couldn't get histo " << histoName;
|
||||||
|
@ -5,8 +5,6 @@
|
|||||||
Author: Andreas Suter
|
Author: Andreas Suter
|
||||||
e-mail: andreas.suter@psi.ch
|
e-mail: andreas.suter@psi.ch
|
||||||
|
|
||||||
$Id$
|
|
||||||
|
|
||||||
***************************************************************************/
|
***************************************************************************/
|
||||||
|
|
||||||
/***************************************************************************
|
/***************************************************************************
|
||||||
@ -443,7 +441,7 @@ int main(int argc, char *argv[])
|
|||||||
// create run info folder and content
|
// create run info folder and content
|
||||||
TFolder *runInfoFolder = new TFolder("RunInfo", "Run Info");
|
TFolder *runInfoFolder = new TFolder("RunInfo", "Run Info");
|
||||||
TLemRunHeader *runHeader = new TLemRunHeader();
|
TLemRunHeader *runHeader = new TLemRunHeader();
|
||||||
sprintf(str, "Fake Data generated from %s", pBFileName.Data());
|
snprintf(str, sizeof(str), "Fake Data generated from %s", pBFileName.Data());
|
||||||
runHeader->SetRunTitle(str);
|
runHeader->SetRunTitle(str);
|
||||||
Float_t fval = timeResolution;
|
Float_t fval = timeResolution;
|
||||||
runHeader->SetTimeResolution(fval);
|
runHeader->SetTimeResolution(fval);
|
||||||
|
Reference in New Issue
Block a user