192 Commits

Author SHA1 Message Date
8cfd0bcc4a increased musrfit patch number. 2024-04-19 12:40:50 +02:00
7198521f60 make sure that brackets are not lost in the function reconstruct, e.g. 1/(2*parX) is not going over into 1/2*parX. 2024-04-19 12:39:01 +02:00
834884f3a4 improved variable description. 2024-04-19 12:36:24 +02:00
80591f6f13 fixed an error in DumpHeader when dumping a TDoubleVector. 2024-03-16 15:59:17 +01:00
44456c49e9 fixed a typo: Atoi() instead of Atof(). 2024-03-16 15:34:00 +01:00
495f02c3c6 for macos: add /usr/local/lib to DYLD_LIBRARY_PATH for qt5. This is needed to find the nexus lib. 2024-03-07 12:31:32 +01:00
ad2e84581f revert back to boost ellint_1, since on many compilers the c++17 std::comp_ellint_1 is not yet implemented. 2024-03-05 18:29:34 +01:00
59dbae4a1e use the QProcess startDetached method and not the static one. 2024-02-14 09:30:17 +01:00
4d176c395c use the QProcess startDetached method and not the static one. 2024-02-14 09:26:27 +01:00
74978025fb start musrview as detached process: simplifies things. 2024-02-13 10:12:50 +01:00
deeee783f5 add /usr/local/lib to default DYLD_LIBRARY_PATH for macOS. 2024-02-08 14:00:06 +01:00
cadd28b9fe Merge branch 'root6' of https://git.psi.ch/nemu/musrfit into root6 2024-02-03 20:01:01 +01:00
79c8be54bf update of the copyright info. 2024-02-03 19:58:11 +01:00
3cf89c6571 added some missing qutation marks musrfit_startup.xml. 2023-11-29 12:47:24 +01:00
673a742631 added some more default search path to default musrfit_startup.xml. 2023-11-29 12:44:58 +01:00
f68775dd64 Merge branch 'root6' of https://gitlab.psi.ch/nemu/musrfit into root6 2023-11-15 16:07:37 +01:00
23bf2ec2fc added proper rpath handling. 2023-11-15 16:04:21 +01:00
23ac67a443 add an option to musrfit which allows to replace to musrfit_startup.xml by the default one. 2023-11-11 18:26:25 +01:00
d6a3767040 adopted default path/file-name scheme to the current state. 2023-11-10 15:05:38 +01:00
75d0c9e01a adopted the technical doxygen files to the current state. 2023-11-10 08:26:52 +01:00
ecd9e4a953 improved the nonlocal field dump, by allowing a custom range. 2023-11-08 12:57:16 +01:00
3c2b0322c0 mupp: got rid of some left over raw pointers by replacing them through smartpointers. 2023-11-03 07:54:52 +01:00
4747fbc77d make sure that singleRunMsrFile is a legal pointer before proceeding. 2023-11-01 14:38:21 +01:00
b1b808ad7b switched TGapIntegrals from raw -> smart pointers. 2023-11-01 08:54:24 +01:00
2d1875ebfe remove unused code. 2023-11-01 08:27:48 +01:00
d221ef1ed0 more work in switching raw -> smart pointer. 2023-11-01 08:27:04 +01:00
f7c45f46ff switched TLondon1D from raw -> smart pointers. 2023-11-01 08:00:47 +01:00
5b093208eb fixed stupid copy/paste error when switching to smart pointers in PMusrWiz. 2023-10-31 18:08:31 +01:00
7a1f60d00f adopted MusrRootDefinition doc to smart pointer use. Updated MusrRootDefinition.pdf 2023-10-31 08:18:01 +01:00
de2d8394d3 adopted MusrRootDefinition doc to smart pointer use. 2023-10-31 08:00:22 +01:00
af13e78c52 more work on Raw -> Smart Pointers for external libs. 2023-10-27 23:23:19 +02:00
7691ef2815 Raw -> Smart Pointers in TMusrRunHeader. 2023-10-25 17:59:05 +02:00
8f4a7c6b68 Raw -> Smart Pointers in PNeXus. 2023-10-25 17:52:24 +02:00
1cb0cfd3e7 Nonlocal: Raw -> Smart Pointers. Improved config of standalone dump_nonlocal_field. 2023-10-25 17:40:56 +02:00
344a5c8ba0 print for debug: the ostream need explicit string not char[]. 2023-10-25 13:47:00 +02:00
6f521668c0 increased main version to 1.9.2, libPMusr to 1.4.0, and mupp to 1.1.0. 2023-10-25 08:46:02 +02:00
02a1cb7a0c added check for mupp script in case the data collection is not readable. 2023-10-25 08:32:13 +02:00
fdeed5dec4 (i) fix of missing status init. (ii) changed vector copy evaluation. 2023-10-24 21:09:35 +02:00
e676d3c045 Raw -> Smart Pointers for mupp_plotter, qt5/qt6. 2023-10-24 16:07:56 +02:00
9911d88889 Raw -> Smart Pointers for PVarDialog, mupp, qt5/qt6. 2023-10-24 13:08:30 +02:00
51520868f1 Raw -> Smart Pointers for mupp, qt5/qt6. 2023-10-24 12:55:26 +02:00
3d149dc6ab Raw -> Smart Pointers for musrWiz, qt5. 2023-10-24 12:15:20 +02:00
e79322b348 Raw -> Smart Pointers for musrStep, qt5. 2023-10-24 10:17:16 +02:00
62e86f42b7 Raw -> Smart Pointers in PSubTextEdit, musredit, qt5. 2023-10-24 09:38:37 +02:00
c18ed68aa8 Raw -> Smart Pointers in PPrefsDialog, musredit, qt5. 2023-10-24 09:30:00 +02:00
e376e9a2e6 Raw -> Smart Pointers for musredit qt5. 2023-10-24 09:22:42 +02:00
a90af4c342 start replacing raw to smart pointers for mupp. 2023-10-23 20:32:01 +02:00
1c7556a73d add missing include. 2023-10-22 19:06:56 +02:00
eb234b7de5 work on smart pointer transition of musrWiz. 2023-10-22 18:03:31 +02:00
3d7d86d657 more work on smart pointer transition of musrStep. 2023-10-22 11:00:24 +02:00
7743eaee09 more work on smart pointer transition of PTextEdit. 2023-10-22 09:31:22 +02:00
9c2e981e2a more work on smart pointer transition of PTextEdit. 2023-10-22 09:23:07 +02:00
f9b1ef9dcc more work on smart pointer transition of PTextEdit. 2023-10-22 09:17:42 +02:00
89146f3cee raw -> smart pointer for musredit where it makes sence. 2023-10-21 22:33:19 +02:00
be29e55834 switched PRunSingleHistoRRF where possible to smart pointers. 2023-10-21 19:19:04 +02:00
8e7fda92e1 switched PRunDataHandler where possible to smart pointers. 2023-10-21 19:11:01 +02:00
890d48a95c switched PRunBase where possible to smart pointers. 2023-10-21 18:46:24 +02:00
823ef087c9 switched PRgeHandler where possible to smart pointers. 2023-10-21 18:40:35 +02:00
05c06a071e switched PMusrT0 where possible to smart pointers. 2023-10-21 18:34:55 +02:00
dbfadc4e42 switched PMusrCanvas where possible to smart pointers. 2023-10-21 17:47:32 +02:00
93754a9fc2 replaced some raw pointer by smart pointer in PFitter. 2023-10-21 17:45:49 +02:00
0bff931af9 switch to smart pointers in PMsr2Data where possible. 2023-10-21 13:32:44 +02:00
1a72d67be9 switched PFitter to smart pointers. 2023-10-21 11:39:16 +02:00
7e17af0256 switched PMsrHandler where possible to smart pointers. 2023-10-21 11:21:27 +02:00
5d731611cf remove one check for Fourier only. 2023-10-18 14:22:06 +02:00
4b561b1f15 get rid of raw pointers for PFourierCanvas where it makes sense. 2023-10-18 14:21:15 +02:00
69305f8b1d removed obsolate clean up. 2023-10-17 16:42:27 +02:00
88b3ab8a01 Merge branch 'root6' of https://git.psi.ch/nemu/musrfit into root6 2023-10-17 16:40:22 +02:00
ca742a064f more work to get rid of raw pointers. 2023-10-17 16:35:54 +02:00
b5a391e355 replaced raw pointers by smart pointers for musrt0.cpp. 2023-10-13 22:46:21 +02:00
1feed7116a replaced raw pointers by smart pointers for musrFT.cpp. 2023-10-13 22:46:01 +02:00
ff9245fd28 replaced raw pointers by smart pointers for msr2data.cpp. 2023-10-13 12:47:33 +02:00
98026c725d replaced raw pointers by smart pointers for dump_header.cpp. 2023-10-13 12:33:47 +02:00
5972391ff4 replaced raw pointers by smart pointers for any2many.cpp. 2023-10-13 12:23:32 +02:00
c5f6eb04b4 replaced raw pointers by smart pointers for addRun.cpp. 2023-10-13 12:19:58 +02:00
2a2e2b40d5 replaced raw pointers by smart pointers for musrview.cpp. 2023-10-13 12:10:06 +02:00
c2a2051d29 replaced raw pointers by smart pointers for musrfit.cpp. 2023-10-13 11:56:52 +02:00
578dc900c2 Merged in master (pull request #14)
Master

Approved-by: Andreas Suter
2023-09-28 11:25:29 +00:00
cf44df21ed Fixed compatibility with C++17 2023-09-28 13:16:19 +02:00
ef641de033 Merged muonspin/musrfit:root6 into master 2023-09-02 14:19:02 +02:00
4c62ae547f updated the docu. Newly added: brief description of the supported file formats. 2023-09-02 13:15:07 +02:00
91d6a4bc99 Merged muonspin/musrfit:root6 into master 2023-09-01 11:51:52 +02:00
c6ebaf3675 more potential musr-data-file paths added. 2023-08-31 10:30:04 +02:00
1df6643bfa more robust handling of positron detector entries. 2023-08-31 10:17:40 +02:00
4d1c7c10c8 make sure that exported MusrRoot files have proper stats in the histo objects. 2023-08-31 08:22:37 +02:00
0b3fc43123 handle dump of RunSummary with and without '\n' and/or '\r' properly. 2023-08-31 07:47:47 +02:00
1f32698b5f try to improve the reload issue of musrT0 called via musredit - Issue #61 on bitbucket. 2023-08-30 15:41:34 +02:00
22178f7869 improved search run, allowing to look for a specific file format in case the run is saved in multiple different file formats. 2023-08-30 15:05:56 +02:00
2e6e5ecb97 added the flame instrument. 2023-08-30 14:09:19 +02:00
56a8730252 Merged muonspin/musrfit:root6 into master 2023-05-22 09:18:22 +02:00
40e15218a3 add flag -c for dump_header via musredit. 2023-05-19 12:04:16 +02:00
39a54d7f63 dump_header can dump #counts for each detector now also for mud and nexus. 2023-05-17 17:22:47 +02:00
d664f5d877 Merged muonspin/musrfit:root6 into master 2023-05-17 10:00:49 +02:00
420b301ac5 dump_header can dump #counts for each detector. Currently only for MusrRoot. 2023-05-16 14:21:33 +02:00
5d9eb0dcec allow more flexible dealing with LEM run numbers > 9999. 2023-05-16 08:27:52 +02:00
905dfde5c7 Merge branch 'root6' of https://git.psi.ch/nemu/musrfit into root6 2023-05-14 16:58:58 +02:00
05a732c9ec add 5-digit run name template for lem, needed for addRun and dump_header. 2023-05-14 16:57:08 +02:00
bace23b97e add hint for potential flatpak. 2023-04-14 10:50:58 +02:00
8765ac9192 Merged muonspin/musrfit:root6 into master 2023-03-10 15:52:28 +01:00
f7620445dc fixed c++ streaming output flag error. 2023-03-07 12:28:01 +01:00
f1b7ca226a Merged muonspin/musrfit:root6 into master 2023-02-20 10:15:20 +01:00
3457ff9d25 make sure that dictionary generation works. 2023-02-19 11:29:55 +01:00
30d124ab51 Merged muonspin/musrfit:root6 into master 2023-02-17 18:19:37 +01:00
da6eea271d updated docu. 2023-02-17 15:09:35 +01:00
abe47395cd changed to more meaningful labelling. 2023-02-17 15:02:28 +01:00
feb33b24ae Merged muonspin/musrfit:root6 into master 2023-02-17 09:46:39 +01:00
a9140ecd74 changed from energy_list to energy_vect in depth_profile_startup.xml. 2023-02-17 09:35:04 +01:00
c6cf124ee3 Merged muonspin/musrfit:root6 into master 2023-01-30 09:31:34 +01:00
401ff9ead6 Merged muonspin/musrfit:root6 into master 2023-01-10 16:39:45 +01:00
5fa84c74ec Merged muonspin/musrfit:root6 into master 2023-01-05 13:50:12 +01:00
7b0492f499 Merged muonspin/musrfit:root6 into master 2022-12-14 14:36:34 +01:00
da2705aa0e Merged muonspin/musrfit:root6 into master 2022-12-12 22:31:29 +01:00
dd733164d1 Merged muonspin/musrfit:root6 into master 2022-12-04 19:33:25 +01:00
5658c06afd Merged muonspin/musrfit:root6 into master 2022-11-26 17:07:19 +01:00
b8622fefa8 Merged muonspin/musrfit:root6 into master 2022-11-07 15:44:01 +01:00
382fd8ad99 Merged muonspin/musrfit:root6 into master 2022-11-06 12:21:54 +01:00
96ac7f68a2 Merged muonspin/musrfit:root6 into master 2022-09-07 10:55:54 +02:00
02f7c459c5 Merged muonspin/musrfit:root6 into master 2022-09-05 15:23:27 +02:00
bb9942e34b Merged muonspin/musrfit:root6 into master 2022-08-09 10:10:11 +02:00
8245728f82 Merged muonspin/musrfit:root6 into master 2022-07-06 16:26:04 +02:00
3c607768b9 Merged muonspin/musrfit:root6 into master 2022-06-21 17:34:53 +02:00
b47c735a1c Merged muonspin/musrfit:root6 into master 2022-06-01 13:47:28 +02:00
c585fedb63 Merged muonspin/musrfit:root6 into master 2022-06-01 09:37:18 +02:00
374367bee8 Merged muonspin/musrfit:root6 into master 2022-05-29 19:02:39 +02:00
e1c9a61251 Merged muonspin/musrfit:root6 into master 2022-04-29 10:43:35 +02:00
6e9d8b3e35 Merged muonspin/musrfit:root6 into master 2022-04-28 09:50:19 +02:00
e37dede866 Merged muonspin/musrfit:root6 into master 2022-04-27 10:46:43 +02:00
0b93a08108 Merged muonspin/musrfit:root6 into master 2022-04-12 16:25:25 +02:00
326b3bea17 Merged muonspin/musrfit:root6 into master 2022-03-04 14:46:21 +01:00
aeaa698be2 Merged muonspin/musrfit:root6 into master 2022-01-11 14:34:03 +01:00
5bcc460cce Merged muonspin/musrfit:root6 into master 2022-01-11 11:05:00 +01:00
6e4e9ab55e Merged muonspin/musrfit:root6 into master 2021-12-06 18:40:18 +01:00
c4da2c4ec0 Merged muonspin/musrfit:root6 into master 2021-12-02 13:09:00 +01:00
edbbb8fc45 Merged muonspin/musrfit:root6 into master 2021-11-05 15:01:19 +01:00
3e6d55f0e8 Merged muonspin/musrfit:root6 into master 2021-11-01 08:22:44 +01:00
d9b29388d0 Merged muonspin/musrfit:root6 into master 2021-10-12 16:13:36 +02:00
f94c43ccdf Merged muonspin/musrfit:root6 into master 2021-09-28 13:28:28 +02:00
30d2275b86 Merged muonspin/musrfit:root6 into master 2021-09-21 12:25:32 +02:00
7d6d8e279f Merged muonspin/musrfit:root6 into master 2021-08-19 08:57:08 +02:00
f3388a7d17 Merged muonspin/musrfit:root6 into master 2021-07-28 14:24:05 +02:00
2d65bc4574 Merged muonspin/musrfit:root6 into master 2021-07-12 19:09:24 +02:00
51e4482945 Merged muonspin/musrfit:root6 into master 2021-07-05 19:40:34 +02:00
5235935f85 Merged muonspin/musrfit:root6 into master 2021-06-17 10:39:07 +02:00
76c2a98f5a Merged muonspin/musrfit:root6 into master 2021-06-17 10:03:09 +02:00
b488ed60a0 Merged muonspin/musrfit:root6 into master 2021-06-07 19:58:56 +02:00
b9e3ceea5c Merged muonspin/musrfit:root6 into master 2021-06-06 22:49:19 +02:00
e0ecad2f3a Merged muonspin/musrfit:root6 into master 2021-06-02 14:14:56 +02:00
97400255a0 Merged muonspin/musrfit:root6 into master 2021-06-01 17:53:04 +02:00
16a1629ab6 Merged muonspin/musrfit:root6 into master 2021-05-21 15:57:51 +02:00
939d4fb7b5 Merged muonspin/musrfit:root6 into master 2021-04-19 16:25:53 +02:00
c638456afe Merged muonspin/musrfit:root6 into master 2021-04-19 15:20:12 +02:00
29b603e124 Merged muonspin/musrfit:root6 into master 2021-04-13 15:33:36 +02:00
9c438b580b Merged muonspin/musrfit:root6 into master 2021-04-12 14:37:43 +02:00
65ee70c52e Merged muonspin/musrfit:root6 into master 2021-04-11 11:47:31 +02:00
6b32dcaa38 Merged muonspin/musrfit:root6 into master 2021-04-06 15:28:19 +02:00
7f2d8f6625 Merged muonspin/musrfit:root6 into master 2021-03-29 17:34:02 +02:00
4dea80c6b6 Merged muonspin/musrfit:root6 into master 2021-03-09 11:51:10 +01:00
8afc51f497 Merged muonspin/musrfit:root6 into master 2021-03-01 09:35:16 +01:00
acd149a159 Merged muonspin/musrfit:root6 into master 2021-02-17 14:10:02 +01:00
c87906efd6 Merged muonspin/musrfit:root6 into master 2021-02-08 10:36:49 +01:00
21dedba8fa Merged muonspin/musrfit:root6 into master 2021-01-25 09:01:24 +01:00
7279de07ff Merged muonspin/musrfit:root6 into master 2021-01-03 11:44:35 +01:00
693b99755d Merged muonspin/musrfit:root6 into master 2020-09-11 10:22:39 +02:00
0069ef02c8 Merged muonspin/musrfit:root6 into master 2020-09-01 16:15:43 +02:00
45de42bc5b Merged muonspin/musrfit:root6 into master 2020-08-30 15:08:05 +02:00
7d1cb313f2 Merged muonspin/musrfit:root6 into master 2020-07-28 09:33:30 +02:00
6a8ec77037 Merged muonspin/musrfit:root6 into master 2020-07-14 19:43:52 +02:00
85359817f9 Merged muonspin/musrfit:root6 into master 2020-06-21 17:46:24 +02:00
268772e953 Merged muonspin/musrfit:root6 into master 2020-06-19 09:10:47 +02:00
260c2c19e7 Merged muonspin/musrfit:root6 into master 2020-06-18 20:40:21 +02:00
c8e863617a Merged muonspin/musrfit:root6 into master 2020-06-18 09:45:43 +02:00
8da82ee6cc Merged muonspin/musrfit:root6 into master 2020-06-09 10:46:31 +02:00
a7e1477f7f Merged muonspin/musrfit:root6 into master 2020-05-27 09:18:18 +02:00
cbdef9b7b9 README.md edited online with Bitbucket 2020-05-26 07:22:22 +00:00
5cc8722a95 Merged muonspin/musrfit:root6 into master 2020-05-25 21:59:55 +02:00
56337cf7a5 Merged muonspin/musrfit:root6 into master 2020-05-19 17:20:03 +02:00
a2855bba19 Merged muonspin/musrfit:root6 into master 2020-05-17 18:06:43 +02:00
263554dd37 Merged muonspin/musrfit:root6 into master 2020-05-16 14:22:13 +02:00
a701a7a336 Merged muonspin/musrfit:root6 into master 2020-04-13 17:33:16 +02:00
a30ac29032 Merged muonspin/musrfit:root6 into master 2020-04-10 12:04:50 +02:00
479e81cc68 Merged muonspin/musrfit:root6 into master 2020-04-07 11:03:10 +02:00
896540bee6 Merged muonspin/musrfit:root6 into master 2020-02-10 10:36:16 +01:00
2f5259d6e5 Merged muonspin/musrfit:root6 into master 2020-02-05 09:42:37 +01:00
8742d9651b Merged muonspin/musrfit:root6 into master 2020-01-31 09:49:29 +01:00
63f73427b1 Merged muonspin/musrfit:root6 into master 2019-12-04 11:02:45 +01:00
2afc21becc Merged muonspin/musrfit:root6 into master 2019-11-11 13:10:01 +01:00
63a1b1c1f3 Merged muonspin/musrfit:root6 into master 2019-11-11 09:29:40 +01:00
b916b0f6da Merged muonspin/musrfit:root6 into master 2019-11-08 16:20:35 +01:00
4ef4316b97 Merged muonspin/musrfit:root6 into master 2019-10-28 09:21:05 +01:00
357b225d53 Merged muonspin/musrfit:root6 into master 2019-10-24 09:16:57 +02:00
5fff38d36b Merged muonspin/musrfit:root6 into master 2019-09-12 15:03:14 +02:00
d00752b196 Merged muonspin/musrfit:root6 into master 2019-09-02 10:07:32 +02:00
392 changed files with 3734 additions and 5379 deletions

View File

@ -1,7 +1,7 @@
# - musrfit
cmake_minimum_required(VERSION 3.17)
project(musrfit VERSION 1.9.0 LANGUAGES C CXX)
project(musrfit VERSION 1.9.3 LANGUAGES C CXX)
#--- musrfit specific options -------------------------------------------------
option(nexus "build optional NeXus support. Needed for ISIS" OFF)
@ -222,6 +222,29 @@ else ()
set(IS_GIT_REPO 0)
endif ()
#--- rpath related things -----------------------------------------------------
# use, i.e. don't skip the full RPATH for the build tree
set(CMAKE_SKIP_BUILD_RPATH FALSE)
# when building, don't use the install RPATH already
# (but later on when installing)
set(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
# add the automatically determined parts of the RPATH
# which point to directories outside the build tree to the install RPATH
set(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
# the RPATH to be used when installing, but only if it's not a system directory
list(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
if("${isSystemDir}" STREQUAL "-1")
set(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
endif("${isSystemDir}" STREQUAL "-1")
set(rpath ${CMAKE_INSTALL_RPATH})
string(APPEND rpath ";/usr/local/lib")
set(CMAKE_INSTALL_RPATH "${rpath}")
#--- propagate to the sub-directories -----------------------------------------
add_subdirectory(src)

View File

@ -12,6 +12,18 @@ or
https://bitbucket.org/muonspin/musrfit/commits/all
Release of V1.9.2, 2023/10/25
=============================
switch over to smart pointers wherever possible.
Release of V1.9.1, 2023/05/16
=============================
add option [-c, --count] to dump_header which will dump the number of counts
per detector and the total number of counts. Currently for MusrRoot data format
only. For the other data formats it will be implement asap
Release of V1.9.0, 2023/02/17
=============================

View File

@ -32,7 +32,6 @@ For a more exhaustive user documentation see:
<andreas.suter@psi.ch>
For the beta-NMR related parts, please contact
For the beta-NMR related parts, please contact Zaher Salman
<zaher.salman@psi.ch>

View File

@ -75,7 +75,7 @@ endfunction()
#as35 endif()
find_path(FFTW3_INCLUDE NAMES fftw3.h
HINTS "/usr/include" "/opt/local/include"
HINTS "/usr/include" "/opt/local/include" "/app/include"
)
find_library(FFTW3_LIBRARY fftw3)

View File

@ -1,35 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<nonlocal xmlns="http://nemu.web.psi.ch/musrfit/nonlocal">
<depthProf xmlns="http://nemu.web.psi.ch/musrfit/depthProf">
<comment>
TrimSp information
</comment>
<trim_sp>
<data_path>./TRIMSP/</data_path>
<rge_fln_pre>SiC_1300x_52nm_48nm_E</rge_fln_pre>
<energy_list>
<energy>1000</energy>
<energy>2000</energy>
<energy>3000</energy>
<energy>4000</energy>
<energy>5000</energy>
<energy>6000</energy>
<energy>7000</energy>
<energy>8000</energy>
<energy>9000</energy>
<energy>10000</energy>
<energy>11000</energy>
<energy>12000</energy>
<energy>13000</energy>
<energy>14000</energy>
<energy>15000</energy>
<energy>16000</energy>
<energy>17000</energy>
<energy>17000</energy>
<energy>18000</energy>
<energy>19000</energy>
<energy>20000</energy>
<energy>21000</energy>
<energy>22000</energy>
</energy_list>
<energy_vect start="1000" stop="22000" step="1000"/>
</trim_sp>
</nonlocal>
</depthProf>

View File

@ -1,35 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<nonlocal xmlns="http://nemu.web.psi.ch/musrfit/nonlocal">
<depthProf xmlns="http://nemu.web.psi.ch/musrfit/depthProf">
<comment>
TrimSp information
</comment>
<trim_sp>
<data_path>./TRIMSP/</data_path>
<rge_fln_pre>SiC_1300x_52nm_48nm_E</rge_fln_pre>
<energy_list>
<energy>1000</energy>
<energy>2000</energy>
<energy>3000</energy>
<energy>4000</energy>
<energy>5000</energy>
<energy>6000</energy>
<energy>7000</energy>
<energy>8000</energy>
<energy>9000</energy>
<energy>10000</energy>
<energy>11000</energy>
<energy>12000</energy>
<energy>13000</energy>
<energy>14000</energy>
<energy>15000</energy>
<energy>16000</energy>
<energy>17000</energy>
<energy>17000</energy>
<energy>18000</energy>
<energy>19000</energy>
<energy>20000</energy>
<energy>21000</energy>
<energy>22000</energy>
</energy_list>
<energy_vect start="1000" stop="22000" step="1000"/>
</trim_sp>
</nonlocal>
</depthProf>

View File

@ -1,35 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<nonlocal xmlns="http://nemu.web.psi.ch/musrfit/nonlocal">
<depthProf xmlns="http://nemu.web.psi.ch/musrfit/depthProf">
<comment>
TrimSp information
</comment>
<trim_sp>
<data_path>./TRIMSP/</data_path>
<rge_fln_pre>Si10_2.0_E</rge_fln_pre>
<energy_list>
<energy>1000</energy>
<energy>2000</energy>
<energy>3000</energy>
<energy>4000</energy>
<energy>5000</energy>
<energy>6000</energy>
<energy>7000</energy>
<energy>8000</energy>
<energy>9000</energy>
<energy>10000</energy>
<energy>11000</energy>
<energy>12000</energy>
<energy>13000</energy>
<energy>14000</energy>
<energy>15000</energy>
<energy>16000</energy>
<energy>17000</energy>
<energy>17000</energy>
<energy>18000</energy>
<energy>19000</energy>
<energy>20000</energy>
<energy>21000</energy>
<energy>22000</energy>
</energy_list>
<energy_vect start="1000" stop="22000" step="1000"/>
</trim_sp>
</nonlocal>
</depthProf>

View File

@ -1,35 +1,11 @@
<?xml version="1.0" encoding="UTF-8"?>
<nonlocal xmlns="http://nemu.web.psi.ch/musrfit/nonlocal">
<depthProf xmlns="http://nemu.web.psi.ch/musrfit/depthProf">
<comment>
TrimSp information
</comment>
<trim_sp>
<data_path>./TRIMSP/</data_path>
<rge_fln_pre>SiO2_70nm2.0_30nm2.2_SiC_E</rge_fln_pre>
<energy_list>
<energy>1000</energy>
<energy>2000</energy>
<energy>3000</energy>
<energy>4000</energy>
<energy>5000</energy>
<energy>6000</energy>
<energy>7000</energy>
<energy>8000</energy>
<energy>9000</energy>
<energy>10000</energy>
<energy>11000</energy>
<energy>12000</energy>
<energy>13000</energy>
<energy>14000</energy>
<energy>15000</energy>
<energy>16000</energy>
<energy>17000</energy>
<energy>17000</energy>
<energy>18000</energy>
<energy>19000</energy>
<energy>20000</energy>
<energy>21000</energy>
<energy>22000</energy>
</energy_list>
<energy_vect start="1000" stop="22000" step="1000"/>
</trim_sp>
</nonlocal>
</depthProf>

View File

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

View File

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

File diff suppressed because one or more lines are too long

View File

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

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Acknowledgements &mdash; musrfit 1.8.2 documentation</title>
<title>Acknowledgements &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -90,6 +94,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -193,8 +198,8 @@ extremely competent way to deal with his projects as well as to deal with the ch
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -216,7 +221,7 @@ extremely competent way to deal with his projects as well as to deal with the ch
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>any2many - a Universal μSR-file-format converter &mdash; musrfit 1.8.2 documentation</title>
<title>any2many - a Universal μSR-file-format converter &mdash; musrfit 1.9.1 documentation</title>
@ -29,7 +29,7 @@
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="MusrRoot - an Extensible Open File Format for μSR" href="musr-root.html" />
<link rel="next" title="Short description and references to the supported file-formats" href="file-formats.html" />
<link rel="prev" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files" href="msr2data.html" />
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -90,6 +94,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -171,7 +176,7 @@ For a detailed description see <a class="reference internal" href="user-manual.h
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="musr-root.html" class="btn btn-neutral float-right" title="MusrRoot - an Extensible Open File Format for μSR" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="file-formats.html" class="btn btn-neutral float-right" title="Short description and references to the supported file-formats" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="msr2data.html" class="btn btn-neutral" title="msr2data - A Program for Automatically Processing Multiple musrfit msr Files" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
@ -183,8 +188,8 @@ For a detailed description see <a class="reference internal" href="user-manual.h
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -206,7 +211,7 @@ For a detailed description see <a class="reference internal" href="user-manual.h
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Bugtracking &mdash; musrfit 1.8.2 documentation</title>
<title>Bugtracking &mdash; musrfit 1.9.1 documentation</title>
@ -57,6 +57,10 @@
<div class="version">
1.9
</div>
@ -89,6 +93,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Bugtracking</a></li>
@ -181,8 +186,8 @@ or send an e-mail to A. Suter at PSI.</p>
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -204,7 +209,7 @@ or send an e-mail to A. Suter at PSI.</p>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>How to Cite musrfit? &mdash; musrfit 1.8.2 documentation</title>
<title>How to Cite musrfit? &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -90,6 +94,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -195,8 +200,8 @@
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -218,7 +223,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

553
doc/html/file-formats.html Normal file
View File

@ -0,0 +1,553 @@
<!DOCTYPE html>
<!--[if IE 8]><html class="no-js lt-ie9" lang="en" > <![endif]-->
<!--[if gt IE 8]><!--> <html class="no-js" lang="en" > <!--<![endif]-->
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Short description and references to the supported file-formats &mdash; musrfit 1.9.1 documentation</title>
<link rel="stylesheet" href="_static/css/theme.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="MusrRoot - an Extensible Open File Format for μSR" href="musr-root.html" />
<link rel="prev" title="any2many - a Universal μSR-file-format converter" href="any2many.html" />
<script src="_static/js/modernizr.min.js"></script>
</head>
<body class="wy-body-for-nav">
<div class="wy-grid-for-nav">
<nav data-toggle="wy-nav-shift" class="wy-nav-side">
<div class="wy-side-scroll">
<div class="wy-side-nav-search">
<a href="index.html" class="icon icon-home"> musrfit
</a>
<div class="version">
1.9
</div>
<div role="search">
<form id="rtd-search-form" class="wy-form" action="search.html" method="get">
<input type="text" name="q" placeholder="Search docs" />
<input type="hidden" name="check_keywords" value="yes" />
<input type="hidden" name="area" value="default" />
</form>
</div>
</div>
<div class="wy-menu wy-menu-vertical" data-spy="affix" role="navigation" aria-label="main navigation">
<ul class="current">
<li class="toctree-l1"><a class="reference internal" href="cite.html">How to Cite <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>?</a></li>
<li class="toctree-l1"><a class="reference internal" href="tutorial.html">Tutorial for <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="user-manual.html">User manual</a></li>
<li class="toctree-l1"><a class="reference internal" href="user-libs.html">Documentation of user libs (user functions)</a></li>
<li class="toctree-l1"><a class="reference internal" href="setup-standard.html">Setting up <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> on Different Platforms</a></li>
<li class="toctree-l1"><a class="reference internal" href="setup-dks.html">Setting up <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> / <code class="docutils literal notranslate"><span class="pre">DKS</span></code>: High Speed Fitting with GPUs</a></li>
<li class="toctree-l1"><a class="reference internal" href="musredit.html"><code class="docutils literal notranslate"><span class="pre">musredit</span></code>: the GUI Based Interface to <code class="docutils literal notranslate"><span class="pre">musrfit</span></code></a></li>
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">Short description and references to the supported file-formats</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#ascii-file-format-for-non-mgrsr">ASCII file format for non-μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#db-file-format-for-non-mgrsr">DB file format for non-μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#dat-csv-like-file-format-for-non-mgrsr">DAT: CSV like file format for non-μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mdu-file-format-psi-for-mgrsr">MDU file format (psi) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#mud-file-format-triumf-for-mgrsr">MUD file format (triumf) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#musrroot-file-format-psi-for-mgrsr">MusrRoot file format (PSI) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#nexus-file-format-isis-for-mgrsr">NeXus file format (isis) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#psi-bin-file-format-psi-for-mgrsr">PSI-BIN file format (psi) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#root-file-format-psi-lem-before-2012-for-mgrsr">ROOT file format (psi/lem before 2012) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="#wkm-file-format-for-mgrsr">WKM file format for μSR</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
</ul>
</div>
</div>
</nav>
<section data-toggle="wy-nav-shift" class="wy-nav-content-wrap">
<nav class="wy-nav-top" aria-label="top navigation">
<i data-toggle="wy-nav-top" class="fa fa-bars"></i>
<a href="index.html">musrfit</a>
</nav>
<div class="wy-nav-content">
<div class="rst-content">
<div role="navigation" aria-label="breadcrumbs navigation">
<ul class="wy-breadcrumbs">
<li><a href="index.html">Docs</a> &raquo;</li>
<li>Short description and references to the supported file-formats</li>
<li class="wy-breadcrumbs-aside">
<a href="_sources/file-formats.rst.txt" rel="nofollow"> View page source</a>
</li>
</ul>
<hr/>
</div>
<div role="main" class="document" itemscope="itemscope" itemtype="http://schema.org/Article">
<div itemprop="articleBody">
<div class="section" id="short-description-and-references-to-the-supported-file-formats">
<span id="file-formats"></span><span id="index-0"></span><h1>Short description and references to the supported file-formats<a class="headerlink" href="#short-description-and-references-to-the-supported-file-formats" title="Permalink to this headline"></a></h1>
<p>Currently the following μSR and non-μSR file formats are supported (in alphabetic order):</p>
<ul class="simple">
<li>ascii (non-μSR): <a class="reference internal" href="#ascii-file-format"><span class="std std-ref">ASCII file format for non-uSR</span></a></li>
<li>db (non-μSR): <a class="reference internal" href="#db-file-format"><span class="std std-ref">DB (triumf)</span></a></li>
<li>dat (non-μSR): <a class="reference internal" href="#dat-file-format"><span class="std std-ref">DAT: CSV like data file</span></a></li>
<li>mdu (μSR): <a class="reference internal" href="#mdu-file-format"><span class="std std-ref">MDU file format (PSI)</span></a></li>
<li>mud (μSR): <a class="reference internal" href="#mud-file-format"><span class="std std-ref">MUon Data access file format (TRIUMF)</span></a></li>
<li>musr-root (μSR): <a class="reference internal" href="musr-root.html#musrroot"><span class="std std-ref">MusrRoot - an Extensible Open File Format for uSR</span></a></li>
<li>nexus (μSR): used to read NeXus files from ISIS (HDF4 and HDF5): <a class="reference internal" href="#nexus-file-format"><span class="std std-ref">NeXus</span></a></li>
<li>psi-bin (μSR): <a class="reference internal" href="#psi-bin-file-format"><span class="std std-ref">PSI-BIN file format (PSI)</span></a></li>
<li>root (μSR): specific version for LEM before 2012 <a class="reference internal" href="#root-file-format"><span class="std std-ref">LEM ROOT file format</span></a></li>
<li>wkm (μSR): special ascii file format used in the past by the TU Braunschweig (outdated): <a class="reference internal" href="#wkm-file-format"><span class="std std-ref">WKM</span></a></li>
</ul>
<div class="section" id="ascii-file-format-for-non-mgrsr">
<span id="ascii-file-format"></span><span id="index-1"></span><h2>ASCII file format for non-μSR<a class="headerlink" href="#ascii-file-format-for-non-mgrsr" title="Permalink to this headline"></a></h2>
<p>This for instance can be used to fit <span class="math notranslate nohighlight">\(1/\lambda^2 ~ \mathrm{vs} ~ T\)</span> to study gap properties of superconductors.
Details about the gap-intergrals can be found in the memo <em>GapIntegrals.pdf</em> which can be found in the source code of musrfit
under &lt;musrfit-home-dir&gt;/src/external/libGapIntegrals.</p>
<p>This primitive file format has the following structure:</p>
<p>Comment lines start with a # or % character.
The file can start with some header info. The header is optional, as all its tags, but
if present it has the following format:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">HEADER</span>
<span class="n">TITLE</span><span class="p">:</span> <span class="n">title</span>
<span class="n">X</span><span class="o">-</span><span class="n">AXIS</span><span class="o">-</span><span class="n">TITLE</span><span class="p">:</span> <span class="n">x</span><span class="o">-</span><span class="n">axis</span> <span class="n">title</span>
<span class="n">Y</span><span class="o">-</span><span class="n">AXIS</span><span class="o">-</span><span class="n">TITLE</span><span class="p">:</span> <span class="n">y</span><span class="o">-</span><span class="n">axis</span> <span class="n">title</span>
<span class="n">SETUP</span><span class="p">:</span> <span class="n">setup</span>
<span class="n">FIELD</span><span class="p">:</span> <span class="n">field</span>
<span class="n">TEMP</span><span class="p">:</span> <span class="n">temperature</span>
<span class="n">ENERGY</span><span class="p">:</span> <span class="n">energy</span>
</pre></div>
</div>
<p>Field has to be given in (G), temperature in (K) and energy in (keV).</p>
<p>The data are read column like and start with the data tag DATA, followed by the
data columns, i.e.:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DATA</span>
<span class="n">x</span><span class="p">,</span> <span class="n">y</span> <span class="p">[,</span> <span class="n">error</span> <span class="n">y</span><span class="p">]</span>
</pre></div>
</div>
<p>where spaces, column, are a tab are possible separations.
If no error in y is present, the weighting in the fit will be equal.</p>
<p>A full example might look like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1"># libGapIntegrals-test.dat</span>
<span class="c1"># This is a comment</span>
<span class="o">%</span> <span class="n">This</span> <span class="k">as</span> <span class="n">well</span>
<span class="n">HEADER</span>
<span class="n">TITLE</span><span class="p">:</span> <span class="n">Test</span> <span class="n">superconductor</span> <span class="n">data</span>
<span class="n">X</span><span class="o">-</span><span class="n">AXIS</span><span class="o">-</span><span class="n">TITLE</span><span class="p">:</span> <span class="n">T</span> <span class="p">(</span><span class="n">K</span><span class="p">)</span>
<span class="n">Y</span><span class="o">-</span><span class="n">AXIS</span><span class="o">-</span><span class="n">TITLE</span><span class="p">:</span> <span class="c1">#lambda^{-2} (#mum^{-2})</span>
<span class="n">SETUP</span><span class="p">:</span> <span class="n">H</span> <span class="c1">#parallel c</span>
<span class="n">FIELD</span><span class="p">:</span> <span class="mi">100</span>
<span class="n">TEMP</span><span class="p">:</span> <span class="mf">0.0</span>
<span class="n">ENERGY</span><span class="p">:</span> <span class="mi">4200</span>
<span class="c1"># here the data will follow</span>
<span class="n">DATA</span>
<span class="c1"># x, y, error y</span>
<span class="mf">0.0318411</span><span class="p">,</span> <span class="mf">7.77455</span><span class="p">,</span> <span class="mf">0.2</span>
<span class="mf">0.0629929</span><span class="p">,</span> <span class="mf">7.9869</span><span class="p">,</span> <span class="mf">0.15</span>
<span class="mf">0.113914</span><span class="p">,</span> <span class="mf">7.64209</span><span class="p">,</span> <span class="mf">0.15</span>
<span class="mf">0.202492</span><span class="p">,</span> <span class="mf">7.37699</span><span class="p">,</span> <span class="mf">0.15</span>
<span class="mf">0.302725</span><span class="p">,</span> <span class="mf">7.70893</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">0.447456</span><span class="p">,</span> <span class="mf">7.77565</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">0.611685</span><span class="p">,</span> <span class="mf">7.45768</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">0.813613</span><span class="p">,</span> <span class="mf">7.19287</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">1.00822</span><span class="p">,</span> <span class="mf">7.57813</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">1.24793</span><span class="p">,</span> <span class="mf">7.31343</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">1.50635</span><span class="p">,</span> <span class="mf">7.16818</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">1.74591</span><span class="p">,</span> <span class="mf">6.99634</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">1.99795</span><span class="p">,</span> <span class="mf">6.90414</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">2.25061</span><span class="p">,</span> <span class="mf">6.41393</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">2.4958</span><span class="p">,</span> <span class="mf">6.66666</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">2.75514</span><span class="p">,</span> <span class="mf">5.93766</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">3.00753</span><span class="p">,</span> <span class="mf">5.61992</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">3.26056</span><span class="p">,</span> <span class="mf">4.89091</span><span class="p">,</span> <span class="mf">0.12</span>
<span class="mf">3.49414</span><span class="p">,</span> <span class="mf">4.52005</span><span class="p">,</span> <span class="mf">0.08</span>
<span class="mf">3.75356</span><span class="p">,</span> <span class="mf">3.73799</span><span class="p">,</span> <span class="mf">0.08</span>
<span class="mf">3.99425</span><span class="p">,</span> <span class="mf">2.84974</span><span class="p">,</span> <span class="mf">0.08</span>
<span class="mf">4.30518</span><span class="p">,</span> <span class="mf">1.35139</span><span class="p">,</span> <span class="mf">0.08</span>
</pre></div>
</div>
</div>
<div class="section" id="db-file-format-for-non-mgrsr">
<span id="db-file-format"></span><span id="index-2"></span><h2>DB file format for non-μSR<a class="headerlink" href="#db-file-format-for-non-mgrsr" title="Permalink to this headline"></a></h2>
<p>The DB file format is an <em>archaic</em> ascii file format from TRIUMF which is intended to be used to collect parameter summaries of various runs, which can be read directly by <a class="reference internal" href="mupp.html#mupp"><span class="std std-ref">mupp</span></a>.</p>
<p>The DB file is organized in a couple of tags defining various properties, followed by the parameter data with its errors.
Tags and is content are always separated by an empty line.
The first tag is the <strong>TITLE</strong>. Followed by the title in the next line</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">TITLE</span>
<span class="n">This</span> <span class="ow">is</span> <span class="n">the</span> <span class="n">best</span> <span class="n">data</span> <span class="n">ever</span>
</pre></div>
</div>
<p>The next tag is the <strong>ABSTRACT</strong>, followed a potentially multi-line abstract, e.g.</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ABSTRACT</span>
<span class="n">Here</span> <span class="n">comes</span> <span class="n">the</span> <span class="n">detailed</span> <span class="n">description</span> <span class="o">...</span>
</pre></div>
</div>
<p>The next tag, <strong>LABELS</strong>, are used to define human readable names for the data parameters to be followed:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">LABELS</span>
<span class="n">T</span> <span class="p">(</span><span class="n">K</span><span class="p">)</span>
<span class="n">B</span> <span class="p">(</span><span class="n">G</span><span class="p">)</span>
<span class="o">...</span>
</pre></div>
</div>
<p>The number of labels have to fit the number of parameters present!</p>
<p>The next tag is <strong>DATA</strong>, which is a list of the parameter names as found in you msr-file.
Unlike the other tags, here the list of names follow directly after the <strong>DATA</strong> tag</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DATA</span> <span class="n">dataT</span> <span class="n">dataB</span> <span class="n">dataE</span> <span class="n">dataTr</span> <span class="o">...</span>
</pre></div>
</div>
<p>Next there will be a line with the tag <strong>\-e</strong>, followed by</p>
<p>The parameters are afterwards listed as</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">param</span><span class="o">-</span><span class="n">name</span> <span class="o">=</span> <span class="n">val</span><span class="p">,</span> <span class="n">pos</span><span class="o">-</span><span class="n">err</span><span class="p">,</span> <span class="n">neg</span><span class="o">-</span><span class="n">err</span><span class="p">,</span>\
</pre></div>
</div>
<p>After all the parameters listed of a specific run, the <strong>run number</strong> with the run title ends a run data set.
This might look like this (be aware of the comma!):</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="mi">11231</span><span class="p">,,,</span> <span class="n">AgPlate</span> <span class="mi">250</span><span class="n">nm</span> <span class="p">(</span><span class="n">T5034</span><span class="p">),</span> <span class="n">T</span><span class="o">=</span><span class="mf">200.00</span> <span class="n">K</span><span class="p">,</span> <span class="n">E</span><span class="o">=</span><span class="mf">12.99</span> <span class="n">keV</span><span class="p">,</span> <span class="n">B</span><span class="o">=~</span><span class="mi">50</span><span class="p">(</span><span class="n">G</span><span class="p">)</span><span class="o">/</span><span class="mf">8.65</span><span class="p">(</span><span class="n">A</span><span class="p">),</span> <span class="n">Tr</span><span class="o">/</span><span class="n">Sa</span><span class="o">=</span><span class="mf">12.00</span><span class="o">/-</span><span class="mf">1.80</span> <span class="n">kV</span><span class="p">,</span> <span class="n">SR</span><span class="o">=-</span><span class="mf">10.00</span>
</pre></div>
</div>
<p>A full example might look like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">TITLE</span>
<span class="n">Ag</span> <span class="n">Plate</span> <span class="mi">2023</span> <span class="n">runs</span><span class="p">,</span> <span class="n">Tr12kV</span><span class="p">,</span> <span class="n">E</span><span class="o">=</span><span class="mi">13</span><span class="n">keV</span><span class="p">,</span> <span class="n">TF</span> <span class="n">B</span><span class="o">=</span><span class="mi">50</span><span class="n">G</span>
<span class="n">Abstract</span>
<span class="n">Summary</span> <span class="n">of</span> <span class="n">the</span>
<span class="n">LABELS</span>
<span class="n">T</span> <span class="p">(</span><span class="n">K</span><span class="p">)</span>
<span class="n">B</span> <span class="p">(</span><span class="n">G</span><span class="p">)</span>
<span class="n">Implantation</span> <span class="n">Energy</span> <span class="p">(</span><span class="n">keV</span><span class="p">)</span>
<span class="n">Transport</span> <span class="p">(</span><span class="n">kV</span><span class="p">)</span>
<span class="n">RAL</span><span class="o">-</span><span class="n">RAR</span> <span class="p">(</span><span class="n">kV</span><span class="p">)</span>
<span class="n">RAT</span><span class="o">-</span><span class="n">RAB</span> <span class="p">(</span><span class="n">kV</span><span class="p">)</span>
<span class="n">Spin</span> <span class="n">Rotation</span> <span class="n">Angle</span> <span class="p">(</span><span class="n">degree</span><span class="p">)</span>
<span class="n">Asy</span>
<span class="n">Lambda</span>
<span class="n">Ph</span>
<span class="n">Field</span>
<span class="n">RelPh_L</span>
<span class="n">N0_L</span>
<span class="n">N_bkg_L</span>
<span class="n">RelPh_T</span>
<span class="n">N0_T</span>
<span class="n">N_bkg_T</span>
<span class="n">RelPh_R</span>
<span class="n">alpha_LR</span>
<span class="n">N_bkg_R</span>
<span class="n">RelPh_B</span>
<span class="n">alpha_TB</span>
<span class="n">N_bkg_B</span>
<span class="n">maxLH</span>
<span class="n">NDF</span>
<span class="n">maxLHred</span>
<span class="n">RUN</span>
<span class="n">Data</span> <span class="n">dataT</span> <span class="n">dataB</span> <span class="n">dataE</span> <span class="n">dataTr</span> <span class="n">dataRALRAR</span> <span class="n">dataRATRAB</span> <span class="n">dataSpinRot</span> <span class="n">Asy</span> <span class="n">Lambda</span> <span class="n">Ph</span> <span class="n">Field</span> <span class="n">RelPh_L</span> <span class="n">N0_L</span> <span class="n">N_bkg_L</span> <span class="n">RelPh_T</span> <span class="n">N0_T</span> <span class="n">N_bkg_T</span> <span class="n">RelPh_R</span> <span class="n">alpha_LR</span> <span class="n">N_bkg_R</span> <span class="n">RelPh_B</span> <span class="n">alpha_TB</span> <span class="n">N_bkg_B</span> <span class="n">maxLH</span> <span class="n">NDF</span> <span class="n">maxLHred</span> <span class="n">RUN</span>
\<span class="o">-</span><span class="n">e</span>
<span class="n">dataT</span> <span class="o">=</span> <span class="mf">200.001</span><span class="p">,</span> <span class="mf">0.0009</span><span class="p">,</span> <span class="mf">0.0009</span><span class="p">,</span>\
<span class="n">dataB</span> <span class="o">=</span> <span class="mf">49.49</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataE</span> <span class="o">=</span> <span class="mf">12.9952</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataTr</span> <span class="o">=</span> <span class="mf">11.9993</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataRALRAR</span> <span class="o">=</span> <span class="o">-</span><span class="mf">0.008</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataRATRAB</span> <span class="o">=</span> <span class="o">-</span><span class="mf">0.009</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataSpinRot</span> <span class="o">=</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">Asy</span> <span class="o">=</span> <span class="mf">0.22466</span><span class="p">,</span> <span class="mf">0.00084</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.00084</span><span class="p">,</span>\
<span class="n">Lambda</span> <span class="o">=</span> <span class="mf">0.0081</span><span class="p">,</span> <span class="mf">0.0014</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.0014</span><span class="p">,</span>\
<span class="n">Ph</span> <span class="o">=</span> <span class="mf">12.14</span><span class="p">,</span> <span class="mf">0.32</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.32</span><span class="p">,</span>\
<span class="n">Field</span> <span class="o">=</span> <span class="mf">50.837</span><span class="p">,</span> <span class="mf">0.017</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.017</span><span class="p">,</span>\
<span class="n">RelPh_L</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">N0_L</span> <span class="o">=</span> <span class="mf">430.67</span><span class="p">,</span> <span class="mf">0.39</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.39</span><span class="p">,</span>\
<span class="n">N_bkg_L</span> <span class="o">=</span> <span class="mf">6.81</span><span class="p">,</span> <span class="mf">0.048</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.048</span><span class="p">,</span>\
<span class="n">RelPh_T</span> <span class="o">=</span> <span class="o">-</span><span class="mf">89.95</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.4</span><span class="p">,</span>\
<span class="n">N0_T</span> <span class="o">=</span> <span class="mf">422.6</span><span class="p">,</span> <span class="mf">0.37</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.37</span><span class="p">,</span>\
<span class="n">N_bkg_T</span> <span class="o">=</span> <span class="mf">7.125</span><span class="p">,</span> <span class="mf">0.047</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.048</span><span class="p">,</span>\
<span class="n">RelPh_R</span> <span class="o">=</span> <span class="o">-</span><span class="mf">178.55</span><span class="p">,</span> <span class="mf">0.39</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.39</span><span class="p">,</span>\
<span class="n">alpha_LR</span> <span class="o">=</span> <span class="mf">0.9729</span><span class="p">,</span> <span class="mf">0.0012</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.0012</span><span class="p">,</span>\
<span class="n">N_bkg_R</span> <span class="o">=</span> <span class="mf">7.375</span><span class="p">,</span> <span class="mf">0.048</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.048</span><span class="p">,</span>\
<span class="n">RelPh_B</span> <span class="o">=</span> <span class="mf">90.38</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.4</span><span class="p">,</span>\
<span class="n">alpha_TB</span> <span class="o">=</span> <span class="mf">0.9522</span><span class="p">,</span> <span class="mf">0.0012</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.0012</span><span class="p">,</span>\
<span class="n">N_bkg_B</span> <span class="o">=</span> <span class="mf">6.546</span><span class="p">,</span> <span class="mf">0.047</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.047</span><span class="p">,</span>\
<span class="n">maxLH</span> <span class="o">=</span> <span class="mf">20303.3</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">NDF</span> <span class="o">=</span> <span class="mi">20361</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">maxLHred</span> <span class="o">=</span> <span class="mf">0.997166</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="mi">11231</span><span class="p">,,,</span> <span class="n">AgPlate</span> <span class="mi">250</span><span class="n">nm</span> <span class="p">(</span><span class="n">T5034</span><span class="p">),</span> <span class="n">T</span><span class="o">=</span><span class="mf">200.00</span> <span class="n">K</span><span class="p">,</span> <span class="n">E</span><span class="o">=</span><span class="mf">12.99</span> <span class="n">keV</span><span class="p">,</span> <span class="n">B</span><span class="o">=~</span><span class="mi">50</span><span class="p">(</span><span class="n">G</span><span class="p">)</span><span class="o">/</span><span class="mf">8.65</span><span class="p">(</span><span class="n">A</span><span class="p">),</span> <span class="n">Tr</span><span class="o">/</span><span class="n">Sa</span><span class="o">=</span><span class="mf">12.00</span><span class="o">/-</span><span class="mf">1.80</span> <span class="n">kV</span><span class="p">,</span> <span class="n">SR</span><span class="o">=-</span><span class="mf">10.00</span>
<span class="n">dataT</span> <span class="o">=</span> <span class="mi">153</span><span class="p">,</span> <span class="mf">0.7</span><span class="p">,</span> <span class="mf">0.7</span><span class="p">,</span>\
<span class="n">dataB</span> <span class="o">=</span> <span class="mf">49.49</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataE</span> <span class="o">=</span> <span class="mf">12.9952</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataTr</span> <span class="o">=</span> <span class="mf">11.9993</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataRALRAR</span> <span class="o">=</span> <span class="o">-</span><span class="mf">0.008</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataRATRAB</span> <span class="o">=</span> <span class="o">-</span><span class="mf">0.009</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">dataSpinRot</span> <span class="o">=</span> <span class="o">-</span><span class="mi">10</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">Asy</span> <span class="o">=</span> <span class="mf">0.22253</span><span class="p">,</span> <span class="mf">0.00084</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.00083</span><span class="p">,</span>\
<span class="n">Lambda</span> <span class="o">=</span> <span class="mf">0.0055</span><span class="p">,</span> <span class="mf">0.0014</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.0014</span><span class="p">,</span>\
<span class="n">Ph</span> <span class="o">=</span> <span class="mf">11.53</span><span class="p">,</span> <span class="mf">0.32</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.32</span><span class="p">,</span>\
<span class="n">Field</span> <span class="o">=</span> <span class="mf">51.026</span><span class="p">,</span> <span class="mf">0.017</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.017</span><span class="p">,</span>\
<span class="n">RelPh_L</span> <span class="o">=</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">N0_L</span> <span class="o">=</span> <span class="mf">430.31</span><span class="p">,</span> <span class="mf">0.39</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.39</span><span class="p">,</span>\
<span class="n">N_bkg_L</span> <span class="o">=</span> <span class="mf">6.762</span><span class="p">,</span> <span class="mf">0.048</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.048</span><span class="p">,</span>\
<span class="n">RelPh_T</span> <span class="o">=</span> <span class="o">-</span><span class="mf">89.3</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.4</span><span class="p">,</span>\
<span class="n">N0_T</span> <span class="o">=</span> <span class="mf">422.31</span><span class="p">,</span> <span class="mf">0.37</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.37</span><span class="p">,</span>\
<span class="n">N_bkg_T</span> <span class="o">=</span> <span class="mf">6.96</span><span class="p">,</span> <span class="mf">0.047</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.047</span><span class="p">,</span>\
<span class="n">RelPh_R</span> <span class="o">=</span> <span class="o">-</span><span class="mf">178.61</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.4</span><span class="p">,</span>\
<span class="n">alpha_LR</span> <span class="o">=</span> <span class="mf">0.975</span><span class="p">,</span> <span class="mf">0.0013</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.0012</span><span class="p">,</span>\
<span class="n">N_bkg_R</span> <span class="o">=</span> <span class="mf">7.361</span><span class="p">,</span> <span class="mf">0.048</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.048</span><span class="p">,</span>\
<span class="n">RelPh_B</span> <span class="o">=</span> <span class="mf">90.24</span><span class="p">,</span> <span class="mf">0.4</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.4</span><span class="p">,</span>\
<span class="n">alpha_TB</span> <span class="o">=</span> <span class="mf">0.9605</span><span class="p">,</span> <span class="mf">0.0012</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.0012</span><span class="p">,</span>\
<span class="n">N_bkg_B</span> <span class="o">=</span> <span class="mf">6.623</span><span class="p">,</span> <span class="mf">0.047</span><span class="p">,</span> <span class="o">-</span><span class="mf">0.047</span><span class="p">,</span>\
<span class="n">maxLH</span> <span class="o">=</span> <span class="mf">20435.6</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">NDF</span> <span class="o">=</span> <span class="mi">20361</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="n">maxLHred</span> <span class="o">=</span> <span class="mf">1.00366</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span> <span class="mi">0</span><span class="p">,</span>\
<span class="mi">11235</span><span class="p">,,,</span> <span class="n">AgPlate</span> <span class="mi">250</span><span class="n">nm</span> <span class="p">(</span><span class="n">T5034</span><span class="p">),</span> <span class="n">T</span><span class="o">=</span><span class="mf">151.72</span> <span class="n">K</span><span class="p">,</span> <span class="n">E</span><span class="o">=</span><span class="mf">13.00</span> <span class="n">keV</span><span class="p">,</span> <span class="n">B</span><span class="o">=~</span><span class="mi">50</span><span class="p">(</span><span class="n">G</span><span class="p">)</span><span class="o">/</span><span class="mf">8.65</span><span class="p">(</span><span class="n">A</span><span class="p">),</span> <span class="n">Tr</span><span class="o">/</span><span class="n">Sa</span><span class="o">=</span><span class="mf">12.00</span><span class="o">/-</span><span class="mf">1.80</span> <span class="n">kV</span><span class="p">,</span> <span class="n">SR</span><span class="o">=-</span><span class="mf">10.00</span>
<span class="o">&gt;&gt;</span> <span class="n">here</span> <span class="n">many</span> <span class="n">more</span> <span class="n">run</span> <span class="n">data</span> <span class="n">would</span> <span class="n">follow</span> <span class="o">...</span>
</pre></div>
</div>
</div>
<div class="section" id="dat-csv-like-file-format-for-non-mgrsr">
<span id="dat-file-format"></span><span id="index-3"></span><h2>DAT: CSV like file format for non-μSR<a class="headerlink" href="#dat-csv-like-file-format-for-non-mgrsr" title="Permalink to this headline"></a></h2>
<p>This is typically used when exporting the parameter data from <strong>msr2data</strong> to be used in <strong>mupp</strong>, gnuplot, origin, or whatever parameter plotter you might use.
The first line defines the parameter tags separated by spaces or tabs. If errors are available there are labeled be the ending <em>Err</em>.
This is followed by the parameter values and its errors if present. A fill example looks like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">dataT</span> <span class="n">dataTErr</span> <span class="n">dataB</span> <span class="n">dataE</span> <span class="n">dataTr</span> <span class="n">dataRALRAR</span> <span class="n">dataRATRAB</span> <span class="n">dataSpinRot</span> <span class="n">Asy</span> <span class="n">AsyPosErr</span> <span class="n">AsyNegErr</span> <span class="n">Lambda</span> <span class="n">LambdaPosErr</span> <span class="n">LambdaNegErr</span> <span class="n">Ph</span> <span class="n">PhPosErr</span> <span class="n">PhNegErr</span> <span class="n">Field</span> <span class="n">FieldPosErr</span> <span class="n">FieldNegErr</span> <span class="n">RelPh_L</span> <span class="n">RelPh_LPosErr</span> <span class="n">RelPh_LNegErr</span> <span class="n">N0_L</span> <span class="n">N0_LPosErr</span> <span class="n">N0_LNegErr</span> <span class="n">N_bkg_L</span> <span class="n">N_bkg_LPosErr</span> <span class="n">N_bkg_LNegErr</span> <span class="n">RelPh_T</span> <span class="n">RelPh_TPosErr</span> <span class="n">RelPh_TNegErr</span> <span class="n">N0_T</span> <span class="n">N0_TPosErr</span> <span class="n">N0_TNegErr</span> <span class="n">N_bkg_T</span> <span class="n">N_bkg_TPosErr</span> <span class="n">N_bkg_TNegErr</span> <span class="n">RelPh_R</span> <span class="n">RelPh_RPosErr</span> <span class="n">RelPh_RNegErr</span> <span class="n">alpha_LR</span> <span class="n">alpha_LRPosErr</span> <span class="n">alpha_LRNegErr</span> <span class="n">N_bkg_R</span> <span class="n">N_bkg_RPosErr</span> <span class="n">N_bkg_RNegErr</span> <span class="n">RelPh_B</span> <span class="n">RelPh_BPosErr</span> <span class="n">RelPh_BNegErr</span> <span class="n">alpha_TB</span> <span class="n">alpha_TBPosErr</span> <span class="n">alpha_TBNegErr</span> <span class="n">N_bkg_B</span> <span class="n">N_bkg_BPosErr</span> <span class="n">N_bkg_BNegErr</span> <span class="n">maxLH</span> <span class="n">NDF</span> <span class="n">maxLHred</span> <span class="n">RUN</span>
<span class="mi">200</span> <span class="mf">0.007</span> <span class="mf">99.48</span> <span class="mf">1.11754</span> <span class="mf">10.001</span> <span class="o">-</span><span class="mf">0.008</span> <span class="o">-</span><span class="mf">0.008</span> <span class="o">-</span><span class="mi">10</span> <span class="mf">0.1587</span> <span class="mf">0.0012</span> <span class="mf">0.0012</span> <span class="mf">0.0263</span> <span class="mf">0.003</span> <span class="mf">0.003</span> <span class="mf">29.85</span> <span class="mf">0.64</span> <span class="mf">0.64</span> <span class="mf">101.179</span> <span class="mf">0.035</span> <span class="mf">0.035</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mf">219.27</span> <span class="mf">0.27</span> <span class="mf">0.27</span> <span class="mf">2.676</span> <span class="mf">0.033</span> <span class="mf">0.033</span> <span class="o">-</span><span class="mf">89.79</span> <span class="mf">0.81</span> <span class="mf">0.81</span> <span class="mf">210.42</span> <span class="mf">0.26</span> <span class="mf">0.26</span> <span class="mf">2.723</span> <span class="mf">0.032</span> <span class="mf">0.032</span> <span class="o">-</span><span class="mf">179.73</span> <span class="mf">0.81</span> <span class="mf">0.81</span> <span class="mf">0.9808</span> <span class="mf">0.0017</span> <span class="mf">0.0017</span> <span class="mf">2.993</span> <span class="mf">0.033</span> <span class="mf">0.033</span> <span class="mf">90.05</span> <span class="mf">0.82</span> <span class="mf">0.82</span> <span class="mf">0.9755</span> <span class="mf">0.0017</span> <span class="mf">0.0017</span> <span class="mf">2.501</span> <span class="mf">0.032</span> <span class="mf">0.032</span> <span class="mf">20444.8</span> <span class="mi">20361</span> <span class="mf">1.00412</span> <span class="mi">11400</span>
<span class="mi">200</span> <span class="mf">0.009</span> <span class="mf">99.49</span> <span class="mf">2.11668</span> <span class="mf">10.001</span> <span class="o">-</span><span class="mf">0.008</span> <span class="o">-</span><span class="mf">0.008</span> <span class="o">-</span><span class="mi">10</span> <span class="mf">0.1732</span> <span class="mf">0.0012</span> <span class="mf">0.0012</span> <span class="mf">0.0096</span> <span class="mf">0.0025</span> <span class="mf">0.0026</span> <span class="mf">28.88</span> <span class="mf">0.57</span> <span class="mf">0.57</span> <span class="mf">101.231</span> <span class="mf">0.03</span> <span class="mf">0.03</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mi">0</span> <span class="mf">219.86</span> <span class="mf">0.27</span> <span class="mf">0.27</span> <span class="mf">2.749</span> <span class="mf">0.033</span> <span class="mf">0.033</span> <span class="o">-</span><span class="mf">88.87</span> <span class="mf">0.71</span> <span class="mf">0.71</span> <span class="mf">211.47</span> <span class="mf">0.26</span> <span class="mf">0.26</span> <span class="mf">2.791</span> <span class="mf">0.032</span> <span class="mf">0.032</span> <span class="o">-</span><span class="mf">178.48</span> <span class="mf">0.72</span> <span class="mf">0.71</span> <span class="mf">0.9678</span> <span class="mf">0.0017</span> <span class="mf">0.0017</span> <span class="mf">2.969</span> <span class="mf">0.033</span> <span class="mf">0.033</span> <span class="mf">90.94</span> <span class="mf">0.73</span> <span class="mf">0.73</span> <span class="mf">0.9608</span> <span class="mf">0.0017</span> <span class="mf">0.0017</span> <span class="mf">2.653</span> <span class="mf">0.032</span> <span class="mf">0.032</span> <span class="mf">20182.5</span> <span class="mi">20361</span> <span class="mf">0.991233</span> <span class="mi">11401</span>
</pre></div>
</div>
</div>
<div class="section" id="mdu-file-format-psi-for-mgrsr">
<span id="mdu-file-format"></span><span id="index-4"></span><h2>MDU file format (psi) for μSR<a class="headerlink" href="#mdu-file-format-psi-for-mgrsr" title="Permalink to this headline"></a></h2>
<p>For details about the PSI-BIN/MDU file format from PSI see <a class="reference external" href="http://lmu.web.psi.ch/docu/manuals/bulk_manuals/software/Class_MuSR_PSI/index.html">Class_MuSR_PSI</a></p>
</div>
<div class="section" id="mud-file-format-triumf-for-mgrsr">
<span id="mud-file-format"></span><span id="index-5"></span><h2>MUD file format (triumf) for μSR<a class="headerlink" href="#mud-file-format-triumf-for-mgrsr" title="Permalink to this headline"></a></h2>
<p>For details about the MUD file format from triumf see <a class="reference external" href="https://cmms.triumf.ca/mud/">MUon Data access</a> .</p>
</div>
<div class="section" id="musrroot-file-format-psi-for-mgrsr">
<span id="musr-root-file-format"></span><h2>MusrRoot file format (PSI) for μSR<a class="headerlink" href="#musrroot-file-format-psi-for-mgrsr" title="Permalink to this headline"></a></h2>
<p>For details see <a class="reference internal" href="musr-root.html#musrroot"><span class="std std-ref">MusrRoot - an Extensible Open File Format for uSR</span></a>.</p>
</div>
<div class="section" id="nexus-file-format-isis-for-mgrsr">
<span id="nexus-file-format"></span><span id="index-6"></span><h2>NeXus file format (isis) for μSR<a class="headerlink" href="#nexus-file-format-isis-for-mgrsr" title="Permalink to this headline"></a></h2>
<p>For details about the NeXus file format from ISIS (UK) see <a class="reference external" href="https://doi.org/10.1016/S0921-4526(02)01613-7">The application of the NeXus data format to ISIS muon data</a> . For a detailed list of available meta information and data see <a class="reference external" href="https://www.isis.stfc.ac.uk/Pages/nexus-definition-v27924.pdf">NeXus Instrument Definitions for ISIS muon Data</a> .</p>
</div>
<div class="section" id="psi-bin-file-format-psi-for-mgrsr">
<span id="psi-bin-file-format"></span><span id="index-7"></span><h2>PSI-BIN file format (psi) for μSR<a class="headerlink" href="#psi-bin-file-format-psi-for-mgrsr" title="Permalink to this headline"></a></h2>
<p>For details about the PSI-BIN/MDU file format from PSI see <a class="reference external" href="http://lmu.web.psi.ch/docu/manuals/bulk_manuals/software/Class_MuSR_PSI/index.html">Class_MuSR_PSI</a>.</p>
</div>
<div class="section" id="root-file-format-psi-lem-before-2012-for-mgrsr">
<span id="root-file-format"></span><span id="index-8"></span><h2>ROOT file format (psi/lem before 2012) for μSR<a class="headerlink" href="#root-file-format-psi-lem-before-2012-for-mgrsr" title="Permalink to this headline"></a></h2>
<p>For details about the API of ROOT files can be here: <a class="reference external" href="https://root.cern/manual/root_files/">ROOT files</a>.
The structure of the ROOT files (LEM, before 2012) looks like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">ROOT</span><span class="o">-</span><span class="n">file</span> <span class="o">--|</span>
<span class="o">|--</span> <span class="n">histos</span> <span class="o">---|</span>
<span class="o">|</span> <span class="o">|--</span> <span class="n">DecayAnaModule</span>
<span class="o">|</span> <span class="o">|--</span> <span class="n">PileUpAnaModule</span>
<span class="o">|</span> <span class="o">|--</span> <span class="n">ScalerSumRate</span>
<span class="o">|</span> <span class="o">|--</span> <span class="n">SCAnaModule</span>
<span class="o">|</span>
<span class="o">|--</span> <span class="n">RunInfo</span> <span class="o">--|</span>
<span class="o">|--</span> <span class="n">RunSummary</span>
</pre></div>
</div>
<p><code class="docutils literal notranslate"><span class="pre">histos</span></code>, <code class="docutils literal notranslate"><span class="pre">RunInfo</span></code>, <code class="docutils literal notranslate"><span class="pre">DecayAnaModule</span></code>, <code class="docutils literal notranslate"><span class="pre">PileUpAnaModule</span></code>, <code class="docutils literal notranslate"><span class="pre">ScalerSumRate</span></code>, <code class="docutils literal notranslate"><span class="pre">SCAnaModule</span></code> are <strong>TFolder</strong> objects.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">DecayAnaModule</span></code> object holds the positron spectra</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">DecayAnaModule</span> <span class="o">--|</span>
<span class="o">|--</span> <span class="n">hDecay00</span>
<span class="o">|--</span> <span class="n">hDecay01</span>
<span class="o">|--</span> <span class="n">hDecay02</span>
<span class="o">|--</span> <span class="n">hDecay03</span>
<span class="o">|--</span> <span class="n">hDecay20</span>
<span class="o">|--</span> <span class="n">hDecay21</span>
<span class="o">|--</span> <span class="n">hDecay22</span>
<span class="o">|--</span> <span class="n">hDecay23</span>
</pre></div>
</div>
<p>The <code class="docutils literal notranslate"><span class="pre">hDecayXX</span></code> files or <strong>TH1F</strong> objects containing the positron spectra of the LEM detectors.</p>
<p>The detectors (00, 01, 02, and 03) are the detectors (Left, Top, Right, Bottom). These are non-post-pileup (NPP) histograms.</p>
<p>The detectors (20, 21, 22, and 23) are the detectors (Left, Top, Right, Bottom). These are post-pileup-corrected (PPC) histograms.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">SCAnaModule</span></code> contains various <strong>TF1H</strong> objects of slow control data of the run.</p>
<p>The <code class="docutils literal notranslate"><span class="pre">RunSummary</span></code> is essentially an ascii dump, with summary information of the run.</p>
</div>
<div class="section" id="wkm-file-format-for-mgrsr">
<span id="wkm-file-format"></span><span id="index-9"></span><h2>WKM file format for μSR<a class="headerlink" href="#wkm-file-format-for-mgrsr" title="Permalink to this headline"></a></h2>
<p>WKM is an obsolete ascii file format, originally introduced by people from the TU Braunschweig.
It starts with a header which shows like this:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="o">-</span> <span class="n">WKM</span> <span class="n">data</span> <span class="n">file</span> <span class="n">converted</span> <span class="k">with</span> <span class="n">any2many</span>
<span class="n">NEMU_Run</span><span class="p">:</span> <span class="mi">2466</span>
<span class="n">nemu_Run</span><span class="p">:</span> <span class="o">./</span><span class="mf">2466.</span><span class="n">wkm</span>
<span class="n">Date</span><span class="p">:</span> <span class="mi">13</span><span class="p">:</span><span class="mi">22</span><span class="p">:</span><span class="mi">00</span> <span class="mi">2012</span><span class="o">-</span><span class="mi">06</span><span class="o">-</span><span class="mi">03</span> <span class="o">/</span> <span class="mi">14</span><span class="p">:</span><span class="mi">04</span><span class="p">:</span><span class="mi">38</span> <span class="mi">2012</span><span class="o">-</span><span class="mi">06</span><span class="o">-</span><span class="mi">03</span>
<span class="n">Title</span><span class="p">:</span> <span class="n">LSCO</span> <span class="n">x</span><span class="o">=</span><span class="mf">0.02</span> <span class="p">(</span><span class="mi">224</span><span class="o">-</span><span class="mi">227</span><span class="p">),</span> <span class="n">T</span><span class="o">=</span><span class="mf">12.00</span> <span class="p">(</span><span class="n">K</span><span class="p">),</span> <span class="n">E</span><span class="o">=</span><span class="mf">5.57</span> <span class="n">keV</span><span class="p">,</span> <span class="n">WEW</span> <span class="n">B</span><span class="o">=~</span><span class="mi">49</span><span class="p">(</span><span class="n">G</span><span class="p">)</span><span class="o">/</span><span class="mf">8.62</span><span class="p">(</span><span class="n">A</span><span class="p">),</span> <span class="n">Tr</span><span class="o">=</span><span class="mf">15.02</span> <span class="p">(</span><span class="n">kV</span><span class="p">),</span> <span class="n">Sample</span><span class="o">=</span><span class="mf">8.70</span> <span class="p">(</span><span class="n">kV</span><span class="p">),</span> <span class="n">SpinRot</span> <span class="o">-</span><span class="mi">10</span>
<span class="n">Field</span><span class="p">:</span> <span class="mf">49.11</span>
<span class="n">Setup</span><span class="p">:</span> <span class="n">Sample</span><span class="p">,</span> <span class="n">WEW</span><span class="p">,</span> <span class="n">LowTemp</span><span class="o">-</span><span class="mi">2</span>
<span class="n">Temp</span><span class="p">:</span> <span class="mf">11.999</span>
<span class="n">TOF</span><span class="p">(</span><span class="n">M3S1</span><span class="p">):</span> <span class="n">nocut</span>
<span class="n">Groups</span><span class="p">:</span> <span class="mi">8</span>
<span class="n">Channels</span><span class="p">:</span> <span class="mi">66601</span>
<span class="n">Resolution</span><span class="p">:</span> <span class="mf">0.0001953125</span>
</pre></div>
</div>
<p>The header ends with an empty line.</p>
<p>The data are stored as following: there are always 10 bin-counts per line.
Between detectors, there will be an empty line.</p>
</div>
</div>
</div>
</div>
<footer>
<div class="rst-footer-buttons" role="navigation" aria-label="footer navigation">
<a href="musr-root.html" class="btn btn-neutral float-right" title="MusrRoot - an Extensible Open File Format for μSR" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="any2many.html" class="btn btn-neutral" title="any2many - a Universal μSR-file-format converter" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
<hr/>
<div role="contentinfo">
<p>
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 24, 2023.
</p>
</div>
Built with <a href="http://sphinx-doc.org/">Sphinx</a> using a <a href="https://github.com/rtfd/sphinx_rtd_theme">theme</a> provided by <a href="https://readthedocs.org">Read the Docs</a>.
</footer>
</div>
</div>
</section>
</div>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
HAS_SOURCE: true,
SOURCELINK_SUFFIX: '.txt'
};
</script>
<script type="text/javascript" src="_static/jquery.js"></script>
<script type="text/javascript" src="_static/underscore.js"></script>
<script type="text/javascript" src="_static/doctools.js"></script>
<script type="text/javascript" src="https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.1/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<script type="text/javascript" src="_static/js/theme.js"></script>
<script type="text/javascript">
jQuery(function () {
SphinxRtdTheme.Navigation.enable(true);
});
</script>
</body>
</html>

View File

@ -9,7 +9,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Index &mdash; musrfit 1.8.2 documentation</title>
<title>Index &mdash; musrfit 1.9.1 documentation</title>
@ -57,6 +57,10 @@
<div class="version">
1.9
</div>
@ -89,6 +93,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -179,6 +184,7 @@
| <a href="#T"><strong>T</strong></a>
| <a href="#U"><strong>U</strong></a>
| <a href="#V"><strong>V</strong></a>
| <a href="#W"><strong>W</strong></a>
| <a href="#X"><strong>X</strong></a>
</div>
@ -201,13 +207,15 @@
</li>
<li><a href="user-manual.html#index-37">addt0-asymmetry</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-manual.html#index-36">addt0-single-histo</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-manual.html#index-22">alpha-beta</a>
</li>
<li><a href="any2many.html#index-0">any2many</a>, <a href="user-manual.html#index-8">[1]</a>
</li>
<li><a href="file-formats.html#index-1">ascii-file-format</a>
</li>
<li><a href="user-manual.html#index-71">asymmetry-fit</a>
</li>
@ -235,7 +243,7 @@
</li>
<li><a href="user-manual.html#index-74">bnmr-asymmetry-fit</a>
</li>
<li><a href="user-libs.html#index-14">BNMR-libs</a>
<li><a href="user-libs.html#index-16">BNMR-libs</a>
</li>
<li><a href="setup-standard.html#index-2">boost-c++</a>
</li>
@ -259,16 +267,22 @@
<h2 id="D">D</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="file-formats.html#index-3">dat-file-format</a>
</li>
<li><a href="user-manual.html#index-33">data-asymmetry</a>
</li>
<li><a href="user-manual.html#index-32">data-single-histo</a>
</li>
<li><a href="setup-dks.html#index-0">dks</a>
<li><a href="file-formats.html#index-2">db-file-format</a>
</li>
<li><a href="user-manual.html#index-43">dks-command-overview</a>
<li><a href="user-libs.html#index-15">DepthProf-lib</a>
</li>
<li><a href="setup-dks.html#index-0">dks</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-manual.html#index-43">dks-command-overview</a>
</li>
<li><a href="setup-dks.html#index-3">dks-install</a>
</li>
<li><a href="setup-dks.html#index-5">dks-opencl-macOS</a>
@ -285,7 +299,7 @@
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-libs.html#index-17">ExpRlx</a>
<li><a href="user-libs.html#index-19">ExpRlx</a>
</li>
</ul></td>
</tr></table>
@ -294,6 +308,8 @@
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="setup-standard.html#index-4">fftw</a>
</li>
<li><a href="file-formats.html#index-0">file-formats</a>
</li>
<li><a href="user-manual.html#index-39">fit</a>
</li>
@ -304,11 +320,11 @@
<li><a href="user-manual.html#index-27">forward</a>
</li>
<li><a href="user-manual.html#index-28">forward-backward</a>
</li>
<li><a href="user-manual.html#index-50">fourier-block-apodization</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-manual.html#index-50">fourier-block-apodization</a>
</li>
<li><a href="user-manual.html#index-49">fourier-block-dc-corrected</a>
</li>
<li><a href="user-manual.html#index-48">fourier-block-fourier_power</a>
@ -357,11 +373,11 @@
<h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-libs.html#index-21">Ianiso</a>
<li><a href="user-libs.html#index-23">Ianiso</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-libs.html#index-20">Iax</a>
<li><a href="user-libs.html#index-22">Iax</a>
</li>
</ul></td>
</tr></table>
@ -369,11 +385,11 @@
<h2 id="L">L</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-libs.html#index-15">libBNMR</a>
<li><a href="user-libs.html#index-17">libBNMR</a>
</li>
<li><a href="user-libs.html#index-2">libFitPofB</a>
</li>
<li><a href="user-libs.html#index-19">libLineProfile</a>
<li><a href="user-libs.html#index-21">libLineProfile</a>
</li>
<li><a href="setup-standard.html#index-6">libxml2</a>
</li>
@ -381,15 +397,15 @@
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-libs.html#index-22">LineGauss</a>
<li><a href="user-libs.html#index-24">LineGauss</a>
</li>
<li><a href="user-libs.html#index-24">LineLaplace</a>
<li><a href="user-libs.html#index-26">LineLaplace</a>
</li>
<li><a href="user-libs.html#index-23">LineLorentzian</a>
<li><a href="user-libs.html#index-25">LineLorentzian</a>
</li>
<li><a href="user-libs.html#index-25">LineSkewLorentzian</a>
<li><a href="user-libs.html#index-27">LineSkewLorentzian</a>
</li>
<li><a href="user-libs.html#index-26">LineSkewLorentzian2</a>
<li><a href="user-libs.html#index-28">LineSkewLorentzian2</a>
</li>
</ul></td>
</tr></table>
@ -400,6 +416,8 @@
<li><a href="setup-standard.html#index-21">macports</a>
</li>
<li><a href="user-manual.html#index-26">map</a>
</li>
<li><a href="file-formats.html#index-4">mdu-file-format</a>
</li>
<li><a href="user-manual.html#index-17">meta-information</a>
</li>
@ -463,10 +481,12 @@
</li>
<li><a href="user-manual.html#index-7">msr2msr</a>
</li>
<li><a href="mupp.html#index-0">mupp</a>
<li><a href="file-formats.html#index-5">mud-file-format</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="mupp.html#index-0">mupp</a>
</li>
<li><a href="mupp.html#index-1">mupp-gui</a>
</li>
<li><a href="mupp.html#index-2">mupp-scripting</a>
@ -547,13 +567,17 @@
</li>
<li><a href="setup-standard.html#index-25">nexus-build-homebrew</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="setup-standard.html#index-15">nexus-build-linux</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="setup-standard.html#index-22">nexus-build-macports</a>
</li>
<li><a href="file-formats.html#index-6">nexus-file-format</a>
</li>
<li><a href="user-manual.html#index-75">non-musr-fit</a>
</li>
<li><a href="user-libs.html#index-14">nonlocal-libs</a>
</li>
<li><a href="user-manual.html#index-23">norm</a>
</li>
@ -573,15 +597,17 @@
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-manual.html#index-40">packing</a>
</li>
<li><a href="user-libs.html#index-30">PowderLineAsymGss</a>
<li><a href="user-libs.html#index-32">PowderLineAsymGss</a>
</li>
<li><a href="user-libs.html#index-31">PowderLineAsymLor</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-libs.html#index-29">PowderLineAsymLor</a>
<li><a href="user-libs.html#index-30">PowderLineAxialGss</a>
</li>
<li><a href="user-libs.html#index-28">PowderLineAxialGss</a>
<li><a href="user-libs.html#index-29">PowderLineAxialLor</a>
</li>
<li><a href="user-libs.html#index-27">PowderLineAxialLor</a>
<li><a href="file-formats.html#index-7">psi-bin-file-format</a>
</li>
</ul></td>
</tr></table>
@ -601,13 +627,15 @@
</li>
<li><a href="setup-standard.html#index-26">root-build-homebrew</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="setup-standard.html#index-16">root-build-linux</a>
</li>
</ul></td>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="setup-standard.html#index-23">root-build-macports</a>
</li>
<li><a href="setup-standard.html#index-5">root-cern</a>
</li>
<li><a href="file-formats.html#index-8">root-file-format</a>
</li>
</ul></td>
</tr></table>
@ -617,7 +645,7 @@
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="setup-standard.html#index-0">setup</a>
</li>
<li><a href="user-libs.html#index-18">SExpRlx</a>
<li><a href="user-libs.html#index-20">SExpRlx</a>
</li>
<li><a href="user-manual.html#index-69">single-histogram-fit</a>
</li>
@ -625,7 +653,7 @@
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="user-manual.html#index-70">single-histogram-rrf-fit</a>
</li>
<li><a href="user-libs.html#index-16">SLR</a>
<li><a href="user-libs.html#index-18">SLR</a>
</li>
<li><a href="setup-standard.html#index-1">supported-operating-systems</a>
</li>
@ -692,6 +720,14 @@
</ul></td>
</tr></table>
<h2 id="W">W</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
<li><a href="file-formats.html#index-9">wkm-file-format</a>
</li>
</ul></td>
</tr></table>
<h2 id="X">X</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%; vertical-align: top;"><ul>
@ -712,8 +748,8 @@
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 24, 2023.
</p>
</div>
@ -735,7 +771,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.8.2 documentation</title>
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.9.1 documentation</title>
@ -57,6 +57,10 @@
<div class="version">
1.9
</div>
@ -89,6 +93,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -178,6 +183,7 @@
<li class="toctree-l1"><a class="reference internal" href="user-libs.html">Documentation of user libs (user functions)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="user-libs.html#meissner-profiles-vortex-lattice-related-functions-bmw-libs">Meissner-Profiles / Vortex-Lattice related functions (BMW libs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-libs.html#nonlocal-superconductivity-related-meissner-screening-functions-as-libs">Nonlocal superconductivity related Meissner screening functions (AS libs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-libs.html#depth-resolved-information-as-libs">Depth resolved information (AS libs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-libs.html#functions-to-analyze-bgr-nmr-data-bnmr-libs">Functions to analyze β-NMR data (BNMR libs)</a></li>
</ul>
</li>
@ -218,6 +224,19 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a><ul>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#ascii-file-format-for-non-mgrsr">ASCII file format for non-μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#db-file-format-for-non-mgrsr">DB file format for non-μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#dat-csv-like-file-format-for-non-mgrsr">DAT: CSV like file format for non-μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#mdu-file-format-psi-for-mgrsr">MDU file format (psi) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#mud-file-format-triumf-for-mgrsr">MUD file format (triumf) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#musrroot-file-format-psi-for-mgrsr">MusrRoot file format (PSI) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#nexus-file-format-isis-for-mgrsr">NeXus file format (isis) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#psi-bin-file-format-psi-for-mgrsr">PSI-BIN file format (psi) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#root-file-format-psi-lem-before-2012-for-mgrsr">ROOT file format (psi/lem before 2012) for μSR</a></li>
<li class="toctree-l2"><a class="reference internal" href="file-formats.html#wkm-file-format-for-mgrsr">WKM file format for μSR</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a><ul>
<li class="toctree-l2"><a class="reference internal" href="musr-root.html#some-basics-concerning-root-files">Some Basics Concerning ROOT Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="musr-root.html#id1">MusrRoot an Extensible Open File Format for μSR</a></li>
@ -262,8 +281,8 @@
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 24, 2023.
</p>
</div>
@ -285,7 +304,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files &mdash; musrfit 1.8.2 documentation</title>
<title>msr2data - A Program for Automatically Processing Multiple musrfit msr Files &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -105,6 +109,7 @@
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -510,8 +515,8 @@ fit serves as template for the second and so on. The template field stays empty
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -533,7 +538,7 @@ fit serves as template for the second and so on. The template field stays empty
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.8.2 documentation</title>
<title>mupp - μSR Parameter Plotter &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -98,6 +102,7 @@
</li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -400,8 +405,8 @@ SCRIPT COMMANDS:
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -423,7 +428,7 @@ SCRIPT COMMANDS:
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>MusrRoot - an Extensible Open File Format for μSR &mdash; musrfit 1.8.2 documentation</title>
<title>MusrRoot - an Extensible Open File Format for μSR &mdash; musrfit 1.9.1 documentation</title>
@ -30,7 +30,7 @@
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Acknowledgements" href="acknowledgement.html" />
<link rel="prev" title="any2many - a Universal μSR-file-format converter" href="any2many.html" />
<link rel="prev" title="Short description and references to the supported file-formats" href="file-formats.html" />
<script src="_static/js/modernizr.min.js"></script>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -90,6 +94,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1 current"><a class="current reference internal" href="#">MusrRoot - an Extensible Open File Format for μSR</a><ul>
<li class="toctree-l2"><a class="reference internal" href="#some-basics-concerning-root-files">Some Basics Concerning ROOT Files</a></li>
<li class="toctree-l2"><a class="reference internal" href="#id1">MusrRoot an Extensible Open File Format for μSR</a><ul>
@ -990,7 +995,7 @@ the entry has been added. The last token, <code class="docutils literal notransl
<a href="acknowledgement.html" class="btn btn-neutral float-right" title="Acknowledgements" accesskey="n" rel="next">Next <span class="fa fa-arrow-circle-right"></span></a>
<a href="any2many.html" class="btn btn-neutral" title="any2many - a Universal μSR-file-format converter" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
<a href="file-formats.html" class="btn btn-neutral" title="Short description and references to the supported file-formats" accesskey="p" rel="prev"><span class="fa fa-arrow-circle-left"></span> Previous</a>
</div>
@ -999,8 +1004,8 @@ the entry has been added. The last token, <code class="docutils literal notransl
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -1022,7 +1027,7 @@ the entry has been added. The last token, <code class="docutils literal notransl
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>musredit: the GUI Based Interface to musrfit &mdash; musrfit 1.8.2 documentation</title>
<title>musredit: the GUI Based Interface to musrfit &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -110,6 +114,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -626,8 +631,8 @@ the corresponding fit parameter value, except the phases where the step will be
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -649,7 +654,7 @@ the corresponding fit parameter value, except the phases where the step will be
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

Binary file not shown.

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Search &mdash; musrfit 1.8.2 documentation</title>
<title>Search &mdash; musrfit 1.9.1 documentation</title>
@ -56,6 +56,10 @@
<div class="version">
1.9
</div>
@ -88,6 +92,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -177,8 +182,8 @@
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 24, 2023.
</p>
</div>
@ -200,7 +205,7 @@
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

File diff suppressed because one or more lines are too long

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Setting up musrfit / DKS: High Speed Fitting with GPUs &mdash; musrfit 1.8.2 documentation</title>
<title>Setting up musrfit / DKS: High Speed Fitting with GPUs &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -109,6 +113,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -400,8 +405,8 @@ The only thing you need <code class="docutils literal notranslate"><span class="
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -423,7 +428,7 @@ The only thing you need <code class="docutils literal notranslate"><span class="
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.8.2 documentation</title>
<title>Setting up musrfit on Different Platforms &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -134,6 +138,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -1087,8 +1092,8 @@ $ musrview test-histo-ROOT-NPP.msr
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -1110,7 +1115,7 @@ $ musrview test-histo-ROOT-NPP.msr
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Tutorial for musrfit &mdash; musrfit 1.8.2 documentation</title>
<title>Tutorial for musrfit &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -102,6 +106,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -519,8 +524,8 @@ For a complete description please refer to the manuals of <a class="reference in
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -542,7 +547,7 @@ For a complete description please refer to the manuals of <a class="reference in
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Documentation of user libs (user functions) &mdash; musrfit 1.8.2 documentation</title>
<title>Documentation of user libs (user functions) &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -95,6 +99,7 @@
</ul>
</li>
<li class="toctree-l2"><a class="reference internal" href="#nonlocal-superconductivity-related-meissner-screening-functions-as-libs">Nonlocal superconductivity related Meissner screening functions (AS libs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#depth-resolved-information-as-libs">Depth resolved information (AS libs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="#functions-to-analyze-bgr-nmr-data-bnmr-libs">Functions to analyze β-NMR data (BNMR libs)</a><ul>
<li class="toctree-l3"><a class="reference internal" href="#libbnmr">libBNMR</a><ul>
<li class="toctree-l4"><a class="reference internal" href="#functions">Functions</a></li>
@ -114,6 +119,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -498,11 +504,120 @@ The expected name of the <code class="docutils literal notranslate"><span class=
</div>
</div>
<div class="section" id="nonlocal-superconductivity-related-meissner-screening-functions-as-libs">
<h2>Nonlocal superconductivity related Meissner screening functions (AS libs)<a class="headerlink" href="#nonlocal-superconductivity-related-meissner-screening-functions-as-libs" title="Permalink to this headline"></a></h2>
<p>To be written yet …</p>
<span id="nonlocal-libs"></span><span id="index-14"></span><h2>Nonlocal superconductivity related Meissner screening functions (AS libs)<a class="headerlink" href="#nonlocal-superconductivity-related-meissner-screening-functions-as-libs" title="Permalink to this headline"></a></h2>
<p>This library allows to calculate the magnetic field profile <span class="math notranslate nohighlight">\(B(z)\)</span> for nonlocal superconductors.
For details see <a class="reference external" href="http://dx.doi.org/10.1103/PhysRevLett.95.197201">A. Suter, et al., PRB 72, 024506 (2005)</a>, and references therein.</p>
<p>The provided function calculates the muon spin polarization</p>
<div class="math notranslate nohighlight">
\[P(t, E) = \int n(z, E)\, \cos(\gamma_\mu B(z) t + \phi) \, dz,\]</div>
<p>where <span class="math notranslate nohighlight">\(B(z)\)</span> is calculated in the limit of specular reflection.
The corresponding user function is called as</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libPNL_PippardFitter</span> <span class="n">PNL_PippardFitter</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span> <span class="mi">4</span> <span class="mi">5</span> <span class="mi">6</span> <span class="mi">7</span> <span class="mi">8</span> <span class="mi">9</span>
</pre></div>
</div>
<p>with the parameters</p>
<ol class="arabic simple">
<li>implantation energy in (keV).</li>
<li>reduced temperature <span class="math notranslate nohighlight">\(t=T/T_c\)</span>.</li>
<li>thickness in (nm).</li>
<li>electron mean path, <span class="math notranslate nohighlight">\(\ell\)</span> in (nm).</li>
<li>superconducting coherence length, <span class="math notranslate nohighlight">\(\xi\)</span> in (nm).</li>
<li>London penetration length, <span class="math notranslate nohighlight">\(\lambda_{\rm L}\)</span> in (nm).</li>
<li>external magnetic field strength in (G).</li>
<li>the effective detector phase, <span class="math notranslate nohighlight">\(\varphi\)</span> in <span class="math notranslate nohighlight">\((^\circ)\)</span>.</li>
<li>a “dead layer” thickness in (nm).</li>
</ol>
<p>Typically this function needs to be multiplied by a Gaussian in order to take into account: nuclear dipole broadening, partial trapped flux, etc.</p>
<p>In order to find the muon stopping profile, <span class="math notranslate nohighlight">\(n(z,E)\)</span>, needed for the calculation, the library needs to find the corresponding trimsp
rge-files (muon stoppping profiles). For this the library reads at start-up the following xml-file (example):</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="nt">&lt;nonlocal</span> <span class="na">xmlns=</span><span class="s">&quot;http://nemu.web.psi.ch/musrfit/nonlocal&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;comment&gt;</span>
nonlocal_startup.xml
<span class="nt">&lt;/comment&gt;</span>
<span class="nt">&lt;nonlocal_par&gt;</span>
<span class="nt">&lt;fourier_points&gt;</span>262144<span class="nt">&lt;/fourier_points&gt;</span>
<span class="nt">&lt;/nonlocal_par&gt;</span>
<span class="nt">&lt;trim_sp&gt;</span>
<span class="nt">&lt;data_path&gt;</span>./profiles/<span class="nt">&lt;/data_path&gt;</span>
<span class="nt">&lt;rge_fln_pre&gt;</span>Sn_E<span class="nt">&lt;/rge_fln_pre&gt;</span>
<span class="nt">&lt;energy_list&gt;</span>
<span class="nt">&lt;energy&gt;</span>1000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>2000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>4000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>6000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>8000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>10000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>12000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>14100<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>18000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>22000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>25000<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;energy&gt;</span>27300<span class="nt">&lt;/energy&gt;</span>
<span class="nt">&lt;/energy_list&gt;</span>
<span class="nt">&lt;/trim_sp&gt;</span>
<span class="nt">&lt;/nonlocal&gt;</span>
</pre></div>
</div>
<p>Here the number of Fourier points needed in the calculation can be defined (<code class="docutils literal notranslate"><span class="pre">fourier_points</span></code>). The <code class="docutils literal notranslate"><span class="pre">trim_sp</span></code> section
contains all the information needed to load the proper muon stopping profiles. <code class="docutils literal notranslate"><span class="pre">data_path</span></code> is the path to the needed rge-files.
<code class="docutils literal notranslate"><span class="pre">rge_fln_pre</span></code> is the rge-file prefix, and <code class="docutils literal notranslate"><span class="pre">energy</span></code> are all the energy tags. E.g. <code class="docutils literal notranslate"><span class="pre">./profile/Sn_E1000.rge</span></code> would be the first
muon stopping profile for an energy of <span class="math notranslate nohighlight">\(E=1000\)</span> (eV).</p>
<p>The name of the xml-file has to be <code class="docutils literal notranslate"><span class="pre">nonlocal_startup.xml</span></code> and needs to be placed in the directory where the analysis takes place, i.e.
in the directory of all the msr-files.</p>
</div>
<div class="section" id="depth-resolved-information-as-libs">
<span id="depthprof-lib"></span><span id="index-15"></span><h2>Depth resolved information (AS libs)<a class="headerlink" href="#depth-resolved-information-as-libs" title="Permalink to this headline"></a></h2>
<p>A method to extract depth-resolved information from the implantation energy dependence of the experimental parameters in a low-energy
muon spin spectroscopy experiment. For details see <a class="reference external" href="https://doi.org/10.1063/1.5126529">A. F. A. Simões, et al. Review of Scientific Instruments. 2020; 91(2): 023906 (7 pp.)</a>.</p>
<p>If you have a layered material (e.g. <span class="math notranslate nohighlight">\(N\)</span> layers), properties like the asymmetry might depend on the layer in which the muons are stopped.
For instance there might be different probabilities for muonium formation depending on the material, charge transfer layers, etc.</p>
<p>Since the muon stopping distribution, <span class="math notranslate nohighlight">\(n(z)\)</span>, has some finite range, these properties will be smeared out. For the following we define
the stopping probability, <span class="math notranslate nohighlight">\(p_{i}(E)\)</span> for a finite slice <span class="math notranslate nohighlight">\(i\)</span>, ranging from <span class="math notranslate nohighlight">\(z \in [a, b]\)</span> as</p>
<div class="math notranslate nohighlight">
\[p_{i}(E) = \int_a^b n(z,E) \, dz\]</div>
<p>Furthermore it is assumes that there is a sharp transition between the layers of the property of interest, e.g. the diamagnetic fraction, <span class="math notranslate nohighlight">\(f_i\)</span>.
Hence the measured property as function of energy is</p>
<div class="math notranslate nohighlight">
\[f(E) = \sum_{i=1}^N p_{i}(E) \cdot f_i.\]</div>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Currently it is recommended to read in the data in ASCII or DAT format as a non-μSR fit <a class="reference internal" href="user-manual.html#non-musr-fit"><span class="std std-ref">(fit type 8)</span></a>.</p>
</div>
<p>The user library for the depth profile analysis looks for a <strong>3 layer material</strong>, assuming one is looking for the diamagnetic fraction, like</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="c1">###############################################################</span>
<span class="n">FITPARAMETER</span>
<span class="c1"># Nr. Name Value Step Pos_Error Boundaries</span>
<span class="mi">1</span> <span class="n">f1</span> <span class="mf">0.54540</span> <span class="mf">0.00072</span> <span class="n">none</span> <span class="mi">0</span> <span class="mi">1</span>
<span class="mi">2</span> <span class="n">f2</span> <span class="mf">0.23957</span> <span class="mf">0.00048</span> <span class="n">none</span>
<span class="mi">3</span> <span class="n">f3</span> <span class="mf">0.05615</span> <span class="mf">0.00047</span> <span class="n">none</span> <span class="mi">0</span> <span class="mi">1</span>
<span class="mi">4</span> <span class="n">x1</span> <span class="mf">63.5000</span> <span class="mf">0.0014</span> <span class="n">none</span>
<span class="mi">5</span> <span class="n">x2</span> <span class="mf">101.5001</span> <span class="mf">0.0044</span> <span class="n">none</span>
<span class="c1">###############################################################</span>
<span class="n">THEORY</span>
<span class="n">userFcn</span> <span class="n">libPDepthProfile</span> <span class="n">PDepthProfile</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span> <span class="mi">4</span> <span class="mi">5</span>
</pre></div>
</div>
<p>Here, <span class="math notranslate nohighlight">\(f1\)</span> is the diamagnetic fraction of the first layer, etc. <span class="math notranslate nohighlight">\(x1\)</span> is the thickness of the first layer, etc.</p>
<p>In order to find the muon stopping profile, <span class="math notranslate nohighlight">\(n(z,E)\)</span>, needed for the calculation, the library needs to find the corresponding trimsp
rge-files (muon stoppping profiles). For this the library reads at start-up the following xml-file (example):</p>
<div class="highlight-xml notranslate"><div class="highlight"><pre><span></span><span class="cp">&lt;?xml version=&quot;1.0&quot; encoding=&quot;UTF-8&quot;?&gt;</span>
<span class="nt">&lt;depthProf</span> <span class="na">xmlns=</span><span class="s">&quot;http://nemu.web.psi.ch/musrfit/depthProf&quot;</span><span class="nt">&gt;</span>
<span class="nt">&lt;comment&gt;</span>
TrimSp information
<span class="nt">&lt;/comment&gt;</span>
<span class="nt">&lt;trim_sp&gt;</span>
<span class="nt">&lt;data_path&gt;</span>./TRIMSP/<span class="nt">&lt;/data_path&gt;</span>
<span class="nt">&lt;rge_fln_pre&gt;</span>SiO2_70nm2.0_30nm2.2_SiC_E<span class="nt">&lt;/rge_fln_pre&gt;</span>
<span class="nt">&lt;energy_vect</span> <span class="na">start=</span><span class="s">&quot;1000&quot;</span> <span class="na">stop=</span><span class="s">&quot;22000&quot;</span> <span class="na">step=</span><span class="s">&quot;1000&quot;</span><span class="nt">/&gt;</span>
<span class="nt">&lt;/trim_sp&gt;</span>
<span class="nt">&lt;/depthProf&gt;</span>
</pre></div>
</div>
</div>
<div class="section" id="functions-to-analyze-bgr-nmr-data-bnmr-libs">
<span id="bnmr-libs"></span><span id="index-14"></span><h2>Functions to analyze β-NMR data (BNMR libs)<a class="headerlink" href="#functions-to-analyze-bgr-nmr-data-bnmr-libs" title="Permalink to this headline"></a></h2>
<span id="bnmr-libs"></span><span id="index-16"></span><h2>Functions to analyze β-NMR data (BNMR libs)<a class="headerlink" href="#functions-to-analyze-bgr-nmr-data-bnmr-libs" title="Permalink to this headline"></a></h2>
<p>This is a collection of <code class="docutils literal notranslate"><span class="pre">C++</span></code> classes using the <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> <a class="reference internal" href="user-manual.html#id38"><span class="std std-ref">user-functions</span></a>
interface in order to facilitate the usage in conjunction with <code class="docutils literal notranslate"><span class="pre">musrfit</span></code>. It consists of two libraries:</p>
<ul class="simple">
@ -514,11 +629,11 @@ interface in order to facilitate the usage in conjunction with <code class="docu
<p class="last">Currently it is recommended to read in the data in ASCII format as a non-μSR fit <a class="reference internal" href="user-manual.html#non-musr-fit"><span class="std std-ref">(fit type 8)</span></a>.</p>
</div>
<div class="section" id="libbnmr">
<span id="index-15"></span><h3>libBNMR<a class="headerlink" href="#libbnmr" title="Permalink to this headline"></a></h3>
<span id="index-17"></span><h3>libBNMR<a class="headerlink" href="#libbnmr" title="Permalink to this headline"></a></h3>
<p>In β-NMR the SLR is usually measured by implanting a pulse of <span class="math notranslate nohighlight">\(^8\)</span>Li with a length <span class="math notranslate nohighlight">\(t_0\)</span> into the sample.
The asymmetry is measured both during the pulse and afterwards. For a a general spin relaxation function <span class="math notranslate nohighlight">\(f(t)\)</span> the time evolution of the asymmetry is then given by [<a class="reference external" href="http://dx.doi.org/10.1103/PhysRevLett.96.147601">Z. Salman, et al., PRL 96, 147601 (2006)</a>]:</p>
<div class="math notranslate nohighlight" id="slr">
<span id="index-16"></span>\[\begin{split}P(t) = \left\{\begin{matrix}
<span id="index-18"></span>\[\begin{split}P(t) = \left\{\begin{matrix}
\frac{\int_0^t e^{-(t-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^t e^{-t'/\tau_{\mathrm{Li}}}dt' } &amp; t\leq t_0\\[6pt]
\frac{\int_0^{t_0}e^{-(t_0-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^{t_0}e^{-t'/\tau_{\mathrm{Li}}}dt'} &amp; t&gt; t_0,
\end{matrix}\right.\end{split}\]</div>
@ -526,7 +641,7 @@ The asymmetry is measured both during the pulse and afterwards. For a a general
<div class="section" id="functions">
<h4>Functions<a class="headerlink" href="#functions" title="Permalink to this headline"></a></h4>
<p>The <code class="docutils literal notranslate"><span class="pre">libBNMR</span></code> library currently contains the following functions:</p>
<p id="index-17"><strong>Exponential relaxation</strong></p>
<p id="index-19"><strong>Exponential relaxation</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libBNMR</span> <span class="n">ExpRlx</span> <span class="mi">1</span> <span class="mi">2</span>
</pre></div>
</div>
@ -536,7 +651,7 @@ The asymmetry is measured both during the pulse and afterwards. For a a general
<li>relaxation rate <span class="math notranslate nohighlight">\(\lambda\)</span> (s<span class="math notranslate nohighlight">\(^{-1}\)</span>)</li>
</ol>
<p>This function implements <span class="math notranslate nohighlight">\(f(t)=e^{-\lambda t}\)</span>.</p>
<p id="index-18"><strong>Stretched exponential relaxation</strong></p>
<p id="index-20"><strong>Stretched exponential relaxation</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libBNMR</span> <span class="n">SExpRlx</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span>
</pre></div>
</div>
@ -550,19 +665,19 @@ The asymmetry is measured both during the pulse and afterwards. For a a general
</div>
</div>
<div class="section" id="liblineprofile">
<span id="index-19"></span><h3>libLineProfile<a class="headerlink" href="#liblineprofile" title="Permalink to this headline"></a></h3>
<span id="index-21"></span><h3>libLineProfile<a class="headerlink" href="#liblineprofile" title="Permalink to this headline"></a></h3>
<p>In addition to some simple line shapes <code class="docutils literal notranslate"><span class="pre">libLineProfile</span></code> contains functions to fit chemical shift anisotropies in the powder average.
Their functional form can be found in <a class="reference external" href="http://dx.doi.org/10.1007/978-3-642-68756-3_2">M. Mehring, Principles of High Resolution NMR in Solids (Springer 1983)</a>.</p>
<p>For an axially symmetric interaction it is given by:</p>
<div class="math notranslate nohighlight" id="iax">
<span id="index-20"></span>\[\begin{split}I_{\mathrm ax}(f)=\left\{\begin{matrix} \frac{1}{2\sqrt{(f_\parallel-f_\perp)(f-f_\perp)}}&amp; f\in(f_\perp,f_\parallel)\cup(f_\parallel,f_\perp)\\[6pt] 0 &amp; \text{otherwise}\end{matrix} \right.\end{split}\]</div>
<span id="index-22"></span>\[\begin{split}I_{\mathrm ax}(f)=\left\{\begin{matrix} \frac{1}{2\sqrt{(f_\parallel-f_\perp)(f-f_\perp)}}&amp; f\in(f_\perp,f_\parallel)\cup(f_\parallel,f_\perp)\\[6pt] 0 &amp; \text{otherwise}\end{matrix} \right.\end{split}\]</div>
<p>where <span class="math notranslate nohighlight">\(f_\parallel\)</span> and <span class="math notranslate nohighlight">\(f_\perp\)</span> are the frequencies that would be observed if the field is oriented paralell or perpendicular to the symmetry axis, respectively.</p>
<div class="line-block">
<div class="line">In case of a completely anisotropic interaction, the powder average can be described by the frequencies along the three principle axis <span class="math notranslate nohighlight">\(f_1,f_2,f_3\)</span>.</div>
<div class="line">Assume without loss of generality that <span class="math notranslate nohighlight">\(f_1&lt;f_2&lt;f_3\)</span>, then</div>
</div>
<div class="math notranslate nohighlight" id="ianiso">
<span id="index-21"></span>\[\begin{split}I(f)&amp;=\left\{\begin{matrix}
<span id="index-23"></span>\[\begin{split}I(f)&amp;=\left\{\begin{matrix}
\frac{K(m)}{\pi\sqrt{(f-f_1)(f_3-f_2)}},&amp; f_3\geq f&gt;f_2 \\[9pt]
\frac{K(m)}{\pi\sqrt{(f_3-f)(f_2-f_1)}},&amp; f_2&gt;f\geq f_1\\[9pt]
0 &amp; \text{otherwise}
@ -578,7 +693,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<div class="section" id="id1">
<h4>Functions<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h4>
<p>The <code class="docutils literal notranslate"><span class="pre">libLineProfile</span></code> library currently contains the following functions:</p>
<p id="index-22"><strong>Gaussian</strong></p>
<p id="index-24"><strong>Gaussian</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">LineGauss</span> <span class="mi">1</span> <span class="mi">2</span>
</pre></div>
</div>
@ -593,7 +708,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
</div>
<div class="math notranslate nohighlight">
\[A(f)=e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}}\]</div>
<p id="index-23"><strong>Lorentzian</strong></p>
<p id="index-25"><strong>Lorentzian</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">LineLorentzian</span> <span class="mi">1</span> <span class="mi">2</span>
</pre></div>
</div>
@ -608,7 +723,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
</div>
<div class="math notranslate nohighlight">
\[A(f)= \frac{w^2}{4(f-f_0)^2+w^2}\]</div>
<p id="index-24"><strong>Laplacian</strong></p>
<p id="index-26"><strong>Laplacian</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">LineLaplace</span> <span class="mi">1</span> <span class="mi">2</span>
</pre></div>
</div>
@ -623,7 +738,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
</div>
<div class="math notranslate nohighlight">
\[A(f)=e^{-2\ln 2 \left|\frac{f-f_0}{w}\right|}\]</div>
<p id="index-25"><strong>Skewed Lorentzian</strong></p>
<p id="index-27"><strong>Skewed Lorentzian</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">LineSkewLorentzian</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span>
</pre></div>
</div>
@ -639,7 +754,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
</div>
<div class="math notranslate nohighlight">
\[A(f)= \frac{w w_a}{4(f-f_0)^2+w_a^2}, \quad w_a=\frac{2w}{1+e^{a(f-f_0)}}\]</div>
<p id="index-26"><strong>Skewed Lorentzian 2</strong></p>
<p id="index-28"><strong>Skewed Lorentzian 2</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">LineSkewLorentzian2</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span>
</pre></div>
</div>
@ -655,7 +770,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
</div>
<div class="math notranslate nohighlight">
\[\begin{split}A(f)= \left\{\begin{matrix}\frac{{w_1}^2}{4{(f-f_0)}^2+{w_1}^2},&amp;f\leq f_0\\[9pt] \frac{{w_2}^2}{4{(f-f_0)}^2+{w_2}^2},&amp;f&gt;f_0\end{matrix}\right.\end{split}\]</div>
<p id="index-27"><strong>Powder average of an axially symmetric interaction convoluted with a Lorentzian</strong></p>
<p id="index-29"><strong>Powder average of an axially symmetric interaction convoluted with a Lorentzian</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">PowderLineAxialLor</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span>
</pre></div>
</div>
@ -672,7 +787,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<div class="math notranslate nohighlight">
\[A(f)= I_{\mathrm ax}(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)\]</div>
<p>with <span class="math notranslate nohighlight">\(I_{\mathrm ax}(f)\)</span> defined <a class="reference internal" href="#iax"><span class="std std-ref">above</span></a>.</p>
<p id="index-28"><strong>Powder average of an axially symmetric interaction convoluted with a Gaussian</strong></p>
<p id="index-30"><strong>Powder average of an axially symmetric interaction convoluted with a Gaussian</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">PowderLineAxialGss</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span>
</pre></div>
</div>
@ -689,7 +804,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<div class="math notranslate nohighlight">
\[A(f)= I_{\mathrm ax}(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)\]</div>
<p>with <span class="math notranslate nohighlight">\(I_{\mathrm ax}(f)\)</span> defined <a class="reference internal" href="#iax"><span class="std std-ref">above</span></a>.</p>
<p id="index-29"><strong>Powder average of an anisotropic interaction convoluted with a Lorentzian</strong></p>
<p id="index-31"><strong>Powder average of an anisotropic interaction convoluted with a Lorentzian</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">PowderLineAsymLor</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span> <span class="mi">4</span>
</pre></div>
</div>
@ -707,7 +822,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<div class="math notranslate nohighlight">
\[A(f)= I(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)\]</div>
<p>with <span class="math notranslate nohighlight">\(I(f)\)</span> defined <a class="reference internal" href="#ianiso"><span class="std std-ref">above</span></a>. Note that <span class="math notranslate nohighlight">\(f_1&lt;f_2&lt;f_3\)</span> is not required by the code.</p>
<p id="index-30"><strong>Powder average of an anisotropic interaction convoluted with a Gaussian</strong></p>
<p id="index-32"><strong>Powder average of an anisotropic interaction convoluted with a Gaussian</strong></p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">userFcn</span> <span class="n">libLineProfile</span> <span class="n">PowderLineAsymGss</span> <span class="mi">1</span> <span class="mi">2</span> <span class="mi">3</span> <span class="mi">4</span>
</pre></div>
</div>
@ -750,8 +865,8 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -773,7 +888,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',

View File

@ -8,7 +8,7 @@
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>User manual &mdash; musrfit 1.8.2 documentation</title>
<title>User manual &mdash; musrfit 1.9.1 documentation</title>
@ -58,6 +58,10 @@
<div class="version">
1.9
</div>
@ -153,6 +157,7 @@
<li class="toctree-l1"><a class="reference internal" href="mupp.html">mupp - μSR Parameter Plotter</a></li>
<li class="toctree-l1"><a class="reference internal" href="msr2data.html">msr2data - A Program for Automatically Processing Multiple <code class="docutils literal notranslate"><span class="pre">musrfit</span></code> msr Files</a></li>
<li class="toctree-l1"><a class="reference internal" href="any2many.html">any2many - a Universal μSR-file-format converter</a></li>
<li class="toctree-l1"><a class="reference internal" href="file-formats.html">Short description and references to the supported file-formats</a></li>
<li class="toctree-l1"><a class="reference internal" href="musr-root.html">MusrRoot - an Extensible Open File Format for μSR</a></li>
<li class="toctree-l1"><a class="reference internal" href="acknowledgement.html">Acknowledgements</a></li>
<li class="toctree-l1"><a class="reference internal" href="bugtracking.html">Bugtracking</a></li>
@ -2866,8 +2871,8 @@ The syntax here is attribute driven</li>
<div role="contentinfo">
<p>
&copy; Copyright 2022, Andreas Suter.
Last updated on Dec 12, 2022.
&copy; Copyright 2023, Andreas Suter.
Last updated on Aug 17, 2023.
</p>
</div>
@ -2889,7 +2894,7 @@ The syntax here is attribute driven</li>
<script type="text/javascript">
var DOCUMENTATION_OPTIONS = {
URL_ROOT:'./',
VERSION:'1.8.2',
VERSION:'1.9.1',
LANGUAGE:'None',
COLLAPSE_INDEX:false,
FILE_SUFFIX:'.html',
@ -2916,4 +2921,4 @@ The syntax here is attribute driven</li>
</script>
</body>
</html>
</html>

View File

@ -38,7 +38,7 @@ PROJECT_NAME = "mupp"
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.0.0
PROJECT_NUMBER = 1.1.0
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -12,8 +12,7 @@
\mainpage musrfit - a framework to analyse muSR data.
<p>This pages here are meant to explain the software structure of the musrfit framework. Only the core-classes
are described, *i.e.* not the Qt GUI related stuff.
<p>This pages here are meant to explain the software structure of the musrfit framework.
<p>People merely interested in the handling of the programs should check this link:
\htmlonly
@ -64,13 +63,9 @@ under Linux, Mac OS X, and (with some more work) under Windows. The musrfit fram
\section roadmap Road map and missing features
<p>Support for NeXus files is fully available from early 2012 on.
<p>The following features should eventually be implemented, but are still missing:
- non-muSR: The plan is to add an option to fit/plot \f$f(x_1,\ldots,x_n)\f$ versus \f$g(x_1,\ldots,x_n)\f$, where \f$x_i\f$ is a given data set element.
- as soon as ROOT will properly support MS Windows platforms, some better support for MS Windows will be added. Currently only the cygwin version will be supported.
- add an interface to maxent
- we will provide rpm's for various linux flavors.
\section shortComings Short comings of the current musrfit design

View File

@ -38,7 +38,7 @@ PROJECT_NAME = musrfit
# could be handy for archiving the generated documentation or if some version
# control system is used.
PROJECT_NUMBER = 1.6.0
PROJECT_NUMBER = 1.9.2
# Using the PROJECT_BRIEF tag one can provide an optional one line description
# for a project that appears at the top of each page and should give viewer a

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -37,6 +37,7 @@
#include <iostream>
#include <fstream>
#include <memory>
#include <boost/algorithm/string.hpp>
#include <boost/filesystem.hpp>
@ -535,40 +536,22 @@ int main(int argc, char *argv[])
// read startup file
char startup_path_name[128];
TSAXParser *saxParser = new TSAXParser();
PStartupHandler *startupHandler = new PStartupHandler();
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
std::unique_ptr<PStartupHandler> startupHandler = std::make_unique<PStartupHandler>();
if (!startupHandler->StartupFileFound()) {
std::cerr << std::endl << ">> addRun **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data();
std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
} else {
strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data());
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
saxParser->ConnectToHandler("PStartupHandler", startupHandler.get());
//status = saxParser->ParseFile(startup_path_name);
// parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PStartupHandler.cpp for the definition)
status = parseXmlFile(saxParser, startup_path_name);
status = parseXmlFile(saxParser.get(), startup_path_name);
// check for parse errors
if (status) { // error
std::cerr << std::endl << ">> addRun **WARNING** Reading/parsing musrfit_startup.xml failed.";
std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
} else {
startupHandler->CheckLists();
}
@ -639,19 +622,12 @@ int main(int argc, char *argv[])
}
// load the files
std::vector<PRunDataHandler*> runDataHandler;
std::vector< std::unique_ptr<PRunDataHandler> > runDataHandler;
runDataHandler.resize(addRunInfo.size());
Bool_t isGood{true};
for (UInt_t i=0; i<runDataHandler.size(); i++) {
if (startupHandler != nullptr) {
runDataHandler[i] = new PRunDataHandler(addRunInfo[i].fPathFileName, addRunInfo[i].fFileFormat, startupHandler->GetDataPathList());
if (runDataHandler[i] == nullptr) {
isGood = false;
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PRunDataHandler (i=" << i << ")." << std::endl;
std::cerr << std::endl;
break;
}
runDataHandler[i] = std::make_unique<PRunDataHandler>(addRunInfo[i].fPathFileName, addRunInfo[i].fFileFormat, startupHandler->GetDataPathList());
runDataHandler[i]->ReadData();
if (!runDataHandler[i]->IsAllDataAvailable()) {
isGood = false;
@ -661,14 +637,7 @@ int main(int argc, char *argv[])
break;
}
} else {
runDataHandler[i] = new PRunDataHandler(addRunInfo[i].fPathFileName, addRunInfo[i].fFileFormat);
if (runDataHandler[i] == nullptr) {
isGood = false;
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PRunDataHandler (i=" << i << ")." << std::endl;
std::cerr << std::endl;
break;
}
runDataHandler[i] = std::make_unique<PRunDataHandler>(addRunInfo[i].fPathFileName, addRunInfo[i].fFileFormat);
runDataHandler[i]->ReadData();
if (!runDataHandler[i]->IsAllDataAvailable()) {
isGood = false;
@ -683,8 +652,8 @@ int main(int argc, char *argv[])
// make sure that the number of provided t0's are matching the number of histos from the run-file
// 1st make sure all the runs have the same number run data (==1 here)
PAny2ManyInfo *info{nullptr};
PRunDataHandler *dataOut{nullptr};
std::unique_ptr<PAny2ManyInfo> info;
std::unique_ptr<PRunDataHandler> dataOut;
if (isGood) {
for (UInt_t i=1; i<runDataHandler.size(); i++) {
if (runDataHandler[0]->GetNoOfRunData() != runDataHandler[i]->GetNoOfRunData()) {
@ -695,13 +664,7 @@ int main(int argc, char *argv[])
break;
}
}
info = new PAny2ManyInfo();
if (info == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PAny2ManyInfo." << std::endl;
std::cerr << std::endl;
isGood = false;
}
info = std::make_unique<PAny2ManyInfo>();
}
if (isGood) {
@ -709,13 +672,7 @@ int main(int argc, char *argv[])
info->outFormat = format;
info->year = year;
info->outFileName = flnOut;
dataOut = new PRunDataHandler(info);
if (dataOut == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PRunDataHandler for the output file." << std::endl;
std::cerr << std::endl;
isGood = false;
}
dataOut = std::make_unique<PRunDataHandler>(info.get());
}
if (isGood) {
@ -812,8 +769,12 @@ int main(int argc, char *argv[])
}
// feed all the necessary information for the data file
PRawRunData *rawRunData = new PRawRunData();
PRawRunData *rawRunData = nullptr;
rawRunData = runDataHandler[0]->GetRunData(); // copy all
if (rawRunData == nullptr) {
std::cerr << ">> addRun: **ERROR** couldn't obtain PRawRunData object." << std::endl;
return PMUSR_MSR_ALLOCATION_ERROR;
}
rawRunData->SetGenerator("addRun");
// overwrite the t0 values with the new ones
for (UInt_t i=0; i<rawRunData->GetNoOfHistos(); i++) {
@ -831,21 +792,5 @@ int main(int argc, char *argv[])
}
}
// clean up
if (startupHandler) {
delete startupHandler;
}
if (info) {
delete info;
}
if (dataOut) {
delete dataOut;
}
for (int i=0; i<runDataHandler.size(); i++) {
if (runDataHandler[i])
delete runDataHandler[i];
}
runDataHandler.clear();
return PMUSR_SUCCESS;
}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -37,6 +37,7 @@
#include <iostream>
#include <fstream>
#include <memory>
#include <TString.h>
#include <TSAXParser.h>
@ -493,49 +494,31 @@ int main(int argc, char *argv[])
// read startup file
char startup_path_name[128];
TSAXParser *saxParser = new TSAXParser();
PStartupHandler *startupHandler = new PStartupHandler();
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
std::unique_ptr<PStartupHandler> startupHandler = std::make_unique<PStartupHandler>();
if (!startupHandler->StartupFileFound()) {
std::cerr << std::endl << ">> any2many **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data();
std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
} else {
strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data());
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
saxParser->ConnectToHandler("PStartupHandler", startupHandler.get());
//status = saxParser->ParseFile(startup_path_name);
// parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PStartupHandler.cpp for the definition)
status = parseXmlFile(saxParser, startup_path_name);
status = parseXmlFile(saxParser.get(), startup_path_name);
// check for parse errors
if (status) { // error
std::cerr << std::endl << ">> any2many **WARNING** Reading/parsing musrfit_startup.xml failed.";
std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
}
}
// read all the necessary runs (raw data)
PRunDataHandler *dataHandler;
std::unique_ptr<PRunDataHandler> dataHandler;
if (startupHandler)
dataHandler = new PRunDataHandler(&info, startupHandler->GetDataPathList());
dataHandler = std::make_unique<PRunDataHandler>(&info, startupHandler->GetDataPathList());
else
dataHandler = new PRunDataHandler(&info);
dataHandler = std::make_unique<PRunDataHandler>(&info);
// read and convert all data
dataHandler->ConvertData();
@ -546,21 +529,6 @@ int main(int argc, char *argv[])
std::cerr << std::endl << ">> any2many **ERROR** Couldn't read all data files, will quit ..." << std::endl;
}
// clean up
info.runList.clear();
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
if (dataHandler) {
delete dataHandler;
dataHandler = nullptr;
}
return PMUSR_SUCCESS;
}

View File

@ -6,6 +6,7 @@ set(MUSRFIT_INC ${CMAKE_SOURCE_DIR}/src/include)
# Hence, target_include_directories cannot be used here because, targets are
# setup only afterwards.
include_directories(${MUSRFIT_INC})
include_directories(${FFTW3_INCLUDE})
root_generate_dictionary(
PFourierCanvasDict
@ -72,7 +73,7 @@ set(prefix "${CMAKE_INSTALL_PREFIX}")
set(exec_prefix "\$\{prefix\}")
set(libdir "\$\{exec_prefix\}/lib")
set(includedir "\$\{prefix\}/include")
set(MUSR_VERSION "1.3.0")
set(MUSR_VERSION "1.4.0")
set(MUSR_LIBRARY_NAME "PMusr")
configure_file("PMusr.pc.in" "PMusr.pc" @ONLY)
set(USERFCN_LIBRARY_NAME "PUserFcnBase")

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -54,8 +54,10 @@ PFindRun::PFindRun(const PStringVector path, const PRunNameTemplateList runNameT
* @param run
*/
PFindRun::PFindRun(const PStringVector path, const PRunNameTemplateList runNameTemplateList,
const TString &instrument, const UInt_t year, const UInt_t run) :
fPath(path), fRunNameTemplateList(runNameTemplateList), fInstrument(instrument), fYear(year), fRun(run)
const TString &instrument, const UInt_t year, const UInt_t run,
const TString file_format) :
fPath(path), fRunNameTemplateList(runNameTemplateList), fInstrument(instrument),
fYear(year), fRun(run), fFileFormat(file_format)
{
// nothing to be done here
}
@ -130,6 +132,23 @@ TString PFindRun::CreatePathName(const TString path, const TString runNameTempla
*/
Bool_t PFindRun::FoundPathName()
{
// if file format is given, get proper extension
TString ext("");
if (fFileFormat.Length() != 0) {
if (!fFileFormat.CompareTo("MusrRoot") || !fFileFormat.CompareTo("ROOT"))
ext = ".root";
else if (!fFileFormat.CompareTo("NeXus"))
ext = ".nxs";
else if (!fFileFormat.CompareTo("PSI-BIN"))
ext = ".bin";
else if (!fFileFormat.CompareTo("PSI-MDU"))
ext = ".mdu";
else if (!fFileFormat.CompareTo("MUD"))
ext = ".mud";
else if (!fFileFormat.CompareTo("WKM"))
ext = ".wkm";
}
// find instrument name in path list
TString pathName{""};
for (Int_t i=0; i<fPath.size(); i++) {
@ -137,6 +156,10 @@ Bool_t PFindRun::FoundPathName()
for (Int_t j=0; j<fRunNameTemplateList.size(); j++) {
if (fRunNameTemplateList[j].instrument == fInstrument) {
pathName = CreatePathName(fPath[i], fRunNameTemplateList[j].runNameTemplate);
if (fFileFormat.Length() != 0) {
if (!pathName.Contains(ext, TString::kIgnoreCase))
continue;
}
if (boost::filesystem::exists(pathName.Data())) {
fPathName = pathName;
return true;

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -280,9 +280,6 @@ PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bo
fCmdLines = *runInfo->GetMsrCommands();
// init class variables
fFitterFcn = nullptr;
fFcnMin = nullptr;
fScanAll = true;
fScanParameter[0] = 0;
fScanParameter[1] = 0;
@ -317,11 +314,7 @@ PFitter::PFitter(PMsrHandler *runInfo, PRunListCollection *runListCollection, Bo
GetPhaseParams();
// create fit function object
fFitterFcn = new PFitterFcn(runListCollection, fUseChi2);
if (!fFitterFcn) {
fIsValid = false;
return;
}
fFitterFcn = std::make_unique<PFitterFcn>(runListCollection, fUseChi2);
}
//--------------------------------------------------------------------------
@ -337,16 +330,6 @@ PFitter::~PFitter()
fScanData.clear();
fElapsedTime.clear();
if (fFcnMin) {
delete fFcnMin;
fFcnMin = nullptr;
}
if (fFitterFcn) {
delete fFitterFcn;
fFitterFcn = nullptr;
}
}
//--------------------------------------------------------------------------
@ -1802,11 +1785,7 @@ Bool_t PFitter::ExecuteMigrad()
}
// keep FunctionMinimum object
if (fFcnMin) { // fFcnMin exist hence clean up first
delete fFcnMin;
fFcnMin = nullptr;
}
fFcnMin = new ROOT::Minuit2::FunctionMinimum(min);
fFcnMin.reset(new ROOT::Minuit2::FunctionMinimum(min));
// keep user parameters
if (fFcnMin)
@ -1883,11 +1862,7 @@ Bool_t PFitter::ExecuteMinimize()
}
// keep FunctionMinimum object
if (fFcnMin) { // fFcnMin exist hence clean up first
delete fFcnMin;
fFcnMin = nullptr;
}
fFcnMin = new ROOT::Minuit2::FunctionMinimum(min);
fFcnMin.reset(new ROOT::Minuit2::FunctionMinimum(min));
// keep user parameters
if (fFcnMin)
@ -2435,8 +2410,8 @@ Bool_t PFitter::ExecuteSave(Bool_t firstSave)
title += fRunInfo->GetFileName();
title += " - ";
title += dt.AsSQLString();
TCanvas *ccorr = new TCanvas("ccorr", "title", 500, 500);
TH2D *hcorr = new TH2D("hcorr", title, cov.Nrow(), 0.0, cov.Nrow(), cov.Nrow(), 0.0, cov.Nrow());
std::unique_ptr<TCanvas> ccorr = std::make_unique<TCanvas>("ccorr", "title", 500, 500);
std::unique_ptr<TH2D> hcorr = std::make_unique<TH2D>("hcorr", title, cov.Nrow(), 0.0, cov.Nrow(), cov.Nrow(), 0.0, cov.Nrow());
Double_t dval;
for (UInt_t i=0; i<cov.Nrow(); i++) {
// parameter number
@ -2498,15 +2473,6 @@ Bool_t PFitter::ExecuteSave(Bool_t firstSave)
ccorr->Write("ccorr", TObject::kOverwrite, sizeof(ccorr));
hcorr->Write("hcorr", TObject::kOverwrite, sizeof(hcorr));
ff.Close();
// clean up
if (ccorr) {
delete ccorr;
ccorr = nullptr;
}
if (hcorr) {
delete hcorr;
hcorr = nullptr;
}
}
parNo.clear(); // clean up
} else {
@ -2530,7 +2496,7 @@ Bool_t PFitter::ExecuteSave(Bool_t firstSave)
fitStartTime = run->at(0).GetFitRange(0);
fitEndTime = run->at(0).GetFitRange(1);
}
fout.setf(std::ios::floatfield);
fout.setf(std::ios::fixed, std::ios::floatfield);
fout << std::endl << " Time Range: " << fitStartTime << ", " << fitEndTime << std::endl;
if (fUseChi2) {
fout.setf(std::ios::fixed, std::ios::floatfield);
@ -2596,11 +2562,7 @@ Bool_t PFitter::ExecuteSimplex()
}
// keep FunctionMinimum object
if (fFcnMin) { // fFcnMin exist hence clean up first
delete fFcnMin;
fFcnMin = nullptr;
}
fFcnMin = new ROOT::Minuit2::FunctionMinimum(min);
fFcnMin.reset(new ROOT::Minuit2::FunctionMinimum(min));
// keep user parameters
if (fFcnMin)

View File

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

View File

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

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -55,7 +55,6 @@ ClassImpQ(PFourierCanvas)
PFourierCanvas::PFourierCanvas()
{
fTimeout = 0;
fTimeoutTimer = nullptr;
fBatchMode = false;
fValid = false;
@ -69,18 +68,10 @@ PFourierCanvas::PFourierCanvas()
fXaxisTitle = TString("");
fCurrentFourierPhase = 0.0;
fCurrentFourierPhaseText = nullptr;
fStyle = nullptr;
fImp = nullptr;
fBar = nullptr;
fPopupMain = nullptr;
fPopupFourier = nullptr;
fMainCanvas = nullptr;
fTitlePad = nullptr;
fFourierPad = nullptr;
fInfoPad = nullptr;
}
//---------------------------------------------------------------------------
@ -112,12 +103,9 @@ PFourierCanvas::PFourierCanvas(std::vector<PFourier*> &fourier, PIntVector dataS
fInitialXRange[1] = fourierXrange[1];
fTimeout = 0;
fTimeoutTimer = nullptr;
fValid = false;
fCurrentFourierPhaseText = nullptr;
// generate fMarkerList and fColorList, since they are not provided
TRandom rand;
Int_t style, color;
@ -168,12 +156,9 @@ PFourierCanvas::PFourierCanvas(std::vector<PFourier*> &fourier, PIntVector dataS
fInitialXRange[1] = fourierXrange[1];
fTimeout = 0;
fTimeoutTimer = nullptr;
fValid = false;
fCurrentFourierPhaseText = nullptr;
// generate fMarkerList and fColorList, since they are not provided
TRandom rand;
Int_t style, color;
@ -196,70 +181,6 @@ PFourierCanvas::PFourierCanvas(std::vector<PFourier*> &fourier, PIntVector dataS
gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling
}
//---------------------------------------------------------------------------
/**
* <p>Destructor
*/
PFourierCanvas::~PFourierCanvas()
{
if (fTimeoutTimer)
delete fTimeoutTimer;
if (fCurrentFourierPhaseText)
delete fCurrentFourierPhaseText;
/*
if (fStyle) {
delete fStyle;
fStyle = 0;
}
*/
if (fTitlePad) {
fTitlePad->Clear();
delete fTitlePad;
fTitlePad = nullptr;
}
if (fFourierHistos.size() > 0) {
for (UInt_t i=0; i<fFourierHistos.size(); i++) {
delete fFourierHistos[i].dataFourierRe;
delete fFourierHistos[i].dataFourierIm;
delete fFourierHistos[i].dataFourierPwr;
delete fFourierHistos[i].dataFourierPhase;
delete fFourierHistos[i].dataFourierPhaseOptReal;
}
fFourierHistos.clear();
}
CleanupAverage();
/*
if (fFourierPad) {
fFourierPad->Clear();
delete fFourierPad;
fFourierPad = 0;
}
*/
if (fInfoPad) {
fInfoPad->Clear();
delete fInfoPad;
fInfoPad = nullptr;
}
if (fLegAvgPerDataSet) {
fLegAvgPerDataSet->Clear();
delete fLegAvgPerDataSet;
fLegAvgPerDataSet = nullptr;
}
/*
if (fMainCanvas) {
delete fMainCanvas;
fMainCanvas = nullptr;
}
*/
}
//--------------------------------------------------------------------------
// Done (SIGNAL)
//--------------------------------------------------------------------------
@ -563,11 +484,7 @@ void PFourierCanvas::SetTimeout(Int_t timeout)
if (fTimeout <= 0)
return;
if (fTimeoutTimer) {
delete fTimeoutTimer;
fTimeoutTimer = nullptr;
}
fTimeoutTimer = new TTimer();
fTimeoutTimer.reset(new TTimer());
fTimeoutTimer->Connect("Timeout()", "PFourierCanvas", this, "Done()");
@ -831,7 +748,7 @@ void PFourierCanvas::CreateXaxisTitle()
void PFourierCanvas::CreateStyle()
{
TString musrFTStyle("musrFTStyle");
fStyle = new TStyle(musrFTStyle, musrFTStyle);
fStyle = std::make_unique<TStyle>(musrFTStyle, musrFTStyle);
fStyle->SetOptStat(0); // no statistics options
fStyle->SetOptTitle(0); // no title
fStyle->cd();
@ -990,21 +907,10 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w
fImp = nullptr;
fBar = nullptr;
fPopupMain = nullptr;
fPopupFourier = nullptr;
fMainCanvas = nullptr;
fTitlePad = nullptr;
fFourierPad = nullptr;
fInfoPad = nullptr;
// invoke canvas
TString canvasName = TString("fMainCanvas");
fMainCanvas = new TCanvas(canvasName.Data(), title, wtopx, wtopy, ww, wh);
if (fMainCanvas == nullptr) {
std::cerr << std::endl << "PFourierCanvas::PFourierCanvas: **PANIC ERROR**: Couldn't invoke " << canvasName.Data();
std::cerr << std::endl;
return;
}
fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
// add canvas menu if not in batch mode
if (!fBatchMode) {
@ -1012,9 +918,9 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w
fBar = fImp->GetMenuBar();
fPopupMain = fBar->AddPopup("MusrFT");
fPopupFourier = new TGPopupMenu();
fPopupFourier = std::make_unique<TGPopupMenu>();
fPopupMain->AddPopup("&Fourier", fPopupFourier);
fPopupMain->AddPopup("&Fourier", fPopupFourier.get());
fPopupFourier->AddEntry("Show Real", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL);
fPopupFourier->AddEntry("Show Imag", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_IMAG);
fPopupFourier->AddEntry("Show Real+Imag", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL_AND_IMAG);
@ -1067,39 +973,25 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w
// divide the canvas into sub pads
// title pad
fTitlePad = new TPaveText(0.0, YTITLE, 1.0, 1.0, "NDC");
if (fTitlePad == nullptr) {
std::cerr << std::endl << "PFourierCanvas::PFourierCanvas: **PANIC ERROR**: Couldn't invoke fTitlePad";
std::cerr << std::endl;
return;
}
fTitlePad = std::make_unique<TPaveText>(0.0, YTITLE, 1.0, 1.0, "NDC");
fTitlePad->SetFillColor(TColor::GetColor(255,255,255));
fTitlePad->SetTextAlign(12); // middle, left
fTitlePad->AddText(title);
fTitlePad->Draw();
// fourier pad
fFourierPad = new TPad("fFourierPad", "fFourierPad", 0.0, YINFO, 1.0, YTITLE);
if (fFourierPad == nullptr) {
std::cerr << std::endl << "PFourierCanvas::PFourierCanvas: **PANIC ERROR**: Couldn't invoke fFourierPad";
std::cerr << std::endl;
return;
}
fFourierPad = std::make_unique<TPad>("fFourierPad", "fFourierPad", 0.0, YINFO, 1.0, YTITLE);
fFourierPad->SetFillColor(TColor::GetColor(255,255,255));
fFourierPad->Draw();
// info pad
fInfoPad = new TLegend(0.0, 0.0, 1.0, YINFO, "NDC");
if (fInfoPad == nullptr) {
std::cerr << std::endl << "PFourierCanvas::PFourierCanvas: **PANIC ERROR**: Couldn't invoke fInfoPad";
std::cerr << std::endl;
return;
}
fInfoPad = std::make_unique<TLegend>(0.0, 0.0, 1.0, YINFO, "NDC");
fInfoPad->SetFillColor(TColor::GetColor(255,255,255));
fInfoPad->SetTextAlign(12); // middle, left
fLegAvgPerDataSet = nullptr;
fValid = true;
if ((fFourier.size() != fDataSetTag.size()) && fAveragedViewPerDataSet) {
@ -1629,12 +1521,6 @@ void PFourierCanvas::PlotFourier()
*/
void PFourierCanvas::PlotFourierPhaseValue()
{
// check if phase TLatex object is present
if (fCurrentFourierPhaseText) {
delete fCurrentFourierPhaseText;
fCurrentFourierPhaseText = nullptr;
}
Double_t x, y;
TString str;
@ -1643,7 +1529,7 @@ void PFourierCanvas::PlotFourierPhaseValue()
str += fCurrentFourierPhase;
x = 0.7;
y = 0.85;
fCurrentFourierPhaseText = new TLatex();
fCurrentFourierPhaseText.reset(new TLatex());
fCurrentFourierPhaseText->SetNDC(kTRUE);
fCurrentFourierPhaseText->SetText(x, y, str.Data());
fCurrentFourierPhaseText->SetTextFont(62);
@ -1675,10 +1561,8 @@ void PFourierCanvas::PlotAverage()
xmax = fInitialXRange[1];
Double_t ymin=0.0, ymax=0.0;
if (fLegAvgPerDataSet) {
if (fLegAvgPerDataSet.get()) {
fLegAvgPerDataSet->Clear();
delete fLegAvgPerDataSet;
fLegAvgPerDataSet = nullptr;
}
switch (fCurrentPlotView) {
@ -1799,7 +1683,7 @@ void PFourierCanvas::PlotAverage()
}
if (fAveragedViewPerDataSet) { // plot all the rest
fLegAvgPerDataSet = new TLegend(0.55, 0.4, 0.85, 0.6);
fLegAvgPerDataSet = std::make_unique<TLegend>(0.55, 0.4, 0.85, 0.6);
TString str = GetDataSetName(fFourierAverage[0].dataFourierPwr->GetTitle());
TString label = TString::Format("<%s>", str.Data());
fLegAvgPerDataSet->AddEntry(fFourierAverage[0].dataFourierPwr, label.Data());

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -655,7 +655,9 @@ void PFunction::EvalTreeForStringExpression(iter_t const& i)
assert(i->children.size() == 2);
EvalTreeForStringExpression(i->children.begin());
fFuncString += " / ";
fFuncString += "(";
EvalTreeForStringExpression(i->children.begin()+1);
fFuncString += ")";
} else {
assert(0);
}

View File

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

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2023 by Bastian M. Wojek / Andreas Suter *
* Copyright (C) 2009-2024 by Bastian M. Wojek / Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -38,6 +38,7 @@
#include <iomanip>
#include <algorithm>
#include <limits>
#include <memory>
#include <boost/algorithm/string/trim.hpp> // for stripping leading whitespace in std::string
#include <boost/algorithm/string/case_conv.hpp> // for to_lower() in std::string
@ -58,7 +59,6 @@ PMsr2Data::PMsr2Data(const std::string &ext) : fFileExtension(ext), fRunListFile
{
fRunVector.clear();
fRunVectorIter = fRunVector.end();
fRunListFileStream = nullptr;
fSaxParser = nullptr;
fStartupHandler = nullptr;
fDataHandler = nullptr;
@ -74,28 +74,6 @@ PMsr2Data::~PMsr2Data()
fRunVector.clear();
fRunVectorIter = fRunVector.end();
fIndVar.clear();
if (fRunListFileStream) {
fRunListFileStream->close();
delete fRunListFileStream;
fRunListFileStream = nullptr;
}
if (fSaxParser) {
delete fSaxParser;
fSaxParser = nullptr;
}
if (fStartupHandler) {
delete fStartupHandler;
fStartupHandler = nullptr;
}
if (fDataHandler) {
delete fDataHandler;
fDataHandler = nullptr;
}
if (fMsrHandler) {
delete fMsrHandler;
fMsrHandler = nullptr;
}
}
//-------------------------------------------------------------
@ -118,19 +96,17 @@ int PMsr2Data::DetermineRunNumberDigits(unsigned int runNo, bool normalMode) con
{
std::ostringstream strInfile;
strInfile << runNo << fFileExtension << ".msr";
std::ifstream *in = new std::ifstream(strInfile.str().c_str());
std::unique_ptr<std::ifstream> in = std::make_unique<std::ifstream>(strInfile.str().c_str());
if (!in->is_open()) {
delete in;
if (!normalMode && (runNo == *fRunVectorIter)) {
std::string fileNameCopy(strInfile.str());
strInfile.clear();
strInfile.str("");
strInfile << runNo << "+global" << fFileExtension << ".msr";
in = new std::ifstream(strInfile.str().c_str());
in.reset(new std::ifstream(strInfile.str().c_str()));
if (!in->is_open()) {
std::cerr << std::endl << ">> msr2data: **ERROR** Neither the file " << fileNameCopy << " nor the file " << strInfile.str() << " can be opened! Please check!";
std::cerr << std::endl;
delete in;
return -1;
}
} else if (runNo == *fRunVectorIter) { // the first run of the runlist was given - if it did not exist, try the rest of the runlist
@ -176,8 +152,6 @@ int PMsr2Data::DetermineRunNumberDigits(unsigned int runNo, bool normalMode) con
}
}
in->close();
delete in;
in = nullptr;
fRunVectorIter = fRunVector.begin(); // set back the runlist-iterator which might have changed during the search for the correct file
return 0;
} else {
@ -187,8 +161,6 @@ int PMsr2Data::DetermineRunNumberDigits(unsigned int runNo, bool normalMode) con
std::cerr << std::endl << ">> msr2data: **ERROR** this is either some template or the first existing file from the run list.";
std::cerr << std::endl;
in->close();
delete in;
in = nullptr;
return -2;
}
}
@ -198,8 +170,7 @@ int PMsr2Data::DetermineRunNumberDigits(unsigned int runNo, bool normalMode) con
std::cerr << std::endl << ">> msr2data: **ERROR** Obviously it contains no RUN block...";
std::cerr << std::endl;
in->close();
delete in;
in = nullptr;
return -3;
}
@ -213,11 +184,12 @@ int PMsr2Data::DetermineRunNumberDigits(unsigned int runNo, bool normalMode) con
*/
int PMsr2Data::CheckRunNumbersInRange() const
{
double max(pow(static_cast<double>(10), static_cast<int>(fRunNumberDigits)) - 1.0);
// since 2023, we encounter in LEM run numbers > 9999, hence this check has been loosened
// by replacing static_cast<int>(fRunNumberDigits)) by static_cast<int>(fRunNumberDigits+1)).
double max(pow(static_cast<double>(10), static_cast<int>(fRunNumberDigits+1)) - 1.0);
unsigned int max_UInt;
max > static_cast<double>(std::numeric_limits<unsigned int>::max()) ? max_UInt = std::numeric_limits<unsigned int>::max()
: max_UInt = static_cast<unsigned int>(max);
for (std::vector<unsigned int>::const_iterator iter(fRunVector.begin()); iter != fRunVector.end(); ++iter) {
if (*iter > max_UInt) {
return -1;
@ -386,7 +358,8 @@ int PMsr2Data::SetRunNumbers(const std::string &runListFile)
in.close();
fRunVectorIter = fRunVector.begin();
fRunListFile = true;
fRunListFileStream = new std::ifstream(runListFile.c_str());
fRunListFileStream = std::make_unique<std::ifstream>(runListFile.c_str());
return 0;
}
@ -401,26 +374,17 @@ int PMsr2Data::SetRunNumbers(const std::string &runListFile)
int PMsr2Data::ParseXmlStartupFile()
{
int status;
fSaxParser = new TSAXParser();
fStartupHandler = new PStartupHandler();
fSaxParser = std::make_unique<TSAXParser>();
fStartupHandler = std::make_unique<PStartupHandler>();
std::string startup_path_name(fStartupHandler->GetStartupFilePath().Data());
fSaxParser->ConnectToHandler("PStartupHandler", fStartupHandler);
fSaxParser->ConnectToHandler("PStartupHandler", fStartupHandler.get());
//status = fSaxParser->ParseFile(startup_path_name.c_str());
// parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PStartupHandler.cpp for the definition)
status = parseXmlFile(fSaxParser, startup_path_name.c_str());
status = parseXmlFile(fSaxParser.get(), startup_path_name.c_str());
// check for parse errors
if (status) { // error
std::cerr << std::endl << ">> msr2data: **WARNING** Reading/parsing musrfit_startup.xml failed." << std::endl;
// clean up
if (fSaxParser) {
delete fSaxParser;
fSaxParser = nullptr;
}
if (fStartupHandler) {
delete fStartupHandler;
fStartupHandler = nullptr;
}
}
return status;
}
@ -438,7 +402,7 @@ int PMsr2Data::ParseXmlStartupFile()
int PMsr2Data::ReadMsrFile(const std::string &infile) const
{
int status;
fMsrHandler = new PMsrHandler(infile.c_str());
fMsrHandler = std::make_unique<PMsrHandler>(infile.c_str());
status = fMsrHandler->ReadMsrFile();
if (status != PMUSR_SUCCESS) {
switch (status) {
@ -486,6 +450,7 @@ PMsrHandler* PMsr2Data::GetSingleRunMsrFile() const
}
return nullptr;
}
return singleRunMsrFile;
}
@ -500,19 +465,18 @@ PMsrHandler* PMsr2Data::GetSingleRunMsrFile() const
int PMsr2Data::ReadRunDataFile()
{
if (fStartupHandler)
fDataHandler = new PRunDataHandler(fMsrHandler, fStartupHandler->GetDataPathList());
fDataHandler = std::make_unique<PRunDataHandler>(fMsrHandler.get(), fStartupHandler->GetDataPathList());
else
fDataHandler = new PRunDataHandler(fMsrHandler);
fDataHandler = std::make_unique<PRunDataHandler>(fMsrHandler.get());
fDataHandler->ReadData();
bool success = fDataHandler->IsAllDataAvailable();
if (!success) {
std::cerr << std::endl << ">> msr2data: **WARNING** Could not read all data files, will continue without the data file information..." << std::endl;
delete fDataHandler;
fDataHandler = nullptr;
return 1;
}
return 0;
}
@ -1338,8 +1302,11 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
if (newRunNumber.str().compare(tempRunNumber.str())) { // first run number does not match the template run number
// in global+ mode, read in the single run msr-file of the corresponding run
if (globalPlus)
if (globalPlus) {
singleRunMsrFile = GetSingleRunMsrFile();
if (singleRunMsrFile == nullptr)
return false;
}
// substitute the template run-numbers in the parameter names
for (unsigned int l(fNumGlobalParam); l < msrParamList->size(); ++l) {
@ -1416,8 +1383,11 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const std::string &
newRunNumber << *fRunVectorIter;
// in global+ mode, read in the single run msr-file
if (globalPlus)
if (globalPlus) {
singleRunMsrFile = GetSingleRunMsrFile();
if (singleRunMsrFile == nullptr)
return false;
}
// add parameters for each run
for (unsigned int l(0); l < fNumSpecParam; ++l) {
@ -1944,14 +1914,6 @@ int PMsr2Data::WriteOutput(const std::string &outfile, const std::vector<unsigne
std::cerr << std::endl;
fRunVectorIter++;
delete fMsrHandler;
fMsrHandler = nullptr;
if (fDataHandler) {
delete fDataHandler;
fDataHandler = nullptr;
}
// clean up some vectors
dataParamNames.clear();
dataParamLabels.clear();
@ -2453,13 +2415,7 @@ int PMsr2Data::WriteOutput(const std::string &outfile, const std::vector<unsigne
outFile.close();
if (!global || (fRunVectorIter == fRunVector.end())) {
delete fMsrHandler;
fMsrHandler = nullptr;
if (fDataHandler) {
delete fDataHandler;
fDataHandler = nullptr;
}
fDataHandler.reset();
}
msrParamList = nullptr;

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -66,8 +66,6 @@ PMsrHandler::PMsrHandler(const Char_t *fileName, PStartupOptions *startupOptions
fStatistic.fMinExpectedPerHisto.clear();
fStatistic.fNdfPerHisto.clear();
fFuncHandler = nullptr;
// check if the file name given is a path-file-name, and if yes, split it into path and file name.
if (fFileName.Contains("/")) {
Int_t idx = -1;
@ -99,11 +97,6 @@ PMsrHandler::~PMsrHandler()
fStatistic.fMinExpectedPerHisto.clear();
fStatistic.fNdfPerHisto.clear();
fParamInUse.clear();
if (fFuncHandler) {
delete fFuncHandler;
fFuncHandler = nullptr;
}
}
//--------------------------------------------------------------------------
@ -2697,10 +2690,6 @@ Int_t PMsrHandler::ParameterInUse(UInt_t paramNo)
*/
Bool_t PMsrHandler::HandleFitParameterEntry(PMsrLines &lines)
{
// If msr-file is used for musrFT only, nothing needs to be done here.
if (fFourierOnly)
return true;
PMsrParamStructure param;
Bool_t error = false;
@ -2945,11 +2934,7 @@ Bool_t PMsrHandler::HandleFunctionsEntry(PMsrLines &lines)
fFunctions = lines;
// create function handler
fFuncHandler = new PFunctionHandler(fFunctions);
if (fFuncHandler == nullptr) {
std::cerr << std::endl << ">> PMsrHandler::HandleFunctionsEntry: **ERROR** Couldn't invoke PFunctionHandler." << std::endl;
return false;
}
fFuncHandler = std::make_unique<PFunctionHandler>(fFunctions);
// do the parsing
if (!fFuncHandler->DoParse()) {
@ -3549,7 +3534,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
} else {
PUIntVector group;
str = iter->fLine;
PStringNumberList *rl = new PStringNumberList(str.Data());
std::unique_ptr<PStringNumberList> rl = std::make_unique<PStringNumberList>(str.Data());
std::string errorMsg("");
if (rl->Parse(errorMsg, true)) {
group = rl->GetList();
@ -3559,7 +3544,6 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
} else {
error = true;
}
delete rl;
group.clear();
}
}
@ -3574,7 +3558,7 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
} else {
PUIntVector group;
str = iter->fLine;
PStringNumberList *rl = new PStringNumberList(str.Data());
std::unique_ptr<PStringNumberList> rl = std::make_unique<PStringNumberList>(str.Data());
std::string errorMsg("");
if (rl->Parse(errorMsg, true)) {
group = rl->GetList();
@ -3584,7 +3568,6 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines)
} else {
error = true;
}
delete rl;
group.clear();
}
}
@ -4638,7 +4621,7 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines)
param.fLifeTimeCorrection = true;
} else if (line.Contains("runs", TString::kIgnoreCase)) { // handle plot runs
TComplex run;
PStringNumberList *rl;
std::unique_ptr<PStringNumberList> rl;
std::string errorMsg;
PUIntVector runList;
switch (param.fPlotType) {
@ -4652,7 +4635,7 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines)
case MSR_PLOT_ASYM_RRF:
case MSR_PLOT_NON_MUSR:
case MSR_PLOT_MU_MINUS:
rl = new PStringNumberList(line.Data());
rl = std::make_unique<PStringNumberList>(line.Data());
if (!rl->Parse(errorMsg, true)) {
std::cerr << std::endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo;
std::cerr << std::endl << ">> Error Message: " << errorMsg;
@ -4666,7 +4649,6 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines)
}
// clean up
runList.clear();
delete rl;
break;
default:
error = true;

View File

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

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -119,7 +119,6 @@ ClassImpQ(PMusrCanvas)
PMusrCanvas::PMusrCanvas()
{
fTimeout = 0;
fTimeoutTimer = nullptr;
fScaleN0AndBkg = true;
fValid = false;
@ -134,16 +133,6 @@ PMusrCanvas::PMusrCanvas()
fImp = nullptr;
fBar = nullptr;
fPopupMain = nullptr;
fPopupFourier = nullptr;
fStyle = nullptr;
fMainCanvas = nullptr;
fTitlePad = nullptr;
fDataTheoryPad = nullptr;
fParameterPad = nullptr;
fTheoryPad = nullptr;
fInfoPad = nullptr;
fMultiGraphLegend = nullptr;
fHistoFrame = nullptr;
@ -153,11 +142,6 @@ PMusrCanvas::PMusrCanvas()
InitFourier();
InitAverage();
fCurrentFourierPhaseText = nullptr;
fRRFText = nullptr;
fRRFLatexText = nullptr;
fXRangePresent = false;
fYRangePresent = false;
fXmin = 0.0;
@ -193,7 +177,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
fBatchMode(batch), fPlotNumber(number)
{
fTimeout = 0;
fTimeoutTimer = nullptr;
fAveragedView = false;
fMultiGraphData = nullptr;
@ -206,11 +189,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
CreateStyle();
InitMusrCanvas(title, wtopx, wtopy, ww, wh);
fCurrentFourierPhaseText = nullptr;
fRRFText = nullptr;
fRRFLatexText = nullptr;
fXRangePresent = false;
fYRangePresent = false;
fXmin = 0.0;
@ -252,7 +230,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
fMarkerList(markerList), fColorList(colorList)
{
fTimeout = 0;
fTimeoutTimer = nullptr;
fMultiGraphData = nullptr;
fMultiGraphDiff = nullptr;
@ -263,11 +240,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
CreateStyle();
InitMusrCanvas(title, wtopx, wtopy, ww, wh);
fCurrentFourierPhaseText = nullptr;
fRRFText = nullptr;
fRRFLatexText = nullptr;
fXRangePresent = false;
fYRangePresent = false;
fXmin = 0.0;
@ -287,31 +259,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
PMusrCanvas::~PMusrCanvas()
{
// cleanup
if (fTimeoutTimer) {
delete fTimeoutTimer;
fTimeoutTimer = nullptr;
}
if (fCurrentFourierPhaseText) {
delete fCurrentFourierPhaseText;
fCurrentFourierPhaseText = nullptr;
}
if (fRRFLatexText) {
delete fRRFLatexText;
fRRFLatexText = nullptr;
}
if (fRRFText) {
delete fRRFText;
fRRFText = nullptr;
}
if (fStyle) {
delete fStyle;
fStyle = nullptr;
}
if (fTitlePad) {
fTitlePad->Clear();
delete fTitlePad;
fTitlePad = nullptr;
}
if (fData.size() > 0) {
for (UInt_t i=0; i<fData.size(); i++)
CleanupDataSet(fData[i]);
@ -322,11 +269,6 @@ PMusrCanvas::~PMusrCanvas()
CleanupDataSet(fNonMusrData[i]);
fNonMusrData.clear();
}
if (fMultiGraphLegend) {
fMultiGraphLegend->Clear();
delete fMultiGraphLegend;
fMultiGraphLegend = nullptr;
}
if (fMultiGraphData) {
delete fMultiGraphData;
fMultiGraphData = nullptr;
@ -335,29 +277,6 @@ PMusrCanvas::~PMusrCanvas()
delete fMultiGraphDiff;
fMultiGraphDiff = nullptr;
}
if (fDataTheoryPad) {
delete fDataTheoryPad;
fDataTheoryPad = nullptr;
}
if (fParameterPad) {
fParameterPad->Clear();
delete fParameterPad;
fParameterPad = nullptr;
}
if (fTheoryPad) {
fTheoryPad->Clear();
delete fTheoryPad;
fTheoryPad = nullptr;
}
if (fInfoPad) {
fInfoPad->Clear();
delete fInfoPad;
fInfoPad = nullptr;
}
if (fMainCanvas) {
delete fMainCanvas;
fMainCanvas = nullptr;
}
}
//--------------------------------------------------------------------------
@ -409,7 +328,7 @@ void PMusrCanvas::SetMsrHandler(PMsrHandler *msrHandler)
(fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq != 0.0)) ||
(fMsrHandler->GetMsrGlobal()->GetRRFPacking() > 0 &&
fMsrHandler->GetMsrGlobal()->GetRRFUnit().CompareTo("??"))) {
fRRFLatexText = new TLatex();
fRRFLatexText = std::make_unique<TLatex>();
fRRFLatexText->SetNDC(kTRUE);
fRRFLatexText->SetTextFont(62);
fRRFLatexText->SetTextSize(0.03);
@ -417,7 +336,7 @@ void PMusrCanvas::SetMsrHandler(PMsrHandler *msrHandler)
Int_t rrfUnitTag = -1;
Double_t rrfFreq = 0.0;
if (fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) { // RRF single histo PLOT
fRRFText = new TString("RRF: ");
fRRFText = std::make_unique<TString>("RRF: ");
rrfUnitTag = fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit;
rrfFreq = fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq;
TString rrfFreqStr("");
@ -446,7 +365,7 @@ void PMusrCanvas::SetMsrHandler(PMsrHandler *msrHandler)
*fRRFText += TString(", RRF packing = ");
*fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking;
} else { // RRF single histo FIT
fRRFText = new TString("RRF: ");
fRRFText = std::make_unique<TString>("RRF: ");
rrfUnitTag = fMsrHandler->GetMsrGlobal()->GetRRFUnitTag();
rrfFreq = fMsrHandler->GetMsrGlobal()->GetRRFFreq(fMsrHandler->GetMsrGlobal()->GetRRFUnit().Data());
TString rrfFreqStr("");
@ -493,11 +412,7 @@ void PMusrCanvas::SetTimeout(Int_t timeout)
if (fTimeout <= 0)
return;
if (fTimeoutTimer) {
delete fTimeoutTimer;
fTimeoutTimer = nullptr;
}
fTimeoutTimer = new TTimer();
fTimeoutTimer.reset(new TTimer());
fTimeoutTimer->Connect("Timeout()", "PMusrCanvas", this, "Done()");
@ -1542,7 +1457,7 @@ void PMusrCanvas::LastCanvasClosed()
void PMusrCanvas::WindowClosed()
{
// std::cerr << ">> fMainCanvas->GetName()=" << fMainCanvas->GetName() << std::endl;
gROOT->GetListOfCanvases()->Remove(fMainCanvas);
gROOT->GetListOfCanvases()->Remove(fMainCanvas.get());
LastCanvasClosed();
}
@ -2323,7 +2238,7 @@ void PMusrCanvas::CreateStyle()
{
TString musrStyle("musrStyle");
musrStyle += fPlotNumber;
fStyle = new TStyle(musrStyle, musrStyle);
fStyle = std::make_unique<TStyle>(musrStyle, musrStyle);
fStyle->SetOptStat(0); // no statistics options
fStyle->SetOptTitle(0); // no title
fStyle->cd();
@ -2407,25 +2322,11 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy,
fImp = nullptr;
fBar = nullptr;
fPopupMain = nullptr;
fPopupFourier = nullptr;
fMainCanvas = nullptr;
fTitlePad = nullptr;
fDataTheoryPad = nullptr;
fParameterPad = nullptr;
fTheoryPad = nullptr;
fInfoPad = nullptr;
fMultiGraphLegend = nullptr;
// invoke canvas
TString canvasName = TString("fMainCanvas");
canvasName += fPlotNumber;
fMainCanvas = new TCanvas(canvasName.Data(), title, wtopx, wtopy, ww, wh);
if (fMainCanvas == nullptr) {
std::cerr << std::endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data();
std::cerr << std::endl;
return;
}
fMainCanvas = std::make_unique<TCanvas>(canvasName.Data(), title, wtopx, wtopy, ww, wh);
fMainCanvas->Connect("Closed()", "PMusrCanvas", this, "LastCanvasClosed()");
@ -2436,11 +2337,11 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy,
fBar = fImp->GetMenuBar();
fPopupMain = fBar->AddPopup("&Musrfit");
fPopupFourier = new TGPopupMenu();
fPopupFourier = std::make_unique<TGPopupMenu>();
fPopupMain->AddEntry("&Data", P_MENU_ID_DATA+P_MENU_PLOT_OFFSET*fPlotNumber);
fPopupMain->AddSeparator();
fPopupMain->AddPopup("&Fourier", fPopupFourier);
fPopupMain->AddPopup("&Fourier", fPopupFourier.get());
fPopupFourier->AddEntry("Show Real", P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_REAL);
fPopupFourier->AddEntry("Show Imag", P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_IMAG);
fPopupFourier->AddEntry("Show Real+Imag", P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_REAL_AND_IMAG);
@ -2470,57 +2371,32 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy,
// divide the canvas into 4 pads
// title pad
fTitlePad = new TPaveText(0.0, YTITLE, 1.0, 1.0, "NDC");
if (fTitlePad == nullptr) {
std::cerr << std::endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fTitlePad";
std::cerr << std::endl;
return;
}
fTitlePad = std::make_unique<TPaveText>(0.0, YTITLE, 1.0, 1.0, "NDC");
fTitlePad->SetFillColor(TColor::GetColor(255,255,255));
fTitlePad->SetTextAlign(12); // middle, left
fTitlePad->AddText(title);
fTitlePad->Draw();
// data/theory pad
fDataTheoryPad = new TPad("dataTheoryPad", "dataTheoryPad", 0.0, YINFO, XTHEO, YTITLE);
if (fDataTheoryPad == nullptr) {
std::cerr << std::endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fDataTheoryPad";
std::cerr << std::endl;
return;
}
fDataTheoryPad = std::make_unique<TPad>("dataTheoryPad", "dataTheoryPad", 0.0, YINFO, XTHEO, YTITLE);
fDataTheoryPad->SetFillColor(TColor::GetColor(255,255,255));
fDataTheoryPad->Draw();
// parameter pad
fParameterPad = new TPaveText(XTHEO, 0.5, 1.0, YTITLE, "NDC");
if (fParameterPad == nullptr) {
std::cerr << std::endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fParameterPad";
std::cerr << std::endl;
return;
}
fParameterPad = std::make_unique<TPaveText>(XTHEO, 0.5, 1.0, YTITLE, "NDC");
fParameterPad->SetFillColor(TColor::GetColor(255,255,255));
fParameterPad->SetTextAlign(13); // top, left
fParameterPad->SetTextFont(102); // courier bold, scalable so that greek parameters will be plotted properly
// theory pad
fTheoryPad = new TPaveText(XTHEO, 0.1, 1.0, 0.5, "NDC");
if (fTheoryPad == nullptr) {
std::cerr << std::endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fTheoryPad";
std::cerr << std::endl;
return;
}
fTheoryPad = std::make_unique<TPaveText>(XTHEO, 0.1, 1.0, 0.5, "NDC");
fTheoryPad->SetFillColor(TColor::GetColor(255,255,255));
fTheoryPad->SetTextAlign(13); // top, left
fTheoryPad->SetTextFont(102); // courier bold, scalable so that greek parameters will be plotted properly
// info pad
fInfoPad = new TLegend(0.0, 0.0, 1.0, YINFO, "NDC");
if (fInfoPad == nullptr) {
std::cerr << std::endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fInfoPad";
std::cerr << std::endl;
return;
}
fInfoPad = std::make_unique<TLegend>(0.0, 0.0, 1.0, YINFO, "NDC");
fInfoPad->SetFillColor(TColor::GetColor(255,255,255));
fInfoPad->SetTextAlign(12); // middle, left
@ -4913,11 +4789,7 @@ void PMusrCanvas::PlotData(Bool_t unzoom)
// set y-axis label
fMultiGraphData->GetYaxis()->SetTitle(yAxisTitle.Data());
} else { // more than one data set present, hence add a legend
if (fMultiGraphLegend) {
delete fMultiGraphLegend;
}
fMultiGraphLegend = new TLegend(0.8, 0.8, 1.0, 1.0);
assert(fMultiGraphLegend != nullptr);
fMultiGraphLegend.reset(new TLegend(0.8, 0.8, 1.0, 1.0));
PStringVector legendLabel;
for (UInt_t i=0; i<plotInfo.fRuns.size(); i++) {
runNo = (UInt_t)plotInfo.fRuns[i]-1;
@ -6110,12 +5982,6 @@ void PMusrCanvas::PlotFourierDifference(Bool_t unzoom)
*/
void PMusrCanvas::PlotFourierPhaseValue(Bool_t unzoom)
{
// check if phase TLatex object is present
if (fCurrentFourierPhaseText) {
delete fCurrentFourierPhaseText;
fCurrentFourierPhaseText = nullptr;
}
double x, y;
TString str;
@ -6127,7 +5993,7 @@ void PMusrCanvas::PlotFourierPhaseValue(Bool_t unzoom)
}
x = 0.7;
y = 0.85;
fCurrentFourierPhaseText = new TLatex();
fCurrentFourierPhaseText.reset(new TLatex());
fCurrentFourierPhaseText->SetNDC(kTRUE);
fCurrentFourierPhaseText->SetText(x, y, str.Data());
fCurrentFourierPhaseText->SetTextFont(62);

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -245,20 +245,11 @@ ClassImpQ(PMusrT0)
PMusrT0::PMusrT0()
{
fTimeout = 0;
fTimeoutTimer = nullptr;
fValid = false;
fStatus = 0; // default is quit locally
fMainCanvas = nullptr;
fHisto = nullptr;
fData = nullptr;
fBkg = nullptr;
fToDoInfo = nullptr;
fDataAndBkgEnabled = false;
fT0Enabled = false;
fShowT0DataChannel = false;
@ -267,13 +258,6 @@ PMusrT0::PMusrT0()
fDataRange[1] = 0;
fBkgRange[0] = 0;
fBkgRange[1] = 0;
fT0Line = nullptr;
fT0DataLine = nullptr;
fFirstBkgLine = nullptr;
fLastBkgLine = nullptr;
fFirstDataLine = nullptr;
fLastDataLine = nullptr;
}
//--------------------------------------------------------------------------
@ -287,20 +271,11 @@ PMusrT0::PMusrT0()
PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
{
fTimeout = 0;
fTimeoutTimer = nullptr;
fValid = true;
fStatus = 0; // default is quit locally
fMainCanvas = nullptr;
fHisto = nullptr;
fData = nullptr;
fBkg = nullptr;
fToDoInfo = nullptr;
fDataAndBkgEnabled = false;
fT0Enabled = false;
fShowT0DataChannel = false;
@ -310,13 +285,6 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
fBkgRange[0] = 0;
fBkgRange[1] = 0;
fT0Line = nullptr;
fT0DataLine = nullptr;
fFirstBkgLine = nullptr;
fLastBkgLine = nullptr;
fFirstDataLine = nullptr;
fLastDataLine = nullptr;
// feed necessary objects
TString str;
@ -347,7 +315,7 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
Int_t noOfBins = rawRunData->GetDataBin(histoNo)->size();
Double_t start = -0.5;
Double_t end = noOfBins - 0.5; // -0.5 is correct since the data start at 0.0
fHisto = new TH1F("fHisto", str.Data(), noOfBins, start, end);
fHisto = std::make_unique<TH1F>("fHisto", str.Data(), noOfBins, start, end);
fHisto->SetMarkerStyle(21);
fHisto->SetMarkerSize(0.5);
fHisto->SetMarkerColor(TColor::GetColor(0,0,0)); // black
@ -382,7 +350,7 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
Int_t noOfBins = rawRunData->GetDataBin(histoNo)->size();
Double_t start = -0.5;
Double_t end = noOfBins - 0.5; // -0.5 is correct since the data start at 0.0
fHisto = new TH1F("fHisto", str.Data(), noOfBins, start, end);
fHisto = std::make_unique<TH1F>("fHisto", str.Data(), noOfBins, start, end);
fHisto->SetMarkerStyle(21);
fHisto->SetMarkerSize(0.5);
fHisto->SetMarkerColor(TColor::GetColor(0,0,0)); // black
@ -517,7 +485,7 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
}
// generate canvas etc
fMainCanvas = new TCanvas("fMainCanvas", str);
fMainCanvas = std::make_unique<TCanvas>("fMainCanvas", str);
fMainCanvas->SetFillColor(TColor::GetColor(255,255,255));
@ -545,7 +513,7 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
if (fMusrT0Data.GetCmdTag() == PMUSRT0_GET_T0) {
str = "please set t0 bin only.";
fToDoInfo = new TLatex();
fToDoInfo = std::make_unique<TLatex>();
fToDoInfo->SetTextFont(51);
fToDoInfo->SetTextSize(0.030);
fToDoInfo->SetLineWidth(2);
@ -554,7 +522,7 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
}
if (fMusrT0Data.GetCmdTag() == PMUSRT0_GET_DATA_AND_BKG_RANGE) {
str = "please set data and bkg range.";
fToDoInfo = new TLatex();
fToDoInfo = std::make_unique<TLatex>();
fToDoInfo->SetTextFont(51);
fToDoInfo->SetTextSize(0.030);
fToDoInfo->SetLineWidth(2);
@ -563,64 +531,6 @@ PMusrT0::PMusrT0(PMusrT0Data &data) : fMusrT0Data(data)
}
}
//--------------------------------------------------------------------------
// Destructor
//--------------------------------------------------------------------------
/**
* <p>Destructor.
*/
PMusrT0::~PMusrT0()
{
if (fTimeoutTimer) {
delete fTimeoutTimer;
fTimeoutTimer = nullptr;
}
if (fHisto) {
delete fHisto;
fHisto = nullptr;
}
if (fData) {
delete fData;
fData = nullptr;
}
if (fBkg) {
delete fBkg;
fBkg = nullptr;
}
if (fToDoInfo) {
delete fToDoInfo;
fToDoInfo = nullptr;
}
if (fT0Line) {
delete fT0Line;
fT0Line = nullptr;
}
if (fT0DataLine) {
delete fT0DataLine;
fT0DataLine = nullptr;
}
if (fFirstBkgLine) {
delete fFirstBkgLine;
fFirstBkgLine = nullptr;
}
if (fLastBkgLine) {
delete fLastBkgLine;
fLastBkgLine = nullptr;
}
if (fFirstDataLine) {
delete fFirstDataLine;
fFirstDataLine = nullptr;
}
if (fLastDataLine) {
delete fLastDataLine;
fLastDataLine = nullptr;
}
if (fMainCanvas && (fStatus != 2)) {
delete fMainCanvas;
fMainCanvas = nullptr;
}
}
//--------------------------------------------------------------------------
// Done (SIGNAL)
//--------------------------------------------------------------------------
@ -724,11 +634,7 @@ void PMusrT0::SetTimeout(Int_t timeout)
if (fTimeout <= 0)
return;
if (fTimeoutTimer) {
delete fTimeoutTimer;
fTimeoutTimer = nullptr;
}
fTimeoutTimer = new TTimer();
fTimeoutTimer.reset(new TTimer());
fTimeoutTimer->Connect("Timeout()", "PMusrT0", this, "Quit()");
@ -782,7 +688,7 @@ void PMusrT0::InitT0()
}
Double_t max = fHisto->GetMaximum();
fT0Line = new TLine((Double_t)t0Bin, 0.0, (Double_t)t0Bin, max);
fT0Line = std::make_unique<TLine>((Double_t)t0Bin, 0.0, (Double_t)t0Bin, max);
fT0Line->SetLineStyle(1); // solid
fT0Line->SetLineColor(TColor::GetColor(0,255,0)); // green
fT0Line->SetLineWidth(2);
@ -815,7 +721,7 @@ void PMusrT0::InitDataAndBkg()
Int_t noOfBins = fDataRange[1]-fDataRange[0]+1;
Double_t start = fDataRange[0] - 0.5;
Double_t end = fDataRange[1] + 0.5;
fData = new TH1F("fData", "fData", noOfBins, start, end);
fData = std::make_unique<TH1F>("fData", "fData", noOfBins, start, end);
fData->SetMarkerStyle(21);
fData->SetMarkerSize(0.5);
fData->SetMarkerColor(TColor::GetColor(0,0,255)); // blue
@ -843,7 +749,7 @@ void PMusrT0::InitDataAndBkg()
noOfBins = fBkgRange[1]-fBkgRange[0]+1;
start = fBkgRange[0] - 0.5;
end = fBkgRange[1] + 0.5;
fBkg = new TH1F("fBkg", "fBkg", noOfBins, start, end);
fBkg = std::make_unique<TH1F>("fBkg", "fBkg", noOfBins, start, end);
fBkg->SetMarkerStyle(21);
fBkg->SetMarkerSize(0.5);
fBkg->SetMarkerColor(TColor::GetColor(255,0,0)); // red
@ -857,26 +763,26 @@ void PMusrT0::InitDataAndBkg()
Double_t max = fHisto->GetMaximum();
// data lines
fFirstDataLine = new TLine(static_cast<Double_t>(fDataRange[0]), 0.0, static_cast<Double_t>(fDataRange[0]), max);
fFirstDataLine = std::make_unique<TLine>(static_cast<Double_t>(fDataRange[0]), 0.0, static_cast<Double_t>(fDataRange[0]), max);
fFirstDataLine->SetLineStyle(3); // doted
fFirstDataLine->SetLineColor(TColor::GetColor(0,0,255)); // blue
fFirstDataLine->SetLineWidth(2);
fFirstDataLine->Draw();
fLastDataLine = new TLine(static_cast<Double_t>(fDataRange[1]), 0.0, static_cast<Double_t>(fDataRange[1]), max);
fLastDataLine = std::make_unique<TLine>(static_cast<Double_t>(fDataRange[1]), 0.0, static_cast<Double_t>(fDataRange[1]), max);
fLastDataLine->SetLineStyle(3); // doted
fLastDataLine->SetLineColor(TColor::GetColor(0,0,255)); // blue
fLastDataLine->SetLineWidth(2);
fLastDataLine->Draw();
// bkg lines
fFirstBkgLine = new TLine(static_cast<Double_t>(fBkgRange[0]), 0.0, static_cast<Double_t>(fBkgRange[0]), max);
fFirstBkgLine = std::make_unique<TLine>(static_cast<Double_t>(fBkgRange[0]), 0.0, static_cast<Double_t>(fBkgRange[0]), max);
fFirstBkgLine->SetLineStyle(6); // _..._...
fFirstBkgLine->SetLineColor(TColor::GetColor(255,0,0)); // red
fFirstBkgLine->SetLineWidth(2);
fFirstBkgLine->Draw();
fLastBkgLine = new TLine(static_cast<Double_t>(fBkgRange[1]), 0.0, static_cast<Double_t>(fBkgRange[1]), max);
fLastBkgLine = std::make_unique<TLine>(static_cast<Double_t>(fBkgRange[1]), 0.0, static_cast<Double_t>(fBkgRange[1]), max);
fLastBkgLine->SetLineStyle(6); // _..._...
fLastBkgLine->SetLineColor(TColor::GetColor(255,0,0)); // red
fLastBkgLine->SetLineWidth(2);
@ -898,7 +804,7 @@ void PMusrT0::ShowDataFileT0Channel()
Double_t max = fHisto->GetMaximum();
if (!fT0DataLine) {
fT0DataLine = new TLine(static_cast<Double_t>(t0Bin), 0.0, static_cast<Double_t>(t0Bin), max);
fT0DataLine = std::make_unique<TLine>(static_cast<Double_t>(t0Bin), 0.0, static_cast<Double_t>(t0Bin), max);
fT0DataLine->SetLineStyle(1); // solid
fT0DataLine->SetLineColor(kOrange-3);
fT0DataLine->SetLineWidth(2);
@ -917,8 +823,7 @@ void PMusrT0::ShowDataFileT0Channel()
void PMusrT0::HideDataFileT0Channel()
{
if (fT0DataLine) {
delete fT0DataLine;
fT0DataLine = nullptr;
fT0DataLine.reset();
}
fMainCanvas->Update();
}
@ -1036,15 +941,11 @@ void PMusrT0::SetDataFirstChannel()
fFirstDataLine->SetX1(x);
fFirstDataLine->SetX2(x);
// recreate data histo
delete fData;
fData = nullptr;
// refill data histo
Int_t noOfBins = fDataRange[1]-fDataRange[0]+1;
Double_t start = fDataRange[0] - 0.5;
Double_t end = fDataRange[1] + 0.5;
fData = new TH1F("fData", "fData", noOfBins, start, end);
fData.reset(new TH1F("fData", "fData", noOfBins, start, end));
fData->SetMarkerStyle(21);
fData->SetMarkerSize(0.5);
fData->SetMarkerColor(TColor::GetColor(0,0,255)); // blue
@ -1086,15 +987,11 @@ void PMusrT0::SetDataLastChannel()
fLastDataLine->SetX1(x);
fLastDataLine->SetX2(x);
// recreate data histo
delete fData;
fData = nullptr;
// refill data histo
Int_t noOfBins = fDataRange[1]-fDataRange[0]+1;
Double_t start = fDataRange[0] - 0.5;
Double_t end = fDataRange[1] + 0.5;
fData = new TH1F("fData", "fData", noOfBins, start, end);
fData.reset(new TH1F("fData", "fData", noOfBins, start, end));
fData->SetMarkerStyle(21);
fData->SetMarkerSize(0.5);
fData->SetMarkerColor(TColor::GetColor(0,0,255)); // blue
@ -1136,15 +1033,11 @@ void PMusrT0::SetBkgFirstChannel()
fFirstBkgLine->SetX1(x);
fFirstBkgLine->SetX2(x);
// recreate data histo
delete fBkg;
fBkg = nullptr;
// refill data histo
Int_t noOfBins = fBkgRange[1]-fBkgRange[0]+1;
Double_t start = fBkgRange[0] - 0.5;
Double_t end = fBkgRange[1] + 0.5;
fBkg = new TH1F("fBkg", "fBkg", noOfBins, start, end);
fBkg.reset(new TH1F("fBkg", "fBkg", noOfBins, start, end));
fBkg->SetMarkerStyle(21);
fBkg->SetMarkerSize(0.5);
fBkg->SetMarkerColor(TColor::GetColor(255,0,0)); // red
@ -1186,15 +1079,11 @@ void PMusrT0::SetBkgLastChannel()
fLastBkgLine->SetX1(x);
fLastBkgLine->SetX2(x);
// recreate data histo
delete fBkg;
fBkg = nullptr;
// refill data histo
Int_t noOfBins = fBkgRange[1]-fBkgRange[0]+1;
Double_t start = fBkgRange[0] - 0.5;
Double_t end = fBkgRange[1] + 0.5;
fBkg = new TH1F("fBkg", "fBkg", noOfBins, start, end);
fBkg.reset(new TH1F("fBkg", "fBkg", noOfBins, start, end));
fBkg->SetMarkerStyle(21);
fBkg->SetMarkerSize(0.5);
fBkg->SetMarkerColor(TColor::GetColor(255,0,0)); // red

View File

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

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -31,6 +31,7 @@
#include <iostream>
#include <vector>
#include <string>
#include <memory>
#include <boost/filesystem.hpp>
#include <boost/algorithm/string.hpp>
@ -345,7 +346,7 @@ PRgeHandler::PRgeHandler(const std::string fln)
}
// create the rge xml handler
PXmlRgeHandler *xmlRge = new PXmlRgeHandler();
std::unique_ptr<PXmlRgeHandler> xmlRge = std::make_unique<PXmlRgeHandler>();
if (xmlRge == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke PXmlRgeHandler." << std::endl;
@ -355,7 +356,7 @@ PRgeHandler::PRgeHandler(const std::string fln)
}
// create the SAX parser
TSAXParser *saxParser = new TSAXParser();
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
if (saxParser == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke TSAXParser." << std::endl;
@ -366,7 +367,7 @@ PRgeHandler::PRgeHandler(const std::string fln)
saxParser->SetStopOnError();
// connect SAX parser and rge handler
saxParser->ConnectToHandler("PXmlRgeHandler", xmlRge);
saxParser->ConnectToHandler("PXmlRgeHandler", xmlRge.get());
int status = saxParser->ParseFile(fln.c_str());
if (status != 0) {
std::cerr << std::endl;
@ -433,9 +434,6 @@ PRgeHandler::PRgeHandler(const std::string fln)
fData.push_back(dataSet);
}
}
delete saxParser;
delete xmlRge;
}
//--------------------------------------------------------------------------

View File

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

View File

@ -9,7 +9,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2018-2023 by Zaher Salman *
* Copyright (C) 2018-2024 by Zaher Salman *
* zaher.salman@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *

View File

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

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -99,7 +99,7 @@ PRunBase::PRunBase(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo,
fFuncValues.push_back(0.0);
// generate theory
fTheory = new PTheory(fMsrInfo, runNo);
fTheory = std::make_unique<PTheory>(fMsrInfo, runNo);
if (fTheory == nullptr) {
std::cerr << std::endl << "**SEVERE ERROR** PRunBase::PRunBase: Couldn't create an instance of PTheory :-(, will quit" << std::endl;
exit(0);
@ -181,10 +181,7 @@ void PRunBase::SetFitRange(PDoublePairVector fitRange)
*/
void PRunBase::CleanUp()
{
if (fTheory) {
delete fTheory;
fTheory = nullptr;
}
fTheory.reset();
}
//--------------------------------------------------------------------------

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -41,6 +41,7 @@
#include <fstream>
#include <string>
#include <sstream>
#include <memory>
#include <TROOT.h>
#include <TSystem.h>
@ -1713,7 +1714,7 @@ Bool_t PRunDataHandler::ReadRootFile()
}
} else { // MusrRoot file
// invoke the MusrRoot header object
TMusrRunHeader *header = new TMusrRunHeader(true); // read quite
std::unique_ptr<TMusrRunHeader> header = std::make_unique<TMusrRunHeader>(true); // read quiet
if (header == nullptr) {
std::cerr << std::endl << ">> PRunDataHandler::ReadRootFile: **ERROR** Couldn't invoke MusrRoot RunHeader in file:" << fRunPathName;
std::cerr << std::endl;
@ -2080,12 +2081,6 @@ Bool_t PRunDataHandler::ReadRootFile()
histoData.clear();
}
}
// clean up
if (header) {
delete header;
header=nullptr;
}
}
f.Close();
@ -2122,7 +2117,7 @@ Bool_t PRunDataHandler::ReadNexusFile()
Double_t dval;
bool ok;
PNeXus *nxs_file = new PNeXus(fRunPathName.Data());
std::unique_ptr<PNeXus> nxs_file = std::make_unique<PNeXus>(fRunPathName.Data());
if (!nxs_file->IsValid()) {
std::cerr << std::endl << ">> PRunDataHandler::ReadNexusFile(): Not a valid NeXus file.";
std::cerr << std::endl << ">> Error Message: " << nxs_file->GetErrorMsg().data() << std::endl;
@ -2454,12 +2449,6 @@ Bool_t PRunDataHandler::ReadNexusFile()
} else {
std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): IDF version " << nxs_file->GetIdfVersion() << ", not implemented." << std::endl;
}
// clean up
if (nxs_file) {
delete nxs_file;
nxs_file = nullptr;
}
#else
std::cout << std::endl << ">> PRunDataHandler::ReadNexusFile(): Sorry, not enabled at configuration level, i.e. --enable-NeXus when executing configure" << std::endl << std::endl;
#endif
@ -4531,7 +4520,7 @@ Bool_t PRunDataHandler::WriteMusrRootFile(TString fln)
runHeader = gROOT->GetRootFolder()->AddFolder("RunHeader", "MusrRoot Run Header Info");
gROOT->GetListOfBrowsables()->Add(runHeader, "RunHeader");
TMusrRunHeader *header = new TMusrRunHeader(true);
std::unique_ptr<TMusrRunHeader> header = std::make_unique<TMusrRunHeader>(true);
gROOT->GetListOfBrowsables()->Add(runHeader, "RunHeader");
// feed header info
@ -4647,9 +4636,13 @@ Bool_t PRunDataHandler::WriteMusrRootFile(TString fln)
str.Form("hDecay%03d", dataSet->GetHistoNo());
length = dataSet->GetData()->size();
histo = new TH1F(str.Data(), str.Data(), length+1, -0.5, static_cast<Double_t>(length)+0.5);
Int_t sum=0, entries=0;
for (UInt_t j=0; j<length; j++) {
histo->SetBinContent(j+1, dataSet->GetData()->at(j));
entries = dataSet->GetData()->at(j);
histo->SetBinContent(j+1, entries);
sum += entries;
}
histo->SetEntries(sum);
histos.push_back(histo);
}
} else { // rebin > 1
@ -4666,14 +4659,18 @@ Bool_t PRunDataHandler::WriteMusrRootFile(TString fln)
length = dataSet->GetData()->size();
histo = new TH1F(str.Data(), str.Data(), static_cast<Int_t>(length/fAny2ManyInfo->rebin)+1, -0.5, static_cast<Double_t>(static_cast<Int_t>(length/fAny2ManyInfo->rebin))+0.5);
dataCount = 0;
Int_t sum=0, entries=0;
for (UInt_t j=0; j<length; j++) {
if ((j > 0) && (j % fAny2ManyInfo->rebin == 0)) {
dataCount++;
histo->SetBinContent(dataCount, dataRebin);
dataRebin = 0;
}
dataRebin += static_cast<UInt_t>(dataSet->GetData()->at(j));
entries = dataSet->GetData()->at(j);
sum += entries;
dataRebin += static_cast<UInt_t>(entries);
}
histo->SetEntries(sum);
histos.push_back(histo);
}
}
@ -4683,7 +4680,7 @@ Bool_t PRunDataHandler::WriteMusrRootFile(TString fln)
decayAnaModule->Add(histos[i]);
// write file
TFile *fout = new TFile(fln, "RECREATE", fln);
std::unique_ptr<TFile> fout = std::make_unique<TFile>(fln, "RECREATE", fln);
if (fout == nullptr) {
std::cerr << std::endl << "PRunDataHandler::WriteMusrRootFile(): **ERROR** Couldn't create ROOT file '" << fln << "'" << std::endl;
return false;
@ -4695,6 +4692,12 @@ Bool_t PRunDataHandler::WriteMusrRootFile(TString fln)
histosFolder->Write();
fout->Close();
// cleanup
for (UInt_t i=0; i<histos.size(); i++) {
if (histos[i])
delete histos[i];
}
// check if root file shall be streamed to stdout
if (fAny2ManyInfo->useStandardOutput && (fAny2ManyInfo->compressionTag == 0)) {
// stream file to stdout
@ -4774,7 +4777,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln)
runInfo = gROOT->GetRootFolder()->AddFolder("RunInfo", "LEM RunInfo");
gROOT->GetListOfBrowsables()->Add(runInfo, "RunInfo");
TLemRunHeader *header = new TLemRunHeader();
std::unique_ptr<TLemRunHeader> header = std::make_unique<TLemRunHeader>();
gROOT->GetListOfBrowsables()->Add(runInfo, "RunInfo");
// feed header info
@ -4813,7 +4816,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln)
tt0[i] = dataSet->GetTimeZeroBin()/fAny2ManyInfo->rebin;
}
header->SetTimeZero(tt0);
runInfo->Add(header); // add header to RunInfo folder
runInfo->Add(header.get()); // add header to RunInfo folder
// feed histos
std::vector<TH1F*> histos;
@ -4867,7 +4870,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln)
decayAnaModule->Add(histos[i]);
// write file
TFile *fout = new TFile(fln, "RECREATE", fln);
std::unique_ptr<TFile> fout = std::make_unique<TFile>(fln, "RECREATE", fln);
if (fout == nullptr) {
std::cerr << std::endl << "PRunDataHandler::WriteRootFile(): **ERROR** Couldn't create ROOT file '" << fln << "'" << std::endl;
return false;
@ -4883,9 +4886,7 @@ Bool_t PRunDataHandler::WriteRootFile(TString fln)
delete histos[i];
}
histos.clear();
delete fout;
delete [] tt0;
delete header;
// check if root file shall be streamed to stdout
if (fAny2ManyInfo->useStandardOutput && (fAny2ManyInfo->compressionTag == 0)) {
@ -4956,7 +4957,7 @@ Bool_t PRunDataHandler::WriteNexusFile(TString fln)
std::cout << std::endl << ">> PRunDataHandler::WriteNexusFile(): writing a NeXus data file (" << fln.Data() << ") ... " << std::endl;
// create NeXus object
PNeXus *nxs = new PNeXus();
std::unique_ptr<PNeXus> nxs = std::make_unique<PNeXus>();
if (nxs == nullptr) {
std::cerr << std::endl << ">> PRunDataHandler::WriteNexusFile(): **ERROR** couldn't invoke the NeXus object." << std::endl;
return false;
@ -5236,11 +5237,6 @@ Bool_t PRunDataHandler::WriteNexusFile(TString fln)
if (fgb) delete [] fgb;
if (lgb) delete [] lgb;
} else {
// clean up
if (nxs != 0) {
delete nxs;
nxs = nullptr;
}
return false;
}
@ -5256,20 +5252,11 @@ Bool_t PRunDataHandler::WriteNexusFile(TString fln)
else {
std::cerr << std::endl << ">> PRunDataHandler::WriteNexusFile(): **ERROR** undefined output NeXus format " << fAny2ManyInfo->outFormat.Data() << " found.";
std::cerr << std::endl << ">> Allowed are: hdf4, hdf5, xml" << std::endl;
if (nxs != 0) {
delete nxs;
nxs = nullptr;
}
return false;
}
// write file
nxs->WriteFile(fln, fileType, fAny2ManyInfo->idf);
if (nxs != 0) {
delete nxs;
nxs = nullptr;
}
#else
std::cout << std::endl << ">> PRunDataHandler::WriteNexusFile(): Sorry, not enabled at configuration level, i.e. --enable-NeXus when executing configure" << std::endl << std::endl;
#endif

View File

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

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -38,6 +38,7 @@
#include <cmath>
#include <iostream>
#include <fstream>
#include <memory>
#include <TString.h>
#include <TObjArray.h>
@ -1068,13 +1069,13 @@ Double_t PRunSingleHistoRRF::GetMainFrequency(PDoubleVector &data)
// create histo
Double_t startTime = (fGoodBins[0]-fT0s[0]) * fTimeResolution;
Int_t noOfBins = fGoodBins[1]-fGoodBins[0]+1;
TH1F *histo = new TH1F("data", "data", noOfBins, startTime-fTimeResolution/2.0, startTime+fTimeResolution/2.0+noOfBins*fTimeResolution);
std::unique_ptr<TH1F> histo = std::make_unique<TH1F>("data", "data", noOfBins, startTime-fTimeResolution/2.0, startTime+fTimeResolution/2.0+noOfBins*fTimeResolution);
for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) {
histo->SetBinContent(i-fGoodBins[0]+1, data[i]);
}
// Fourier transform
PFourier *ft = new PFourier(histo, FOURIER_UNIT_FREQ);
std::unique_ptr<PFourier> ft = std::make_unique<PFourier>(histo.get(), FOURIER_UNIT_FREQ);
ft->Transform(F_APODIZATION_STRONG);
// find frequency maximum
@ -1099,10 +1100,6 @@ Double_t PRunSingleHistoRRF::GetMainFrequency(PDoubleVector &data)
// clean up
if (power)
delete power;
if (ft)
delete ft;
if (histo)
delete histo;
return freqMax;
}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -91,7 +91,7 @@ int parseXmlFile(TSAXParser *saxParser, const char *startup_path_name)
/**
* <p>Constructor. Check if the musrfit_startup.xml file is found in some standard search paths
*/
PStartupHandler::PStartupHandler()
PStartupHandler::PStartupHandler(bool reset_startup_file)
{
fStartupFileFound = false;
fStartupFilePath = "";
@ -145,6 +145,17 @@ PStartupHandler::PStartupHandler()
}
}
// musrfit_startup.xml found. Check if it should be rewritten
if (fStartupFileFound && reset_startup_file) {
std::cout << std::endl;
std::cout << ">> Will only reset the file: '" << fStartupFilePath.Data() << "'."<< std::endl;
std::cout << std::endl;
if (!WriteDefaultStartupFile(reset_startup_file)) {
std::cerr << std::endl << "**ERROR** couldn't re-write " << fStartupFilePath.Data() << "." << std::endl;
return;
}
}
// if musrfit_startup.xml is still not found, will create a default one
if (!fStartupFileFound) {
std::cout << std::endl << "**INFO** no musrfit_startup.xml file found, will write a default one." << std::endl;
@ -606,33 +617,37 @@ Bool_t PStartupHandler::StartupFileExists(Char_t *fln)
//--------------------------------------------------------------------------
// WriteDefaultStartupFile
//--------------------------------------------------------------------------
Bool_t PStartupHandler::WriteDefaultStartupFile()
Bool_t PStartupHandler::WriteDefaultStartupFile(bool reset_startup_file)
{
// get home
Char_t startup_path_name[256];
Char_t *home = nullptr;
home = getenv("HOME");
if (home == nullptr) {
std::cerr << std::endl << "**ERROR** couldn't obtain $HOME." << std::endl;
return false;
}
// first check that $HOME/.musrfit exists and if NOT create it
struct stat info;
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit", home);
if (!stat(startup_path_name, &info)) {
if (!(info.st_mode & S_IFDIR))
return false;
} else {
if (mkdir(startup_path_name, 0777)) {
std::cerr << std::endl << "**ERROR** couldn't create '" << startup_path_name << "'" << std::endl;
if (reset_startup_file) { // reset the found
snprintf(startup_path_name, sizeof(startup_path_name), "%s", fStartupFilePath.Data());
} else { // no musrfit_startup.xml found, hence write default under $HOME/.musrfit
// get home
Char_t *home = nullptr;
home = getenv("HOME");
if (home == nullptr) {
std::cerr << std::endl << "**ERROR** couldn't obtain $HOME." << std::endl;
return false;
}
}
// set path-name for musrfit_startup.xml
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
// first check that $HOME/.musrfit exists and if NOT create it
struct stat info;
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit", home);
if (!stat(startup_path_name, &info)) {
if (!(info.st_mode & S_IFDIR))
return false;
} else {
if (mkdir(startup_path_name, 0777)) {
std::cerr << std::endl << "**ERROR** couldn't create '" << startup_path_name << "'" << std::endl;
return false;
}
}
// set path-name for musrfit_startup.xml
snprintf(startup_path_name, sizeof(startup_path_name), "%s/.musrfit/musrfit_startup.xml", home);
}
std::ofstream fout(startup_path_name, std::ofstream::out);
if (!fout.is_open()) {
@ -648,25 +663,36 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
fout << " </comment>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/nemu/data/his</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/nemu/data/wkm</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/misc</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/gps</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/dolly</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/gpd</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/ltf</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/alc</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/alc/td</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/hifi</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/lem</data_path>" << std::endl;
fout << " <data_path>/afs/psi.ch/project/bulkmusr/data/flame</data_path>" << std::endl;
fout << " <!-- MISC/PSI 1985 - 1990 -->" << std::endl;
fout << " <run_name_template inst=\"misc\">d%yyyy%/deltat_misc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <!-- ALC TD/PSI -->" << std::endl;
fout << " <run_name_template inst=\"alc\">d%yyyy%/deltat_zh_chem_%rrrr%.bin</run_name_template>" << std:: endl;
fout << " <run_name_template inst=\"alc\">d%yyyy%/deltat_tdc_alc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"alc\">d%yyyy%/tdc/deltat_tdc_alc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <!-- Dolly/PSI -->" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/root/deltat_tdc_dolly_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pie1/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pie3/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/deltat_flc_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/pta/deltat_pta_dolly_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/deltat_tdc_dolly_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/root/deltat_tdc_dolly_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"dolly\">d%yyyy%/tdc/mdu/deltat_tdc_dolly_%rrrr%.mdu</run_name_template>" << std::endl;
fout << " <!-- Flame/PSI -->" << std::endl;
fout << " <run_name_template inst=\"flame\">d%yyyy%/tdc/root/deltat_tdc_flame_%yyyy%_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"flame\">d%yyyy%/tdc/root/deltat_tdc_flame_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"flame\">d%yyyy%/tdc/deltat_tdc_flame_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"flame\">d%yyyy%/tdc/mdu/deltat_tdc_flame_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
fout << " <!-- GPD/PSI -->" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/root/deltat_tdc_gpd_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_mue1_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_fq_si_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_strobo_%rrrr%.bin</run_name_template>" << std::endl;
@ -677,9 +703,11 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_janis_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_janis_gpd_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/deltat_pta_gpd_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/pta/deltat_pta_gpd_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/deltat_tdc_gpd_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/root/deltat_tdc_gpd_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gpd\">d%yyyy%/tdc/mdu/deltat_tdc_gpd_%rrrr%.mdu</run_name_template>" << std::endl;
fout << " <!-- GPS/PSI -->" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/root/deltat_tdc_gps_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_ccr_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_he3_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_stutt_%rrrr%.bin</run_name_template>" << std::endl;
@ -690,19 +718,23 @@ Bool_t PStartupHandler::WriteDefaultStartupFile()
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_oven2_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/deltat_pta_gps_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/deltat_tdc_gps_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/root/deltat_tdc_gps_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"gps\">d%yyyy%/tdc/mdu/deltat_tdc_gps_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
fout << " <!-- HAL-9500/PSI == HIFI/PSI -->" << std::endl;
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/root/deltat_tdc_hifi_%yyyy%_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/deltat_hifi_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/tdc_hifi_%yyyy%_%rrrrr%.mdu</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"hifi\">d%yyyy%/tdc/root/deltat_tdc_hifi_%yyyy%_%rrrr%.mdu</run_name_template>" << std::endl;
fout << " <!-- LTF/PSI -->" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/deltat_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/deltat_ltf2_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/deltat_pta_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/pta/deltat_pta_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"ltf\">d%yyyy%/tdc/deltat_tdc_ltf_%rrrr%.bin</run_name_template>" << std::endl;
fout << " <!-- LEM/PSI -->" << std::endl;
fout << " <run_name_template inst=\"lem\">%yyyy%/lem%yy%_his_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"lem\">d%yyyy%/tdc/lem%yy%_his_%rrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"lem\">%yyyy%/lem%yy%_his_%rrrrr%.root</run_name_template>" << std::endl;
fout << " <run_name_template inst=\"lem\">d%yyyy%/tdc/lem%yy%_his_%rrrrr%.root</run_name_template>" << std::endl;
fout << " <fourier_settings>" << std::endl;
fout << " <units>Gauss</units>" << std::endl;
fout << " <fourier_power>0</fourier_power>" << std::endl;

View File

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

View File

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

View File

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

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -43,6 +43,7 @@
#include <sstream>
#include <string>
#include <vector>
#include <memory>
#include <boost/algorithm/string.hpp>
@ -52,6 +53,8 @@
#include <TFile.h>
#include <TFolder.h>
#include <TString.h>
#include <TFolder.h>
#include <TH1F.h>
#ifdef HAVE_GIT_REV_H
#include "git-revision.h"
@ -78,7 +81,8 @@
void dump_header_syntax()
{
std::cout << std::endl << "usage: dump_header [-rn <runNo> | -fn <fileName>] [-ff, --fileFormat <fileFormat>]";
std::cout << std::endl << " [-y, --year <year>] [-s, --summary] [--psi-bulk <opt>] |";
std::cout << std::endl << " [-y, --year <year>] [-s, --summary] [-i, --instrument <inst>]";
std::cout << std::endl << " [-c, --counts] | ";
std::cout << std::endl << " --help | --version";
std::cout << std::endl;
std::cout << std::endl << " Dumps the header information of a given muSR data file onto the standard output.";
@ -96,7 +100,8 @@ void dump_header_syntax()
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 << " -i, --instrument <inst> : where <inst> is the requested instrument:";
std::cout << std::endl << " lem (default) | gps | ltf | dolly | gpd | hifi.";
std::cout << std::endl << " lem (default) | gps | ltf | dolly | gpd | hifi | flame.";
std::cout << std::endl << " -c, --counts : will show detector counts as well.";
std::cout << std::endl << " -h, --help : will show this help";
std::cout << std::endl << " -v, --version : will show the current version.";
std::cout << std::endl << std::endl;
@ -108,10 +113,11 @@ void dump_header_syntax()
*
* @param fileName file name of the ROOT file
* @param summary bool, if true dump the summary
* @param counts bool, if true dump detector counts
*
* @return 0 on success, otherwise 1.
*/
int dump_header_root(const std::string fileName, const bool summary)
int dump_header_root(const std::string fileName, const bool summary, const bool counts)
{
TFile f(fileName.c_str());
if (f.IsZombie()) {
@ -122,6 +128,8 @@ int dump_header_root(const std::string fileName, const bool summary)
}
UInt_t fileType = DH_MUSR_ROOT;
UInt_t noOfHistos{0};
PIntVector redGreenOffset;
TFolder *folder;
f.GetObject("RunInfo", folder); // try first LEM-ROOT style file (used until 2011).
@ -138,12 +146,16 @@ int dump_header_root(const std::string fileName, const bool summary)
fileType = DH_LEM_ROOT;
}
std::unique_ptr<TMusrRunHeader> header;
bool ok;
Int_t ival;
if (fileType == DH_LEM_ROOT) { // ROOT (LEM)
// read header and check if some missing run info need to be fed
TLemRunHeader *runHeader = dynamic_cast<TLemRunHeader*>(folder->FindObjectAny("TLemRunHeader"));
TLemRunHeader* runHeader = dynamic_cast<TLemRunHeader*>(folder->FindObjectAny("TLemRunHeader"));
// check if run header is valid
if (!runHeader) {
if (runHeader == nullptr) {
std::cerr << std::endl << "**ERROR** Couldn't obtain run header info from ROOT file " << fileName << std::endl;
f.Close();
return 1;
@ -186,17 +198,9 @@ int dump_header_root(const std::string fileName, const bool summary)
std::cout << std::endl << "First Good Bin : " << timeZero[0];
std::cout << std::endl << "Last Good Bin : " << runHeader->GetNChannels()-1;
std::cout << std::endl << "-------------------" << std::endl << std::endl;
delete runHeader;
} else { // MusrRoot
// invoke the MusrRoot header object
TMusrRunHeader *header = new TMusrRunHeader(fileName.c_str(), true); // read quite
if (header == 0) {
std::cerr << std::endl << "**ERROR** Couldn't invoke MusrRoot RunHeader in file:" << fileName;
std::cerr << std::endl;
f.Close();
return 1;
}
header = std::make_unique<TMusrRunHeader>(fileName.c_str(), true); // read quite
// try to populate the MusrRoot header object
if (!header->ExtractAll(folder)) {
@ -208,7 +212,15 @@ int dump_header_root(const std::string fileName, const bool summary)
header->DumpHeader();
delete header;
if (counts) {
PIntVector ivec;
header->Get("RunInfo/No of Histos", ival, ok);
if (ok)
noOfHistos = ival;
header->Get("RunInfo/RedGreen Offsets", ivec, ok);
if (ok)
redGreenOffset = ivec;
}
}
// summary as well?
@ -229,6 +241,59 @@ int dump_header_root(const std::string fileName, const bool summary)
tstr = static_cast<TObjString*>(runSum->At(i));
str = tstr->String();
std::cout << str;
if (!str.Contains("\r") && !str.Contains("\n"))
std::cout << std::endl;
}
}
// detector counts as well?
if (counts && (fileType == DH_MUSR_ROOT)) {
// dump the detector counts
std::cout << "Detector counts (all, between fgb and lgb)" << std::endl;
f.GetObject("histos", folder);
if ((folder != nullptr) && (header != nullptr)) {
char detectorLabel[64];
TH1F *histo{nullptr};
UInt_t total{0}, total_good{0}, ta, tg;
Int_t fgb, lgb;
for (UInt_t i=0; i<redGreenOffset.size(); i++) {
std::cout << " Group " << i+1 << " (Offset=" << redGreenOffset[i] << ") : " << std::endl;
total = 0;
total_good = 0;
for (UInt_t j=0; j<noOfHistos; j++) {
// get fgb, lgb
fgb = -1;
snprintf(detectorLabel, sizeof(detectorLabel), "DetectorInfo/Detector%03d/First Good Bin", redGreenOffset[i]+j+1);
header->Get(detectorLabel, ival, ok);
if (ok) {
fgb = ival;
}
lgb = -1;
snprintf(detectorLabel, sizeof(detectorLabel), "DetectorInfo/Detector%03d/Last Good Bin", redGreenOffset[i]+j+1);
header->Get(detectorLabel, ival, ok);
if (ok) {
lgb = ival;
}
// get histo info
snprintf(detectorLabel, sizeof(detectorLabel), "hDecay%03d", redGreenOffset[i]+j+1);
histo = (TH1F*) folder->FindObjectAny(detectorLabel);
if (histo != nullptr) {
ta = histo->Integral(0, histo->GetNbinsX()+1);
tg = histo->Integral(fgb, lgb);
std::cout << " " << histo->GetTitle() << ":\t " << ta << ", " << tg << std::endl;
total += ta;
total_good += tg;
}
}
if (i % 2 == 0)
std::cout << " total counts of group " << i+1 << ":\t\t\t " << total << ", " << total_good << std::endl;
else
std::cout << " total counts of group " << i+1 << ":\t\t\t\t\t " << total << ", " << total_good << std::endl;
}
} else {
std::cout << "Sorry, no histos folder found" << std::endl;
f.Close();
return 0;
}
}
@ -242,32 +307,23 @@ int dump_header_root(const std::string fileName, const bool summary)
* <p>dumps the header information of a NeXus file.
*
* @param fileName file name of the NeXus file.
* @param counts bool, if true dump detector counts
*
* @return 0 on success, 1 otherwise
*/
int dump_header_nexus(const std::string fileName) {
int dump_header_nexus(const std::string fileName, const bool counts) {
#ifdef PNEXUS_ENABLED
PNeXus *nxs_file = new PNeXus(fileName.c_str());
if (nxs_file == nullptr) {
std::cerr << std::endl;
std::cerr << "**ERROR** couldn't invoke NeXus file object." << std::endl;
std::cerr << std::endl;
return 1;
}
std::unique_ptr<PNeXus> nxs_file = std::make_unique<PNeXus>(fileName.c_str());
if (nxs_file->IsValid(false)) {
nxs_file->Dump();
nxs_file->Dump(counts);
} else {
std::cerr << std::endl;
std::cerr << "**ERROR** found invalid NeXus file." << std::endl;
std::cerr << std::endl;
return 1;
}
if (nxs_file)
delete nxs_file;
#else
std::cout << std::endl << "NeXus not enabled, hence the header information cannot be dumped." << std::endl << std::endl;
#endif
@ -344,10 +400,11 @@ std::vector<std::string> dump_header_instrument_info(std::string fileName)
*
* @param fileName file name of the PSI-BIN
* @param fileFormat either PSI-BIN or PSI-MDU
* @param counts bool, if true dump detector counts
*
* @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, const bool counts)
{
MuSR_td_PSI_bin psiBin;
int status;
@ -439,7 +496,8 @@ int dump_header_psi_bin(const std::string fileName, const std::string fileFormat
std::cout << std::endl << "Time Zero Bin : " << psiBin.GetT0Int(i);
std::cout << std::endl << "First Good Bin : " << psiBin.GetFirstGoodInt(i);
std::cout << std::endl << "Last Good Bin : " << psiBin.GetLastGoodInt(i);
std::cout << std::endl << "No of Events : " << psiBin.GetEventsHistoLong(i);
if (counts)
std::cout << std::endl << "No of Events : " << psiBin.GetEventsHistoLong(i);
}
std::cout << std::endl << "-------------------" << std::endl << std::endl;
@ -450,10 +508,11 @@ 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
* @param counts bool, if true dump detector counts
*
* @return 0 on success, 1 otherwise
*/
int dump_header_mud(const std::string fileName)
int dump_header_mud(const std::string fileName, const bool counts)
{
int fh;
UINT32 type, val;
@ -618,6 +677,12 @@ int dump_header_mud(const std::string fileName)
std::cout << std::endl << "Last Good Bin : " << val;
else
std::cout << std::endl << "Last Good Bin : ???";
if (counts) {
success = MUD_getHistNumEvents( fh, i+1, &val );
if (success) {
std::cout << std::endl << "#Events : " << val;
}
}
}
std::cout << std::endl << "-------------------" << std::endl << std::endl;
@ -723,6 +788,7 @@ int main(int argc, char *argv[])
std::string year("");
std::string instrument("lem");
bool summary(false);
bool counts(false);
for (int i=1; i<argc; i++) {
if (!strcmp(argv[i], "--help") || !strcmp(argv[i], "-h")) {
@ -812,6 +878,8 @@ int main(int argc, char *argv[])
i++;
} else if (!strcmp(argv[i], "-s") || !strcmp(argv[i], "--summary")) {
summary = true;
} else if (!strcmp(argv[i], "-c") || !strcmp(argv[i], "--counts")) {
counts = true;
} else if (!strcmp(argv[i], "-i") || !strcmp(argv[i], "--instrument")) {
if (i+1 >= argc) {
std::cerr << std::endl << "**ERROR** found option --instrument without <instrument> input!" << std::endl;
@ -819,7 +887,8 @@ int main(int argc, char *argv[])
return 1;
}
if (strcmp(argv[i+1], "lem") && strcmp(argv[i+1], "gps") && strcmp(argv[i+1], "ltf") &&
strcmp(argv[i+1], "dolly") && strcmp(argv[i+1], "gpd") && strcmp(argv[i+1], "hifi")) {
strcmp(argv[i+1], "dolly") && strcmp(argv[i+1], "gpd") && strcmp(argv[i+1], "hifi") &&
strcmp(argv[i+1], "flame")) {
std::cerr << std::endl << "**ERROR** found --instrument with unkown instrument name: '" << argv[i+1] << "'!" << std::endl;
dump_header_syntax();
return 1;
@ -848,40 +917,22 @@ int main(int argc, char *argv[])
// invoke the startup handler in order to get the default search paths to the data files
// read startup file
char startup_path_name[128];
TSAXParser *saxParser = new TSAXParser();
PStartupHandler *startupHandler = new PStartupHandler();
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
std::unique_ptr<PStartupHandler> startupHandler = std::make_unique<PStartupHandler>();
if (!startupHandler->StartupFileFound()) {
std::cerr << std::endl << ">> musrfit **WARNING** couldn't find " << startupHandler->GetStartupFilePath().Data();
std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
} else {
strcpy(startup_path_name, startupHandler->GetStartupFilePath().Data());
saxParser->ConnectToHandler("PStartupHandler", startupHandler);
saxParser->ConnectToHandler("PStartupHandler", startupHandler.get());
//status = saxParser->ParseFile(startup_path_name);
// parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PStartupHandler.cpp for the definition)
int status = parseXmlFile(saxParser, startup_path_name);
int status = parseXmlFile(saxParser.get(), startup_path_name);
// check for parse errors
if (status) { // error
std::cerr << std::endl << ">> musrfit **WARNING** Reading/parsing musrfit_startup.xml failed.";
std::cerr << std::endl;
// clean up
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
}
}
@ -890,7 +941,8 @@ int main(int argc, char *argv[])
if (fileName == "") { // only look for runs if the file name is not explicitly given
int yy = static_cast<int>(strtod(year.c_str(), static_cast<char**>(nullptr)));
int run = static_cast<int>(strtod(runNo.c_str(), static_cast<char**>(nullptr)));
PFindRun findRun(startupHandler->GetDataPathList(), startupHandler->GetRunNameTemplateList(), instrument, yy, run);
PFindRun findRun(startupHandler->GetDataPathList(), startupHandler->GetRunNameTemplateList(),
instrument, yy, run, fileFormat);
if (findRun.FoundPathName()) {
pathFln = findRun.GetPathName().Data();
} else {
@ -929,30 +981,20 @@ int main(int argc, char *argv[])
boost::to_lower(fileFormat);
if (boost::iequals(fileFormat, "MusrRoot") || boost::iequals(fileFormat, "ROOT")) {
dump_header_root(pathFln, summary);
dump_header_root(pathFln, summary, counts);
} else if (boost::iequals(fileFormat, "NeXus")) {
#ifdef PNEXUS_ENABLED
dump_header_nexus(pathFln);
dump_header_nexus(pathFln, counts);
#else
std::cout << std::endl << "Sorry, NeXus is not enabled, hence I cannot help you." << std::endl;
#endif
} else if (boost::iequals(fileFormat, "PSI-BIN") || boost::iequals(fileFormat, "PSI-MDU")) {
dump_header_psi_bin(pathFln, fileFormat);
dump_header_psi_bin(pathFln, fileFormat, counts);
} else if (boost::iequals(fileFormat, "MUD")) {
dump_header_mud(pathFln);
dump_header_mud(pathFln, counts);
} else if (boost::iequals(fileFormat, "WKM")) {
dump_header_wkm(pathFln);
}
// cleanup
if (saxParser) {
delete saxParser;
saxParser = nullptr;
}
if (startupHandler) {
delete startupHandler;
startupHandler = nullptr;
}
return 0;
}

View File

@ -35,6 +35,7 @@
#include <cmath>
#include <vector>
#include <memory>
//-----------------------------------------------------------------------------
/**
@ -88,10 +89,8 @@ inline double T2Integrator::IntegrateFunc(double x1, double x2, const std::vecto
ptrPair.first = (this);
ptrPair.second = &par;
ROOT::Math::GSLIntegrator *integrator = new ROOT::Math::GSLIntegrator(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
std::unique_ptr<ROOT::Math::GSLIntegrator> integrator = std::make_unique<ROOT::Math::GSLIntegrator>(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
double value(integrator->Integral(&T2Integrator::FuncAtXgsl, static_cast<void*>(&ptrPair), x1, x2));
delete integrator;
integrator = nullptr;
return value;
}
@ -115,7 +114,7 @@ class TIntegrator {
private:
static double FuncAtXgsl(double, void *);
ROOT::Math::GSLIntegrator *fIntegrator; ///< pointer to the GSL integrator
std::unique_ptr<ROOT::Math::GSLIntegrator> fIntegrator; ///< pointer to the GSL integrator
mutable double (*fFunc)(double, void *); ///< pointer to the integrand function
};
@ -125,7 +124,7 @@ class TIntegrator {
* Allocation of memory for an integration using the adaptive 31 point Gauss-Kronrod rule
*/
inline TIntegrator::TIntegrator() : fFunc(0) {
fIntegrator = new ROOT::Math::GSLIntegrator(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
fIntegrator = std::make_unique<ROOT::Math::GSLIntegrator>(ROOT::Math::Integration::kADAPTIVE,ROOT::Math::Integration::kGAUSS31);
}
//-----------------------------------------------------------------------------
@ -135,8 +134,6 @@ inline TIntegrator::TIntegrator() : fFunc(0) {
*/
inline TIntegrator::~TIntegrator(){
fPar.clear();
delete fIntegrator;
fIntegrator=nullptr;
fFunc=0;
}
@ -190,7 +187,7 @@ class TMCIntegrator {
private:
static double FuncAtXgsl(double *, size_t, void *);
ROOT::Math::GSLMCIntegrator *fMCIntegrator; ///< pointer to the GSL integrator
std::unique_ptr<ROOT::Math::GSLMCIntegrator> fMCIntegrator; ///< pointer to the GSL integrator
mutable double (*fFunc)(double *, size_t, void *); ///< pointer to the integrand function
};
@ -200,7 +197,7 @@ class TMCIntegrator {
* Allocation of memory for an integration using the MISER algorithm of Press and Farrar
*/
inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
fMCIntegrator = new ROOT::Math::GSLMCIntegrator(ROOT::Math::MCIntegration::kMISER, 1.E-6, 1.E-4, 500000);
fMCIntegrator = std::make_unique<ROOT::Math::GSLMCIntegrator>(ROOT::Math::MCIntegration::kMISER, 1.E-6, 1.E-4, 500000);
}
//-----------------------------------------------------------------------------
@ -210,8 +207,6 @@ inline TMCIntegrator::TMCIntegrator() : fFunc(0) {
*/
inline TMCIntegrator::~TMCIntegrator(){
fPar.clear();
delete fMCIntegrator;
fMCIntegrator=nullptr;
fFunc=0;
}

View File

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

View File

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

View File

@ -33,37 +33,33 @@
#include <cmath>
#include <cassert>
#include <algorithm>
using namespace std;
#include <memory>
//--------------------
// Constructor of the TrimSPData class -- reading all available trim.SP-rge-files with a given name into std::vectors
//--------------------
TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool debug, unsigned int highRes) {
TTrimSPData::TTrimSPData(const std::string &path, std::map<double, std::string> &energies, bool debug, unsigned int highRes) {
// sort the energies in ascending order - this might be useful for later applications (energy-interpolations etc.)
// after the change from the vector to the map this is not necessary any more - since maps are always ordered!
// sort(energies.begin(), energies.end());
double zz(0.0), nzz(0.0);
vector<double> vzz, vnzz;
string word, energyStr;
std::vector<double> vzz, vnzz;
std::string word, energyStr;
bool goodFile(false);
for ( map<double, string>::const_iterator iter(energies.begin()); iter != energies.end(); ++iter ) {
for ( std::map<double, std::string>::const_iterator iter(energies.begin()); iter != energies.end(); ++iter ) {
energyStr = path + iter->second + ".rge";
ifstream *rgeFile = new ifstream(energyStr.c_str());
if(! *rgeFile) {
cerr << "TTrimSPData::TTrimSPData: file " << energyStr << " not found! Try next energy..." << endl;
delete rgeFile;
rgeFile = 0;
std::unique_ptr<std::ifstream> rgeFile = std::make_unique<std::ifstream>(energyStr.c_str());
if (rgeFile == nullptr) {
std::cerr << "TTrimSPData::TTrimSPData: file " << energyStr << " not found! Try next energy..." << std::endl;
} else {
while(*rgeFile >> word) {
if(word == "PARTICLES") {
while (*rgeFile >> word) {
if (word == "PARTICLES") {
goodFile = true;
break;
}
@ -73,7 +69,7 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
fEnergy.push_back(iter->first);
while(!rgeFile->eof()) {
while (!rgeFile->eof()) {
*rgeFile >> zz >> nzz;
vzz.push_back(zz);
vnzz.push_back(nzz);
@ -92,8 +88,6 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
rgeFile->close();
delete rgeFile;
rgeFile = 0;
vzz.clear();
vnzz.clear();
@ -106,14 +100,14 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
}
} else {
cerr << "TTrimSPData::TTrimSPData: " << energyStr << " does not seem to be a valid unmodified TRIM.SP output file!" << endl;
std::cerr << "TTrimSPData::TTrimSPData: " << energyStr << " does not seem to be a valid unmodified TRIM.SP output file!" << std::endl;
continue;
}
}
}
if (debug)
cout << "TTrimSPData::TTrimSPData: Read in " << fDataNZ.size() << " implantation profiles in total." << endl;
std::cout << "TTrimSPData::TTrimSPData: Read in " << fDataNZ.size() << " implantation profiles in total." << std::endl;
fOrigDataNZ = fDataNZ;
@ -126,8 +120,8 @@ TTrimSPData::TTrimSPData(const string &path, map<double, string> &energies, bool
// If it is not found the energy iterator will point to the end() of the energy vector.
void TTrimSPData::FindEnergy(double e) const {
for(fEnergyIter = fEnergy.begin(); fEnergyIter != fEnergy.end(); ++fEnergyIter) {
if(fabs(*fEnergyIter - e) < 0.05)
for (fEnergyIter = fEnergy.begin(); fEnergyIter != fEnergy.end(); ++fEnergyIter) {
if (fabs(*fEnergyIter - e) < 0.05)
return;
}
return;
@ -137,11 +131,11 @@ void TTrimSPData::UseHighResolution(double e) {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
vector<double> vecZ;
vector<double> vecNZ;
for(double zz(1.); zz<2100.; zz+=1.) {
std::vector<double> vecZ;
std::vector<double> vecNZ;
for (double zz(1.); zz<2100.; zz+=1.) {
vecZ.push_back(zz);
vecNZ.push_back(GetNofZ(zz/10.0, e));
}
@ -153,7 +147,7 @@ void TTrimSPData::UseHighResolution(double e) {
return;
}
cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... Nothing happens." << endl;
std::cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... Nothing happens." << std::endl;
return;
}
@ -161,16 +155,16 @@ void TTrimSPData::UseHighResolution(double e) {
// Method returning z-vector calculated by trim.SP for given energy[keV]
//---------------------
vector<double> TTrimSPData::DataZ(double e) const {
std::vector<double> TTrimSPData::DataZ(double e) const {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
return fDataZ[i];
}
// default
cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... You get back the first one." << endl;
std::cout << "TTrimSPData::DataZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
return fDataZ[0];
}
@ -179,50 +173,50 @@ vector<double> TTrimSPData::DataZ(double e) const {
// potentially altered by the WeightLayers- or the Normalize-method for given energy[keV]
//---------------------
vector<double> TTrimSPData::DataNZ(double e) const {
std::vector<double> TTrimSPData::DataNZ(double e) const {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
return fDataNZ[i];
}
// default
cout << "TTrimSPData::DataNZ: No implantation profile available for the specified energy... You get back the first one." << endl;
return fDataNZ[0];
std::cout << "TTrimSPData::DataNZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
return fDataNZ[0];
}
//---------------------
// Method returning original n(z)-vector calculated by trim.SP for given energy[keV]
//---------------------
vector<double> TTrimSPData::OrigDataNZ(double e) const {
std::vector<double> TTrimSPData::OrigDataNZ(double e) const {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
return fOrigDataNZ[i];
}
// default
cout << "TTrimSPData::OrigDataNZ: No implantation profile available for the specified energy... You get back the first one." << endl;
return fOrigDataNZ[0];
std::cout << "TTrimSPData::OrigDataNZ: No implantation profile available for the specified energy... You get back the first one." << std::endl;
return fOrigDataNZ[0];
}
double TTrimSPData::DataDZ(double e) const {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
return fDZ[i];
}
// default
cout << "TTrimSPData::DataDZ: No implantation profile available for the specified energy... The resolution will be zero!" << endl;
return 0.0;
std::cout << "TTrimSPData::DataDZ: No implantation profile available for the specified energy... The resolution will be zero!" << std::endl;
return 0.0;
}
//---------------------
@ -230,10 +224,10 @@ double TTrimSPData::DataDZ(double e) const {
// Parameters: Energy[keV], LayerNumber[1], Interfaces[nm]
//---------------------
double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<double>& interface) const {
double TTrimSPData::LayerFraction(double e, unsigned int layno, const std::vector<double>& interface) const {
if(layno < 1 && layno > (interface.size()+1)) {
cout << "TTrimSPData::LayerFraction: No such layer available according to your specified interfaces... Returning 0.0!" << endl;
if (layno < 1 && layno > (interface.size()+1)) {
std::cout << "TTrimSPData::LayerFraction: No such layer available according to your specified interfaces... Returning 0.0!" << std::endl;
return 0.0;
}
@ -244,21 +238,21 @@ double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<dou
// Because we do not know if the implantation profile is normalized or not, do not care about this and calculate the fraction from the beginning
// Total "number of muons"
double totalNumber(0.0);
for(unsigned int j(0); j<fDataZ[i].size(); j++)
for (unsigned int j(0); j<fDataZ[i].size(); j++)
totalNumber += fDataNZ[i][j];
// "number of muons" in layer layno
double layerNumber(0.0);
if(!(layno-1)){
for(unsigned int j(0); j<fDataZ[i].size(); j++)
if(fDataZ[i][j] < interface[0]*10.0)
if (!(layno-1)){
for (unsigned int j(0); j<fDataZ[i].size(); j++)
if (fDataZ[i][j] < interface[0]*10.0)
layerNumber += fDataNZ[i][j];
} else if(!(layno-interface.size()-1)){
for(unsigned int j(0); j<fDataZ[i].size(); j++)
if(fDataZ[i][j] >= *(interface.end()-1)*10.0)
} else if (!(layno-interface.size()-1)) {
for (unsigned int j(0); j<fDataZ[i].size(); j++)
if (fDataZ[i][j] >= *(interface.end()-1)*10.0)
layerNumber += fDataNZ[i][j];
} else {
for(unsigned int j(0); j<fDataZ[i].size(); j++)
if(fDataZ[i][j] >= interface[layno-2]*10.0 && fDataZ[i][j] < interface[layno-1]*10.0)
for (unsigned int j(0); j<fDataZ[i].size(); j++)
if (fDataZ[i][j] >= interface[layno-2]*10.0 && fDataZ[i][j] < interface[layno-1]*10.0)
layerNumber += fDataNZ[i][j];
}
// fraction of muons in layer layno
@ -267,9 +261,9 @@ double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<dou
}
// default
cout << "TTrimSPData::LayerFraction: No implantation profile available for the specified energy " << e << " keV... Returning 0.0" << endl;
return 0.0;
std::cout << "TTrimSPData::LayerFraction: No implantation profile available for the specified energy " << e << " keV... Returning 0.0" << std::endl;
return 0.0;
}
//---------------------
@ -280,30 +274,30 @@ double TTrimSPData::LayerFraction(double e, unsigned int layno, const vector<dou
// the first and last layers get the full n(z), where only one third of the muons in the second layer will be taken into account
//---------------------
void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const vector<double>& weight) const {
void TTrimSPData::WeightLayers(double e, const std::vector<double>& interface, const std::vector<double>& weight) const {
if(weight.size()-interface.size()-1) {
cout << "TTrimSPData::WeightLayers: For the weighting the number of interfaces has to be one less than the number of weights!" << endl;
cout << "TTrimSPData::WeightLayers: No weighting of the implantation profile will be done unless you take care of that!" << endl;
if (weight.size()-interface.size()-1) {
std::cout << "TTrimSPData::WeightLayers: For the weighting the number of interfaces has to be one less than the number of weights!" << std::endl;
std::cout << "TTrimSPData::WeightLayers: No weighting of the implantation profile will be done unless you take care of that!" << std::endl;
return;
}
for(unsigned int i(0); i<interface.size(); i++) {
for (unsigned int i(0); i<interface.size(); i++) {
if (interface[i]<0.0) {
cout << "TTrimSPData::WeightLayers: One of your layer interfaces has a negative coordinate! - No weighting will be done!" << endl;
std::cout << "TTrimSPData::WeightLayers: One of your layer interfaces has a negative coordinate! - No weighting will be done!" << std::endl;
return;
}
else if (i>1) {
if (interface[i]<interface[i-1]) {
cout << "TTrimSPData::WeightLayers: The specified interfaces appear to be not in ascending order! - No weighting will be done!" << endl;
std::cout << "TTrimSPData::WeightLayers: The specified interfaces appear to be not in ascending order! - No weighting will be done!" << std::endl;
return;
}
}
}
for(unsigned int i(0); i<weight.size(); i++) {
for (unsigned int i(0); i<weight.size(); i++) {
if (weight[i]>1.0 || weight[i]<0.0) {
cout << "TTrimSPData::WeightLayers: At least one of the specified weights is out of range - no weighting will be done!" << endl;
std::cout << "TTrimSPData::WeightLayers: At least one of the specified weights is out of range - no weighting will be done!" << std::endl;
return;
}
}
@ -311,11 +305,11 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
FindEnergy(e);
// If all weights are equal to one, use the original n(z) vector
for(unsigned int i(0); i<weight.size(); i++) {
if(weight[i]-1.0)
for (unsigned int i(0); i<weight.size(); i++) {
if (weight[i]-1.0)
break;
if(i == weight.size() - 1) {
if(fEnergyIter != fEnergy.end()) {
if (i == weight.size() - 1) {
if (fEnergyIter != fEnergy.end()) {
unsigned int j(fEnergyIter - fEnergy.begin());
fDataNZ[j] = fOrigDataNZ[j];
fIsNormalized[j] = false;
@ -324,12 +318,12 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
}
}
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
unsigned int k(0);
for(unsigned int j(0); j<fDataZ[i].size(); j++) {
if(k<interface.size()) {
if(fDataZ[i][j] < interface[k]*10.0)
for (unsigned int j(0); j<fDataZ[i].size(); j++) {
if (k<interface.size()) {
if (fDataZ[i][j] < interface[k]*10.0)
fDataNZ[i][j] = fOrigDataNZ[i][j]*weight[k];
else {
k++;
@ -339,11 +333,11 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
else
fDataNZ[i][j] = fOrigDataNZ[i][j]*weight[k];
}
fIsNormalized[i] = false;
return;
fIsNormalized[i] = false;
return;
}
cout << "TTrimSPData::WeightLayers: No implantation profile available for the specified energy... No weighting done." << endl;
std::cout << "TTrimSPData::WeightLayers: No implantation profile available for the specified energy... No weighting done." << std::endl;
return;
}
@ -353,20 +347,20 @@ void TTrimSPData::WeightLayers(double e, const vector<double>& interface, const
double TTrimSPData::GetNofZ(double zz, double e) const {
vector<double> z, nz;
std::vector<double> z, nz;
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
z = fDataZ[i];
nz = fDataNZ[i];
} else {
cout << "TTrimSPData::GetNofZ: No implantation profile available for the specified energy " << e << " keV... Quitting!" << endl;
std::cout << "TTrimSPData::GetNofZ: No implantation profile available for the specified energy " << e << " keV... Quitting!" << std::endl;
exit(-1);
}
if(zz < 0)
if (zz < 0)
return 0.0;
bool found = false;
@ -395,7 +389,7 @@ void TTrimSPData::Normalize(double e) const {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
double nZsum = 0.0;
for (unsigned int j(0); j<fDataZ[i].size(); j++)
@ -408,9 +402,9 @@ void TTrimSPData::Normalize(double e) const {
return;
}
// default
cout << "TTrimSPData::Normalize: No implantation profile available for the specified energy... No normalization done." << endl;
return;
std::cout << "TTrimSPData::Normalize: No implantation profile available for the specified energy... No normalization done." << std::endl;
return;
}
//---------------------
@ -420,12 +414,12 @@ void TTrimSPData::Normalize(double e) const {
bool TTrimSPData::IsNormalized(double e) const {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
return fIsNormalized[i];
}
cout << "TTrimSPData::IsNormalized: No implantation profile available for the specified energy... Returning false! Check your code!" << endl;
std::cout << "TTrimSPData::IsNormalized: No implantation profile available for the specified energy... Returning false! Check your code!" << std::endl;
return false;
}
@ -436,19 +430,19 @@ bool TTrimSPData::IsNormalized(double e) const {
double TTrimSPData::MeanRange(double e) const {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
if (!fIsNormalized[i])
Normalize(e);
double mean(0.0);
for(unsigned int j(0); j<fDataNZ[i].size(); j++){
for (unsigned int j(0); j<fDataNZ[i].size(); j++){
mean += fDataNZ[i][j]*fDataZ[i][j];
}
mean *= fDZ[i]/10.0;
return mean;
}
cout << "TTrimSPData::MeanRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << endl;
std::cout << "TTrimSPData::MeanRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << std::endl;
return -1.;
}
@ -460,21 +454,21 @@ double TTrimSPData::PeakRange(double e) const {
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
vector<double>::const_iterator nziter;
std::vector<double>::const_iterator nziter;
nziter = max_element(fDataNZ[i].begin(),fDataNZ[i].end());
if(nziter != fDataNZ[i].end()){
if (nziter != fDataNZ[i].end()){
unsigned int j(nziter - fDataNZ[i].begin());
return fDataZ[i][j]/10.0;
}
cout << "TTrimSPData::PeakRange: No maximum found in the implantation profile... Returning -1! Please check the profile!" << endl;
std::cout << "TTrimSPData::PeakRange: No maximum found in the implantation profile... Returning -1! Please check the profile!" << std::endl;
return -1.;
}
cout << "TTrimSPData::PeakRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << endl;
std::cout << "TTrimSPData::PeakRange: No implantation profile available for the specified energy... Returning -1! Check your code!" << std::endl;
return -1.;
}
@ -484,26 +478,26 @@ double TTrimSPData::PeakRange(double e) const {
//---------------------
void TTrimSPData::ConvolveGss(double w, double e) const {
if(!w)
if (!w)
return;
vector<double> z, nz, gss;
std::vector<double> z, nz, gss;
double nn;
FindEnergy(e);
if(fEnergyIter != fEnergy.end()) {
if (fEnergyIter != fEnergy.end()) {
unsigned int i(fEnergyIter - fEnergy.begin());
z = fDataZ[i];
nz = fDataNZ[i];
for(unsigned int k(0); k<z.size(); k++) {
for (unsigned int k(0); k<z.size(); k++) {
gss.push_back(exp(-z[k]*z[k]/200.0/w/w));
}
for(unsigned int k(0); k<nz.size(); k++) {
for (unsigned int k(0); k<nz.size(); k++) {
nn = 0.0;
for(unsigned int j(0); j<nz.size(); j++) {
for (unsigned int j(0); j<nz.size(); j++) {
nn += nz[j]*gss[abs(int(k)-int(j))];
}
fDataNZ[i][k] = nn;
@ -514,6 +508,6 @@ void TTrimSPData::ConvolveGss(double w, double e) const {
return;
}
cout << "TTrimSPData::ConvolveGss: No implantation profile available for the specified energy... No convolution done!" << endl;
std::cout << "TTrimSPData::ConvolveGss: No implantation profile available for the specified energy... No convolution done!" << std::endl;
return;
}

View File

@ -32,7 +32,6 @@
#include <vector>
#include <string>
#include <map>
using namespace std;
/**
* <p>Class used to handle a set of low energy muon implantation profiles
@ -41,7 +40,7 @@ class TTrimSPData {
public:
TTrimSPData(const string&, map<double, string>&, bool debug = false, unsigned int highRes = 0);
TTrimSPData(const std::string&, std::map<double, std::string>&, bool debug = false, unsigned int highRes = 0);
~TTrimSPData() {
fDataZ.clear();
@ -52,15 +51,15 @@ public:
fIsNormalized.clear();
}
vector<double> Energy() const {return fEnergy;}
vector<double> DataZ(double) const;
vector<double> DataNZ(double) const;
vector<double> OrigDataNZ(double) const;
std::vector<double> Energy() const {return fEnergy;}
std::vector<double> DataZ(double) const;
std::vector<double> DataNZ(double) const;
std::vector<double> OrigDataNZ(double) const;
double DataDZ(double) const;
void UseHighResolution(double);
void SetOriginal() {fOrigDataNZ = fDataNZ;}
void WeightLayers(double, const vector<double>&, const vector<double>&) const;
double LayerFraction(double, unsigned int, const vector<double>&) const;
void WeightLayers(double, const std::vector<double>&, const std::vector<double>&) const;
double LayerFraction(double, unsigned int, const std::vector<double>&) const;
double GetNofZ(double, double) const;
void Normalize(double) const;
bool IsNormalized(double) const;
@ -71,13 +70,13 @@ public:
private:
void FindEnergy(double) const;
vector<double> fEnergy; ///< vector holding all available muon energies
vector<double> fDZ; ///< vector holding the spatial resolution of the TRIM.SP output for all energies
vector< vector<double> > fDataZ; ///< discrete points in real space for which n(z) has been calculated for all energies
mutable vector< vector<double> > fDataNZ; ///< n(z) for all energies
vector< vector<double> > fOrigDataNZ; ///< original (unmodified) implantation profiles for all energies as read in from rge-files
mutable vector<bool> fIsNormalized; ///< tag indicating if the implantation profiles are normalized (for each energy separately)
mutable vector<double>::const_iterator fEnergyIter; ///< iterator traversing the vector of available energies
std::vector<double> fEnergy; ///< vector holding all available muon energies
std::vector<double> fDZ; ///< vector holding the spatial resolution of the TRIM.SP output for all energies
std::vector< std::vector<double> > fDataZ; ///< discrete points in real space for which n(z) has been calculated for all energies
mutable std::vector< std::vector<double> > fDataNZ; ///< n(z) for all energies
std::vector< std::vector<double> > fOrigDataNZ; ///< original (unmodified) implantation profiles for all energies as read in from rge-files
mutable std::vector<bool> fIsNormalized; ///< tag indicating if the implantation profiles are normalized (for each energy separately)
mutable std::vector<double>::const_iterator fEnergyIter; ///< iterator traversing the vector of available energies
};
#endif // _TTrimSPDataHandler_H_

View File

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

View File

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

View File

@ -6,6 +6,7 @@ set(DEPTH_PROFILE_INC ${CMAKE_CURRENT_SOURCE_DIR}/../inc)
# ROOT requires that the dictonary header files are found at configuration time.
# Hence, target_include_directories cannot be used here because, targets are
# setup only afterwards.
include_directories(${FFTW3_INCLUDE})
include_directories(${MUSRFIT_INC})
include_directories(${DEPTH_PROFILE_INC})
@ -13,7 +14,7 @@ root_generate_dictionary(
PDepthProfileDict
PDepthProfile.h
OPTIONS
-I${FFTW3_INCLUDE_DIR}
-I${FFTW3_INCLUDE}
-I${MUSRFIT_INC}
-I${DEPTH_PROFILE_INC}
-inlineInputHeader
@ -45,7 +46,7 @@ set_target_properties(PDepthProfile
#--- make sure that the include directory is found ----------------------------
target_include_directories(
PDepthProfile BEFORE PRIVATE
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE}>
$<BUILD_INTERFACE:${MUSRFIT_INC}>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/../inc>
)

View File

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

View File

@ -1,5 +1,5 @@
<?xml version="1.0" encoding="UTF-8"?>
<nonlocal xmlns="http://nemu.web.psi.ch/musrfit/nonlocal">
<depthProf xmlns="http://nemu.web.psi.ch/musrfit/depthProf">
<comment>
TrimSp information
</comment>
@ -31,5 +31,7 @@
<energy>21000</energy>
<energy>22000</energy>
</energy_list>
<!-- <energy_vect start="1000" stop="22000" step="1000"/>
-->
</trim_sp>
</nonlocal>
</depthProf>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -10,7 +10,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2011-2023 by Andreas Suter *
* Copyright (C) 2011-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -59,14 +59,14 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
// read XML startup file
char startup_path_name[128];
TSAXParser *saxParser = new TSAXParser();
PMPStartupHandler *fStartupHandler = new PMPStartupHandler();
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
fStartupHandler = std::make_unique<PMPStartupHandler>();
strcpy(startup_path_name, fStartupHandler->GetStartupFilePath().Data());
saxParser->ConnectToHandler("PMPStartupHandler", fStartupHandler);
saxParser->ConnectToHandler("PMPStartupHandler", fStartupHandler.get());
//Int_t status = saxParser->ParseFile(startup_path_name);
// parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
Int_t status = parseXmlFile(saxParser, startup_path_name);
Int_t status = parseXmlFile(saxParser.get(), startup_path_name);
// check for parse errors
if (status) { // error
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal: **WARNING** Reading/parsing mag_proximity_startup.xml failed.";
@ -74,12 +74,6 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
fValid = false;
}
// clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
// check if everything went fine with the startup handler
if (!fStartupHandler->IsValid()) {
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
@ -89,7 +83,7 @@ PMagProximityFitterGlobal::PMagProximityFitterGlobal()
}
// load all the TRIM.SP rge-files
fRgeHandler = new PRgeHandler();
fRgeHandler = std::make_unique<PRgeHandler>();
if (!fRgeHandler->IsValid()) {
std::cout << std::endl << ">> PMagProximityFitterGlobal::PMagProximityFitterGlobal **PANIC ERROR**";
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
@ -109,15 +103,6 @@ PMagProximityFitterGlobal::~PMagProximityFitterGlobal()
fPreviousParam.clear();
fField.clear();
if (fRgeHandler) {
delete fRgeHandler;
fRgeHandler = nullptr;
}
if (fStartupHandler) {
delete fStartupHandler;
fStartupHandler = nullptr;
}
}
//--------------------------------------------------------------------------

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2023 by Andreas Suter *
* Copyright (C) 2009-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -30,6 +30,8 @@
#ifndef _PMAGPROXIMITYFITTER_H_
#define _PMAGPROXIMITYFITTER_H_
#include <memory>
#include "PUserFcnBase.h"
#include "PMPStartupHandler.h"
#include "PRgeHandler.h"
@ -49,8 +51,8 @@ class PMagProximityFitterGlobal
private:
Bool_t fValid;
PMPStartupHandler *fStartupHandler;
PRgeHandler *fRgeHandler;
std::unique_ptr<PMPStartupHandler> fStartupHandler;
std::unique_ptr<PRgeHandler> fRgeHandler;
mutable std::vector<Double_t> fPreviousParam;

View File

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

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2023 by Andreas Suter *
* Copyright (C) 2007-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -31,6 +31,7 @@
#include <ctime>
#include <iostream>
#include <iomanip>
#include <memory>
#include "TMusrRunHeader.h"
@ -1075,7 +1076,7 @@ Bool_t TMusrRunHeader::ExtractHeaderInformation(TObjArray *headerInfo, TString r
}
for (Int_t i=0; i<tokens->GetEntries(); i++) {
ostr = dynamic_cast<TObjString*>(tokens->At(i));
dvec.push_back(ostr->GetString().Atoi());
dvec.push_back(ostr->GetString().Atof());
}
if (tokens) {
delete tokens;
@ -1234,7 +1235,7 @@ void TMusrRunHeader::DumpHeader()
str += subStr;
str += "; ";
}
subStr.Form(fmt, dvec.size()-1);
subStr.Form(fmt, dvec[dvec.size()-1]);
str += subStr;
str += " -@";
str += MRH_DOUBLE_VECTOR;
@ -1254,13 +1255,13 @@ void TMusrRunHeader::DumpHeader()
*/
void TMusrRunHeader::DrawHeader()
{
TPaveText *pt;
TCanvas *ca;
std::unique_ptr<TPaveText> pt;
std::unique_ptr<TCanvas> ca;
ca = new TCanvas("MusrRoot RunHeader","MusrRoot RunHeader", 147,37,699,527);
ca = std::make_unique<TCanvas>("MusrRoot RunHeader","MusrRoot RunHeader", 147,37,699,527);
ca->Range(0., 0., 100., 100.);
pt = new TPaveText(10.,10.,90.,90.,"br");
pt = std::make_unique<TPaveText>(10.,10.,90.,90.,"br");
pt->SetFillColor(19);
pt->SetTextAlign(12);
@ -1506,7 +1507,7 @@ bool TMusrRunHeader::UpdateFolder(TObject *treeObj, TString path)
if (!obj) { // required object not present, create it
TObjArray *oarray = new TObjArray();
if (!oarray) {
if (oarray == nullptr) {
std::cerr << std::endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't create header structure!!" << std::endl;
return false;
}

View File

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

View File

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

Binary file not shown.

View File

@ -274,7 +274,7 @@ An example program \verb!write_musrRoot_runHeader! which is writing a full run h
\begin{shaded}
\begin{verbatim}
TMusrRunHeader *header = new TMusrRunHeader();
std::unique_ptr<TMusrRunHeader> header = std::make_unique<TMusrRunHeader>();
TMusrRunPhysicalQuantity prop;
\end{verbatim}
\end{shaded}
@ -318,14 +318,15 @@ header->Set("DetectorInfo/Detector001/Time Zero Bin", 3419.0);
\begin{shaded}
\begin{verbatim}
TFile *f = new TFile(fileName, "RECREATE", "write_musrRoot_runHeader");
std::unique_ptr<TFile> f = std::make_unique<TFile>(fileName, "RECREATE",
"write_musrRoot_runHeader");
if (f->IsZombie()) {
delete f;
return -1;
}
// create the needed TFolder object
TFolder *runHeader = new TFolder("RunHeader", "MusrRoot Run Header Info");
std::unique_ptr<TFolder> runHeader = std::make_unique<TFolder>("RunHeader",
"MusrRoot Run Header Info");
// create the "directory" structure
if (header->FillFolder(runHeader)) {
@ -343,21 +344,22 @@ The following code snippet shows how the extract the full run header from the \m
\begin{shaded}
\begin{verbatim}
TFile *f = new TFile(fileName, "READ", "read_musrRoot_runHeader");
std::unique_ptr<TFile> f = std::make_unique<TFile>(fileName, "READ",
"read_musrRoot_runHeader");
if (f->IsZombie()) {
delete f;
return -1;
}
TFolder *runHeader = 0;
TFolder *runHeader = nullptr;
f->GetObject("RunHeader", runHeader);
if (runHeader == 0) {
if (runHeader == nullptr) {
cerr << endl << ">> **ERROR** Couldn't get top folder RunHeader";
closeFile(f);
return -1;
}
TMusrRunHeader *header = new TMusrRunHeader(fileName);
std::unique_ptr<TMusrRunHeader> header =
std::make_unique<TMusrRunHeader>(fileName);
if (!header->ExtractAll(runHeader)) {
cerr << endl << ">> **ERROR** couldn't extract all RunHeader information";
@ -366,7 +368,6 @@ if (!header->ExtractAll(runHeader)) {
}
f->Close();
delete f;
\end{verbatim}
\end{shaded}

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2023 by Andreas Suter *
* Copyright (C) 2009-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -31,6 +31,7 @@
#include <cmath>
#include <iostream>
#include <memory>
#include <TSAXParser.h>
#include <TMath.h>
@ -52,14 +53,14 @@ PNL_PippardFitterGlobal::PNL_PippardFitterGlobal()
{
// read XML startup file
char startup_path_name[128];
TSAXParser *saxParser = new TSAXParser();
PNL_StartupHandler *fStartupHandler = new PNL_StartupHandler();
std::unique_ptr<TSAXParser> saxParser = std::make_unique<TSAXParser>();
fStartupHandler = std::make_unique<PNL_StartupHandler>();
strcpy(startup_path_name, fStartupHandler->GetStartupFilePath().Data());
saxParser->ConnectToHandler("PNL_StartupHandler", fStartupHandler);
saxParser->ConnectToHandler("PNL_StartupHandler", fStartupHandler.get());
//Int_t status = saxParser->ParseFile(startup_path_name);
// parsing the file as above seems to lead to problems in certain environments;
// use the parseXmlFile function instead (see PUserFcnBase.cpp for the definition)
Int_t status = parseXmlFile(saxParser, startup_path_name);
Int_t status = parseXmlFile(saxParser.get(), startup_path_name);
// check for parse errors
if (status) { // error
std::cout << std::endl << ">> PNL_PippardFitterGlobal::PNL_PippardFitterGlobal: **WARNING** Reading/parsing nonlocal_startup.xml failed.";
@ -67,14 +68,8 @@ PNL_PippardFitterGlobal::PNL_PippardFitterGlobal()
fValid = false;
}
// clean up
if (saxParser) {
delete saxParser;
saxParser = 0;
}
// check if everything went fine with the startup handler
if (!fStartupHandler->IsValid()) {
if (!fStartupHandler->IsValid() && fValid) {
std::cout << std::endl << ">> PNL_PippardFitterGlobal::PNL_PippardFitterGlobal **PANIC ERROR**";
std::cout << std::endl << ">> startup handler too unhappy. Will terminate unfriendly, sorry.";
std::cout << std::endl;
@ -84,12 +79,14 @@ PNL_PippardFitterGlobal::PNL_PippardFitterGlobal()
fFourierPoints = fStartupHandler->GetFourierPoints();
// load all the TRIM.SP rge-files
fRgeHandler = new PRgeHandler("./nonlocal_startup.xml");
if (!fRgeHandler->IsValid()) {
std::cout << std::endl << ">> PNL_PippardFitterGlobal::PNL_PippardFitterGlobal **PANIC ERROR**";
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
std::cout << std::endl;
fValid = false;
if (fValid) {
fRgeHandler = std::make_unique<PRgeHandler>("./nonlocal_startup.xml");
if (!fRgeHandler->IsValid()) {
std::cout << std::endl << ">> PNL_PippardFitterGlobal::PNL_PippardFitterGlobal **PANIC ERROR**";
std::cout << std::endl << ">> rge data handler too unhappy. Will terminate unfriendly, sorry.";
std::cout << std::endl;
fValid = false;
}
}
fPlanPresent = false;
@ -124,15 +121,6 @@ PNL_PippardFitterGlobal::~PNL_PippardFitterGlobal()
fftw_free(fFieldq);
fFieldB = 0;
}
if (fRgeHandler) {
delete fRgeHandler;
fRgeHandler = 0;
}
if (fStartupHandler) {
delete fStartupHandler;
fStartupHandler = 0;
}
}
//--------------------------------------------------------------------------

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2023 by Andreas Suter *
* Copyright (C) 2009-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -36,6 +36,8 @@
//#endif
#include <fftw3.h>
#include <memory>
#include "PMusr.h"
#include "PUserFcnBase.h"
#include "PNL_StartupHandler.h"
@ -57,8 +59,8 @@ class PNL_PippardFitterGlobal
private:
Bool_t fValid{true};
PNL_StartupHandler *fStartupHandler{nullptr};
PRgeHandler *fRgeHandler{nullptr};
std::unique_ptr<PNL_StartupHandler> fStartupHandler;
std::unique_ptr<PRgeHandler> fRgeHandler;
mutable std::vector<Double_t> fPreviousParam;

View File

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

View File

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

View File

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

View File

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

View File

@ -2,3 +2,7 @@
#define PROJECT_VERSION "@PROJECT_VERSION@"
#define GIT_BRANCH "@GIT_BRANCH@"
#define GIT_CURRENT_SHA1 @GIT_CURRENT_SHA1@
#define ROOT_VERSION_USED "@ROOT_VERSION_USED@"

View File

@ -1,23 +1,64 @@
#--- dump_nonlocal_field ------------------------------------------------------
cmake_minimum_required(VERSION 3.15)
project(dump_nonlocal_field VERSION 1.0.0 LANGUAGES C CXX)
#--- check for git ------------------------------------------------------------
find_package(Git REQUIRED)
#--- check for ROOT -----------------------------------------------------------
find_package(ROOT 6.18 REQUIRED COMPONENTS Gui MathMore Minuit2 XMLParser)
if (ROOT_mathmore_FOUND)
execute_process(COMMAND root-config --bindir OUTPUT_VARIABLE ROOT_BINDIR)
string(STRIP ${ROOT_BINDIR} ROOT_BINDIR)
execute_process(COMMAND root-config --version OUTPUT_VARIABLE ROOT_VERSION_USED)
string(STRIP ${ROOT_VERSION_USED} ROOT_VERSION_USED)
execute_process(COMMAND root-config --incdir OUTPUT_VARIABLE ROOT_INC)
string(STRIP ${ROOT_INC} ROOT_INC)
message("-- Found ROOT: ${ROOT_BINDIR} (found version: ${ROOT_VERSION})")
#---Define useful ROOT functions and macros (e.g. ROOT_GENERATE_DICTIONARY)
include(${ROOT_USE_FILE})
endif (ROOT_mathmore_FOUND)
#--- check for boost ----------------------------------------------------------
find_package(Boost REQUIRED
COMPONENTS
system
filesystem
)
message(STATUS "Boost libs: ${Boost_LIBRARIES}")
#--- check for fftw3 ----------------------------------------------------------
#find_package(FFTW3 REQUIRED)
# Get the current working branch
execute_process(
COMMAND git rev-parse --abbrev-ref HEAD
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_BRANCH
OUTPUT_STRIP_TRAILING_WHITESPACE
)
# Get the latest abbreviated commit hash of the working branch
execute_process(
COMMAND git log -1 --pretty="%h, %ci"
WORKING_DIRECTORY ${CMAKE_SOURCE_DIR}
OUTPUT_VARIABLE GIT_CURRENT_SHA1
OUTPUT_STRIP_TRAILING_WHITESPACE
)
#--- feed dnlf_config.h -----------------------------------------
set(HAVE_DNLF_CONFIG_H 1 CACHE INTERNAL "dnlf_config.h is available")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/../cmake/dnlf_config.h.in ${CMAKE_CURRENT_BINARY_DIR}/dnlf_config.h)
#--- start create git-revision.h ----------------------------------------------
if (IS_GIT_REPO)
set(HAVE_GIT_REV_H "-DHAVE_GIT_REV_H")
else (IS_GIT_REPO)
set(HAVE_GIT_REV_H "")
endif (IS_GIT_REPO)
add_executable(dump_nonlocal_field dump_nonlocal_field.cpp)
target_compile_options(dump_nonlocal_field BEFORE PRIVATE "-DHAVE_CONFIG_H" "-DHAVE_DNLF_CONFIG_H" "${HAVE_GIT_REV_H}")
target_include_directories(dump_nonlocal_field
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${ROOT_INC}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2009-2023 by Andreas Suter *
* Copyright (C) 2009-2024 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -38,15 +38,9 @@
#include "PNL_PippardFitter.h"
#ifdef HAVE_CONFIG_H
#include "config.h"
#endif
#ifdef HAVE_DNLF_CONFIG_H
#include "dnlf_config.h"
#endif
#ifdef HAVE_GIT_REV_H
#include "git-revision.h"
#endif
//-----------------------------------------------------------------------------
/**
@ -58,6 +52,7 @@ void dnlf_syntax()
std::cout << "usage: dump_nonlocal_field [<msr-file> --out <field-dump> [--step <stepVal>] | --version | --help]" << std::endl;
std::cout << " <msr-file> : nonlocal msr-file name." << std::endl;
std::cout << " --out <field-dump> : ascii field dump output file name." << std::endl;
std::cout << " --range <rangeVal> : this optional parameter (in nm) will overwrite the standard z-range = 5 * lambdaL." << std::endl;
std::cout << " --step <stepVal> : this optional parameters allows to define the z-value step size in (nm)." << std::endl;
std::cout << " --version : dumps the version" << std::endl;
std::cout << " --help : will dump this help" << std::endl;
@ -190,7 +185,8 @@ int main(int argc, char* argv[])
{
std::string msrFileName("");
std::string outFileName("");
double step(0.0);
double step{0.0};
double range{0.0};
bool show_syntax(false);
if (argc == 1) {
@ -202,18 +198,10 @@ int main(int argc, char* argv[])
if (argv[i][0] != '-') { // must be the msr-file name
msrFileName = argv[i];
} else if (!strcmp(argv[i], "--version")) {
#ifdef HAVE_CONFIG_H
#ifdef HAVE_GIT_REV_H
std::cout << std::endl << "dump_nonlocal_field version: " << PROJECT_VERSION << " (" << PACKAGE_VERSION << "), git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << " (" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#ifdef HAVE_DNLF_CONFIG_H
std::cout << std::endl << "dump_nonlocal_field version: " << PROJECT_VERSION << ", git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << ", ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#else
std::cout << std::endl << "dump_nonlocal_field version: " << PROJECT_VERSION << " (" << PACKAGE_VERSION << "/" << BUILD_TYPE << "), ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#endif
#else
#ifdef HAVE_GIT_REV_H
std::cout << std::endl << "dump_nonlocal_field git-branch: " << GIT_BRANCH << ", git-rev: " << GIT_CURRENT_SHA1 << std::endl << std::endl;
#else
std::cout << std::endl << "dump_nonlocal_field version: unknown" << std::endl << std::endl;
#endif
std::cout << std::endl << "dump_nonlocal_field version: " << PROJECT_VERSION << ", ROOT version: " << ROOT_VERSION_USED << std::endl << std::endl;
#endif
return 0;
} else if (!strcmp(argv[i], "--help")) {
@ -228,6 +216,22 @@ int main(int argc, char* argv[])
show_syntax = true;
break;
}
} else if (!strcmp(argv[i], "--range")) {
if (i < argc-1) {
try {
range = std::stod(argv[i+1]);
}
catch(std::exception& e) {
std::cout << "dump_nonlocal_field: **ERROR** <rangeVal> '" << argv[i+1] << "' seems not to be a double." << std::endl;
show_syntax = true;
break;
}
i++;
} else {
std::cerr << std::endl << "dump_nonlocal_field: **ERROR** found option --range without <rangeVal>" << std::endl;
show_syntax = true;
break;
}
} else if (!strcmp(argv[i], "--step")) {
if (i < argc-1) {
try {
@ -260,14 +264,17 @@ int main(int argc, char* argv[])
// calculate field and write it to file
PNL_PippardFitterGlobal pip;
pip.CalculateField(param);
if (pip.IsValid())
pip.CalculateField(param);
else
return -3;
std::ofstream fout(outFileName.c_str(), std::ofstream::out);
if (!fout.is_open()) {
std::cout << std::endl;
std::cerr << "**ERROR** can not write to file '" << outFileName << "'." << std::endl;
std::cout << std::endl;
return -3;
return -4;
}
// write header
fout << "% z (nm), field (G)" << std::endl;
@ -280,13 +287,15 @@ int main(int argc, char* argv[])
bool done(false);
double deadLayer = param[8];
double b0 = param[6];
if (range == 0.0)
range = 5.0*param[5]; // 5*lambda
do {
if (z < deadLayer) {
fout << z << ", " << b0 << std::endl;
} else {
field = pip.GetMagneticField(z-deadLayer);
fout << z << ", " << b0*field << std::endl;
if (fabs(prevField-field) < 1.0e-10)
if ((fabs(prevField-field) < 1.0e-10) && (z >= range))
done = true;
prevField = field;
}

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