diff --git a/ChangeLog b/ChangeLog index 2dbaff80..1c2ed615 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,12 +2,90 @@ # ChangeLog #--------------------------------------------------------------------- +changes since 0.16.0 +=================================== +NEW 2016-01-22 update of the docu which now describes the RRF option. + +changes since 0.15.0 +=================================== +NEW 2016-01-22 add RRF fit option. At the same time, the version has been + increased to 0.16.0. For details see the documentation. +FIXED 2015-10-29 TMusrRunHeader didn't map a double vector properly into a + string. The last element was a copy of the 2nd last instead + if the proper last. This is now fixed. Fixed also some + comment typo. +FIXED 2015-11-11 Fixes the crash of Fourier if the maximal range given in the + Fourier block is larger than the available. +CHANGED 2015-11-15 removed unnecessary check form musredit_qt5 msr2data interface. + +changes since 0.14.0 +=================================== +NEW 2015-10-26 added a first ported musredit version (Qt4 -> Qt5). At the same + the version has been incremented to 0.15.0. +NEW 2015-09-24 adding a phase optimized real Fourier to musrFT. This is still VERY + experimental, and hence only available from within musrFT. Eventually + it should make its way into musrview as well. Furthermore the + documentation needs to be written yet. There is only a short not in + the command line present. +NEW 2015-02-23 implemented an average-per-data-set option for musrFT. +NEW 2015-02-21 add proper Mac icon to musredit +FIXED 2015-09-22 generating global fit msr-files including a GLOBAL block is working + now as expected. +FIXED 2015-09-17 in PMsr2Data::PrepareGlobalInputFile() there seem to be 'unmotivated' + break; commands in some loops. They prevent a proper map handling. + Since this is a real puzzle I contacted BMW for clarification. + 2015-09-18: there is only one unmotivated break; cleaned up the code + accordingly. +FIXED 2015-09-14 any2many export of MusrRoot crashed when first histo group was != 0. + This happend when exporting to PSI-BIN or WKM. This is fixed now. +FIXED 2015-09-08 fixed error in view_packing for single histo (wrong norm of the theory). +FIXED 2015-09-04 minor change in Fourier-block output (PMsrHandler::WriteMsrLogFile + and PMsrHandler::WriteMsrLogFile) to avoid truncated range labels. +FIXED 2015-06-30 changed setf/unsetf bug (PMsr2Data.cpp) +FIXED 2015-05-15 another path check for HDF5 with ubuntu 15.04 +FIXED 2015-03-16 some minor correction for ASCII export in any2many +FIXED 2015-02-26 some more bug fixing for average per data set. +FIXED 2015-02-20 for graphical export in the batch mode, menus mustn't be set. +CHANGED 2015-08-17 updated ChangeLog which was orphaned since V0.13.0 +CHANGED 2015-08-16 updated the docu +CHANGED 2015-08-16 added the class PStringNumberList which allow to parse a + generic encoded list of numbers. Used this class to improve + PMsrHandler, and improved the runList feature of msr2data. + For details see the documentation of msr2data. +CHANGED 2015-06-25 adopted the temperature dependence of the gap function + (see Eq.(8) of the memo), which breaks the self-consistency. + Makes it more flexible but requires that the user is using + his brain. +CHANGED 2015-06-25 small correction of the skewed Gaussian for extrem parameter + values. +CHANGED 2015-05-29 updated docu and removed an unsed variable +CHANGED 2015-05-29 added a group histo selector in any2many for MusrRoot when + exporting to a too limited file format as PSI-BIN. +CHANGED 2015-04-01 update of the technical docu +CHANGED 2015-02-28 check that FOURIER block phase parameter as parX is not leading + to an error message. +CHANGED 2015-02-24 added missing background range from msr-file (musrFT) +CHANGED 2015-02-24 separated PSI-BIN and PSI-MDU file format +CHANGED 2015-02-21 make sure that musrFT is found +CHANGED 2015-02-21 needed to adopted includes for dictionary generation due to + adding fftw.h in PMusr.h +CHANGED 2015-02-21 have now README and README.md for automake and bitbucket, + respectively. + changes since 0.13.0 =================================== +NEW 2015-02-23 implemented an average-per-data-set option for musrFT. +NEW 2015-02-20 add a switch to musrview that it plots initially the Fouier data rather + than the time domain data. +NEW 2015-02-19 added a first preliminary user interface for musrFT within musredit. +NEW 2015-02-16 changed the data export handling from musrview. It is now more + main line and follows the implementation of musrFT. NEW 2015-02-13 first implementation of a standalone Fourier transform/plotter: musrFT. Initially it is meant to be used for HAL-9500, i.e. Fourier transform WITHOUT lifetime correction. A first simple minded lifetime correction is implemented as well. +NEW 2015-02-04 Integration of libBNMR for fitting beta-NMR relaxation data + into automake of musrfit. NEW 2014-12-18 first implementation of a GLOBAL block which allows to shorten a typical msr-file. Duplicate entries from the RUN blocks can be added here. Furthermore, the 'lifetimecorrection' flag is @@ -17,9 +95,6 @@ NEW 2014-12-18 first implementation of a GLOBAL block which allows to shorten parameters (t0, data, fit) has been encapsulated into its own functions. -NEW 2015-02-04 Integration of libBNMR for fitting beta-NMR relaxation data - into automake of musrfit. - changes since 0.12.0 =================================== NEW 2014-12-04 Fourier: added the unit 'Tesla' needed e.g. for HAL-9500 diff --git a/README b/README index fd52af9c..9c6eabfc 100644 --- a/README +++ b/README @@ -1,6 +1,9 @@ -# musrfit - muSR data analysis package # +README -### Contents ### +musrfit - muSR data analysis package + +Contents +-------- This is a data analysis package to analyze time differential muSR and beta-NMR data. Currently it allows the following things: @@ -15,18 +18,18 @@ Currently it allows the following things: * allows to implement more sophisticated user functions (e.g. GL vortex lattice, Meissner screening including low-energy muon stopping profiles) -### Currently supported platforms: ### +Currently supported platforms: * Linux * Mac OS X * Windows - not really, only for the very brave ones -### Documentation #### +Documentation For a more exhaustive user documentation see: http://lmu.web.psi.ch/musrfit/user/MUSR/WebHome.html -### Contact ### +Contact - \ No newline at end of file + diff --git a/README.md b/README.md new file mode 100644 index 00000000..fd52af9c --- /dev/null +++ b/README.md @@ -0,0 +1,32 @@ +# musrfit - muSR data analysis package # + +### Contents ### + +This is a data analysis package to analyze time differential muSR and beta-NMR data. +Currently it allows the following things: + +* setting up most commonly used fitting functions for muSR and beta-NMR +* fitting data, including global fits +* showing the fit results and the residuals +* showing the Fourier transform of the data +* extracting easily the fitting parameters to be used in other programs (gnuplot, qtiplot/origin, ...) +* allows to generate fitting input files for follow-up runs +* allows to generate global fitting input files based on a single run template +* allows to implement more sophisticated user functions + (e.g. GL vortex lattice, Meissner screening including low-energy muon stopping profiles) + +### Currently supported platforms: ### + +* Linux +* Mac OS X +* Windows - not really, only for the very brave ones + +### Documentation #### + +For a more exhaustive user documentation see: + + http://lmu.web.psi.ch/musrfit/user/MUSR/WebHome.html + +### Contact ### + + \ No newline at end of file diff --git a/configure.ac b/configure.ac index 0c219f42..fa00d12e 100644 --- a/configure.ac +++ b/configure.ac @@ -1,7 +1,7 @@ AC_REVISION([m4_esyscmd_s([git describe --always])]) AC_PREREQ(2.63) -AC_INIT([musrfit],[0.13.0],[andreas.suter@psi.ch]) +AC_INIT([musrfit],[0.16.0],[andreas.suter@psi.ch]) AC_CONFIG_AUX_DIR(admin) AC_CANONICAL_HOST #AC_MSG_RESULT([${host} ${host_cpu} ${host_vendor} ${host_os}]) @@ -35,7 +35,7 @@ dnl ----------------------------------------------- #release versioning MUSR_MAJOR_VERSION=0 -MUSR_MINOR_VERSION=13 +MUSR_MINOR_VERSION=16 MUSR_MICRO_VERSION=0 #release versioning @@ -525,6 +525,9 @@ AC_ARG_ENABLE([NeXus], [AS_HELP_STRING([--enable-NeXus],[build optional NeXus su elif test -r /usr/local/hdf5/include/hdf5.h; then HDF5_PREFIX="/usr/local/hdf5" AC_MSG_RESULT([${HDF5_PREFIX}]) + elif test -r /usr/include/hdf5/serial/hdf5.h; then + HDF5_PREFIX="/usr/include/hdf5/serial" + AC_MSG_RESULT([${HDF5_PREFIX}]) elif test -r /usr/include/hdf5.h; then HDF5_PREFIX="/usr" AC_MSG_RESULT([${HDF5_PREFIX}]) @@ -855,6 +858,8 @@ if test "x$enable_editor" != "xno"; then echo "Additional checks for musredit/musrgui ..." + QT5MINVER=5.4 + case "$host" in *-*-cygwin) QT4MINVER=4.5 @@ -867,6 +872,7 @@ if test "x$enable_editor" != "xno"; then QT3_FOUND=no QT3MT_FOUND=no QT4_FOUND=no + QT5_FOUND=no QMAKEBIN="" QTEDITOR=none @@ -940,14 +946,58 @@ if test "x$enable_editor" != "xno"; then fi] ) + AC_ARG_WITH([qt5], + [AS_HELP_STRING([--with-qt5],[prefix of the Qt5 installation, e.g. /usr/lib64/qt5/])], + [QT5_PREFIX=$with_qt5 + AC_MSG_CHECKING([whether qmake for Qt5 can be found at the specified location]) + for QMAKE in qmake qmake-qt5 + do + if test -x "${QT5_PREFIX}/bin/${QMAKE}"; then + QMAKEVERSIONSTRING="$(${QT5_PREFIX}/bin/${QMAKE} -v 2>&1)" + for a in $QMAKEVERSIONSTRING + do + if test "$(expr "$a" : '\(..\)')" = "5."; then + QMAKEBIN="${QT5_PREFIX}/bin/${QMAKE}" + QTEDITOR=musredit_qt5 + AC_MSG_RESULT([${QMAKEBIN}]) + break + fi + done + if test "x${QMAKEBIN}" != "x"; then + break + fi + fi + done + + if test "x${QMAKEBIN}" = "x"; then + AC_MSG_RESULT([no]) + AC_MSG_ERROR([qmake for Qt5 cannot be found in ${QT5_PREFIX}/bin!]) + fi + + if test "x${QT4PRESENT}" = "xyes"; then + AC_MSG_WARN([Qt4 and Qt5 directories have been given -- only the Qt5 information will be used and only musredit will be built!]) + fi], + [if test "x${QMAKEBIN}" = "x"; then + PKG_CHECK_MODULES(QT5, Qt5WebKit >= $QT5MINVER Qt5Xml >= $QT5MINVER, [QT5_FOUND=yes], + [AC_MSG_NOTICE([Qt5 (including Qt5WebKit and Qt5Xml) not found!]) + PKG_CHECK_MODULES(QT3, qt >= 3.3.0 qt < 4.0, [QT3_FOUND=yes], + [PKG_CHECK_MODULES(QT3MT, qt-mt >= 3.3.0 qt-mt < 4.0, [QT3MT_FOUND=yes], [QT3MT_FOUND=no])] + )] + ) + fi] + ) + if test "x${QMAKEBIN}" = "x"; then - if test "x${QT3_FOUND}" = "xno" && test "x${QT3MT_FOUND}" = "xno" && test "x${QT4_FOUND}" = "xno"; then - AC_MSG_WARN([No suitable version of either Qt4 or Qt3 has been found! musredit/musrgui will not be built in this stage!]) + if test "x${QT3_FOUND}" = "xno" && test "x${QT3MT_FOUND}" = "xno" && test "x${QT4_FOUND}" = "xno" && test "x${Qt5_FOUND}" = "xno"; then + AC_MSG_WARN([No suitable version of either Qt5, Qt4 or Qt3 has been found! musredit/musrgui will not be built in this stage!]) else # Check for qmake on the basis of the pkg-config information QTPATH=none - if test "x$QT4_FOUND" = "xyes"; then + if test "x$QT5_FOUND" = "xyes"; then + QTPATH=$(pkg-config --variable=prefix Qt5WebKit) + QTEDITOR=musredit_qt5 + elif test "x$QT4_FOUND" = "xyes"; then QTPATH=$(pkg-config --variable=prefix QtWebKit) QTEDITOR=musredit elif test "x$QT3_FOUND" = "xyes"; then @@ -960,7 +1010,29 @@ if test "x$enable_editor" != "xno"; then AC_MSG_CHECKING([for qmake]) if test "x${QTPATH}" != "xnone"; then - if test "x$QTEDITOR" = "xmusredit"; then + if test "x$QTEDITOR" = "xmusredit_qt5"; then + for QMAKE in qmake-qt5 qmake-qt54 qmake-qt55 + do + if test -x "${QTPATH}/bin/${QMAKE}"; then + QMAKEBIN="${QTPATH}/bin/${QMAKE}" + AC_MSG_RESULT([${QMAKEBIN}]) + break + fi + done + if test "x${QMAKEBIN}" = "x"; then + if test -x "${QTPATH}/bin/qmake"; then + QMAKEVERSIONSTRING="$(${QTPATH}/bin/qmake -v 2>&1)" + for a in $QMAKEVERSIONSTRING + do + if test "$(expr "$a" : '\(..\)')" = "5."; then + QMAKEBIN="${QTPATH}/bin/qmake" + AC_MSG_RESULT([${QMAKEBIN}]) + break + fi + done + fi + fi + elif test "x$QTEDITOR" = "xmusredit"; then for QMAKE in qmake-qt4 qmake-qt46 qmake-qt47 qmake-qt48 do if test -x "${QTPATH}/bin/${QMAKE}"; then @@ -1007,13 +1079,14 @@ if test "x$enable_editor" != "xno"; then fi if test "x${QMAKEBIN}" = "x"; then AC_MSG_RESULT([no]) - AC_MSG_WARN([If Qt4 or Qt3 are present but have not been detected, try using the --with-qt4 or --with-qt3 options!]) + AC_MSG_WARN([If Qt5, Qt4 or Qt3 are present but have not been detected, try using the --with-qt5, --with-qt4 or --with-qt3 options!]) fi fi fi fi fi +AM_CONDITIONAL([BUILD_MUSREDIT_QT5], [test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit_qt5"]) AM_CONDITIONAL([BUILD_MUSREDIT], [test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit"]) AM_CONDITIONAL([BUILD_MUSRGUI], [test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusrgui"]) @@ -1167,6 +1240,10 @@ AC_CONFIG_FILES([Makefile \ src/external/libPhotoMeissner/Makefile \ src/external/libPhotoMeissner/classes/Makefile \ src/external/libBNMR/Makefile \ + src/musredit_qt5/Makefile \ + src/musredit/Makefile \ + src/musrgui/Makefile \ + src/musredit_qt5/musredit_startup.xml \ src/musredit/musredit_startup.xml \ src/musrgui/musrgui_startup.xml]) @@ -1176,10 +1253,16 @@ if test "x$enable_editor" != "xno" && test "x$QMAKEBIN" != "x"; then echo "Configuring ${QTEDITOR} ..." + if test "x${QTEDITOR}" = "xmusredit_qt5"; then + QTEDITOR_PRO="musredit" + else + QTEDITOR_PRO=${QTEDITOR} + fi + echo "Changing directory to src/${QTEDITOR} and calling" - echo "${QMAKEBIN} CC=${CC} CXX=${CXX} PREFIX=${INSTALLDIR} ${QTEDITOR}.pro" + echo "${QMAKEBIN} CC=${CC} CXX=${CXX} PREFIX=${INSTALLDIR} ${QTEDITOR_PRO}.pro" cd src/${QTEDITOR} - ${QMAKEBIN} CC=${CC} CXX=${CXX} PREFIX=${INSTALLDIR} ${QTEDITOR}.pro + ${QMAKEBIN} CC=${CC} CXX=${CXX} PREFIX=${INSTALLDIR} ${QTEDITOR_PRO}.pro cd ../.. fi @@ -1298,15 +1381,20 @@ else fi echo "" echo " Qt musrfit editors:" +if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit_qt5"; then + echo " musredit (Qt5): yes" +else + echo " musredit (Qt5): no" +fi if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusredit"; then echo " musredit (Qt4): yes" else echo " musredit (Qt4): no" fi if test "x$enable_editor" != "xno" && test "x${QMAKEBIN}" != "x" && test "x${QTEDITOR}" = "xmusrgui"; then - echo " musrgui (Qt3): yes" + echo " musrgui (Qt3): yes" else - echo " musrgui (Qt3): no" + echo " musrgui (Qt3): no" fi echo "" echo "" diff --git a/doc/examples/BMWlibs/data/libGapIntegrals-test.dat b/doc/examples/BMWlibs/data/libGapIntegrals-test.dat index 6179895a..d9644f4b 100644 --- a/doc/examples/BMWlibs/data/libGapIntegrals-test.dat +++ b/doc/examples/BMWlibs/data/libGapIntegrals-test.dat @@ -12,15 +12,25 @@ ENERGY: 4200 # here the data will follow data # x, y, error y -0.02, 12.0, 0.5 -0.1, 11.8, 0.8 -0.2, 9.9, 0.4 -0.33, 7.2, 0.15 -0.41, 3.8, 0.38 -0.5, 2.7, 0.5 -0.64, 1.0, 0.7 -0.7, 0.1, 0.2 -0.8, 0.0, 0.8 -0.9, 0.1, 0.5 -1.2, 0.0, 0.1 - +0.0318411, 7.77455, 0.2 +0.0629929, 7.9869, 0.15 +0.113914, 7.64209, 0.15 +0.202492, 7.37699, 0.15 +0.302725, 7.70893, 0.12 +0.447456, 7.77565, 0.12 +0.611685, 7.45768, 0.12 +0.813613, 7.19287, 0.12 +1.00822, 7.57813, 0.12 +1.24793, 7.31343, 0.12 +1.50635, 7.16818, 0.12 +1.74591, 6.99634, 0.12 +1.99795, 6.90414, 0.12 +2.25061, 6.41393, 0.12 +2.4958, 6.66666, 0.12 +2.75514, 5.93766, 0.12 +3.00753, 5.61992, 0.12 +3.26056, 4.89091, 0.12 +3.49414, 4.52005, 0.08 +3.75356, 3.73799, 0.08 +3.99425, 2.84974, 0.08 +4.30518, 1.35139, 0.08 diff --git a/doc/examples/BMWlibs/test-libGapIntegrals-ASCII.msr b/doc/examples/BMWlibs/test-libGapIntegrals-ASCII.msr index c6e714ca..e819c669 100644 --- a/doc/examples/BMWlibs/test-libGapIntegrals-ASCII.msr +++ b/doc/examples/BMWlibs/test-libGapIntegrals-ASCII.msr @@ -2,18 +2,16 @@ Test superconductor data ############################################################### FITPARAMETER # Nr. Name Value Step Pos_Error Boundaries - 1 lambdaInvSq0 11.69 0.39 none - 2 Tc 0.558 0.018 none 0 2 - 3 Delta0 0.0673 0.0035 none - 4 aG 1 0 none + 1 lambdaInvSq0 7.983 -0.042 0.042 + 2 Tc 4.470 -0.015 0.016 0 5 + 3 Delta0 1.547 -0.026 0.027 + 4 c0 1.468 0 none + 5 aG 1.33333 0 none ############################################################### THEORY asymmetry 1 -userFcn libGapIntegrals TGapSWave 2 3 4 - -############################################################### -#FUNCTIONS +userFcn libGapIntegrals TGapDWave 2 3 4 5 ############################################################### RUN data/libGapIntegrals-test PIM3 PSI ASCII (name beamline institute data-file-format) @@ -26,15 +24,15 @@ packing 1 ############################################################### COMMANDS MINIMIZE -HESSE -#MINOS +#HESSE +MINOS SAVE ############################################################### PLOT 8 (non muSR plot) runs 1 -range 0 1.5 +range 0 6 ############################################################### -STATISTIC --- 2014-10-28 10:40:31 - chisq = 14.3, NDF = 8, chisq/NDF = 1.790471 +STATISTIC --- 2015-06-25 08:39:03 + chisq = 58.3, NDF = 19, chisq/NDF = 3.066272 diff --git a/doc/examples/test-asy-HAL9500-RRF.msr b/doc/examples/test-asy-HAL9500-RRF.msr new file mode 100644 index 00000000..e7676ea5 --- /dev/null +++ b/doc/examples/test-asy-HAL9500-RRF.msr @@ -0,0 +1,178 @@ +MnSi, FLC68.2, 50 K +############################################################### +FITPARAMETER +# Nr. Name Value Step Pos_Error Boundaries + 1 rate_1 1.680 0.019 none + 2 field_1 1589.71 0.20 none + 3 rate_2 1.863 0.065 none + 4 field_2 788.86 0.49 none + + 5 alpha_f15 1.0029 0.0015 none + 6 frac_f15 0.7350 0.0090 none + 7 asym_f15 0.2713 0.0043 none 0 none + 8 phase_f15 79.37 0.80 none + + 9 alpha_f26 0.9996 0.0015 none + 10 frac_f26 0.7408 0.0085 none + 11 asym_f26 0.3029 0.0046 none 0 none + 12 phase_f26 30.22 0.73 none + + 13 alpha_f37 1.0003 0.0015 none + 14 frac_f37 0.88 0.23 none + 15 asym_f37 0.0126 0.0045 none 0 none + 16 phase_f37 58.0 15.0 none + + 17 alpha_f48 0.9999 0.0015 none + 18 frac_f48 0.7344 0.0084 none + 19 asym_f48 0.2929 0.0043 none 0 none + 20 phase_f48 -33.13 0.76 none + + 21 alpha_b15 0.9991 0.0013 none + 22 frac_b15 0.7439 0.0077 none + 23 asym_b15 0.2807 0.0038 none 0 none + 24 phase_b15 164.98 0.68 none + + 25 alpha_b26 1.0003 0.0013 none + 26 frac_b26 0.7331 0.0078 none + 27 asym_b26 0.2810 0.0038 none 0 none + 28 phase_b26 119.49 0.70 none + + 29 alpha_b37 0.9989 0.0012 none + 30 frac_b37 0.7504 0.0078 none + 31 asym_b37 0.2755 0.0037 none 0 none + 32 phase_b37 102.07 0.69 none + + 33 alpha_b48 0.9990 0.0012 none + 34 frac_b48 0.7391 0.0080 none + 35 asym_b48 0.2763 0.0039 none 0 none + 36 phase_b48 37.66 0.67 none + +############################################################### +THEORY +asymmetry fun1 +simplExpo 1 (rate) +TFieldCos map3 fun3 (phase frequency) ++ +asymmetry fun2 +simplExpo 3 (rate) +TFieldCos map3 fun4 (phase frequency) + +############################################################### +FUNCTIONS +fun1 = map1 * map2 +fun2 = (1 - map1) * map2 +fun3 = gamma_mu * par2 +fun4 = gamma_mu * par4 + +############################################################### +GLOBAL +fittype 3 (asymmetry RRF fit) +fit 0.0005 6 +rrf_freq 7.15 T +rrf_packing 300 +rrf_phase 0.00 + +############################################################### +# Fw1-Fw5 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 5 +map 6 7 8 0 0 0 0 0 0 0 0 +forward 2 +backward 6 +background 500 15000 500 15000 # estimated bkg: 0.0492 / 0.0501 +data 20158 409500 20130 409500 +t0 20108.0 20080.0 + +# Fw2-Fw6 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 9 +map 10 11 12 0 0 0 0 0 0 0 0 +forward 3 +backward 7 +background 500 15000 500 15000 # estimated bkg: 0.0501 / 0.0451 +data 20138 409500 20121 409500 +t0 20088.0 20071.0 + +# Fw3-Fw7 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 13 +map 14 15 16 0 0 0 0 0 0 0 0 +forward 3 +backward 8 +background 500 15000 500 15000 # estimated bkg: 0.0501 / 0.0449 +data 20111 409500 20116 409500 +t0 20061.0 20066.0 + +# Fw4-Fw8 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 17 +map 18 19 20 0 0 0 0 0 0 0 0 +forward 5 +backward 9 +background 500 15000 500 15000 # estimated bkg: 0.0560 / 0.0462 +data 20121 409500 20082 409500 +t0 20071.0 20032.0 + +# Bw1-Bw5 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 21 +map 22 23 24 0 0 0 0 0 0 0 0 +forward 10 +backward 14 +background 500 15000 500 15000 # estimated bkg: 0.0641 / 0.0806 +data 20072 409500 20067 409500 +t0 20022.0 20017.0 + +# Bw2-Bw6 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 25 +map 26 27 28 0 0 0 0 0 0 0 0 +forward 11 +backward 15 +background 500 15000 500 15000 # estimated bkg: 0.0689 / 0.0768 +data 20076 409500 20069 409500 +t0 20026.0 20019.0 + +# Bw3-Bw7 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 29 +map 30 31 32 0 0 0 0 0 0 0 0 +forward 12 +backward 16 +background 500 15000 500 15000 # estimated bkg: 0.0769 / 0.0795 +data 20060 409500 20069 409500 +t0 20010.0 20019.0 + +# Bw4-Bw8 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 33 +map 34 35 36 0 0 0 0 0 0 0 0 +forward 13 +backward 17 +background 500 15000 500 15000 # estimated bkg: 0.0761 / 0.0702 +data 20063 409500 20089 409500 +t0 20013.0 20039.0 + +############################################################### +COMMANDS +#MAX_LIKELIHOOD +PRINT_LEVEL 2 +MINIMIZE +#MINOS +SAVE + +############################################################### +PLOT 3 (asymmetry RRF plot) +runs 1 2 3 4 5 6 7 8 +range 0 9.07 -0.5 0.5 + +############################################################### +FOURIER +units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s' +fourier_power 11 +apodization STRONG # NONE, WEAK, MEDIUM, STRONG +plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE + +############################################################### +STATISTIC --- 2016-01-18 16:23:00 + chisq = 7402.2, NDF = 6516, chisq/NDF = 1.135997 diff --git a/doc/examples/test-histo-HAL9500-RRF.msr b/doc/examples/test-histo-HAL9500-RRF.msr new file mode 100644 index 00000000..24891bf9 --- /dev/null +++ b/doc/examples/test-histo-HAL9500-RRF.msr @@ -0,0 +1,235 @@ +MnSi, FLC68.2, 50 K +############################################################### +FITPARAMETER +# Nr. Name Value Step Pos_Error Boundaries + 1 Rate_1 1.678 0.018 none + 2 Field_1_RRF 1589.66 0.19 none + 3 Rate_2 1.948 0.064 none + 4 Field_2_RRF 788.93 0.47 none + + 5 Asym_1 0.3102 0.0067 none + 6 Frc_1 0.728 0.012 none + 7 Phase_1 57.3 1.1 none + + 8 Asym_2 0.3073 0.0066 none + 9 Frc_2 0.748 0.012 none + 10 Phase_2 30.6 1.0 none + + 11 Asym_3 0.3245 0.0065 none + 12 Frc_3 0.728 0.011 none + 13 Phase_3 18.70 0.96 none + + 14 Asym_4 0.3290 0.0062 none + 15 Frc_4 0.733 0.011 none + 16 Phase_4 339.27 0.96 none + + 17 Asym_5 0.3213 0.0062 none + 18 Frc_5 0.730 0.011 none + 19 Phase_5 282.5 1.0 none + + 20 Asym_6 0.3424 0.0072 none + 21 Frc_6 0.726 0.012 none + 22 Phase_6 211.3 1.0 none + + 23 Asym_7 0.3321 0.0069 none + 24 Frc_7 0.731 0.012 none + 25 Phase_7 161.7 1.1 none + + 26 Asym_8 0.3219 0.0067 none + 27 Frc_8 0.730 0.012 none + 28 Phase_8 133.7 1.1 none + + 29 Asym_9 0.3030 0.0058 none + 30 Frc_9 0.730 0.011 none + 31 Phase_9 158.87 0.97 none + + 32 Asym_10 0.3046 0.0057 none + 33 Frc_10 0.731 0.011 none + 34 Phase_10 129.97 0.97 none + + 35 Asym_11 0.2898 0.0055 none + 36 Frc_11 0.754 0.011 none + 37 Phase_11 101.80 0.96 none + + 38 Asym_12 0.3013 0.0055 none + 39 Frc_12 0.740 0.010 none + 40 Phase_12 43.00 0.88 none + + 41 Asym_13 0.3009 0.0054 none + 42 Frc_13 0.747 0.010 none + 43 Phase_13 351.72 0.88 none + + 44 Asym_14 0.3054 0.0053 none + 45 Frc_14 0.729 0.010 none + 46 Phase_14 289.91 0.91 none + + 47 Asym_15 0.2931 0.0053 none + 48 Frc_15 0.740 0.010 none + 49 Phase_15 282.39 0.94 none + + 50 Asym_16 0.2814 0.0058 none + 51 Frc_16 0.729 0.011 none + 52 Phase_16 212.89 0.99 none + +############################################################### +THEORY +asymmetry fun1 +simplExpo 1 (rate) +TFieldCos map3 fun3 (phase frequency) ++ +asymmetry fun2 +simplExpo 3 (rate) +TFieldCos map3 fun4 (phase frequency) + +############################################################### +FUNCTIONS +fun1 = map1 * map2 +fun2 = map1 * (1 - map2) +fun3 = par2 * gamma_mu +fun4 = par4 * gamma_mu + +############################################################### +GLOBAL +fittype 1 (single histogram RRF fit) +rrf_freq 7.15 T +rrf_packing 300 +rrf_phase 0.00 +fit 0.0005 10 + +############################################################### +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 5 6 7 0 0 0 0 0 0 0 0 +forward 2 +background 100 18000 # estimated bkg: 0.0476 +data 20208 409500 +t0 20108.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 8 9 10 0 0 0 0 0 0 0 0 +forward 3 +background 100 18000 # estimated bkg: 0.0490 +data 20188 409500 +t0 20088.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 11 12 13 0 0 0 0 0 0 0 0 +forward 4 +background 100 18000 # estimated bkg: 0.0582 +data 20161 409500 +t0 20061.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 14 15 16 0 0 0 0 0 0 0 0 +forward 5 +background 100 18000 # estimated bkg: 0.0553 +data 20171 409500 +t0 20071.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 17 18 19 0 0 0 0 0 0 0 0 +forward 6 +background 100 18000 # estimated bkg: 0.0515 +data 20180 409500 +t0 20080.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 20 21 22 0 0 0 0 0 0 0 0 +forward 7 +background 100 18000 # estimated bkg: 0.0458 +data 20171 409500 +t0 20071.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 23 24 25 0 0 0 0 0 0 0 0 +forward 8 +background 100 18000 # estimated bkg: 0.0466 +data 20166 409500 +t0 20066.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 26 27 28 0 0 0 0 0 0 0 0 +forward 9 +background 100 18000 # estimated bkg: 0.0457 +data 20132 409500 +t0 20032.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 29 30 31 0 0 0 0 0 0 0 0 +forward 10 +background 100 18000 # estimated bkg: 0.0635 +data 20122 409500 +t0 20022.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 32 33 34 0 0 0 0 0 0 0 0 +forward 11 +background 100 18000 # estimated bkg: 0.0685 +data 20126 409500 +t0 20026.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 35 36 37 0 0 0 0 0 0 0 0 +forward 12 +background 100 18000 # estimated bkg: 0.0752 +data 20110 409500 +t0 20010.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 38 39 40 0 0 0 0 0 0 0 0 +forward 13 +background 100 18000 # estimated bkg: 0.0760 +data 20113 409500 +t0 20013.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 41 42 43 0 0 0 0 0 0 0 0 +forward 14 +background 100 18000 # estimated bkg: 0.0809 +data 20117 409500 +t0 20017.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 44 45 46 0 0 0 0 0 0 0 0 +forward 15 +background 100 18000 # estimated bkg: 0.0755 +data 20119 409500 +t0 20019.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 47 48 49 0 0 0 0 0 0 0 0 +forward 16 +background 100 18000 # estimated bkg: 0.0796 +data 20119 409500 +t0 20019.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 50 51 52 0 0 0 0 0 0 0 0 +forward 17 +background 100 18000 # estimated bkg: 0.0702 +data 20139 409500 +t0 20039.0 + +############################################################### +COMMANDS +#MAX_LIKELIHOOD +PRINT_LEVEL 2 +MINIMIZE +#MINOS +SAVE + +############################################################### +PLOT 1 (single histo RRF plot) +runs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +range 0 9.07 -0.5 0.5 + +############################################################### +FOURIER +units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s' +fourier_power 12 +apodization MEDIUM # NONE, WEAK, MEDIUM, STRONG +plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE +#range 7.1 7.5 + +############################################################### +STATISTIC --- 2016-01-14 13:24:36 + chisq = 22007.6, NDF = 20700, chisq/NDF = 1.063168 diff --git a/doc/html/user/MUSR/BmwLibs.html b/doc/html/user/MUSR/BmwLibs.html index 492bc7f1..12c12d36 100644 --- a/doc/html/user/MUSR/BmwLibs.html +++ b/doc/html/user/MUSR/BmwLibs.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: BmwLibs - + MUSR :: BmwLibs + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + +
-
+
-
-
+
+
+
Topic revision: r5 - 10 Jul 2011, wojek
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
This topic: MUSR > WebHome > MusrFit > BmwLibs
+Topic revision: 03 Jul 2015, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/CiteMusrFit.html b/doc/html/user/MUSR/CiteMusrFit.html index fe86b5fd..b446cc8d 100644 --- a/doc/html/user/MUSR/CiteMusrFit.html +++ b/doc/html/user/MUSR/CiteMusrFit.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: CiteMusrFit - + MUSR :: CiteMusrFit + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + +
-
+
-
-
-

-

- - - -

-

-

-

-

How to Cite musrfit?

+
+
+

How to Cite musrfit?

Since quite some effort is going into the development and maintenance of the musrfit package, you should at least acknowledge it in your publication if you have used it to analyze your data. Even better of course is to cite it properly by the reference given beneath

-
- - - - - +

+

- - -
- - -
Topic revision: r2 - 19 Jun 2012, AndreasSuter
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
This topic: MUSR > WebHome > CiteMusrFit
+Topic revision: 19 Jun 2012, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/LibFitPofB.html b/doc/html/user/MUSR/LibFitPofB.html index 734a904d..2adfdbfe 100644 --- a/doc/html/user/MUSR/LibFitPofB.html +++ b/doc/html/user/MUSR/LibFitPofB.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: LibFitPofB - + MUSR :: LibFitPofB + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + + + + +
-
+
-
-
-

-

- - - -

-

-

-

-
- -

libFitPofB

-
    +
    +
    +
    + +

    libFitPofB

    + - -

    1 Introduction

    + +

    1 Introduction

    libFitPofB is a collection of C++ classes using the musrfit user-function interface in order to facilitate the usage in conjunction with musrfit. The classes contained in this library generally implement calculations of one-dimensional static magnetic field distributions P(B) which lead to muon-spin depolarization functions

    \mathcal{P}(t) = \int P(B)\cos\left(\gamma_{\mu} B t + \varphi\right) \mathrm{d}B,

    where \gamma_{\mu} = 2\pi\times 135.54~\mathrm{MHz/T} is the gyromagnetic ratio of the muon and \varphi is the initial phase of the muon spins with respect to the positron detector.
    -At the moment the only available implementations deal with field distributions measured in local isotropic superconductors, either by means of low-energy μSR in the Meissner state or by conventional μSR in the mixed state. In the following the basic usage of the library in musrfit is explained—the calculations by themselves are only outlined. For further information please refer to the original literature and/or the source code of the implementation. +At the moment the only available implementations deal with field distributions measured in local isotropic superconductors, either by means of low-energy μSR in the Meissner state or by conventional μSR in the mixed state. In the following the basic usage of the library in musrfit is explained—the calculations by themselves are only outlined. For further information please refer to the original literature and/or the source code of the implementation.


    Remark 1: In order to supply certain information needed for the calculations but not suited to be stored in the musrfit msr files an XML configuration file in the working directory is used. For details, see below.

    -Remark 2: The implementations in this library heavily rely on FFTW3. In principle, it always checks what is the best way to do efficient Fourier transforms for a given machine before the transforms are actually done. If repeatedly Fourier transforms of the same (sizable) length should be done, it might be worth storing the once obtained information in an external file and just load it the next time this information is needed ("wisdom handling"). In case this feature shall be used, a valid wisdom file has to be specified in the XML file. +Remark 2: The implementations in this library heavily rely on FFTW3. In principle, it always checks what is the best way to do efficient Fourier transforms for a given machine before the transforms are actually done. If repeatedly Fourier transforms of the same (sizable) length should be done, it might be worth storing the once obtained information in an external file and just load it the next time this information is needed ("wisdom handling"). In case this feature shall be used, a valid wisdom file has to be specified in the XML file.

    Remark 3: The model functions described in the following do generally not behave nicely in conjunction with MINUIT function minimizations (or maximizations). The analysis process at the moment in most cases involves some tedious trial-and-error procedure, where the displayed MINUIT information as always deserves attention. This is especially true if small effects should be analyzed (e.g. small diamagnetic shifts in superconductors). The parameter uncertainty in many cases has to be estimated independently. Due to these limitations, also the use of the fit option of msr2data cannot be advised.

    Remark 4: If these classes still prove useful and results obtained through them are part of scientific publications, an acknowledgement of the use of the library is appreciated.

    -

    2 LE-μSR

    -

    2.1 One-dimensional London model for the Meissner state of isotropic superconductors

    +

    2 LE-μSR

    +

    2.1 One-dimensional London model for the Meissner state of isotropic superconductors

    The models for analyzing LE-μSR data assume the magnetic induction B(z) to vary only in the dimension parallel to the momentum of the incident muons. In such a case the magnetic field distribution is given by

    @@ -163,7 +170,7 @@ Assuming an array of N \frac{\partial^2}{\partial z^2}B_i(z) = \frac{1}{\lambda_i^2}B_i(z)

    -for each layer i taking into account the boundary conditions(1) +for each layer i taking into account the boundary conditions(1)

    B_1(0) = B_N(d) = \mu_0H

    @@ -182,19 +189,19 @@ userFcn libFitPofB TLondon1DHS 1 2 3 4 5 The parameters are:
    1. phase (deg) -
    2. muon implantation energy as specified in the XML startup file (keV) +
    3. muon implantation energy as specified in the XML startup file (keV)
    4. applied field (G)
    5. thickness of the dead layer (nm)
    6. magnetic field penetration depth (nm)

    Superconducting thin film (one layer)
    -userFcn  libFitPofB TLondon1D1L 1 2 3 4 5 6 [a b]
    +userFcn  libFitPofB TLondon1D1L 1 2 3 4 5 6 [a b]
     
    The mandatory parameters are:
    1. phase (deg) -
    2. muon implantation energy as specified in the XML startup file (keV) +
    3. muon implantation energy as specified in the XML startup file (keV)
    4. applied field (G)
    5. thickness of the dead layer (nm)
    6. thickness of the actually superconducting layer (nm) @@ -202,17 +209,17 @@ The mandatory parameters are:

      The optional parameters are:
        -
      1. fraction f1 of muons in the thin film contributing to the signal (0 ≤ f1 ≤ 1) -
      2. fraction fs of muons in the substrate contributing to the signal (0 ≤ fs ≤ 1) +
      3. fraction f1 of muons in the thin film contributing to the signal (0 ≤ f1 ≤ 1) +
      4. fraction fs of muons in the substrate contributing to the signal (0 ≤ fs ≤ 1)

      Superconducting thin-film bilayer heterostructure
      -userFcn  libFitPofB TLondon1D2L 1 2 3 4 5 6 7 8 [a b c]
      +userFcn  libFitPofB TLondon1D2L 1 2 3 4 5 6 7 8 [a b c]
       
      The mandatory parameters are:
      1. phase (deg) -
      2. muon implantation energy as specified in the XML startup file (keV) +
      3. muon implantation energy as specified in the XML startup file (keV)
      4. applied field (G)
      5. thickness of the dead layer (nm)
      6. thickness of the actually superconducting first layer (nm) @@ -222,18 +229,18 @@ The mandatory parameters are:

        The optional parameters are:
          -
        1. fraction f1 of muons in the dead and first layer contributing to the signal (0 ≤ f1 ≤ 1) -
        2. fraction f2 of muons in the second layer contributing to the signal (0 ≤ f2 ≤ 1) -
        3. fraction fs of muons in the substrate contributing to the signal (0 ≤ fs ≤ 1) +
        4. fraction f1 of muons in the dead and first layer contributing to the signal (0 ≤ f1 ≤ 1) +
        5. fraction f2 of muons in the second layer contributing to the signal (0 ≤ f2 ≤ 1) +
        6. fraction fs of muons in the substrate contributing to the signal (0 ≤ fs ≤ 1)

        Superconducting thin-film trilayer heterostructure
        -userFcn  libFitPofB TLondon1D3L 1 2 3 4 5 6 7 8 9 10 [a b c d]
        +userFcn  libFitPofB TLondon1D3L 1 2 3 4 5 6 7 8 9 10 [a b c d]
         
        The mandatory parameters are:
        1. phase (deg) -
        2. muon implantation energy as specified in the XML startup file (keV) +
        3. muon implantation energy as specified in the XML startup file (keV)
        4. applied field (G)
        5. thickness of the dead layer (nm)
        6. thickness of the actually superconducting first layer (nm) @@ -245,39 +252,39 @@ The mandatory parameters are:

          The optional parameters are:
            -
          1. fraction f1 of muons in the dead and first layer contributing to the signal (0 ≤ f1 ≤ 1) -
          2. fraction f2 of muons in the second layer contributing to the signal (0 ≤ f2 ≤ 1) -
          3. fraction f3 of muons in the third layer contributing to the signal (0 ≤ f3 ≤ 1) -
          4. fraction fs of muons in the substrate contributing to the signal (0 ≤ fs ≤ 1) +
          5. fraction f1 of muons in the dead and first layer contributing to the signal (0 ≤ f1 ≤ 1) +
          6. fraction f2 of muons in the second layer contributing to the signal (0 ≤ f2 ≤ 1) +
          7. fraction f3 of muons in the third layer contributing to the signal (0 ≤ f3 ≤ 1) +
          8. fraction fs of muons in the substrate contributing to the signal (0 ≤ fs ≤ 1)

          Notes

          - 1 : F. London, Superfluids: Macroscopic Theory of Superconductivity, Dover (1961), p. 34 + 1 : F. London, Superfluids: Macroscopic Theory of Superconductivity, Dover (1961), p. 34


          -

          3 Conventional (bulk) μSR

          -

          3.1 Field distributions in the mixed state of isotropic superconductors

          +

          3 Conventional (bulk) μSR

          +

          3.1 Field distributions in the mixed state of isotropic superconductors

          When investigating superconductors in the mixed state by means of conventional μSR a two-dimensional flux-line lattice is probed randomly by the muons. The spatial field distributions within such an ordered lattice are modeled using the Fourier series

          B(\mathbf{r}) = \langle B \rangle \sum\limits_{\mathbf{K}}B_{\mathbf{K}}\exp(-\imath\mathbf{K}\mathbf{r}),

          where \mathbf{r}=(x,y), \mathbf{K} are the reciprocal lattice vectors of a two-dimensional vortex lattice and the B_{\mathbf{K}} are the Fourier coefficients depending on the magnetic penetration depth \lambda and the superconducting coherence length \xi. The B_{\mathbf{K}} for some specific models are as follows:
          -
          London model with Gaussian cutoff(2)

          B_{\mathbf{K}} = \frac{\exp\left({-K^2\xi^2/2}\right)}{1 + K^2\lambda^2}

          -
          Modified London model(3)

          B_{\mathbf{K}} = \frac{\exp\left({-K^2\xi^2/2(1-b)}\right)}{1 + K^2\lambda^2/(1-b)},

          where b = \langle B \rangle/\mu_0H_{\mathrm{c}2}. -
          Analytical Ginzburg-Landau model(4)

          B_{\mathbf{K}} = \frac{f_{\infty}K_1\left(\frac{\xi_v}{\lambda}\sqrt{f_{\infty}^2+\lambda^2K^2}\right)}{K_1\left(\frac{\xi_v}{\lambda}f_{\infty}\right)\sqrt{f_{\infty}^2+\lambda^2K^2}},

          where f_{\infty} = 1 - b^4,~\xi_v = \xi\left(\sqrt{2}-{3\xi}/\left({4\lambda}\right)\right)\sqrt{(1+b^4)(1-2b(1-b)^2)} and K_1 is a modified Bessel function. +
          London model with Gaussian cutoff(2)

          B_{\mathbf{K}} = \frac{\exp\left({-K^2\xi^2/2}\right)}{1 + K^2\lambda^2}

          +
          Modified London model(3)

          B_{\mathbf{K}} = \frac{\exp\left({-K^2\xi^2/2(1-b)}\right)}{1 + K^2\lambda^2/(1-b)},

          where b = \langle B \rangle/\mu_0H_{\mathrm{c}2}. +
          Analytical Ginzburg-Landau model(4)

          B_{\mathbf{K}} = \frac{f_{\infty}K_1\left(\frac{\xi_v}{\lambda}\sqrt{f_{\infty}^2+\lambda^2K^2}\right)}{K_1\left(\frac{\xi_v}{\lambda}f_{\infty}\right)\sqrt{f_{\infty}^2+\lambda^2K^2}},

          where f_{\infty} = 1 - b^4,~\xi_v = \xi\left(\sqrt{2}-{3\xi}/\left({4\lambda}\right)\right)\sqrt{(1+b^4)(1-2b(1-b)^2)} and K_1 is a modified Bessel function.
          -Apart from the mentioned analytical models the numerical Ginzburg-Landau model (5) is available. In this case B(\mathbf{r}) is obtained by an iterative minimization of the free energy of the vortex lattice. +Apart from the mentioned analytical models the numerical Ginzburg-Landau model (5) is available. In this case B(\mathbf{r}) is obtained by an iterative minimization of the free energy of the vortex lattice.

          Concerning the applicability (e.g. field regions) of each of the mentioned models please refer to the original publications!

          -At the moment, the calculation of the field distribution has been implemented for triangular flux-line lattices. The number of grid lines in which the inter-vortex distance is divided for the calculations to be specified through the XML file.
          The muon-spin depolarization functions finally are calculated using the following lines in the THEORY block of a musrfit msr file:
          +At the moment, the calculation of the field distribution has been implemented for triangular flux-line lattices. The number of grid lines in which the inter-vortex distance is divided for the calculations to be specified through the XML file.
          The muon-spin depolarization functions finally are calculated using the following lines in the THEORY block of a musrfit msr file:
          2D triangular vortex lattice, London model with Gaussian cutoff
           userFcn  libFitPofB TBulkTriVortexLondon 1 2 3 4
           
          @@ -336,23 +343,23 @@ SAVE

          Notes

          - 2 : E.H. Brandt, J. Low Temp. Phys. 73, 355 (1988). + 2 : E.H. Brandt, J. Low Temp. Phys. 73, 355 (1988).

          - 3 : T.M. Riseman et al., Phys. Rev. B 52, 10569 (1995). + 3 : T.M. Riseman et al., Phys. Rev. B 52, 10569 (1995).

          - 4 : A. Yaouanc, P. Dalmas de Réotier and E.H. Brandt, Phys. Rev. B 55, 11107 (1997). + 4 : A. Yaouanc, P. Dalmas de Réotier and E.H. Brandt, Phys. Rev. B 55, 11107 (1997).

          - 5 : E.H. Brandt, Phys. Rev. B 68, 054506 (2003). + 5 : E.H. Brandt, Phys. Rev. B 68, 054506 (2003).


          - -

          4 The XML startup file

          + +

          4 The XML startup file

          BMW_startup.xml is a configuration file located in the working directory. In this file some settings like the time and field resolution of the calculations as well as the present muon implantation profiles for a LE-μSR analysis have to be defined. The following XML tags are allowed to define settings:
          <debug>ONE_OR_ZERO</debug>
          activate the debugging output of the settings read from the XML file by setting 1, deactivate it with 0 -
          <wisdom>PATH_TO_FILE</wisdom>
          specify the PATH_TO_FILE to an FFTW3 wisdom file that should be used; if the PATH_TO_FILE is invalid, no FFTW3 wisdom will be used +
          <wisdom>PATH_TO_FILE</wisdom>
          specify the PATH_TO_FILE to an FFTW3 wisdom file that should be used; if the PATH_TO_FILE is invalid, no FFTW3 wisdom will be used
          <delta_t>ResT</delta_t>
          set the time resolution ResT for the calculated depolarization function in microseconds
          <delta_B>ResB</delta_B>
          set the field resolution ResB for the calculated field distribution in Gauss
          <VortexLattice></VortexLattice>
          set the parameters used for the calculation of the spatial field distribution of a vortex lattice
          @@ -398,83 +405,29 @@ An example XML file looks as follows: </BMW>

          --- BMW & AS
    -
    - - - - - +

    +

    - - -
    - -
    - Edit | Attach | Print version | PDF | History: r16 < r15 < r14 < r13 | Backlinks | View wiki text | Refresh | More topic actions -
    -
    Topic revision: r16 - 10 Jul 2011, wojek
    -
    -
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
This topic: MUSR > WebHome > MusrFit > BmwLibs > LibFitPofB
+Topic revision: 03 Jul 2015, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/LibZFRelaxation.html b/doc/html/user/MUSR/LibZFRelaxation.html index e0e3358c..b18fcaf5 100644 --- a/doc/html/user/MUSR/LibZFRelaxation.html +++ b/doc/html/user/MUSR/LibZFRelaxation.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: LibZFRelaxation - + MUSR :: LibZFRelaxation + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + + + + +
-
+
-
-
-

-

- - - -

-

-

-

-
- -

libZFRelaxation

-
    +
    +
    +
    + +

    libZFRelaxation

    + - -

    1 Introduction

    + +

    1 Introduction

    libZFRelaxation is a collection of C++ classes using the musrfit user-function interface in order to facilitate the usage in conjunction with musrfit. The classes contained in this library implement the calculation of some additional zero-field μSR relaxation functions which are not built-in into musrfit.

    @@ -136,9 +143,9 @@ In the following the use of the implemented functions is shortly introduced&mdas If these classes prove useful and results obtained through them are part of scientific publications, an acknowledgement of the use of the library is appreciated.

    -

    2 Isotropic static Gaussian broadened randomly oriented internal fields

    +

    2 Isotropic static Gaussian broadened randomly oriented internal fields

    -E. I. Kornilov and V. Yu. Pomjakushin, Phys. Lett. A 153, 364–367 (1991), doi: 10.1016/0375-9601(91)90959-C +E. I. Kornilov and V. Yu. Pomjakushin, Phys. Lett. A 153, 364–367 (1991), doi: 10.1016/0375-9601(91)90959-C

    \mathcal{P}(t) = \left(1-\alpha\right)\exp\left(-\frac{\sigma_{\mathrm{L}}^2t^2}{2}\right)+\alpha\left(\cos\left(2\pi\nu t\right)-\frac{\sigma_{\mathrm{T}}^2t}{2\pi\nu}\sin\left(2\pi\nu t\right)\right)\exp\left(-\frac{\sigma_{\mathrm{T}}^2t^2}{2}\right) @@ -154,9 +161,9 @@ The parameters are:

    1. the "longitudinal depolarization rate" σL (μs-1) (= 0 in the article).

    -

    3 Isotropic static Lorentzian broadened randomly oriented internal fields

    +

    3 Isotropic static Lorentzian broadened randomly oriented internal fields

    -M. I. Larkin, Y. Fudamoto, I. M. Gat, A. Kinkhabwala, K. M. Kojima, G. M. Luke, J. Merrin, B. Nachumi, Y. J. Uemura, M. Azuma, T. Saito, and M. Takano, Physica B 289–290, 153–156 (2000), doi: 10.1016/S0921-4526(00)00337-9 +M. I. Larkin, Y. Fudamoto, I. M. Gat, A. Kinkhabwala, K. M. Kojima, G. M. Luke, J. Merrin, B. Nachumi, Y. J. Uemura, M. Azuma, T. Saito, and M. Takano, Physica B 289–290, 153–156 (2000), doi: 10.1016/S0921-4526(00)00337-9

    \mathcal{P}(t) = \left(1-\alpha\right)\exp\left(-a_{\mathrm{L}}t\right) + \alpha\left(\cos\left(2\pi\nu t\right)-\frac{a_{\mathrm{T}}}{2\pi\nu}\sin\left(2\pi\nu t\right)\right)\exp\left(-a_{\mathrm{T}}t\right) @@ -172,9 +179,9 @@ The parameters are:

    1. the "longitudinal depolarization rate" aL (μs-1) (= 0 in the article).

    -

    4 Static Gaussian distributed fields with uniaxial anisotropy

    +

    4 Static Gaussian distributed fields with uniaxial anisotropy

    -G. Solt, Hyperfine Interactions 96, 167–175 (1995), doi: 10.1007/BF02066280 +G. Solt, Hyperfine Interactions 96, 167–175 (1995), doi: 10.1007/BF02066280

    \mathcal{P}(t) = \frac{1}{2}\sin^2\Theta + \left(\frac{3}{2}\cos^2\Theta-\frac{1}{2}\right)f_1\left(\epsilon\right) + \sin^2\Theta f_2(\epsilon, \sigma_1, t) + \left(\frac{3}{2}\cos^2\Theta-\frac{1}{2}\right)f_3\left(\epsilon, \sigma_1, t\right), @@ -203,83 +210,29 @@ The parameters are:

    1. Θ (°).

    --- BMW & AS
    -
    - - - - - +

    +

    - - -
    - - -
    Topic revision: r2 - 10 Jul 2011, wojek
    -
    -
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
This topic: MUSR > WebHome > MusrFit > BmwLibs > LibZFRelaxation
+Topic revision: 03 Jul 2015, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/Msr2Data.html b/doc/html/user/MUSR/Msr2Data.html index d4ace4e6..aae6e8f8 100644 --- a/doc/html/user/MUSR/Msr2Data.html +++ b/doc/html/user/MUSR/Msr2Data.html @@ -1,35 +1,72 @@ - + - - + + - MUSR :: Msr2Data - + MUSR :: Msr2Data + + + + + + + - + - - + + + + + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + +
-
+
-
-
+
+
+
+

msr2data

-

- - - -

-

-

-

-
-

msr2data

-

-
    +

    - -

    1 Introduction

    -msr2data (originally written by B. M. Wojek) is a program implemented in C++. Its purpose is to process multiple musrfit msr files with the same parameters and summarize the fitting results either in a TRIUMF DB (1) or a column ASCII file. It evolved from a script called mlog2db which has been written only for collecting fit results of LEM data stored in mlog files generated by musrfit and putting them together in a file with the DB format for further analysis. Therefore, any peculiarities, e.g. in supplying options to msr2data are owed its original purpose. -msr2data is free software and licensed under the GNU GPL version 2 or any later version (at your option). + +

    1 Introduction

    +msr2data (originally written by B. M. Wojek) is a program implemented in C++. Its purpose is to process multiple musrfit msr files with the same parameters and summarize the fitting results either in a TRIUMF DB (1) or a column ASCII file. It evolved from a script called mlog2db which has been written only for collecting fit results of LEM data stored in mlog files generated by musrfit and putting them together in a file with the DB format for further analysis. Therefore, any peculiarities, e.g. in supplying options to msr2data are owed its original purpose. +msr2data is free software and licensed under the GNU GPL version 2 or any later version (at your option).

    Before the usage of msr2data will be explained in greater detail first be aware of the following:

    @@ -147,35 +189,36 @@ Before the usage of msr2data will be explained in greater detail first be aware

    Notes

    - 1 : For an abridged description of this format see here. The DB files produced by msr2data can be viewed for instance with μView, however, they are not completely backward-compatible to the original "db language" since the parameter names can be longer than five or six characters! In order to establish this backward compatibility (if needed) the user has to ensure the correct length of the parameter names in the msr files! + 1 : For an abridged description of this format see here. The DB files produced by msr2data can be viewed for instance with μView, however, they are not completely backward-compatible to the original "db language" since the parameter names can be longer than five or six characters! In order to establish this backward compatibility (if needed) the user has to ensure the correct length of the parameter names in the msr files!


    - -

    2 Basic Types of Usage

    + +

    2 Basic Types of Usage

    Apart from numerous optional parameters that might be set or not, in principle there are four different ways of calling msr2data. These differ in how the list of runs which should be processed is supplied:
    msr2data <run> <extension> [optional parameters]
    A single run number.
    msr2data <firstRunNo> <lastRunNo> <extension> [optional parameters]
    An interval of run numbers is specified through the first and the last run number. The condition <firstRunNo> < <lastRunNo> is not necessary. -
    msr2data \[<run1> <run2> ... <runN> \] <extension> [optional parameters]
    A space separated list of run numbers can be enclosed in [ and ]. Every run that should be processed has to be specified explicitly by its run number. +
    msr2data \[ <runList> \] <extension> [optional parameters]
    Where <runList> is one or a combination of the following:(i) <run0>, <run1>, <run2>, ... <runN> : run numbers, e.g. 123 124, (ii) <run0>-<runN> : a range, e.g. 123-125 -> 123 124 125, (iii) <run0>:<runN>:<step> : a sequence, e.g. 123:127:2 -> 123 125 127. <step> has to be a positive integer. A <runList> can also combine (i)-(iii), e.g. 123 128-130 133, etc.
    msr2data <runListFileName> <extension> [optional parameters]
    An ASCII file containing a list of run numbers and optional external parameters is passed to msr2data. For the structure of the ASCII file see below.

    All four basic types of calling msr2data contain the mandatory file-name <extension> passed right after the list of runs. The meaning of this <extension> should become clear after giving examples for all four cases: -
    msr2data 8472 _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr. +
    msr2data 8472 _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr.
    msr2data 8472 8474 _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr, 8473_tf_h13.msr, and 8474_tf_h13.msr. -
    msr2data [8472 8470] _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr and 8470_tf_h13.msr. +
    msr2data [8472 8470] _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr and 8470_tf_h13.msr. +
    msr2data [8470:8474:2] _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8470_tf_h13.msr, 8472_tf_h13.msr, and 8474_tf_h13.msr.
    msr2data run.list _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from all runs listed in the ASCII file run.list in the working directory. In this file it is also possible to include external parameters which should be put in the resulting DB file. The structure of the run.list is the following: - +
     RUN VAR1 VAR2 VAR3 ...
     8460 200 27.1 46.2 ...
     8472 205 27.1 46.3 ...
     8453 210 27.2 45.9 ...
    -·     ·    ·    ·
    -·     ·    ·    ·
    -·     ·    ·    ·
    +·     ·    ·    ·
    +·     ·    ·    ·
    +·     ·    ·    ·
     
    The first not commented and not empty line determines the parameter names and labels and has to be present!
    It is allowed to add comments (with a preceding #) or empty lines to the run-list file. @@ -184,14 +227,14 @@ The following should be mentioned together with the above examples:
    • The output files in the examples above are only newly created if they did not exist before invoking msr2data. If the files were already present the msr-file data would be appended!
    • If the files have been newly created, also the DB file header is written. If the files were present before, only the data blocks are appended. The output of the header can either be forced or completely suppressed with the header and noheader options as shall be seen later.
    -
      +
      • If the musrfit output files do not have an <extension> as specified above like 8472.msr one has to call msr2data like in the following example:
         msr2data 8472 8460 ""
         

      - -

      3 Optional Parameters

      + +

      3 Optional Parameters

      As mentioned already above there are some optional parameters which change the behavior of msr2data and can be passed in any order. Here is a complete list:
      data
      The output file format is changed to a simple column ASCII file (default output file name: out.dat).
      new
      An existing output file is deleted before new information is written to it. @@ -212,9 +255,9 @@ msr2data 8400 8460 _tf_h13 -oABC.db fit-8472 Using 8472_tf_h13.msr as first template, msr2data generates subsequent msr input files 8400_tf_h13.msr through 8460_tf_h13.msr, calls musrfit to perform a fit of these files and collects the results of the fits together with the DB header in the new file ABC.db. Additionally, some information about external parameters like the temperature will be passed to ABC.db if it is present in the data files.
      -msr2data [8500 8505] _zf fit-8472 noheader nosummary -o DEF.db 
      +msr2data [8500 8502-8504 8507] _zf fit-8472 noheader nosummary -o DEF.db 
       
      -Using 8472_zf.msr as first template, msr2data generates subsequent msr input files 8500_zf.msr and 8505_zf.msr, calls musrfit to perform a fit of these files and collects the results of the fits in the file DEF.db without writing the DB file header or attempting to read additional information from the data files. +Using 8472_zf.msr as first template, msr2data generates subsequent msr input files 8500_zf.msr, 8502_zf.msr, 8503_zf.msr, 8504_zf.msr and 8507_zf.msr, calls musrfit to perform a fit of these files and collects the results of the fits in the file DEF.db without writing the DB file header or attempting to read additional information from the data files.
       msr2data 8595 8585 "" noheader fit-8472! -oGHI.dat data nosummary -k 
       
      @@ -228,12 +271,12 @@ msr2data 8472 8475 _tf_h13 msr-8471! Using 8471_tf_h13.msr as template for all runs, msr2data generates the msr input files 8472_tf_h13.msr through 8475_tf_h13.msr. No fitting will be performed and no DB or ASCII output will be generated!

      - -

      4 The Global Mode

      + +

      4 The Global Mode

      Apart from all the options described above there is another program option: global. This option changes the general behavior of msr2data in that way that instead of processing one msr file for each run it combines all specified runs in one single msr file with the possibility to define common parameters for all runs as well as run-specific parameters. When writing the obtained parameters to a DB file or a column-structured ASCII file that single msr file is read and the parameters valid for each run are extracted. The global option can be used in conjunction with any of the described invocations of msr2data and together with all options stated above.

      - -

      4.1 File Generation

      + +

      4.1 File Generation

      The general idea of this mode is to generate a global msr file on the basis of a working single-run msr file. For this purpose a single-run template containing information about common and run-specific parameters should be created. These parameters are identified through their parameter names:
      run-specific parameters
      these parameters are tagged with the current run number in the format %0Xu, i.e. X digits with leading zeros, at the end of the parameter name, e.g. for a 4-digit-formatted run number alpha0123 if the run number was 123 or for a 8-digit-formatted run number alpha00123456 if the run number was 123456. X has to be at least 4.
      common parameters
      all parameters that are not run specific @@ -278,19 +321,19 @@ During this reorganization all the affected parameter occurrences are changed ac

      Please be aware of the fact that comments in the template msr file are not propagated to the newly generated global msr file!

      -

      4.2 Parameter Extraction

      +

      4.2 Parameter Extraction

      After fitting some model to the specified data the fit parameters can be extracted from the global msr file to a DB or column-structured ASCII file—as usual this includes also parameters stored in the run data files or externally specified parameters given in a run-list file. In order to reach this goal the global msr file has to obey certain rules:
      • The order of the parameters has to match the one described above, meaning the common parameters are listed first followed by the same number of parameters specific to each run tagged by the according run numbers at the end of the parameter names and having the same order as the specified list of runs.
      • The RUN blocks have to be ordered according to the list of runs to be processed.
      -Following these rules—which is achieved most easily by generating the global msr file using msr2data as shown above—the parameters can be extracted e.g. like
      +Following these rules—which is achieved most easily by generating the global msr file using msr2data as shown above—the parameters can be extracted e.g. like 
       msr2data 8471 8470 _example global data -o globalFit.dat
       
      This will read in the file 8471+global_example.msr, extract for each run all relevant parameters from the msr file as well as from the according data files (if available) and append all of them in columns to the ASCII file globalFit.dat.

      - -

      4.3 The Extended Global Mode

      + +

      4.3 The Extended Global Mode

      If a new global input file is generated, it is also possible to do an automatic pre-analysis for each single run using the specified template first; afterwards the run-specific parameters of these single-run msr files are collected in the global msr file. In special cases this might be useful to obtain a better set of starting values for the parameters, however, in most cases it will not replace the "manual review" of the generated global input file. The option is activated by choosing the keyword global+. For example
       msr2data 8471 8470 _example global+ msr-8472
       
      @@ -302,8 +345,8 @@ msr2data 8471 8470 -OneRunFit_example -o OneRunFits.db

      Please be aware that the program in this mode always generates new single-run msr files and always calls musrfit for them. In case there are already single-run fits present, these cannot be used in conjunction with this option. The program on purpose behaves in this way in order to ensure the file integrity and correct parameter order within these files.

      - -

      5 Known Limitations

        + +

        5 Known Limitations

        • The indexing run number of the msr file has to be at the begin of every filename.
        • Within the data file name the RUN# has the format %0Xu, i.e. X digits with leading zeros, and has to be the rightmost number given in this format in the file name. X has to be at least 4. The highest treatable run number is 232-1 = 4294967295.
        • In order to keep msr2data working properly the msr files should only contain one STATISTIC block at the end of the file and one FITPARAMETER block right after the TITLEmusrfit itself allows to have more creative msr files... @@ -311,11 +354,11 @@ msr2data 8471 8470 -OneRunFit_example -o OneRunFits.db
        • msr2data will write only up to two successive empty lines in newly generated msr files. In case more subsequent empty lines are encountered in a template file, these are not copied! Actually, this measure is not a limitation but has been introduced to keep the msr files in a reasonable shape.

        - -

        6 The Graphical User Interface Provided by musrgui / musredit

        + +

        6 The Graphical User Interface Provided by musrgui / musredit

        musrgui/musredit, editors designed especially for the manipulation of musrfit msr files and graphical front ends to musrfit, offer an almost self-explanatory graphical user interface to msr2data depicted below:
        -msr2data-input-tabs.png
        -
        1–3
        Choose one of the ways to specify your list of runs. +msr2data-input-tabs.png
        +
        1–3
        Choose one of the ways to specify your list of runs.
        4
        Give the file extension here, e.g. _zf for files like 8472_zf.msr. If the files do not have an extension this field stays empty. musrgui / musredit take care of passing the "" to msr2data as mentioned above.
        5
        Activates the fit-<template> option if <template> is entered. In case the option "Chain Fit" is not set the given template will be used for the input-file generation for all runs to be fitted—otherwise the output of the first fit serves as template for the second and so on. The template field stays empty if no fits should be performed!
        6
        Activates the -o<outputFileName> option if <outputFileName> is entered. If nothing is entered the default output file out.db or out.dat is used. @@ -328,104 +371,63 @@ msr2data 8471 8470 -OneRunFit_example -o OneRunFits.db
        13
        If set, the -t option is passed to msr2data.
        14
        If set, msr2data is called with the option msr-<template> (instead of fit-<template>) and hence is only producing the msr input files without any fitting.
        15
        If set, msr2data is called with the option fit, i.e. no template will be used to generate new msr input files; only existing files are fed to musrfit. -
        16
        If set, msr2data is operating in the global mode. +
        16
        If set, msr2data is operating in the global mode.
        17
        If set, msr2data is operating in the extended global mode.

        - -

        7 Bugtracking

        + +

        7 Bugtracking

        -For reporting bugs or requesting new features and improvements please use the PSI Tracker or send an e-mail to A. Suter. +For reporting bugs or requesting new features and improvements please use the Bitbucket Issues, PSI Tracker or send an e-mail to A. Suter.

        --- BMW & AS
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r38 < r37 < r36 < r35 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r38 - 20 Jul 2011, wojek
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
Topic attachments
I Attachment Action Size Date Who Comment
msr2data-input-tabs.pngpng msr2data-input-tabs.png manage 36 K 20 Jul 2011 - 12:13 UnknownUser graphical interface to msr2data
+
+
This topic: MUSR > WebHome > MusrFit > Msr2Data
+Topic revision: 16 Aug 2015, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/MusrFit.html b/doc/html/user/MUSR/MusrFit.html index 42e934d2..654045a2 100644 --- a/doc/html/user/MUSR/MusrFit.html +++ b/doc/html/user/MUSR/MusrFit.html @@ -1,35 +1,53 @@ - + - - + + - MUSR :: MusrFit - + MUSR :: MusrFit + + + + + + + - + - - + + + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + + + + +
-
+
-
-
-

-

- - - -

-

-

-

-
- -

musrfit User Manual

-
    +
    +
    +
    + +

    musrfit User Manual

    + - -

    1 Introduction

    + +

    1 Introduction

    -musrfit is a software tool for analyzing time-differential μSR data. The program suite is free software and licensed under the GNU GPL version 2 or any later version (at your option). It is implemented in C++/ROOT and uses the MINUIT2 libraries developed at CERN for fitting data. Installation instructions for GNU/Linux, MS Windows, and Mac OS X can be found here. For people familiar with the μSR data analysis program WKM there is a short quick start page explaining the major differences between WKM and musrfit. Recent changes of the program are listed in the ChangeLog. +musrfit is a software tool for analyzing time-differential μSR data. The program suite is free software and licensed under the GNU GPL version 2 or any later version (at your option). It is implemented in C++/ROOT and uses the MINUIT2 libraries developed at CERN for fitting data. Installation instructions for GNU/Linux, MS Windows, and Mac OS X can be found here. For people familiar with the μSR data analysis program WKM there is a short quick start page explaining the major differences between WKM and musrfit. Recent changes of the program are listed in the ChangeLog.

    -

    2 Available Executables, Configuration Files and their Basic Usage

    +

    2 Available Executables, Configuration Files and their Basic Usage

    - -

    2.1 musrfit

    + +

    2.1 musrfit

    musrfit is the actual fitting program. It defines the FCN routine passed to MINUIT2 and performs χ2 or log-likelihood fitting. If called from within a shell it accepts several parameters:
    <msr_file>
    filename of the msr input file defining all the details needed for performing a fit to a specified set of data—the only mandatory parameter @@ -186,8 +211,8 @@ If called with a msr input file, e.g.
    musrfit 8472.msr
    the fit described in the input file will be executed and the results will be written to a mlog output file—in the example 8472.mlog. When the fitting has terminated the msr file and the mlog file are swapped, so that the resultant parameter values can be found in the msr file and the mlog file contains a copy of the input file. The format of the mlog file is the same as that of the msr file. For a detailed description of the msr file format refer to the corresponding section.

    - -

    2.2 musrview

    + +

    2.2 musrview

    musrview is an interactive graphical user interface for the presentation of the analyzed data and the corresponding fits. If called from within a shell it accepts the following parameters:
    <msr_file>
    name of the msr input or output file to be displayed—this parameter is mandatory
    --<graphic_format_extension>
    will produce a graphics output file without starting a ROOT session. The filename is based on the name of the <msr_file>, e.g. 8472.msr8472_0.png
    Supported values for <graphic_format_extension> are eps, pdf, gif, jpg, png, svg, xpm, root @@ -203,14 +228,14 @@ for each PLOT block in the the msr file a file 8472_X.jpg is produced whe If called only with a msr file, e.g.
    musrview 8472.msr
    a ROOT canvas is drawn; it contains all experimental data and fits specified in the PLOT block of the msr file. -For a description of the various plotting types refer to the corresponding section. +For a description of the various plotting types refer to the corresponding section.

    Within the drawn canvas all standard actions applicable to ROOT canvases might be performed. In the menu bar the Musrfit menu can be found. From there some musrfit-specific actions might be taken:
    Fourier
    performs the Fourier transformation of the selected data and shows the result
    Difference
    shows the difference between the selected data and the fit
    Average
    toggle between the current view and the averaged data view. Useful if the averaged Fourier power spectrum of lots of detectors shall be shown. -
    Save Data
    saves the selected data in a simple multi-column ASCII file +
    Export Data
    saves the selected data in a simple multi-column ASCII file

    Additionally, some functions can be accessed using key-shortcuts:
    @@ -221,11 +246,62 @@ Additionally, some functions can be accessed using key-shortcuts:
    u
    reset the plotting range to the area given in the msr file ("unzoom")

    - -

    2.3 musrt0

    -musrt0 is a user interface for the determination of t0 and the time windows of data and background needed to be specified in the RUN blocks of the msr file. It can be operated either as an interactive program or in a non-interactive mode. In the non-interactive mode it accepts the following parameters:
    + +

    2.3 musrFT NEW

    +musrFT is an interactive graphical user interface for the presentation of Fourier transforms of raw μSR histograms. It's purpose is to get a quick overview for high TF-field data, as found e.g. at the HAL-9500 instrument at PSI. It Fourier transforms the raw histogram data, i.e. N(t) rather than A(t), and hence shows the lifetime contribution of the muon. This is no problem for large enough fields, but will be a severe problem at very low fields. musrFT is still in its early stage and should be considered a beta-version. +

    +If called from within a shell it accepts the following parameters:
    +
    <msr_files>
    msr-file name(s). These msr-files are used for the Fourier transform. It can be a list of msr-files, e.g. musrFT 3110.msr 3111.msr +
    -df, --data-file <data-file>
    This allows to feed only μSR data file(s) to perform the Fourier transform. Since the extended <msr-file> information are missing, they will need to be provided by to options, or musrFT tries to guess, based on musrfit_startup.xml settings. +
    --help
    display a help and exit +
    --version
    output version information and exit +
    -g, --graphic-format <graphic-format-extension>
    will produce a graphic-output-file without starting a root session. The name is based either on the <msr-file> or the <data-file>, e.g. 3310.msr -> 3310_0.png. Supported graphic-format-extension: eps, pdf, gif, jpg, png, svg, xpm, root +
    --dump <fln>
    rather than starting a root session and showing Fourier graphs of the data, it will output the Fourier data in an ascii file <fln>. +
    -br, --background-range <start> <end>
    background interval used to estimate the background to be subtracted before the Fourier transform. <start>, <end> to be given in bins. +
    -bg, --background
    gives the background explicit for each histogram. +
    -fo, --fourier-option <fopt>
    <fopt> can be 'real', 'imag', 'real+imag', 'power', or 'phase'. If this is not defined (neither on the command line nor in the musrfit_startup.xml). Default will be 'power'. +
    -ap, --apodization <val>
    <val> can be either 'none', 'weak', 'medium', 'strong'. Default will be 'none'. +
    -fp, --fourier-power <N>
    <N> being the Fourier power, i.e. 2^<N> used for zero padding. Default is -1, i.e. no zero padding will be performed. +
    -u, --units <units>
    <units> is used to define the x-axis of the Fourier transform. One may choose between the fields (Gauss) or (Tesla), the frequency (MHz), and the angular-frequency domain (Mc/s). Default will be 'MHz'. +
    -ph, --phase <val>
    defines the initial phase <val>. This only is of concern for 'real', 'imag', and 'real+imag'. Default will be 0.0. +
    -fr, --fourier-range <start> <end>
    Fourier range. <start>, <end> are interpreted in the units given. Default will be -1.0 for both which means, take the full Fourier range. +
    -tr, --time-range <start> <end>
    time domain range to be used for Fourier transform. <start>, <end> are to be given in (μsec). If nothing is given, the full time range found in the data file(s) will be used. +
    --histo <list>
    give the <list> of histograms to be used for the Fourier transform. E.g. musrFT -df lem15_his_01234.root --histo 1 3, will only be needed together with the option --data-file. If multiple data file are given, <list> will apply to all data-files given. If --histo is not given, all histos of a data file will be used. <list> can be anything like: 2 3 6, or 2-17, or 1-6 9, etc. +
    -a, --average
    show the average of all ALL Fourier transformed data. +
    -ad, --average-per-data-set
    show the average of per data set Fourier transformed data. +
    --t0 <list>
    A list of t0's can be provided. This in conjunction with --data-file and --fourier-option real allows to get the proper initial phase if t0's are known. If a single t0 for multiple histos is given, it is assume, that this t0 is common to all histos. Example: musrFT -df lem15_his_01234.root -fo real --t0 2750 --histo 1 3. +
    -pa, --packing <N>
    if <N> (an integer), the time domain data will first be packed/rebinned by <N>. +
    --title <title>
    give a global title for the plot. +
    --create-msr-file <fln>
    creates a msr-file based on the command line options provided. This will help on the way to a full fitting model. +
    -lc, --lifetimecorrection <fudge>
    try to eliminate muon life time decay. Only makes sense for low transverse fields. <fudge> is a tweaking factor (scaling factor for the estimated t0) and should be kept around 1.0. +
    --timeout <timeout>
    <timeout> given in seconds after which musrFT terminates. If <timeout> <= 0, no timeout will take place. Default <timeout> is 3600 sec. +
    +

    +
    Example 1
    musrFT -df tdc_hifi_2014_00153.mdu --title "MnSi" -tr 0 10 -fr 7.0 7.6 -u Tesla --histo 2-17 -a
    will take time range from t=0..10μsec, will show the Fourier transform in units of Tesla from B=7.0..7.6 Tesla of the detectors 2-17. Rather than showing the 16 individual Fourier transforms, the average of all Fourier spectra will be shown. t0's will be guessed by the maximum of the time domain histogram (assuming a prompt peak). +
    Example 2
    musrFT -df tdc_hifi_2014_00153.mdu -tr 0 10 -fr 7.0 7.6 -u Tesla --histo 2-17 --title "MnSi average, T=50K, B=7.5T" -a -g pdf
    as Example 1 but rather than showing an interactive GUI, the output will be dumped into a pdf-file. The file name will be tdc_hifi_2014_00153.pdf. +
    Example 3
    musrFT -df tdc_hifi_2014_00153.mdu -tr 0 10 -fr 7.0 7.6 -u Tesla --histo 2-17 --title "MnSi average, T=50K, B=7.5T" -a --dump MnSi.dat
    as Example 1 but rather than showing an interactive GUI, the output will be dumped into the ascii file MnSi.dat. +
    +

    +Within the drawn canvas all standard actions applicable to ROOT canvases might be performed. +In the menu bar the MusrFT menu can be found. From there some musrFT-specific actions might be taken:
    +
    Fourier
    allows to switch between different Fourier transform representations 'Power', 'Real', ... +
    Average
    toggle between the current view and the averaged data view. +
    Average per Data Set
    toggle between the current view and the per data set average view. +
    Export Data
    saves the selected data in a simple multi-column ASCII file +
    +

    +Additionally, some functions can be accessed using key-shortcuts:
    +
    q
    quits musrFT +
    a
    toggle between average of the presented data and single Fourier histos, e.g. the averaged Fourier power spectra of various detectors. +
    d
    toggle between average per data set and single Fourier histos, e.g. the averaged Fourier power spectra of various detectors for the different data sets given. +
    u
    reset the plotting range to the area given in the msr-file or the form the command line ("unzoom") +
    +

    + +

    2.4 musrt0

    +musrt0 is a user interface for the determination of t0 and the time windows of data and background needed to be specified in the RUN blocks of the msr file. It can be operated either as an interactive program or in a non-interactive mode. In the non-interactive mode it accepts the following parameters:
    <msr_file>
    name of an msr file -
    -g, --getT0FromPromptPeak [<firstGoodBinOffset>]
    tries to estimate t0 from the prompt peak (maximum entry) in each histogram and writes the corresponding values to the t0 lines in the RUN blocks of the msr file. If an optional number <firstGoodBinOffset> is given, the lower limit of the data range will be set to t0 + <firstGoodBinOffset>. +
    -g, --getT0FromPromptPeak [<firstGoodBinOffset>]
    tries to estimate t0 from the prompt peak (maximum entry) in each histogram and writes the corresponding values to the t0 lines in the RUN blocks of the msr file. If an optional number <firstGoodBinOffset> is given, the lower limit of the data range will be set to t0 + <firstGoodBinOffset>.
    --timeout <timeout>
    <timeout> given in seconds after which musrview terminates. If <timeout> <= 0, no timeout will take place. Default for <timeout> is 0.
    --help
    displays a small help notice in the shell explaining the basic usage of the program
    --version
    prints the version number of musrt0 @@ -233,8 +309,8 @@ Additionally, some functions can be accessed using key-shortcuts:

    The interactive mode of musrt0 is started if the program is called with a sole msr-file argument, e.g.
    musrt0 8472.msr
    -Then a ROOT canvas depicting the histogram of the data set mentioned first in the RUN block is drawn in different colors:
    -musrt0
    +Then a ROOT canvas depicting the histogram of the data set mentioned first in the RUN block is drawn in different colors:
    +musrt0
    The colors of the data points represent the choice of the time windows of data (blue) and background (red), as well as t0 (green line). In order to change these ranges the mouse cross-hair is moved to a channel of choice and one of the following keys is pressed:
    q
    close the currently open histogram and opens the next (see also below)
    Q
    quit musrt0 without writing into the msr file @@ -252,11 +328,11 @@ When all channels have been set correctly for the first histogram, pressing of t Using the key Q, musrt0 can be interrupted. No changes to the msr file are applied in this case.
    Closing a window by clicking the X button is equivalent to pressing Q, i.e. musrt0 is simply terminated.

    - -

    2.4 musrfit_startup.xml

    + +

    2.5 musrfit_startup.xml

    musrfit_startup.xml is a configuration file located at the musrfit binary path. In this file the following XML tags are allowed to define settings:
    <data_path>PATH_TO_DATA</data_path>
    add the new path PATH_TO_DATA where musrfit and musrview will search for data files -
    <write_per_run_block_chisq>y/n</write_per_run_block_chisq>
    if enabled χ2 for each RUN block will be written to the STATISTIC block of the resulting msr file. Additionally, in case a χ2 single-histogram fit is done, also Pearson's χ2 will be added. +
    <write_per_run_block_chisq>y/n</write_per_run_block_chisq>
    if enabled χ2 for each RUN block will be written to the STATISTIC block of the resulting msr file. Additionally, in case a χ2 single-histogram fit is done, also Pearson's χ2 will be added.
    <fourier_settings></fourier_settings>
    set the default parameters for the Fourier transform in musrview. For further details refer to the description of the msr file.
    <units>UNITS</units>
    specify the units of the frequency or field-domain. Valid units are Gauss, MHz and Mc/s (inside a <fourier_settings> environment)
    <fourier_power>n</fourier_power>
    specify the number of points 2n (n < 21) to be used for the Fourier transform (inside a <fourier_settings> environment) @@ -308,8 +384,8 @@ An example would look like: </musrfit>

    - -

    2.5 msr2msr

    + +

    2.6 msr2msr

    msr2msr is a small utility for converting existing WKM msr files into musrfit msr files. It accepts the following parameters:
    <msr_file_in>
    input WKM msr file (mandatory first parameter)
    <msr_file_out>
    converted output musrfit msr file (mandatory second parameter) @@ -320,8 +396,8 @@ A typical example then looks like:
    msr2msr 8472-WKM.msr 8472-musrfit.msr
    If the input file has already the musrfit msr file structure, the output file will be just a copy of the input file.

    - -

    2.6 any2many

    + +

    2.7 any2many

    any2many is a muSR data file converter. Currently different facilities (PSI, TRIUMF, ISIS, J-PARC) are saving their muSR data files in different formats, or even worse some instruments are using other muSR data formats than others. The aim of any2many is that these files can be converted into each other. Of course only a subset of header information can be converted.

    Currently any2many can convert the following muSR data file formats:
      @@ -335,6 +411,7 @@ Since the goal was to create a very flexible converter tool, it has ample of opt
    -r <runList-input>
    where <runList-input> is a list of run numbers separated by spaces of the form: <run1> <run2> <run3> etc., or a sequence of runs <runStart>-<runEnd>, e.g. 111-123. This option cannot be combined with -f and vice versa.
    -t <in-template> <out-template>
    where <in-/out-template> are templates to generate real file names from run numbers. The following template tags can be used: [yy] for year, and [rrrr] for the run number. If the run number tag is used, the number of 'r' will give the number of digits used with leading zeros, e.g. [rrrrrr] and run 123 will result in 000123. Similarly [yyyy] will result in something like 1999, whereas [yy] into something like 99. For more details best check the examples below.
    -c <in-Format> <out-Format>
    this is used to tell any2many what is the input-file-format and into which output-file-format the data shall be converted. The possible input-/output-file-formats are listed above. +
    -h
    This option is for MusrRoot input files only! Select the the histo groups to be exported. is a space separated list of the histo group, e.g. -h 0, 20 will try to export the histo 0 (NPP) and 20 (PPC). A histo-group is defined via the RedGreen offset in the MusrRoot file format. It is used e.g. in red/green mode measurements. If this option is omitted in a conversion from MusrRoot to something, the first group will exported only!
    -p <output-path>
    where <output-path> is the output path for the converted files. If no <output-path> is given, the current directory will be used, unless the option -s is used.
    -y <year>
    here a <year> in the form yy or yyyy can be given. If this is the case, any automatic file name generation which needs a year will use this given one.
    -s
    with this option the output data file will be sent to the stdout. It is intended to be used together with web applications. @@ -354,38 +431,38 @@ Will take the LEM ROOT file '2010/lem10_his_0123.root' rebin it by
    any2many -f 2010/lem10_his_0123.root -c ROOT NEXUS2-HDF5 -o 2010/lem10_his_0123_v2.nxs
    Will take the LEM ROOT file '2010/lem10_his_0123.root' and convert it to NeXus IDF V2. The output file name will be lem10_his_0123_v2.nxs, and will be saved in the current directory.

    -
    any2many -r 123 137 -c PSI-BIN MUD -t d[yyyy]/deltat_tdc_gps_[rrrr].bin [rrrrrr].msr -y 2001
    +
    any2many -r 123 137 -c PSI-BIN MUD -t d[yyyy]/deltat_tdc_gps_[rrrr].bin [rrrrrr].msr -y 2001
    Will take the run 123 and 137, will generate the input file names: d2001/deltat_tdc_gps_0123.bin and d2001/deltat_tdc_gps_0137.bin, read these files, and convert them to the output files with names 000123.msr and 000137.msr, respectively.

    -
    any2many -r 100-117 -c PSI-MDU ASCII -t d[yyyy]/deltat_tdc_alc_[rrrr].mdu [rrr].ascii -y 2011 -s
    +
    any2many -r 100-117 -c PSI-MDU ASCII -t d[yyyy]/deltat_tdc_alc_[rrrr].mdu [rrr].ascii -y 2011 -s
    Will take the runs 100 through 117 and convert the PSI-MDU input files to ASCII output and instead of saving them into a file, they will be spit to the standard output.

    -
    any2many -r 100-117 -c NEXUS ROOT -t d[yyyy]/psi_gps_[rrrr].NXS psi_[yyyy]_gps_[rrrr].root -z b psi_gps_run_100to117
    +
    any2many -r 100-117 -c NEXUS ROOT -t d[yyyy]/psi_gps_[rrrr].NXS psi_[yyyy]_gps_[rrrr].root -z b psi_gps_run_100to117
    Will take the runs 100 through 117 and convert the NeXus input files to ROOT output. Afterwards these new files will be collected in a compressed archive psi_gps_run_100to117.tar.bz2.

    any2many -f 2010/lem10_his_0123.root 2010/lem10_his_0012.root -c ROOT ROOT -rebin 25
    Will read the two files '2010/lem10_his_0123.root' and '2010/lem10_his_0012.root', rebin them with 25 and export them as LEM ROOT files with adding rebin25 to the name, e.g. 2010/lem10_his_0123_rebin25.root.

    - -

    2.7 dump_header

    + +

    2.8 dump_header

    dump_header is a little program which tries to read a μSR data file and sends the relevant information (required header info, start of the histos, etc.) to the standard output. Currently the following μSR data file formats are supported: MusrROOT, ROOT (old LEM format), PSI-BIN, PSI-MDU, NeXus (IDF1 and IDF2), MUD, and WKM.

    - -

    3 Auxiliary Programs

    + +

    3 Auxiliary Programs

    Additionally to the programs mentioned above editor front ends called musrgui/musredit and another tool named msr2data are available. The purpose of msr2data is to process multiple msr files with the same parameters and to summarize the fitting results either in a DB or a column ASCII file. Also, new msr files can be generated from a template. For details refer to its manual.

    Before going to use musrgui / musredit it is strongly recommended to read this manual first!

    - -

    4 Description of the msr File Format

    + +

    4 Description of the msr File Format

    The programs are using an input file to control their action. This input file has the extension .msr (msr file). The msr file is built up from different blocks. Each block starts with a keyword and is—with the exception of the title—terminated by an empty line. Comments start with the character #. The various input blocks are described below.

    - -

    4.1 The Title

    + +

    4.1 The Title

    The first line of the msr file is the title line. Unlike all the other input blocks, it does not start with a block keyword. It is just a simple text line, in which any information can be placed. The title text will be used in the graphical representation of the data as a headline.

    - -

    4.2 The FITPARAMETER Block

    + +

    4.2 The FITPARAMETER Block

    The FITPARAMETER block is used to define the fit parameters in a MINUIT typical style. There are various possible parameter definitions which are listed here:
    @@ -393,7 +470,7 @@ are various possible parameter definitions which are listed here:
        2. <no> <name> <value> <step> <lower_boundary> <upper_boundary>
        3. <no> <name> <value> <step> <pos_error> <lower_boundary> <upper_boundary>
     
    -where <no> is the parameter number, <name> is the parameter name (1), <value> is the initial guess of the parameter, <step> the inital step width, <lower/upper_boundary> is the lower/upper boundary for the parameter (2). +where <no> is the parameter number, <name> is the parameter name (1), <value> is the initial guess of the parameter, <step> the inital step width, <lower/upper_boundary> is the lower/upper boundary for the parameter (2).

    In the output file, <value> will be the MINUIT fit value, <step> will contain the error estimate (or the negative error estimate if MINOS was successfully used), <pos_error> will have the value none if MINOS has not been used, otherwise it will show the positive error estimate.

    @@ -430,27 +507,27 @@ There is also the possibility to constrain the parameters to semi-defined interv

    Notes

    - 1 : a standard string without whitespace + 1 : a standard string without whitespace

    - 2 : According to the MINUIT manual this should be avoided whenever possible! + 2 : According to the MINUIT manual this should be avoided whenever possible!


    - -

    4.3 The THEORY Block

    + +

    4.3 The THEORY Block

    The THEORY block is used to define the fit function. There is a set of predefined functions available. It is also possible to use externally defined functions. How to use them will be explained afterwards, here only the predefined functions are described.

    - - + +
    - - - - - + + + + + @@ -489,119 +566,119 @@ The THEORY block is used to define the fit function. There is a set of predefine - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + - + @@ -634,7 +711,7 @@ The THEORY block is used to define the fit function. There is a set of predefine
    name abbreviation parameters mathematical expression reference name abbreviation parameters mathematical expression reference
    stg \sigma\,(\mu\text{s}^{-1}) \frac{1}{3} + \frac{2}{3} \left[1-(\sigma t)^2\right] \exp\left[-\frac{1}{2}\left(\sigma t\right)^2\right] dead! dead!
    statGssKTLF sgktlf \nu\,(\mathrm{MHz}), \sigma\,(\mu\text{s}^{-1}) G_{\mathrm{G,LF}}(t) \equiv 1-\frac{2\sigma^2}{(2\pi\nu)^2}\left[1-\exp\left(-\frac{1}{2}\sigma^2t^2\right)\cos(2\pi\nu t)\right]+\frac{2\sigma^4}{(2\pi\nu)^3}\int^t_0 \exp\left(-\frac{1}{2}\sigma^2\tau^2\right)\sin(2\pi\nu\tau)\mathrm{d}\tau (4) (4)
    dynGssKTLF dgktlf \nu\,(\mathrm{MHz}), \sigma\,(\mu\text{s}^{-1}), \Gamma\,(\mathrm{MHz}) \frac{1}{2\pi \imath}\int_{\gamma-\imath\infty}^{\gamma+\imath\infty} \frac{f_{\mathrm{G}}(s+\Gamma)}{1-\Gamma f_{\mathrm{G}}(s+\Gamma)} \exp(s t) \mathrm{d}s,\mathrm{where}\,f_{\mathrm{G}}(s)\equiv \int_0^{\infty}G_{\mathrm{G,LF}}(t)\exp(-s t) \mathrm{d}t (5) (5)
    statExpKT sekt \lambda\,(\mu\text{s}^{-1}) \frac{1}{3} + \frac{2}{3} \left[1-\lambda t\right] \exp\left(-\lambda t\right) (6) (6)
    statExpKTLF sektlf \nu\,(\mathrm{MHz}), a\,(\mu\text{s}^{-1}) 1-\frac{a}{2\pi\nu}j_1(2\pi\nu t)\exp\left(-at\right)-\left(\frac{a}{2\pi\nu}\right)^2 \left[j_0(2\pi\nu t)\exp\left(-at\right)-1\right]-a\left[1+\left(\frac{a}{2\pi\nu}\right)^2\right]\int^t_0 \exp\left(-a\tau\right)j_0(2\pi\nu\tau)\mathrm{d}\tau \equiv G_{\mathrm{L,LF}}(t) (7) (7)
    dynExpKTLF dektlf \nu\,(\mathrm{MHz}), a\,(\mu\text{s}^{-1}), \Gamma\,(\mathrm{MHz}) \frac{1}{2\pi \imath}\int_{\gamma-\imath\infty}^{\gamma+\imath\infty} \frac{f_{\mathrm{L}}(s+\Gamma)}{1-\Gamma f_{\mathrm{L}}(s+\Gamma)} \exp(s t) \mathrm{d}s,\mathrm{where}\,f_{\mathrm{L}}(s)\equiv \int_0^{\infty}G_{\mathrm{L,LF}}(t)\exp(-s t) \mathrm{d}t (8) (8)
    combiLGKT lgkt \lambda\,(\mu\text{s}^{-1}), \sigma\,(\mu\text{s}^{-1}) \frac{1}{3}+\frac{2}{3}\left(1-\sigma^2 t^2-\lambda t\right)\exp\left(-\frac{\sigma^2t^2}{2}-\lambda t\right) dead! dead!
    strKT skt \sigma\,(\mu\text{s}^{-1}), \beta\,(1) \frac{1}{3}+\frac{2}{3}\left[1-(\sigma t)^\beta\right] \exp\left[-(\sigma t)^\beta / \beta \right] (9) (9)
    spinGlass spg \lambda\,(\mu\text{s}^{-1}), \gamma\,(\mu\text{s}^{-1}), q\,(1) \frac{1}{3}\exp\left(-\sqrt{\frac{4\lambda^2(1-q)t}{\gamma}}\right)+\frac{2}{3}\left(1-\frac{q\lambda^2t^2}{\sqrt{\frac{4\lambda^2(1-q)t}{\gamma}+q\lambda^2t^2}}\right)\exp\left(-\sqrt{\frac{4\lambda^2(1-q)t}{\gamma}+q\lambda^2t^2}\right) dead! dead!
    rdAnisoHf rahf \nu\,(\mathrm{MHz}), \lambda\,(\mu\text{s}^{-1}) \frac{1}{6}\left(1-\frac{\nu t}{2}\right)\exp\left(-\frac{\nu t}{2}\right)+\frac{1}{3}\left(1-\frac{\nu t}{4}\right)\exp\left(-\frac{\nu t + 2.44949\lambda t}{4}\right) (9) (9)
    TFieldCos tf \varphi\,(^{\circ}), \nu\,(\mathrm{MHz}) \cos\left(2\pi\nu t+\frac{\pi\varphi}{180}\right) dead! dead!
    internFld if \alpha\,(1), \varphi\,(^{\circ}), \nu\,(\mathrm{MHz}), \lambda_{\mathrm{T}}\,(\mu\text{s}^{-1}), \lambda_{\mathrm{L}}\,(\mu\text{s}^{-1}) \alpha\,\cos\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)\exp\left(-\lambda_{\mathrm{T}}t\right)+(1-\alpha)\,\exp\left(-\lambda_{\mathrm{L}}t\right) dead! dead!
    Bessel b \varphi\,(^{\circ}), \nu\,(\mathrm{MHz}) j_0\left(2\pi\nu t+\frac{\pi\varphi}{180}\right) dead! dead!
    internBsl ib \alpha\,(1), \varphi\,(^{\circ}), \nu\,(\mathrm{MHz}), \lambda_{\mathrm{T}}\,(\mu\text{s}^{-1}), \lambda_{\mathrm{L}}\,(\mu\text{s}^{-1}) \alpha\,j_0\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)\exp\left(-\lambda_{\mathrm{T}}t\right)+(1-\alpha)\,\exp\left(-\lambda_{\mathrm{L}}t\right) dead! dead!
    abragam ab \sigma\,(\mu\text{s}^{-1}), \gamma\,(\mathrm{MHz}) \exp\left[-\frac{\sigma^2}{\gamma^2}\left(e^{-\gamma t}-1+\gamma t\right)\right] dead! dead!
    skewedGss skg \varphi\,(^{\circ}), \nu\,(\mathrm{MHz}), \sigma_{-}\,(\mu\text{s}^{-1}), \sigma_{+}\,(\mu\text{s}^{-1}) \frac{\sigma_{-}}{\sigma_{+}+\sigma_{-}}\exp\left[-\frac{\sigma_{-}^2t^2}{2}\right]\left\lbrace\cos\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)+\sin\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)\mathrm{Erfi}\left(\frac{\sigma_{-}t}{\sqrt{2}}\right)\right\rbrace+ \frac{\sigma_{+}}{\sigma_{+}+\sigma_{-}}\exp\left[-\frac{\sigma_{+}^2t^2}{2}\right]\left\lbrace\cos\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)-\sin\left(2\pi\nu t+\frac{\pi\varphi}{180}\right)\mathrm{Erfi}\left(\frac{\sigma_{+}t}{\sqrt{2}}\right)\right\rbrace memo pdf memo pdf
    staticNKZF snkzf \Delta_0\,(\mu\text{s}^{-1}), R_b = \Delta_{\mathrm{GbG}}/\Delta_0 \,(\text{1}) \frac{1}{3}+\frac{2}{3}\left(\frac{1}{1+R_b^2\Delta_0^2 t^2}\right)^{3/2} \left(1-\frac{\Delta_0^2 t^2}{1+R_b^2\Delta_0^2 t^2}\right)\,\exp\left[-\frac{\Delta_0^2 t^2}{2(1+R_b^2\Delta_0^2 t^2)}\right] (10) (10)
    staticNKTF

    -Every theory function has to be written on a single line. It starts with the theory function name or its abbreviation followed by the parameters. Consecutive lines of theory functions will be multiplied. If theory functions need to be added, a line with a + has to separate them. The parameters are given as the numbers assigned to them in the FITPARAMETER block. The order of the parameters is given in the table above. As an example +Every theory function has to be written on a single line. It starts with the theory function name or its abbreviation followed by the parameters. Consecutive lines of theory functions will be multiplied. If theory functions need to be added, a line with a + has to separate them. The parameters are given as the numbers assigned to them in the FITPARAMETER block. The order of the parameters is given in the table above. As an example
        simplExpo 4
     
    @@ -654,26 +731,26 @@ which means A(t) = p2 e-p3

    Notes

    - 4 : R. S. Hayano et al., Phys. Rev. B 20 (1979) 850 + 4 : R. S. Hayano et al., Phys. Rev. B 20 (1979) 850

    - 5 : R. S. Hayano et al., Phys. Rev. B 20 (1979) 850; P. Dalmas de Réotier and A. Yaouanc, J. Phys.: Condens. Matter 4 (1992) 4533; A. Keren, Phys. Rev. B 50 (1994) 10039 + 5 : R. S. Hayano et al., Phys. Rev. B 20 (1979) 850; P. Dalmas de Réotier and A. Yaouanc, J. Phys.: Condens. Matter 4 (1992) 4533; A. Keren, Phys. Rev. B 50 (1994) 10039

    - 6 , 7 : Y. J. Uemura et al., Phys. Rev. B 31 (1985) 546 + 6 , 7 : Y. J. Uemura et al., Phys. Rev. B 31 (1985) 546

    - 8 : R. S. Hayano et al., Phys. Rev. B 20 (1979) 850; P. Dalmas de Réotier and A. Yaouanc, J. Phys.: Condens. Matter 4 (1992) 4533 + 8 : R. S. Hayano et al., Phys. Rev. B 20 (1979) 850; P. Dalmas de Réotier and A. Yaouanc, J. Phys.: Condens. Matter 4 (1992) 4533

    - 9 : M.R. Crook and R. Cywinski, J. Phys.: Condens. Matter 9 (1997) 1149 + 9 : M.R. Crook and R. Cywinski, J. Phys.: Condens. Matter 9 (1997) 1149

    - 9 : R. E. Turner and D. R. Harshman, Phys. Rev. B 34 (1986) 4467 + 9 : R. E. Turner and D. R. Harshman, Phys. Rev. B 34 (1986) 4467

    - 10 : D.R. Noakes and G.M. Kalvius, Phys. Rev. B 56 (1997) 2352; A. Yaouanc and P. Dalmas de Réotier "Muon Spin Rotation, Relaxation, and Resonance" Oxford Scientific Publication; simplifying the original formulae by eliminating \Delta_{\rm eff} via the identity \Delta_{\rm eff}^2 = (1+R_b^2) \Delta_0 + 10 : D.R. Noakes and G.M. Kalvius, Phys. Rev. B 56 (1997) 2352; A. Yaouanc and P. Dalmas de Réotier "Muon Spin Rotation, Relaxation, and Resonance" Oxford Scientific Publication; simplifying the original formulae by eliminating \Delta_{\rm eff} via the identity \Delta_{\rm eff}^2 = (1+R_b^2) \Delta_0


    - -

    4.3.1 Maps

    + +

    4.3.1 Maps

    In case different runs are fitted simultaneously, it is very often necessary that for a given theory function, some parameters are run-dependent. An example could be a temperature scan, where the parameters (asymmetry, depolarization rates, etc.) will depend on the temperature. In order to handle such situations, a mapping of parameters in the THEORY block is possible. That means, instead of a parameter number, the mapping of the parameter is given. The definition of the mapping block is part of the RUN block and will be described there. For example
        THEORY
    @@ -686,13 +763,13 @@ In case different runs are fitted simultaneously, it is very often necessary tha
     
    means that the first part of this theory function is common to all runs, as for instance the background, and the second part is changing from run to run, i.e. map1/2 will point to different parameters depending on the run.

    - -

    4.3.2 Functions

    -Yet another useful feature is the possibility to define functions in the FUNCTIONS block. Within the THEORY block these functions can be addressed as funα, where α is the function number, e.g. fun2. + +

    4.3.2 Functions

    +Yet another useful feature is the possibility to define functions in the FUNCTIONS block. Within the THEORY block these functions can be addressed as funα, where α is the function number, e.g. fun2.

    - -

    4.3.3 User Functions

    -In the case complicated and not predefined functions are needed to fit data, musrfit offers the possibility to implement external functions and introduce them to musrfit through the ROOT dictionary mechanism. The detailed rules these user-defined functions have to obey will be discussed in the according section. Here only the syntax for the msr file is provided. + +

    4.3.3 User Functions

    +In the case complicated and not predefined functions are needed to fit data, musrfit offers the possibility to implement external functions and introduce them to musrfit through the ROOT dictionary mechanism. The detailed rules these user-defined functions have to obey will be discussed in the according section. Here only the syntax for the msr file is provided. To call a user function in the THEORY block the keyword userFcn is used. It is followed by the name of the shared library which holds the C++ class where the function is implemented and the name of the class. Finally, all parameters are given in the order needed by the class. Of course it is also possible to use mapped parameters or functions instead of specifying the parameters directly.

    A THEORY block including a user function may then look like @@ -704,9 +781,9 @@ A THEORY block including a user function may then look like ...

    - -

    4.4 The FUNCTIONS Block

    -musrfit utilizes a powerful parser. Therefore, it is possible to define even rather complicated functional relations between the fit parameters and use these in the THEORY block (and in one exceptional case also in the RUN-block). Supported is the use of basic arithmetics:
    + +

    4.4 The FUNCTIONS Block

    +musrfit utilizes a powerful parser. Therefore, it is possible to define even rather complicated functional relations between the fit parameters and use these in the THEORY block (and in one exceptional case also in the RUN-block). Supported is the use of basic arithmetics:
    +
    Addition
    -
    Subtraction
    *
    Multiplication @@ -754,8 +831,8 @@ It follows an example to illustrate the usage of functions in the THEORY block.

    In the case that functions have to be fitted which cannot be defined in the FUNCTIONS block, the functions can be implemented externally and made usable through the userFunc mechanism.

    - -

    4.5 The GLOBAL Block

    + +

    4.5 The GLOBAL Block

    The GLOBAL block is used to collect data which otherwise need to be specified in every single run entry of the RUN block. Therefore, this block is only present to potential shorten the msr-file and to ease the handling for the user. The logic will by like that:
    1. check it the property is found in the RUN block. @@ -771,10 +848,26 @@ The currently supported GLOBAL block entries are:
      • t0
      • addt0
      • fit -
      • packing +
      • rrf_freq (for fittype 1, 3) +
      • rrf_packing (for fittype 1, 3) +
      • rrf_phase (for fittype 1, 3) +
      • packing (for fittype 0, 2, 4)

      -For a detailed discussion of these entries see Sec RUN block. +For a detailed discussion of these entries see Sec RUN block. +

      +The single histo RRF fit and asymmetry RRF fit related entries (fittype 1 and 3 only) have the following syntax: +

      +
      rrf_freq
      Defines the RRF frequency. The exact syntax is rrf_freq <value> <unit> where <value> is the value, and <unit> can be MHz, Mc, and T. An example:
      +rrf_freq 7.2 T
      +
      +
      rrf_packing
      for fittype 1 and fittype 3 rather than giving packing, rrf_packing <pack> has to be provided, e.g.
      +rrf_packing 150
      +
      +
      rrf_phase
      an optional additional RRF phase can be provided (if not provided, the RRF phase will be 0.0). Syntax: rrf_phase <phase>, where the value <phase> is given in degree. Example:
      +rrf_phase 45
      +
      +

      An example snippet with, and without GLOBAL section: With GLOBAL block: @@ -837,18 +930,18 @@ fittype 0 (single histogram fit) ... and many more detectors here ...

      - -

      4.6 The RUN Block

      + +

      4.6 The RUN Block

      The RUN block is used to collect the data needed for a particular run to be fitted. This includes the run name, fit type, data format, etc. The RUN block is slightly differently organized than the other blocks. The information is collected via labels followed by the information. Each run to be fitted has its own RUN block. A RUN block starts with a run-file line which has the structure
          RUN <run_file_name> <beamline> <facility> <file_format>
       

      - +
      - - + + @@ -872,10 +965,10 @@ The RUN block is used to collect the data needed for a particular run to be fitt

      The tokens following the RUN statement are used to identify the run, the potential location where the run might be found, and the file format in which the run data has been saved. In order to understand the meaning of all the above tokens, a short digression is needed.

      - + Where is musrfit looking for data files? There is a specific order how this is done:
      1. Check if the file is found in the current directory -
      2. Check if the path (or multiple paths) was (were) given in the XML startup file. +
      3. Check if the path (or multiple paths) was (were) given in the XML startup file.
      4. Check if there is a system variable MUSRFULLDATAPATH. This system variable can contain multiple search paths separated by colons, e.g.
         export MUSRFULLDATAPATH=/mnt/data/nemu/wkm/:/mnt/data/nemu/his/:/afs/psi.ch/user/s/smith/
         
        @@ -899,8 +992,8 @@ RUN beautiful-data MUE4 PSI DB After this short digression back to the RUN-block description.

        In order to describe the operations needed for fitting and plotting, quite some information are needed. These information are following the RUN statement and are listed below. Depending on the fit type these information vary and hence it is indicated for which fit/plot type the information is applicable. -
        -
        ADDRUN <run_file_name> <beamline> <facility> <file_format> (optional)
        If an ADDRUN is just following after a RUN statement, these runs will be added. More than one ADDRUN statements are possible, i.e. adding up as many runs as wished. It is also possible to add runs with different file formats. If the t0's are given in the data files, the ADDRUN statement is all what is needed, otherwise just add the t0's with the addt0 statement.
        +
        +
        ADDRUN <run_file_name> <beamline> <facility> <file_format> (optional)
        If an ADDRUN is just following after a RUN statement, these runs will be added. More than one ADDRUN statements are possible, i.e. adding up as many runs as wished. It is also possible to add runs with different file formats. If the t0's are given in the data files, the ADDRUN statement is all what is needed, otherwise just add the t0's with the addt0 statement.
        For a 'Single Histogram Fit' or a 'MuMinus Fit' it will be
         addt0 t0AddRun1
        @@ -910,40 +1003,51 @@ etc.
         addt0 t0AddRun1Forward t0AddRun1Backward
         addt0 t0AddRun2Forward t0AddRun2Backward
         etc.
        -
        How will the background and data ranges be handled in this situation? First, the ADDRUN's will be shifted in time such that all the t0's have the same channel/bin number. Subsequently, the runs will be added. The background/data range is applied to this summed up new histogram. ADDRUN is not available for the fit type 'Non-μSR Fit' (sorry no ). + How will the background and data ranges be handled in this situation? First, the ADDRUN's will be shifted in time such that all the t0's have the same channel/bin number. Subsequently, the runs will be added. The background/data range is applied to this summed up new histogram. ADDRUN is not available for the fit type 'Non-μSR Fit' (sorry no ).

        -
        -
        fittype (required)
        This tag is used to indicate which type of fit is wished. The supported fit types are:
        +
        +
        fittype (required if not already defined in the GLOBAL block)
        This tag is used to indicate which type of fit is wished. The supported fit types are:
        0
        Single Histogram Fit +
        1
        Single Histogram RRF Fit (only for online analysis(l) )
        2
        Asymmetry Fit +
        3
        Asymmetry RRF Fit (only for online analysis. See comment added for Single Histogram RRF Fit)
        4
        MuMinus Fit. This is a single histogram fit especially for negative muon μSR
        8
        Non-μSR Fit

        - The description of these fit types can be found in the corresponding section. + The description of these fit types can be found in the corresponding section. + Example:
        +fittype 0
        +

        -
        alpha, beta (fit types 2)
        These parameters are used to correct the asymmetry for different detector efficiencies, solid angles and initial asymmetries. They are defined as α≡N0,b/N0,f and β≡|A0,b/A0,f|. If the parameters are not specified in the RUN block, for each one the value of 1 is assumed. +
        alpha, beta (fit types 2)
        These parameters are used to correct the asymmetry for different detector efficiencies, solid angles and initial asymmetries. They are defined as α≡N0,b/N0,f and β≡|A0,b/A0,f|. If the parameters are not specified in the RUN block, for each one the value of 1 is assumed. Example for alpha is fit parameter number 1:
        +alpha           1
        +

        -
        -
        norm (fit type 0)
        Number of the fit parameter that represents the normalization constant N0 of the histogram; the value of this parameter is given either per nanosecond or per bin (see below). It is possible to substitute the parameter number by a function here (and only here in a RUN block), for instance to relate N0s of different histograms through an α parameter. +
        +
        norm (fit type 0)
        Number of the fit parameter that represents the normalization constant N0 of the histogram; the value of this parameter is given either per nanosecond or per bin (see below). It is possible to substitute the parameter number by a function here (and only here in a RUN block), for instance to relate N0s of different histograms through an α parameter. Example for a norm defined by fit parameter number 12:
        +norm            12
        +
        Example for a norm defined in function number 3:
        +norm            fun3
        +

        -
        backgr.fit (fit type 0)
        Parameter number specifying the constant background in a histogram. Its value is given either per nanosecond or per bin (see below). If this keyword is present, any information on a background line are ignored. +
        backgr.fit (fit type 0)
        Parameter number specifying the constant background in a histogram. Its value is given either per nanosecond or per bin (see below). If this keyword is present, any information on a background line are ignored.

        lifetime (fit type 0)
        Fit parameter representing the lifetime of the muon. If it is not specified the value τμ=2.197019 μs is used in the calculations.

        -
        lifetimecorrection (fit type 0) eek! obsolete eek!
        Does not accept any arguments. If present, the output in musrview is corrected for the exponential decay of the muon. This item is obsolete in the RUN block and will be transferred to the PLOT block, which allows switching between histogram view and asymmetry view much quicker. +
        lifetimecorrection (fit type 0) eek! obsolete eek!
        Does not accept any arguments. If present, the output in musrview is corrected for the exponential decay of the muon. This item is obsolete in the RUN block and will be transferred to the PLOT block, which allows switching between histogram view and asymmetry view much quicker.

        -
        map
        On this line the mapping of run-dependent parameters is done. Parameter numbers given here may be accessed through map1, map2, etc. in the THEORY and FUNCTIONS blocks (see also here). The first ten maps are always present and have the value 0 if not used; however, the total number of maps is not restricted! +
        map
        On this line the mapping of run-dependent parameters is done. Parameter numbers given here may be accessed through map1, map2, etc. in the THEORY and FUNCTIONS blocks (see also here). The first ten maps are always present and have the value 0 if not used; however, the total number of maps is not restricted!

        -
        -
        forward (fit type 0, 4)
        Number of the histogram in the data file to be processed. If histograms shall be grouped, all the numbers which shall be grouped. Examples:
        + 
        +
        forward (fit type 0, 1, 4)
        Number of the histogram in the data file to be processed. If histograms shall be grouped, all the numbers which shall be grouped. Examples:
           forward 3       # no grouping, take histogram number 3
           forward 1 2     # group histogram number 1 and 2
           forward 1-10 12 # group histograms with numbers from 1 to 10 and additionally histogram 12 
        @@ -963,24 +1067,32 @@ etc.
         

        -
        backgr.fix (fit types 0, 2)
        A fixed constant background in counts per nanosecond or per bin (see below) may be given at this point. The background is specified for all histograms in the order Bf Bb [Br Bl]. If this keyword is present, any information on a background line is ignored. +
        backgr.fix (fit types 0, 1, 2)
        A fixed constant background in counts per nanosecond or per bin (see below) may be given at this point. The background is specified for all histograms in the order Bf Bb [Br Bl]. If this keyword is present, any information on a background line is ignored.

        -
        background (fit type 0)
        The numbers of the first and the last channel of an interval from which the constant background should be calculated are specified here. In case histograms are being grouped, the specified channels are interpreted with respect to the first histogram. +
        background (fit type 0, 1)
        The numbers of the first and the last channel of an interval from which the constant background should be calculated are specified here. In case histograms are being grouped, the specified channels are interpreted with respect to the first histogram. Example:
        +background      100     18000
        +

        -
        background (fit types 2)
        The numbers of the first and the last channel of an interval from which the constant background should be calculated are specified here. For all the histograms this is done together in the following order: kf,first kf,last kb,first kb,last [kr,first kr,last kl,first kl,last]. In case histograms are being grouped, the specified channels are interpreted with respect to the first histograms. +
        background (fit types 2)
        The numbers of the first and the last channel of an interval from which the constant background should be calculated are specified here. For all the histograms this is done together in the following order: kf,first kf,last kb,first kb,last [kr,first kr,last kl,first kl,last]. In case histograms are being grouped, the specified channels are interpreted with respect to the first histograms. Example:
        +background      61      184     57      145     
        +

        -
        -
        data (fit type 0, 4)
        The numbers of the first and the last channel of an interval from which the data is taken are specified here. In case histograms are being grouped, the specified channels are interpreted with respect to the first histogram. Typically these channels are referred to as first good bin / last good bin (fgb/lgb). +
        +
        data (fit type 0, 1, 4)
        The numbers of the first and the last channel of an interval from which the data is taken are specified here. In case histograms are being grouped, the specified channels are interpreted with respect to the first histogram. Typically these channels are referred to as first good bin / last good bin (fgb/lgb). Example:
        +data            165     7965    
        +

        -
        data (fit types 2)
        The numbers of the first and the last channel of an interval from which the data is taken are specified here. Typically these channels are referred to as first good bin / last good bin (fgb/lgb). For all the histograms this is done together in the following order: kf,first kf,last kb,first kb,last [kr,first kr,last kl,first kl,last]. In case histograms are being grouped, the specified channels are interpreted with respect to the first histograms. +
        data (fit types 2)
        The numbers of the first and the last channel of an interval from which the data is taken are specified here. Typically these channels are referred to as first good bin / last good bin (fgb/lgb). For all the histograms this is done together in the following order: kf,first kf,last kb,first kb,last [kr,first kr,last kl,first kl,last]. In case histograms are being grouped, the specified channels are interpreted with respect to the first histograms. Example:
        +data            207     7994    167     8009    
        +

        -
        -
        t0 (fit type 0, 4)
        The number of the time-zero channel of the histogram. Example:
        + 
        +
        t0 (fit type 0, 1, 4)
        The number of the time-zero channel of the histogram. Example:
           t0 3419        # t0 channel = 3419
           t0 3419 3434   # t0 channels for groupings: forward f1 f2. 3419 t0 for f1, 3434 t0 for f2. 
         
        @@ -992,28 +1104,28 @@ etc.

        -
        -
        addt0 (fit type 0, 4)
        The number of the time-zero channel of the histogram. If grouping of histograms is present (see forward) the same syntax as for t0 applies. If one addt0 is given, the total number of addt0's needs to be equal to the total number of ADDRUN's! +
        +
        addt0 (fit type 0, 1, 4)
        The number of the time-zero channel of the histogram. If grouping of histograms is present (see forward) the same syntax as for t0 applies. If one addt0 is given, the total number of addt0's needs to be equal to the total number of ADDRUN's!

        -
        addt0 (fit types 2)
        The numbers of time-zero channels of the histograms in the order t0,f t0,b [t0,r t0,l]. If grouping of histograms is present (see forward) the same syntax as for t0 applies. If one addt0 is given, the total number of addt0's needs to be equal to the total number of ADDRUN's! +
        addt0 (fit types 2)
        The numbers of time-zero channels of the histograms in the order t0,f t0,b [t0,r t0,l]. If grouping of histograms is present (see forward) the same syntax as for t0 applies. If one addt0 is given, the total number of addt0's needs to be equal to the total number of ADDRUN's!

        xy-data (fit type 8)
        Specification of the data from an ASCII or DB file which should be used as x and y data (in this order). For a simple ASCII file the column numbers are used, in the case of a DB file one can either specify the variable numbers or the name of the variables as given in the DB header.

        -
        fit
        The range of data that should be considered when the fitting is done. For the μSR fit types 0, 2, and 4 here the starting and end times are given in microseconds. For the non-μSR fit type 8 the starting and end points of the fitting range are given in the units of the x data.
        In case the fit range specified here is larger than the data range (in any direction), eventually the data range will be used as fit range. An example for a μSR fit:
        +
        fit
        The range of data that should be considered when the fitting is done. For the μSR fit types 0, 2, and 4 here the starting and end times are given in microseconds. For the non-μSR fit type 8 the starting and end points of the fitting range are given in the units of the x data.
        In case the fit range specified here is larger than the data range (in any direction), eventually the data range will be used as fit range. An example for a μSR fit:
         fit 0.2 8.5
         
        Which means that the fitting window will span from 0.2 to 8.5 microseconds.
        Another possibility for the μSR fits is to give the fit range in bins, rather than time. The syntax is then:
        fit fgb+<n0> lgb-<n1>,
        where fgb and lgb are label tags which refer to the 'first good bin' and the 'last good bin' defined either in the data tag of the run block, data file, are estimated based on T0. <n0> and <n1> are offsets (given in bins) allowing to change the fit window compared to the data window. An example:
        fit fgb+150 lgb-1332

        -
        packing
        Number of data channels to be binned together. For the non-μSR fit type 8 the binning is supposed to be 1. +
        packing
        Number of data channels to be binned together. For the non-μSR fit type 8 the binning is supposed to be 1. For the single histogram RRF fit (fittype 1) and asymmetry RRF fit (fittype 3) this parameter is meaningless.

        - -

        4.7 The COMMANDS Block

        + +

        4.7 The COMMANDS Block

        The COMMANDS block is used to specify the commands which are passed from musrfit to MINUIT2. The supported commands after the COMMANDS keyword are STRATEGY, MIGRAD, SIMPLEX, MINIMIZE, MINOS, HESSE, SAVE, some additional commands described below, and for compatibility reasons SET BATCH and END RETURN. The last two commands may appear in the COMMANDS block but are simply ignored. -A detailed description of all of these commands can be found in the MINUIT2 users guide pdf. +A detailed description of all of these commands can be found in the MINUIT2 users guide pdf.

        A standard COMMANDS block then looks like this:
            COMMANDS
        @@ -1052,7 +1164,7 @@ It is important to understand that before MINOS is called, all
         

        For even more complex fitting the additional command FIT_RANGE RESET | tstart tend | ts1 te1 ts2 te2 ... tsn ten is provided. It allows to change the fit range during different iterations. The command FIT_RANGE tstart tend changes the current fit range for all the runs present in the msr file. FIT_RANGE RESET will restore to the original fit ranges as provided in the RUN block. If for each run of the msr file an individual fit range should be used, the third option applies. Here n has to correspond to the number of runs in the RUN block.

        -As for the run block, there is a 2nd flavor how the FIT_RANGE can be changed, namely giving the fit range in bins, i.e. FIT_RANGE RESET | fgb+<n0> lgb-<n1> | fgb+<n00> lgb-<n01> fgb+<n10> lgb-<n11> ... fgb+<nN0> lgb-<nN1> where N is the number of available run blocks. The idea is inline with the above syntax and the syntax describe for the fit range (fit) of the RUN block. +As for the run block, there is a 2nd flavor how the FIT_RANGE can be changed, namely giving the fit range in bins, i.e. FIT_RANGE RESET | fgb+<n0> lgb-<n1> | fgb+<n00> lgb-<n01> fgb+<n10> lgb-<n11> ... fgb+<nN0> lgb-<nN1> where N is the number of available run blocks. The idea is inline with the above syntax and the syntax describe for the fit range (fit) of the RUN block.

        A typical example could look like:
            COMMANDS
        @@ -1073,10 +1185,10 @@ A typical example could look like:
            SAVE
         

        - + The last accepted command in the COMMAND block is SCALE_N0_BKG TRUE | FALSE. This command is only used in conjunction with single-histogram fits. The default is SCALE_N0_BKG TRUE which will result in a scaling of N(t) such that it is given in ns-1, whereas with SCALE_N0_BKG FALSE no scaling is performed and N(t) will be given in bin-1. If the command is not present at all, it will be interpreted as if SCALE_N0_BKG TRUE was present.

        - + For debug purposes it is possible to force MINUIT2 to print out additional informations. The COMMAND block command is PRINT_LEVEL <n>, where <n> can have the values 0,1,2, or 3. A typical example could look like:
           COMMANDS
           MIGRAD
        @@ -1087,13 +1199,13 @@ For debug purposes it is possible to force MINUIT2 to print out additional infor
         
        Here the MINOS command will print out lot of additional information to the standard output. Notice there are 2 SAVE commands here. This will write the result of MIGRAD to the MINUIT2.OUTPUT file and at the end append the MINOS results to this file.

        - -

        4.8 The FOURIER Block

        -The Fourier transform is done and the results are plotted within musrview —as input data the actual data shown in musrview is used. In the FOURIER block of the msr file all necessary parameters for calculating and presenting the Fourier transform of the data specified in the PLOT block is given. If the FOURIER block is not present in the msr file, either the parameters set in the XML startup file or the system defaults are taken when the Fourier transform is performed. The block starts with the FOURIER keyword and may contain the following entries on the successive lines:
        + +

        4.8 The FOURIER Block

        +The Fourier transform is done and the results are plotted within musrview —as input data the actual data shown in musrview is used. In the FOURIER block of the msr file all necessary parameters for calculating and presenting the Fourier transform of the data specified in the PLOT block is given. If the FOURIER block is not present in the msr file, either the parameters set in the XML startup file or the system defaults are taken when the Fourier transform is performed. The block starts with the FOURIER keyword and may contain the following entries on the successive lines:
        units
        Here is specified in which domain the Fourier-transformed data is presented. One may choose between the fields (Gauss) or (Tesla), the frequency (MHz), and the angular-frequency domain (Mc/s).
        fourier_power
        It is possible (but not necessary) to set the number of data points used for the Fourier transform here. As argument the exponent n<21 of a power of 2 is accepted. The number of data points is then 2n. Attention: If the number of points given here is bigger than the actual number of available data points, the input data vector is filled with zeros until the number of requested points is reached (zero padding)!
        dc-corrected
        a flag to remove a potential DC-offset of the signal. Allowed entries are dc-corrected true | 1 | false | 0. -
        apodization
        Here is decided if the data should be apodized before the Fourier transform is done and if yes, which apodization should be used (for further details about apodization of μSR data refer to the PhD thesis of T.M. Riseman). The argument to be put after the keyword is therefore one of the following: NONE, WEAK, MEDIUM or STRONG. If the data should be apodized, they are manipulated as follows: each data value is multiplied by the function \sum_{j=0}^4 c_j \left(\frac{i}{n}\right)^{2j}, where i is the data-point index and n is the total number of data points. The coefficients c_j for the different apodizations are given by:
        +
        apodization
        Here is decided if the data should be apodized before the Fourier transform is done and if yes, which apodization should be used (for further details about apodization of μSR data refer to the PhD thesis of T.M. Riseman). The argument to be put after the keyword is therefore one of the following: NONE, WEAK, MEDIUM or STRONG. If the data should be apodized, they are manipulated as follows: each data value is multiplied by the function \sum_{j=0}^4 c_j \left(\frac{i}{n}\right)^{2j}, where i is the data-point index and n is the total number of data points. The coefficients c_j for the different apodizations are given by:
        WEAK
        c_0 = 1,\, c_1 = -1.319391,\, c_2 = 0.703484,\, c_3=c_4=0
        MEDIUM
        c_0 = 1,\, c_1 = -1.831292,\, c_2 = 0.983734,\, c_3=c_4=0
        STRONG
        c_0 = 1,\, c_1 = -2.708894,\, c_2 = 2.953575,\, c_3=-1.599128,\, c_4=0.399782 @@ -1124,8 +1236,16 @@ Altogether, a possible FOURIER block might look like that:

        - -

        4.9 The PLOT Block

        +Notes +

        + l : for a more detailed discussion about the shortcomings of RRF fits see the RRF memo found under <musrfit>/doc/memo/rrf +

        +

        +

        +
        +

        + +

        4.9 The PLOT Block

        The PLOT block is intended to collect all the information needed for the graphical presentation of the data and fits using musrview. The PLOT keyword at the beginning of the block is followed by a number which indicates the plot type. The plot types match the fit types. Additionally, it is possible to provide information using the following keywords:
        lifetimecorrection
        Does not accept any arguments. If present, the output in musrview is corrected for the exponential decay of the muon. Only relevant for (type 0).
        runs
        The numbers of the runs to be plotted have to be put here. The runs are numbered according to their appearance in the RUN block. @@ -1137,12 +1257,12 @@ The PLOT block is intended to collect all the information needed for the graphic
        sub_ranges
        Here it is possible to define the plotting range for each run individually. For the different plot types the command has the structure
        0 without lifetimecorrection, 4
        tmin1 tmax1 tmin2 tmax2 ... tminn tmaxn [ Nmin Nmax ] (n = the number of runs to be plotted)
        0 with lifetimecorrection, 2
        tmin1 tmax1 tmin2 tmax2 ... tminn tmaxn [ Amin Amax ] (n = the number of runs to be plotted) -
        8
        not yet implemented. +
        8
        not yet implemented.
        use_fit_ranges [ ymin ymax]
        The fit ranges of the individual runs are used to present the data. Optionally, an ordinate range can be provided.
        view_packing
        The data are presented in the packing given here rather than the binning used for the fit. WARNING: This is a global option and applies to all PLOT-blocks. -
        logx
        Will present the time axis in a logarithmic scale. So far no checking of negative and zero-valued data is performed wink -
        logy
        Will present the axis of ordinates in a logarithmic scale. So far no checking of negative and zero-valued data is performed wink +
        logx
        Will present the time axis in a logarithmic scale. So far no checking of negative and zero-valued data is performed wink +
        logy
        Will present the axis of ordinates in a logarithmic scale. So far no checking of negative and zero-valued data is performed wink
        rrf_packing value
        In the rotating-reference-frame (RRF) representation, this will be the value for the packing. WARNING: For the time being, this is a global option and applies to all PLOT blocks.
        rrf_freq value unit
        This entry provides the RRF "frequency" given by the value and the unit which can be: kHz, MHz, Mc/s, G, or T.
        rrf_phase value
        A phase of the RRF can be provided, either as a value in degrees, or as a parX, e.g. par4, where X is supposed to be the phase parameter number in the FITPARAMETER block. @@ -1163,37 +1283,49 @@ The PLOT block is intended to collect all the information needed for the graphic rrf_packing 75

        - -

        4.10 The STATISTIC Block

        + +

        4.10 The STATISTIC Block

        The STATISTIC block is the last block of a msr file. It contains some information on the fit: the date and time as well as the absolute and normalized values of χ2 and the number of degrees of freedom in the fit.
        -If enabled in the XML file for χ2-single-histogram fits also Pearson's χ2 will be written to the STATISTIC block.
        +If enabled in the XML file for χ2-single-histogram fits also Pearson's χ2 will be written to the STATISTIC block.
        These information only have a meaning if the fitting procedure has been executed at least once and the fit has converged!

        - -

        5 The Fit Types

        + +

        5 The Fit Types

        - -

        5.1 Single Histogram Fit

        + +

        5.1 Single Histogram Fit

        The single-histogram fit (fit type 0) is used to fit a function directly to the raw data using
        -N(t)=N_0\,\mathrm{e}^{-t/\tau_{\mu}} \left[1 + A(t)\right] + B. +N(t)=N_0\,\mathrm{e}^{-t/\tau_{\mu}} \left[1+A(t)\right]+N_{\rm bkg}.
        The parameters are given by:
        N(t)
        rebinned decay histogram
        N_0
        normalization constant of the histogram (RUN block: norm)
        \tau_{\mu}
        lifetime of the muon (RUN block: lifetime) -
        B
        constant background (RUN block: backgr.fit or background) +
        N_{\rm bkg}
        constant background (RUN block: backgr.fit or background)
        A(t)
        decay asymmetry/depolarization function as given in the THEORY block

        In the plot type 0 without lifetimecorrection the rebinned histogram and the function N(t) written above are presented. -If the option lifetimecorrection is set in the RUN block the asymmetry is plotted: +If the option lifetimecorrection is set in the PLOT block the asymmetry is plotted:
        -A(t)=\frac{N(t)-B}{N_0\,\mathrm{e}^{-t/\tau_{\mu}}}-1 +A(t)=\frac{N(t)-N_{\rm bkg}}{N_0\,\mathrm{e}^{-t/\tau_{\mu}}}-1

        - -

        5.2 Asymmetry Fit

        + +

        5.2 Single Histogram RRF Fit

        +The single-histogram RRF fit (fit type 1) is used to fit the rotating reference frame asymmetry A_{\rm rrf}(t) extracted from the raw data. The currently implemented version will fail at low fields/frequencies (for about < 1 Tesla). The same is true, if multiple frequencies with large enough separation are present, e.g. when dealing with muonium. A_{\rm rrf}(t) is estimated the following way (for more details see the RRF memo):
          +
        1. define the background N_{\rm bkg}, and subtract it from the raw histogram. +
        2. calculate the property M(t) = [N(t)-N_{\rm bkg}] \exp(+t/\tau). +
        3. estimate N_0. This is the most tricky part. From this calculate A(t) = M(t)/N_0 -1. +
        4. now the RRF transformation takes place: A_{\rm rrf}(t) = 2 \cos(\omega_{\rm rrf} t + \phi_{\rm rrf}) A(t). In Fourier space this is leading to [A(\omega-\omega_{\rm rrf})+A(\omega+\omega_{\rm rrf})]. +
        5. in order to get rid if the A(\omega+\omega_{\rm rrf}) component, A_{\rm rrf}(t) is over-binned by the rrf_packing. This results in a signal \langle A_{\rm rrf}(t) \rangle_{p} which ideally is A(t) shifted down in frequency by \omega_{\rm rrf}. +
        +

        +The single histogram RRF fit was introduced for online analysis only. It is leading to many uncontrolled effects like ghost lines due to imperfection of the N_0 estimate, line shape distortion due to dispersive filtering originating from the packing, back folding problems if \omega_{\rm rrf} is not properly chosen, etc. In summary: if you not urgently need it: do not use it! There are better ways to deal with the analysis of high frequency data! +

        + +

        5.3 Asymmetry Fit

        For an asymmetry fit (fit type 2) two histograms are needed. These are given by the forward and backward keywords in the RUN block. Additionally, the parameters alpha and beta which relate the detector efficiencies, solid angles and initial asymmetries of the two detectors can be supplied. The constant background for the two histograms is either given by background-determined intervals or specified through backgr.fix in the RUN-block. @@ -1225,23 +1357,27 @@ For the graphical representation in plot type 2 the equation ab and plotted together with the function given in the THEORY block.

        - -

        5.3 Negative Muon μSR Fit

        + +

        5.4 Asymmetry RRF Fit

        +In a first step, the unbinned asymmetry is formed as described for the asymmetry fit. Afterwards the RRF transformation is carried out, i.e. point 4. and 5. as sketched in the single histogramm RRF fit. The same reservations as for the single histogram RRF fit apply: if you not urgently need it: do not use it! There are better ways to deal with the analysis of high frequency data! +

        + +

        5.5 Negative Muon μSR Fit

        The negative muon μSR fit (fit type 4) is used for single histogram fits of MuMinus, i.e.
        -N(t) = \sum_i N_i\,\mathrm{e}^{-t/\tau_i} \left[ 1 + A_i(t)\right] + B(t) +N(t) = \sum_i N_i\,\mathrm{e}^{-t/\tau_i} \left[ 1 + A_i(t)\right] + N_{\rm bkg}(t)
        where i runs over the different lifetime channels of \mu^{-}, and
        N_i
        counts of lifetime channel i
        \tau_i
        lifetime of lifetime channel i
        A_i(t)
        depolarization function of lifetime channel i -
        B(t)
        B(t)= B_0 + \sum_j B_j \cos(j \omega_{\rm cyclotron} t) the background +
        N_{\rm bkg}(t)
        N_{\rm bkg}(t)= N_{\rm bkg,0} + \sum_k N_{\rm bkg,k} \cos(k \omega_{\rm cyclotron} t) the background

        Since MuMinus is quite generic, the full functional depends has to be written in the THEORY Block.

        - -

        5.4 Non-μSR Fit

        + +

        5.6 Non-μSR Fit

        In the case of a non-μSR fit (fit type 8) the fitting function is
        y=f(x), @@ -1253,11 +1389,11 @@ where

        The same is valid for the plot with plot type 8.

        - -

        6 User Functions

        + +

        6 User Functions

        musrfit offers the possibility to plug-in user-defined functions implemented in C++ classes to the fitting and plotting routines. In order to do so, basically two things are needed:
        1. a shared library containing the compiled class with the defined function -
        2. a ROOT dictionary that contains information about the functions in the shared library +
        3. a ROOT dictionary that contains information about the functions in the shared library

        There are two possible ways to implement user functions and both will be explained below:
          @@ -1267,8 +1403,8 @@ There are two possible ways to implement user functions and both will be explain

          Since the first is simpler this will be explained using an explicit example, before it is discussed why the second option is needed and how it can be used.

          - -

          6.1 User Function without global user-function-object access

          + +

          6.1 User Function without global user-function-object access

          In the following it is explained in detail how the implementation of a user function is done using the simple example of fa(x) = sin(ax)/ax, where the parameter a should be determined by the fit. Although not necessary for this simple example, the source code is split into two parts, namely a header file TMyFunction.h containing the class declaration and a second file TMyFunction.cpp including the function implementation.

          @@ -1309,7 +1445,7 @@ public:

          In the header file above the constructor (destructor) of the class is empty. This is not necessary. Any code that should be executed when the RUN block is read and the class object is created (destroyed) may be implemented in the constructor (destructor). Another peculiarity is the ClassDef statement at the end of the class definition. It is needed for the ROOT dictionary generation and has as arguments the class name and a revision number.

          -Please also be aware of the const-ness of the operator(). For an introductory discussion on that topic look for example here and the links herein. +Please also be aware of the const-ness of the operator(). For an introductory discussion on that topic look for example here and the links herein.

          The actual implementation of the user function is done in the second source file. In this example it only contains the definition of the function operator() declared in the header file and might look like:

          @@ -1327,7 +1463,7 @@ ClassImp(TMyFunction) // for the ROOT dictionary Double_t TMyFunction::operator()(Double_t x, const vector<Double_t> &par) const { assert(par.size()==1); // make sure the number of parameters handed to the function is correct - Double_t arg(par[0]*x); + Double_t arg(par[0]*x); if(!arg) return 1.0; @@ -1357,22 +1493,22 @@ What is further needed for the ROOT dictionary is a so-called LinkD #endif //__CINT__

        -For compiling and linking it is wise to use a Makefile as for example the attached Makefile.TMyLibrary. It assumes standard ROOT and musrfit installations and defines rules for the generation of the shared library libTMyLibrary.so including the class and the ROOT dictionary. +For compiling and linking it is wise to use a Makefile as for example the attached Makefile.TMyLibrary. It assumes standard ROOT and musrfit installations and defines rules for the generation of the shared library libTMyLibrary.so including the class and the ROOT dictionary. In order to get the library built and installed on the standard ROOT path just call:
         make -f Makefile.TMyLibrary
         make -f Makefile.TMyLibrary install
         
        -In case of a custom installation some paths in the Makefile might have to be changed. For further information about the ROOT dictionary mechanism please refer to the documentation. +In case of a custom installation some paths in the Makefile might have to be changed. For further information about the ROOT dictionary mechanism please refer to the documentation.

        After installing the shared library the defined user function might be used in musrfit as described above.

        -Good luck! wink +Good luck! wink

        Finally, please be aware of the remark at the end of this section.

        - -

        6.2 User Function with global user-function-object access

        + +

        6.2 User Function with global user-function-object access

        Before explaining how to use global objects within user functions, it will be shortly explained where is problem and why this might be a sensible approach. In musrfit each RUN block (histogram, asymmetry, ...) is owning its own theory-function tree. An example is shown in the figure below. The bluish nodes are @@ -1380,8 +1516,8 @@ default musrfit functions, whereas the red nodes represent user fun are independent entities. This means if the msr file contains n run blocks, the user function uF1 will be called n times for each step in the calculation. If the user function is performing CPU-demanding calculations this is rather inefficient.

        - -theory tree with user function and <strong>global</strong> user function objects + +theory tree with user function and  global  user function objects

        Therefore, it is possible to associate to each user function (uFx) a global user-function object (g_uFx). The idea is the following: If uFx needs to perform very time-consuming calculations (e.g. calculate an Abrikosov vortex lattice or the nonlocal response of a superconductor in the Meissner state) this can be @@ -1389,7 +1525,7 @@ transferred to the global user-function object (g_uFxg_uFx), thus speeding up the fit.

        After explaining the purpose of the global user-function-object approach, some explanations how to interface it follow here. Since the interface is very close to -the user function without global objects, only the additionally necessary overhead is explained here. +the user function without global objects, only the additionally necessary overhead is explained here.

        The user's header file could look like the following:
        @@ -1472,18 +1608,18 @@ void TMyFunction::SetGlobalPart(vector<void *> &globalPart, UInt
               cerr << endl << ">> TMyFunction::SetGlobalPart(): **ERROR** Couldn't invoke global user function object, sorry ..." << endl;
             } else {  // global user function object could be invoked -> resize to global user function vector and keep the pointer to the corresponding object
               globalPart.resize(fIdxGlobal+1);
        -      globalPart[fIdxGlobal] = dynamic_cast<TMyGlobalFunction*>(fGlobalUserFcn);
        +      globalPart[fIdxGlobal] = dynamic_cast<TMyGlobalFunction*>(fGlobalUserFcn);
               fValid = true;
               fInvokedGlobal = true;
             }
           } else { // global user function already present hence just retrieve a pointer to it
             fValid = true;
        -    fGlobalUserFcn = (TMyGlobalFunction*)globalPart[fIdxGlobal];
        +    fGlobalUserFcn = (TMyGlobalFunction*)globalPart[fIdxGlobal];
           }
         }
         

        -What it does is the following: it first checks if the object is already present in the global user-function-object vector and if not creates it. If it is already present, the pointer to the global object vector is just kept (see figure above). +What it does is the following: it first checks if the object is already present in the global user-function-object vector and if not creates it. If it is already present, the pointer to the global object vector is just kept (see figure above).

        A sketch of the method operator()(Double_t, const vector&) const will then look like (pseudo-code snippet):

        @@ -1513,110 +1649,44 @@ Double_t TMyFunction::operator()(Double_t t, const vector<Double_ This way the efficiency of the user function can be increased by almost a factor of n (where n is the number of RUN blocks).


        - -Important remark: If musrfit has been built with parallelization support (default for GCC ≥ 4.2) it should be taken care of the thread safety of the user-function operator(). During the function optimization of musrfit the operator() is called once for any given set of parameters in order to allow the safe execution of any calculation. Within the single-histogram and asymmetry fits the calculation of χ2 or the log-likelihood is parallelized and the operator() is expected to evaluate to reasonable values for a fixed set of parameters (but changing t) beginning with the second function call. + +Important remark: If musrfit has been built with parallelization support (default for GCC ≥ 4.2) it should be taken care of the thread safety of the user-function operator(). During the function optimization of musrfit the operator() is called once for any given set of parameters in order to allow the safe execution of any calculation. Within the single-histogram and asymmetry fits the calculation of χ2 or the log-likelihood is parallelized and the operator() is expected to evaluate to reasonable values for a fixed set of parameters (but changing t) beginning with the second function call. In case this cannot be ensured, the parallelization can be disabled by --disable-omp on the configure level of the program installation.

        - -

        7 Technical Description of the musrfit framework

        + +

        7 Technical Description of the musrfit framework

        -A technical description of the musrfit framework can be found here. +A technical description of the musrfit framework can be found here.

        - -

        8 Bugtracking

        + +

        8 Bugtracking

        +

        +For reporting bugs or requesting new features and improvements please use the bitbucket-repo (preferred), PSI Tracker or send an e-mail to A. Suter. +

        +-- AS & BMW

        -For reporting bugs or requesting new features and improvements please use the bitbucket-repo (preferred), PSI Tracker or send an e-mail to A. Suter.

        --- AS & BMW -
        - - - - - - - -
        - -
        - Edit | Attach | Print version | PDF | History: r117 < r116 < r115 < r114 | Backlinks | View wiki text | Refresh | More topic actions -
        -
        Topic revision: r117 - 18 Dec 2014, AndreasSuter
        - - - -
         
        -
        -
        -
      RUN-block tag comment RUN-block tag comment
      - -
      -

        -
      • -
      • -
      -

      -

      -

      -
      -
    -
    -
    Ideas, requests, problems regarding PSI Wiki? Send feedback
    +
    This topic: MUSR > WebHome > MusrFit
    +Topic revision: 22 Jan 2016, AndreasSuter
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/MusrFitAcknowledgements.html b/doc/html/user/MUSR/MusrFitAcknowledgements.html index 927d0854..0be5b6c5 100644 --- a/doc/html/user/MUSR/MusrFitAcknowledgements.html +++ b/doc/html/user/MUSR/MusrFitAcknowledgements.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: MusrFitAcknowledgements - + MUSR :: MusrFitAcknowledgements + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + +
-
+
-
-
-

-

- - - -

-

-

-

-

Acknowledgements - musrfit

+
+
+

Acknowledgements - musrfit

-
Bastian M. Wojek
I am very much indebted to BMW for his rigorous testing of musrfit, his many useful suggestions, contributions, and for the largest part of the user manual of musrfit which makes it accessible to a broader audience! Many thanks Bastian! -
+
Bastian M. Wojek
I am very much indebted to BMW for his rigorous testing of musrfit, his many useful suggestions, contributions, and for the largest part of the user manual of musrfit which makes it accessible to a broader audience! Many thanks Bastian! +
+

--- BMW & AS
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r4 < r3 < r2 < r1 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r4 - 10 Jul 2011, wojek
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
This topic: MUSR > WebHome > MusrFit > MusrFitAcknowledgements
+Topic revision: 03 Jul 2015, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/MusrFitSetup.html b/doc/html/user/MUSR/MusrFitSetup.html index bdc0e1e6..cdfcd17d 100644 --- a/doc/html/user/MUSR/MusrFitSetup.html +++ b/doc/html/user/MUSR/MusrFitSetup.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: MusrFitSetup - + MUSR :: MusrFitSetup + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + + + + +
-
+
-
-
+
+
+

Setting up musrfit on Different Platforms

-

- - - -

-

-

-

-

Setting up musrfit on Different Platforms

-

-

-

1 Supported Operating Systems and Software Requirements

+

1 Supported Operating Systems and Software Requirements

-This page is intended to demonstrate for the interested user which steps are necessary to set up the free software μSR data analysis framework musrfit. While the preferred way is to run the software on GNU/Linux, with some restrictions it can also be set up under MS Windows and MacOS X. In case musrfit should be installed according to the description found on this page, the user is strongly encouraged to read completely each section dealing with the present installation step before starting the installation process! +This page is intended to demonstrate for the interested user which steps are necessary to set up the free software μSR data analysis framework musrfit. While the preferred way is to run the software on GNU/Linux or MacOS X, with some restrictions it can also be set up under MS Windows (cygwin, only for the very brave, probably it is easier for most MS Windows users to install a Virtual Machine running Linux). In case musrfit should be installed according to the description found on this page, the user is strongly encouraged to read completely each section dealing with the present installation step before starting the installation process!

- -Apart from GCC, the GNU Compiler Collection, the GNU build tools autoconf, automake and libtool as well as the helper tool pkg-config musrfit requires the installation of a few open-source libraries and programs:
-
boost C++ libraries
The powerful Spirit parser framework used by musrfit is included in that collection of libraries. Required version ≥ 1.33 -
GNU Scientific Library
A numerical C and C++ library which provides efficient implementations of various mathematical routines. Required version ≥ 1.9 -
FFTW
A C implementation for the fast computation of discrete Fourier transforms. Required version ≥ 3.1 -
ROOT
A C++ data analysis framework developed at CERN. Required version ≥ 5.22 -
libxml2
The XML C parser and toolkit of Gnome. Required version ≥ 2.0 -
+ +Apart from GCC, the GNU Compiler Collection (gcc, g++), the GNU build tools autoconf, automake and libtool as well as the helper tool pkg-config musrfit requires the installation of a few open-source libraries and programs including their header packages: + $ boost C++ libraries: The powerful Spirit parser framework used by musrfit is included in that collection of libraries. Required version ≥ 1.33 + $ GNU Scientific Library: A numerical C and C++ library which provides efficient implementations of various mathematical routines. Required version ≥ 1.9 + $ FFTW: A C implementation for the fast computation of discrete Fourier transforms. Required version ≥ 3.1 + $ ROOT: A C++ data analysis framework developed at CERN. Required version ≥ 5.22 + $ libxml2: The XML C parser and toolkit of Gnome. Required version ≥ 2.0

- -Additionally, only if musrfit should support reading of data files in the NeXus format the following libraries are needed:
-
HDF4
A library and multi-object file format for storing and managing data. -
HDF5
A data model, library, and file format for storing and managing data. -
minixml
A small XML library that can be used to read and write XML and XML -like data files. Required version ≥ 2.2 -
NeXus
A common data format for neutron, x-ray, and muon science. -
+ +Additionally, only if musrfit should support reading of data files in the NeXus format the following libraries are needed: + $ HDF4: A library and multi-object file format for storing and managing data. + $ HDF5: A data model, library, and file format for storing and managing data. + $ minixml: A small XML library that can be used to read and write XML and XML -like data files. Required version ≥ 2.2 + $ NeXus: A common data format for neutron, x-ray, and muon science.

-If optionally the editor and graphical user interface musrgui / musredit is going to be installed there is one further requirement:
-
Qt
A cross-platform application and user interface framework. Required version ≥ 3.3 & ≪ 4.0 (musrgui) OR ≥ 4.6 (musredit) -
+If optionally the editor and graphical user interface musrgui / musredit is going to be installed there is one further requirement: + $ Qt: A cross-platform application and user interface framework. Required version ≥ 3.3 & ≪ 4.0 (musrgui) OR ≥ 4.6 (musredit)

Each of the following sections focusing on the installation of musrfit on the different operating systems will also give a brief introduction on the installation of the requirements before the actual musrfit installation is described.

-

2 OS Restrictions

+

2 OS Restrictions

Before the further installation will be described, please note the following restrictions:
GNU/Linux
No serious problems are known at the moment.
MS Windows
The setup of musrfit (including the requirements) using Visual C++ has not been tested. If anybody likes to do this: Just go ahead and have fun! However, not very much assistance can be expected, although it would be an interesting experiment. -
Mac OS X
On 10.6 Snow Leopard Qt3 for Mac is not supported any more since this was based on a 32-bit only API. Snow Leopard -users are advised to use the Qt4 based musredit or to rely on the standard Qt3 version for X11 in order to run musrgui. +
Mac OS X
On 10.6 Snow Leopard Qt3 for Mac is not supported any more since this was based on a 32-bit only API. Snow Leopard -users are advised to use the Qt4 based musredit or to rely on the standard Qt3 version for X11 in order to run musrgui. On newer Mac OS X versions (>= 10.8) you should use the Qt4 base musredit only.

-

3 GNU/Linux

-

3.1 Requirements

-

3.1.1 Everything but ROOT and NeXus

+

3 GNU/Linux

+

3.1 Requirements

+

3.1.1 Everything but ROOT and NeXus

Depending on the GNU/Linux distribution chosen, the above mentioned software—except the ROOT system and the NeXus library—should be available from the distributor and could be easily installed in the form of binary packages. If done in this way there should be taken care of installing both, the libraries and the header (dev, devel) files.
-On a Scientific Linux (Red Hat) system the following command executed as superuser from the shell will do the trick: +On a Scientific Linux (Red Hat, other RPM-package base Linux distributions) system the following command executed as superuser from the shell will do the trick (never type the '$' it is the shell prompt of your system):
-yum install git boost-devel gsl-devel fftw-devel libxml2-devel qt-devel qtwebkit-devel
+$ yum install git boost-devel gsl-devel fftw-devel libxml2-devel qt-devel qtwebkit-devel
 
-When dealing with a distribution that uses the dpkg/apt package manager like Debian or Ubuntu the installation would look like: +When dealing with a distribution that uses the dpkg/apt package manager like Debian or Ubuntu the installation would look like:
-apt-get install git libboost-dev libgsl0-dev libfftw3-dev libxml2-dev libqt4-dev libqtwebkit-dev
+$ apt-get install git libboost-dev libgsl0-dev libfftw3-dev libxml2-dev libqt4-dev libqtwebkit-dev
 
-Everyone should know best himself which is the way to install distribution software on the chosen distribution wink +Everyone should know best himself which is the way to install distribution software on the chosen distribution wink

In case the distribution does not include the required software it has to be compiled from the source files which normally means to download the source code from the corresponding website, to unpack the source tree and call the following from the shell:
-./configure
-make
-make install
+$ ./configure
+$ make
+$ make install
 
In order to obtain some information about the possible options for the installation, calling ./configure --help might give some useful hints.
For any further information on the standard installation of software, please refer to the web search engine of choice and ask for "install software on linux"...

-

3.1.2 Installation of NeXus requirements (optional)

-Only if musrfit should support reading data files in the NeXus format the further required software has to be set up. The required libraries and header files could either be available through the user's GNU/Linux distribution or if this is not the case, the packages can be installed from the source code. E.g. on Red Hat-like systems binary packages for MXML, HDF4, and HDF5 might be called mxml, mxml-devel, hdf, hdf-devel, hdf5, hdf5-devel, on Debian-like systems libmxml1, libmxml-dev, libhdf4-dev, libhdf5-dev. +

3.1.2 Installation of NeXus requirements (optional)

+Only if musrfit should support reading/writing data files in the NeXus format the further required software has to be set up. The required libraries and header files could either be available through the user's GNU/Linux distribution or if this is not the case, the packages can be installed from the source code. E.g. on Red Hat-like systems binary packages for MXML, HDF4, and HDF5 might be called mxml, mxml-devel, hdf, hdf-devel, hdf5, hdf5-devel, on Debian-like systems libmxml1, libmxml-dev, libhdf4-dev, libhdf5-dev.

-Even though there might exist binary packages for the NeXus library, it is best to build and install it directly from the source code which can be found here. +Even though there might exist binary packages for the NeXus library, it is best to build and install it directly from the source code which can be found here.

-

3.1.3 ROOT

-Currently only ROOT 5.34/xx is support! Do NOT try to use ROOT 6.xx/yy! +

3.1.3 ROOT

+Currently only ROOT 5.34/xx is support! Do NOT try to use ROOT 6.xx/yy yet!

-The ROOT system may or may not be part of the GNU/Linux distribution. If it is, it should be checked that the provided binaries are of a recent version and then these in principle can be installed using a package manager as described above.
-In case the distribution provides no or only outdated binary packages there are the following possibilities:
    -
  • Visit the ROOT web page and download the packed precompiled binary version matching best the GNU/Linux distribution. Then unpack the bundle to its final destination. -
  • If there is no precompiled binary version of ROOT available for your system or e.g. ROOT should be compiled with another version of GCC visit the web page and download the 'complete source tree for all systems'. Then unpack this source tree to its destination (e.g. /opt/root-system)(1), configure(2) it (here using the minimal set of options) and compile it as follows right below:
    -cd /opt/root-system
    -./configure linux --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    -            (or in case of a 64 bit installation: ./configure linuxx8664gcc --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml)
    -make
    -            (or in case there are multiple processors available, e.g.: make -j4)
    -
    -
-After one of the two setup variants has been executed the system should be told where to find the ROOT installation, therefore the following is suggested:
    -
  • As superuser create a file /etc/ld.so.conf.d/root-system.conf where the path to the lib directory of ROOT is added and call /sbin/ldconfig afterwards. In the example mentioned above one way of doing this is:
    -echo "/opt/root-system/lib" >> /etc/ld.so.conf.d/root-system.conf
    -/sbin/ldconfig
    -
    -
  • Additionally, as normal user one should append the following lines to the ~/.bashrc and/or ~/.bash_profile (and then either restart the shell or call the same commands once more from the shell) in order to change some path-setting environment variables:
    -export ROOTSYS=/opt/root-system/
    -export PATH=$ROOTSYS/bin:$PATH
    -
    -
+The ROOT system may or may not be part of the GNU/Linux distribution. Some distributions are packing ROOT in a manner incompatible with the way it is needed for musrfit. Therefore we advise to install ROOT from source. Before installing ROOT from source you will need to install some additional header packages.

- -

3.2 musrfit

-When all required software has been set up it can be proceeded with the musrfit installation. First, the most recent source code should be downloaded. The preferred way of doing so is to clone the musrfit repository via git. Assuming the code should be located in ~/musrfit this is achieved most easily calling from the terminal +For RPM based systems (RedHat, Fedora, etc) this will likely to be libX11-devel, libXft-devel, libXpm-devel, and libXext-devel:
-cd
-git clone https://bitbucket.org/muonspin/musrfit.git
+$ yum install libX11-devel libXft-devel libXpm-devel libXext-devel
+
+

+For a dpkg/apt based system (Debian, Ubuntu, etc) this will likely to be libX11-dev, libxft-dev, libxpm-dev, and libxext-dev: +
+$ apt-get install libX11-dev libxft-dev libxpm-dev libxext-dev
+
+

+Also make sure that you have installed all required packages listed under Requested Software (e.g. fftw, gsl, etc). +

+For the following it is assumed that ROOT shall be installed under $HOME/Apps. If you want to install it somewhere else, just systematically replace the related terms of the following description. For the following list of commands the '$' will be given, the command prompt. Do not enter it! Also some comments will be added starting with a '#' which can be omitted. They are only there to explain what is going on. +
+$ cd $HOME
+$ # creat the Apps directory if not already present
+$ mkdir Apps
+$ cd Apps
+$ git clone http://root.cern.ch/git/root.git
+$ cd root
+$ git tag -l
+$ # git tag -l will list all available tags. In the next command choose the tag v5-34-xx
+$ # where xx is the highest listed number, e.g. v5-34-32
+$ git checkout -b v5-34-32 v5-34-32
+$ # now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.
+$ ./configure --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
+$ # next will be the make. If running on a multicore CPU you can speed up tremendously by calling
+$ # make with the option -j <number>, where <number> is the number of threads which you want to give,
+$ # e.g. make -j8
+$ make
+
+

+What is still missing is that the system should be told where to find the ROOT installation, therefore the following is suggested:
    +
  • As superuser create a file /etc/ld.so.conf.d/cern-root.conf where the path to the lib directory of ROOT is added and call /sbin/ldconfig afterwards. In the example mentioned above one way of doing this is (<home> has to be the path to your home, e.g. /home/luke_skywalker):
    +$ echo "<home>/Apps/root/lib" >> /etc/ld.so.conf.d/cern-root.conf
    +$ /sbin/ldconfig
    +
    +
  • Additionally, as normal user one should append the following lines to the ~/.bashrc and/or ~/.bash_profile (~./profile on Debian like systems, and then either restart the shell or call the same commands once more from the shell) in order to change some path-setting environment variables:
    +$ export ROOTSYS=$HOME/Apps/root
    +$ export PATH=$ROOTSYS/bin:$PATH
    +
    +
+

+If an update of ROOT is needed, simple do the following:
+$ cd $HOME/Apps/root
+$ git pull
+$ make
+
+

+ +

3.2 musrfit

+When all required software has been set up it can be proceeded with the musrfit installation. First, the most recent source code should be downloaded. The preferred way of doing so is to clone the musrfit repository via git. Assuming the code should be located in $HOME/Apps this is achieved most easily calling from the terminal +
+$ cd $HOME/Apps
+$ git clone https://bitbucket.org/muonspin/musrfit.git
 
or
-cd
-git clone git://gitorious.psi.ch/nemu/musrfit.git
+$ cd $HOME/Apps
+$ git clone git://gitorious.psi.ch/nemu/musrfit.git
 

Note: musrfit has moved from svn to git. In case you still have an old svn version of musrfit, it is advised to remove it first. For svn users: for a smooth transition from svn to git, please check the following link: -Git for Subversion Users - A Cheat Sheet. +Git for Subversion Users - A Cheat Sheet.

If a local repository clone is already present, one can update it using:
-cd musrfit
-git pull
+$ cd $HOME/Apps/musrfit
+$ git pull
+$ # the new version now needs to be compiled and installed
+$ make
+$ make install
 

-As an alternative (if git is not available), the source code can also be downloaded from the following web-page: musrfit at bitbucket. +As an alternative (if git is not available), the source code can also be downloaded from the following web-page: musrfit at bitbucket.

After the source-code extraction the autogen.sh script is called to prepare the build environment. If it has been executed successfully the configure script should be ready to collect all the information needed to create the Makefiles. If musrfit should support NeXus data files this has to be enabled by specifying the --enable-NeXus switch when calling configure. For an overview of all available options just call ./configure --help. Besides the standard options there are a few special options which should be mentioned here:

@@ -288,18 +324,18 @@ After the source-code extraction the autogen.sh script is calle
--with-qt4
Set the prefix of the Qt4 installation, e.g. /usr/lib/qt47 (only useful in conjunction with building musredit)
--enable-NeXus
Enable the support of NeXus data files (requires the HDF4, HDF5 and NeXus libraries to be installed).
--disable-editor
Disable the integrated building of musredit/musrgui. -
--disable-omp
Switches off the OpenMP features of musrfit (parallelization of the χ2 calculation when compiled with GCC ≥ 4.2) +
--disable-omp
Switches off the OpenMP features of musrfit (parallelization of the χ2 calculation when compiled with GCC ≥ 4.2)

Normally it should not be necessary to make use of any of the options except for specifying the installation path with --prefix. The other paths should be detected automatically. If this does not work for some reason the configure script will terminate and ask for the information. -When the configure script has been called successfully everything is ready for building the musrfit libraries and executables. A standard installation sequence (without NeXus support) might then look like(3): +When the configure script has been called successfully everything is ready for building the musrfit libraries and executables. A standard installation sequence (without NeXus support) might then look like(3):
-cd musrfit
-sh autogen.sh
-./configure --prefix=$ROOTSYS
-make
-make install
-/sbin/ldconfig                                   (as superuser)
+$ cd $HOME/Apps/musrfit
+$ sh autogen.sh
+$ ./configure --prefix=$ROOTSYS
+$ make
+$ make install
+$ /sbin/ldconfig                                  # (as superuser)
 
In order to finish the installation of musrfit two more things should be done:
  • Define the MUSRFITPATH environment variable containing the path to the musrfit executables and XML files. E.g. if the location of the example above is used append the following line to the ~/.bashrc and ~/.bash_profile (and then either restart the shell or call the same commands once more from the shell):
    @@ -308,57 +344,54 @@ export MUSRFITPATH=/opt/root-system/bin
     
  • Adjust the paths where musrfit will search for data files in the installed musrfit_startup.xml. For detailed information on this XML file refer to the manual.

- -

3.3 musredit

+ +

3.3 musredit

In the latest version of musrfit the configure script tries to determine automatically if Qt4.6 or higher is set up on the machine. In case this is found, the editor musredit is built already together with musrfit. If not, one can either try to call the configure script with the "--with-qt4" option or install this editor separately:
-cd src/musredit
-qmake musredit.pro
+$ cd $HOME/Apps/musrfit/src/musredit
+$ # for some distributions you will need qmake-qt4 for the next command
+$ qmake musredit.pro
 
If everything went fine musredit can be compiled and installed:
-make
-make install
+$ make
+$ make install
 
In case one does not like the executable musredit to be copied to the default installation directory $ROOTSYS/bin the last "make install" can be skipped and the executable can be copied somewhere else instead. However, the musredit_startup.xml should go to the installation directory MUSRFITPATH of the musrfit executables. Eventually, in the installed musredit_startup.xml the path specifications should be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual.

-

3.4 musrgui

-If Qt4.6 or higher is not available but Qt3 is set up musrgui can be installed. For this please follow the instructions for the musredit installation where simply every musredit occurrence has to be replaced by musrgui.
+

3.4 musrgui

+If Qt4.6 or higher is not available but Qt3 is set up musrgui can be installed. For this please follow the instructions for the musredit installation where simply every musredit occurrence has to be replaced by musrgui.
If there are problems during the qmake step, e.g. "uic: File generated with too old version of Qt Designer", this most probably means the Qt4 version of qmake is being used. In order to use the Qt3 version it should be enough to specify the full path to its location when calling it. Within the most GNU/Linux distributions this location will be something like /usr/lib/qt-3.3/bin/qmake.

-

3.5 Check of the installation

+

3.5 Check of the installation

In order to perform a quick test for finding out if the installation has been completed successfully, a few msr files together with the corresponding data files can be found in the musrfit source tree at doc/examples/.
If musrgui has been installed, just open one of the test-*.msr files in the editor and test the musrfit functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:
-cd doc/examples
-musrview test-histo-ROOT-NPP.msr
+$ cd $HOME/Apps/musrfit/doc/examples
+$ musrview test-histo-ROOT-NPP.msr
 

Notes

- 1 : In case only a single user is working at the machine it might be considerable to change the ownership of the ROOT folder so that the user has easy write access to this directory: -

- 2 : When using GCC ≥ 4.2 please make sure that the environment variables USE_PARALLEL_MINUIT2 and USE_OPENMP are not set! Otherwise MINUIT2 will be compiled with parallelization support and cannot be used together with musrfit afterwards since the musrfit code is not fully thread-safe! When compiled with GCC ≥ 4.2 musrfit itself will parallelize the χ2 calculation. -

- 3 : In case the normal user has no write permissions to the $ROOTSYS and the installation path the "make install" commands have to be executed as superuser. + 3 : In case the normal user has no write permissions to the $ROOTSYS and the installation path the "make install" commands have to be executed as superuser.


-

4 MS Windows

-Under Windows a native installation is not supported but there is the possibility to run musrfit through Cygwin which has the great advantage that one gains additionally various nice UNIX tools also for other purposes wink
+

4 MS Windows

+Under Windows a native installation is not supported but there is the possibility to run musrfit through Cygwin which has the great advantage that one gains additionally various nice UNIX tools also for other purposes wink
Please also be aware of the fact that the X server which is going to be installed with Cygwin has to be started (e.g. by selecting it from the "Programs" folder) before any graphical application (musrview, musrgui, etc.) is run.

One more advice: Please never try to install either ROOT or musrfit from or to a directory containing spaces in the absolute path or in case you do, do not wonder if some errors occur!
msr files, however, might be saved in such directories like ...\My Documents\...

-

4.1 Requirements

-

4.1.1 Setting up Cygwin

-For the start go to the Cygwin website, download the setup file and use it to install Cygwin 1.7. During the installation process you will be asked where you want to install Cygwin and normally the default choice should just be fine. +

4.1 Requirements

+

4.1.1 Setting up Cygwin

+For the start go to the Cygwin website, download the setup file and use it to install Cygwin 1.7. During the installation process you will be asked where you want to install Cygwin and normally the default choice should just be fine. At some point you will be asked which packages should be installed—make sure that you choose at least the following (or packages with revisions close to the following) in order to fulfill the musrfit requirements and be able to work with this base system:

a2ps, alternatives, autoconf, automake, base-cygwin, base-files, base-passwd bash, bash-completion, bc, binutils, bison, boost, boost-devel, bzip2, cmake, colorgcc, coreutils, curl, cygutils, cygwin, editrights, fftw3, findutils, flex, font-adobe-dpi100, font-adobe-dpi75, font-alias, font-bitstream-dpi100, font-bitstream-dpi75, font-encodings, font-ibm-type1, font-sun-misc, font-util, font-xfree86-type1, fontconfig, freeglut, gawk, gcc-tools-autoconf, gcc-tools-automake, gcc4, gcc4-core, gcc4-fortran, gcc4-g++, gccmakedep, gd, gettext, ghostscript, ghostscript-fonts-std, giflib, gmp, grep, groff, gsl, gsl-apps, gsl-devel, gv, gzip, inputproto, jasper, jpeg, lapack, less, libboost, libbz2_1, libcharset1, libcurl4, libfftw3-devel, libfftw3_3, libgcc1, libgd-devel, libgif-devel, libGL-devel, libGL1, libGLU-devel, libGLU1, libglut-devel, libglut3, libgmp-devel libgmp3, libgomp1, libICE-devel, libICE6, libjpeg-devel, libjpeg62, liblapack-devel, libmpfr-devel, libmpfr1, libncurses-devel, libncurses9, libOSMesa-devel, libOSMesa7, libpng, libpng14, libpng14-devel, libreadline6, libSM-devel, libSM6, libssh2_1, libstdc++6, libstdc++6-devel, libtiff-devel, libtiff5, libtool, libX11-devel, libX11_6, libXau-devel, libXau6, libXaw7, libxcb-devel, libxcb-xlib-devel libXcursor-devel, libXcursor1, libXdmcp-devel, libXdmcp6, libXext-devel, libXext6, libXfixes-devel, libXfixes3, libXfont-devel, libXfont1, libXft-devel, libXft2, libXi-devel, libXi6, libxkbfile1, libxml2, libxml2-devel, libXmu-devel, libXmu6, libXpm-devel, libXpm4, libXrender-devel, libXrender1, libXt-devel, libXt6, login, m4, make, makedepend, man, mpfr, nano, opengl, openssh, openssl, pdftk, perl, ping, pkg-config, psutils, python, qt3, qt3-bin, qt3-devel, readline, rebase, rgb, rsync, run, screen, sed, subversion, tar, tcltk, terminfo, unzip, util-linux, vim, w32api, which, X-start-menu-icons, xauth, xextproto, xfontsel, xinit, xkbcomp, xkeyboard-config, xkill, xlogo, xlsfonts, xorg-cf-files, xorg-scripts, xorg-server, xproto, xrdb, xrefresh, xset, xterm, zip, zlib, zlib-devel, zlib0, libQt3Support4-devel, libQtAssistantClient4-devel, libQtCore4-devel, libQtDBus4-devel, libQtDesigner4-devel, libQtGui4-devel, libQtHelp4-devel, libQtNetwork4-devel, libQtOpenGL4-devel, libQtScript4-devel, libQtScriptTools4-devel, libQtSql4-devel, libQtSvg4-devel, libQtTest4-devel, libQtWebKit4-devel, libQtXml4-devel, libQtXmlPatterns4-devel @@ -367,55 +400,55 @@ After these installations already most of the required software is present and t

Since later on the boost header files should be used and in the standard Cygwin installation these are found at a version specific location, the later handling will be easier if a symbolic link to these files is created now in the terminal (in case it had not been present before):
-ln -sf /usr/include/boost-x_yy_z/boost /usr/include/boost
+$ ln -sf /usr/include/boost-x_yy_z/boost /usr/include/boost
 
where x_yy_z has to be substituted by the correct version number, e.g. 1_33_1.

-

4.1.2 Installation of NeXus requirements (optional)

-Only if musrfit should support reading data files in the NeXus format the further required software has to be set up. Under Cygwin of all the required libraries only HDF5 is available. The packages hdf5 and libhdf5-devel can be installed through the Cygwin setup. One should also make sure that bison, flex and a package containing /usr/lib/librpc.a (e.g. sunrpc = 4.0-3, but not sunrpc = 4.0-4) are installed. +

4.1.2 Installation of NeXus requirements (optional)

+Only if musrfit should support reading data files in the NeXus format the further required software has to be set up. Under Cygwin of all the required libraries only HDF5 is available. The packages hdf5 and libhdf5-devel can be installed through the Cygwin setup. One should also make sure that bison, flex and a package containing /usr/lib/librpc.a (e.g. sunrpc = 4.0-3, but not sunrpc = 4.0-4) are installed.

All other libraries have to be built from the sources. The following lines will track the installation of JPEG 6b, MXML 2.9, HDF 4.2.7-patch1, and NeXus 4.3.2. The version numbers and source-code locations might of course change with time but should be easily adjustable.
-cd
-mkdir nexus
-cd nexus
-curl http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz -G | tar xz
-cd jpeg-6b
-./configure --prefix=/usr/local --enable-static
-make
-make install
-cd ..
-curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G | tar xz
-cd mxml-2.9
-./configure --prefix=/usr/local --enable-static
-make
-make install
-cd ..
-curl http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.7-patch1.tar.gz -G | tar xz
-cd hdf-4.2.7-patch1
-./configure --prefix=/usr/local --enable-static --disable-fortran --with-jpeg=/usr/local
-make
-make install
-cd ..
-curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G | tar xz
-cd nexus-4.3.2-20140413svn1919
-./configure --prefix=/usr/local --with-hdf4=/usr/local --with-hdf5=/usr --with-xml=/usr/local
-make
-make install
+$ cd
+$ mkdir nexus
+$ cd nexus
+$ curl http://www.hdfgroup.org/ftp/lib-external/jpeg/src/jpegsrc.v6b.tar.gz -G | tar xz
+$ cd jpeg-6b
+$ ./configure --prefix=/usr/local --enable-static
+$ make
+$ make install
+$ cd ..
+$ curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G | tar xz
+$ cd mxml-2.9
+$ ./configure --prefix=/usr/local --enable-static
+$ make
+$ make install
+$ cd ..
+$ curl http://www.hdfgroup.org/ftp/HDF/HDF_Current/src/hdf-4.2.7-patch1.tar.gz -G | tar xz
+$ cd hdf-4.2.7-patch1
+$ ./configure --prefix=/usr/local --enable-static --disable-fortran --with-jpeg=/usr/local
+$ make
+$ make install
+$ cd ..
+$ curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G | tar xz
+$ cd nexus-4.3.2-20140413svn1919
+$ ./configure --prefix=/usr/local --with-hdf4=/usr/local --with-hdf5=/usr --with-xml=/usr/local
+$ make
+$ make install
 

-

4.1.3 ROOT

+

4.1.3 ROOT

In order to install the ROOT system, there are two possibilities:
    -
  • Download the precompiled Cygwin GCC 4.3 package of the most recent ROOT version from the web page and unpack it in a Cygwin shell (in order to get the line endings correctly) at the final location. Suppose the package has been downloaded to C:\ and the ROOT tree should be in C:\root, this is achieved by:
    -cd /cygdrive/c
    -tar xzf root_v5.xx.yy.win32gcc-gcc-4.3.tar.gz
    +
  • Download the precompiled Cygwin GCC 4.3 package of the most recent ROOT version from the web page and unpack it in a Cygwin shell (in order to get the line endings correctly) at the final location. Suppose the package has been downloaded to C:\ and the ROOT tree should be in C:\root, this is achieved by:
    +$ cd /cygdrive/c
    +$ tar xzf root_v5.xx.yy.win32gcc-gcc-4.3.tar.gz
     
    -
  • If due to some reason there was no precompiled Cygwin GCC 4.3 package available or ROOT should be built from source, one has to visit the web page, download the 'complete source tree for all systems' and save it for instance in C:\.
    Then go to the Cygwin shell and unpack this source tree, configure(2) it (here using the minimal set of options) and compile it as follows right below:
    -cd /cygdrive/c
    -tar xzf root_v5.xx.yy.source.tar.gz
    -cd root
    -./configure win32gcc --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    -make
    +
  • If due to some reason there was no precompiled Cygwin GCC 4.3 package available or ROOT should be built from source, one has to visit the web page, download the 'complete source tree for all systems' and save it for instance in C:\.
    Then go to the Cygwin shell and unpack this source tree, configure(2) it (here using the minimal set of options) and compile it as follows right below:
    +$ cd /cygdrive/c
    +$ tar xzf root_v5.xx.yy.source.tar.gz
    +$ cd root
    +$ ./configure win32gcc --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    +$ make
     

@@ -424,34 +457,34 @@ In order to finalize the ROOT installation and to prepare already t export DISPLAY=:0.0 export QTDIR=/usr/lib/qt4 export ROOTSYS=/cygdrive/c/root -export PATH=$ROOTSYS/bin:$QTDIR/bin:/usr/i686-pc-cygwin/bin:$PATH -export MUSRFITPATH=$ROOTSYS/bin +export PATH=$ROOTSYS/bin:$QTDIR/bin:/usr/i686-pc-cygwin/bin:$PATH +export MUSRFITPATH=$ROOTSYS/bin

Afterwards close the Cygwin shell and reopen it again for the installation of musrfit.

-

4.2 musrfit

+

4.2 musrfit

First, the most recent source code should be downloaded. First, the most recent source code should be downloaded. The preferred way of doing so is to clone the musrfit repository via git. Assuming the code should be located in ~/musrfit this is achieved most easily calling from the terminal
-cd
-git clone https://bitbucket.org/muonspin/musrfit.git 
+$ cd
+$ git clone https://bitbucket.org/muonspin/musrfit.git 
 
or
-cd
-git clone git://gitorious.psi.ch/nemu/musrfit.git
+$ cd
+$ git clone git://gitorious.psi.ch/nemu/musrfit.git
 

Note: musrfit has moved from svn to git. In case you still have an old svn version of musrfit, it is advised to remove it first. For svn users: for a smooth transition from svn to git, please check the following link: -Git for Subversion Users - A Cheat Sheet. +Git for Subversion Users - A Cheat Sheet.

If the repository had been checked out already before, one can update the local copy using:
-cd musrfit
-git pull
+$ cd musrfit
+$ git pull
 

-As an alternative (if git is not available), the source code can also be downloaded from the following web-page: musrfit at bitbucket. +As an alternative (if git is not available), the source code can also be downloaded from the following web-page: musrfit at bitbucket.

After the source-code extraction the autogen.sh script is called to prepare the build environment. If it has been executed successfully the configure script should be ready to collect all the information needed to create the Makefiles. If musrfit should support NeXus data files this has to be enabled by specifying the --enable-static --enable-NeXus switches when calling configure. For an overview of all available options just call ./configure --help. Besides the standard options there are a few special options which should be mentioned here:

@@ -467,31 +500,31 @@ After the source-code extraction the autogen.sh script is calle
--with-qt4
Set the prefix of the Qt4 installation, e.g. /usr/lib/qt47 (only useful in conjunction with building musredit)
--enable-NeXus
Enable the support of NeXus data files (requires the HDF4, HDF5 and NeXus libraries to be installed).
--disable-editor
Disable the integrated building of musredit/musrgui. -
--disable-omp
Switches off the OpenMP features of musrfit (parallelization of the χ2 calculation when compiled with GCC ≥ 4.2) +
--disable-omp
Switches off the OpenMP features of musrfit (parallelization of the χ2 calculation when compiled with GCC ≥ 4.2)

Normally it should not be necessary to make use of any of the options except for specifying the installation path with --prefix. The other paths should be detected automatically. If this does not work for some reason the configure script will terminate and ask for the information. When the configure script has been called successfully everything is ready for building the musrfit libraries and executables. A standard installation sequence (without NeXus support) might then look like:
-cd musrfit
-sh autogen.sh
-./configure --prefix=$ROOTSYS
-make
-make install
+$ cd musrfit
+$ sh autogen.sh
+$ ./configure --prefix=$ROOTSYS
+$ make
+$ make install
 
In order to finish the installation of musrfit the paths where musrfit searches for data files should be adjusted in the installed musrfit_startup.xml (/cygdrive/c/root/bin/musrfit_startup.xml or C:\root\bin\musrfit_startup.xml). The paths have to obey the POSIX naming convention. For detailed information on this XML file refer to the manual.

- -

4.3 musredit

+ +

4.3 musredit

In the latest version of musrfit the configure script tries to determine automatically if Qt4.5 or higher is set up on the machine. In case this is found, the editor musredit is built already together with musrfit. If not, one can either try to call the configure script with the "--with-qt4" option or install this editor separately:
-cd src/musredit
-qmake-qt4 musredit.pro
+$ cd src/musredit
+$ qmake-qt4 musredit.pro
 
If everything went fine musredit can be compiled and installed:
-make
-make install
+$ make
+$ make install
 
Eventually, in the installed musredit_startup.xml (/cygdrive/c/root/bin/musredit_startup.xml or C:\root\bin\musredit_startup.xml) the path specifications should be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual.

@@ -502,106 +535,123 @@ In case one likes to get the editor started just with starting the X server from export DISPLAY=:0.0 export QTDIR=/usr/lib/qt4 export ROOTSYS=/cygdrive/c/root -export PATH=$ROOTSYS/bin:$QTDIR/bin:/usr/i686-pc-cygwin/bin:$PATH -export MUSRFITPATH=$ROOTSYS/bin +export PATH=$ROOTSYS/bin:$QTDIR/bin:/usr/i686-pc-cygwin/bin:$PATH +export MUSRFITPATH=$ROOTSYS/bin musredit &

-

4.4 musrgui

-If Qt4.5 is not available but Qt3 is set up musrgui can be installed. For this please follow the instructions for the musredit installation where simply every musredit occurrence has to be replaced by musrgui, and qt4 is replaced by qt3. +

4.4 musrgui

+If Qt4.5 is not available but Qt3 is set up musrgui can be installed. For this please follow the instructions for the musredit installation where simply every musredit occurrence has to be replaced by musrgui, and qt4 is replaced by qt3.

-

4.5 Check of the installation

+

4.5 Check of the installation

In order to perform a quick test for finding out if the installation has been completed successfully, a few msr files together with the corresponding data files can be found in the musrfit source tree at doc/examples/.
If musrgui has been installed, just open one of the test-*.msr files in the editor and test the musrfit functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:
-cd doc/examples
-musrview test-histo-ROOT-NPP.msr
+$ cd doc/examples
+$ musrview test-histo-ROOT-NPP.msr
 

-

4.6 Possible problems

+

4.6 Possible problems

It might be that especially when running on Windows 7 musredit and musrgui produce errors like a "STATUS_ACCESS_VIOLATION". In this case, try to do the following: Close all Cygwin programs (including the terminals and X server) and run from a Windows command prompt (cmd)
-C:\cygwin\bin\ash.exe /bin/rebaseall
+$ C:\cygwin\bin\ash.exe /bin/rebaseall
 
If this does not resolve the problem, try to change the compatibility settings of C:\cygwin\bin\sh.exe and C:\cygwin\bin\bash.exe so that they are executed with administrator privileges.

-

5 Mac OS X

+

5 Mac OS X

-With Mac OS X the situation is up to some extent similar like on MS Windows but still different since Mac OS X is a UNIX system. The similarity is that also on OS X a helping framework—either MacPorts or Fink—which provides open-source software is employed to fulfill the basic software requirements of musrfit. In the following, both possibilities (using MacPorts or Fink) are described but it is emphasized here that it should be followed only one of the possible routes. +With Mac OS X the situation is up to some extent similar like on MS Windows but still different since Mac OS X is a UNIX system. The similarity is that also on OS X a helping framework—either MacPorts or Fink—which provides open-source software is employed to fulfill the basic software requirements of musrfit. In the following, both possibilities (using MacPorts or Fink) are described but it is emphasized here that it should be followed only one of the possible routes.

-

5.1 Requirements (MacPorts)

-

5.1.1 Everything but ROOT and NeXus

-Before proceeding with the usage of the MacPorts system first a few useful tools provided by Apple together with OS X (on the installation DVD/CDs) should be installed:
-
Xcode tools
Useful developer tools including for instance the GNU compiler collection. Starting from XCode >= 4.3 the command line tools need to be installed manually. -
X11
The X-window system (automatically installed on 10.5 Leopard and 10.6 Snow Leopard). For 10.7 and higher you also will need to install XQuartz +WARNING: The instruction for Fink haven't been updated/tested for quite a while and likely are slightly outdated. + +

+

+

+

5.1 Requirements (MacPorts)

+

5.1.1 Everything but ROOT and NeXus

+Before proceeding with the usage of the MacPorts system first a few useful tools provided by Apple together with OS X (on the installation DVD/CDs) should be installed: + $ Xcode tools: Useful developer tools including for instance the GNU compiler collection. Starting from XCode >= 4.3 the command line tools need to be installed manually.
+
X11
The X-window system (automatically installed on 10.5 Leopard and 10.6 Snow Leopard). For 10.7 and higher you also will need to install XQuartz

-After installing the Xcode tools go to the MacPorts install page, download the installer for your system and follow the installation instructions on the page. By default the MacPorts system will be installed in /opt/local.
+After installing the Xcode tools go to the MacPorts install page, download the installer for your system and follow the installation instructions on the page. By default the MacPorts system will be installed in /opt/local.
To be sure that the newest version of the software is used a MacPorts upgrade should be performed by typing in a terminal:
-sudo port -v selfupdate
+$ sudo port -v selfupdate
 

-Remark: MacPorts uses rsync in order to synchronize the list of available packages. It frequently happens that this service is blocked by firewalls. In this case it should be possible to download a local version of the package repository and do the synchronization. +Remark: MacPorts uses rsync in order to synchronize the list of available packages. It frequently happens that this service is blocked by firewalls. In this case it should be possible to download a local version of the package repository and do the synchronization. If this step becomes necessary (and only then) it can be done in the following way:
  1. Get a local version of the repository:
    -svn co http://svn.macports.org/repository/macports/trunk/dports ~/dports
    +$ svn co http://svn.macports.org/repository/macports/trunk/dports ~/dports
     
  2. Edit the file /opt/local/etc/macports/sources.conf: At the end of the file, comment the line beginning with "rsync://" and add a new line pointing to your local copy, e.g.
     file:///Users/username/dports
     
  3. Synchronize the packages:
    -sudo port -v -d sync
    +$ sudo port -v -d sync
     

Then the MacPorts system should be set up and can be used to install additional software.
The installation of the software mentioned above is then done in the terminal:
-sudo port -v install pkgconfig autoconf automake libtool fftw-3 fftw-3-single gsl boost libxml2 qt4-mac
+$ sudo port -v install pkgconfig autoconf automake libtool fftw-3 fftw-3-single gsl boost libxml2 qt4-mac
 
With qt4-mac, musredit will be installed. If it happens that you used musrgui in the past, please change over to musredit since there will be no further development for musrgui anymore!

-

5.1.2 Installation of NeXus requirements (optional)

+

5.1.2 Installation of NeXus requirements (optional)

Only if musrfit should support reading data files in the NeXus format the further required packages are set up:
-sudo port -v install jpeg6b hdf4 hdf5
+$ sudo port -v install jpeg6b hdf4 hdf5
 
Unfortunately, the minixml and NeXus libraries have to be compiled and installed directly from the source code. Given the respective version numbers of 2.9 and 4.3.2 (which are subject to change with time) this can be achieved for example by:
-cd
-curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G | tar xz
-cd mxml-2.9
-./configure --prefix=/usr/local
-make
-sudo make install
-cd ..
-curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G | tar xz
-cd nexus-4.3.2-20140413svn1919
-./configure --prefix=/usr/local
-make
-sudo make install
+$ cd
+$ curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G | tar xz
+$ cd mxml-2.9
+$ ./configure --prefix=/usr/local
+$ make
+$ sudo make install
+$ cd ..
+$ curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G | tar xz
+$ cd nexus-4.3.2-20140413svn1919
+$ ./configure --prefix=/usr/local
+$ make
+$ sudo make install
 

-

5.1.3 ROOT

-For installing the ROOT system there are two independent possibilities:
    -
  • Visit the ROOT web page and download the packed precompiled binary version matching the OS X version. Then unpack the bundle to its final destination (e.g. /opt/root-system). -
  • If there is no precompiled binary version of ROOT available for your system or e.g. ROOT should be compiled with another version of GCC visit the web page and download the 'complete source tree for all systems'. Then unpack this source tree to its destination (e.g. /opt/root-system). In case only a single user is working at the machine it might be considerable to change the ownership of the ROOT folder so that the user ("username" in the example) has easy write access to this directory:
    sudo chown -R username:staff /opt/root-system/ 
    Finally, ROOT can be configured (here using the minimal set of options) and compiled as stated right below:
    -cd /opt/root-system
    -./configure --gminimal --enable-fink --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    -make
    -
    and for Mac OS X 10.9 (Mavericks) for now (beginning 2014, subject to be changed hopefully soon):
    -cd /opt/root-system
    -./configure --gminimal --enable-builtin-freetype --enable-fink --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    -make
    +

    5.1.3 ROOT

    +The best way to get ROOT exactly the way needed for musrfit is to install it from source. Before describing it, please make sure that you have installed all required packages listed under Requested Software (e.g. fftw, gsl, etc). +

    +For the following it is assumed that ROOT shall be installed under $HOME/Apps. If you want to install it somewhere else, just systematically replace the related terms of the following description. For the following list of commands the '$' will be given, the command prompt. Do not enter it! Also some comments will be added starting with a '#' which can be omitted. They are only there to explain what is going on. +
    +$ cd $HOME
    +$ # creat the Apps directory if not already present
    +$ mkdir Apps
    +$ cd Apps
    +$ git clone http://root.cern.ch/git/root.git
    +$ cd root
    +$ git tag -l
    +$ # git tag -l will list all available tags. In the next command choose the tag v5-34-xx
    +$ # where xx is the highest listed number, e.g. v5-34-32
    +$ git checkout -b v5-34-32 v5-34-32
    +$ # now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.
    +$ ./configure --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    +$ # next will be the make. If running on a multicore CPU you can speed up tremendously by calling
    +$ # make with the option -j <number>, where <number> is the number of threads which you want to give,
    +$ # e.g. make -j8
    +$ make
     
    -
  • In case you are just migrating to the latest Mac OS X version (e.g. from 10.7 to 10.8.1) often for a period of a few weeks it is necessary to work with the GIT trunk version of ROOT, i.e. that you have to checkout ROOT via git:
    -git clone http://root.cern.ch/git/root.git
    -
    For details see Installing ROOT from Source. -
+

+For further details see Installing ROOT from Source. +

+Since Apple in its wisdom decided that programs started from a shell are treated differently than apps if it is coming to system variables, we need to work harder compared to a Linux system. +

+For Mac OS X < 10.8:

In order to finalize the ROOT installation and to prepare already the installation of musrfit and musrgui / musredit this is a good time for setting necessary environment variables for the use in Mac OS X. Put the following lines (without the comments in parentheses and with the paths adjusted to your local installation) into the file ~/.MacOSX/environment.plist and re-login:
@@ -610,35 +660,41 @@ In order to finalize the ROOT installation and to prepare already t
 <plist version="1.0">
 <dict>
         <key>MUSRFITPATH</key>
-        <string>/opt/root-system/bin</string>        (where to find the musrfit executables)
+        <string>$HOME/Apps/root/bin</string>         (where to find the musrfit executables)
         <key>QTDIR</key>
         <string>/opt/local/lib/qt3mac</string>       (where to find Qt3 (for musrgui) or Qt4 (for musredit))
         <key>ROOTSYS</key>
-        <string>/opt/root-system</string>            (where to find the ROOT system)
+        <string>$HOME/Apps/root</string>             (where to find the ROOT system)
 </dict>
 </plist>
 

-Additionally, one might want to put a line in ~/.profile (or ~/.bash_profile) to look for executables also in the ROOT and Qt binary directories: +For Mac OS X >= 10.8: +

+One needs to add some system variables in ~/.profile:
-export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
+export ROOTSYS=$HOME/Apps/root
+launchctl setenv ROOTSYS $ROOTSYS
+export MUSRFITPATH=$ROOTSYS/bin
+launchctl setenv MUSRFITPATH $MUSRFITPATH
+export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
 

-

5.2 Requirements (Fink)

-

5.2.1 Everything but ROOT and NeXus

-Before proceeding with the usage of the Fink system first a few useful tools provided by Apple together with OS X (on the installation DVD/CDs) should be installed:
-
Xcode tools
Useful developer tools including for instance the GNU compiler collection -
X11
The X-window-system (automatically installed on 10.5 Leopard and 10.6 Snow Leopard) +

5.2 Requirements (Fink)

+

5.2.1 Everything but ROOT and NeXus

+Before proceeding with the usage of the Fink system first a few useful tools provided by Apple together with OS X (on the installation DVD/CDs) should be installed: + $ Xcode tools: Useful developer tools including for instance the GNU compiler collection
+
X11
The X-window-system (automatically installed on 10.5 Leopard and 10.6 Snow Leopard)

-After installing the Xcode tools go to the Fink download page, download the installer for your system and follow the installation instructions on the page. +After installing the Xcode tools go to the Fink download page, download the installer for your system and follow the installation instructions on the page. By default the Fink system is installed in /sw. After the basic setup make sure that in /sw/etc/fink.conf the line starting with Trees: reads like:
 Trees: local/main stable/main stable/crypto unstable/main
 
After applying the changes above to the configuration file, the Fink core system should be upgraded to its newest version by typing in a terminal:
-sudo fink selfupdate
+$ sudo fink selfupdate
 
Then the Fink system should be set up and can be used to install additional software.
The Fink installer package also contains a graphical user interface called FinkCommander and it is suggested to use that for installing the following packages (or packages with revisions close to the following)—it is necessary to compile a few packages from source since no binary packages are available, however, this is done automatically by the FinkCommander after you have chosen the software packages for installation: @@ -647,57 +703,71 @@ The Fink installer package also contains a graphical user interface

Under OS X 10.6 Snow Leopard it will not be possible to install qt3mac since the system is by default a 64-bit system and the old qt3-mac depends on software which is only available for 32-bit systems. It is suggested to install qt4mac instead and use musredit.

-Also, due to some not fulfilled dependencies, it might not be possible to install FFTW3 through Fink. In this case (and ONLY in THIS case) simply download the FFTW3 source code from its download page and install it from a terminal using the following commands (for the FFTW version 3.x.y): +Also, due to some not fulfilled dependencies, it might not be possible to install FFTW3 through Fink. In this case (and ONLY in THIS case) simply download the FFTW3 source code from its download page and install it from a terminal using the following commands (for the FFTW version 3.x.y):
-tar xz fftw-3.x.y
-cd fftw-3.x.y
-./configure --enable-single --enable-shared --enable-threads --prefix=/usr/local
-make
-sudo make install
+$ tar xz fftw-3.x.y
+$ cd fftw-3.x.y
+$ ./configure --enable-single --enable-shared --enable-threads --prefix=/usr/local
+$ make
+$ sudo make install
 

Since later on the boost header files should be used and in the standard Fink installation these are found at a version specific location, the later handling will be easier if a symbolic link to this files is created now in the terminal (if it did not exist earlier), e.g.:
-ln -sf /sw/include/boost-x_yy_z/boost /sw/include/boost
+$ ln -sf /sw/include/boost-x_yy_z/boost /sw/include/boost
 
where x_yy_z has to be substituted by the correct version number, e.g. 1_41_0.

-

5.2.2 Installation of NeXus requirements (optional)

+

5.2.2 Installation of NeXus requirements (optional)

-Only if musrfit should support reading data files in the NeXus format the further required packages can be installed through Fink: +Only if musrfit should support reading data files in the NeXus format the further required packages can be installed through Fink:

libjpeg hdf hdf5-18 hdf5-18-shlibs

Unfortunately, the minixml and NeXus libraries have to be compiled and installed directly from the source code. Given the respective version numbers of 2.9 and 4.3.2 (which are subject to change with time) this can be achieved for example by:
-cd
-curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G | tar xz
-cd mxml-2.9
-./configure --prefix=/usr/local
-make
-sudo make install
-cd ..
-curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G | tar xz
-cd nexus-4.3.2-20140413svn1919
-./configure --prefix=/usr/local
-make
-sudo make install
+$ cd
+$ curl www.msweet.org/files/project3/mxml-2.9.tar.gz -G | tar xz
+$ cd mxml-2.9
+$ ./configure --prefix=/usr/local
+$ make
+$ sudo make install
+$ cd ..
+$ curl http://download.nexusformat.org/kits/nexus-4.3.2-20140413svn1919.tar.gz -G | tar xz
+$ cd nexus-4.3.2-20140413svn1919
+$ ./configure --prefix=/usr/local
+$ make
+$ sudo make install
 

-

5.2.3 ROOT

-For installing the ROOT system there are some independent possibilities:
    -
  • Visit the ROOT web page and download the packed precompiled binary version matching the OS X version. Then unpack the bundle to its final destination (e.g. /opt/root-system). -
  • If there is no precompiled binary version of ROOT available for your system or e.g. ROOT should be compiled with another version of GCC visit the web page and download the 'complete source tree for all systems'. Then unpack this source tree to its destination (e.g. /opt/root-system). In case only a single user is working at the machine it might be considerable to change the ownership of the ROOT folder so that the user ("username" in the example) has easy write access to this directory:
    sudo chown -R username:staff /opt/root-system/ 
    Finally, ROOT can be configured (here using the minimal set of options) and compiled as stated right below:
    -cd /opt/root-system
    -./configure --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    -make
    -
    and for Mac OS X 10.9 (Mavericks) for now (beginning 2014, subject to be changed hopefully soon):
    -cd /opt/root-system
    -./configure --gminimal --enable-builtin-freetype --enable-fink --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    -make
    +

    5.2.3 ROOT

    +The best way to get ROOT exactly the way needed for musrfit is to install it from source. Before describing it, please make sure that you have installed all required packages listed under Requested Software (e.g. fftw, gsl, etc). +

    +For the following it is assumed that ROOT shall be installed under $HOME/Apps. If you want to install it somewhere else, just systematically replace the related terms of the following description. For the following list of commands the '$' will be given, the command prompt. Do not enter it! Also some comments will be added starting with a '#' which can be omitted. They are only there to explain what is going on. +
    +$ cd $HOME
    +$ # creat the Apps directory if not already present
    +$ mkdir Apps
    +$ cd Apps
    +$ git clone http://root.cern.ch/git/root.git
    +$ cd root
    +$ git tag -l
    +$ # git tag -l will list all available tags. In the next command choose the tag v5-34-xx
    +$ # where xx is the highest listed number, e.g. v5-34-32
    +$ git checkout -b v5-34-32 v5-34-32
    +$ # now ROOT is ready to be configured. Below you will find the minimal ROOT configuration needed.
    +$ ./configure --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
    +$ # next will be the make. If running on a multicore CPU you can speed up tremendously by calling
    +$ # make with the option -j <number>, where <number> is the number of threads which you want to give,
    +$ # e.g. make -j8
    +$ make
     
    -
  • ROOT is also available through the FinkCommander! Install root5 or root5-devel. However, this versions also have to be compiled locally since there are no binary packages. The manual installation mentioned right above should be preferred in this case. -
+

+For further details see Installing ROOT from Source. +

+Since Apple in its wisdom decided that programs started from a shell are treated differently than apps if it is coming to system variables, we need to work harder compared to a Linux system. +

+For Mac OS X < 10.8:

In order to finalize the ROOT installation and to prepare already the installation of musrfit and musrgui / musredit this is a good time for setting necessary environment variables for the use in Mac OS X. Put the following lines (without the comments in parentheses and with the paths adjusted to your local installation) into the file ~/.MacOSX/environment.plist and re-login:
@@ -706,45 +776,49 @@ In order to finalize the ROOT installation and to prepare already t
 <plist version="1.0">
 <dict>
         <key>MUSRFITPATH</key>
-        <string>/opt/root-system/bin</string>        (where to find the musrfit executables)
+        <string>$HOME/Apps/root/bin</string>         (where to find the musrfit executables)
         <key>QTDIR</key>
-        <string>/sw/lib/qt3mac</string>              (where to find Qt3 (for musrgui) or Qt4 (for musredit))
+        <string>/opt/local/lib/qt3mac</string>       (where to find Qt3 (for musrgui) or Qt4 (for musredit))
         <key>ROOTSYS</key>
-        <string>/opt/root-system</string>            (where to find the ROOT system)
+        <string>$HOME/Apps/root</string>             (where to find the ROOT system)
 </dict>
 </plist>
 

-Additionally, one might want to put a line in ~/.profile (or ~/.bash_profile) to look for executables also in the ROOT and Qt binary directories: +For Mac OS X >= 10.8: +

+One needs to add some system variables in ~/.profile:
-export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
+export ROOTSYS=$HOME/Apps/root
+launchctl setenv ROOTSYS $ROOTSYS
+export MUSRFITPATH=$ROOTSYS/bin
+launchctl setenv MUSRFITPATH $MUSRFITPATH
+export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
 
-

-

-

5.3 musrfit

-First, the most recent source code should be downloaded. First, the most recent source code should be downloaded. The preferred way of doing so is to clone the musrfit repository via git. Assuming the code should be located in ~/musrfit this is achieved most easily calling from the terminal +

5.3 musrfit

+First, the most recent source code should be downloaded. First, the most recent source code should be downloaded. The preferred way of doing so is to clone the musrfit repository via git. Assuming the code should be located in ~/Apps/musrfit this is achieved most easily calling from the terminal

-cd
-git clone https://bitbucket.org/muonspin/musrfit.git 
+$ cd ~/Apps
+$ git clone https://bitbucket.org/muonspin/musrfit.git 
 
or
-cd
-git clone git://gitorious.psi.ch/nemu/musrfit.git  
+$ cd ~/Apps
+$ git clone git://gitorious.psi.ch/nemu/musrfit.git  
 

Note: musrfit has moved from svn to git. In case you still have an old svn version of musrfit, it is advised to remove it first. For svn users: for a smooth transition from svn to git, please check the following link: -Git for Subversion Users - A Cheat Sheet. +Git for Subversion Users - A Cheat Sheet.

If a local repository clone is already present, one can update it using:
-cd musrfit
-git pull
+$ cd ~/Apps/musrfit
+$ git pull
 

-As an alternative (if git is not available), the source code can also be downloaded from the following web-page: musrfit at bitbucket. +As an alternative (if git is not available), the source code can also be downloaded from the following web-page: musrfit at bitbucket.

After the source-code extraction the autogen.sh script is called to prepare the build environment. If it has been executed successfully the configure script should be ready to collect all the information needed to create the Makefiles. If musrfit should support NeXus data files this has to be enabled by specifying the --enable-NeXus switch when calling configure. For an overview of all available options just call ./configure --help. Besides the standard options there are a few special options which should be mentioned here:

@@ -760,49 +834,49 @@ After the source-code extraction the autogen.sh script is calle
--with-qt4
Set the prefix of the Qt4 installation, e.g. /opt/local/lib/qt-4.7 (only useful in conjunction with building musredit)
--enable-NeXus
Enable the support of NeXus data files (requires the HDF4, HDF5 and NeXus libraries to be installed).
--disable-editor
Disable the integrated building of musredit/musrgui. -
--disable-omp
Switches off the OpenMP features of musrfit (parallelization of the χ2 calculation when compiled with GCC ≥ 4.2) +
--disable-omp
Switches off the OpenMP features of musrfit (parallelization of the χ2 calculation when compiled with GCC ≥ 4.2)

Normally it should not be necessary to make use of any of the options except for specifying the installation path with --prefix. The other paths should be detected automatically. If this does not work for some reason the configure script will terminate and ask for the information. When the configure script has been called successfully everything is ready for building the musrfit libraries and executables. A standard installation sequence (without NeXus support) might then look like:
-cd musrfit
-sh autogen.sh
-./configure --prefix=$ROOTSYS
-make
-make install
+$ cd ~/Apps/musrfit
+$ sh autogen.sh
+$ ./configure --prefix=$ROOTSYS
+$ make
+$ make install
 
In order to finish the installation of musrfit the paths where musrfit searches for data files should be adjusted in the installed musrfit_startup.xml ($ROOTSYS/bin/musrfit_startup.xml). For detailed information on this XML file refer to the manual.

- -

5.4 musredit

-In the latest version of musrfit the configure script tries to determine automatically if Qt4.5 or higher is set up on the machine. In case this is found, the editor musredit is built already together with musrfit. If not, one can either try to call the configure script with the "--with-qt4" option or install this editor separately: + +

5.4 musredit

+In the latest version of musrfit the configure script tries to determine automatically if Qt4.5 or higher is set up on the machine. In case this is found, the editor musredit is built already together with musrfit. If not, one can either try to call the configure script with the "--with-qt4" option (MacPort: for Mac OS X < 10.11 this is likley /opt/local/libexec/qt4, for Mac OS X >= 10.11 this is likely /usr/local/libexec/qt4) or install this editor separately:
-cd src/musredit
-qmake musredit.pro
+$ cd ~/Apps/musrfit/src/musredit
+$ qmake musredit.pro
 
If everything went fine musredit can be compiled and installed:
-make
-make install
+$ make
+$ make install
 
The last command copies musredit.app to the standard program directory /Applications and the musredit_startup.xml to $ROOTSYS/bin/musredit_startup.xml. Eventually, in the installed musredit_startup.xml the path specifications have to be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual.

-

5.5 musrgui

+

5.5 musrgui (obsolete)

If Qt3 is set up the installation of the musrfit editor can be done as follows from within the shell:
-cd src/musrgui
-qmake musrgui.pro
-make
-make install
+$ cd ~/Apps/musrfit/src/musrgui
+$ qmake musrgui.pro
+$ make
+$ make install
 
-The last command copies musrgui.app to the standard program directory /Applications (4) and the musrgui_startup.xml to $ROOTSYS/bin/musrgui_startup.xml. Eventually, in the installed musrgui_startup.xml the path-specifications have to be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual. +The last command copies musrgui.app to the standard program directory /Applications (4) and the musrgui_startup.xml to $ROOTSYS/bin/musrgui_startup.xml. Eventually, in the installed musrgui_startup.xml the path-specifications have to be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual.

Under some circumstances it might happen, that if musrgui was called from Finder the necessary libraries for executing musrfit could not be found. In that case, the only workaround for the moment is to export the environment variable DYLD_LIBRARY_PATH in the shell and call musrgui from a terminal! In order to accomplish that, add the following lines to ~/.profile and call musrgui with the specified command (e.g. mgui):
-export DYLD_LIBRARY_PATH=/opt/root-system/lib:/sw/lib:$DYLD_LIBRARY_PATH
+export DYLD_LIBRARY_PATH=/opt/root-system/lib:/sw/lib:$DYLD_LIBRARY_PATH
 alias mgui='/Applications/musrgui.app/Contents/MacOS/musrgui'
 

@@ -810,97 +884,45 @@ alias mgui='/Applications/musrgui.app/Contents/MacOS/musrgui'

Notes

- 4 : In the case qt3-mac has not been installed, there will be no musrgui.app but only the executable musrgui which will be placed in the directory $ROOTSYS/bin and has to be called from the terminal. + 2 : When using GCC ≥ 4.2 please make sure that the environment variables USE_PARALLEL_MINUIT2 and USE_OPENMP are not set! Otherwise MINUIT2 will be compiled with parallelization support and cannot be used together with musrfit afterwards since the musrfit code is not fully thread-safe! When compiled with GCC ≥ 4.2 musrfit itself will parallelize the χ2 calculation. +

+ 4 : In the case qt3-mac has not been installed, there will be no musrgui.app but only the executable musrgui which will be placed in the directory $ROOTSYS/bin and has to be called from the terminal.


-

5.6 Check of the installation

+

5.6 Check of the installation

In order to perform a quick test for finding out if the installation has been completed successfully, a few msr files together with the corresponding data files can be found in the musrfit source tree at doc/examples/.
If musrgui has been installed, just open one of the test-*.msr files in the editor and test the musrfit functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:
-cd doc/examples
-musrview test-histo-ROOT-NPP.msr
+$ cd ~/Apps/musrfit/doc/examples
+$ musrview test-histo-ROOT-NPP.msr
 

--- BMW & AS
-
- - - - - +

+

- - -
- -
- Edit | Attach | Print version | PDF | History: r60 < r59 < r58 < r57 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r60 - 25 Oct 2014, AndreasSuter
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
This topic: MUSR > WebHome > MusrFit > MusrFitSetup
+Topic revision: 23 Nov 2015, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/MusrGui.html b/doc/html/user/MUSR/MusrGui.html index 222bf1a4..aa20246d 100644 --- a/doc/html/user/MUSR/MusrGui.html +++ b/doc/html/user/MUSR/MusrGui.html @@ -1,35 +1,72 @@ - + - - + + - MUSR :: MusrGui - + MUSR :: MusrGui + + + + + + + - + - - + + + + + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + +
-
+
-
-
+
+
+
+

musredit / (musrgui)

-

- - - -

-

-

-

-
-

musrgui / musredit

-

-
    -
  • musrgui / musredit +

    -

    1 Introduction

    -musrgui and musredit are editors which also provide a graphical user interface to the programs contained in the musrfit suite and are intended to help the user handle musrfit msr files. They are implemented in C++ and use the Qt framework. Principally, musrgui and musredit are doing the same, but are based on different Qt versions. musrgui is based on Qt 3.x and will only be maintained on bug-fixing level since the Qt 3.x licensing is less straight forward than the Qt 4.x one. musredit is based on Qt 4.6 (or above) and this is the program which will be developed further.
    +

    1 Introduction

    +musredit and musrgui are editors which also provide a graphical user interface to the programs contained in the musrfit suite and are intended to help the user handle musrfit msr files. They are implemented in C++ and use the Qt framework. Principally, musrgui and musredit are doing the same, but are based on different Qt versions. musrgui is based on Qt 3.x and will only be maintained on bug-fixing level since the Qt 3.x licensing is less straight forward than the Qt 4.x one. musredit is based on Qt 4.6 (or above) and this is the program which will be developed further.
    On this documentation page only the features related to musrfit are described—the basic editor functions which should be self-explanatory are not. Before going on using musrgui / musredit it is strongly recommended to read the manual of musrfit first!

    -

    2 Available Executables, Configuration Files and their Basic Usage

    - -

    2.1 musrgui / musredit

    -musrgui / musredit are the editor executables. If called from within a shell they accept a few optional parameters:
    +

    2 Available Executables, Configuration Files and their Basic Usage

    + +

    2.1 musredit / (musrgui)

    +musredit / musrgui are the editor executables. If called from within a shell they accept a few optional parameters:
    <msr_files>
    file names of the msr files that should be opened in separate editor tabs on startup of musrgui / musredit.
    --help
    displays a small help notice in the shell explaining the basic usage of the program
    --version
    prints the version number of musrgui / musredit @@ -147,11 +189,11 @@ On this documentation page only the features related to musrfit are

    If called without any parameters an empty editor window opens.

    - -

    2.2 musrgui_startup.xml / musredit_startup.xml

    -musrgui_startup.xml / musredit_startup.xml are configuration files located at the musrgui / musredit binary path. It is also possible to have another version of this file in the working directory which then will be used! + +

    2.2 musredit_startup.xml / musrgui_startup.xml

    +musredit_startup.xml / musrgui_startup.xml are configuration files located at the musredit / musrgui binary path. It is also possible to have another version of this file in the working directory which then will be used!

    -In this file the following XML tags are allowed to define settings and might proof useful for all users of musrgui / musredit:
    +In this file the following XML tags are allowed to define settings and might proof useful for all users of musredit / musrgui:
    <general></general>
    set the default paths to executables and files in this environment
    <exec_path>PATH_TO_EXEC</exec_path>
    set the path PATH_TO_EXEC where the executables musrfit, musrview, musrt0, etc. can be found (inside the <general> environment)
    <default_save_path>SAV_PATH</default_save_path>
    specify the path SAV_PATH where musrgui / musredit point by default when opening and saving msr files (inside the <general> environment) @@ -188,13 +230,13 @@ Additionally, there are some settings defined in this XML file which should be o
    <help_section></help_section>
    define various help messages in this environment
    <help_main>HELP TEXT</help_main>
    set the main help message HELP TEXT here (inside a <help_section> environment)
    -
    <func_pixmap_path>PIX_PATH</func_pixmap_path>
    set the path PIX_PATH to LaTeX_logo.png pixmaps visualizing the various supported theory functions +
    <func_pixmap_path>PIX_PATH</func_pixmap_path>
    set the path PIX_PATH to LaTeX_logo.png pixmaps visualizing the various supported theory functions
    <theory_functions></theory_functions>
    define the functions for a msr file's THEORY block according to the correct syntax in this environment
    <func></func>
    specify a function here (inside a <theory_functions> environment)
    <name>NAME</name>
    the NAME of the function in the msr file (inside a <func> environment)
    <comment>COMMENT</comment>
    description of the used parameters (inside a <func> environment)
    <label>LABEL</label>
    LABEL of the function in the musrgui / musredit menu (inside a <func> environment) -
    <pixmap>PIXMAP</pixmap>
    LaTeX_logo.png picture used to describe the function and stored in the PIX_PATH (inside a <func> environment) +
    <pixmap>PIXMAP</pixmap>
    LaTeX_logo.png picture used to describe the function and stored in the PIX_PATH (inside a <func> environment)
    <params>N</params>
    number of parameters N used by the function (inside a <func> environment)
    @@ -264,143 +306,94 @@ An example of the musrgui_startup.xml looks like: </musrgui_startup>

    - -

    3 musrfit Features

    + +

    3 musrfit Features

    The features of musrfit which can be accessed by the graphical front ends musrgui / musredit are described in the following. All functions can either be called by choosing them from the MusrFit menu, by clicking the respective button in the MusrFit bar, or by using a keyboard shortcut. -

    -
    musrasym.png Asymmetry Default (Alt+a)
    Generate a full msr file suitable for the fit type 2 of musrfit from defaults. Calling this function opens a window where the relative path and file name to a data file as well as the file format that should be used have to be specified. For instance if the data file /path-to-datadir/2007/lem07_his_8472.root should be used and /path-to-datadir is on the path where musrfit looks for data files then the file name would be 2007/lem07_his_8472 and the file format either ROOT-NPP or ROOT-PPC. -
    -

    -
    musrsinglehisto.png Single-Histogram Default (Alt+h)
    Generate a full msr file suitable for the fit type 0 of musrfit from defaults. Calling this function opens a window where the relative path and file name to a data file as well as the file format that should be used have to be specified. For instance if the data file /path-to-datadir/d2007/deltat_pta_gps_8472.bin should be used and /path-to-datadir is on the path where musrfit looks for data files then the file name would be d2007/deltat_pta_gps_8472 and the file format PSI-BIN. -
    -

    -
    musrcalcchisq.png Calculate Chisq (Alt+c)
    musrfit <msr_file> --chisq-only
    is called for the <msr_file> selected in the editor. For further information refer to the manual of musrfit. -
    -

    -
    musrfit.png Fit (Alt+f)
    musrfit <msr_file> [optional parameters]
    is called for the <msr_file> selected in the editor. The optional parameters may be chosen under Preferences. For further information refer to the manual of musrfit. -
    -

    -
    musrswap.png Swap Msr ↔ Mlog (Alt+s)
    Swap the msr and mlog files. E.g., for a file called 8472_zf.msr, this is copied to 8472_zf.mlog and vice versa. -
    -

    -
    musrmsr2data.png Msr2data (Alt+m)
    Opens a graphical interface to the msr2data program described in detail in its own manual. -
    -

    -
    musrview.png View (Alt+v)
    musrview <msr_file>
    is called for the <msr_file> selected in the editor. For further information refer to the manual of musrfit. -
    -

    -
    musrt0.png T0 (Alt+t)
    musrt0 <msr_file>
    is called for the <msr_file> selected in the editor. For further information refer to the manual of musrfit. -

    -
    -
    musrprefs.png Preferences (Alt+p)
    Opens a window in which the optional parameters that should be passed to musrfit can be chosen. These options are --keep-mn2-output, --dump ascii, --dump root, and --title-from-data-file. For further information refer to the manual of musrfit. Additionally, the access to musrt0 can be enabled temporarily. -
    -

    -
    musrdump.png Dump Header
    Opens a file dialog which allows to select a μSR data file. When this file can be read, the run header info is dumped into a dialog window. Essentially this calls dump_header internally. -
    + $ musrasym.png Asymmetry Default (Alt+a): Generate a full msr file suitable for the fit type 2 of musrfit from defaults. Calling this function opens a window where the relative path and file name to a data file as well as the file format that should be used have to be specified. For instance if the data file /path-to-datadir/2007/lem07_his_8472.root should be used and /path-to-datadir is on the path where musrfit looks for data files then the file name would be 2007/lem07_his_8472 and the file format either ROOT-NPP or ROOT-PPC.

    - -

    4 Editor Features

    + $ musrsinglehisto.png Single-Histogram Default (Alt+h): Generate a full msr file suitable for the fit type 0 of musrfit from defaults. Calling this function opens a window where the relative path and file name to a data file as well as the file format that should be used have to be specified. For instance if the data file /path-to-datadir/d2007/deltat_pta_gps_8472.bin should be used and /path-to-datadir is on the path where musrfit looks for data files then the file name would be d2007/deltat_pta_gps_8472 and the file format PSI-BIN. +

    + $ musrcalcchisq.png Calculate Chisq (Alt+c):
    musrfit <msr_file> --chisq-only
    is called for the <msr_file> selected in the editor. For further information refer to the manual of musrfit. +

    + $ musrfit.png Fit (Alt+f):
    musrfit <msr_file> [optional parameters]
    is called for the <msr_file> selected in the editor. The optional parameters may be chosen under Preferences. For further information refer to the manual of musrfit. +

    + $ musrswap.png Swap Msr ↔ Mlog (Alt+s): Swap the msr and mlog files. E.g., for a file called 8472_zf.msr, this is copied to 8472_zf.mlog and vice versa. +

    + $ musrmsr2data.png Msr2data (Alt+m): Opens a graphical interface to the msr2data program described in detail in its own manual. +

    + $ musrview.png View (Alt+v):
    musrview <msr_file>
    is called for the <msr_file> selected in the editor. For further information refer to the manual of musrfit. +

    + $ musrt0.png T0 (Alt+t):
    musrt0 <msr_file>
    is called for the <msr_file> selected in the editor. For further information refer to the manual of musrfit. +

    + $ musrFT.png Raw Fourier: musrFT <with-many-options> is called. For a proper documentation of it, check the manual of musrFT. +

    + + $ musrprefs.png Preferences (Alt+p): Opens a window in which the optional parameters that should be passed to musrfit can be chosen. These options are --keep-mn2-output, --dump ascii, --dump root, and --title-from-data-file. For further information refer to the manual of musrfit. Additionally, the access to musrt0 can be enabled temporarily. +

    + $ musrdump.png Dump Header: Opens a file dialog which allows to select a μSR data file. When this file can be read, the run header info is dumped into a dialog window. Essentially this calls dump_header internally. +

    + +

    4 Editor Features

    Besides the functions described above and which are mostly interfacing musrfit/msr2data the editors of musrgui / musredit offer various functions for manipulating especially musrfit msr files: -musrgui editor features
      +musrgui editor features
      • Upon right-clicking an open msr file a menu as shown to the right is displayed which offers the addition of any valid msr file block or theory function. In case a simple theory function is chosen, the function will be inserted into the THEORY block using the correct syntax. If one chooses to add a whole block to the file a dialog opens in which the necessary information for each block as described in the manual of musrfit can be supplied. This feature is available only in musrgui. In musredit the respective functions can be accessed through the Edit menu.
      • In order to comment or uncomment lines in a msr file select the according lines and apply Edit → (Un)Comment or use the keyboard shortcut Ctrl+(Shift)+m.

      - -

      5 Bugtracking

      + +

      5 Bugtracking

      -For reporting bugs or requesting new features and improvements please use the PSI Tracker or send an e-mail to A. Suter. +For reporting bugs or requesting new features and improvements please use the Bitbucket Tracker, PSI Tracker (PSI account needed) or send an e-mail to A. Suter.

      --- BMW & AS
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r19 < r18 < r17 < r16 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r19 - 25 May 2012, AndreasSuter
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+ + + + + + + + + + + + + + + + + + + + + + +
Topic attachments
I Attachment Action Size Date Who Comment
musrgui-editor-v0.pngpng musrgui-editor-v0.png manage 37 K 10 Apr 2009 - 14:53 UnknownUser musrgui options available upon right clicking a open msr-file
+
+
This topic: MUSR > WebHome > MusrFit > MusrGui
+Topic revision: 19 Feb 2015, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/MusrRoot.html b/doc/html/user/MUSR/MusrRoot.html index c81b5d54..5478a392 100644 --- a/doc/html/user/MUSR/MusrRoot.html +++ b/doc/html/user/MUSR/MusrRoot.html @@ -1,35 +1,72 @@ - + - - + + - MUSR :: MusrRoot - + MUSR :: MusrRoot + + + + + + + - + - - + + + + + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + + + + + +
-
+
-
-
+
+
+
+

MusrRoot

-

- - - -

-

-

-

-
-

MusrRoot

-

-
    +

    -

    1 Introduction

    +

    1 Introduction

    Until 2011 different μSR file formats were used within PSI. The bulk-μSR instruments were writing their data in the PSI-BIN file format, which is a fixed binary format with rather stringent limitations. The LE-μSR (LEM) instrument was using a ROOT (CERN) based file format which was tightly tailored to the special needs of the LEM instrument. This situation was unsatisfactorily and hence it was decided to move forward to a open file format called MusrRoot to be described in the following.

    -

    2 Some Basics Concerning ROOT Files

    -The μSR data acquisition systems at PSI are utilizing MIDAS (see Midas Home Page ). The MIDAS analyzer, which is responsible to build histograms, especially the μSR decay histograms, makes it very easy to build ROOT (see ROOT/CERN home page ) histogram objects (these are TH1F objects for μSR decay histograms). ROOT is a C++ object-oriented data mining frame work. These histograms can be collected and saved in ROOT files (TFile). In order to ease the understanding of the upcoming definitions, a few ROOT related things shall be summaries here. For details concerning the ROOT frame work documentation please check ROOT/CERN Users Guide and ROOT/CERN Reference Guide . +

    2 Some Basics Concerning ROOT Files

    +The μSR data acquisition systems at PSI are utilizing MIDAS (see Midas Home Page ). The MIDAS analyzer, which is responsible to build histograms, especially the μSR decay histograms, makes it very easy to build ROOT (see ROOT/CERN home page ) histogram objects (these are TH1F objects for μSR decay histograms). ROOT is a C++ object-oriented data mining frame work. These histograms can be collected and saved in ROOT files (TFile). In order to ease the understanding of the upcoming definitions, a few ROOT related things shall be summaries here. For details concerning the ROOT frame work documentation please check ROOT/CERN Users Guide and ROOT/CERN Reference Guide .

    ROOT files (TFile) are binary files which can hold any kind of objects. A TFile is organized similarly to a directory structure of an operating system. Within the ROOT framework, there is a TFile browser available which allows to inspect these files. This browser (TBrowser) will show all object saved in the TFile directly, if they derive from TObject.

    @@ -162,7 +204,7 @@ The MusrRoot file format to be described below is only using a smal

    Since all these objects are deriving form TObject, they will be directly accessible via the TBrowser -object. For instance, the μ-decay-histograms can be directly plotted, are even fitted, out of the box.

    -

    3 MusrRoot an Extensible Open File Format for μSR

    +

    3 MusrRoot an Extensible Open File Format for μSR

    As mentioned before, ROOT files are open-file-format files meaning that they can contain more entries (and most probably will) than the ones specified in the following. The specified ones will be the mandatory ones for all instruments. Before defining all mandatory entries, the MusrRoot file structure shall be sketched.

    @@ -192,7 +234,7 @@ RunHeader ---| where hDecay001, etc. are ROOT histograms (to be more specific: TH1F), containing the μSR decay histograms. There can be as many as needed, especially there is no limitation about their length. The histogram object names will be hDecayXXX, where XXX (leading zero int, i.e. %03d in C/C++ notation, starting with `1') is the histogram number. The title and name of the histogram (see description of the TH1F ROOT class) contains the label of the histogram, like `top', `forward', etc. How many of these histograms are present is accessible through the RunInfo folder in which the necessary header information are found (details see next sections). The folder SCAnaModule contains histograms of some of the slow-control parameters, as for instance the sample temperature versus time, the applied field versus time, etc. Again the label of the histogram will give more specific information about its content.

    -

    3.1 Run Information Contained in RunHeader

    +

    3.1 Run Information Contained in RunHeader

    The RunHeader contains all needed meta-information to describe a μSR-run. The list of the minimal number of required "folders" of the RunHeader is given in the following structure:

    @@ -204,40 +246,40 @@ RunHeader (TFolder) ---|
                            |- BeamlineInfo (TObjArray)
     

    -In brackets the object type is given. RunInfo contains most information relevant for the user and will be itemized Sec. RunInfo Overview and RunInfo Required. DetectorInfo contains detector specific information, like detector name, time zero bin, etc. (details in Sec. DetectorInfo Required). SampleEnvironmentInfo (details in Sec. SampleEnvironmentInfo Required), and MagneticFieldEnvironmentInfo (details in Sec. MagneticFieldEnvironmentInfo Required) store additional, more detailed information concerning the sample environment. BeamlineInfo stores beamline relevant information (details in Sec. BeamlineInfo Required). +In brackets the object type is given. RunInfo contains most information relevant for the user and will be itemized Sec. RunInfo Overview and RunInfo Required. DetectorInfo contains detector specific information, like detector name, time zero bin, etc. (details in Sec. DetectorInfo Required). SampleEnvironmentInfo (details in Sec. SampleEnvironmentInfo Required), and MagneticFieldEnvironmentInfo (details in Sec. MagneticFieldEnvironmentInfo Required) store additional, more detailed information concerning the sample environment. BeamlineInfo stores beamline relevant information (details in Sec. BeamlineInfo Required).

    Before elaborating more on the required items within this structure, a few words on the ROOT types used here: RunHeader is a TFolder object. All the "sub-directory" entries are of type TObjArray and collect items of type TObjString or other TObjArray (i.e. sub-directories and sub-sub-directories, etc.).

    - -

    3.1.1 RunInfo Overview

    + +

    3.1.1 RunInfo Overview

    - +
    - - - + + + - + - - + + - - + + - + @@ -247,7 +289,7 @@ Before elaborating more on the required items within this structure, a few words - + @@ -257,52 +299,52 @@ Before elaborating more on the required items within this structure, a few words - + - + - + - + - + - + - + - + - + - + @@ -312,64 +354,64 @@ Before elaborating more on the required items within this structure, a few words - + - + - + - + - + - + - + - +
    Name Internal Type Comment Name Internal Type Comment
    Version TString TString SVN version of TMusrRunHeader
    Generic Validator URL TString URL of the generic MusrRoot validation xsd-file. TString URL of the generic MusrRoot validation xsd-file.
    Specific Validator URL TString URL of the instrument specific validation xsd-file. TString URL of the instrument specific validation xsd-file.
    Generator TString TString Program which wrote the MusrRoot file,
    File Name TString TString File name of the MusrRoot file,
    Run Title TString TString  
    Run Number Int_t Int_t  
    Run Start Time TString TString ISO 8601 date time
    Run Stop Time TString TString ISO 8601 date time
    Run Duration TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity run duration in sec
    Laboratory TString TString e.g. PSI
    Instrument TString TString e.g. GPS
    Muon Beam Momentum TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity e.g. 28.1 MeV/c
    Muon Species TString TString positive, or negative muon
    Muon Source TString TString e.g. Target E - Low Energy Muons or
    Setup TString TString  
    Comment TString TString  
    Sample Name TString TString  
    Sample Temperature TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity e.g. 3.21 +- 0.05 K; SP: 3.2; CF1
    Sample Magnetic Field TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity e.g. 350.002 +- 0.005 G; SP: 350; WXY
    No of Histos Int_t Int_t  
    Time Resolution TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity e.g. 0.1953125 ns
    RedGreen Offsets TIntVector TIntVector e.g. 0; 20

    These entries should be clear except for the RedGreen Offsets and the column "Internal Type" which shortly will be discussed before specifying the content of the other required folders.

      -
    1. RedGreen Offsets: in case experiments are performed with external stimuli, there will be a collection of related histograms. For instance for electrical field experiments, there will be histograms for field on/off, doubling the number of needed histograms. In order to distinguish them easier in the data file, the RedGreen Offsets were introduced. One selection of histograms (assuming for the moment 8 detectors) will be numbered from 1 to 8 (lets say the field off ones). The other set of histograms (field on in this example) will then start with 21 through 28 (see table above). The same will be true for the detector information (see Sec. DetectorInfo Required). The entry No of Histos will only give 8 for the given example, meaning that red/green multiplication is defined rather via RedGreen Offsets than the number of histograms. -
    2. Internal Types: in order to ease the handling of the MusrRoot run header, a class TMusrRunHeader is available which deals with it. The "Internal Type" specified, corresponds to the internal representation in within this class. In the MusrRoot file these entries are all saved as browsable ROOT strings (TObjString). The only special type is TMusrRunPhysicalQuantity which is introduced to deal with physical quantities. They always can be represented in the following way: +
    3. RedGreen Offsets: in case experiments are performed with external stimuli, there will be a collection of related histograms. For instance for electrical field experiments, there will be histograms for field on/off, doubling the number of needed histograms. In order to distinguish them easier in the data file, the RedGreen Offsets were introduced. One selection of histograms (assuming for the moment 8 detectors) will be numbered from 1 to 8 (lets say the field off ones). The other set of histograms (field on in this example) will then start with 21 through 28 (see table above). The same will be true for the detector information (see Sec. DetectorInfo Required). The entry No of Histos will only give 8 for the given example, meaning that red/green multiplication is defined rather via RedGreen Offsets than the number of histograms. +
    4. Internal Types: in order to ease the handling of the MusrRoot run header, a class TMusrRunHeader is available which deals with it. The "Internal Type" specified, corresponds to the internal representation in within this class. In the MusrRoot file these entries are all saved as browsable ROOT strings (TObjString). The only special type is TMusrRunPhysicalQuantity which is introduced to deal with physical quantities. They always can be represented in the following way:
     <property name> <value> +- <estimated error> <unit>; SP: <demand>; <description>
     
    -Not all of these values are needed to be given and depending on which are given, the representation in the MusrRoot file will be different (handled by TMusrRunHeader). Examples are given in the comment column of the table above. For details see TMusrRunPhysicalQuantity - Possible Representations. +Not all of these values are needed to be given and depending on which are given, the representation in the MusrRoot file will be different (handled by TMusrRunHeader). Examples are given in the comment column of the table above. For details see TMusrRunPhysicalQuantity - Possible Representations.

    A mock-up TBrowser print-out would look like the one shown in the following figure. You might notice, that at the end of each entry you find a " -@X ", where X is a number. This is an encoding of the internal type of the entry and is the price to be payed not using derived types. The next section will explain this in much more detail.

    -=TMusrRunHeader= mock up. The red shaded entries are of type =TMusrRunPhysicalQuantity= +TMusrRunHeader  mock up. The red shaded entries are of type  TMusrRunPhysicalQuantity

    TMusrRunHeader mock up. The red shaded entries are of type TMusrRunPhysicalQuantity

    - -

    4 TMusrRunHeader Concept

    + +

    4 TMusrRunHeader Concept

    The different μSR instruments need different information to be written into the data file (next to the most important ones: the histograms). The above defined properties are the minimal number of required ones. There are different possible approaches to deal with it on the implementation level.

    • A base class dealing with minimal required standard is defined. Afterwards for each instrument a class is derived which is extending the base class to the needs of the instrument. @@ -389,10 +431,10 @@ Even though the first approach is very clean, it would mean a lot of maintenance

      These properties can be collected by themselves in form of vectors. This way any needed information can be written into the ROOT file. The class TMusrRunHeader is implementing this run header concept. In following section code snippets will be discussed, showing how this is used on level of the MIDAS analyzer, musrfit reader routine, and any2many conversion routines. The section Validation will discuss how to validate MusrRoot files.

      -

      4.1 User Interface for MusrRoot Run Header

      +

      4.1 User Interface for MusrRoot Run Header

      There are two things needed to deal with the MusrRoot run header, namely writing it and reading it. I will start with the writing as will be done in the MIDAS analyzer.

      -

      4.1.1 Writing a MusrRoot Run Header

      +

      4.1.1 Writing a MusrRoot Run Header

      An example program write_musrRoot_runHeader which is writing a full run header is part of the musrfit package. Here I will concentrate just on the most essential parts. First one needs an instance of TMusrRunHeader

      @@ -421,7 +463,7 @@ prop.Set("CF3", MRH_UNDEFINED, 3.27, 0.09, "K", "strange
       header->Set("SampleEnvironmentInfo/CF3", prop);
       

      -Here TMusrRunPhysicalQuantity objects are fed via the use of the overloaded set-method. For details see TMusrRunPhysicalQuantity - Possible Representations. +Here TMusrRunPhysicalQuantity objects are fed via the use of the overloaded set-method. For details see TMusrRunPhysicalQuantity - Possible Representations.

      To set some property within "sub-sub-directories" it would like this:

      @@ -449,7 +491,7 @@ if (header->FillFolder(runHeader)) { f->Close();

      -

      4.1.2 Reading a MusrRoot Run Header

      +

      4.1.2 Reading a MusrRoot Run Header

      The following code snippet shows how the extract the full run header from the MusrRoot file.

      @@ -506,11 +548,11 @@ if (ok) {
       }
       

      - -

      4.2 Validation of a MusrRoot File

      + +

      4.2 Validation of a MusrRoot File

      Since MusrRoot is an open and extensible file format a mechanism is needed to validate that a given file is indeed holding the minimum of required entries. To check this the following scheme is implemented in the program musrRootValidation:

      - +MusrRootValidationScheme.png

      MusrRoot validation scheme

      @@ -524,46 +566,46 @@ In the following this validation scheme will be discussed as it is implemented i

      This validation scheme is useful for people which define instrument specific extensions of the base MusrRoot, as for instance the LEM instrument at PSI. It is also useful for people writing file converters in order to cross check if the generated file is valid.

      - -

      5 RunInfo Required

      + +

      5 RunInfo Required

      - +
      - - - + + + - + - + - + - + - + - + @@ -573,7 +615,7 @@ This validation scheme is useful for people which define instrument specific ext - + @@ -583,52 +625,52 @@ This validation scheme is useful for people which define instrument specific ext - + - + - + - + - + - + - + - + - + - + @@ -638,48 +680,48 @@ This validation scheme is useful for people which define instrument specific ext - + - + - + - + - + - + - + - +
      Name Internal Type Comment Name Internal Type Comment
      Version TString TString SVN version of TMusrRunHeader
      Generic Validator URL TString TString URL of the generic MusrRoot validation xsd-file.
          e.g. http://lmu.web.psi.ch/facilities/software/MusrRoot/Validation/MusrRoot.xsd e.g. http://lmu.web.psi.ch/facilities/software/MusrRoot/Validation/MusrRoot.xsd
      Specific Validator URL TString TString URL of the instrument specific validation xsd-file.
          e.g. for LEM: http://lmu.web.psi.ch/facilities/software/MusrRoot/Validation/MusrRootLEM.xsd e.g. for LEM: http://lmu.web.psi.ch/facilities/software/MusrRoot/Validation/MusrRootLEM.xsd
      Generator TString TString Program which wrote the MusrRoot file,
      File Name TString TString File name of the MusrRoot file,
      Run Title TString TString  
      Run Number Int_t Int_t  
      Run Start Time TString TString ISO 8601 date time
      Run Stop Time TString TString ISO 8601 date time
      Run Duration TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity run duration in sec
      Laboratory TString TString e.g. PSI
      Instrument TString TString e.g. GPS
      Muon Beam Momentum TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity e.g. 28.1 MeV/c
      Muon Species TString TString positive, or negative muon
      Muon Source TString TString e.g. Target E - Low Energy Muons or
      Setup TString TString  
      Comment TString TString  
      Sample Name TString TString  
      Sample Temperature TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity e.g. 3.21 +- 0.05 K; SP: 3.2; CF1
      Sample Magnetic Field TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity e.g. 350.002 +- 0.005 G; SP: 350; WXY
      No of Histos Int_t Int_t  
      Time Resolution TMusrRunPhysicalQuantity TMusrRunPhysicalQuantity e.g. 0.1953125 ns
      RedGreen Offsets TIntVector TIntVector e.g. 0; 20

      - -

      6 DetectorInfo Required

      + +

      6 DetectorInfo Required

      The DetectorInfo is organized in a sub-tree like

      @@ -695,115 +737,115 @@ The numbering of the detectors has to correspond the its histogram, e.g.

      Detector<XXX> has the elements

      - +
      - - - + + + - + - + - + - + - + - +
      Name Internal Type Comment Name Internal Type Comment
      Name TString TString detector name, e.g. Left-NPP
      Histo Number Int_t Int_t histogram number. This number corresponds to the histogram number in the histos/DecayAnaModule sub-tree.
      Histo Length Int_t Int_t length of the histogram
      Time Zero Bin Double_t Double_t The type is Double_t since for the high-field spectrometer at PSI an Int_t representation would be not good enough.
      First Good Bin Int_t Int_t  
      Last Good Bin Int_t Int_t  

      - -

      7 SampleEnvironmentInfo Required

      + +

      7 SampleEnvironmentInfo Required

      Here only a single entry is required, namely

      - +
      - - - + + + - +
      Name Internal Type Comment Name Internal Type Comment
      Cryo TString TString name of the used cryostat, e.g. Konti-2

      - -

      8 MagneticFieldEnvironmentInfo Required

      + +

      8 MagneticFieldEnvironmentInfo Required

      Here only a single entry is required, namely

      - +
      - - - + + + - + - +
      Name Internal Type Comment Name Internal Type Comment
      Magnet Name TString TString name of the used magnet, e.g. WEW.
          In case of ZF measurements, there might be an entry like ZF. In case of ZF measurements, there might be an entry like ZF.

      - -

      9 BeamlineInfo Required

      + +

      9 BeamlineInfo Required

      Here only a single entry is required, namely

      - +
      - - - + + + - +
      Name Internal Type Comment Name Internal Type Comment
      Name TString TString name of the beamline, e.g. piM3.2.

      -

      10 Exhaustive MusrRoot Tree Including Everything Required

      +

      10 Exhaustive MusrRoot Tree Including Everything Required

      Here it is assumed that there are hypothetical red / green data with electric field on/off and light on/off, and hence 4 data sets per detector, and 8 detectors of the instrument: left/forward, top/forward, right/forward, bottom/forward, left/backward, top/backward, right/backward, bottom/backward. To show the whole tree structure, it will be splitted in the representation afterwards, but keep in mind: this will be all part of a single MusrRoot file. I will add comments in the tree structure by the symbol #. Lets start with the μSR data histograms:

      @@ -859,7 +901,7 @@ Next the whole RunHeader. Here the information will be grouped in d
       

       RunInfo:
      -  000 - Version: $Id: TMusrRunHeader.cpp 5092 2012-03-13 07:47:00Z nemu $ -@0
      +  000 - Version: $Id: TMusrRunHeader.cpp 5092 2012-03-13 07:47:00Z nemu $ -@0
         001 - Generic Validator URL: http://lmu.web.psi.ch/facilities/software/MusrRoot/Validation/MusrRoot.xsd -@0
         002 - Specific Validator URL: http://lmu.web.psi.ch/facilities/software/MusrRoot/Validation/MusrRootLEM.xsd -@0
         003 - Generator: nemu_analyzer -@0
      @@ -938,8 +980,8 @@ RunSummary:
       

      Comment: the last sub-tree RunSummary is not following TMusrRunHeader rule <number> - <label>: <value> -@<type>. It is added in the instrument analyzer directly by other means than the TMusrRunHeader::Set -method. This is no problem! Since RunSummary is not part of the required MusrRoot -file. One is quite free in adding any ROOT based information here.

      - -

      11 TMusrRunPhysicalQuantity - Possible Representations

      + +

      11 TMusrRunPhysicalQuantity - Possible Representations

      A physical property can be described as

      @@ -951,7 +993,7 @@ where <property name> is the name of the quantity, e.g.TMusrRunPhysicalQuantity prop; is somewhere defined.
       

      -<property name>: <value> <unit> [; <description>]
      +<property name>: <value> <unit> [; <description>]
       

      Code snippet: @@ -974,7 +1016,7 @@ The number on front of the token (e.g. 011 in front of

      -<property name>: <val> +- <err> <unit>[; <description>]
      +<property name>: <val> +- <err> <unit>[; <description>]
       

      Code snippet: @@ -991,7 +1033,7 @@ Result in the RunHeader/SampleEnvironmentInfo:

      -<property name>: <val> <unit>; SP: <demand>[; <description>]
      +<property name>: <val> <unit>; SP: <demand>[; <description>]
       

      Code snippet: @@ -1026,95 +1068,63 @@ Result in the RunHeader/SampleEnvironmentInfo: 017 - Sample Magnetic Field: 350.002 +- 0.005 G; SP: 350.0; WXY -@3

      --- AndreasSuter - 29 March 2012
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r7 < r6 < r5 < r4 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r7 - 29 Mar 2012, AndreasSuter
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Topic attachments
I Attachment Action Size Date Who Comment
MusrRootValidationScheme.pngpng MusrRootValidationScheme.png manage 96 K 29 Mar 2012 - 11:15 UnknownUser  
RunInfo.pngpng RunInfo.png manage 53 K 27 Mar 2012 - 16:09 UnknownUser  
+
+
This topic: MUSR > MusrRoot
+Topic revision: 29 Mar 2012, suter_a
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/QuickStart.html b/doc/html/user/MUSR/QuickStart.html index 67007c7b..5013e2d0 100644 --- a/doc/html/user/MUSR/QuickStart.html +++ b/doc/html/user/MUSR/QuickStart.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: QuickStart - + MUSR :: QuickStart + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + +
-
+
-
-
-

-

- - - -

-

-

-

-

Quickstart for WKM users

-
    +
    +
    +

    Quickstart for WKM users

    + -

    Introduction

    +

    Introduction

    -musrfit is a program suite for analyzing μSR data. It is implemented in C++/ROOT and uses the MINUIT2 libraries developed at CERN for fitting data. +musrfit is a program suite for analyzing μSR data. It is implemented in C++/ROOT and uses the MINUIT2 libraries developed at CERN for fitting data. Installation instructions for Linux, MS Windows, and Mac OS X can be found here. The full user manual is available here.
    In principle the programs can be used in the same fashion as WKM (wkmfit, wkmview). E.g., for fitting data as defined in the input file 8472.msr one types:
    musrfit 8472.msr
    for plotting data and the corresponding fit one calls:
    musrview 8472.msr
    Additionally, there are editors called musrgui/musredit available which can do everything the emacs plug-in for WKM is capable of and even more. However, before going to use only musrgui / musredit it is strongly recommended to read at least this "Quickstart" since there are a few differences between the programs as well as new features which are partially described in the following.

    -

    Differences between WKM and musrfit msr files

    +

    Differences between WKM and musrfit msr files

    The msr file format of WKM has some weaknesses and has therefore been extended for the use with musrfit. Existing WKM files can be converted using the small utility msr2msr. The changes are:
    • The musrfit msr and mlog files contain an additional column in the FITPARAMETER block for the representation of positive uncertainties if MINOS was called during fitting. In that case the Step column holds the negative uncertainties. If there has not been performed an error analysis using MINOS, the symmetric error can be found in the Step column, whereas the Pos_Error column contains only none entries. The beginning of the FITPARAMETER block then might look like this
      @@ -170,7 +174,7 @@ RUN 2008/lem08_his_8472 MUE4 PSI ROOT-NPP   (name beamline institute dat
       
    • The commands SET BATCH and END RETURN may be omitted in the COMMANDS block.

    -

    Selected new features in musrfit

      +

      Selected new features in musrfit

      • If single-histogram fits are done, the normalization and background constants are given either "per nanosecond" or "per rebinned bin". The nanosecond normalization allows to change the binning without the need of re-doing the fit to the data.
      • The use of functions in the RUN block is now possible for the normalization parameter, e.g. for the definition of an α parameter in simultaneous single-histogram fits of two histograms.
      • Apart from the default χ2 minimization, when doing single-histogram fits (fit type 0) in musrfit there is also the possibility to do a log-likelihood maximization instead. For switching, just put MAX_LIKELIHOOD in the COMMANDS block. @@ -200,7 +204,7 @@ RUN 2008/lem08_his_8472 MUE4 PSI ROOT-NPP (name beamline institute dat
      • gamma_mu = γμ/2π = 0.0135538817 MHz/G
      • pi = π = 3.14159265358979323846
      -
    • As theory function also the so called skewed Gaussian can be chosen. The properties of this function are summarized in a memo pdf. The function is called in the THEORY block as follows:
      +
    • As theory function also the so called skewed Gaussian can be chosen. The properties of this function are summarized in a memo pdf. The function is called in the THEORY block as follows:
          skewedGss   1  2  3  4 (phase frequency rate_m rate_p)
       
    • After fitting it is possible to keep the MINUIT2 output including the correlation matrix of the parameters. Calling musrfit with the --keep-mn2-ouput or -k option will provide you an ASCII and a ROOT file with the complete output, e.g.
      musrfit 8472.msr --keep-mn2-ouput
      generates 8472-mn2.output and 8472-mn2.root (and of course 8472.mlog). @@ -258,83 +262,29 @@ RUN 2008/lem08_his_8472 MUE4 PSI ROOT-NPP (name beamline institute dat In the above example musrfit reads the data from the file superconductor-data.db; the x and y data are specified by the DB parameter names range and field. An alternative specification of the x and y data by the parameter number in the DB file is also possible!

    --- BMW & AS
    -
    - - - - - +

    +

    - - -
    - -
    - Edit | Attach | Print version | PDF | History: r7 < r6 < r5 < r4 | Backlinks | View wiki text | Refresh | More topic actions -
    -
    Topic revision: r7 - 10 Jul 2011, wojek
    -
    -
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
This topic: MUSR > WebHome > MusrFit > QuickStart
+Topic revision: 10 Jul 2011, wojek
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/TutorialSingleHisto.html b/doc/html/user/MUSR/TutorialSingleHisto.html index 34873b08..6d728ee8 100644 --- a/doc/html/user/MUSR/TutorialSingleHisto.html +++ b/doc/html/user/MUSR/TutorialSingleHisto.html @@ -1,35 +1,72 @@ - + - - + + - MUSR :: TutorialSingleHisto - + MUSR :: TutorialSingleHisto + + + + + + + - + - - + + + + + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + + +
-
+
-
-
-

-

- - - -

-

-

-

-

musrfit Single-Histogram-Fit Tutorial

+
+
+

musrfit Single-Histogram-Fit Tutorial

The μSR-data-analysis process using musrfit is based on so-called msr files. These files contain all information needed for the analysis such as names of the data files, a theory function, fit and plot parameters, and so on. It is the idea of this page to explain the basic use of an msr file and the different programs of the musrfit suite using the example of a single-histogram fit to time-differential transverse-field μSR data. For a complete description of all options please refer to the manual.

-The example deals with a diamagnetic sample that has been measured in an applied field of approximately 150 G in the GPS spectrometer at PSI using the "transverse geometry". In this geometry the muon spin is rotated about 50° up and the field is applied parallel to the muon momentum. Hence, the relevant positron counters (to detect the spin precession) are placed above (histogram 3), below (histogram 4) and right of (histogram 5) the sample. The run numbers start from 3110. +The example deals with a diamagnetic sample that has been measured in an applied field of approximately 150 G in the GPS spectrometer at PSI using the "transverse geometry". In this geometry the muon spin is rotated about 50° up and the field is applied parallel to the muon momentum. Hence, the relevant positron counters (to detect the spin precession) are placed above (histogram 3), below (histogram 4) and right of (histogram 5) the sample. The run numbers start from 3110.

To analyze these data (in a simple way) one starts out from the msr file 3110_tutorial.msr provided together with the source-code distribution in the sub-directory doc/examples/. This ASCII file can be edited using any text editor. For convenience the editors musredit/musrgui are provided which offer some msr-file-specific functionalities and additionally serve as front ends to the underlying programs. In the following it is assumed that the file is open within musredit.

-

1 The msr file

+

1 The msr file

The msr file itself is divided into different blocks—a full description of the format can be found here. In the file 3110_tutorial.msr these blocks are successively:
    @@ -230,134 +269,138 @@ STATISTIC --- 2011-07-09 10:58:44 This block is the last block of a msr file. It contains some information on the fit: the date and time as well as the absolute and normalized values of χ2 and the number of degrees of freedom in the fit.
    These information only have a meaning if the fitting procedure has been executed at least once and the fit has converged!

-

2 Determine t0 and the data range using musrt0

+

2 Determine t0 and the data range using musrt0

Before the given model can be fitted to the data, the data ranges and time zeros of the different RUN blocks have to be set correctly. This can be achieved using musrt0. Starting this program by selecting the musrt0.png button in musredit or calling from a terminal
musrt0 3110_tutorial.msr
opens an interactive window plotting the data of the first RUN block:
-musrt0-1
+musrt0-1
The green line (at bin 1) represents time zero, the blue lines the start (at bin 1) and end (at bin 8000) of the data range and the optional red lines give the limits of the background range (if the background shall not be determined by the fit). All lines can be either dragged to reasonable locations or set by pressing the corresponding keyboard shortcuts. In the example the time zero can be set by pressing T (which moves the green line to the bin containing the maximum number of counts), the start of the data range should be set to about five bins later by zooming into the graph around bin 250 and pressing d when the cursor is found at a suitable location:
-musrt0-2
+musrt0-2
After all lines have been adjusted for the first histogram, one can go on to the second by pressing q. This procedure is repeated until all ranges have been set correctly. When finished with the last histogram the new t0 and data-range values will be written to the msr file. A full description of musrt0 can be found here.

-

3 Fit the model to the data using musrfit

-Now that the basics of the msr file have been introduced and the necessary adjustments have been done one can proceed with fitting the specified model to the data. This is done by selecting the musrfit.png button in musredit or calling from a terminal
musrfit 3110_tutorial.msr
+

3 Fit the model to the data using musrfit

+Now that the basics of the msr file have been introduced and the necessary adjustments have been done one can proceed with fitting the specified model to the data. This is done by selecting the musrfit.png button in musredit or calling from a terminal
musrfit 3110_tutorial.msr

After the fitting procedure has finished the msr file is updated and contains the newly determined values of the fit parameters.

-

4 View the data and the fit using musrview

+

4 View the data and the fit using musrview

The data and the corresponding fit can be visualized by choosing musrview.png in musredit or calling from a terminal
musrview 3110_tutorial.msr
This creates the windows according to the given PLOT blocks in the msr file:
-musrview-1
-musrview-2
+musrview-1
+musrview-2
The basic features of musrview can be found in the Musrfit menu. They include:
  • export the shown data and the model to an ASCII file with comma-separated values
  • presenting the difference between the shown data and the model (keyboard shortcut: d) -
  • calculate and show the Fourier transform of the shown data (keyboard shortcut: f), e.g. for the asymmetry of the "Up" and "Down" detectors:
    musrview-3
    +
  • calculate and show the Fourier transform of the shown data (keyboard shortcut: f), e.g. for the asymmetry of the "Up" and "Down" detectors:
    musrview-3

-

5 Process multiple msr files using msr2data

+

5 Process multiple msr files using msr2data

This short introduction is concluded by calling attention to the program msr2data. As the name indicates the main purpose of this program is to extract the FITPARAMETER-block information from multiple msr files with the same structure and to summarize them in a single ASCII file (either in TRIUMF DB format or simple columns). However, as described in detail in the manual, it is not only possible to collect data from msr files but also to create new msr files from a template and to process these files using musrfit on the fly.
Assuming the successive runs 3111 through 3114 can be analyzed using the same model introduced above for run 3110 (e.g. in the case one has done measurements at different temperatures) one can use the file 3110_tutorial.msr as template, generate the files 3111_tutorial.msr through 3114_tutorial.msr with the corresponding updates in the RUN blocks, call for each one musrfit and finally summarize the FITPARAMETER-block information of all processed files in an ASCII output file tutorial-T-dependence.dat (simple columns). If further information on the temperature or the applied field is available in the data files these will be included as well in the resulting ASCII file.
From the terminal this would be done as follows:
 msr2data 3110 3114 _tutorial fit-3110 -o tutorial-T-dependence.dat data
 
To achieve the same in musredit one selects musrmsr2data.png and fills the form accordingly:
-msr2data +msr2data

-

6 Further reading

+

6 Further reading

This page only summarizes the very basic features and options of the programs contained in the musrfit suite. For a complete description please refer to the manuals of

--- BMW & AS
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r9 < r8 < r7 < r6 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r9 - 02 Sep 2011, wojek
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Topic attachments
I Attachment Action Size Date Who Comment
msr2data.pngpng msr2data.png manage 34 K 20 Jul 2011 - 13:34 UnknownUser  
musrt0-1.pngpng musrt0-1.png manage 19 K 20 Jul 2011 - 13:38 UnknownUser  
musrt0-2.pngpng musrt0-2.png manage 19 K 09 Jul 2011 - 15:17 UnknownUser  
musrview-1.pngpng musrview-1.png manage 45 K 09 Jul 2011 - 15:48 UnknownUser  
musrview-2.pngpng musrview-2.png manage 36 K 09 Jul 2011 - 15:48 UnknownUser  
musrview-3.pngpng musrview-3.png manage 42 K 09 Jul 2011 - 16:01 UnknownUser  
+
+
This topic: MUSR > TutorialSingleHisto
+Topic revision: 02 Sep 2011, wojek
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/MUSR/WebHome.html b/doc/html/user/MUSR/WebHome.html index eef6a90e..d8b1e5d1 100644 --- a/doc/html/user/MUSR/WebHome.html +++ b/doc/html/user/MUSR/WebHome.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: MUSR - + MUSR :: MUSR + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + +
-
+
-
-
+
+
+

Welcome to the MUSR web

-

- - - -

-

-

-

-
-
- - - - - +

+

- - -
- -
- Edit | Attach | Print version | PDF | History: r46 < r45 < r44 < r43 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r46 - 18 Dec 2014, AndreasSuter
-
-
-
-
 
-
-
-
- -
-

    -
  • -
  • -
-

-

-

-
-
-
-
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
This topic: MUSR > WebHome
+Topic revision: 19 Jan 2016, AndreasSuter
-
- - - +
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding PSI Wiki? Send feedback
+
+
+
+

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/pub/MUSR/Msr2Data/igp_1c17a5bfb1fd01add8e3c7933ca421d5_msr2data-input-tabs.png b/doc/html/user/pub/MUSR/Msr2Data/igp_1c17a5bfb1fd01add8e3c7933ca421d5_msr2data-input-tabs.png new file mode 100644 index 00000000..01830911 Binary files /dev/null and b/doc/html/user/pub/MUSR/Msr2Data/igp_1c17a5bfb1fd01add8e3c7933ca421d5_msr2data-input-tabs.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_1f6a4872a5556d809b896252d177f297.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_1f6a4872a5556d809b896252d177f297.png new file mode 100644 index 00000000..ba73e674 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_1f6a4872a5556d809b896252d177f297.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_3ee4cdd2dc2829c9d29c0f213de51785.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_3ee4cdd2dc2829c9d29c0f213de51785.png new file mode 100644 index 00000000..4cd8db01 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_3ee4cdd2dc2829c9d29c0f213de51785.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_409b6ae604705cd9a31d089bcfba146b.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_409b6ae604705cd9a31d089bcfba146b.png new file mode 100644 index 00000000..e8274811 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_409b6ae604705cd9a31d089bcfba146b.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_53e41adf70ef506cc7668f8593a1b501.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_53e41adf70ef506cc7668f8593a1b501.png new file mode 100644 index 00000000..70a4541e Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_53e41adf70ef506cc7668f8593a1b501.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_5c718f2fbcec7dd36986d69a28eda3db.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_5c718f2fbcec7dd36986d69a28eda3db.png new file mode 100644 index 00000000..767e7a4a Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_5c718f2fbcec7dd36986d69a28eda3db.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_5e07a020de661906573e8fed8eff32bf.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_5e07a020de661906573e8fed8eff32bf.png new file mode 100644 index 00000000..38591c18 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_5e07a020de661906573e8fed8eff32bf.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_7cd3c4b24d4a0c837964ae6b635f9ee0.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_7cd3c4b24d4a0c837964ae6b635f9ee0.png new file mode 100644 index 00000000..6266c004 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_7cd3c4b24d4a0c837964ae6b635f9ee0.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_8024ece95f6c092834e35ca64920583a.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_8024ece95f6c092834e35ca64920583a.png new file mode 100644 index 00000000..64e31752 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_8024ece95f6c092834e35ca64920583a.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_9c7fbcfa6252ecf134381d9921d16bbc.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_9c7fbcfa6252ecf134381d9921d16bbc.png new file mode 100644 index 00000000..6346410e Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_9c7fbcfa6252ecf134381d9921d16bbc.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_a6e7fae88607100e780df97caf1683cf.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_a6e7fae88607100e780df97caf1683cf.png new file mode 100644 index 00000000..5ad6f6e0 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_a6e7fae88607100e780df97caf1683cf.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_e8298362de8db0a5a1d74d409427e7d2.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_e8298362de8db0a5a1d74d409427e7d2.png new file mode 100644 index 00000000..035d8332 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_e8298362de8db0a5a1d74d409427e7d2.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_eec594f64bc6a88c4e6ff8ae6fae8816.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_eec594f64bc6a88c4e6ff8ae6fae8816.png new file mode 100644 index 00000000..ac7c5368 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_eec594f64bc6a88c4e6ff8ae6fae8816.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_f19fedf2f7c0c0d4c869d0c7c0070aeb.png b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_f19fedf2f7c0c0d4c869d0c7c0070aeb.png new file mode 100644 index 00000000..062bf62e Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/_MathModePlugin_f19fedf2f7c0c0d4c869d0c7c0070aeb.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/igp_30b1bd03f016c26e55e7a3979538e223_musrt0.png b/doc/html/user/pub/MUSR/MusrFit/igp_30b1bd03f016c26e55e7a3979538e223_musrt0.png new file mode 100644 index 00000000..f3e692de Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/igp_30b1bd03f016c26e55e7a3979538e223_musrt0.png differ diff --git a/doc/html/user/pub/MUSR/MusrFit/igp_9eac78831993c6c274146a8f75bc15fe_Theory-Tree-with-UserFcn.png b/doc/html/user/pub/MUSR/MusrFit/igp_9eac78831993c6c274146a8f75bc15fe_Theory-Tree-with-UserFcn.png new file mode 100644 index 00000000..d32dd166 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrFit/igp_9eac78831993c6c274146a8f75bc15fe_Theory-Tree-with-UserFcn.png differ diff --git a/doc/html/user/pub/MUSR/MusrGui/igp_6000206c604d890d5466ca71a2eda191_musrgui-editor-v0.png b/doc/html/user/pub/MUSR/MusrGui/igp_6000206c604d890d5466ca71a2eda191_musrgui-editor-v0.png new file mode 100644 index 00000000..fab89753 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrGui/igp_6000206c604d890d5466ca71a2eda191_musrgui-editor-v0.png differ diff --git a/doc/html/user/pub/MUSR/MusrGui/musrFT.png b/doc/html/user/pub/MUSR/MusrGui/musrFT.png new file mode 100644 index 00000000..06e7dc76 Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrGui/musrFT.png differ diff --git a/doc/html/user/pub/MUSR/MusrGui/musrdump.png b/doc/html/user/pub/MUSR/MusrGui/musrdump.png new file mode 100644 index 00000000..b87a0b9b Binary files /dev/null and b/doc/html/user/pub/MUSR/MusrGui/musrdump.png differ diff --git a/doc/html/user/pub/MUSR/TutorialSingleHisto/igp_dabb07604d494aa45c41710849314460_musrt0-2.png b/doc/html/user/pub/MUSR/TutorialSingleHisto/igp_dabb07604d494aa45c41710849314460_musrt0-2.png new file mode 100644 index 00000000..0d85259e Binary files /dev/null and b/doc/html/user/pub/MUSR/TutorialSingleHisto/igp_dabb07604d494aa45c41710849314460_musrt0-2.png differ diff --git a/doc/html/user/pub/Main/SmiliesPluginPSI/eek.gif b/doc/html/user/pub/Main/SmiliesPluginPSI/eek.gif new file mode 100644 index 00000000..43cf2125 Binary files /dev/null and b/doc/html/user/pub/Main/SmiliesPluginPSI/eek.gif differ diff --git a/doc/html/user/pub/System/DocumentGraphics/arrowright.png b/doc/html/user/pub/System/DocumentGraphics/arrowright.png new file mode 100644 index 00000000..b1a18192 Binary files /dev/null and b/doc/html/user/pub/System/DocumentGraphics/arrowright.png differ diff --git a/doc/html/user/pub/System/DocumentGraphics/help.png b/doc/html/user/pub/System/DocumentGraphics/help.png new file mode 100644 index 00000000..5c870176 Binary files /dev/null and b/doc/html/user/pub/System/DocumentGraphics/help.png differ diff --git a/doc/html/user/pub/System/PatternSkin/print.css b/doc/html/user/pub/System/PatternSkin/print.css index 420b3aaa..8fb202ee 100644 --- a/doc/html/user/pub/System/PatternSkin/print.css +++ b/doc/html/user/pub/System/PatternSkin/print.css @@ -1 +1 @@ -body{margin:0;padding:0;}#patternScreen, #patternPageShadow, #patternPage, #patternOuter{margin:0;padding:0;top:0;border:none;float:none;}#patternMain{width:100%;float:none;display:inline;overflow:visible;}#patternSideBar{display:none;}#patternWrapper{height:1%;}#patternTopBar, #patternClearHeaderCenter, #patternClearHeaderLeft, #patternClearHeaderRight, #patternTopBarContentsOuter{display:none;}.patternTopicAction, .patternToolBar, .patternToolBarBottom, .patternHomePath img, .patternHomePathTitle, .foswikiActionFormStepSign{display:none;}#patternMainContents{margin:0;padding:1em 2em;}#patternBottomBar{border:none;}.patternTopicFooter{margin:1em 0 0 0;}#attachmentsshow, #attachmentshide{display:none;}pre, html>body pre{overflow:visible !important;}h1, h2, h3, h4, h5, h6{page-break-after:avoid;page-break-inside:avoid;}img{page-break-inside:avoid;page-break-after:avoid;}blockquote, table, pre{page-break-inside:avoid;}ul, ol, dl{page-break-before:avoid;}.commentPlugin{display:none;}.twistyTrigger{display:none;}.editTableEditImageButton{display:none;}html body{background-color:#fff;}h2, h3, h4, h5, h6{background-color:transparent;}#patternBottomBar{background-color:transparent;}pre, code, tt{color:#5b4221;}.foswikiTable th{border-style:solid;border-width:0 0 1px 1px;border-color:#ccc;color:#000;}.foswikiTable th a:link, .foswikiTable th a:visited, .foswikiTable th a font, .foswikiAttachments .foswikiTable th a:link, .foswikiAttachments .foswikiTable th a:visited, .foswikiAttachments .foswikiTable th a font{color:#000;text-decoration:none;}:visited, .foswikiTopic a:visited{color:#06c;background-color:transparent;}.foswikiAttachments, .patternContent .foswikiAttachments, .foswikiForm, .patternContent .foswikiForm{background-color:#fff;}.patternRevInfo, .foswikiGrayText{color:#666;}.patternRevInfo a:link, .patternRevInfo a:visited .foswikiGrayText a:link, .foswikiGrayText a:visited{color:#666;}@media print{body{margin:0;padding:0;}#patternScreen, #patternPageShadow, #patternPage, #patternOuter{margin:0;padding:0;top:0;border:none;float:none;}#patternMain{width:100%;float:none;display:inline;overflow:visible;}#patternSideBar{display:none;}#patternWrapper{height:1%;}#patternTopBar, #patternClearHeaderCenter, #patternClearHeaderLeft, #patternClearHeaderRight, #patternTopBarContentsOuter{display:none;}.patternTopicAction, .patternToolBar, .patternToolBarBottom, .patternHomePath img, .patternHomePathTitle, .foswikiActionFormStepSign{display:none;}#patternMainContents{margin:0;padding:1em 2em;}#patternBottomBar{border:none;}.patternTopicFooter{margin:1em 0 0 0;}#attachmentsshow, #attachmentshide{display:none;}pre, html>body pre{overflow:visible !important;}h1, h2, h3, h4, h5, h6{page-break-after:avoid;page-break-inside:avoid;}img{page-break-inside:avoid;page-break-after:avoid;}blockquote, table, pre{page-break-inside:avoid;}ul, ol, dl{page-break-before:avoid;}.commentPlugin{display:none;}.twistyTrigger{display:none;}.editTableEditImageButton{display:none;}html body{background-color:#fff;}h2, h3, h4, h5, h6{background-color:transparent;}#patternBottomBar{background-color:transparent;}pre, code, tt{color:#5b4221;}.foswikiTable th{border-style:solid;border-width:0 0 1px 1px;border-color:#ccc;color:#000;}.foswikiTable th a:link, .foswikiTable th a:visited, .foswikiTable th a font, .foswikiAttachments .foswikiTable th a:link, .foswikiAttachments .foswikiTable th a:visited, .foswikiAttachments .foswikiTable th a font{color:#000;text-decoration:none;}:visited, .foswikiTopic a:visited{color:#06c;background-color:transparent;}.foswikiAttachments, .patternContent .foswikiAttachments, .foswikiForm, .patternContent .foswikiForm{background-color:#fff;}.patternRevInfo, .foswikiGrayText{color:#666;}.patternRevInfo a:link, .patternRevInfo a:visited .foswikiGrayText a:link, .foswikiGrayText a:visited{color:#666;}} #peopleIcon {display: none;} #tooltip {display: none;} .ecpHeading img {display: none;} .foswikiTopicInfo { border-bottom: 0; } #patternBottomBar, .patternTopicActions, .foswikiFormSteps { display:none; } .foswikiTopicInfo {margin-top: 50px;} .foswikiTopicInfo h1 a {text-decoration:none;} h1 a:visited { color: #D1400E; }html{overflow:visible} +body{margin:0;padding:0}#patternScreen,#patternPageShadow,#patternPage,.patternViewPage #patternOuter{margin:0;padding:0;top:0;border:0;float:none}#patternMain{width:auto;float:none;display:inline;overflow:visible}#patternSideBar{display:none}#patternWrapper{height:1%}#patternTopBarButtons,#patternTopBar,#patternClearHeaderCenter,#patternClearHeaderLeft,#patternClearHeaderRight,#patternTopBarContentsOuter{display:none}.patternTop,.patternTopicAction,.patternTopicActions,.patternToolBar,.patternToolBarBottom,.patternHomePath img,.patternHomePathTitle,.foswikiContentFooter+.foswikiFormSteps,.foswikiActionFormStepSign{display:none}#patternMainContents{margin:0;padding:1em 2em}#patternBottomBar{display:none}.patternTopicFooter{margin:1em 0 0 0}#attachmentsshow,#attachmentshide{display:none}pre,html>body pre{overflow:visible!important}h1,h2,h3,h4,h5,h6{page-break-after:avoid;page-break-inside:avoid}img{page-break-inside:avoid;page-break-after:avoid}blockquote,table,pre{page-break-inside:avoid}ul,ol,dl{page-break-before:avoid}.commentPlugin{display:none}.twistyTrigger{display:none}.editTableEditImageButton{display:none}html body{background-color:#fff}h2,h3,h4,h5,h6{background-color:transparent}#patternBottomBar{background-color:transparent}pre,code,tt{color:#5b4221}.foswikiTable th{border-style:solid;border-width:0 0 1px 1px;border-color:#ccc;color:#000}.foswikiTable th a:link,.foswikiTable th a:visited,.foswikiTable th a font,.foswikiAttachments .foswikiTable th a:link,.foswikiAttachments .foswikiTable th a:visited,.foswikiAttachments .foswikiTable th a font{color:#000;text-decoration:none}:visited,.foswikiTopic a:visited{color:#06c;background-color:transparent}.foswikiAttachments,.patternContent .foswikiAttachments,.foswikiForm,.patternContent .foswikiForm{background-color:#fff}.patternRevInfo,.foswikiGrayText{color:#666}.patternRevInfo a:link,.patternRevInfo a:visited .foswikiGrayText a:link,.foswikiGrayText a:visited{color:#666}@media print{body{margin:0;padding:0}#patternScreen,#patternPageShadow,#patternPage,#patternOuter{margin:0;padding:0;top:0;border:0;float:none}#patternMain{width:100%;float:none;display:inline;overflow:visible}#patternSideBar{display:none}#patternWrapper{height:1%}#patternTopBar,#patternClearHeaderCenter,#patternClearHeaderLeft,#patternClearHeaderRight,#patternTopBarContentsOuter{display:none}.patternTopicAction,.patternToolBar,.patternToolBarBottom,.patternHomePath img,.patternHomePathTitle,.foswikiActionFormStepSign{display:none}#patternMainContents{margin:0;padding:1em 2em}#patternBottomBar{border:0}.patternTopicFooter{margin:1em 0 0 0}#attachmentsshow,#attachmentshide{display:none}pre,html>body pre{overflow:visible!important}h1,h2,h3,h4,h5,h6{page-break-after:avoid;page-break-inside:avoid}img{page-break-inside:avoid;page-break-after:avoid}blockquote,table,pre{page-break-inside:avoid}ul,ol,dl{page-break-before:avoid}.commentPlugin{display:none}.twistyTrigger{display:none}.editTableEditImageButton{display:none}html body{background-color:#fff}h2,h3,h4,h5,h6{background-color:transparent}#patternBottomBar{background-color:transparent}pre,code,tt{color:#5b4221}.foswikiTable th{border-style:solid;border-width:0 0 1px 1px;border-color:#ccc;color:#000}.foswikiTable th a:link,.foswikiTable th a:visited,.foswikiTable th a font,.foswikiAttachments .foswikiTable th a:link,.foswikiAttachments .foswikiTable th a:visited,.foswikiAttachments .foswikiTable th a font{color:#000;text-decoration:none}:visited,.foswikiTopic a:visited{color:#06c;background-color:transparent}.foswikiAttachments,.patternContent .foswikiAttachments,.foswikiForm,.patternContent .foswikiForm{background-color:#fff}.patternRevInfo,.foswikiGrayText{color:#666}.patternRevInfo a:link,.patternRevInfo a:visited .foswikiGrayText a:link,.foswikiGrayText a:visited{color:#666}html,body{height:auto}#patternFloatWrap{float:none}} \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkinTheme2009/colors.css b/doc/html/user/pub/System/PatternSkinTheme2009/colors.css index 1ff74d91..c14ef204 100644 --- a/doc/html/user/pub/System/PatternSkinTheme2009/colors.css +++ b/doc/html/user/pub/System/PatternSkinTheme2009/colors.css @@ -1,794 +1 @@ -/* PatternSkin colors */ -/* Generated by AttachContentPlugin from System.PatternSkinColorSettings */ - -/* LAYOUT ELEMENTS */ - -#patternScreen { - background:#e2e2e2; -} -#patternPage { - border-color:#ccc; -} -#patternTopBar { - border-color:#e2e2e2; - /* color is defined as WEBHEADERBGCOLOR in System/DefaultPreferences */ -} -#patternMain { /* don't set a background here; use patternOuter */ } -#patternOuter { - background:none; - border-color:#dadada; -} -#patternSideBar, -#patternWrapper { - background:#fff; -} -#patternBottomBar { - border-color:#ccc; - background-color:#f5f5f5; -} -#patternBottomBarContents, -#patternBottomBarContents a:link, -#patternBottomBarContents a:visited { - color:#777; -} -#patternBottomBarContents a:hover { - color:#fff; -} - -/* GENERAL HTML ELEMENTS */ - -html body { - background-color:#f5f5f5; - color:#000; -} -html body.patternEditPage, -.mceContentBody { - background-color:#fff; -} - -/* be kind to netscape 4 that doesn't understand inheritance */ -body, p, li, ul, ol, dl, dt, dd, acronym, h1, h2, h3, h4, h5, h6 { - background-color:transparent; -} -hr { - color:#e2e2e2; - background-color:#e2e2e2; -} -pre, code, tt { - color:#333; -} -pre { - background:#f5f5f5; - border-color:#ddd; -} -blockquote { - background-color:#f5f5f5; - border-color:#ddd; -} -blockquote h2 { - background:none; -} -h1 { - color:#2989bb; -} -h2, h3, h4, h5, h6 { - color:#d1400e; -} -h2 { - border-color:#e2e2e2; -} -h3, h4, h5, h6 { - border-color:#e2e2e2; -} - -/* to override old Render.pm coded font color style */ -.foswikiNewLink font { - color:inherit; -} -.foswikiNewLink a:link sup, -.foswikiNewLink a:visited sup { - color:#777; - border-color:#ddd; -} -.foswikiNewLink a:hover sup { - background-color:#0055b5; - color:#fff; - border-color:#0055b5; -} -.foswikiNewLink { - border-color:#ddd; -} -:link:focus, -:visited:focus, -:link, -:visited, -:link:active, -:visited:active { - color:#4571d0; - background-color:transparent; -} -:link:hover, -:visited:hover { - color:#fff; - background-color:#0055b5; - background-image:none; -} -:link:hover img, -:visited:hover img { - background-color:transparent; -} -.foswikiTopic a:visited { - color:#666; -} -.foswikiTopic a:hover { - color:#fff; -} -.foswikiTopic .foswikiUnvisited a:visited { - color:#4571d0; -} -.foswikiTopic .foswikiUnvisited a:hover { - color:#fff; -} - -/* Form elements */ - -textarea, -input, -select { - border-color:#aaa; - color:#000; - background-color:#fff; -} -.foswikiSubmit, -.foswikiButton { - border-color:#fff #888 #888 #fff; -} -.foswikiSubmit { - color:#fff; - background-color:#06c; -} -.foswikiButton { - color:#000; - background-color:#e2e3e3; -} -.foswikiButtonCancel { - color:#000; - background-color:#f2d5d0; -} -.foswikiSubmitDisabled, -.foswikiSubmitDisabled:active { - border-color:#fff #ccc #ccc #fff; - color:#aaa; - background-color:#eef7fa; -} -.foswikiTextarea, -.foswikiInputField, -.foswikiInputFieldDisabled, -.foswikiInputFieldReadOnly, -.foswikiSelect { - border-color:#bbb #f2f2f2 #f2f2f2 #bbb; -} -.foswikiTextarea, -.foswikiInputField, -.foswikiSelect { - color:#000; - background-color:#fff; -} -.foswikiInputField:active, -.foswikiInputField:focus, -.foswikiInputFieldFocus { - background-color:#ffffe0; -} - -.foswikiTextareaRawView { - color:#000; -} -.foswikiInputFieldDisabled { - color:#aaa; - background-color:#fafaf8; -} -.foswikiInputFieldReadOnly { - color:#777; -} -.foswikiSelect { - border-color:#bbb #f2f2f2 #f2f2f2 #bbb; - color:#000; - background-color:#fff; -} -.foswikiInputFieldDisabled, -.foswikiSelectDisabled { - color:#aaa; - border-color:#bbb #f2f2f2 #f2f2f2 #bbb; - background-color:#fafaf8; -} -.foswikiInputFieldBeforeFocus { - color:#777; -} - -/* ----------------------------------------------------------- - Plugin elements - ----------------------------------------------------------- */ - -/* TablePlugin */ -.foswikiTable, -.foswikiTable td, -.foswikiTable th { - border-color:#eee; -} -.foswikiTable th { - background:#d6d3cf; -} -.foswikiTable th, -.foswikiTable th a:link, -.foswikiTable th a:visited { - color:#000; -} - -/* TwistyContrib */ -.twistyPlaceholder { - color:#777; -} -a:hover.twistyTrigger { - color:#fff; -} - -/* TipsContrib */ -.tipsOfTheDay { -} - -/* RevCommentPlugin */ -.revComment .patternTopicActions { - background-color:#eef7fa; -} - -/* ----------------------------------------------------------- - Foswiki styles - ----------------------------------------------------------- */ - -.foswikiGrayText { - color:#777; -} -.foswikiGrayText a:link, -.foswikiGrayText a:visited { - color:#777; -} -.foswikiGrayText a:hover { - color:#fff; -} - -table.foswikiFormTable th.foswikiFormTableHRow, -table.foswikiFormTable td.foswikiFormTableRow { - color:#777; -} -.foswikiEditForm { - color:#000; -} -.foswikiEditForm .foswikiFormTable, -.foswikiEditForm .foswikiFormTable th, -.foswikiEditForm .foswikiFormTable td { - border-color:#e2e2e2; -} -/* use a different table background color mix: no odd/even rows, no white background */ -.foswikiEditForm .foswikiFormTable td { - background-color:#f7fafc; -} -.foswikiEditForm .foswikiFormTable th { - background-color:#f0f6fb; -} -.patternTwistyButton h3 { - color:#d1400e; -} -.foswikiAttachments table, -table.foswikiFormTable { - border-color:#e2e2e2; - background-color:#fff; -} -.foswikiAttachments table { - background-color:#fff; -} -.foswikiForm td, -.foswikiForm th, -.foswikiAttachments td, -.foswikiAttachments th { - border-color:#e2e2e2; -} -.foswikiAttachments .foswikiTable th font, -table.foswikiFormTable th.foswikiFormTableHRow font { - color:#4571d0; -} - -.foswikiFormSteps { - background-color:#eef7fa; - border-color:#e2e2e2; -} -.foswikiFormStep { - border-color:#e2e2e2; -} -.foswikiFormStep h2 { - color:#2989bb; -} -.foswikiFormStep h3, -.foswikiFormStep h4 { - color:#d1400e; -} -.foswikiFormStep h3, -.foswikiFormStep h4 { - background-color:transparent; -} -.foswikiFormStep .foswikiHelp { - background:#fff; -} -.foswikiToc .foswikiTocTitle { - color:#777; -} -.foswikiBroadcastMessage, -.foswikiNotification { - background-color:#ffe67b; -} -.foswikiNotification { - border:2px solid #ffdf4c; -} -.foswikiMessage { - background-color:#ffe67b; -} -#foswikiLogin .patternLoginNotification { - background-color:#fff; - border-color:#f00; -} -.foswikiHelp { - background-color:#edf5fa; - border-color:#e2e2e2; -} -.foswikiBroadcastMessage b, -.foswikiBroadcastMessage strong { - color:#f00; -} -.foswikiAlert, -.foswikiAlert code { - color:#f00; -} -.foswikiEmulatedLink { - color:#4571d0; -} -.foswikiPageForm table { - border-color:#e2e2e2; - background:#fff; -} -.foswikiPageForm hr { - border-color:#cfcfcf; - background-color:#cfcfcf; - color:#cfcfcf; -} -.foswikiAccessKey { - color:inherit; - border-color:#777; -} -a:link .foswikiAccessKey, -a:visited .foswikiAccessKey { - color:inherit; -} -a:hover .foswikiAccessKey { - color:inherit; -} -.foswikiImage img { - border-color:#eee; - background-color:#fff; -} -#patternTopBar .foswikiImage img { - background-color:transparent; -} -.foswikiImage a:hover img { - border-color:#0055b5; -} - -/* ----------------------------------------------------------- - Pattern skin specific elements - ----------------------------------------------------------- */ -#patternPage { - background-color:#fff; -} -.patternHomePathTitle, -.patternRevInfo, -.patternHomePath a:link, -.patternHomePath a:visited { - border-color:#ddd; - color:#666; -} -.patternTop a:hover { - border:none; - color:#fff; -} -.patternHomePath .patternRevInfo, -.patternHomePath .patternRevInfo a:link, -.patternHomePath .patternRevInfo a:visited { - color:#777; -} -.patternHomePath .patternRevInfo a:hover { - color:#fff; -} - -/* Left bar */ -#patternSideBarContents { - color:#000; -} -#patternSideBarContents hr { - color:#e2e2e2; - background-color:#e2e2e2; -} -#patternSideBarContents a:link, -#patternSideBarContents a:visited { - color:#444; -} -#patternSideBarContents a:hover { - color:#fff; -} -#patternSideBarContents .patternLeftBarPersonal, -#patternSideBarContents .patternWebIndicator { - border-color:#dadada; -} -#patternSideBarContents b, -#patternSideBarContents strong { - color:#d1400e; -} - -.patternTopicActions { - background-color:#2989bb; - color:#bbb; -} -.patternTopicActions s, -.patternTopicActions strike { - color:#aaa; -} -.patternTopicActions .foswikiSeparator { - color:#e2e2e2; -} -.patternActionButtons a:link, -.patternActionButtons a:visited { - color:#fff; -} -.patternActionButtons a:hover { - color:#fff; -} -.patternTopicActions a:link .foswikiAccessKey, -.patternTopicActions a:visited .foswikiAccessKey { - color:#fff; - border-color:#fff; -} -.patternTopicActions a:hover .foswikiAccessKey { - color:#fff; -} -.patternTopicActions label { - color:#000; -} -.patternHelpCol { - color:#777; -} -.patternSigLine { - color:#777; -} -.patternEditTopic { - background:#eef7fa; -} -.patternToolBar a:link .foswikiAccessKey, -.patternToolBar a:visited .foswikiAccessKey { - color:inherit; - border-color:#666; -} -.patternToolBar a:hover .foswikiAccessKey { - background-color:transparent; - color:inherit; - border-color:#666; -} - -/* WebSearch, WebSearchAdvanced */ -table#foswikiSearchTable { - border-color:#e2e2e2; -} -table#foswikiSearchTable th, -table#foswikiSearchTable td { - background-color:#fff; - border-color:#e2e2e2; -} -table#foswikiSearchTable hr { - border-color:#e2e2e2; - background-color:#e2e2e2; -} -table#foswikiSearchTable th { - color:#000; -} - -/* ----------------------------------------------------------- - Search results - styles and overridden styles used in search.pattern.tmpl - ----------------------------------------------------------- */ - -.foswikiSearchResult .foswikiAlert { - color:#f00; -} -.foswikiSearchResult .foswikiSummary .foswikiAlert { - color:#900; -} -.foswikiSearchResult .foswikiBottomRow, -.foswikiSearchResult .foswikiBottomRow a:link, -.foswikiSearchResult .foswikiBottomRow a:visited { - color:#049804; -} -.foswikiSearchResult .foswikiBottomRow:hover a:link, -.foswikiSearchResult .foswikiBottomRow:hover a:visited { - color:#06c; -} -.foswikiSearchResult .foswikiBottomRow:hover a:hover { - color:#fff; -} -.patternViewPage .patternSearchResultsBegin { - border-color:#eee; -} - -/* Search results in book view format */ - -.patternBookView .foswikiTopRow { - background-color:transparent; /* set to WEBBGCOLOR in css.pattern.tmpl */ - color:#777; -} -.patternBookView .foswikiBottomRow { - border-color:#e2e2e2; -} -.patternBookView .patternSearchResultCount { - color:#777; -} - -/* preview.pattern.tmpl */ - -.foswikiPreviewArea { - border-color:#f00; - background-color:#fff; -} - -/* rdiff.pattern.tmpl */ - -.patternDiff { - border-color:#6b7f93; -} -#patternMainContents .patternDiff h4.patternSearchResultsHeader { - background-color:#6b7f93; - color:#fff; -} -#patternMainContents .patternDiff h4.patternSearchResultsHeader a:link, -#patternMainContents .patternDiff h4.patternSearchResultsHeader a:visited { - color:#fff; -} -tr.foswikiDiffDebug td { - border-color:#e2e2e2; -} -.patternDiffPage .foswikiDiffTable th { - background-color:#ccc; -} -/* Changed */ -.foswikiDiffChangedHeader, -tr.foswikiDiffDebug .foswikiDiffChangedText, -tr.foswikiDiffDebug .foswikiDiffChangedText { - background:#9f9; /* green - do not change */ -} -/* Deleted */ -tr.foswikiDiffDebug .foswikiDiffDeletedMarker, -tr.foswikiDiffDebug .foswikiDiffDeletedText { - background-color:#f99; /* red - do not change */ -} -/* Added */ -.foswikiDiffAddedHeader, -tr.foswikiDiffDebug .foswikiDiffAddedMarker, -tr.foswikiDiffDebug .foswikiDiffAddedText { - background-color:#ccf; /* violet - do not change */ -} -/* Unchanged */ -tr.foswikiDiffDebug .foswikiDiffUnchangedText { - color:#777; -} -.foswikiDiffUnchangedTextContents { } -.foswikiDiffLineNumberHeader { - background-color:#ccc; -} - - -/* IMAGES */ -/* image positions are set here as well as these are dependent on the image */ - -#patternTopBar { - /* image is defined as WEBHEADERART in System/DefaultPreferences */ -} -.foswikiToc li { - background-image:url(bullet-toc.gif); - background-repeat:no-repeat; - background-position:0 .4em; -} -.patternPrintPage #patternOuter { - background:#fff; /* white - do not change */ -} -.foswikiSubmit, -.foswikiSubmitDisabled { - background-image:url(bg_submit_gradient.gif); - background-repeat:repeat-x; -} -.foswikiSubmit, -a.foswikiSubmit:link, -a.foswikiSubmit:visited { - background-position:0px 0px; - background-color:#06c; - border-color:#94cce2 #0e66a2 #0e66a2 #94cce2; - color:#fff; -} -.foswikiSubmit:hover, -a.foswikiSubmit:hover { - background-position:0px -80px; - background-color:#0047b7; - border-color:#0e66a2 #94cce2 #94cce2 #0e66a2; - color:#fff; -} -.foswikiSubmit:active, -a.foswikiSubmit:active { - background-position:0px -160px; - background-color:#73ace6; - border-color:#0e66a2 #94cce2 #94cce2 #0e66a2; - color:#fff; -} -.foswikiSubmitDisabled, -.foswikiSubmitDisabled:hover, -.foswikiSubmitDisabled:active { - background-position:0px -240px; - background-color:#d9e8f7; - border-color:#ccc #ccc #ccc #ccc; - color:#ccc; -} -.foswikiButton, -a.foswikiButton:link, -a.foswikiButton:visited { - background-image:url(bg_button_gradient.gif); - background-repeat:repeat-x; - background-position:0px 0px; - border-color:#fff #94cce2 #94cce2 #fff; - background-color:#cce7f1; - color:#333; -} -.foswikiButton:hover, -.foswikiButton:active, -a.foswikiButton:hover, -a.foswikiButton:active { - background-position:0px -160px; - border-color:#94cce2 #94cce2 #94cce2 #94cce2; - background-color:#cce7f1; - color:#333; -} -.foswikiButtonDisabled, -.foswikiButtonDisabled:hover, -.foswikiButtonDisabled:active { - background-image:url(bg_button_gradient.gif); - background-repeat:repeat-x; - background-position:0px -240px; - border-color:#ccc #ccc #ccc #ccc; - background-color:#edece6; - color:#bbb; -} -.foswikiButtonCancel { - background-image:url(bg_buttoncancel_gradient.gif); - background-repeat:repeat-x; - background-position:0px 0px; - border-color:#f3ddd7 #ce5232 #ce5232 #f3ddd7; - background-color:#dd724d; - color:#fff; -} -.foswikiButtonCancel:hover { - background-position:0px -80px; - border-color:#ce5232 #f3ddd7 #f3ddd7 #ce5232; - background-color:#dd724d; - color:#fff; -} -.foswikiButtonCancel:active { - background-position:0px -160px; - border-color:#ce5232 #f3ddd7 #f3ddd7 #ce5232; - background-color:#dd724d; - color:#fff; -} -.patternToolBar span a:link, -.patternToolBar span a:visited, -.patternToolBar span s, -.patternToolBar span strike { - background-image:url(bg_button_gradient.gif); - background-repeat:repeat-x; -} -.patternToolBar span a:link, -.patternToolBar span a:visited { - background-position:0px 0px; - border-color:#fff #94cce2 #94cce2 #fff; - background-color:#cce7f1; - color:#333; -} -.patternToolBar span a:hover { - background-position:0px -80px; - border-color:#94cce2 #94cce2 #94cce2 #94cce2; - background-color:#cce7f1; - color:#222; -} -.patternToolBar span a:active { - background-position:0px -160px; - border-color:#94cce2 #94cce2 #94cce2 #94cce2; - background-color:#e8e5d7; - color:#222; -} -.patternToolBar span s, -.patternToolBar span strike { - background-position:0px -240px; - border-color:#eae9e7 #eae9e7 #eae9e7 #eae9e7; - background-color:#edece6; - color:#bbb; -} -.patternTextareaButton { - border-color:#fffefd #b8b6ad #b8b6ad #fffefd; - overflow:hidden; -} -.patternButtonFontSelector { - background-image:url(button_font_selector.gif); - width:33px; - height:16px; -} -.patternButtonFontSelectorProportional { - background-position:0 0; -} -.patternButtonFontSelectorMonospace { - background-position:0 -16px; -} -.patternButtonEnlarge, -.patternButtonShrink { - background-image:url(button_arrow.gif); - width:16px; - height:16px; -} -.patternButtonEnlarge { - background-position:0 0; -} -.patternButtonEnlarge:hover { - background-position:0 -42px; -} -.patternButtonEnlarge:active { - background-position:0 -84px; -} -.patternButtonShrink { - background-position:16px 0; -} -.patternButtonShrink:hover { - background-position:16px -42px; -} -.patternButtonShrink:active { - background-position:16px -84px; -} -.foswikiBroadcastMessage { - background-image:url(background_alert.gif); - background-repeat:repeat-x; -} - -/* common settings */ -.patternLeftBarPersonal li, -li.patternLogOut, -li.patternLogIn { - padding-left:13px; - background-position:0 .4em; - background-repeat:no-repeat; -} -.patternLeftBarPersonal li { - background-image:url(bullet-personal_sidebar.gif); -} -.patternLeftBarPersonal li.patternLogOut { - background-image:url(bullet-lock.gif); -} -.patternLeftBarPersonal li.patternLogIn { - background-image:url(bullet-lock.gif); -} - -.foswikiJs a.jqPopUpWindow:link, -.foswikiJs a.jqPopUpWindow:visited, -.foswikiJs a.jqPopUpWindow:hover { - background-image:url(popup.gif); - background-repeat:no-repeat; - background-position:right; - padding-right:14px; - margin-right:3px; -} +#patternScreen{background:#e2e2e2}#patternPage{border-color:#ccc}#patternTopBar{border-color:#e2e2e2}#patternOuter{background:0;border-color:#dadada}#patternSideBar,#patternWrapper{background:#fff}#patternBottomBar{border-color:#ccc;background-color:#f5f5f5}#patternBottomBarContents,#patternBottomBarContents a:link,#patternBottomBarContents a:visited{color:#777}#patternBottomBarContents a:hover{color:#fff}html body{background-color:#f5f5f5;color:#000}html body.patternEditPage,.mceContentBody{background-color:#fff}body,p,li,ul,ol,dl,dt,dd,acronym,h1,h2,h3,h4,h5,h6{background-color:transparent}hr{color:#e2e2e2;background-color:#e2e2e2}pre,code,tt{color:#333}pre{background:#f5f5f5;border-color:#ddd}blockquote{background-color:#f5f5f5;border-color:#ddd}blockquote h2{background:0}h1{color:#2989bb}h2,h3,h4,h5,h6{color:#d1400e}h2{border-color:#e2e2e2}h3,h4,h5,h6{border-color:#e2e2e2}.foswikiNewLink font{color:inherit}.foswikiNewLink a:link sup,.foswikiNewLink a:visited sup{color:#777;border-color:#ddd}.foswikiNewLink a:hover sup{background-color:#0055b5;color:#fff;border-color:#0055b5}.foswikiNewLink{border-color:#ddd}:link:focus,:visited:focus,:link,:visited,:link:active,:visited:active{color:#4571d0;background-color:transparent}:link:hover,:visited:hover{color:#fff;background-color:#0055b5;background-image:none}:link:hover img,:visited:hover img{background-color:transparent}.foswikiTopic a:visited{color:#666}.foswikiTopic a:hover{color:#fff}.foswikiTopic .foswikiUnvisited a:visited{color:#4571d0}.foswikiTopic .foswikiUnvisited a:hover{color:#fff}textarea,input,select{border-color:#aaa;color:#000;background-color:#fff}.foswikiSubmit,.foswikiButton{border-color:#fff #888 #888 #fff}.foswikiSubmit{color:#fff;background-color:#06c}.foswikiButton{color:#000;background-color:#e2e3e3}.foswikiButtonCancel{color:#000;background-color:#f2d5d0}.foswikiSubmitDisabled,.foswikiSubmitDisabled:active{border-color:#fff #ccc #ccc #fff;color:#aaa;background-color:#eef7fa}.foswikiTextarea,.foswikiInputField,.foswikiInputFieldDisabled,.foswikiInputFieldReadOnly,.foswikiSelect{border-color:#bbb #f2f2f2 #f2f2f2 #bbb}.foswikiTextarea,.foswikiInputField,.foswikiSelect{color:#000;background-color:#fff}.foswikiInputField:active,.foswikiInputField:focus,.foswikiInputFieldFocus{background-color:#ffffe0}.foswikiTextareaRawView{color:#000}.foswikiInputFieldDisabled{color:#aaa;background-color:#fafaf8}.foswikiInputFieldReadOnly{color:#777}.foswikiSelect{border-color:#bbb #f2f2f2 #f2f2f2 #bbb;color:#000;background-color:#fff}.foswikiInputFieldDisabled,.foswikiSelectDisabled{color:#aaa;border-color:#bbb #f2f2f2 #f2f2f2 #bbb;background-color:#fafaf8}.foswikiInputFieldBeforeFocus{color:#777}.foswikiTable,.foswikiTable td,.foswikiTable th{border-color:#eee}.foswikiTable th{background:#d6d3cf}.foswikiTable th,.foswikiTable th a:link,.foswikiTable th a:visited{color:#000}.twistyPlaceholder{color:#777}a:hover.twistyTrigger{color:#fff}.revComment .patternTopicActions{background-color:#eef7fa}.foswikiGrayText{color:#777}.foswikiGrayText a:link,.foswikiGrayText a:visited{color:#777}.foswikiGrayText a:hover{color:#fff}table.foswikiFormTable th.foswikiFormTableHRow,table.foswikiFormTable td.foswikiFormTableRow{color:#777}.foswikiEditForm{color:#000}.foswikiEditForm .foswikiFormTable,.foswikiEditForm .foswikiFormTable th,.foswikiEditForm .foswikiFormTable td{border-color:#e2e2e2}.foswikiEditForm .foswikiFormTable td{background-color:#f7fafc}.foswikiEditForm .foswikiFormTable th{background-color:#f0f6fb}.patternTwistyButton h3{color:#d1400e}.foswikiAttachments table,table.foswikiFormTable{border-color:#e2e2e2;background-color:#fff}.foswikiAttachments table{background-color:#fff}.foswikiForm td,.foswikiForm th,.foswikiAttachments td,.foswikiAttachments th{border-color:#e2e2e2}.foswikiAttachments .foswikiTable th font,table.foswikiFormTable th.foswikiFormTableHRow font{color:#4571d0}.foswikiFormSteps{background-color:#eef7fa;border-color:#e2e2e2}.foswikiFormStep{border-color:#e2e2e2}.foswikiFormStep h2{color:#2989bb}.foswikiFormStep h3,.foswikiFormStep h4{color:#d1400e}.foswikiFormStep h3,.foswikiFormStep h4{background-color:transparent}.foswikiFormStep .foswikiHelp{background:#fff}.foswikiToc .foswikiTocTitle{color:#777}.foswikiBroadcastMessage,.foswikiNotification{background-color:#ffe67b}.foswikiNotification{border:2px solid #ffdf4c}.foswikiMessage{background-color:#ffe67b}#foswikiLogin .patternLoginNotification{background-color:#fff;border-color:#f00}.foswikiHelp{background-color:#edf5fa;border-color:#e2e2e2}.foswikiBroadcastMessage b,.foswikiBroadcastMessage strong{color:#f00}.foswikiAlert,.foswikiAlert code{color:#f00}.foswikiEmulatedLink{color:#4571d0}.foswikiPageForm table{border-color:#e2e2e2;background:#fff}.foswikiPageForm hr{border-color:#cfcfcf;background-color:#cfcfcf;color:#cfcfcf}.foswikiAccessKey{color:inherit;border-color:#777}a:link .foswikiAccessKey,a:visited .foswikiAccessKey{color:inherit}a:hover .foswikiAccessKey{color:inherit}.foswikiImage img{border-color:#eee;background-color:#fff}#patternTopBar .foswikiImage img{background-color:transparent}.foswikiImage a:hover img{border-color:#0055b5}#patternPage{background-color:#fff}.patternHomePathTitle,.patternRevInfo,.patternHomePath a:link,.patternHomePath a:visited{border-color:#ddd;color:#666}.patternTop a:hover{border:0;color:#fff}.patternHomePath .patternRevInfo,.patternHomePath .patternRevInfo a:link,.patternHomePath .patternRevInfo a:visited{color:#777}.patternHomePath .patternRevInfo a:hover{color:#fff}#patternSideBarContents{color:#000}#patternSideBarContents hr{color:#e2e2e2;background-color:#e2e2e2}#patternSideBarContents a:link,#patternSideBarContents a:visited{color:#444}#patternSideBarContents a:hover{color:#fff}#patternSideBarContents .patternLeftBarPersonal,#patternSideBarContents .patternWebIndicator{border-color:#dadada}#patternSideBarContents b,#patternSideBarContents strong{color:#d1400e}.patternTopicActions{background-color:#2989bb;color:#bbb}.patternTopicActions s,.patternTopicActions strike{color:#aaa}.patternTopicActions .foswikiSeparator{color:#e2e2e2}.patternActionButtons a:link,.patternActionButtons a:visited{color:#fff}.patternActionButtons a:hover{color:#fff}.patternTopicActions a:link .foswikiAccessKey,.patternTopicActions a:visited .foswikiAccessKey{color:#fff;border-color:#fff}.patternTopicActions a:hover .foswikiAccessKey{color:#fff}.patternTopicActions label{color:#000}.patternHelpCol{color:#777}.patternSigLine{color:#777}.patternEditTopic{background:#eef7fa}.patternToolBar a:link .foswikiAccessKey,.patternToolBar a:visited .foswikiAccessKey{color:inherit;border-color:#666}.patternToolBar a:hover .foswikiAccessKey{background-color:transparent;color:inherit;border-color:#666}table#foswikiSearchTable{border-color:#e2e2e2}table#foswikiSearchTable th,table#foswikiSearchTable td{background-color:#fff;border-color:#e2e2e2}table#foswikiSearchTable hr{border-color:#e2e2e2;background-color:#e2e2e2}table#foswikiSearchTable th{color:#000}.foswikiSearchResult .foswikiAlert{color:#f00}.foswikiSearchResult .foswikiSummary .foswikiAlert{color:#900}.foswikiSearchResult .foswikiBottomRow,.foswikiSearchResult .foswikiBottomRow a:link,.foswikiSearchResult .foswikiBottomRow a:visited{color:#049804}.foswikiSearchResult .foswikiBottomRow:hover a:link,.foswikiSearchResult .foswikiBottomRow:hover a:visited{color:#06c}.foswikiSearchResult .foswikiBottomRow:hover a:hover{color:#fff}.patternViewPage .patternSearchResultsBegin{border-color:#eee}.patternBookView .foswikiTopRow{background-color:transparent;color:#777}.patternBookView .foswikiBottomRow{border-color:#e2e2e2}.patternBookView .patternSearchResultCount{color:#777}.foswikiPreviewArea{border-color:#f00;background-color:#fff}.patternDiff{border-color:#6b7f93}#patternMainContents .patternDiff h4.patternSearchResultsHeader{background-color:#6b7f93;color:#fff}#patternMainContents .patternDiff h4.patternSearchResultsHeader a:link,#patternMainContents .patternDiff h4.patternSearchResultsHeader a:visited{color:#fff}tr.foswikiDiffDebug td{border-color:#e2e2e2}.patternDiffPage .foswikiDiffTable th{background-color:#ccc}.foswikiDiffChangedHeader,tr.foswikiDiffDebug .foswikiDiffChangedText,tr.foswikiDiffDebug .foswikiDiffChangedText{background:#9f9}tr.foswikiDiffDebug .foswikiDiffDeletedMarker,tr.foswikiDiffDebug .foswikiDiffDeletedText{background-color:#f99}.foswikiDiffAddedHeader,tr.foswikiDiffDebug .foswikiDiffAddedMarker,tr.foswikiDiffDebug .foswikiDiffAddedText{background-color:#ccf}tr.foswikiDiffDebug .foswikiDiffUnchangedText{color:#777}.foswikiDiffLineNumberHeader{background-color:#ccc}.foswikiToc li{background-image:url(bullet-toc.gif);background-repeat:no-repeat;background-position:0 .4em}.patternPrintPage #patternOuter{background:#fff}.foswikiSubmit,.foswikiSubmitDisabled{background-image:url(bg_submit_gradient.gif);background-repeat:repeat-x}.foswikiSubmit,a.foswikiSubmit:link,a.foswikiSubmit:visited{background-position:0 0;background-color:#06c;border-color:#94cce2 #0e66a2 #0e66a2 #94cce2;color:#fff}.foswikiSubmit:hover,a.foswikiSubmit:hover{background-position:0 -80px;background-color:#0047b7;border-color:#0e66a2 #94cce2 #94cce2 #0e66a2;color:#fff}.foswikiSubmit:active,a.foswikiSubmit:active{background-position:0 -160px;background-color:#73ace6;border-color:#0e66a2 #94cce2 #94cce2 #0e66a2;color:#fff}.foswikiSubmitDisabled,.foswikiSubmitDisabled:hover,.foswikiSubmitDisabled:active{background-position:0 -240px;background-color:#d9e8f7;border-color:#ccc #ccc #ccc #ccc;color:#ccc}.foswikiButton,a.foswikiButton:link,a.foswikiButton:visited{background-image:url(bg_button_gradient.gif);background-repeat:repeat-x;background-position:0 0;border-color:#fff #94cce2 #94cce2 #fff;background-color:#cce7f1;color:#333}.foswikiButton:hover,.foswikiButton:active,a.foswikiButton:hover,a.foswikiButton:active{background-position:0 -160px;border-color:#94cce2 #94cce2 #94cce2 #94cce2;background-color:#cce7f1;color:#333}.foswikiButtonDisabled,.foswikiButtonDisabled:hover,.foswikiButtonDisabled:active{background-image:url(bg_button_gradient.gif);background-repeat:repeat-x;background-position:0 -240px;border-color:#ccc #ccc #ccc #ccc;background-color:#edece6;color:#bbb}.foswikiButtonCancel{background-image:url(bg_buttoncancel_gradient.gif);background-repeat:repeat-x;background-position:0 0;border-color:#f3ddd7 #ce5232 #ce5232 #f3ddd7;background-color:#dd724d;color:#fff}.foswikiButtonCancel:hover{background-position:0 -80px;border-color:#ce5232 #f3ddd7 #f3ddd7 #ce5232;background-color:#dd724d;color:#fff}.foswikiButtonCancel:active{background-position:0 -160px;border-color:#ce5232 #f3ddd7 #f3ddd7 #ce5232;background-color:#dd724d;color:#fff}.patternToolBar span a:link,.patternToolBar span a:visited,.patternToolBar span s,.patternToolBar span strike{background-image:url(bg_button_gradient.gif);background-repeat:repeat-x}.patternToolBar span a:link,.patternToolBar span a:visited{background-position:0 0;border-color:#fff #94cce2 #94cce2 #fff;background-color:#cce7f1;color:#333}.patternToolBar span a:hover{background-position:0 -80px;border-color:#94cce2 #94cce2 #94cce2 #94cce2;background-color:#cce7f1;color:#222}.patternToolBar span a:active{background-position:0 -160px;border-color:#94cce2 #94cce2 #94cce2 #94cce2;background-color:#e8e5d7;color:#222}.patternToolBar span s,.patternToolBar span strike{background-position:0 -240px;border-color:#eae9e7 #eae9e7 #eae9e7 #eae9e7;background-color:#edece6;color:#bbb}.patternTextareaButton{border-color:#fffefd #b8b6ad #b8b6ad #fffefd;overflow:hidden}.patternButtonFontSelector{background-image:url(button_font_selector.gif);width:33px;height:16px}.patternButtonFontSelectorProportional{background-position:0 0}.patternButtonFontSelectorMonospace{background-position:0 -16px}.patternButtonEnlarge,.patternButtonShrink{background-image:url(button_arrow.gif);width:16px;height:16px}.patternButtonEnlarge{background-position:0 0}.patternButtonEnlarge:hover{background-position:0 -42px}.patternButtonEnlarge:active{background-position:0 -84px}.patternButtonShrink{background-position:16px 0}.patternButtonShrink:hover{background-position:16px -42px}.patternButtonShrink:active{background-position:16px -84px}.foswikiBroadcastMessage{background-image:url(background_alert.gif);background-repeat:repeat-x}.patternLeftBarPersonal li,li.patternLogOut,li.patternLogIn{padding-left:13px;background-position:0 .4em;background-repeat:no-repeat}.patternLeftBarPersonal li{background-image:url(bullet-personal_sidebar.gif)}.patternLeftBarPersonal li.patternLogOut{background-image:url(bullet-lock.gif)}.patternLeftBarPersonal li.patternLogIn{background-image:url(bullet-lock.gif)}.foswikiJs a.jqPopUpWindow:link,.foswikiJs a.jqPopUpWindow:visited,.foswikiJs a.jqPopUpWindow:hover{background-image:url(popup.gif);background-repeat:no-repeat;background-position:right;padding-right:14px;margin-right:3px} \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkinTheme2009/column_left.css b/doc/html/user/pub/System/PatternSkinTheme2009/column_left.css index c6d6ae50..b47ad089 100644 --- a/doc/html/user/pub/System/PatternSkinTheme2009/column_left.css +++ b/doc/html/user/pub/System/PatternSkinTheme2009/column_left.css @@ -1,12 +1 @@ -/* -places the side bar at the left -depends on global settings in layout.css -*/ - -#patternOuter { - margin-left:16em; -} -#patternSideBar { - width:16em; - margin-left:-16em; -} +#patternOuter{margin-left:16em}#patternSideBar{width:16em;margin-left:-16em} \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkinTheme2009/style.css b/doc/html/user/pub/System/PatternSkinTheme2009/style.css index df75ca68..0792bcda 100644 --- a/doc/html/user/pub/System/PatternSkinTheme2009/style.css +++ b/doc/html/user/pub/System/PatternSkinTheme2009/style.css @@ -1,1096 +1 @@ -/* ----------------------------------------------------------- - STYLE - Appearance: margins, padding, fonts, borders - ----------------------------------------------------------- */ - - -/* ---------------------------------------------------------------------------- - CONSTANTS - - Sizes - ---------------------------------------- - S1 line-height 1.5em - S2 somewhat smaller font size font-size:94% - S3 small font size, foswikiSmall font-size:86%; line-height:110%; - S4 horizontal bar padding (h2, patternTop) 5px - S5 form and attachment padding 20px - S6 left margin left bar 1em - - ------------------------------------------------------------------------- */ - -/* GENERAL HTML ELEMENTS */ - -html body { - font-family:arial, verdana, sans-serif; - font-size:104%; - voice-family:"\"}\""; - voice-family:inherit; - font-size:small; -} -html>body { /* Mozilla */ - font-size:small; -} -body { - line-height:1.5em; /*S1*/ - /* change font size here */ - font-size:103%; -} -body font { - line-height:135%; -} -th { - line-height:1.15em; -} -label { - padding:.15em .3em .15em 0; /* same vertical padding as foswikiInputField */ -} -hr { - height:1px; - border:none; -} -/* put overflow pre in a scroll area */ -pre { - width:auto; - margin:1em 0; /* Win IE tries to make this bigger otherwise */ - border-style:solid; - border-width:1px; - padding:1em; -} -pre, code, tt { - font-family: "Bitstream Vera Sans Mono","Andale Mono",Courier,monospace; - font-size:86%; -} - -/* IE behavior for pre is defined in css.pattern.tmpl in conditional comment */ -html>body pre { /* hide from IE */ - /*\*/ overflow:auto !important; /* */ overflow:scroll; width:auto; /* for Mac Safari */ -} -ol, ul { - margin-top:0; -} -blockquote { - padding:.5em 1.25em; - border-style:solid; - border-width:1px 1px 1px 5px; -} - -/* Text */ -h1 { - margin:0 0 .5em 0; -} -h1, h2, h3, h4, h5, h6 { - font-weight:normal; - line-height:1em; -} -h1 { font-size:190%; } -h2 { font-size:153%; } -h3 { font-size:133%; } -h4 { font-size:122%; font-weight:bold; } -h5 { font-size:110%; font-weight:bold; } -h6 { font-size:95%; font-weight:bold; } -h2, h3, h4, h5, h6 { - display:block; - /* give header a background color for easy scanning:*/ - padding:.25em 10px; - margin:1em -10px .35em -10px; - height:auto; -} -h1.patternTemplateTitle { - font-size:170%; - text-align:center; -} -h2.patternTemplateTitle { - text-align:center; - margin-top:.5em; - background:none; - border:none; -} -/* Links */ -/* somehow the foswikiNewLink style have to be before the general link styles */ -.foswikiNewLink { - border-width:0 0 1px 0; - border-style:solid; -} -.foswikiNewLink a { - text-decoration:none; - margin-left:1px; -} -.foswikiNewLink a sup { - text-align:center; - padding:0 2px; - vertical-align:baseline; - font-size:100%; - text-decoration:none; -} -.foswikiNewLink a:link sup, -.foswikiNewLink a:visited sup { - border-width:1px; - border-style:solid; - text-decoration:none; -} -.foswikiNewLink a:hover sup { - text-decoration:none; -} - -:link:focus, -:visited:focus, -:link, -:visited, -:link:active, -:visited:active { - text-decoration:underline; -} -:link:hover, -:visited:hover { - text-decoration:none; -} -img { - vertical-align:text-bottom; - border:0; -} - -/* Form elements */ -form { - display:inline; - margin:0; - padding:0; -} -textarea, -input, -select { - vertical-align:middle; - font-family:arial, verdana, sans-serif; - font-size:100%; -} -label input { - vertical-align:text-bottom; -} -.foswikiTextarea { - padding:1px 4px; -} -.foswikiSubmit, -.foswikiSubmitDisabled, -.foswikiButton, -.foswikiButtonDisabled, -.foswikiButtonCancel, -a.foswikiButton, -a.foswikiSubmit, -a.foswikiButtonCancel, -.foswikiCheckbox { - border-width:1px; - border-style:solid; - padding:.1em .2em; - font-weight:bold; - vertical-align:middle; - text-align:center; -} -.foswikiSubmit, -.foswikiSubmitDisabled, -.foswikiButton, -.foswikiButtonDisabled, -.foswikiButtonCancel, -.foswikiSubmit:hover, -.foswikiSubmitDisabled:hover, -.foswikiButton:hover, -.foswikiSubmit:active, -.foswikiSubmitDisabled:active, -.foswikiButton:active { - cursor:default; - outline:none; -} -a.foswikiButton, -a.foswikiButton:hover, -a.foswikiButton:link:active, -a.foswikiButton:visited:active, -a.foswikiButtonCancel, -a.foswikiButtonCancel:hover, -a.foswikiButtonCancel:link:active, -a.foswikiButtonCancel:visited:active, -a.foswikiSubmit, -a.foswikiSubmit:hover, -a.foswikiSubmit:link:active, -a.foswikiSubmit:visited:active { - text-decoration:none; -} -.jqButton.foswikiButtonCancel, -.jqButton.foswikiButtonCancel:hover { - border:none; - padding:0; - font-weight:normal; - margin:0; -} -.foswikiCheckbox, -.foswikiRadioButton { - margin:1px .25em 1px .1em; - padding:0 0 0 .5em; - border:0; -} -.foswikiTextarea, -.foswikiInputField, -.foswikiInputFieldDisabled, -.foswikiInputFieldReadOnly, -.foswikiSelect { - border-width:2px; - border-style:solid; -} -.foswikiTextarea, -.foswikiInputField, -.foswikiInputFieldDisabled, -.foswikiInputFieldReadOnly { - font-size:100%; -} -.foswikiInputField, -.foswikiInputFieldDisabled, -.foswikiInputFieldReadOnly { - padding:.1em .2em; -} - -/* ----------------------------------------------------------- - Plugin elements - ----------------------------------------------------------- */ - -/* TagMePlugin */ -.tagMePlugin select { - margin:0 .25em 0 0; -} -.tagMePlugin input { - border:0px; -} - -/* RevCommentPlugin */ -.patternEditPage .revComment { - padding:1em 0 2em 0; -} - -/* EditTablePlugin */ -.editTable .foswikiTable { - margin:0 0 2px 0; -} -.editTableEditImageButton { - border:none; -} - -/* TablePlugin */ -.foswikiTable, -.foswikiTable td, -.foswikiTable th { - border-width:1px; -} -.foswikiTable { - border-style:solid; - margin:2px 0; - border-collapse:collapse; -} -.foswikiTable td { - padding:3px 6px; - border-top-style:solid; - border-bottom-style:solid; -} -.foswikiTable th { - border-left-style:solid; - border-right-style:solid; - padding:4px 6px; -} -.foswikiTable .tableSortIcon { - margin:0 0 0 5px; -} -.foswikiTable a:link, -.foswikiTable a:visited { - text-decoration:underline; -} -.foswikiTable a:hover { - text-decoration:underline; -} - -/* TwistyContrib */ -.twistyTrigger a:link, -.twistyTrigger a:visited { - text-decoration:none; -} -.twistyTrigger a:link .foswikiLinkLabel, -.twistyTrigger a:visited .foswikiLinkLabel { - text-decoration:none; -} -.twistyTrigger a img { - margin:0 .25em 0 0; -} - -/*tipsOfTheDay*/ -.tipsOfTheDay { - padding:10px; -} - -/* ----------------------------------------------------------- - Foswiki styles - ----------------------------------------------------------- */ - -#foswikiLogin { - width:44em; - margin:0 auto; - text-align:center; -} -#foswikiLogin .foswikiFormSteps { - border-width:5px; - text-align:left; -} -#foswikiLogin .patternLoginNotification { - padding-left:.5em; - padding-right:.5em; - border-style:solid; - border-width:2px; -} -.foswikiTable h2, .foswikiFormTable h2, -.foswikiTable h3, .foswikiFormTable h3, -.foswikiTable h4, .foswikiFormTable h4, -.foswikiTable h5, .foswikiFormTable h5, -.foswikiTable h6, .foswikiFormTable h6 { - border:0; - margin:0; - padding-left:0; - padding-right:0; -} -.foswikiFormTable th { - font-weight:normal; -} -.foswikiFormTable .foswikiTable th { - font-weight:bold; -} -.patternEditPage .foswikiFormTable td, -.patternEditPage .foswikiFormTable th { - padding:.3em .4em; - border-style:solid; - border-width:0 0 1px 0; - vertical-align:middle; -} -.foswikiAttachments .foswikiTable, -table.foswikiFormTable { - margin:10px 0 5px 0; - border-collapse:collapse; - padding:0px; - border-spacing:0px; - empty-cells:show; - border-style:solid; - border-width:1px; -} -.foswikiAttachments table { - line-height:1.5em; /*S1*/ - width:auto; - width:100%; -} -.foswikiAttachments .foswikiTable th { - border-style:none none solid solid; - border-width:1px; -} -.foswikiAttachments .foswikiTable th, -table.foswikiFormTable th.foswikiFormTableHRow { - padding:3px 6px; - height:2.5em; - vertical-align:middle; -} -table.foswikiFormTable th.foswikiFormTableHRow { - text-align:center; -} -.foswikiFormTableFooter {} -.foswikiAttachments .foswikiTable td, -table.foswikiFormTable td { - padding:3px 2em 3px 1em; - height:1.5em; /*S1*/ - text-align:left; - vertical-align:top; -} -.foswikiAttachments .foswikiTable th.foswikiFirstCol, -.foswikiAttachments .foswikiTable td.foswikiFirstCol { - /* make more width for the icon column */ - width:26px; - text-align:center; -} -.foswikiAttachments .foswikiTable caption { - display:none; -} -table.foswikiFormTable th.foswikiFormTableHRow a:link, -table.foswikiFormTable th.foswikiFormTableHRow a:visited { - text-decoration:none; -} -.foswikiAttachments h3, -.foswikiForm h3, -.patternTwistyButton h3 { - font-size:1.1em; - font-weight:bold; - display:inline; - margin:0; - padding:0; -} -.patternTwistyButton h3 { - /* always add class foswikiButton as well */ - padding:.1em .2em; -} -.foswikiForm h3 a:link, -.foswikiForm h3 a:visited { - text-decoration:none; -} -.patternTwistyButton { - font-weight:bold; - margin:.25em 0; - display:inline-block; -} -.foswikiForm h3 .foswikiSmall { - font-weight:normal; - font-size:86%; - margin:0 0 0 .15em; -} -.foswikiFormSteps { - padding:0 40px; - border-width:1px; - border-style:solid; -} -.foswikiFormStep { - padding:12px 40px; - margin:-1px -40px -1px -40px; - border-width:1px; - border-style:solid none; -} -.foswikiFormStep h2, -.foswikiFormStep h3, -.foswikiFormStep h4 { - border:none; - margin-top:0; - margin-left:0; - margin-right:0; - padding:0; - background:none; -} -.foswikiFormStep p { - margin:.5em 0; -} -.foswikiFormSteps h2 { - font-size:115%; - font-weight:bold; -} -.foswikiFormSteps h3 { - font-size:100%; - font-weight:bold; -} -.foswikiFormSteps h4 { - font-size:100%; - font-weight:bold; -} -.foswikiFormSteps blockquote { - margin-left:1em; - padding-top:.25em; - padding-bottom:.25em; -} -.foswikiToc { - margin:1em 0; - padding:.3em 0 .6em 0; -} -.foswikiToc ul { - list-style:none; - padding:0 0 0 .5em; - margin:0; -} -.foswikiToc li { - margin-left:1em; - padding-left:1em; - background-repeat:no-repeat; - background-position:0 .5em; -} -.foswikiToc .foswikiTocTitle { - margin:0; - padding:0; - font-weight:bold; -} -.foswikiSmall { - font-size:86%; /*S3*/ - line-height:1.5em; /*S1*/ -} -.foswikiSmallish { - font-size:94%; /*S2*/ - line-height:1.5em; /*S1*/ -} -.foswikiEmulatedLink { - text-decoration:underline; -} -.foswikiPageForm table { - border-width:1px; - border-style:solid; -} -.foswikiPageForm table { - width:100%; -} -.foswikiPageForm th, -.foswikiPageForm td { - border:0; - padding:.5em 1em; -} -.foswikiPageForm td {} -.foswikiPageForm td.first { - padding-top:1em; -} -.foswikiBroadcastMessage, -.foswikiNotification { - padding:1em 20px; /*S5*/ -} -.foswikiNotification { - margin:1em 0; - border-style:solid; - border-width:2px; -} -.foswikiBroadcastMessage { - margin:0 0 1.25em 0; -} -.foswikiMessage { - padding:.5em 10px; - border:none; -} -.foswikiHelp { - padding:1em; - margin:.25em 0 0 0; - border-style:solid; - border-width:2px; -} -.foswikiHelp ul { - margin:0; - padding-left:20px; -} -.foswikiAccessKey { - border:none; -} -a:hover .foswikiAccessKey { - text-decoration:none; - border-width:0 0 1px 0; - border-style:solid; -} -.foswikiWebIndent { - margin:0 0 0 1em; -} -.foswikiLinkLabel {} -.foswikiImage img { - padding:3px; - border-width:1px; - border-style:solid; -} -.foswikiImage a:link, -.foswikiImage a:visited { - background:none; -} -#foswikiLogo img { - margin:0; - padding:0; - border:0px; -} -.foswikiNoBreak { - white-space:nowrap; -} -.foswikiSearchResultCount { - font-weight:bold; -} - -/* ----------------------------------------------------------- - Pattern skin specific elements - ----------------------------------------------------------- */ - -/* LAYOUT ELEMENTS */ -/* for specific layout sub-elements see further down */ - -.patternNoViewPage #patternOuter { - margin-left:0; - margin-right:0; -} -#patternTopBar { - border-width:1px; - border-style:none none solid none; -} -#patternBottomBar { - border-width:1px 0 0 0; - border-style:solid; -} -#patternWebBottomBar { - font-size:94%; /*S2*/ - line-height:125%; - text-align:left; -} -#patternSideBarContents { - margin:0 0 1em 0; - padding-right:.5em; - padding-left:1em; -} -#patternMainContents, -#patternBottomBarContents, -#patternSideBarContents, -#patternTopBarContents { - padding-right:2em; - padding-left:2em; -} -#patternSideBarContents, -#patternMainContents { - padding-top:2em; -} -#patternSideBarContents { - padding-bottom:2em; -} -#patternTopBarContents { - padding-top:1em; -} -#patternBottomBarContents { - padding-top:1em; -} -.patternNoViewPage .foswikiTopic { - margin-top:2em; -} - -/* bottom paddings */ -#patternMainContents { - padding-bottom:4em; -} -#patternBottomBarContents { - padding-bottom:2em; -} -.foswikiTopic { - margin:0 0 2em 0; -} -.patternNoViewPage #patternMainContents, -.patternNoViewPage #patternBottomBarContents { - margin-left:4%; - margin-right:4%; -} -.patternEditPage #patternMainContents, -.patternEditPage #patternBottomBarContents { - margin-left:2%; - margin-right:2%; -} - -.patternTop { - margin:0 0 .5em 0; -} -.patternNoViewPage .patternTop { - font-size:94%; -} -#patternSideBarContents img { - margin:0 3px 0 0; - vertical-align:text-bottom; -} -#patternSideBarContents a:link, -#patternSideBarContents a:visited { - text-decoration:none; -} -#patternSideBarContents ul { - padding:0; - margin:0; - list-style:none; -} -#patternSideBarContents, -#patternSideBarContents ul, -#patternSideBarContents li { - line-height:1.35em; -} -#patternSideBarContents h2 { - border:none; - background-color:transparent; -} -#patternSideBarContents .patternLeftBarPersonal, -#patternSideBarContents .patternWebIndicator { - padding:0 1em .75em 1em; - margin:0 -1em .75em -1em; /*S6*/ - border-style:none none solid none; - border-width:1px; -} -.patternWebIndicator a { - font-size:1.1em; - font-weight:bold; -} -.patternLeftBarPersonalContent { - padding:1em 0 0 0; -} -#patternSideBarContents li { - overflow:hidden; -} -html>body #patternSideBarContents li { /* Mozilla */ - overflow:visible; -} - -/* form options in top bar */ -.patternMetaMenu {} -.patternMetaMenu input, -.patternMetaMenu select, -.patternMetaMenu select option { - margin:0; -} -.patternMetaMenu select option { - padding:1px 0 0 0; -} -.patternMetaMenu ul { - padding:0; - margin:0; - list-style:none; -} -.patternMetaMenu ul li { - padding:0; - display:inline; -} -.patternMetaMenu ul li .foswikiInputField, -.patternMetaMenu ul li .foswikiSelect { - margin:0 0 0 .5em; -} -.patternHomePath .foswikiSeparator { - padding:0 .5em; -} -.patternHomePath a:link, -.patternHomePath a:visited { - text-decoration:none; - border-style:none none solid none; - border-width:1px; -} - -.patternToolBar { -} -.patternToolBar span { - float:left; -} -.patternToolBar span s, -.patternToolBar span strike, -.patternToolBar span a:link, -.patternToolBar span a:visited { - display:block; - border-width:1px; - border-style:solid; - padding:.1em .35em; - margin:0 0 .2em .25em; - font-weight:bold; -} -.patternToolBar span a:link, -.patternToolBar span a:visited { - text-decoration:none; - outline:none; -} -.patternToolBar span a:hover, -.patternToolBar span a:hover { - border-width:1px; - border-style:solid; -} -.patternToolBar span a:active { - outline:none; -} -.patternToolBar span.foswikiAccessKey { - float:none; -} -.patternToolBar span s, -.patternToolBar span strike { - text-decoration:none; -} - -.patternActionButtons a:link, -.patternActionButtons a:visited { - padding:1px 1px 2px 1px; -} -.patternTopicActions .patternActionButtons a:link, -.patternTopicActions .patternActionButtons a:visited { - text-decoration:none; -} -.patternTopicActions .patternActionButtons span s, -.patternTopicActions .patternActionButtons span strike { - text-decoration:none; -} -.patternActionButtons a.foswikiButton, -.patternActionButtons a.foswikiSubmit, -.patternActionButtons a.foswikiButtonCancel { - padding:.1em .2em; -} -.patternInfo { - margin:1.5em 0 0 0; -} -.patternHomePath .patternRevInfo { - font-size:94%; - white-space:nowrap; -} -.patternTopicFooter { - margin:1em 0 0 0; -} -.patternSimpleLogo { - margin:1em 0 0 0; -} - -/* WebSearch, WebSearchAdvanced */ -.foswikiWebSearchForm form { - width:100%; -} -.foswikiWebSearchForm ul { - list-style:none; - margin-top:0; -} - -#foswikiSearchTable { - width:100%; - margin:.5em 0; - background:none; - border-bottom:0; -} -#foswikiSearchTable th, -#foswikiSearchTable td { - padding:1em; - border-width:0 0 1px 0; - border-style:solid; -} -#foswikiSearchTable th { - width:20%; - text-align:right; -} -#foswikiSearchTable td { - width:80%; -} - -/* ----------------------------------------------------------- - Search results - styles and overridden styles used in search.pattern.tmpl - ----------------------------------------------------------- */ - -.patternSearchResults { - /* no longer used in search.pattern.tmpl, but remains in rename templates */ - margin:0 0 1em 0; -} -#renamehelpshow a span, -#renamehelphide a span { - font-size: 1.1em; -} -.patternSearchResults blockquote { - margin:1em 0 1em 5em; -} -h3.patternSearchResultsHeader, -h4.patternSearchResultsHeader { - display:block; - border-width:0 0 1px 0; - border-style:solid; - font-weight:bold; -} -.patternSearchResults h3 { - font-size:115%; /* same as foswikiFormStep */ - margin:0; - padding:.5em 40px; /*S5*/ - font-weight:bold; -} -h4.patternSearchResultsHeader { - font-size:100%; - padding-top:.3em; - padding-bottom:.3em; - font-weight:normal; -} -.patternSearchResult .foswikiTopRow { - padding-top:.2em; - margin-top:.1em; -} -.patternSearchResult .foswikiBottomRow { - margin-bottom:.1em; - padding-bottom:.25em; - border-width:0 0 1px 0; - border-style:solid; -} -.patternSearchResult .foswikiAlert { - font-weight:bold; -} -.patternSearchResult .foswikiSummary .foswikiAlert { - font-weight:normal; -} -.patternSearchResult .foswikiNew { - border-width:1px; - border-style:solid; - font-size:86%; /*S3*/ - padding:0 1px; - font-weight:bold; -} -.foswikiSearchResultsHeader span { - padding:0 .5em 0 0; -} - -.foswikiSearchResultCount { - font-weight:bold; -} -.foswikiSearchResult { - margin:0 0 1em 0; -} -.foswikiSearchResult .foswikiTopRow {} -.foswikiSearchResult .foswikiBottomRow {} -.foswikiSearchResult .foswikiAlert { - font-weight:bold; -} -.foswikiSummary, -.foswikiSearchResult .foswikiBottomRow { - font-size:86%; /*S3*/ -} -.foswikiSearchResult .foswikiSummary .foswikiAlert { - font-weight:normal; -} -.foswikiSearchResultsPager { - margin:1em 0; - padding:.25em 0; -} -.patternSearchResults .foswikiHelp { - display:block; - width:auto; - padding:.1em 5px; - margin:1em -5px .35em -5px; -} -.patternSearchResultCount { - margin:1em 0 3em 0; -} -.patternSearched {} - -/* Search results in book view format */ - -.patternBookView { - border-width:0 0 2px 2px; - border-style:solid; - /* border color in cssdynamic.pattern.tmpl */ - margin:.5em 0 1.5em -5px; - padding:0 0 0 5px; -} -.patternBookView .foswikiTopRow { - padding:.25em 5px .15em 5px; /*S4*/ - margin:1em -5px .15em -5px; /*S4*/ -} -.patternBookView .foswikiBottomRow { - font-size:100%; - padding:1em 0 1em 0; - width:auto; - border:none; -} - -/* pages that are not view */ - -/* edit.pattern.tmpl */ - -#edithelphide a span, -#edithelpshow a span { - font-size:1.1em; -} - -.patternNoViewPage #patternMainContents { - padding-top:0; -} -.patternEditPage #patternMainContents { - padding-left:0; - padding-right:0; -} -.patternEditPage .patternEditTopic { - padding:5px; - margin:0 0 1em 0; -} -.patternEditPage .foswikiTextarea { -} -.patternEditPage .foswikiForm { - border:none; -} -.foswikiFormHolder { /* constrains the textarea */ - width:100%; -} -.patternEditPage .foswikiForm h1, -.patternEditPage .foswikiForm h2, -.patternEditPage .foswikiForm h3 { - /* same as foswikiFormStep */ - font-size:120%; - font-weight:bold; -} -.foswikiEditboxStyleMono { - font-family: "Bitstream Vera Sans Mono","Andale Mono",Courier,monospace; -} -.foswikiEditboxStyleProportional { - font-family:arial, verdana, sans-serif; -} -.patternSig { - text-align:right -} -.patternSigLine { - margin:.5em 0 0 0; - border-style:none; -} -.foswikiAddFormButton { - float:right; -} -.patternTextareaButton { - margin:0 0 0 1px; - display:block; - cursor:pointer; - border-style:solid; - border-width:1px; -} -.patternButtonFontSelector { - margin:0 8px 0 0; -} -.patternSaveHelp { - margin:1em 0 0 0; - line-height:1.5em; -} - -/* preview.pattern.tmpl */ - -.patternPreviewPage #patternMainContents { - padding-left:0; - padding-right:0; -} -.patternPreviewPage .foswikiTopic { - margin-bottom:0; -} -.foswikiPreviewArea { - border-width:1px; - border-style:solid; - margin:0 0 1.5em 0; - padding:2em; -} - -/* attach.pattern.tmpl */ - -.patternAttachPage .foswikiAttachments .foswikiTable { - width:auto; -} -.patternAttachPage .foswikiAttachments { - margin-top:0; -} -.patternMoveAttachment { - margin:.5em 0 0 0; - text-align:right; -} - -/* rdiff.pattern.tmpl */ - -.patternDiff { - /* same as patternBookView */ - border-width:0 0 2px 2px; - border-style:solid; - margin:.5em 0 1.5em 0; - padding:0 0 0 10px; -} -.patternDiff h4.patternSearchResultsHeader { - padding:.5em 10px; -} -.patternDiffPage .patternRevInfo ul { - padding:0; - margin:2em 0 0 0; - list-style:none; -} -.patternDiffPage .foswikiDiffTable { - margin:2em 0; -} -.foswikiDiffDebug { - /* same styling as pre and code */ - font-family: "Bitstream Vera Sans Mono","Andale Mono",Courier,monospace; - font-size:86%; - white-space:pre; -} -tr.foswikiDiffDebug td { - border-width:1px; - border-style:solid; -} -.patternDiffPage td.foswikiDiffDebugLeft { - border-bottom:none; -} -.patternDiffPage .foswikiDiffTable th { - padding:.25em .5em; -} -.patternDiffPage .foswikiDiffTable td { - padding:.25em; -} -.foswikiDiffLineNumberHeader { - padding:.3em 0; -} - -.mceContentBody { - padding: 1px 4px; -} +html body{font-family:arial,verdana,sans-serif;font-size:104%;voice-family:"\"}\"";voice-family:inherit;font-size:small}html>body{font-size:small}body{line-height:1.5em;font-size:103%}body font{line-height:135%}th{line-height:1.15em}label{padding:.15em .3em .15em 0}hr{height:1px;border:0}pre{width:auto;margin:1em 0;border-style:solid;border-width:1px;padding:1em}pre,code,tt{font-family:"Bitstream Vera Sans Mono","Andale Mono",Courier,monospace;font-size:86%}html>body pre{/*\*/overflow:auto!important;/**/overflow:scroll;width:auto}ol,ul{margin-top:0}blockquote{padding:.5em 1.25em;border-style:solid;border-width:1px 1px 1px 5px}h1{margin:0 0 .5em 0}h1,h2,h3,h4,h5,h6{font-weight:normal;line-height:1em}h1{font-size:190%}h2{font-size:153%}h3{font-size:133%}h4{font-size:122%;font-weight:bold}h5{font-size:110%;font-weight:bold}h6{font-size:95%;font-weight:bold}h2,h3,h4,h5,h6{display:block;padding:.25em 10px;margin:1em -10px .35em -10px;height:auto}h1.patternTemplateTitle{font-size:170%;text-align:center}h2.patternTemplateTitle{text-align:center;margin-top:.5em;background:0;border:0}.foswikiNewLink{border-width:0 0 1px 0;border-style:solid}.foswikiNewLink a{text-decoration:none;margin-left:1px}.foswikiNewLink a sup{text-align:center;padding:0 2px;vertical-align:baseline;font-size:100%;text-decoration:none}.foswikiNewLink a:link sup,.foswikiNewLink a:visited sup{border-width:1px;border-style:solid;text-decoration:none}.foswikiNewLink a:hover sup{text-decoration:none}:link:focus,:visited:focus,:link,:visited,:link:active,:visited:active{text-decoration:underline}:link:hover,:visited:hover{text-decoration:none}img{vertical-align:text-bottom;border:0}form{display:inline;margin:0;padding:0}textarea,input,select{vertical-align:middle;font-family:arial,verdana,sans-serif;font-size:100%}label input{vertical-align:text-bottom}.foswikiTextarea{padding:1px 4px}.foswikiSubmit,.foswikiSubmitDisabled,.foswikiButton,.foswikiButtonDisabled,.foswikiButtonCancel,a.foswikiButton,a.foswikiSubmit,a.foswikiButtonCancel,.foswikiCheckbox{border-width:1px;border-style:solid;padding:.1em .2em;font-weight:bold;vertical-align:middle;text-align:center}.foswikiSubmit,.foswikiSubmitDisabled,.foswikiButton,.foswikiButtonDisabled,.foswikiButtonCancel,.foswikiSubmit:hover,.foswikiSubmitDisabled:hover,.foswikiButton:hover,.foswikiSubmit:active,.foswikiSubmitDisabled:active,.foswikiButton:active{cursor:default;outline:0}a.foswikiButton,a.foswikiButton:hover,a.foswikiButton:link:active,a.foswikiButton:visited:active,a.foswikiButtonCancel,a.foswikiButtonCancel:hover,a.foswikiButtonCancel:link:active,a.foswikiButtonCancel:visited:active,a.foswikiSubmit,a.foswikiSubmit:hover,a.foswikiSubmit:link:active,a.foswikiSubmit:visited:active{text-decoration:none}.jqButton.foswikiButtonCancel,.jqButton.foswikiButtonCancel:hover{border:0;padding:0;font-weight:normal;margin:0}.foswikiCheckbox,.foswikiRadioButton{margin:1px .25em 1px .1em;padding:0 0 0 .5em;border:0}.foswikiTextarea,.foswikiInputField,.foswikiInputFieldDisabled,.foswikiInputFieldReadOnly,.foswikiSelect{border-width:2px;border-style:solid}.foswikiTextarea,.foswikiInputField,.foswikiInputFieldDisabled,.foswikiInputFieldReadOnly{font-size:100%}.foswikiInputField,.foswikiInputFieldDisabled,.foswikiInputFieldReadOnly{padding:.1em .2em}.tagMePlugin select{margin:0 .25em 0 0}.tagMePlugin input{border:0}.patternEditPage .revComment{padding:1em 0 2em 0}.editTable .foswikiTable{margin:0 0 2px 0}.editTableEditImageButton{border:0}.foswikiTable,.foswikiTable td,.foswikiTable th{border-width:1px}.foswikiTable{border-style:solid;margin:2px 0;border-collapse:collapse}.foswikiTable td{padding:3px 6px;border-top-style:solid;border-bottom-style:solid}.foswikiTable th{border-left-style:solid;border-right-style:solid;padding:4px 6px}.foswikiTable .tableSortIcon{margin:0 0 0 5px}.foswikiTable a:link,.foswikiTable a:visited{text-decoration:underline}.foswikiTable a:hover{text-decoration:underline}.twistyTrigger a:link,.twistyTrigger a:visited{text-decoration:none}.twistyTrigger a:link .foswikiLinkLabel,.twistyTrigger a:visited .foswikiLinkLabel{text-decoration:none}.twistyTrigger a img{margin:0 .25em 0 0}.tipsOfTheDay{padding:10px}#foswikiLogin{width:44em;margin:0 auto;text-align:center}#foswikiLogin .foswikiFormSteps{border-width:5px;text-align:left}#foswikiLogin .patternLoginNotification{padding-left:.5em;padding-right:.5em;border-style:solid;border-width:2px}.foswikiTable h2,.foswikiFormTable h2,.foswikiTable h3,.foswikiFormTable h3,.foswikiTable h4,.foswikiFormTable h4,.foswikiTable h5,.foswikiFormTable h5,.foswikiTable h6,.foswikiFormTable h6{border:0;margin:0;padding-left:0;padding-right:0}.foswikiFormTable th{font-weight:normal}.foswikiFormTable .foswikiTable th{font-weight:bold}.patternEditPage .foswikiFormTable td,.patternEditPage .foswikiFormTable th{padding:.3em .4em;border-style:solid;border-width:0 0 1px 0;vertical-align:middle}.foswikiAttachments .foswikiTable,table.foswikiFormTable{margin:10px 0 5px 0;border-collapse:collapse;padding:0;border-spacing:0;empty-cells:show;border-style:solid;border-width:1px}.foswikiAttachments table{line-height:1.5em;width:auto;width:100%}.foswikiAttachments .foswikiTable th{border-style:none none solid solid;border-width:1px}.foswikiAttachments .foswikiTable th,table.foswikiFormTable th.foswikiFormTableHRow{padding:3px 6px;height:2.5em;vertical-align:middle}table.foswikiFormTable th.foswikiFormTableHRow{text-align:center}.foswikiAttachments .foswikiTable td,table.foswikiFormTable td{padding:3px 2em 3px 1em;height:1.5em;text-align:left;vertical-align:top}.foswikiAttachments .foswikiTable th.foswikiFirstCol,.foswikiAttachments .foswikiTable td.foswikiFirstCol{width:26px;text-align:center}.foswikiAttachments .foswikiTable caption{display:none}table.foswikiFormTable th.foswikiFormTableHRow a:link,table.foswikiFormTable th.foswikiFormTableHRow a:visited{text-decoration:none}.foswikiAttachments h3,.foswikiForm h3,.patternTwistyButton h3{font-size:1.1em;font-weight:bold;display:inline;margin:0;padding:0}.patternTwistyButton h3{padding:.1em .2em}.foswikiForm h3 a:link,.foswikiForm h3 a:visited{text-decoration:none}.patternTwistyButton{font-weight:bold;margin:.25em 0;display:inline-block}.foswikiForm h3 .foswikiSmall{font-weight:normal;font-size:86%;margin:0 0 0 .15em}.foswikiFormSteps{padding:0 40px;border-width:1px;border-style:solid}.foswikiFormStep{padding:12px 40px;margin:-1px -40px -1px -40px;border-width:1px;border-style:solid none}.foswikiFormStep h2,.foswikiFormStep h3,.foswikiFormStep h4{border:0;margin-top:0;margin-left:0;margin-right:0;padding:0;background:0}.foswikiFormStep p{margin:.5em 0}.foswikiFormSteps h2{font-size:115%;font-weight:bold}.foswikiFormSteps h3{font-size:100%;font-weight:bold}.foswikiFormSteps h4{font-size:100%;font-weight:bold}.foswikiFormSteps blockquote{margin-left:1em;padding-top:.25em;padding-bottom:.25em}.foswikiToc{margin:1em 0;padding:.3em 0 .6em 0}.foswikiToc ul{list-style:none;padding:0 0 0 .5em;margin:0}.foswikiToc li{margin-left:1em;padding-left:1em;background-repeat:no-repeat;background-position:0 .5em}.foswikiToc .foswikiTocTitle{margin:0;padding:0;font-weight:bold}.foswikiSmall{font-size:86%;line-height:1.5em}.foswikiSmallish{font-size:94%;line-height:1.5em}.foswikiEmulatedLink{text-decoration:underline}.foswikiPageForm table{border-width:1px;border-style:solid}.foswikiPageForm table{width:100%}.foswikiPageForm th,.foswikiPageForm td{border:0;padding:.5em 1em}.foswikiPageForm td.first{padding-top:1em}.foswikiBroadcastMessage,.foswikiNotification{padding:1em 20px}.foswikiNotification{margin:1em 0;border-style:solid;border-width:2px}.foswikiBroadcastMessage{margin:0 0 1.25em 0}.foswikiMessage{padding:.5em 10px;border:0}.foswikiHelp{padding:1em;margin:.25em 0 0 0;border-style:solid;border-width:2px}.foswikiHelp ul{margin:0;padding-left:20px}.foswikiAccessKey{border:0}a:hover .foswikiAccessKey{text-decoration:none;border-width:0 0 1px 0;border-style:solid}.foswikiWebIndent{margin:0 0 0 1em}.foswikiImage img{padding:3px;border-width:1px;border-style:solid}.foswikiImage a:link,.foswikiImage a:visited{background:0}#foswikiLogo img{margin:0;padding:0;border:0}.foswikiNoBreak{white-space:nowrap}.foswikiSearchResultCount{font-weight:bold}.patternNoViewPage #patternOuter{margin-left:0;margin-right:0}#patternTopBar{border-width:1px;border-style:none none solid none}#patternBottomBar{border-width:1px 0 0 0;border-style:solid}#patternWebBottomBar{font-size:94%;line-height:125%;text-align:left}#patternSideBarContents{margin:0 0 1em 0;padding-right:.5em;padding-left:1em}#patternMainContents,#patternBottomBarContents,#patternSideBarContents,#patternTopBarContents{padding-right:2em;padding-left:2em}#patternSideBarContents,#patternMainContents{padding-top:2em}#patternSideBarContents{padding-bottom:2em}#patternTopBarContents{padding-top:1em}#patternBottomBarContents{padding-top:1em}.patternNoViewPage .foswikiTopic{margin-top:2em}#patternMainContents{padding-bottom:4em}#patternBottomBarContents{padding-bottom:2em}.foswikiTopic{margin:0 0 2em 0}.patternNoViewPage #patternMainContents,.patternNoViewPage #patternBottomBarContents{margin-left:4%;margin-right:4%}.patternEditPage #patternMainContents,.patternEditPage #patternBottomBarContents{margin-left:2%;margin-right:2%}.patternTop{margin:0 0 .5em 0}.patternNoViewPage .patternTop{font-size:94%}#patternSideBarContents img{margin:0 3px 0 0;vertical-align:text-bottom}#patternSideBarContents a:link,#patternSideBarContents a:visited{text-decoration:none}#patternSideBarContents ul{padding:0;margin:0;list-style:none}#patternSideBarContents,#patternSideBarContents ul,#patternSideBarContents li{line-height:1.35em}#patternSideBarContents h2{border:0;background-color:transparent}#patternSideBarContents .patternLeftBarPersonal,#patternSideBarContents .patternWebIndicator{padding:0 1em .75em 1em;margin:0 -1em .75em -1em;border-style:none none solid none;border-width:1px}.patternWebIndicator a{font-size:1.1em;font-weight:bold}.patternLeftBarPersonalContent{padding:1em 0 0 0}#patternSideBarContents li{overflow:hidden}html>body #patternSideBarContents li{overflow:visible}.patternMetaMenu input,.patternMetaMenu select,.patternMetaMenu select option{margin:0}.patternMetaMenu select option{padding:1px 0 0 0}.patternMetaMenu ul{padding:0;margin:0;list-style:none}.patternMetaMenu ul li{padding:0;display:inline}.patternMetaMenu ul li .foswikiInputField,.patternMetaMenu ul li .foswikiSelect{margin:0 0 0 .5em}.patternHomePath .foswikiSeparator{padding:0 .5em}.patternHomePath a:link,.patternHomePath a:visited{text-decoration:none;border-style:none none solid none;border-width:1px}.patternToolBar span{float:left}.patternToolBar span s,.patternToolBar span strike,.patternToolBar span a:link,.patternToolBar span a:visited{display:block;border-width:1px;border-style:solid;padding:.1em .35em;margin:0 0 .2em .25em;font-weight:bold}.patternToolBar span a:link,.patternToolBar span a:visited{text-decoration:none;outline:0}.patternToolBar span a:hover,.patternToolBar span a:hover{border-width:1px;border-style:solid}.patternToolBar span a:active{outline:0}.patternToolBar span.foswikiAccessKey{float:none}.patternToolBar span s,.patternToolBar span strike{text-decoration:none}.patternActionButtons a:link,.patternActionButtons a:visited{padding:1px 1px 2px 1px}.patternTopicActions .patternActionButtons a:link,.patternTopicActions .patternActionButtons a:visited{text-decoration:none}.patternTopicActions .patternActionButtons span s,.patternTopicActions .patternActionButtons span strike{text-decoration:none}.patternActionButtons a.foswikiButton,.patternActionButtons a.foswikiSubmit,.patternActionButtons a.foswikiButtonCancel{padding:.1em .2em}.patternInfo{margin:1.5em 0 0 0}.patternHomePath .patternRevInfo{font-size:94%;white-space:nowrap}.patternTopicFooter{margin:1em 0 0 0}.patternSimpleLogo{margin:1em 0 0 0}.foswikiWebSearchForm form{width:100%}.foswikiWebSearchForm ul{list-style:none;margin-top:0}#foswikiSearchTable{width:100%;margin:.5em 0;background:0;border-bottom:0}#foswikiSearchTable th,#foswikiSearchTable td{padding:1em;border-width:0 0 1px 0;border-style:solid}#foswikiSearchTable th{width:20%;text-align:right}#foswikiSearchTable td{width:80%}.patternSearchResults{margin:0 0 1em 0}#renamehelpshow a span,#renamehelphide a span{font-size:1.1em}.patternSearchResults blockquote{margin:1em 0 1em 5em}h3.patternSearchResultsHeader,h4.patternSearchResultsHeader{display:block;border-width:0 0 1px 0;border-style:solid;font-weight:bold}.patternSearchResults h3{font-size:115%;margin:0;padding:.5em 40px;font-weight:bold}h4.patternSearchResultsHeader{font-size:100%;padding-top:.3em;padding-bottom:.3em;font-weight:normal}.patternSearchResult .foswikiTopRow{padding-top:.2em;margin-top:.1em}.patternSearchResult .foswikiBottomRow{margin-bottom:.1em;padding-bottom:.25em;border-width:0 0 1px 0;border-style:solid}.patternSearchResult .foswikiAlert{font-weight:bold}.patternSearchResult .foswikiSummary .foswikiAlert{font-weight:normal}.patternSearchResult .foswikiNew{border-width:1px;border-style:solid;font-size:86%;padding:0 1px;font-weight:bold}.foswikiSearchResultsHeader span{padding:0 .5em 0 0}.foswikiSearchResultCount{font-weight:bold}.foswikiSearchResult{margin:0 0 1em 0}.foswikiSearchResult .foswikiAlert{font-weight:bold}.foswikiSummary,.foswikiSearchResult .foswikiBottomRow{font-size:86%}.foswikiSearchResult .foswikiSummary .foswikiAlert{font-weight:normal}.foswikiSearchResultsPager{margin:1em 0;padding:.25em 0}.patternSearchResults .foswikiHelp{display:block;width:auto;padding:.1em 5px;margin:1em -5px .35em -5px}.patternSearchResultCount{margin:1em 0 3em 0}.patternBookView{border-width:0 0 2px 2px;border-style:solid;margin:.5em 0 1.5em -5px;padding:0 0 0 5px}.patternBookView .foswikiTopRow{padding:.25em 5px .15em 5px;margin:1em -5px .15em -5px}.patternBookView .foswikiBottomRow{font-size:100%;padding:1em 0 1em 0;width:auto;border:0}#edithelphide a span,#edithelpshow a span{font-size:1.1em}.patternNoViewPage #patternMainContents{padding-top:0}.patternEditPage #patternMainContents{padding-left:0;padding-right:0}.patternEditPage .patternEditTopic{padding:5px;margin:0 0 1em 0}.patternEditPage .foswikiForm{border:0}.foswikiFormHolder{width:100%}.patternEditPage .foswikiForm h1,.patternEditPage .foswikiForm h2,.patternEditPage .foswikiForm h3{font-size:120%;font-weight:bold}.foswikiEditboxStyleMono{font-family:"Bitstream Vera Sans Mono","Andale Mono",Courier,monospace}.foswikiEditboxStyleProportional{font-family:arial,verdana,sans-serif}.patternSig{text-align:right}.patternSigLine{margin:.5em 0 0 0;border-style:none}.foswikiAddFormButton{float:right}.patternTextareaButton{margin:0 0 0 1px;display:block;cursor:pointer;border-style:solid;border-width:1px}.patternButtonFontSelector{margin:0 8px 0 0}.patternSaveHelp{margin:1em 0 0 0;line-height:1.5em}.patternPreviewPage #patternMainContents{padding-left:0;padding-right:0}.patternPreviewPage .foswikiTopic{margin-bottom:0}.foswikiPreviewArea{border-width:1px;border-style:solid;margin:0 0 1.5em 0;padding:2em}.patternAttachPage .foswikiAttachments .foswikiTable{width:auto}.patternAttachPage .foswikiAttachments{margin-top:0}.patternMoveAttachment{margin:.5em 0 0 0;text-align:right}.patternDiff{border-width:0 0 2px 2px;border-style:solid;margin:.5em 0 1.5em 0;padding:0 0 0 10px}.patternDiff h4.patternSearchResultsHeader{padding:.5em 10px}.patternDiffPage .patternRevInfo ul{padding:0;margin:2em 0 0 0;list-style:none}.patternDiffPage .foswikiDiffTable{margin:2em 0}.foswikiDiffDebug{font-family:"Bitstream Vera Sans Mono","Andale Mono",Courier,monospace;font-size:86%;white-space:pre}tr.foswikiDiffDebug td{border-width:1px;border-style:solid}.patternDiffPage td.foswikiDiffDebugLeft{border-bottom:0}.patternDiffPage .foswikiDiffTable th{padding:.25em .5em}.patternDiffPage .foswikiDiffTable td{padding:.25em}.foswikiDiffLineNumberHeader{padding:.3em 0}.mceContentBody{padding:1px 4px} \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkinTheme2009/variant_twiki.css b/doc/html/user/pub/System/PatternSkinTheme2009/variant_twiki.css index f545a73e..03da46c8 100644 --- a/doc/html/user/pub/System/PatternSkinTheme2009/variant_twiki.css +++ b/doc/html/user/pub/System/PatternSkinTheme2009/variant_twiki.css @@ -1,45 +1 @@ -/* -Compatible skin for TWiki-like installations -Overrides global settings in layout.css, style.css and colors.css -*/ - -/* outer 'frame' */ -#patternScreen { - padding:0; -} -#patternPage { - border:none; -} - -/* paddings of main content elements */ -#patternBottomBarContents, -#patternTopBarContents { - padding-right:2em; - padding-left:1em; -} -#patternMainContents { - padding-right:2em; - padding-left:2em; -} -#patternSideBarContents, -#patternMainContents { - padding-top:1em; -} -#patternBottomBarContents { - padding-top:1em; -} - -/* top bar */ -#patternTopBarContents { - background-image:url(TWiki_header.gif); - background-repeat:no-repeat; - background-color:#fff; -} -#patternTopBar, -#patternClearHeaderCenter, -#patternClearHeaderLeft, -#patternClearHeaderRight, -#patternTopBarContents { - height:64px; - overflow:hidden; -} +#patternScreen{padding:0}#patternPage{border:0}#patternBottomBarContents,#patternTopBarContents{padding-right:2em;padding-left:1em}#patternMainContents{padding-right:2em;padding-left:2em}#patternSideBarContents,#patternMainContents{padding-top:1em}#patternBottomBarContents{padding-top:1em}#patternTopBarContents{background-image:url(TWiki_header.gif);background-repeat:no-repeat;background-color:#fff}#patternTopBar,#patternTopBarContents{height:64px;overflow:hidden} \ No newline at end of file diff --git a/doc/html/user/pub/System/PsiSkin/psistyle.css b/doc/html/user/pub/System/PsiSkin/psistyle.css index 8626dd6b..00c5ebb6 100644 --- a/doc/html/user/pub/System/PsiSkin/psistyle.css +++ b/doc/html/user/pub/System/PsiSkin/psistyle.css @@ -99,7 +99,8 @@ blockquote.psi { /* DMS Icon */ -.patternContent a[href^="http:"] { +.patternContent a[href^="http:"], +.patternContent a[href^="https:"] { background-image: url(../DocumentGraphics/external.gif); background-position: right center; background-repeat: no-repeat; @@ -107,11 +108,14 @@ blockquote.psi { } .patternContent a[href^="http:"]:hover, -.patternContent a[href^="http:"]:visited:hover { +.patternContent a[href^="http:"]:visited:hover, +.patternContent a[href^="https:"]:hover, +.patternContent a[href^="https:"]:visited:hover { background-image: url(../DocumentGraphics/external-hover.gif); } -.patternContent a[href^="http:"]:visited { +.patternContent a[href^="http:"]:visited, +.patternContent a[href^="https:"]:visited { background-image: url(../DocumentGraphics/external-visited.gif); } @@ -128,14 +132,17 @@ blockquote.psi { padding-right: 0px; } -.patternContent a[href^="http://i.psi.ch"] { +.patternContent a[href^="http://i.psi.ch"], +.patternContent a[href^="https://intranet.psi.ch"] { background: transparent; padding-right: 0px; background-repeat: no-repeat; background-image: none; } .patternContent a[href^="http://i.psi.ch"]:hover, -.patternContent a[href^="http://i.psi.ch"]:visited:hover { +.patternContent a[href^="http://i.psi.ch"]:visited:hover, +.patternContent a[href^="https://intranet.psi.ch"]:hover, +.patternContent a[href^="https://intranet.psi.ch"]:visited:hover { background-image: none; background-color: #0055B5; } @@ -175,7 +182,7 @@ caption { :lang(de) { quotes:"\201E" "\201C" "\201A" "\2018"; } :lang(en) { quotes:"\201C" "\201D" "\2018" "\2019"; } -:lang(fr) { quotes:"\00AB\A0" "\A0\00BB" "\2039\A0" "\A0\203A"; } +:lang(fr) { quotes:"\00AB" "\00BB" "\2039" "\203A"; } q:before { content:open-quote; color:#000000; } q:after { content:close-quote; color:#000000; } diff --git a/doc/html/user/pub/System/SkinTemplates/base.css b/doc/html/user/pub/System/SkinTemplates/base.css index f3445348..f50c8b3d 100644 --- a/doc/html/user/pub/System/SkinTemplates/base.css +++ b/doc/html/user/pub/System/SkinTemplates/base.css @@ -1 +1 @@ -.foswikiMakeVisible,.foswikiMakeVisibleInline,.foswikiMakeVisibleBlock{display:none;}.foswikiJs .foswikiMakeVisible{display:inline;}.foswikiJs p.foswikiMakeVisible,.foswikiJs h1.foswikiMakeVisible,.foswikiJs h2.foswikiMakeVisible,.foswikiJs h3.foswikiMakeVisible,.foswikiJs h4.foswikiMakeVisible,.foswikiJs h5.foswikiMakeVisible,.foswikiJs h6.foswikiMakeVisible,.foswikiJs dl.foswikiMakeVisible,.foswikiJs dt.foswikiMakeVisible,.foswikiJs dd.foswikiMakeVisible,.foswikiJs ol.foswikiMakeVisible,.foswikiJs ul.foswikiMakeVisible,.foswikiJs li.foswikiMakeVisible,.foswikiJs address.foswikiMakeVisible,.foswikiJs blockquote.foswikiMakeVisible,.foswikiJs center.foswikiMakeVisible,.foswikiJs del.foswikiMakeVisible,.foswikiJs div.foswikiMakeVisible,.foswikiJs form.foswikiMakeVisible,.foswikiJs hr.foswikiMakeVisible,.foswikiJs ins.foswikiMakeVisible,.foswikiJs noscript.foswikiMakeVisible,.foswikiJs pre.foswikiMakeVisible,.foswikiJs table.foswikiMakeVisible{display:block;}.foswikiJs .foswikiMakeVisibleInline{display:inline;}.foswikiJs .foswikiMakeVisibleBlock{display:block;}.foswikiJs .foswikiMakeHidden{display:none;}.foswikiLeft{float:left;position:relative;}.foswikiRight{position:relative;float:right;display:inline;margin:0;}.foswikiClear,.foswikiFormStep p.foswikiClear{margin:0;padding:0;height:0;line-height:0;clear:both;display:block;}.foswikiHidden{display:none;}.foswikiSmall{font-size:86%;line-height:110%;}.foswikiSmallish{font-size:94%;}.foswikiLarge{font-size:1.3em;line-height:1.5em;}.foswikiBroadcastMessage,.foswikiNotification{background-color:#fff7e7;padding:.25em .5em;margin:0 0 1em 0;}.foswikiBroadcastMessage b,.foswikiBroadcastMessage strong{color:#f00;}.foswikiMessage{padding:.5em 10px;background-color:#fff7e7;border:none;}.foswikiAlert,.foswikiAlert code{color:#f00;}.foswikiEmulatedLink{text-decoration:underline;}.foswikiAccessKey{text-decoration:none;border-width:0 0 1px 0;border-style:solid;}a:hover .foswikiAccessKey{text-decoration:none;border:none;}img{border:0;vertical-align:middle;}.foswikiImage img{padding:3px;border-width:1px;border-style:solid;}.foswikiPreviewArea{border-width:1px;border-style:solid;border-color:#f00;margin:1em 0;padding:1em;}.foswikiSummary em{font-weight:bold;font-style:normal;color:#000;}.foswikiTabs ul{margin:0;padding:0;list-style:none;position:relative;bottom:0;}.foswikiTabs ul li{display:inline;}.foswikiTabs ul li a,.foswikiTabs ul li a:link,.foswikiTabs ul li a:hover,.foswikiTabs ul li a:visited{text-decoration:none;color:#000;}.foswikiTabs ul li a,.foswikiTabs ul li span{display:block;float:left;margin:0 6px 0 0;padding:.35em .7em;border-style:solid;border-width:1px;border-color:#ccc;background:#eee;}.foswikiTabs ul li a,.foswikiTabs ul li span,.foswikiTabContent{border-style:solid;border-width:1px;border-color:#ccc;}.foswikiTabs ul li.foswikiActiveTab a,.foswikiTabs ul li a:hover,.foswikiTabs ul li span{border-bottom-color:#fff;background:#fff;}.foswikiTabContent{margin:-1px 0 1em 0;padding:.7em;background:#fff;}.foswikiHorizontalList ul{margin:0;padding:0;list-style:none;clear:both;}.foswikiHorizontalList ul li{float:left;display:block;padding:0 .5em;border-style:none solid none none;border-width:1px;}.foswikiHorizontalList ul li.foswikiLast{border:none;}.foswikiYellowFG{color:#ff0;}.foswikiOrangeFG{color:#f60;}.foswikiRedFG{color:#f00;}.foswikiPinkFG{color:#f0f;}.foswikiPurpleFG{color:#800080;}.foswikiTealFG{color:#008080;}.foswikiNavyFG{color:#000080;}.foswikiBlueFG{color:#00f;}.foswikiAquaFG{color:#0ff;}.foswikiLimeFG{color:#0f0;}.foswikiGreenFG{color:#008000;}.foswikiOliveFG{color:#808000;}.foswikiMaroonFG{color:#800000;}.foswikiBrownFG{color:#963;}.foswikiBlackFG{color:#000;}.foswikiGrayFG{color:#808080;}.foswikiSilverFG{color:#c0c0c0;}.foswikiWhiteFG{color:#fff;}.foswikiYellowBG{background-color:#ff0;}.foswikiOrangeBG{background-color:#f60;}.foswikiRedBG{background-color:#f00;}.foswikiPinkBG{background-color:#f0f;}.foswikiPurpleBG{background-color:#800080;}.foswikiNavyBG{background-color:#000080;}.foswikiBlueBG{background-color:#00f;}.foswikiTealBG{background-color:#008080;}.foswikiAquaBG{background-color:#0ff;}.foswikiLimeBG{background-color:#0f0;}.foswikiGreenBG{background-color:#008000;}.foswikiOliveBG{background-color:#808000;}.foswikiMaroonBG{background-color:#800000;}.foswikiBrownBG{background-color:#963;}.foswikiBlackBG{background-color:#000;}.foswikiGrayBG{background-color:#808080;}.foswikiSilverBG{background-color:#c0c0c0;}.foswikiWhiteBG{background-color:#fff;} \ No newline at end of file +.foswikiNoJs .foswikiMakeVisible,.foswikiNoJs .foswikiMakeVisibleInline,.foswikiNoJs .foswikiMakeVisibleBlock{display:none}.foswikiMakeVisible{display:inline}a.foswikiMakeVisible,p.foswikiMakeVisible,h1.foswikiMakeVisible,h2.foswikiMakeVisible,h3.foswikiMakeVisible,h4.foswikiMakeVisible,h5.foswikiMakeVisible,h6.foswikiMakeVisible,dl.foswikiMakeVisible,dt.foswikiMakeVisible,dd.foswikiMakeVisible,ol.foswikiMakeVisible,ul.foswikiMakeVisible,li.foswikiMakeVisible,address.foswikiMakeVisible,blockquote.foswikiMakeVisible,center.foswikiMakeVisible,del.foswikiMakeVisible,div.foswikiMakeVisible,form.foswikiMakeVisible,hr.foswikiMakeVisible,ins.foswikiMakeVisible,noscript.foswikiMakeVisible,pre.foswikiMakeVisible,table.foswikiMakeVisible{display:block}.foswikiMakeVisibleInline{display:inline}.foswikiMakeVisibleBlock{display:block}.foswikiMakeHidden{display:none}.foswikiLeft{float:left}.foswikiRight{float:right}.foswikiClear,.foswikiFormStep p.foswikiClear{margin:0;padding:0;height:0;line-height:0;clear:both;display:block}.foswikiHidden{display:none}.foswikiSmall{font-size:86%;line-height:110%}.foswikiSmallish{font-size:94%}.foswikiLarge{font-size:1.3em;line-height:1.5em}.foswikiBroadcastMessage,.foswikiNotification{background-color:#fff7e7;padding:.25em .5em;margin:0 0 1em 0}.foswikiBroadcastMessage b,.foswikiBroadcastMessage strong{color:#f00}.foswikiMessage{padding:.5em 10px;background-color:#fff7e7;border:0}.foswikiAlert,.foswikiAlert code{color:#f00}.foswikiNewLink,.foswikiNewLink:link,.foswikiNewLink:visited{color:#b00000;text-decoration:none;border-bottom:1px dotted #b00000}.foswikiNewLink:link:hover{color:#b00000;text-decoration:none;border-bottom:1px solid #b00000}.foswikiEmulatedLink{text-decoration:underline}.foswikiAccessKey{text-decoration:none;border-width:0 0 1px 0;border-style:solid}a:hover .foswikiAccessKey{text-decoration:none;border:0}img{border:0;vertical-align:middle}pre{white-space:pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;white-space:-moz-pre-wrap;width:auto;margin:1em 0;padding:1em}.foswikiImage img{padding:3px;border-width:1px;border-style:solid}.foswikiPreviewArea{border-width:1px;border-style:solid;border-color:#f00;margin:1em 0;padding:1em}.foswikiSummary em{font-weight:bold;font-style:normal;color:#000}.foswikiTabs{position:relative}.foswikiTabs:after{content:'';position:absolute;width:100%;height:1px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#ccc;bottom:0}.foswikiTabs>ul{margin:0;padding:0;list-style:none;bottom:0;margin-bottom:-1px;*zoom:1}.foswikiTabs>ul:before,.foswikiTabs>ul:after{display:table;content:"";line-height:0}.foswikiTabs>ul:after{clear:both}.foswikiTabs>ul>li{display:inline}.foswikiTabs>ul>li>a{position:relative;display:inline-block;float:left;margin-right:6px;border-style:solid;border-width:1px;border-color:#ccc;background-image:none;background:#eee}.foswikiTabs>ul>li>a:link,.foswikiTabs>ul>li>a:visited,.foswikiTabs>ul>li>a:hover,.foswikiTabs>ul>li>a:active{padding:.35em .7em;text-decoration:none;color:#000}.foswikiTabs>ul>li>a:visited{color:#000}.foswikiTabs>ul>li>a:hover{background:#eee}.foswikiTabs>ul>li.foswikiActiveTab a:hover,.foswikiTabs>ul>li.foswikiActive a:hover{cursor:default}.foswikiTabs>ul>li.foswikiActiveTab a,.foswikiTabs>ul>li.foswikiActive a{border-bottom-color:#fff;background:#fff;z-index:1}.foswikiTabContent{border-style:solid;border-width:1px;border-color:#ccc;background:#fff;margin-bottom:1.5em}.foswikiNoJs .foswikiTabs>ul{display:none}.foswikiWebSearchForm{margin:1em 0}.foswikiHorizontalList ul{margin:0;padding:0;list-style:none;clear:both}.foswikiHorizontalList ul li{float:left;display:block;padding:0 .5em;border-style:none solid none none;border-width:1px}.foswikiHorizontalList ul li.foswikiLast{border:0}.foswikiIndent{padding-left:3em}.foswikiToc.foswikiRight{margin:0 0 1em 2em;max-width:40%}.foswikiToc.foswikiLeft{margin:0 2em 1em 0;max-width:40%}.foswikiToc .foswikiTocTitle{font-weight:bold}.foswikiYellowFG{color:#ff0}.foswikiOrangeFG{color:#f60}.foswikiRedFG{color:#f00}.foswikiPinkFG{color:#f0f}.foswikiPurpleFG{color:#800080}.foswikiTealFG{color:#008080}.foswikiNavyFG{color:#000080}.foswikiBlueFG{color:#00f}.foswikiAquaFG{color:#0ff}.foswikiLimeFG{color:#0f0}.foswikiGreenFG{color:#008000}.foswikiOliveFG{color:#808000}.foswikiMaroonFG{color:#800000}.foswikiBrownFG{color:#963}.foswikiBlackFG{color:#000}.foswikiGrayFG{color:#808080}.foswikiSilverFG{color:#c0c0c0}.foswikiWhiteFG{color:#fff}.foswikiYellowBG{background-color:#ff0}.foswikiOrangeBG{background-color:#f60}.foswikiRedBG{background-color:#f00}.foswikiPinkBG{background-color:#f0f}.foswikiPurpleBG{background-color:#800080}.foswikiNavyBG{background-color:#000080}.foswikiBlueBG{background-color:#00f}.foswikiTealBG{background-color:#008080}.foswikiAquaBG{background-color:#0ff}.foswikiLimeBG{background-color:#0f0}.foswikiGreenBG{background-color:#008000}.foswikiOliveBG{background-color:#808000}.foswikiMaroonBG{background-color:#800000}.foswikiBrownBG{background-color:#963}.foswikiBlackBG{background-color:#000}.foswikiGrayBG{background-color:#808080}.foswikiSilverBG{background-color:#c0c0c0}.foswikiWhiteBG{background-color:#fff} \ No newline at end of file diff --git a/doc/memos/rrf/08011-Fourier-Averaged.pdf b/doc/memos/rrf/08011-Fourier-Averaged.pdf new file mode 100644 index 00000000..c95586d5 Binary files /dev/null and b/doc/memos/rrf/08011-Fourier-Averaged.pdf differ diff --git a/doc/memos/rrf/08011-RRF-Asym-Fourier-Averaged-Ghost.pdf b/doc/memos/rrf/08011-RRF-Asym-Fourier-Averaged-Ghost.pdf new file mode 100644 index 00000000..85876e84 Binary files /dev/null and b/doc/memos/rrf/08011-RRF-Asym-Fourier-Averaged-Ghost.pdf differ diff --git a/doc/memos/rrf/08011-RRF-Histo-Fourier-Averaged-Ghost.pdf b/doc/memos/rrf/08011-RRF-Histo-Fourier-Averaged-Ghost.pdf new file mode 100644 index 00000000..74eb41cc Binary files /dev/null and b/doc/memos/rrf/08011-RRF-Histo-Fourier-Averaged-Ghost.pdf differ diff --git a/doc/memos/rrf/08019-Fourier-Averaged.pdf b/doc/memos/rrf/08019-Fourier-Averaged.pdf new file mode 100644 index 00000000..baee392f Binary files /dev/null and b/doc/memos/rrf/08019-Fourier-Averaged.pdf differ diff --git a/doc/memos/rrf/HAL-9500-t0.pdf b/doc/memos/rrf/HAL-9500-t0.pdf new file mode 100644 index 00000000..90fe700d Binary files /dev/null and b/doc/memos/rrf/HAL-9500-t0.pdf differ diff --git a/doc/memos/rrf/PSI_Logo_narrow_blau.jpg b/doc/memos/rrf/PSI_Logo_narrow_blau.jpg new file mode 100644 index 00000000..aa253979 Binary files /dev/null and b/doc/memos/rrf/PSI_Logo_narrow_blau.jpg differ diff --git a/doc/memos/rrf/PSI_Logo_wide_blau.pdf b/doc/memos/rrf/PSI_Logo_wide_blau.pdf new file mode 100644 index 00000000..13482e93 Binary files /dev/null and b/doc/memos/rrf/PSI_Logo_wide_blau.pdf differ diff --git a/doc/memos/rrf/rrf-notes.pdf b/doc/memos/rrf/rrf-notes.pdf new file mode 100644 index 00000000..89b20118 Binary files /dev/null and b/doc/memos/rrf/rrf-notes.pdf differ diff --git a/doc/memos/rrf/rrf-notes.tex b/doc/memos/rrf/rrf-notes.tex new file mode 100644 index 00000000..74dd9903 --- /dev/null +++ b/doc/memos/rrf/rrf-notes.tex @@ -0,0 +1,265 @@ +\documentclass[twoside]{article} + +\usepackage[english]{babel} +\usepackage{a4} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage{fancyhdr} +\usepackage{array} +\usepackage{float} +\usepackage{hyperref} +\usepackage{xspace} +\usepackage{rotating} +\usepackage{dcolumn} +\usepackage{url} + +\setlength{\topmargin}{10mm} +\setlength{\topmargin}{-13mm} +% \setlength{\oddsidemargin}{0.5cm} +% \setlength{\evensidemargin}{0cm} +\setlength{\oddsidemargin}{1cm} +\setlength{\evensidemargin}{1cm} +\setlength{\textwidth}{14.5cm} +\setlength{\textheight}{23.8cm} + +\def\mathbi#1{\textbf{\em #1}} + +\pagestyle{fancyplain} +\addtolength{\headwidth}{0.6cm} +\fancyhead{}% +\fancyhead[RE,LO]{\bf RRF Fits}% +\fancyhead[LE,RO]{\thepage} +\cfoot{--- Andreas Suter -- \today ---} +\rfoot{\includegraphics[width=6.4cm]{PSI_Logo_wide_blau.pdf}} + +\DeclareMathAlphabet{\bi}{OML}{cmm}{b}{it} + +\newcommand{\mean}[1]{\langle #1 \rangle} +\newcommand{\lem}{LE-$\mu$SR\xspace} +\newcommand{\musr}{$\mu$SR\xspace} +\newcommand{\etal}{\emph{et al.\xspace}} +\newcommand{\ie}{\emph{i.e.\xspace}} +\newcommand{\eg}{\emph{e.g.\xspace}} + +\newcolumntype{d}[1]{D{.}{.}{#1}} + +\begin{document} + +% Header info -------------------------------------------------- +\thispagestyle{empty} +\noindent +\begin{tabular}{@{\hspace{-0.7cm}}l@{\hspace{6cm}}r} +\noindent\includegraphics[width=3.4cm]{PSI_Logo_narrow_blau.jpg} & + {\Huge\sf Memorandum} +\end{tabular} +% +\vskip 1cm +% +\begin{tabular}{@{\hspace{-0.5cm}}ll@{\hspace{4cm}}ll} +Datum: & \today & & \\[3ex] +Von: & Andreas Suter & An: & \\ +Telefon: & +41\, (0)56\, 310\, 4238 & & \\ +Raum: & WLGA / 119 & cc: & \\ +e-mail: & \verb?andreas.suter@psi.ch? & & \\ +\end{tabular} +% +\vskip 0.3cm +\noindent\hrulefill +\vskip 1cm +% +\section{Rotating Reference Frame Fits} + +High transverse field \musr (HTF-\musr) experiments will typically lead to +rather large data sets since it is necessary to follow the high frequencies +present in the positron decay histograms. Currently the HAL-9500 instrument +at PSI \cite{HAL9500} is operated with $2\time 8$ positron detector, with a +typical number of $\sim 4\times 10^5$ histogram bins. To analyze HTF-\musr +data on rather slugish computer hardware is a challenge. In the last millennium +the people invented the rotating reference frame transformation (RRF) \cite{Riseman90} +to reduce to data sets to be handled. + +Here I will shortly describe the ways how it is implemented in \textsc{Musrfit}, +and why it should be avoided to be used altogether. The starting point of all +is given by the positron decay spectrum which formally takes the form + +\begin{equation}\label{eq:positron_decay_spectrum} + N^{(j)}(t) = N_0^{(j)} \exp(-t / \tau_\mu) \, \left[ 1 + A^{(j)}(t) \right] + N_{\rm bkg}^{(j)}, +\end{equation} + +\noindent where $(j)$ is the index of the positron counter, $N_0$ gives the scale +of recorded positrons, $\tau_\mu$ is the muon lifetime, $A(t)$ the asymmetry, and $N_{\rm bkg}$ +describes the background due to uncorrelated events. + +The idea behind the RRF is twofolded: (i) try to extract $A(t)$, and (ii) shift the high frequency +data set $A(t)$ to lower frequencies such that the number of necessary bins needed can be +reduced (packing / rebinning), and hence the overall number of bins is much smaller. + +As I will try to explain, this is not for free, and there are problems arising from +this kind of data treatment. + +\subsection{Single Histogram RRF Implementation} + +In a first step the asymmetry needs to be determined. This is done the following way: +\begin{enumerate} + \item Determine the background, $N_{\rm bkg}$, at times before $t_0$ ($t_0$ is the time of the muon + implantation). Hopefully the background before and after $t_0$ is equal, which is not always + the case. + \item Multiple the background corrected histogram with $\exp(+t / \tau_\mu)$, this is leading to +\end{enumerate} + +\begin{equation}\label{eq:Mt} + M(t) \equiv \left[ N(t) - N_{\rm bkg} \right]\,\exp(+t / \tau_\mu) = N_0 \left[ 1 + A(t) \right]. +\end{equation} + +\begin{enumerate} + \setcounter{enumi}{2} + \item In order to extract $A(t)$ from $M(t)$, $N_0$ needs to be determined, which is almost the + most tricky part here. The idea is simple: since $A(t)$ is dominated by high frequency signals, + proper averaging over $M(t)$ should allow to determine $N_0$, assuming that $\langle A(t) \rangle = 0$. + Is this assumption always true? \emph{No!} For instance it is \emph{not} true if the averaging is preformed + over incomplete periodes of a single assumed signal. Another case where it will fail is if multiple signals + with too far apart frequencies is present, as \eg in the case of muonium. Said all this, let's come + back and try to determine $N_0$: +\end{enumerate} + +\begin{equation}\label{eq:N0estimate} + N_0 = \sum_{k=0}^{N_{\rm avg}} w_k M(t_k), +\end{equation} + +\noindent where $N_{\rm avg}$ is determined such that $N_{\rm avg} \Delta t \simeq 1 \mu$s ($\Delta t$ being the +time resolution. $1 \mu$s means averaging over many cyles). In order to get a good estimate for $N_{\rm avg}$, $N(t)$ is Fourier +transformed, and from this power spectrum the frequency with the largest amplitude is determined, $\nu_{\rm 0}$. From $\nu_0$, +$\Delta t$, the number of cycles fitting into $1 \mu$s can be determined, and from this and the time resolution $N_{\rm avg}$ +can be calculated. The weight $w_k$ is given by: + +\begin{equation} + w_k = \frac{\left[\Delta M(t_k)\right]^{-2}}{\sum_{j=0}^{N_{\rm avg}} \left[\Delta M(t_j)\right]^{-2}}, +\end{equation} + +\noindent where + +\begin{equation} + \Delta M(t) = \left[ \left(\frac{\partial M}{\partial N} \Delta N\right)^2 + + \left(\frac{\partial M}{\partial N_{\rm bkg}} \Delta N_{\rm bkg}\right)^2 \right]^{1/2} + \simeq \exp(+t/\tau_\mu) \sqrt{N(t)}. +\end{equation} + +\noindent The error estimate on $N_0$ is then + +\begin{equation}\label{eq:N0-rrf} + \Delta N_0 = \sigma_{N_0} = \sqrt{\sum_k w_k^2 \Delta M(t_k)^2}. +\end{equation} + +\noindent Having estimated $N_0$, the asymmetry can be extracted as: + +\begin{equation} + A(t) = M(t) / N_0 - 1. +\end{equation} + +\begin{enumerate} + \setcounter{enumi}{3} + \item Now the actual RRF transformation can take place: $A_{\rm rrf}(t) = 2 \times A(t) \cos(\omega_{\rm rrf} t + \phi_{\rm rrf})$. + The factor of 2 is introduced to conserve the asymmetry amplitude. The idea is the following: Fourier transform theory tells as that +\end{enumerate} + +\begin{equation} + {\cal F}\left\{2 \times A(t) \cos(\omega_{\rm rrf} t + \phi_{\rm rrf}) \right\} = + {\cal F}\left\{A(t)\right\}(\omega-\omega_{\rm rrf}) + {\cal F}\left\{A(t)\right\}(\omega+\omega_{\rm rrf}), +\end{equation} + +\noindent \ie that the Fourier spectrum of $A(t)$ is shifted down and up by $\omega - \omega_{\rm rrf}$ and $\omega + \omega_{\rm rrf}$, respectively. +In order to get rid of the high frequency part (${\cal F}\left\{A(t)\right\}(\omega+\omega_{\rm rrf})$), $A_{\rm rrf}(t)$ will be heavily over-binned, +\ie + +\begin{enumerate} + \setcounter{enumi}{4} + \item Do the rrf packing: $A_{\rm rrf}(t) \rightarrow \langle A_{\rm rrf}(t) \rangle_p$. Packing itself is a filtering of data! Especially this + kind of filter is dispersive \cite{King89}, \ie that it potentially is leading to line shape distortions. For symmetric, rather narrow + lines, this is unlikely to be a problem. However, this might be quite different for complex line shapes as in the case of vortex lattices. +\end{enumerate} + +\noindent The property $\langle A_{\rm rrf}(t) \rangle_p$ is what is fitted. The error on this property is estimated the following way: (i) the +unpacked error of $A(t)$ is: + +\begin{equation} + \Delta A(t) \simeq \frac{\exp(+t/\tau_\mu)}{N_0}\,\left[ N(t) + \left( \frac{N(t)-N_{\rm bkg}}{N_0} \right)^2 \Delta N_0^2 \right]^{1/2}, +\end{equation} + +\noindent and form this the packed $A_{\rm rrf}(t)$ error can be calculated. + +\subsection{Asymmetry RRF Implementation} + +\begin{enumerate} + \item In order to circumvent the difficulties to estimate $N_0$ the asymmetry of the starting positron histograms is formed. For details + see \cite{musrfit_userManual15}. For this, positron detectors geometrically under $180^\circ$ are used. However, due the the spiraling + of the positron in sufficiently high magnetic fields, and the uncertainties of the $t_0$'s, the geometrical phase might \emph{not} + correspond to the positron signal phase! At $B=9$T the uncertainty in $t_0$ by one channel leads to a phase shift of + $\gamma_\mu B \Delta t \cdot (180 / \pi) = 1.7^\circ$. Fig.\ref{fig:hal-9500-t0} shows the $t_0$-region of a typical HAL-9500 spectrum. + It shows that it is very hard to get the absolut value of $t_0$ right. + \item Carry out the RRF transformation $A_{\rm rrf}(t) = 2 \times A(t) \cos(\omega_{\rm rrf} t + \phi_{\rm rrf})$. + \item Do the rrf packing. +\end{enumerate} + +\begin{figure}[h] + \centering + \includegraphics[width=0.5\textwidth]{HAL-9500-t0.pdf} + \caption{The $t_0$ region of a typical HAL-9500 spectrum. The broad black hump with the green line, is the ``prompt'' peak. + It is \emph{not} straight forward how to define $t_0$.}\label{fig:hal-9500-t0} +\end{figure} + + +\section{Discussion} + +Both RRF transformation sketched above have weak points which makes it hard to estimate systematic errors. Both methods will fail at too +low fields of $\lesssim 1$T. The only and single purpose of the RRF transformation is slughish computer power! We developed GPU based fitting +which overcomes \emph{all} this uncontrolled weaknesses and henceforth RRF could be omitted altogether. I still added it for the time being, +since strong GPU/CPU hardware is still a bit costly and therefore not affordable to everyone. + +In order to give a feeling about what might go ``wrong'' with the RRF, I was running a couple of test cases. The chosen asymmetry is + +\begin{equation}\label{eq:asymmetry-simulation} + A^{(j)}(t) = A_0^{(j)} \sum_{k=1}^3 f_k \exp\left[-0.5\cdot (\sigma_k t)^2 \right] \cos(\gamma_\mu B_k t + \phi^{(j)}), +\end{equation} + +\noindent with values found in Tab.\ref{tab:asymmetry-parameters}. For the simulation 4 positron detector signals were generated with +$A_0^{(j)} = \left\{ 0.2554, 0.2574, 0.2576, 0.2566 \right\}$. The further ingredients were: $N_0^{(j)} = \left\{ 27.0, 25.3, 25.6, 26.9 \right\}$, +$N_{\rm bkg}^{(j)} = \left\{ 0.055, 0.060, 0.069, 0.064 \right\}$, and $ \phi^{(j)} = \left\{ 5.0, 95.0, 185.0, 275.0 \right\}$. + +\begin{table}[h] + \centering + \begin{tabular}{c|c|c|c} + $k$ & $f_k$ & $\sigma_k$ & $B_k$ \\ + & & ($1/\mu$s) & (T) \\ \hline\hline + 1 & 0.5 & 7 & $1$ or $9$ \\ + 2 & 0.2 & 0.75 & $1.02$ or $9.02$ \\ + 3 & 0.3 & 0.25 & $1.06$ or $9.06$ + \end{tabular} + \caption{Parameters used in Eq.(\ref{eq:asymmetry-simulation}).}\label{tab:asymmetry-parameters} +\end{table} + +\begin{figure}[h] + \centering + \includegraphics[width=0.45\textwidth]{08011-Fourier-Averaged.pdf} \quad + \includegraphics[width=0.45\textwidth]{08011-RRF-Histo-Fourier-Averaged-Ghost.pdf} \\ + \includegraphics[width=0.45\textwidth]{08011-RRF-Asym-Fourier-Averaged-Ghost.pdf} + \caption{Averaged Fourier power spectra. Top left: from single histogram fit for the 1T data set. + Top right: from single histogram RRF fit. Bottom: from asymmetry RRF fit. Both RRF + sets show ghost lines.}\label{fig:08011-Fourier} +\end{figure} + +Figure.\ref{fig:08011-Fourier} shows the averaged Fourier power spectra for the simulated data sets at 1T. Both RRF transformation are +showing ghost lines, even for optimally chosen RRF rebinning. At higher fields this is less pronounced. The ghost lines have various origins +such as aliasing effects due to the RRF packing not prefectly suppressing the high frequency part of $A_{\rm rrf}(t)$, leakage of the RRF frequency +for not sufficently precise known $N_0$ (see Eq.(\ref{eq:N0-rrf})) for single histogram RRF fits, etc. + +Fits of simulated data as described above (see Eq.(\ref{eq:asymmetry-simulation}), with fields 0.5, 1.0, 3.0, 5.0, 7.0, and 9.0T) show that above +about 1T the model parameters of the RRF fits are acceptable, but the error bars are typically about a factor 3 larger compared to single histogram +fits. The asymmetries of the RRF fits are ``substantially'' too small. The $\chi^2$ values are close to meaningless for the RRF fits, since they +are strongly depending on the RRF packing, time interval chosen, etc. + +To summaries: RRF fits can be used for online analysis if no GPU accelerator is available, but \emph{must not} be used for any final analysis! + +\bibliographystyle{amsplain} +\bibliography{rrf} + +\end{document} \ No newline at end of file diff --git a/doc/memos/rrf/rrf.bib b/doc/memos/rrf/rrf.bib new file mode 100644 index 00000000..6106f488 --- /dev/null +++ b/doc/memos/rrf/rrf.bib @@ -0,0 +1,29 @@ +@Article{ Riseman90, + title = {{The Rotating Reference Frame Transformation in $\mu$SR}}, + author = "T. M. Riseman and J. H. Brewer", + journal = "Hyperfine Interact.", + volume = "65", + year = "1990", + pages = "1107" +} + +@Misc{ HAL9500, + title = {{HAL-9500}}, + author = "", + note = {{\verb!https://www.psi.ch/smus/hal-9500!}}, +} + +@book{ King89, + Address = {New York}, + Author = {R. King and M. Ahmadi and R. Gorgui-Naguib and A. Kwabwe and M. Azimi-Sajadi}, + Edition = {1st}, + Publisher = {Plenum Press}, + Title = {Digital Filtering in one and two Dimensions}, + Year = 1989 +} + +@Misc{ musrfit_userManual15, + title = {{Musrfit User Guide}}, + author = "", + note = {{\verb!https://intranet.psi.ch/MUSR/MusrFit#A_5.3_Asymmetry_Fit!}}, +} diff --git a/doc/musrfit.dox b/doc/musrfit.dox index e03ae52f..521cb421 100644 --- a/doc/musrfit.dox +++ b/doc/musrfit.dox @@ -38,6 +38,7 @@ How to setup musrfit on different platforms: \texttt{http://lmu.web.psi.ch/musrf

The musrfit framework provies the following programs: - \ref musrfit Carries out fits based on a msr-file. - \ref musrview Is used show the data in a graphical representation. +- \ref musrFT Is used to show Fourier transforms of data without the need of a theory (raw data Fourier transform). - \ref musrt0 Is used to set graphically t0's, background and data ranges off raw histogram data. - \ref musrparam Can be used to generate ascii output files with extracted fit-parameters (from msr-files) and independent additional variables like temperature, field, ... The ascii output files can than be used to plot parameters, e.g. by gnuplot. - \ref msr2data A program (originally written by Bastian M. Wojek). Its purpose is to process/generate multiple musrfit msr-files with the same parameters and summarize the fitting results either in a TRIUMF DB or a column ASCII file. @@ -89,6 +90,12 @@ This two points are somewhat contradictory, and currently it is not clear which

Here will eventually follow a more technical description of musrview. If you looking for a user-manual like description, please check \htmlonlymusrfit user manual\endhtmlonly \latexonly musrfit user manual: \texttt{http://lmu.web.psi.ch/musrfit/user/MUSR/MusrFit.html} \endlatexonly +//**************************************************************************************************** +\page musrFTPage +\section musrFT musrFT + +

Here will eventually follow a more technical description of musrFT. If you looking for a user-manual like description, please check \htmlonlymusrfit user manual\endhtmlonly \latexonly musrfit user manual: \texttt{http://lmu.web.psi.ch/musrfit/user/MUSR/MusrFit.html} \endlatexonly + //**************************************************************************************************** \page musrt0Page \section musrt0 musrt0 diff --git a/doc/musrfit_dox.cfg b/doc/musrfit_dox.cfg index 4cbde48b..83c10d9d 100644 --- a/doc/musrfit_dox.cfg +++ b/doc/musrfit_dox.cfg @@ -23,7 +23,7 @@ PROJECT_NAME = musrfit # This could be handy for archiving the generated documentation or # if some version control system is used. -PROJECT_NUMBER = 0.13.0 +PROJECT_NUMBER = 0.14.0 # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) # base path where the generated documentation will be put. @@ -462,17 +462,19 @@ WARN_LOGFILE = INPUT = musrfit.dox \ ../src/include/PFitterFcn.h \ ../src/include/PFitter.h \ - ../src/include/PFourier.h \ + ../src/include/PFourier.h \ + ../src/include/PFourierCanvas.h \ ../src/include/PFunctionGrammar.h \ ../src/include/PFunction.h \ ../src/include/PFunctionHandler.h \ - ../src/include/PMsr2Data.h \ + ../src/include/PMsr2Data.h \ ../src/include/PMsrHandler.h \ ../src/include/PMusrCanvas.h \ ../src/include/PMusrCanvasLinkDef.h \ ../src/include/PMusr.h \ - ../src/include/PMusrT0.h \ - ../src/include/PMusrT0LinkDef.h \ + ../src/include/PMusrT0.h \ + ../src/include/PMusrT0LinkDef.h \ + ../src/include/PPrepFourier.h \ ../src/include/PRunAsymmetry.h \ ../src/include/PRunBase.h \ ../src/include/PRunDataHandler.h \ @@ -488,7 +490,8 @@ INPUT = musrfit.dox \ ../src/include/PUserFcn.h \ ../src/classes/PFitter.cpp \ ../src/classes/PFitterFcn.cpp \ - ../src/classes/PFourier.cpp \ + ../src/classes/PFourier.cpp \ + ../src/classes/PFourierCanvas.cpp \ ../src/classes/PFunction.cpp \ ../src/classes/PFunctionHandler.cpp \ ../src/classes/PMsr2Data.cpp \ @@ -496,6 +499,7 @@ INPUT = musrfit.dox \ ../src/classes/PMusrCanvas.cpp \ ../src/classes/PMusr.cpp \ ../src/classes/PMusrT0.cpp \ + ../src/classes/PPrepFourier.cpp \ ../src/classes/PRunAsymmetry.cpp \ ../src/classes/PRunBase.cpp \ ../src/classes/PRunDataHandler.cpp \ diff --git a/src/Makefile.am b/src/Makefile.am index 3d0d9c75..069d6d17 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -16,21 +16,32 @@ if BUILD_MUSREDIT EDITORDIR = musredit endif +if BUILD_MUSREDIT_QT5 + EDITORDIR = musredit_qt5 +endif + SUBDIRS = external/MusrRoot \ external/TLemRunHeader \ external/MuSR_software \ external/mud \ $(PNEXUSDIRS) \ classes \ - external + external \ + musredit_qt5 \ + musredit \ + musrgui if BUILD_MUSRGUI -SUBDIRS += $(EDITORDIR) +#SUBDIRS += $(EDITORDIR) EXTRA_DIST = $(EDITORDIR)/Makefile endif if BUILD_MUSREDIT -SUBDIRS += $(EDITORDIR) +#SUBDIRS += $(EDITORDIR) +EXTRA_DIST = $(EDITORDIR)/Makefile +endif + +if BUILD_MUSREDIT_QT5 EXTRA_DIST = $(EDITORDIR)/Makefile endif diff --git a/src/any2many.cpp b/src/any2many.cpp index 652b0421..0fb896fa 100644 --- a/src/any2many.cpp +++ b/src/any2many.cpp @@ -54,7 +54,7 @@ using namespace std; void any2many_syntax() { cout << endl << "usage: any2many [--help] : will show this help."; - cout << endl << " any2many --version : will show the svn version."; + cout << endl << " any2many --version : will show the git version."; cout << endl << " any2many -f | -r "; cout << endl << " -c [-p ] [-y ]"; cout << endl << " [-o | -t ] [-s]"; @@ -83,6 +83,10 @@ void any2many_syntax() cout << endl << " NeXus2-HDF4, NeXus2-HDF5, NeXus2-XML, WKM, ASCII"; cout << endl << " Comment: ROOT is superseeded by MusrRoot. If there is not a very good"; cout << endl << " reason, avoid it!"; + cout << endl << " -h : This option is for MusrRoot input files only!"; + cout << endl << " Select the the histo groups to be exported. is a space"; + cout << endl << " separated list of the histo group, e.g. -h 0, 20 will try to export the histo"; + cout << endl << " 0 (NPP) and 20 (PPC)."; cout << endl << " -p : where is the output path for the"; cout << endl << " converted files. If nothing is given, the current directory"; cout << endl << " will be used, unless the option '-s' is used."; @@ -190,7 +194,7 @@ int main(int argc, char *argv[]) // call any2many --help or any2many --version if (argc == 2) { - if (strstr(argv[1], "--h")) + if (!strncmp(argv[1], "--help", 128)) any2many_syntax(); else if (strstr(argv[1], "--v")) { #ifdef HAVE_CONFIG_H @@ -344,6 +348,21 @@ int main(int argc, char *argv[]) show_syntax = true; break; } + } else if (!strcmp(argv[i], "-h")) { // filter histo group list (for MusrRoot and ROOT (LEM) only!) + bool done = false; + int j = i+1; + do { + status = sscanf(argv[j], "%d", &ival); + if (status == 1) { + info.groupHistoList.push_back(ival); + j++; + } else { + done = true; + } + } while (!done && (j= argc) // make sure that counter is still in range + break; } else if (!strcmp(argv[i], "-p")) { // filter output path name flag if (i+1 < argc) { info.outPath = argv[i+1]; diff --git a/src/classes/Makefile.am b/src/classes/Makefile.am index 16ede5e0..282772ff 100644 --- a/src/classes/Makefile.am +++ b/src/classes/Makefile.am @@ -15,12 +15,14 @@ h_sources = \ ../include/PMusrT0.h \ ../include/PPrepFourier.h \ ../include/PRunAsymmetry.h \ + ../include/PRunAsymmetryRRF.h \ ../include/PRunBase.h \ ../include/PRunDataHandler.h \ ../include/PRunListCollection.h \ ../include/PRunNonMusr.h \ ../include/PRunMuMinus.h \ ../include/PRunSingleHisto.h \ + ../include/PRunSingleHistoRRF.h \ ../include/PStartupHandler.h \ ../include/PTheory.h @@ -59,12 +61,14 @@ cpp_sources = \ PMusrT0.cpp \ PPrepFourier.cpp \ PRunAsymmetry.cpp \ + PRunAsymmetryRRF.cpp \ PRunBase.cpp \ PRunDataHandler.cpp \ PRunListCollection.cpp \ PRunNonMusr.cpp \ PRunMuMinus.cpp \ PRunSingleHisto.cpp \ + PRunSingleHistoRRF.cpp \ PStartupHandler.cpp \ PTheory.cpp @@ -91,7 +95,7 @@ AM_LDFLAGS = $(LOCAL_LIB_LDFLAGS) -L@ROOTLIBDIR@ CLEANFILES = *Dict.cpp *Dict.h *~ core %Dict.cpp %Dict.h: ../include/%.h ../include/%LinkDef.h - @ROOTCINT@ -v -f $*Dict.cpp -c -p $(INCLUDES) $^ + @ROOTCINT@ -v -f $*Dict.cpp -c -p $(AM_CPPFLAGS) $^ lib_LTLIBRARIES = libPUserFcnBase.la libPMusr.la diff --git a/src/classes/PFitter.cpp b/src/classes/PFitter.cpp index fa9b88cb..e366bda1 100644 --- a/src/classes/PFitter.cpp +++ b/src/classes/PFitter.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PFitterFcn.cpp b/src/classes/PFitterFcn.cpp index e67ac505..c6a8566a 100644 --- a/src/classes/PFitterFcn.cpp +++ b/src/classes/PFitterFcn.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -77,12 +77,16 @@ Double_t PFitterFcn::operator()(const std::vector& par) const if (fUseChi2) { // chi square value += fRunListCollection->GetSingleHistoChisq(par); + value += fRunListCollection->GetSingleHistoRRFChisq(par); value += fRunListCollection->GetAsymmetryChisq(par); + value += fRunListCollection->GetAsymmetryRRFChisq(par); value += fRunListCollection->GetMuMinusChisq(par); value += fRunListCollection->GetNonMusrChisq(par); } else { // max likelihood value += fRunListCollection->GetSingleHistoMaximumLikelihood(par); + value += fRunListCollection->GetSingleHistoRRFMaximumLikelihood(par); value += fRunListCollection->GetAsymmetryMaximumLikelihood(par); + value += fRunListCollection->GetAsymmetryRRFMaximumLikelihood(par); value += fRunListCollection->GetMuMinusMaximumLikelihood(par); value += fRunListCollection->GetNonMusrMaximumLikelihood(par); } diff --git a/src/classes/PFourier.cpp b/src/classes/PFourier.cpp index a660e141..ec516096 100644 --- a/src/classes/PFourier.cpp +++ b/src/classes/PFourier.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -163,7 +163,7 @@ PFourier::~PFourier() } //-------------------------------------------------------------------------- -// Transform +// Transform (public) //-------------------------------------------------------------------------- /** *

Carries out the Fourier transform. It is assumed that fStartTime is the time zero @@ -201,7 +201,24 @@ void PFourier::Transform(UInt_t apodizationTag) } //-------------------------------------------------------------------------- -// GetRealFourier +// GetMaxFreq (public) +//-------------------------------------------------------------------------- +/** + *

returns the maximal frequency in units choosen, i.e. Gauss, Tesla, MHz, Mc/s + */ +Double_t PFourier::GetMaxFreq() +{ + UInt_t noOfFourierBins = 0; + if (fNoOfBins % 2 == 0) + noOfFourierBins = fNoOfBins/2; + else + noOfFourierBins = (fNoOfBins+1)/2; + + return fResolution*noOfFourierBins; +} + +//-------------------------------------------------------------------------- +// GetRealFourier (public) //-------------------------------------------------------------------------- /** *

returns the real part Fourier as a histogram. @@ -242,7 +259,112 @@ TH1F* PFourier::GetRealFourier(const Double_t scale) } //-------------------------------------------------------------------------- -// GetImaginaryFourier +// GetPhaseOptRealFourier (public) +//-------------------------------------------------------------------------- +/** + *

returns the phase corrected real Fourier transform. The correction angle is + * past back as well. + *

Currently it simply does the following thing: (i) rotate the complex Fourier + * transform through all angles in 1/2° steps, i.e. + * \f$ f_{\rm rot} = (f_{\rm real} + i f_{\rm imag}) \exp(- \alpha)\f$, + * hence \f$ f_{\rm rot} = f_{\rm real} \cos(\alpha) + f_{\rm imag} \sin(\alpha)\f$. + * (ii) search the maximum of \f$ sum_{\alpha} {\cal R}\{f_{\rm rot}\}\f$ for all + * \f$\alpha\f$. From this one gets \f$\alpha_{\rm opt}\f$. (iii) The 'optimal' + * real Fourier transform is \f$f_{\rm opt} = (f_{\rm real} + i f_{\rm imag}) + * \exp(- \alpha_{\rm opt})\f$. + * + * \return the TH1F histo of the phase 'optimzed' real Fourier transform. + * + * \param phase return value of the optimal phase + * \param scale normalisation factor + * \param min minimal freq / field from which to optimise. Given in the choosen unit. + * \param max maximal freq / field up to which to optimise. Given in the choosen unit. + */ +TH1F* PFourier::GetPhaseOptRealFourier(Double_t &phase, const Double_t scale, const Double_t min, const Double_t max) +{ + UInt_t noOfFourierBins = 0; + if (fNoOfBins % 2 == 0) + noOfFourierBins = fNoOfBins/2; + else + noOfFourierBins = (fNoOfBins+1)/2; + + UInt_t minBin = 0; + UInt_t maxBin = noOfFourierBins; + + // check if minimum frequency is given. If yes, get the proper minBin + if (min != -1.0) { + minBin = (UInt_t)(min/fResolution); + } + + // check if maximum frequency is given. If yes, get the proper maxBin + if (max != -1.0) { + maxBin = (UInt_t)(max/fResolution); + if (maxBin >= noOfFourierBins) { + maxBin = noOfFourierBins; + cerr << "**WARNING** maximum frequency/field out of range. Will adopted it." << endl; + } + } + + // copy the real/imag Fourier from min to max + vector realF, imagF; + for (UInt_t i=minBin; i<=maxBin; i++) { + realF.push_back(fOut[i][0]); + imagF.push_back(fOut[i][1]); + } + + // rotate trough real/imag Fourier through 360° with a 1/2° resolution and keep the integral + Double_t rotRealIntegral[720]; + Double_t sum = 0.0; + Double_t da = 8.72664625997164774e-03; // pi / 360 + for (UInt_t i=0; i<720; i++) { + sum = 0.0; + for (UInt_t j=0; jGetName()); + snprintf(title, sizeof(title), "%s_Fourier_PhOptRe", fData->GetTitle()); + + TH1F *realPhaseOptFourier = new TH1F(name, title, noOfFourierBins, -fResolution/2.0, (Double_t)(noOfFourierBins-1)*fResolution+fResolution/2.0); + if (realPhaseOptFourier == 0) { + fValid = false; + cerr << endl << "**SEVERE ERROR** couldn't allocate memory for the real part of the Fourier transform." << endl; + return 0; + } + + // fill realFourier vector + for (UInt_t i=0; iSetBinContent(i+1, scale*(fOut[i][0]*cos(phase) + fOut[i][1]*sin(phase))); + realPhaseOptFourier->SetBinError(i+1, 0.0); + } + + return realPhaseOptFourier; +} + +//-------------------------------------------------------------------------- +// GetImaginaryFourier (public) //-------------------------------------------------------------------------- /** *

returns the imaginary part Fourier as a histogram. @@ -284,7 +406,7 @@ TH1F* PFourier::GetImaginaryFourier(const Double_t scale) } //-------------------------------------------------------------------------- -// GetPowerFourier +// GetPowerFourier (public) //-------------------------------------------------------------------------- /** *

returns the Fourier power spectrum as a histogram. @@ -326,7 +448,7 @@ TH1F* PFourier::GetPowerFourier(const Double_t scale) } //-------------------------------------------------------------------------- -// GetPhaseFourier +// GetPhaseFourier (public) //-------------------------------------------------------------------------- /** *

returns the Fourier phase spectrum as a histogram. @@ -385,7 +507,7 @@ TH1F* PFourier::GetPhaseFourier(const Double_t scale) } //-------------------------------------------------------------------------- -// PrepareFFTwInputData +// PrepareFFTwInputData (private) //-------------------------------------------------------------------------- /** *

Feeds the Fourier data and apply the apodization. @@ -434,7 +556,7 @@ void PFourier::PrepareFFTwInputData(UInt_t apodizationTag) } //-------------------------------------------------------------------------- -// ApodizeData +// ApodizeData (private) //-------------------------------------------------------------------------- /** *

Carries out the appodization of the data. diff --git a/src/classes/PFourierCanvas.cpp b/src/classes/PFourierCanvas.cpp index 9c33bd04..07813ff4 100644 --- a/src/classes/PFourierCanvas.cpp +++ b/src/classes/PFourierCanvas.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -43,9 +43,9 @@ using namespace std; #define YINFO 0.2 #define YTITLE 0.95 -static const char *gFiletypes[] = { "All files", "*", - "Data files", "*.dat", - 0, 0 }; +static const Char_t *gFiletypes[] = { "Data files", "*.dat", + "All files", "*", + 0, 0 }; ClassImpQ(PFourierCanvas) @@ -61,6 +61,7 @@ PFourierCanvas::PFourierCanvas() fBatchMode = false; fValid = false; fAveragedView = false; + fAveragedViewPerDataSet = false; fCurrentPlotView = FOURIER_PLOT_NOT_GIVEN; fInitialXRange[0] = 0.0; fInitialXRange[1] = 0.0; @@ -99,12 +100,14 @@ PFourierCanvas::PFourierCanvas() * \param wh * \param batch */ -PFourierCanvas::PFourierCanvas(vector &fourier, const Char_t* title, const Bool_t showAverage, +PFourierCanvas::PFourierCanvas(vector &fourier, PIntVector dataSetTag, const Char_t* title, + const Bool_t showAverage, const Bool_t showAveragePerDataSet, const Int_t fourierPlotOpt, Double_t fourierXrange[], Double_t phase, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch) : - fBatchMode(batch), fAveragedView(showAverage), fCurrentPlotView(fourierPlotOpt), - fTitle(title), fFourier(fourier), fCurrentFourierPhase(phase) + fBatchMode(batch), fAveragedView(showAverage), fAveragedViewPerDataSet(showAveragePerDataSet), + fDataSetTag(dataSetTag), fCurrentPlotView(fourierPlotOpt), fTitle(title), fFourier(fourier), + fCurrentFourierPhase(phase) { fInitialXRange[0] = fourierXrange[0]; fInitialXRange[1] = fourierXrange[1]; @@ -116,10 +119,21 @@ PFourierCanvas::PFourierCanvas(vector &fourier, const Char_t* title, fCurrentFourierPhaseText = 0; + // generate fMarkerList and fColorList, since they are not provided + TRandom rand; + Int_t style, color; + for (UInt_t i=0; iSetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling } @@ -142,13 +156,14 @@ PFourierCanvas::PFourierCanvas(vector &fourier, const Char_t* title, * \param colorList * \param batch */ -PFourierCanvas::PFourierCanvas(vector &fourier, const Char_t* title, const Bool_t showAverage, +PFourierCanvas::PFourierCanvas(vector &fourier, PIntVector dataSetTag, const Char_t* title, + const Bool_t showAverage, const Bool_t showAveragePerDataSet, const Int_t fourierPlotOpt, Double_t fourierXrange[], Double_t phase, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const PIntVector markerList, const PIntVector colorList, const Bool_t batch) : - fBatchMode(batch), fAveragedView(showAverage), fCurrentPlotView(fourierPlotOpt), - fTitle(title), fFourier(fourier), fCurrentFourierPhase(phase), - fMarkerList(markerList), fColorList(colorList) + fBatchMode(batch), fAveragedView(showAverage), fAveragedViewPerDataSet(showAveragePerDataSet), + fDataSetTag(dataSetTag), fCurrentPlotView(fourierPlotOpt), fTitle(title), fFourier(fourier), + fCurrentFourierPhase(phase), fMarkerList(markerList), fColorList(colorList) { fInitialXRange[0] = fourierXrange[0]; fInitialXRange[1] = fourierXrange[1]; @@ -160,10 +175,24 @@ PFourierCanvas::PFourierCanvas(vector &fourier, const Char_t* title, fCurrentFourierPhaseText = 0; + // generate fMarkerList and fColorList, since they are not provided + TRandom rand; + Int_t style, color; + for (UInt_t i=fMarkerList.size(); iSetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling } @@ -193,11 +222,12 @@ PFourierCanvas::~PFourierCanvas() } if (fFourierHistos.size() > 0) { - for (unsigned int i=0; iClear(); + delete fLegAvgPerDataSet; + fLegAvgPerDataSet = 0; + } + /* if (fMainCanvas) { delete fMainCanvas; @@ -267,19 +303,40 @@ void PFourierCanvas::HandleCmdKey(Int_t event, Int_t x, Int_t y, TObject *select if (x == 'q') { // quit Done(0); } else if (x == 'u') { // unzoom - if (fAveragedView) + if (fAveragedView || fAveragedViewPerDataSet) PlotAverage(); else PlotFourier(); } else if (x == 'a') { // toggle between average view and single histo view // toggle average view flag fAveragedView = !fAveragedView; + // unset average per data set view flag + fAveragedViewPerDataSet = false; // update menu if (fAveragedView) { fPopupMain->CheckEntry(P_MENU_ID_AVERAGE); + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); HandleAverage(); PlotAverage(); } else { + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE); + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); + CleanupAverage(); + PlotFourier(); + } + } else if (x == 'd') { // toggle between average view per data set and single histo view + // toggle average per data set view flag + fAveragedViewPerDataSet = !fAveragedViewPerDataSet; + // unset average view flag + fAveragedView = false; + // update menu + if (fAveragedViewPerDataSet) { + fPopupMain->CheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE); + HandleAverage(); + PlotAverage(); + } else { + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE); CleanupAverage(); PlotFourier(); @@ -330,6 +387,11 @@ void PFourierCanvas::HandleMenuPopup(Int_t id) fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE); fCurrentPlotView = FOURIER_PLOT_PHASE; PlotFourier(); + } else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_OPT_REAL) { + fPopupFourier->UnCheckEntries(); + fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_OPT_REAL); + fCurrentPlotView = FOURIER_PLOT_PHASE_OPT_REAL; + PlotFourier(); } else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_PLUS) { IncrementFourierPhase(); } else if (id == P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_MINUS) { @@ -337,12 +399,33 @@ void PFourierCanvas::HandleMenuPopup(Int_t id) } else if (id == P_MENU_ID_AVERAGE) { // toggle average view flag fAveragedView = !fAveragedView; + // unset average per data set view flag + fAveragedViewPerDataSet = false; // update menu if (fAveragedView) { fPopupMain->CheckEntry(P_MENU_ID_AVERAGE); + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); HandleAverage(); PlotAverage(); } else { + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE); + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); + CleanupAverage(); + PlotFourier(); + } + } else if (id == P_MENU_ID_AVERAGE_PER_DATA_SET) { + // toggle average per data set view flag + fAveragedViewPerDataSet = !fAveragedViewPerDataSet; + // unset average view flag + fAveragedView = false; + // update menu + if (fAveragedViewPerDataSet) { + fPopupMain->CheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE); + HandleAverage(); + PlotAverage(); + } else { + fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); fPopupMain->UnCheckEntry(P_MENU_ID_AVERAGE); CleanupAverage(); PlotFourier(); @@ -385,7 +468,7 @@ void PFourierCanvas::UpdateFourierPad() if (!fValid) return; - if (fAveragedView) + if (fAveragedView || fAveragedViewPerDataSet) PlotAverage(); else PlotFourier(); @@ -408,14 +491,14 @@ void PFourierCanvas::UpdateInfoPad() // write header line TDatime dt; - char dtStr[128]; + Char_t dtStr[128]; strncpy(dtStr, dt.AsSQLString(), sizeof(dtStr)); TString str("musrFT: "); str += dtStr; fInfoPad->SetHeader(str); - char title[1024]; - for (unsigned int i=0; iGetDataTitle(), sizeof(title)); // add entry fInfoPad->AddEntry(fFourierHistos[i].dataFourierRe, title, "p"); @@ -513,6 +596,12 @@ void PFourierCanvas::ExportData(const Char_t *pathFileName) yAxis = TString(""); xMinBin = fFourierHistos[0].dataFourierPhase->GetXaxis()->GetFirst(); xMaxBin = fFourierHistos[0].dataFourierPhase->GetXaxis()->GetLast(); + break; + case FOURIER_PLOT_PHASE_OPT_REAL: + xAxis = fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetTitle(); + yAxis = TString(""); + xMinBin = fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst(); + xMaxBin = fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetLast(); break; default: xAxis = TString("??"); @@ -547,6 +636,12 @@ void PFourierCanvas::ExportData(const Char_t *pathFileName) xMinBin = fFourierHistos[0].dataFourierPhase->GetXaxis()->GetFirst(); xMaxBin = fFourierHistos[0].dataFourierPhase->GetXaxis()->GetLast(); break; + case FOURIER_PLOT_PHASE_OPT_REAL: + xAxis = fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetTitle(); + yAxis = TString("Phase"); + xMinBin = fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetFirst(); + xMaxBin = fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetLast(); + break; default: xAxis = TString("??"); yAxis = TString("??"); @@ -563,24 +658,27 @@ void PFourierCanvas::ExportData(const Char_t *pathFileName) // write header fout << "% " << pfn << endl; fout << "% averaged data of:" << endl; - for (unsigned int i=0; iGetTitle() << endl; } fout << "%------------" << endl; fout << "% " << xAxis << ", " << yAxis << endl; - for (int i=xMinBin; iGetBinCenter(i) << ", " << fFourierAverage.dataFourierRe->GetBinContent(i) << endl; + fout << fFourierAverage[0].dataFourierRe->GetBinCenter(i) << ", " << fFourierAverage[0].dataFourierRe->GetBinContent(i) << endl; break; case FOURIER_PLOT_IMAG: - fout << fFourierAverage.dataFourierIm->GetBinCenter(i) << ", " << fFourierAverage.dataFourierIm->GetBinContent(i) << endl; + fout << fFourierAverage[0].dataFourierIm->GetBinCenter(i) << ", " << fFourierAverage[0].dataFourierIm->GetBinContent(i) << endl; break; case FOURIER_PLOT_POWER: - fout << fFourierAverage.dataFourierPwr->GetBinCenter(i) << ", " << fFourierAverage.dataFourierPwr->GetBinContent(i) << endl; + fout << fFourierAverage[0].dataFourierPwr->GetBinCenter(i) << ", " << fFourierAverage[0].dataFourierPwr->GetBinContent(i) << endl; break; case FOURIER_PLOT_PHASE: - fout << fFourierAverage.dataFourierPhase->GetBinCenter(i) << ", " << fFourierAverage.dataFourierPhase->GetBinContent(i) << endl; + fout << fFourierAverage[0].dataFourierPhase->GetBinCenter(i) << ", " << fFourierAverage[0].dataFourierPhase->GetBinContent(i) << endl; + break; + case FOURIER_PLOT_PHASE_OPT_REAL: + fout << fFourierAverage[0].dataFourierPhaseOptReal->GetBinCenter(i) << ", " << fFourierAverage[0].dataFourierPhaseOptReal->GetBinContent(i) << endl; break; default: break; @@ -590,19 +688,19 @@ void PFourierCanvas::ExportData(const Char_t *pathFileName) // write header fout << "% " << pfn << endl; fout << "% data of:" << endl; - for (unsigned int i=0; iGetTitle() << endl; } fout << "%------------" << endl; fout << "% "; - for (unsigned int i=0; iGetBinCenter(i) << ", " << fFourierHistos[j].dataFourierRe->GetBinContent(i) << ", "; @@ -616,6 +714,9 @@ void PFourierCanvas::ExportData(const Char_t *pathFileName) case FOURIER_PLOT_PHASE: fout << fFourierHistos[j].dataFourierPhase->GetBinCenter(i) << ", " << fFourierHistos[j].dataFourierPhase->GetBinContent(i) << ", "; break; + case FOURIER_PLOT_PHASE_OPT_REAL: + fout << fFourierHistos[j].dataFourierPhaseOptReal->GetBinCenter(i) << ", " << fFourierHistos[j].dataFourierPhaseOptReal->GetBinContent(i) << ", "; + break; default: break; } @@ -633,6 +734,9 @@ void PFourierCanvas::ExportData(const Char_t *pathFileName) case FOURIER_PLOT_PHASE: fout << fFourierHistos[fFourierHistos.size()-1].dataFourierPhase->GetBinCenter(i) << ", " << fFourierHistos[fFourierHistos.size()-1].dataFourierPhase->GetBinContent(i) << endl; break; + case FOURIER_PLOT_PHASE_OPT_REAL: + fout << fFourierHistos[fFourierHistos.size()-1].dataFourierPhaseOptReal->GetBinCenter(i) << ", " << fFourierHistos[fFourierHistos.size()-1].dataFourierPhaseOptReal->GetBinContent(i) << endl; + break; default: break; } @@ -695,11 +799,13 @@ void PFourierCanvas::InitFourierDataSets() { // get all the Fourier histos fFourierHistos.resize(fFourier.size()); - for (unsigned int i=0; iGetRealFourier(); fFourierHistos[i].dataFourierIm = fFourier[i]->GetImaginaryFourier(); fFourierHistos[i].dataFourierPwr = fFourier[i]->GetPowerFourier(); fFourierHistos[i].dataFourierPhase = fFourier[i]->GetPhaseFourier(); + fFourierHistos[i].dataFourierPhaseOptReal = fFourier[i]->GetPhaseOptRealFourier(fFourierHistos[i].optPhase, 1.0, fInitialXRange[0], fInitialXRange[1]); + cout << "debug> histo[" << i << "]: opt. phase = " << fFourierHistos[i].optPhase * 180.0 / TMath::Pi() << "°" << endl; } // rescale histo to abs(maximum) == 1 @@ -707,116 +813,107 @@ void PFourierCanvas::InitFourierDataSets() Int_t start = fFourierHistos[0].dataFourierRe->FindBin(fInitialXRange[0]); Int_t end = fFourierHistos[0].dataFourierRe->FindBin(fInitialXRange[1]); // real - for (unsigned int i=0; iGetBinContent(j); if (fabs(dval) > max) max = dval; } } - for (unsigned int i=0; iGetNbinsX(); j++) { + for (UInt_t i=0; iGetNbinsX(); j++) { fFourierHistos[i].dataFourierRe->SetBinContent(j, fFourierHistos[i].dataFourierRe->GetBinContent(j)/fabs(max)); } } + // imaginary - for (unsigned int i=0; iGetBinContent(j); if (fabs(dval) > max) max = dval; } } - for (unsigned int i=0; iGetNbinsX(); j++) { + for (UInt_t i=0; iGetNbinsX(); j++) { fFourierHistos[i].dataFourierIm->SetBinContent(j, fFourierHistos[i].dataFourierIm->GetBinContent(j)/fabs(max)); } } + // power max = 0.0; - for (unsigned int i=0; iGetBinContent(j); if (fabs(dval) > max) max = dval; } } - for (unsigned int i=0; iGetNbinsX(); j++) { + for (UInt_t i=0; iGetNbinsX(); j++) { fFourierHistos[i].dataFourierPwr->SetBinContent(j, fFourierHistos[i].dataFourierPwr->GetBinContent(j)/fabs(max)); } } + // phase max = 0.0; - for (unsigned int i=0; iGetBinContent(j); if (fabs(dval) > max) max = dval; } } - for (unsigned int i=0; iGetNbinsX(); j++) { + for (UInt_t i=0; iGetNbinsX(); j++) { fFourierHistos[i].dataFourierPhase->SetBinContent(j, fFourierHistos[i].dataFourierPhase->GetBinContent(j)/fabs(max)); } } - // set the marker and line color - for (unsigned int i=0; iSetMarkerColor(fColorList[i]); - fFourierHistos[i].dataFourierRe->SetLineColor(fColorList[i]); - fFourierHistos[i].dataFourierIm->SetMarkerColor(fColorList[i]); - fFourierHistos[i].dataFourierIm->SetLineColor(fColorList[i]); - fFourierHistos[i].dataFourierPwr->SetMarkerColor(fColorList[i]); - fFourierHistos[i].dataFourierPwr->SetLineColor(fColorList[i]); - fFourierHistos[i].dataFourierPhase->SetMarkerColor(fColorList[i]); - fFourierHistos[i].dataFourierPhase->SetLineColor(fColorList[i]); - } else { - TRandom rand(i); - Int_t color = TColor::GetColor((Int_t)rand.Integer(255), (Int_t)rand.Integer(255), (Int_t)rand.Integer(255)); - fFourierHistos[i].dataFourierRe->SetMarkerColor(color); - fFourierHistos[i].dataFourierRe->SetLineColor(color); - fFourierHistos[i].dataFourierIm->SetMarkerColor(color); - fFourierHistos[i].dataFourierIm->SetLineColor(color); - fFourierHistos[i].dataFourierPwr->SetMarkerColor(color); - fFourierHistos[i].dataFourierPwr->SetLineColor(color); - fFourierHistos[i].dataFourierPhase->SetMarkerColor(color); - fFourierHistos[i].dataFourierPhase->SetLineColor(color); + // phase opt real + for (UInt_t i=0; iGetBinContent(j); + if (fabs(dval) > max) + max = dval; } } + for (UInt_t i=0; iGetNbinsX(); j++) { + fFourierHistos[i].dataFourierPhaseOptReal->SetBinContent(j, fFourierHistos[i].dataFourierPhaseOptReal->GetBinContent(j)/fabs(max)); + } + } + + // set the marker and line color + for (UInt_t i=0; iSetMarkerColor(fColorList[i]); + fFourierHistos[i].dataFourierRe->SetLineColor(fColorList[i]); + fFourierHistos[i].dataFourierIm->SetMarkerColor(fColorList[i]); + fFourierHistos[i].dataFourierIm->SetLineColor(fColorList[i]); + fFourierHistos[i].dataFourierPwr->SetMarkerColor(fColorList[i]); + fFourierHistos[i].dataFourierPwr->SetLineColor(fColorList[i]); + fFourierHistos[i].dataFourierPhase->SetMarkerColor(fColorList[i]); + fFourierHistos[i].dataFourierPhase->SetLineColor(fColorList[i]); + fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerColor(fColorList[i]); + fFourierHistos[i].dataFourierPhaseOptReal->SetLineColor(fColorList[i]); + } // set the marker symbol and size - Int_t style; - for (unsigned int i=0; iSetMarkerStyle(fMarkerList[i]); - fFourierHistos[i].dataFourierRe->SetMarkerSize(0.7); - fFourierHistos[i].dataFourierIm->SetMarkerStyle(fMarkerList[i]); - fFourierHistos[i].dataFourierIm->SetMarkerSize(0.7); - fFourierHistos[i].dataFourierPwr->SetMarkerStyle(fMarkerList[i]); - fFourierHistos[i].dataFourierPwr->SetMarkerSize(0.7); - fFourierHistos[i].dataFourierPhase->SetMarkerStyle(fMarkerList[i]); - fFourierHistos[i].dataFourierPhase->SetMarkerSize(0.7); - } else { - TRandom rand(i); - style = 20+(Int_t)rand.Integer(10); - fFourierHistos[i].dataFourierRe->SetMarkerStyle(style); - fFourierHistos[i].dataFourierRe->SetMarkerSize(0.7); - fFourierHistos[i].dataFourierIm->SetMarkerStyle(style); - fFourierHistos[i].dataFourierIm->SetMarkerSize(0.7); - fFourierHistos[i].dataFourierPwr->SetMarkerStyle(style); - fFourierHistos[i].dataFourierPwr->SetMarkerSize(0.7); - fFourierHistos[i].dataFourierPhase->SetMarkerStyle(style); - fFourierHistos[i].dataFourierPhase->SetMarkerSize(0.7); - } + for (UInt_t i=0; iSetMarkerStyle(fMarkerList[i]); + fFourierHistos[i].dataFourierRe->SetMarkerSize(0.7); + fFourierHistos[i].dataFourierIm->SetMarkerStyle(fMarkerList[i]); + fFourierHistos[i].dataFourierIm->SetMarkerSize(0.7); + fFourierHistos[i].dataFourierPwr->SetMarkerStyle(fMarkerList[i]); + fFourierHistos[i].dataFourierPwr->SetMarkerSize(0.7); + fFourierHistos[i].dataFourierPhase->SetMarkerStyle(fMarkerList[i]); + fFourierHistos[i].dataFourierPhase->SetMarkerSize(0.7); + fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerStyle(fMarkerList[i]); + fFourierHistos[i].dataFourierPhaseOptReal->SetMarkerSize(0.7); } // initialize average histos - fFourierAverage.dataFourierRe = 0; - fFourierAverage.dataFourierIm = 0; - fFourierAverage.dataFourierPwr = 0; - fFourierAverage.dataFourierPhase = 0; + CleanupAverage(); } //-------------------------------------------------------------------------- @@ -856,7 +953,7 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w if (!fBatchMode) { fImp = (TRootCanvas*)fMainCanvas->GetCanvasImp(); fBar = fImp->GetMenuBar(); - fPopupMain = fBar->AddPopup("&MusrFT"); + fPopupMain = fBar->AddPopup("MusrFT"); fPopupFourier = new TGPopupMenu(); @@ -866,6 +963,7 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w fPopupFourier->AddEntry("Show Real+Imag", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_REAL_AND_IMAG); fPopupFourier->AddEntry("Show Power", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PWR); fPopupFourier->AddEntry("Show Phase", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE); + fPopupFourier->AddEntry("Show Phase Opt Fourier", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_OPT_REAL); fPopupFourier->AddSeparator(); fPopupFourier->AddEntry("Phase +", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_PLUS); fPopupFourier->AddEntry("Phase -", P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_MINUS); @@ -888,6 +986,9 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w case FOURIER_PLOT_PHASE: fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE); break; + case FOURIER_PLOT_PHASE_OPT_REAL: + fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_ID_FOURIER_PHASE_OPT_REAL); + break; default: break; } @@ -895,6 +996,9 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w fPopupMain->AddEntry("Average", P_MENU_ID_AVERAGE); if (fAveragedView) fPopupMain->CheckEntry(P_MENU_ID_AVERAGE); + fPopupMain->AddEntry("Average per Data Set", P_MENU_ID_AVERAGE_PER_DATA_SET); + if (fAveragedViewPerDataSet) + fPopupMain->CheckEntry(P_MENU_ID_AVERAGE_PER_DATA_SET); fPopupMain->AddSeparator(); fPopupMain->AddEntry("Export Data", P_MENU_ID_EXPORT_DATA); @@ -918,7 +1022,7 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w fTitlePad->Draw(); // fourier pad - fFourierPad = new TPad("fourierPad", "fourierPad", 0.0, YINFO, 1.0, YTITLE); + fFourierPad = new TPad("fFourierPad", "fFourierPad", 0.0, YINFO, 1.0, YTITLE); if (fFourierPad == 0) { cerr << endl << "PFourierCanvas::PFourierCanvas: **PANIC ERROR**: Couldn't invoke fFourierPad"; cerr << endl; @@ -937,8 +1041,15 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w fInfoPad->SetFillColor(TColor::GetColor(255,255,255)); fInfoPad->SetTextAlign(12); // middle, left + fLegAvgPerDataSet = 0; + fValid = true; + if ((fFourier.size() != fDataSetTag.size()) && fAveragedViewPerDataSet) { + fValid = false; + cerr << endl << "PFourierCanvas::PFourierCanvas: **PANIC ERROR**: # Fourier != # Data Set Tags." << endl; + } + fMainCanvas->cd(); fMainCanvas->Show(); @@ -955,22 +1066,29 @@ void PFourierCanvas::InitFourierCanvas(const Char_t* title, Int_t wtopx, Int_t w */ void PFourierCanvas::CleanupAverage() { - if (fFourierAverage.dataFourierRe != 0) { - delete fFourierAverage.dataFourierRe; - fFourierAverage.dataFourierRe = 0; - } - if (fFourierAverage.dataFourierIm) { - delete fFourierAverage.dataFourierIm; - fFourierAverage.dataFourierIm = 0; - } - if (fFourierAverage.dataFourierPwr) { - delete fFourierAverage.dataFourierPwr; - fFourierAverage.dataFourierPwr = 0; - } - if (fFourierAverage.dataFourierPhase) { - delete fFourierAverage.dataFourierPhase; - fFourierAverage.dataFourierPhase = 0; + for (UInt_t i=0; iGetTitle()) + "_avg"; - fFourierAverage.dataFourierRe = new TH1F(name, name, fFourierHistos[0].dataFourierRe->GetNbinsX(), - fFourierHistos[0].dataFourierRe->GetXaxis()->GetXmin(), - fFourierHistos[0].dataFourierRe->GetXaxis()->GetXmax()); - - name = TString(fFourierHistos[0].dataFourierIm->GetTitle()) + "_avg"; - fFourierAverage.dataFourierIm = new TH1F(name, name, fFourierHistos[0].dataFourierIm->GetNbinsX(), - fFourierHistos[0].dataFourierIm->GetXaxis()->GetXmin(), - fFourierHistos[0].dataFourierIm->GetXaxis()->GetXmax()); - - name = TString(fFourierHistos[0].dataFourierPwr->GetTitle()) + "_avg"; - fFourierAverage.dataFourierPwr = new TH1F(name, name, fFourierHistos[0].dataFourierPwr->GetNbinsX(), - fFourierHistos[0].dataFourierPwr->GetXaxis()->GetXmin(), - fFourierHistos[0].dataFourierPwr->GetXaxis()->GetXmax()); - - name = TString(fFourierHistos[0].dataFourierPhase->GetTitle()) + "_avg"; - fFourierAverage.dataFourierPhase = new TH1F(name, name, fFourierHistos[0].dataFourierPhase->GetNbinsX(), - fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmin(), - fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmax()); - Double_t dval=0.0; - // real average - for (Int_t j=0; jGetNbinsX(); j++) { - dval = 0.0; - for (unsigned int i=0; iGetNbinsX()) - dval += GetInterpolatedValue(fFourierHistos[i].dataFourierRe, fFourierHistos[0].dataFourierRe->GetBinCenter(j)); - } - fFourierAverage.dataFourierRe->SetBinContent(j, dval/fFourierHistos.size()); - } - // set marker color, line color, maker size, marker type - fFourierAverage.dataFourierRe->SetMarkerColor(kBlack); - fFourierAverage.dataFourierRe->SetLineColor(kBlack); - fFourierAverage.dataFourierRe->SetMarkerSize(0.8); - fFourierAverage.dataFourierRe->SetMarkerStyle(22); // closed up triangle - // imaginary average - for (Int_t j=0; jGetNbinsX(); j++) { - dval = 0.0; - for (unsigned int i=0; iGetNbinsX()) - dval += GetInterpolatedValue(fFourierHistos[i].dataFourierIm, fFourierHistos[0].dataFourierIm->GetBinCenter(j)); - } - fFourierAverage.dataFourierIm->SetBinContent(j, dval/fFourierHistos.size()); - } - // set marker color, line color, maker size, marker type - fFourierAverage.dataFourierIm->SetMarkerColor(kBlack); - fFourierAverage.dataFourierIm->SetLineColor(kBlack); - fFourierAverage.dataFourierIm->SetMarkerSize(0.8); - fFourierAverage.dataFourierIm->SetMarkerStyle(22); // closed up triangle + // check if ALL data shall be averaged + if (fAveragedView) { + fFourierAverage.resize(1); - // power average - for (Int_t j=0; jGetNbinsX(); j++) { - dval = 0.0; - for (unsigned int i=0; iGetNbinsX()) - dval += GetInterpolatedValue(fFourierHistos[i].dataFourierPwr, fFourierHistos[0].dataFourierPwr->GetBinCenter(j)); - } - fFourierAverage.dataFourierPwr->SetBinContent(j, dval/fFourierHistos.size()); - } - // set marker color, line color, maker size, marker type - fFourierAverage.dataFourierPwr->SetMarkerColor(kBlack); - fFourierAverage.dataFourierPwr->SetLineColor(kBlack); - fFourierAverage.dataFourierPwr->SetMarkerSize(0.8); - fFourierAverage.dataFourierPwr->SetMarkerStyle(22); // closed up triangle + // create average histograms + name = TString(fFourierHistos[0].dataFourierRe->GetTitle()) + "_avg"; + fFourierAverage[0].dataFourierRe = new TH1F(name, name, fFourierHistos[0].dataFourierRe->GetNbinsX(), + fFourierHistos[0].dataFourierRe->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierRe->GetXaxis()->GetXmax()); - // phase average - for (Int_t j=0; jGetNbinsX(); j++) { - dval = 0.0; - for (unsigned int i=0; iGetNbinsX()) - dval += GetInterpolatedValue(fFourierHistos[i].dataFourierPhase, fFourierHistos[0].dataFourierPhase->GetBinCenter(j)); + name = TString(fFourierHistos[0].dataFourierIm->GetTitle()) + "_avg"; + fFourierAverage[0].dataFourierIm = new TH1F(name, name, fFourierHistos[0].dataFourierIm->GetNbinsX(), + fFourierHistos[0].dataFourierIm->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierIm->GetXaxis()->GetXmax()); + + name = TString(fFourierHistos[0].dataFourierPwr->GetTitle()) + "_avg"; + fFourierAverage[0].dataFourierPwr = new TH1F(name, name, fFourierHistos[0].dataFourierPwr->GetNbinsX(), + fFourierHistos[0].dataFourierPwr->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierPwr->GetXaxis()->GetXmax()); + + name = TString(fFourierHistos[0].dataFourierPhase->GetTitle()) + "_avg"; + fFourierAverage[0].dataFourierPhase = new TH1F(name, name, fFourierHistos[0].dataFourierPhase->GetNbinsX(), + fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmax()); + + name = TString(fFourierHistos[0].dataFourierPhaseOptReal->GetTitle()) + "_avg"; + fFourierAverage[0].dataFourierPhaseOptReal = new TH1F(name, name, fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(), + fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax()); + + // real average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (UInt_t i=0; iGetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[i].dataFourierRe, fFourierHistos[0].dataFourierRe->GetBinCenter(j)); + } + fFourierAverage[0].dataFourierRe->SetBinContent(j, dval/fFourierHistos.size()); + } + // set marker color, line color, maker size, marker type + fFourierAverage[0].dataFourierRe->SetMarkerColor(kBlack); + fFourierAverage[0].dataFourierRe->SetLineColor(kBlack); + fFourierAverage[0].dataFourierRe->SetMarkerSize(0.8); + fFourierAverage[0].dataFourierRe->SetMarkerStyle(22); // closed up triangle + + // imaginary average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (UInt_t i=0; iGetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[i].dataFourierIm, fFourierHistos[0].dataFourierIm->GetBinCenter(j)); + } + fFourierAverage[0].dataFourierIm->SetBinContent(j, dval/fFourierHistos.size()); + } + // set marker color, line color, maker size, marker type + fFourierAverage[0].dataFourierIm->SetMarkerColor(kBlack); + fFourierAverage[0].dataFourierIm->SetLineColor(kBlack); + fFourierAverage[0].dataFourierIm->SetMarkerSize(0.8); + fFourierAverage[0].dataFourierIm->SetMarkerStyle(22); // closed up triangle + + // power average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (UInt_t i=0; iGetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[i].dataFourierPwr, fFourierHistos[0].dataFourierPwr->GetBinCenter(j)); + } + fFourierAverage[0].dataFourierPwr->SetBinContent(j, dval/fFourierHistos.size()); + } + // set marker color, line color, maker size, marker type + fFourierAverage[0].dataFourierPwr->SetMarkerColor(kBlack); + fFourierAverage[0].dataFourierPwr->SetLineColor(kBlack); + fFourierAverage[0].dataFourierPwr->SetMarkerSize(0.8); + fFourierAverage[0].dataFourierPwr->SetMarkerStyle(22); // closed up triangle + + // phase average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (UInt_t i=0; iGetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[i].dataFourierPhase, fFourierHistos[0].dataFourierPhase->GetBinCenter(j)); + } + fFourierAverage[0].dataFourierPhase->SetBinContent(j, dval/fFourierHistos.size()); + } + // set marker color, line color, maker size, marker type + fFourierAverage[0].dataFourierPhase->SetMarkerColor(kBlack); + fFourierAverage[0].dataFourierPhase->SetLineColor(kBlack); + fFourierAverage[0].dataFourierPhase->SetMarkerSize(0.8); + fFourierAverage[0].dataFourierPhase->SetMarkerStyle(22); + + // phase optimised real average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (UInt_t i=0; iGetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[i].dataFourierPhaseOptReal, fFourierHistos[0].dataFourierPhaseOptReal->GetBinCenter(j)); + } + fFourierAverage[0].dataFourierPhaseOptReal->SetBinContent(j, dval/fFourierHistos.size()); + } + // set marker color, line color, maker size, marker type + fFourierAverage[0].dataFourierPhaseOptReal->SetMarkerColor(kBlack); + fFourierAverage[0].dataFourierPhaseOptReal->SetLineColor(kBlack); + fFourierAverage[0].dataFourierPhaseOptReal->SetMarkerSize(0.8); + fFourierAverage[0].dataFourierPhaseOptReal->SetMarkerStyle(22); + } + + // check if per data set shall be averaged + if (fAveragedViewPerDataSet) { + // check what size is required + UInt_t count = 1; + Int_t currentTag = fDataSetTag[0]; + for (UInt_t i=1; i 0) + start = j-1; + else + start = 0; + } + if (currentTag != fDataSetTag[j]) { + if (count == i) { + end = j-1; + break; + } + count++; + currentTag = fDataSetTag[j]; + } + } + if (start == -1) + start = fDataSetTag.size()-1; + if (end == -1) + end = fDataSetTag.size()-1; + + // create average histograms + name = TString(fFourierHistos[start].dataFourierRe->GetTitle()) + "_avg"; + fFourierAverage[i].dataFourierRe = new TH1F(name, name, fFourierHistos[0].dataFourierRe->GetNbinsX(), + fFourierHistos[0].dataFourierRe->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierRe->GetXaxis()->GetXmax()); + + name = TString(fFourierHistos[start].dataFourierIm->GetTitle()) + "_avg"; + fFourierAverage[i].dataFourierIm = new TH1F(name, name, fFourierHistos[0].dataFourierIm->GetNbinsX(), + fFourierHistos[0].dataFourierIm->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierIm->GetXaxis()->GetXmax()); + + name = TString(fFourierHistos[start].dataFourierPwr->GetTitle()) + "_avg"; + fFourierAverage[i].dataFourierPwr = new TH1F(name, name, fFourierHistos[0].dataFourierPwr->GetNbinsX(), + fFourierHistos[0].dataFourierPwr->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierPwr->GetXaxis()->GetXmax()); + + name = TString(fFourierHistos[start].dataFourierPhase->GetTitle()) + "_avg"; + fFourierAverage[i].dataFourierPhase = new TH1F(name, name, fFourierHistos[0].dataFourierPhase->GetNbinsX(), + fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierPhase->GetXaxis()->GetXmax()); + + name = TString(fFourierHistos[start].dataFourierPhaseOptReal->GetTitle()) + "_avg"; + fFourierAverage[i].dataFourierPhaseOptReal = new TH1F(name, name, fFourierHistos[0].dataFourierPhaseOptReal->GetNbinsX(), + fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmin(), + fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->GetXmax()); + + // real average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (Int_t k=start; k<=end; k++) { + if (j < fFourierHistos[k].dataFourierRe->GetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[k].dataFourierRe, fFourierHistos[0].dataFourierRe->GetBinCenter(j)); + } + fFourierAverage[i].dataFourierRe->SetBinContent(j, dval/(end-start+1)); + } + // set marker color, line color, maker size, marker type + fFourierAverage[i].dataFourierRe->SetMarkerColor(fColorList[i]); + fFourierAverage[i].dataFourierRe->SetLineColor(fColorList[i]); + fFourierAverage[i].dataFourierRe->SetMarkerSize(0.8); + fFourierAverage[i].dataFourierRe->SetMarkerStyle(22); // closed up triangle + + // imaginary average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (Int_t k=start; k<=end; k++) { + if (j < fFourierHistos[k].dataFourierIm->GetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[k].dataFourierIm, fFourierHistos[0].dataFourierIm->GetBinCenter(j)); + } + fFourierAverage[i].dataFourierIm->SetBinContent(j, dval/(end-start+1)); + } + // set marker color, line color, maker size, marker type + fFourierAverage[i].dataFourierIm->SetMarkerColor(fColorList[i]); + fFourierAverage[i].dataFourierIm->SetLineColor(fColorList[i]); + fFourierAverage[i].dataFourierIm->SetMarkerSize(0.8); + fFourierAverage[i].dataFourierIm->SetMarkerStyle(22); // closed up triangle + + // power average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (Int_t k=start; k<=end; k++) { + if (j < fFourierHistos[k].dataFourierPwr->GetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[k].dataFourierPwr, fFourierHistos[0].dataFourierPwr->GetBinCenter(j)); + } + fFourierAverage[i].dataFourierPwr->SetBinContent(j, dval/(end-start+1)); + } + // set marker color, line color, maker size, marker type + fFourierAverage[i].dataFourierPwr->SetMarkerColor(fColorList[i]); + fFourierAverage[i].dataFourierPwr->SetLineColor(fColorList[i]); + fFourierAverage[i].dataFourierPwr->SetMarkerSize(0.8); + fFourierAverage[i].dataFourierPwr->SetMarkerStyle(22); // closed up triangle + + // phase average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (Int_t k=start; k<=end; k++) { + if (j < fFourierHistos[k].dataFourierPhase->GetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[k].dataFourierPhase, fFourierHistos[0].dataFourierPhase->GetBinCenter(j)); + } + fFourierAverage[i].dataFourierPhase->SetBinContent(j, dval/(end-start+1)); + } + // set marker color, line color, maker size, marker type + fFourierAverage[i].dataFourierPhase->SetMarkerColor(fColorList[i]); + fFourierAverage[i].dataFourierPhase->SetLineColor(fColorList[i]); + fFourierAverage[i].dataFourierPhase->SetMarkerSize(0.8); + fFourierAverage[i].dataFourierPhase->SetMarkerStyle(22); // closed up triangle + + // phase optimised real average + for (Int_t j=0; jGetNbinsX(); j++) { + dval = 0.0; + for (Int_t k=start; k<=end; k++) { + if (j < fFourierHistos[k].dataFourierPhaseOptReal->GetNbinsX()) + dval += GetInterpolatedValue(fFourierHistos[k].dataFourierPhaseOptReal, fFourierHistos[0].dataFourierPhaseOptReal->GetBinCenter(j)); + } + fFourierAverage[i].dataFourierPhaseOptReal->SetBinContent(j, dval/(end-start+1)); + } + // set marker color, line color, maker size, marker type + fFourierAverage[i].dataFourierPhaseOptReal->SetMarkerColor(fColorList[i]); + fFourierAverage[i].dataFourierPhaseOptReal->SetLineColor(fColorList[i]); + fFourierAverage[i].dataFourierPhaseOptReal->SetMarkerSize(0.8); + fFourierAverage[i].dataFourierPhaseOptReal->SetMarkerStyle(22); // closed up triangle } - fFourierAverage.dataFourierPhase->SetBinContent(j, dval/fFourierHistos.size()); } - // set marker color, line color, maker size, marker type - fFourierAverage.dataFourierPhase->SetMarkerColor(kBlack); - fFourierAverage.dataFourierPhase->SetLineColor(kBlack); - fFourierAverage.dataFourierPhase->SetMarkerSize(0.8); - fFourierAverage.dataFourierPhase->SetMarkerStyle(22); } //-------------------------------------------------------------------------- @@ -1087,104 +1373,134 @@ void PFourierCanvas::PlotFourier() Double_t ymin=0, ymax=0; switch (fCurrentPlotView) { - case FOURIER_PLOT_REAL: - fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); - ymin = GetMinimum(fFourierHistos[0].dataFourierRe, xmin, xmax); - ymax = GetMaximum(fFourierHistos[0].dataFourierRe, xmin, xmax); - for (unsigned int i=1; i ymax) - ymax = GetMaximum(fFourierHistos[i].dataFourierRe, xmin, xmax); - if (GetMinimum(fFourierHistos[i].dataFourierRe, xmin, xmax) < ymin) - ymin = GetMinimum(fFourierHistos[i].dataFourierRe, xmin, xmax); - } - fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax); - fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitle("Real"); - fFourierHistos[0].dataFourierRe->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierHistos[0].dataFourierRe->Draw("p"); - for (unsigned int i=1; iDraw("psame"); - } - break; - case FOURIER_PLOT_IMAG: - fFourierHistos[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax); - ymin = GetMinimum(fFourierHistos[0].dataFourierIm, xmin, xmax); - ymax = GetMaximum(fFourierHistos[0].dataFourierIm, xmin, xmax); - for (unsigned int i=1; i ymax) - ymax = GetMaximum(fFourierHistos[i].dataFourierIm, xmin, xmax); - if (GetMinimum(fFourierHistos[i].dataFourierIm, xmin, xmax) < ymin) - ymin = GetMinimum(fFourierHistos[i].dataFourierIm, xmin, xmax); - } - fFourierHistos[0].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax); - fFourierHistos[0].dataFourierIm->GetYaxis()->SetTitle("Imag"); - fFourierHistos[0].dataFourierIm->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierHistos[0].dataFourierIm->Draw("p"); - for (unsigned int i=1; iDraw("psame"); - } - break; - case FOURIER_PLOT_REAL_AND_IMAG: - fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); - ymin = GetMinimum(fFourierHistos[0].dataFourierRe, xmin, xmax); - ymax = GetMaximum(fFourierHistos[0].dataFourierRe, xmin, xmax); - for (unsigned int i=1; i ymax) - ymax = GetMaximum(fFourierHistos[i].dataFourierRe, xmin, xmax); - if (GetMaximum(fFourierHistos[i].dataFourierIm, xmin, xmax) > ymax) - ymax = GetMaximum(fFourierHistos[i].dataFourierIm, xmin, xmax); - if (GetMinimum(fFourierHistos[i].dataFourierRe, xmin, xmax) < ymin) - ymin = GetMinimum(fFourierHistos[i].dataFourierRe, xmin, xmax); - if (GetMinimum(fFourierHistos[i].dataFourierIm, xmin, xmax) < ymin) - ymin = GetMinimum(fFourierHistos[i].dataFourierIm, xmin, xmax); - } - fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax); - fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitle("Real"); - fFourierHistos[0].dataFourierRe->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierHistos[0].dataFourierRe->Draw("p"); - for (unsigned int i=1; iDraw("psame"); - } - for (unsigned int i=0; iDraw("psame"); - } - break; - case FOURIER_PLOT_POWER: - // get maximum of Fourier data in the range - fFourierHistos[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax); - ymin = 0.0; - ymax = GetMaximum(fFourierHistos[0].dataFourierPwr, xmin, xmax); - for (unsigned int i=1; i ymax) - ymax = GetMaximum(fFourierHistos[i].dataFourierPwr, xmin, xmax); - } - fFourierHistos[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax); - fFourierHistos[0].dataFourierPwr->GetYaxis()->SetTitle("Power"); - fFourierHistos[0].dataFourierPwr->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierHistos[0].dataFourierPwr->Draw("p"); - for (unsigned int i=1; iDraw("psame"); - } - break; - case FOURIER_PLOT_PHASE: - fFourierHistos[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax); - ymin = GetMinimum(fFourierHistos[0].dataFourierPhase, xmin, xmax); - ymax = GetMaximum(fFourierHistos[0].dataFourierPhase, xmin, xmax); - for (unsigned int i=1; i ymax) - ymax = GetMaximum(fFourierHistos[i].dataFourierPhase, xmin, xmax); - if (GetMinimum(fFourierHistos[i].dataFourierPhase, xmin, xmax) < ymin) - ymin = GetMinimum(fFourierHistos[i].dataFourierPhase, xmin, xmax); - } - fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax); - fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitle("Phase"); - fFourierHistos[0].dataFourierPhase->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierHistos[0].dataFourierPhase->Draw("p"); - for (unsigned int i=1; iDraw("psame"); - } - break; - default: - break; + case FOURIER_PLOT_REAL: + fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierHistos[0].dataFourierRe, xmin, xmax); + ymax = GetMaximum(fFourierHistos[0].dataFourierRe, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierHistos[i].dataFourierRe, xmin, xmax); + if (GetMinimum(fFourierHistos[i].dataFourierRe, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierHistos[i].dataFourierRe, xmin, xmax); + } + fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax); + fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitle("Real"); + fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3); + fFourierHistos[0].dataFourierRe->GetYaxis()->SetDecimals(kTRUE); + fFourierHistos[0].dataFourierRe->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierHistos[0].dataFourierRe->Draw("p"); + for (UInt_t i=1; iDraw("psame"); + } + break; + case FOURIER_PLOT_IMAG: + fFourierHistos[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierHistos[0].dataFourierIm, xmin, xmax); + ymax = GetMaximum(fFourierHistos[0].dataFourierIm, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierHistos[i].dataFourierIm, xmin, xmax); + if (GetMinimum(fFourierHistos[i].dataFourierIm, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierHistos[i].dataFourierIm, xmin, xmax); + } + fFourierHistos[0].dataFourierIm->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax); + fFourierHistos[0].dataFourierIm->GetYaxis()->SetTitleOffset(1.3); + fFourierHistos[0].dataFourierIm->GetYaxis()->SetDecimals(kTRUE); + fFourierHistos[0].dataFourierIm->GetYaxis()->SetTitle("Imag"); + fFourierHistos[0].dataFourierIm->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierHistos[0].dataFourierIm->Draw("p"); + for (UInt_t i=1; iDraw("psame"); + } + break; + case FOURIER_PLOT_REAL_AND_IMAG: + fFourierHistos[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierHistos[0].dataFourierRe, xmin, xmax); + ymax = GetMaximum(fFourierHistos[0].dataFourierRe, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierHistos[i].dataFourierRe, xmin, xmax); + if (GetMaximum(fFourierHistos[i].dataFourierIm, xmin, xmax) > ymax) + ymax = GetMaximum(fFourierHistos[i].dataFourierIm, xmin, xmax); + if (GetMinimum(fFourierHistos[i].dataFourierRe, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierHistos[i].dataFourierRe, xmin, xmax); + if (GetMinimum(fFourierHistos[i].dataFourierIm, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierHistos[i].dataFourierIm, xmin, xmax); + } + fFourierHistos[0].dataFourierRe->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax); + fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3); + fFourierHistos[0].dataFourierRe->GetYaxis()->SetDecimals(kTRUE); + fFourierHistos[0].dataFourierRe->GetYaxis()->SetTitle("Real"); + fFourierHistos[0].dataFourierRe->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierHistos[0].dataFourierRe->Draw("p"); + for (UInt_t i=1; iDraw("psame"); + } + for (UInt_t i=0; iDraw("psame"); + } + break; + case FOURIER_PLOT_POWER: + // get maximum of Fourier data in the range + fFourierHistos[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = 0.0; + ymax = GetMaximum(fFourierHistos[0].dataFourierPwr, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierHistos[i].dataFourierPwr, xmin, xmax); + } + fFourierHistos[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax); + fFourierHistos[0].dataFourierPwr->GetYaxis()->SetTitle("Power"); + fFourierHistos[0].dataFourierPwr->GetYaxis()->SetTitleOffset(1.3); + fFourierHistos[0].dataFourierPwr->GetYaxis()->SetDecimals(kTRUE); + fFourierHistos[0].dataFourierPwr->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierHistos[0].dataFourierPwr->Draw("p"); + for (UInt_t i=1; iDraw("psame"); + } + break; + case FOURIER_PLOT_PHASE: + fFourierHistos[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierHistos[0].dataFourierPhase, xmin, xmax); + ymax = GetMaximum(fFourierHistos[0].dataFourierPhase, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierHistos[i].dataFourierPhase, xmin, xmax); + if (GetMinimum(fFourierHistos[i].dataFourierPhase, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierHistos[i].dataFourierPhase, xmin, xmax); + } + fFourierHistos[0].dataFourierPhase->GetYaxis()->SetRangeUser(1.05*ymin, 1.05*ymax); + fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitleOffset(1.3); + fFourierHistos[0].dataFourierPhase->GetYaxis()->SetDecimals(kTRUE); + fFourierHistos[0].dataFourierPhase->GetYaxis()->SetTitle("Phase"); + fFourierHistos[0].dataFourierPhase->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierHistos[0].dataFourierPhase->Draw("p"); + for (UInt_t i=1; iDraw("psame"); + } + break; + case FOURIER_PLOT_PHASE_OPT_REAL: + fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierHistos[0].dataFourierPhaseOptReal, xmin, xmax); + ymax = GetMaximum(fFourierHistos[0].dataFourierPhaseOptReal, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierHistos[i].dataFourierPhaseOptReal, xmin, xmax); + if (GetMinimum(fFourierHistos[i].dataFourierPhaseOptReal, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierHistos[i].dataFourierPhaseOptReal, xmin, xmax); + } + fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(ymin, 1.05*ymax); + fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetTitleOffset(1.3); + fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetDecimals(kTRUE); + fFourierHistos[0].dataFourierPhaseOptReal->GetYaxis()->SetTitle("Phase Opt. Real"); + fFourierHistos[0].dataFourierPhaseOptReal->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierHistos[0].dataFourierPhaseOptReal->Draw("p"); + for (UInt_t i=1; iDraw("psame"); + } + break; + default: + break; } fFourierPad->Update(); @@ -1207,7 +1523,7 @@ void PFourierCanvas::PlotFourierPhaseValue() fCurrentFourierPhaseText = 0; } - double x, y; + Double_t x, y; TString str; // plot Fourier phase @@ -1238,49 +1554,168 @@ void PFourierCanvas::PlotAverage() { fFourierPad->cd(); - if (fFourierAverage.dataFourierRe == 0) { // ups, HandlerAverage never called! + if (fFourierAverage.size() == 0) { // ups, HandleAverage never called! HandleAverage(); } - Double_t xmin=0, xmax=0; + Double_t xmin=0.0, xmax=0.0; xmin = fInitialXRange[0]; xmax = fInitialXRange[1]; + Double_t ymin=0.0, ymax=0.0; + + if (fLegAvgPerDataSet) { + fLegAvgPerDataSet->Clear(); + delete fLegAvgPerDataSet; + fLegAvgPerDataSet = 0; + } switch (fCurrentPlotView) { - case FOURIER_PLOT_REAL: - fFourierAverage.dataFourierRe->GetYaxis()->SetTitle(""); - fFourierAverage.dataFourierRe->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierAverage.dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); - fFourierAverage.dataFourierRe->Draw("p"); - break; - case FOURIER_PLOT_IMAG: - fFourierAverage.dataFourierIm->GetYaxis()->SetTitle(""); - fFourierAverage.dataFourierIm->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierAverage.dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax); - fFourierAverage.dataFourierIm->Draw("p"); - break; - case FOURIER_PLOT_REAL_AND_IMAG: - fFourierAverage.dataFourierRe->GetYaxis()->SetTitle(""); - fFourierAverage.dataFourierRe->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierAverage.dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); - fFourierAverage.dataFourierRe->Draw("p"); - fFourierAverage.dataFourierIm->Draw("psame"); + case FOURIER_PLOT_REAL: + fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierAverage[0].dataFourierRe, xmin, xmax); + ymax = GetMaximum(fFourierAverage[0].dataFourierRe, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierAverage[i].dataFourierRe, xmin, xmax); + if (GetMinimum(fFourierAverage[i].dataFourierRe, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierAverage[i].dataFourierRe, xmin, xmax); + } + fFourierAverage[0].dataFourierRe->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax); + fFourierAverage[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3); + fFourierAverage[0].dataFourierRe->GetYaxis()->SetDecimals(kTRUE); + fFourierAverage[0].dataFourierRe->GetYaxis()->SetTitle(""); + fFourierAverage[0].dataFourierRe->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); + fFourierAverage[0].dataFourierRe->Draw("p"); break; - case FOURIER_PLOT_POWER: - // get maximum of Fourier data in the range - fFourierAverage.dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax); - fFourierAverage.dataFourierPwr->GetYaxis()->SetTitle(""); - fFourierAverage.dataFourierPwr->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierAverage.dataFourierPwr->Draw("p"); - break; - case FOURIER_PLOT_PHASE: - fFourierAverage.dataFourierPhase->GetYaxis()->SetTitle(""); - fFourierAverage.dataFourierPhase->GetXaxis()->SetTitle(fXaxisTitle.Data()); - fFourierAverage.dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax); - fFourierAverage.dataFourierPhase->Draw("p"); - break; - default: - break; + case FOURIER_PLOT_IMAG: + fFourierAverage[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierAverage[0].dataFourierIm, xmin, xmax); + ymax = GetMaximum(fFourierAverage[0].dataFourierIm, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierAverage[i].dataFourierIm, xmin, xmax); + if (GetMinimum(fFourierAverage[i].dataFourierIm, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierAverage[i].dataFourierIm, xmin, xmax); + } + fFourierAverage[0].dataFourierIm->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax); + fFourierAverage[0].dataFourierIm->GetYaxis()->SetTitleOffset(1.3); + fFourierAverage[0].dataFourierIm->GetYaxis()->SetDecimals(kTRUE); + fFourierAverage[0].dataFourierIm->GetYaxis()->SetTitle(""); + fFourierAverage[0].dataFourierIm->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierAverage[0].dataFourierIm->GetXaxis()->SetRangeUser(xmin, xmax); + fFourierAverage[0].dataFourierIm->Draw("p"); + break; + case FOURIER_PLOT_REAL_AND_IMAG: + fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierAverage[0].dataFourierRe, xmin, xmax); + ymax = GetMaximum(fFourierAverage[0].dataFourierRe, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierAverage[i].dataFourierRe, xmin, xmax); + if (GetMinimum(fFourierAverage[i].dataFourierRe, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierAverage[i].dataFourierRe, xmin, xmax); + } + fFourierAverage[0].dataFourierRe->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax); + fFourierAverage[0].dataFourierRe->GetYaxis()->SetTitleOffset(1.3); + fFourierAverage[0].dataFourierRe->GetYaxis()->SetDecimals(kTRUE); + fFourierAverage[0].dataFourierRe->GetYaxis()->SetTitle(""); + fFourierAverage[0].dataFourierRe->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierAverage[0].dataFourierRe->GetXaxis()->SetRangeUser(xmin, xmax); + fFourierAverage[0].dataFourierRe->Draw("p"); + fFourierAverage[0].dataFourierIm->Draw("psame"); + break; + case FOURIER_PLOT_POWER: + // get maximum of Fourier data in the range + fFourierAverage[0].dataFourierPwr->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = 0.0; + ymax = GetMaximum(fFourierAverage[0].dataFourierPwr, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierAverage[i].dataFourierPwr, xmin, xmax); + } + fFourierAverage[0].dataFourierPwr->GetYaxis()->SetRangeUser(ymin, 1.03*ymax); + fFourierAverage[0].dataFourierPwr->GetYaxis()->SetTitleOffset(1.3); + fFourierAverage[0].dataFourierPwr->GetYaxis()->SetDecimals(kTRUE); + fFourierAverage[0].dataFourierPwr->GetYaxis()->SetTitle(""); + fFourierAverage[0].dataFourierPwr->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierAverage[0].dataFourierPwr->Draw("p"); + break; + case FOURIER_PLOT_PHASE: + fFourierAverage[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierAverage[0].dataFourierPhase, xmin, xmax); + ymax = GetMaximum(fFourierAverage[0].dataFourierPhase, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierAverage[i].dataFourierPhase, xmin, xmax); + if (GetMinimum(fFourierAverage[i].dataFourierPhase, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierAverage[i].dataFourierPhase, xmin, xmax); + } + fFourierAverage[0].dataFourierPhase->GetYaxis()->SetRangeUser(1.03*ymin, 1.03*ymax); + fFourierAverage[0].dataFourierPhase->GetYaxis()->SetTitleOffset(1.3); + fFourierAverage[0].dataFourierPhase->GetYaxis()->SetDecimals(kTRUE); + fFourierAverage[0].dataFourierPhase->GetYaxis()->SetTitle(""); + fFourierAverage[0].dataFourierPhase->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierAverage[0].dataFourierPhase->GetXaxis()->SetRangeUser(xmin, xmax); + fFourierAverage[0].dataFourierPhase->Draw("p"); + break; + case FOURIER_PLOT_PHASE_OPT_REAL: + fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax); + ymin = GetMinimum(fFourierAverage[0].dataFourierPhaseOptReal, xmin, xmax); + ymax = GetMaximum(fFourierAverage[0].dataFourierPhaseOptReal, xmin, xmax); + for (UInt_t i=1; i ymax) + ymax = GetMaximum(fFourierAverage[i].dataFourierPhaseOptReal, xmin, xmax); + if (GetMinimum(fFourierAverage[i].dataFourierPhaseOptReal, xmin, xmax) < ymin) + ymin = GetMinimum(fFourierAverage[i].dataFourierPhaseOptReal, xmin, xmax); + } + fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetRangeUser(ymin, 1.03*ymax); + fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetTitleOffset(1.3); + fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetDecimals(kTRUE); + fFourierAverage[0].dataFourierPhaseOptReal->GetYaxis()->SetTitle(""); + fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetTitle(fXaxisTitle.Data()); + fFourierAverage[0].dataFourierPhaseOptReal->GetXaxis()->SetRangeUser(xmin, xmax); + fFourierAverage[0].dataFourierPhaseOptReal->Draw("p"); + break; + default: + break; + } + + if (fAveragedViewPerDataSet) { // plot all the rest + fLegAvgPerDataSet = new 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()); + for (UInt_t i=1; iDraw("psame"); + break; + case FOURIER_PLOT_IMAG: + fFourierAverage[i].dataFourierIm->Draw("psame"); + break; + case FOURIER_PLOT_REAL_AND_IMAG: + fFourierAverage[i].dataFourierRe->Draw("psame"); + fFourierAverage[i].dataFourierIm->Draw("psame"); + break; + case FOURIER_PLOT_POWER: + fFourierAverage[i].dataFourierPwr->Draw("psame"); + break; + case FOURIER_PLOT_PHASE: + fFourierAverage[i].dataFourierPhase->Draw("psame"); + break; + case FOURIER_PLOT_PHASE_OPT_REAL: + fFourierAverage[i].dataFourierPhaseOptReal->Draw("psame"); + break; + default: + break; + } + // add legend ?!?! + str = GetDataSetName(fFourierAverage[i].dataFourierPwr->GetTitle()); + label = TString::Format("<%s>", str.Data()); + fLegAvgPerDataSet->AddEntry(fFourierAverage[i].dataFourierPwr, label.Data()); + } + fLegAvgPerDataSet->Draw(); } fFourierPad->Update(); @@ -1300,10 +1735,10 @@ void PFourierCanvas::IncrementFourierPhase() if ((fCurrentPlotView == FOURIER_PLOT_POWER) || (fCurrentPlotView == FOURIER_PLOT_PHASE)) return; - double re, im; - double inc = 1.0; - const double cp = TMath::Cos(inc/180.0*TMath::Pi()); - const double sp = TMath::Sin(inc/180.0*TMath::Pi()); + Double_t re, im; + Double_t inc = 1.0; + const Double_t cp = TMath::Cos(inc/180.0*TMath::Pi()); + const Double_t sp = TMath::Sin(inc/180.0*TMath::Pi()); fCurrentFourierPhase += inc; PlotFourierPhaseValue(); @@ -1333,10 +1768,10 @@ void PFourierCanvas::DecrementFourierPhase() if ((fCurrentPlotView == FOURIER_PLOT_POWER) || (fCurrentPlotView == FOURIER_PLOT_PHASE)) return; - double re, im; - double inc = 1.0; - const double cp = TMath::Cos(inc/180.0*TMath::Pi()); - const double sp = TMath::Sin(inc/180.0*TMath::Pi()); + Double_t re, im; + Double_t inc = 1.0; + const Double_t cp = TMath::Cos(inc/180.0*TMath::Pi()); + const Double_t sp = TMath::Sin(inc/180.0*TMath::Pi()); fCurrentFourierPhase -= inc; PlotFourierPhaseValue(); @@ -1345,8 +1780,8 @@ void PFourierCanvas::DecrementFourierPhase() if ((fFourierHistos[i].dataFourierRe != 0) && (fFourierHistos[i].dataFourierIm != 0)) { for (Int_t j=0; jGetNbinsX(); j++) { // loop over a fourier data set // calculate new fourier data set value - re = fFourierHistos[i].dataFourierRe->GetBinContent(j) * cp + fFourierHistos[i].dataFourierIm->GetBinContent(j) * sp; - im = fFourierHistos[i].dataFourierIm->GetBinContent(j) * cp - fFourierHistos[i].dataFourierRe->GetBinContent(j) * sp; + re = fFourierHistos[i].dataFourierRe->GetBinContent(j) * cp - fFourierHistos[i].dataFourierIm->GetBinContent(j) * sp; + im = fFourierHistos[i].dataFourierIm->GetBinContent(j) * cp + fFourierHistos[i].dataFourierRe->GetBinContent(j) * sp; // overwrite fourier data set value fFourierHistos[i].dataFourierRe->SetBinContent(j, re); fFourierHistos[i].dataFourierIm->SetBinContent(j, im); @@ -1478,3 +1913,26 @@ Double_t PFourierCanvas::GetInterpolatedValue(TH1F* histo, Double_t xVal) return (y1-y0)*(xVal-x0)/(x1-x0)+y0; } + +//-------------------------------------------------------------------------- +// GetDataSetName (private) +//-------------------------------------------------------------------------- +/** + *

filters out the data set name from the title + * + * return: + * - data set name + * + * \param title title of the Fourier histogram + */ +TString PFourierCanvas::GetDataSetName(TString title) +{ + TString str(title); + + Ssiz_t idx = str.First(':'); + str.Remove(0, idx+1); + idx = str.First(','); + str.Remove(idx); + + return str; +} diff --git a/src/classes/PFunction.cpp b/src/classes/PFunction.cpp index 35bd9f42..951153d8 100644 --- a/src/classes/PFunction.cpp +++ b/src/classes/PFunction.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PFunctionHandler.cpp b/src/classes/PFunctionHandler.cpp index a7ac7e6b..de8abaa5 100644 --- a/src/classes/PFunctionHandler.cpp +++ b/src/classes/PFunctionHandler.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PMsr2Data.cpp b/src/classes/PMsr2Data.cpp index e818e6ff..f5e19160 100644 --- a/src/classes/PMsr2Data.cpp +++ b/src/classes/PMsr2Data.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2009-2014 by Bastian M. Wojek / Andreas Suter * + * Copyright (C) 2009-2016 by Bastian M. Wojek / Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -170,7 +170,7 @@ int PMsr2Data::DetermineRunNumberDigits(unsigned int runNo, bool normalMode) con string::size_type loc = firstOnLine.rfind(tempRunNumber.str()); if ( loc != string::npos ) { while ( loc > 0 ) { - if(isdigit(firstOnLine.at(--loc))) { + if (isdigit(firstOnLine.at(--loc))) { ++fRunNumberDigits; } else { break; @@ -731,7 +731,7 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const string &msrOu msrParamList->at(i).fIsGlobal = true; ++fNumGlobalParam; } - //cout << msrParamList->at(i).fNo << " is global: " << msrParamList->at(i).fIsGlobal << endl; + // cout << "debug> " << msrParamList->at(i).fNo << ": " << msrParamList->at(i).fName.Data() << " is global: " << msrParamList->at(i).fIsGlobal << endl; } // check if parameters have been sorted correctly from the beginning @@ -760,7 +760,7 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const string &msrOu bool mapExists(false); for (unsigned int i(0); i < tempLines->size(); ++i) { line = (*tempLines)[i].fLine.Data(); - split( tempVec, line, is_any_of(" \t") ); // split the theory line at spaces + split( tempVec, line, is_any_of(" \t"), token_compress_on ); // split the theory line at spaces for (unsigned int j(1); j < tempVec.size(); ++j) { try { tempPar = boost::lexical_cast(tempVec[j]); @@ -1060,12 +1060,11 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const string &msrOu tempLines = fMsrHandler->GetMsrTheory(); for (unsigned int i(0); i < tempLines->size(); ++i) { line = (*tempLines)[i].fLine.Data(); - split( tempVec, line, is_any_of(" \t") ); // split the theory line at spaces + split( tempVec, line, is_any_of(" \t"), token_compress_on ); // split the theory line at spaces for (unsigned int j(1); j < tempVec.size(); ++j) { try { tempPar = boost::lexical_cast(tempVec[j]); - if (!msrParamList->at(tempPar - 1).fIsGlobal) { cerr << endl << ">> msr2data: **WARNING** The parameter " << msrParamList->at(tempPar - 1).fName.Data() \ << " is recognized as run specific!"; @@ -1112,7 +1111,6 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const string &msrOu lineChanged = true; } } - break; } catch(boost::bad_lexical_cast &) { // in case the cast does not work: do nothing - this means the entry is not a simple parameter @@ -2444,7 +2442,7 @@ void PMsr2Data::WriteValue(fstream &outFile, const double &value, const unsigned if ((fabs(value) >= 1.0e6) || ((fabs(value) < 1.0e-4) && (fabs(value) > 0.0))) outFile << scientific << setprecision(width - 8); else - outFile.setf(ios::floatfield); + outFile.unsetf(ios::floatfield); outFile << setw(width) << left << value; } @@ -2469,7 +2467,7 @@ void PMsr2Data::WriteValue(fstream &outFile, const double &value, const double & if ((fabs(value) >= 1.0e6) || ((fabs(value) < 1.0e-4) && (fabs(value) > 0))) outFile << scientific; else - outFile.setf(ios::floatfield); + outFile.unsetf(ios::floatfield); outFile.precision(prec); outFile << setw(width) << left << value; diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 9a91f134..d6d4e049 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -242,7 +242,7 @@ Int_t PMsrHandler::ReadMsrFile() if (result == PMUSR_SUCCESS) if (!HandleFunctionsEntry(functions)) result = PMUSR_MSR_SYNTAX_ERROR; - if (result == PMUSR_SUCCESS) + if ((result == PMUSR_SUCCESS) && (global.size()>0)) if (!HandleGlobalEntry(global)) result = PMUSR_MSR_SYNTAX_ERROR; if (result == PMUSR_SUCCESS) @@ -311,6 +311,11 @@ Int_t PMsrHandler::ReadMsrFile() if (!CheckAddRunParameters()) result = PMUSR_MSR_SYNTAX_ERROR; + // check that if RRF settings are present, the RUN block settings do correspond + if (result == PMUSR_SUCCESS) + if (!CheckRRFSettings()) + result = PMUSR_MSR_SYNTAX_ERROR; + if (result == PMUSR_SUCCESS) { CheckMaxLikelihood(); // check if the user wants to use max likelihood with asymmetry/non-muSR fit (which is not implemented) CheckLegacyLifetimecorrection(); // check if lifetimecorrection is found in RUN blocks, if yes transfer it to PLOT blocks @@ -348,7 +353,7 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) { const UInt_t prec = 6; // default output precision for float/doubles UInt_t neededPrec = 0; - UInt_t neededWidth = 9; + UInt_t neededWidth = 9; Int_t tag, lineNo = 0, number; Int_t runNo = -1, addRunNo = 0; @@ -612,9 +617,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) case MSR_FITTYPE_SINGLE_HISTO: fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl; + break; case MSR_FITTYPE_ASYM: fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; break; + case MSR_FITTYPE_ASYM_RRF: + fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ; + break; case MSR_FITTYPE_MU_MINUS: fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; break; @@ -624,6 +635,27 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) default: break; } + } else if (sstr.BeginsWith("rrf_freq", TString::kIgnoreCase) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << left << "rrf_freq "; + fout.width(8); + neededPrec = LastSignificant(fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()),10); + fout.precision(neededPrec); + fout << left << fixed << fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()); + fout << " " << fGlobal.GetRRFUnit(); + fout << endl; + } else if (sstr.BeginsWith("rrf_phase", TString::kIgnoreCase) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << "rrf_phase "; + fout.width(8); + fout << left << fGlobal.GetRRFPhase(); + fout << endl; + } else if (sstr.BeginsWith("rrf_packing", TString::kIgnoreCase) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << "rrf_packing "; + fout.width(8); + fout << left << fGlobal.GetRRFPacking(); + fout << endl; } else if (sstr.BeginsWith("data")) { fout.width(16); fout << left << "data"; @@ -749,9 +781,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) case MSR_FITTYPE_SINGLE_HISTO: fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl; + break; case MSR_FITTYPE_ASYM: fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; break; + case MSR_FITTYPE_ASYM_RRF: + fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ; + break; case MSR_FITTYPE_MU_MINUS: fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; break; @@ -1089,6 +1127,11 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) } else if (sstr.BeginsWith("range_for_phase_correction")) { fout << "range_for_phase_correction " << fFourier.fRangeForPhaseCorrection[0] << " " << fFourier.fRangeForPhaseCorrection[1] << endl; } else if (sstr.BeginsWith("range ")) { + fout.setf(ios::fixed,ios::floatfield); + neededPrec = LastSignificant(fFourier.fPlotRange[0]); + if (LastSignificant(fFourier.fPlotRange[1]) > neededPrec) + neededPrec = LastSignificant(fFourier.fPlotRange[1]); + fout.precision(neededPrec); fout << "range " << fFourier.fPlotRange[0] << " " << fFourier.fPlotRange[1] << endl; } else { fout << str.Data() << endl; @@ -1102,9 +1145,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) case MSR_PLOT_SINGLE_HISTO: fout << "PLOT " << fPlots[plotNo].fPlotType << " (single histo plot)" << endl; break; + case MSR_PLOT_SINGLE_HISTO_RRF: + fout << "PLOT " << fPlots[plotNo].fPlotType << " (single histo RRF plot)" << endl; + break; case MSR_PLOT_ASYM: fout << "PLOT " << fPlots[plotNo].fPlotType << " (asymmetry plot)" << endl; break; + case MSR_PLOT_ASYM_RRF: + fout << "PLOT " << fPlots[plotNo].fPlotType << " (asymmetry RRF plot)" << endl; + break; case MSR_PLOT_MU_MINUS: fout << "PLOT " << fPlots[plotNo].fPlotType << " (mu minus plot)" << endl; break; @@ -1590,7 +1639,136 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co // write GLOBAL block if (fGlobal.IsPresent()) { - // not sure that anything needs to be done here ... + fout << "GLOBAL" << endl; + + // fittype + if (fGlobal.GetFitType() != -1) { + fout.width(16); + switch (fGlobal.GetFitType()) { + case MSR_FITTYPE_SINGLE_HISTO: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; + break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl; + break; + case MSR_FITTYPE_ASYM: + fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; + break; + case MSR_FITTYPE_ASYM_RRF: + fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ; + break; + case MSR_FITTYPE_MU_MINUS: + fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; + break; + case MSR_FITTYPE_NON_MUSR: + fout << left << "fittype" << MSR_FITTYPE_NON_MUSR << " (non muSR fit)" << endl ; + break; + default: + break; + } + } + + // RRF related stuff + if ((fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) > 0.0) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << left << "rrf_freq "; + fout.width(8); + fout << left << fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()); + fout << " " << fGlobal.GetRRFUnit(); + fout << endl; + } + if ((fGlobal.GetRRFPhase() != 0.0) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << "rrf_phase "; + fout.width(8); + fout << left << fGlobal.GetRRFPhase(); + fout << endl; + } + if ((fGlobal.GetRRFPacking() != -1) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << "rrf_packing "; + fout.width(8); + fout << left << fGlobal.GetRRFPacking(); + fout << endl; + } + + // data range + if ((fGlobal.GetDataRange(0) != -1) || (fGlobal.GetDataRange(1) != -1) || (fGlobal.GetDataRange(2) != -1) || (fGlobal.GetDataRange(3) != -1)) { + fout.width(16); + fout << left << "data"; + for (UInt_t j=0; j<4; ++j) { + if (fGlobal.GetDataRange(j) > 0) { + fout.width(8); + fout << left << fGlobal.GetDataRange(j); + } + } + fout << endl; + } + + // t0 + if (fGlobal.GetT0BinSize() > 0) { + fout.width(16); + fout << left << "t0"; + for (UInt_t j=0; j 0) { + fout.width(16); + fout << left << "addt0"; + for (Int_t k=0; k 0) + fout << "+" << fGlobal.GetFitRangeOffset(0); + fout << " lgb"; + if (fGlobal.GetFitRangeOffset(1) > 0) + fout << "-" << fGlobal.GetFitRangeOffset(1); + } else { // fit range given in time + for (UInt_t j=0; j<2; j++) { + if (fGlobal.GetFitRange(j) == -1) + break; + UInt_t neededWidth = 7; + UInt_t neededPrec = LastSignificant(fRuns[i].GetFitRange(j)); + fout.width(neededWidth); + fout.precision(neededPrec); + fout << left << fixed << fGlobal.GetFitRange(j); + if (j==0) + fout << " "; + } + } + fout << endl; + } + + // packing + if (fGlobal.GetPacking() != -1) { + fout.width(16); + fout << left << "packing"; + fout << fGlobal.GetPacking() << endl; + } + + fout << endl << hline.Data() << endl; } // write RUN blocks @@ -1655,22 +1833,30 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co } // fittype - fout.width(16); - switch (fRuns[i].GetFitType()) { - case MSR_FITTYPE_SINGLE_HISTO: - fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; - break; - case MSR_FITTYPE_ASYM: - fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; - break; - case MSR_FITTYPE_MU_MINUS: - fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; - break; - case MSR_FITTYPE_NON_MUSR: - fout << left << "fittype" << MSR_FITTYPE_NON_MUSR << " (non muSR fit)" << endl ; - break; - default: - break; + if (fRuns[i].GetFitType() != -1) { + fout.width(16); + switch (fRuns[i].GetFitType()) { + case MSR_FITTYPE_SINGLE_HISTO: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; + break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl; + break; + case MSR_FITTYPE_ASYM: + fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; + break; + case MSR_FITTYPE_ASYM_RRF: + fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ; + break; + case MSR_FITTYPE_MU_MINUS: + fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; + break; + case MSR_FITTYPE_NON_MUSR: + fout << left << "fittype" << MSR_FITTYPE_NON_MUSR << " (non muSR fit)" << endl ; + break; + default: + break; + } } // alpha @@ -1810,17 +1996,19 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co } // addt0 - for (UInt_t j = 0; j < fRuns[i].GetRunNameSize() - 1; ++j) { - if (fRuns[i].GetAddT0BinSize(j) > 0) { - fout.width(16); - fout << left << "addt0"; - for (Int_t k=0; k 0) { + for (UInt_t j = 0; j < fRuns[i].GetRunNameSize() - 1; ++j) { + if (fRuns[i].GetAddT0BinSize(j) > 0) { + fout.width(16); + fout << left << "addt0"; + for (Int_t k=0; k *co } // fit - fout.width(16); - fout << left << "fit"; - if (fRuns[i].IsFitRangeInBin()) { // fit range given in bins - fout << "fgb"; - if (fRuns[i].GetFitRangeOffset(0) > 0) - fout << "+" << fRuns[i].GetFitRangeOffset(0); - fout << " lgb"; - if (fRuns[i].GetFitRangeOffset(1) > 0) - fout << "-" << fRuns[i].GetFitRangeOffset(1); - } else { // fit range given in time - for (UInt_t j=0; j<2; j++) { - if (fRuns[i].GetFitRange(j) == -1) - break; - UInt_t neededWidth = 7; - UInt_t neededPrec = LastSignificant(fRuns[i].GetFitRange(j)); - fout.width(neededWidth); - fout.precision(neededPrec); - fout << left << fixed << fRuns[i].GetFitRange(j); - if (j==0) - fout << " "; + if ( (fRuns[i].IsFitRangeInBin() && fRuns[i].GetFitRangeOffset(0) != -1) || + (fRuns[i].GetFitRange(0) != PMUSR_UNDEFINED) ) { + fout.width(16); + fout << left << "fit"; + if (fRuns[i].IsFitRangeInBin()) { // fit range given in bins + fout << "fgb"; + if (fRuns[i].GetFitRangeOffset(0) > 0) + fout << "+" << fRuns[i].GetFitRangeOffset(0); + fout << " lgb"; + if (fRuns[i].GetFitRangeOffset(1) > 0) + fout << "-" << fRuns[i].GetFitRangeOffset(1); + } else { // fit range given in time + for (UInt_t j=0; j<2; j++) { + if (fRuns[i].GetFitRange(j) == -1) + break; + UInt_t neededWidth = 7; + UInt_t neededPrec = LastSignificant(fRuns[i].GetFitRange(j)); + fout.width(neededWidth); + fout.precision(neededPrec); + fout << left << fixed << fRuns[i].GetFitRange(j); + if (j==0) + fout << " "; + } } + fout << endl; } - fout << endl; // packing - fout.width(16); - fout << left << "packing"; - fout << fRuns[i].GetPacking() << endl; + if (fRuns[i].GetPacking() != -1) { + fout.width(16); + fout << left << "packing"; + fout << fRuns[i].GetPacking() << endl; + } + fout << endl; } @@ -1971,6 +2165,11 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co // range if ((fFourier.fPlotRange[0] != -1.0) || (fFourier.fPlotRange[1] != -1.0)) { + fout.setf(ios::fixed,ios::floatfield); + UInt_t neededPrec = LastSignificant(fFourier.fPlotRange[0]); + if (LastSignificant(fFourier.fPlotRange[1]) > neededPrec) + neededPrec = LastSignificant(fFourier.fPlotRange[1]); + fout.precision(neededPrec); fout << "range " << fFourier.fPlotRange[0] << " " << fFourier.fPlotRange[1] << endl; } @@ -1989,9 +2188,15 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co case MSR_PLOT_SINGLE_HISTO: fout << "PLOT " << fPlots[i].fPlotType << " (single histo plot)" << endl; break; + case MSR_PLOT_SINGLE_HISTO_RRF: + fout << "PLOT " << fPlots[i].fPlotType << " (single histo RRF plot)" << endl; + break; case MSR_PLOT_ASYM: fout << "PLOT " << fPlots[i].fPlotType << " (asymmetry plot)" << endl; break; + case MSR_PLOT_ASYM_RRF: + fout << "PLOT " << fPlots[i].fPlotType << " (asymmetry RRF plot)" << endl; + break; case MSR_PLOT_MU_MINUS: fout << "PLOT " << fPlots[i].fPlotType << " (mu minus plot)" << endl; break; @@ -2677,8 +2882,8 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines) TString str; TObjArray *tokens = 0; TObjString *ostr = 0; - Int_t ival; - Double_t dval; + Int_t ival = 0; + Double_t dval = 0.0; UInt_t addT0Counter = 0; // since this routine is called, a GLOBAL block is present @@ -2709,7 +2914,9 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines) if (str.IsDigit()) { Int_t fittype = str.Atoi(); if ((fittype == MSR_FITTYPE_SINGLE_HISTO) || + (fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) || (fittype == MSR_FITTYPE_ASYM) || + (fittype == MSR_FITTYPE_ASYM_RRF) || (fittype == MSR_FITTYPE_MU_MINUS) || (fittype == MSR_FITTYPE_NON_MUSR)) { global.SetFitType(fittype); @@ -2720,6 +2927,55 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines) error = true; } } + } else if (iter->fLine.BeginsWith("rrf_freq", TString::kIgnoreCase)) { + if (tokens->GetEntries() < 3) { + error = true; + } else { + ostr = dynamic_cast(tokens->At(1)); + str = ostr->GetString(); + if (str.IsFloat()) { + dval = str.Atof(); + if (dval <= 0.0) + error = true; + } + if (!error) { + ostr = dynamic_cast(tokens->At(2)); + str = ostr->GetString(); + global.SetRRFFreq(dval, str.Data()); + if (global.GetRRFFreq(str.Data()) == RRF_FREQ_UNDEF) + error = true; + } + } + } else if (iter->fLine.BeginsWith("rrf_packing", TString::kIgnoreCase)) { + if (tokens->GetEntries() < 2) { + error = true; + } else { + ostr = dynamic_cast(tokens->At(1)); + str = ostr->GetString(); + if (str.IsDigit()) { + ival = str.Atoi(); + if (ival > 0) { + global.SetRRFPacking(ival); + } else { + error = true; + } + } else { + error = true; + } + } + } else if (iter->fLine.BeginsWith("rrf_phase", TString::kIgnoreCase)) { + if (tokens->GetEntries() < 2) { + error = true; + } else { + ostr = dynamic_cast(tokens->At(1)); + str = ostr->GetString(); + if (str.IsFloat()) { + dval = str.Atof(); + global.SetRRFPhase(dval); + } else { + error = true; + } + } } else if (iter->fLine.BeginsWith("data", TString::kIgnoreCase)) { // data if (tokens->GetEntries() < 3) { error = true; @@ -2861,29 +3117,6 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines) fGlobal = global; } -/* - cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: fittype : " << fGlobal.GetFitType(); - cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: data bin range: "; - for (UInt_t i=0; i<4; i++) { - cout << fGlobal.GetDataRange(i) << ", "; - } - cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: t0's : "; - for (UInt_t i=0; i PMsrHandler::HandleGlobalEntry: Global: addt0's : "; - for (UInt_t i=0; i --> " << i << ": "; - for (UInt_t j=0; j<(UInt_t)fGlobal.GetAddT0BinSize(i); j++) { - cout << fGlobal.GetAddT0Bin(i,j) << ", "; - } - } - cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: fit in bin: " << fGlobal.IsFitRangeInBin(); - cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: fit offset: " << fGlobal.GetFitRangeOffset(0) << ", " << fGlobal.GetFitRangeOffset(1); - cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: fit : " << fGlobal.GetFitRange(0) << ", " << fGlobal.GetFitRange(1); - cout << endl << "debug> PMsrHandler::HandleGlobalEntry: Global: packing : " << fGlobal.GetPacking(); - cout << endl; -*/ - return !error; } @@ -3017,7 +3250,9 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines) if (str.IsDigit()) { Int_t fittype = str.Atoi(); if ((fittype == MSR_FITTYPE_SINGLE_HISTO) || + (fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) || (fittype == MSR_FITTYPE_ASYM) || + (fittype == MSR_FITTYPE_ASYM_RRF) || (fittype == MSR_FITTYPE_MU_MINUS) || (fittype == MSR_FITTYPE_NON_MUSR)) { param.SetFitType(fittype); @@ -3188,15 +3423,19 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines) if (tokens->GetEntries() < 2) { error = true; } else { - PIntVector group; + PUIntVector group; str = iter->fLine; - if (ParseDetectorGrouping(str, group)) { + PStringNumberList *rl = new PStringNumberList(str.Data()); + string errorMsg(""); + if (rl->Parse(errorMsg, true)) { + group = rl->GetList(); for (UInt_t i=0; iGetEntries() < 2) { error = true; } else { - PIntVector group; + PUIntVector group; str = iter->fLine; - if (ParseDetectorGrouping(str, group)) { + PStringNumberList *rl = new PStringNumberList(str.Data()); + string errorMsg(""); + if (rl->Parse(errorMsg, true)) { + group = rl->GetList(); for (UInt_t i=0; i(tokens->At(1)); str = ostr->GetString(); if (str.BeginsWith("par", TString::kIgnoreCase)) { // parameter value - Int_t no = 0; - if (FilterNumber(str, "par", 0, no)) { - // check that the parameter is in range - if ((Int_t)fParam.size() < no) { + if (fFourierOnly) { + cerr << endl << ">> PMsrHandler::HandleFourierEntry: **WARNING** Found phase parameter for Fourier only."; + cerr << endl << ">> This is currently not supported. Will set the phase to 0." << endl; + fourier.fPhase = 0.0; + } else { + Int_t no = 0; + if (FilterNumber(str, "par", 0, no)) { + // check that the parameter is in range + if ((Int_t)fParam.size() < no) { + error = true; + continue; + } + // keep the parameter number + fourier.fPhaseParamNo = no; + // get parameter value + fourier.fPhase = fParam[no-1].fValue; + } else { error = true; continue; } - // keep the parameter number - fourier.fPhaseParamNo = no; - // get parameter value - fourier.fPhase = fParam[no-1].fValue; - } else { - error = true; - continue; } } else if (str.IsFloat()) { // phase value fourier.fPhase = str.Atof(); @@ -3909,39 +4158,34 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines) param.fLifeTimeCorrection = true; } else if (iter1->fLine.Contains("runs", TString::kIgnoreCase)) { // handle plot runs TComplex run; + PStringNumberList *rl; + string errorMsg; + PUIntVector runList; switch (param.fPlotType) { case -1: error = true; break; case MSR_PLOT_SINGLE_HISTO: // like: runs 1 5 13 + case MSR_PLOT_SINGLE_HISTO_RRF: case MSR_PLOT_ASYM: + case MSR_PLOT_ASYM_RRF: case MSR_PLOT_NON_MUSR: case MSR_PLOT_MU_MINUS: - tokens = iter1->fLine.Tokenize(" \t"); - if (!tokens) { + rl = new PStringNumberList(iter1->fLine.Data()); + if (!rl->Parse(errorMsg, true)) { cerr << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; + cerr << endl << ">> Error Message: " << errorMsg; cerr << endl << endl; return false; } - if (tokens->GetEntries() < 2) { // runs missing - error = true; - } else { - for (Int_t i=1; iGetEntries(); i++) { - ostr = dynamic_cast(tokens->At(i)); - str = ostr->GetString(); - if (str.IsDigit()) { - run = TComplex(str.Atoi(),-1.0); - param.fRuns.push_back(run); - } else { - error = true; - } - } + runList = rl->GetList(); + for (UInt_t i=0; i> [use_fit_ranges [ymin ymax]]"; cerr << endl << ">> [view_packing n]"; cerr << endl; - cerr << endl << ">> where is: 0=single histo asym,"; + cerr << endl << ">> where is: 0=single histo,"; + cerr << endl << ">> 1=RRF single histo,"; cerr << endl << ">> 2=forward-backward asym,"; + cerr << endl << ">> 3=forward-backward RRF asym,"; cerr << endl << ">> 4=mu minus single histo,"; cerr << endl << ">> 8=non muSR."; cerr << endl << ">> is the list of runs, e.g. runs 1 3"; @@ -5054,7 +5300,7 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity() cerr << endl << ">> forward parameter number not defined. Necessary for single histogram fits." << endl; return false; } - if (fRuns[i].GetNormParamNo() > static_cast(fParam.size())) { + if ((fRuns[i].GetNormParamNo() > static_cast(fParam.size())) && !fFourierOnly) { // check if forward histogram number is a function if (fRuns[i].GetNormParamNo() - MSR_PARAM_FUN_OFFSET > static_cast(fParam.size())) { cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; @@ -5090,6 +5336,53 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity() fRuns[i].SetPacking(1); } break; + case PRUN_SINGLE_HISTO_RRF: + // check that there is a forward parameter number + if (fRuns[i].GetForwardHistoNo() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> forward parameter number not defined. Necessary for single histogram RRF fits." << endl; + return false; + } + if ((fRuns[i].GetNormParamNo() > static_cast(fParam.size())) && !fFourierOnly) { + // check if forward histogram number is a function + if (fRuns[i].GetNormParamNo() - MSR_PARAM_FUN_OFFSET > static_cast(fParam.size())) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> forward histogram number " << fRuns[i].GetNormParamNo() << " is larger than the number of fit parameters (" << fParam.size() << ")."; + cerr << endl << ">> Consider to check the manual ;-)" << endl; + return false; + } + } + // check fit range + if (!fRuns[i].IsFitRangeInBin() && !fFourierOnly) { // fit range given as times in usec (RUN block) + if ((fRuns[i].GetFitRange(0) == PMUSR_UNDEFINED) || (fRuns[i].GetFitRange(1) == PMUSR_UNDEFINED)) { // check fit range in RUN block + if (!fGlobal.IsFitRangeInBin()) { // fit range given as times in usec (GLOBAL block) + if ((fGlobal.GetFitRange(0) == PMUSR_UNDEFINED) || (fGlobal.GetFitRange(1) == PMUSR_UNDEFINED)) { // check fit range in GLOBAL block + cerr << endl << "PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << " Fit range is not defined. Necessary for single histogram fits." << endl; + return false; + } + } + } + } + // check number of T0's provided + if ((fRuns[i].GetT0BinSize() > fRuns[i].GetForwardHistoNoSize()) && + (fGlobal.GetT0BinSize() > fRuns[i].GetForwardHistoNoSize())) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> Found " << fRuns[i].GetT0BinSize() << " T0 entries. Expecting only " << fRuns[i].GetForwardHistoNoSize() << ". Needs to be fixed." << endl; + cerr << endl << ">> In GLOBAL block: " << fGlobal.GetT0BinSize() << " T0 entries. Expecting only " << fRuns[i].GetForwardHistoNoSize() << ". Needs to be fixed." << endl; + return false; + } + // check that RRF frequency is given + if (fGlobal.GetRRFUnitTag() == RRF_UNIT_UNDEF) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** no RRF frequency found in the GLOBAL block." << endl; + return false; + } + // check that RRF packing is given + if (fGlobal.GetRRFPacking() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** no RRF packing found in the GLOBAL block." << endl; + return false; + } + break; case PRUN_ASYMMETRY: // check alpha if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) { @@ -5142,6 +5435,62 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity() fRuns[i].SetPacking(1); } break; + case PRUN_ASYMMETRY_RRF: + // check alpha + if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> alpha parameter number missing which is needed for an asymmetry RRF fit."; + cerr << endl << ">> Consider to check the manual ;-)" << endl; + return false; + } + // check that there is a forward parameter number + if (fRuns[i].GetForwardHistoNo() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> forward histogram number not defined. Necessary for asymmetry RRF fits." << endl; + return false; + } + // check that there is a backward parameter number + if (fRuns[i].GetBackwardHistoNo() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> backward histogram number not defined. Necessary for asymmetry RRF fits." << endl; + return false; + } + // check fit range + if (!fRuns[i].IsFitRangeInBin()) { // fit range given as times in usec + if ((fRuns[i].GetFitRange(0) == PMUSR_UNDEFINED) || (fRuns[i].GetFitRange(1) == PMUSR_UNDEFINED)) { + if ((fGlobal.GetFitRange(0) == PMUSR_UNDEFINED) || (fGlobal.GetFitRange(1) == PMUSR_UNDEFINED)) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> Fit range is not defined, also NOT present in the GLOBAL block. Necessary for asymmetry RRF fits." << endl; + return false; + } + } + } + // check number of T0's provided + if ((fRuns[i].GetT0BinSize() > 2*fRuns[i].GetForwardHistoNoSize()) && + (fGlobal.GetT0BinSize() > 2*fRuns[i].GetForwardHistoNoSize())) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> Found " << fRuns[i].GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetForwardHistoNoSize() << " in forward. Needs to be fixed." << endl; + cerr << endl << ">> In GLOBAL block: " << fGlobal.GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetForwardHistoNoSize() << ". Needs to be fixed." << endl; + return false; + } + if ((fRuns[i].GetT0BinSize() > 2*fRuns[i].GetBackwardHistoNoSize()) && + (fGlobal.GetT0BinSize() > 2*fRuns[i].GetBackwardHistoNoSize())) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> Found " << fRuns[i].GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetBackwardHistoNoSize() << " in backward. Needs to be fixed." << endl; + cerr << endl << ">> In GLOBAL block: " << fGlobal.GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetBackwardHistoNoSize() << ". Needs to be fixed." << endl; + return false; + } + // check that RRF frequency is given + if (fGlobal.GetRRFUnitTag() == RRF_UNIT_UNDEF) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** no RRF frequency found in the GLOBAL block." << endl; + return false; + } + // check that RRF packing is given + if (fGlobal.GetRRFPacking() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** no RRF packing found in the GLOBAL block." << endl; + return false; + } + break; case PRUN_MU_MINUS: // needs eventually to be implemented break; @@ -5338,6 +5687,9 @@ Bool_t PMsrHandler::CheckFuncs() { Bool_t result = true; + if (fFourierOnly) + return result; + PIntVector funVec; PIntVector funBlock; PIntVector funLineBlockNo; @@ -5525,6 +5877,103 @@ void PMsrHandler::CheckMaxLikelihood() } } +//-------------------------------------------------------------------------- +// CheckRRFSettings (public) +//-------------------------------------------------------------------------- +/** + *

Make sure that if RRF settings are found in the GLOBAL section, the fit types + * in the RUN blocks correspond. + */ +Bool_t PMsrHandler::CheckRRFSettings() +{ + Bool_t result = true; + Int_t fittype = fGlobal.GetFitType(); + + // first set of tests: if RRF parameters are set, check if RRF fit is chosen. + if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) != RRF_FREQ_UNDEF) { + if (fittype != -1) { // check if GLOBAL fittype is set + if ((fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) && + (fittype != MSR_FITTYPE_ASYM_RRF)) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** found GLOBAL fittype " << fittype << " and"; + cerr << endl << ">> RRF settings in the GLOBAL section. This is NOT compatible. Fix it first."; + result = false; + } + } else { // GLOBAL fittype is NOT set + for (UInt_t i=0; i> PMsrHandler::CheckRRFSettings: **ERROR** found RUN with fittype " << fittype << " and"; + cerr << endl << ">> RRF settings in the GLOBAL section. This is NOT compatible. Fix it first."; + result = false; + break; + } + } + } + } else { + if (fGlobal.GetRRFPacking() != -1) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **WARNING** found in the GLOBAL section rrf_packing, without"; + cerr << endl << ">> rrf_freq. Doesn't make any sense. Will drop rrf_packing"; + cerr << endl << endl; + fGlobal.SetRRFPacking(-1); + } + if (fGlobal.GetRRFPhase() != 0.0) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **WARNING** found in the GLOBAL section rrf_phase, without"; + cerr << endl << ">> rrf_freq. Doesn't make any sense. Will drop rrf_phase"; + cerr << endl << endl; + fGlobal.SetRRFPhase(0.0); + } + } + + // if not a RRF fit, done at this point + if ((fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) && + (fittype != MSR_FITTYPE_ASYM_RRF)) { + return true; + } + + // second set of tests: if RRF fit is chosen, do I find the necessary RRF parameters? + fittype = fGlobal.GetFitType(); + if ((fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) || + (fittype == MSR_FITTYPE_ASYM_RRF)) { // make sure RRF freq and RRF packing are set + if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == RRF_FREQ_UNDEF) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but"; + cerr << endl << ">> no RRF frequency found in the GLOBAL section! Fix it."; + return false; + } + if (fGlobal.GetRRFPacking() == -1) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but"; + cerr << endl << ">> no RRF packing found in the GLOBAL section! Fix it."; + return false; + } + } else { // check single runs for RRF + UInt_t rrfFitCounter = 0; + for (UInt_t i=0; i> PMsrHandler::CheckRRFSettings: **ERROR** #Runs (" << fRuns.size() << ") != # RRF fits found (" << rrfFitCounter << ")"; + cerr << endl << ">> This is currently not supported."; + return false; + } + if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == RRF_FREQ_UNDEF) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but"; + cerr << endl << ">> no RRF frequency found in the GLOBAL section! Fix it."; + return false; + } + if (fGlobal.GetRRFPacking() == -1) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but"; + cerr << endl << ">> no RRF packing found in the GLOBAL section! Fix it."; + return false; + } + } + + return result; +} + //-------------------------------------------------------------------------- // GetGroupingString (public) //-------------------------------------------------------------------------- @@ -5658,86 +6107,6 @@ UInt_t PMsrHandler::LastSignificant(Double_t dval, UInt_t precLimit) return lastSignificant; } -//-------------------------------------------------------------------------- -// ParseDetectorGrouping (private) -//-------------------------------------------------------------------------- -/** - *

- * - * \param str forward/backward string to be decoded - * \param group decoded detector grouping vector - * - * return: true if parsing was successful, false otherwise. - */ -Bool_t PMsrHandler::ParseDetectorGrouping(TString str, PIntVector &group) -{ - TObjArray *tok=0, *tok1=0; - TObjString *ostr=0; - Int_t first=0, last=0; - - // change cn - cm to cn-cm. Will *NOT* handle cn - cm etc - str = str.ReplaceAll(" - ", "-"); - - group.clear(); - tok = str.Tokenize(" \t"); - - // check that there are indeed enough tokens - if (tok->GetEntries() < 2) { - delete tok; - return false; - } - - for (Int_t i=1; iGetEntries(); i++) { - ostr = dynamic_cast(tok->At(i)); - if (ostr->GetString().Contains("-")) { // hopefully a cn-cm token - tok1 = ostr->GetString().Tokenize("-"); - if (tok1->GetEntries() == 2) { - ostr = dynamic_cast(tok1->At(0)); - if (ostr->GetString().IsDigit()) { - first = ostr->GetString().Atoi(); - } else { - if (tok) delete tok; - if (tok1) delete tok1; - return false; - } - ostr = dynamic_cast(tok1->At(1)); - if (ostr->GetString().IsDigit()) { - last = ostr->GetString().Atoi(); - } else { - if (tok) delete tok; - if (tok1) delete tok1; - return false; - } - - if (last < first) { - if (tok) delete tok; - return false; - } - - for (Int_t i=first; i<=last; i++) - group.push_back(i); - } else { - if (tok) delete tok; - if (tok1) delete tok1; - return false; - } - } else { // hopefully a number - if (ostr->GetString().IsDigit()) { - group.push_back(ostr->GetString().Atoi()); - } else { - if (tok) delete tok; - return false; - } - } - } - - // clean up - if (tok) delete tok; - if (tok1) delete tok1; - - return true; -} - //-------------------------------------------------------------------------- // MakeDetectorGroupingString (private) //-------------------------------------------------------------------------- diff --git a/src/classes/PMusr.cpp b/src/classes/PMusr.cpp index ee618411..a84f4765 100644 --- a/src/classes/PMusr.cpp +++ b/src/classes/PMusr.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -28,10 +28,14 @@ ***************************************************************************/ #include - #include using namespace std; +#include +using namespace boost; + +#include "TMath.h" + #include "PMusr.h" //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -706,6 +710,10 @@ void PRawRunData::SetTempError(const UInt_t idx, const Double_t errTemp) PMsrGlobalBlock::PMsrGlobalBlock() { fGlobalPresent = false; + fRRFFreq = RRF_FREQ_UNDEF; // rotating reference frequency in units given by fRRFUnitTag. Only needed for fittype 1 + fRRFUnitTag = RRF_UNIT_UNDEF; // RRF unit tag. Default: undefined + fRRFPhase = 0.0; + fRRFPacking = -1; // undefined RRF packing/rebinning fFitType = -1; // undefined fit type for (UInt_t i=0; i<4; i++) { fDataRange[i] = -1; // undefined data bin range @@ -718,6 +726,135 @@ PMsrGlobalBlock::PMsrGlobalBlock() fPacking = -1; // undefined packing/rebinning } +//-------------------------------------------------------------------------- +// GetRRFFreq (public) +//-------------------------------------------------------------------------- +/** + *

get RRF frequency value in specific units. If units is unknown, RRF_UNDEF_FREQ will be returned. + * + * \param unit unit string in which the units shall be given + */ +Double_t PMsrGlobalBlock::GetRRFFreq(const char *unit) +{ + Double_t freq = 0.0; + + // check that the units given make sense + TString unitStr = unit; + Int_t unitTag = RRF_UNIT_UNDEF; + if (!unitStr.CompareTo("MHz", TString::kIgnoreCase)) + unitTag = RRF_UNIT_MHz; + else if (!unitStr.CompareTo("Mc", TString::kIgnoreCase)) + unitTag = RRF_UNIT_Mcs; + else if (!unitStr.CompareTo("T", TString::kIgnoreCase)) + unitTag = RRF_UNIT_T; + else + return RRF_FREQ_UNDEF; + + // calc the conversion factor + if (unitTag == fRRFUnitTag) + freq = fRRFFreq; + else if ((unitTag == RRF_UNIT_MHz) && (fRRFUnitTag == RRF_UNIT_Mcs)) + freq = fRRFFreq/TMath::TwoPi(); + else if ((unitTag == RRF_UNIT_MHz) && (fRRFUnitTag == RRF_UNIT_T)) + freq = fRRFFreq*1e4*GAMMA_BAR_MUON; // 1e4 need for T -> G since GAMMA_BAR_MUON is given in MHz/G + else if ((unitTag == RRF_UNIT_Mcs) && (fRRFUnitTag == RRF_UNIT_MHz)) + freq = fRRFFreq*TMath::TwoPi(); + else if ((unitTag == RRF_UNIT_Mcs) && (fRRFUnitTag == RRF_UNIT_T)) + freq = fRRFFreq*1e4*TMath::TwoPi()*GAMMA_BAR_MUON; // 1e4 need for T -> G since GAMMA_BAR_MUON is given in MHz/G + else if ((unitTag == RRF_UNIT_T) && (fRRFUnitTag == RRF_UNIT_MHz)) + freq = fRRFFreq/GAMMA_BAR_MUON*1e-4; // 1e-4 need for G -> T since GAMMA_BAR_MUON is given in MHz/G + else if ((unitTag == RRF_UNIT_T) && (fRRFUnitTag == RRF_UNIT_Mcs)) + freq = fRRFFreq/(TMath::TwoPi()*GAMMA_BAR_MUON)*1e-4; // 1e-4 need for G -> T since GAMMA_BAR_MUON is given in MHz/G + + return freq; +} + +//-------------------------------------------------------------------------- +// SetRRFFreq (public) +//-------------------------------------------------------------------------- +/** + *

set RRF frequency value in specific units. If units is unknown, 0.0 will be set. + * + * \param RRF frequency value + * \param unit unit string in which the units shall be given + */ +void PMsrGlobalBlock::SetRRFFreq(Double_t freq, const char *unit) +{ + // check that the units given make sense + TString unitStr = unit; + Int_t unitTag = RRF_UNIT_UNDEF; + if (!unitStr.CompareTo("MHz", TString::kIgnoreCase)) + unitTag = RRF_UNIT_MHz; + else if (!unitStr.CompareTo("Mc", TString::kIgnoreCase)) + unitTag = RRF_UNIT_Mcs; + else if (!unitStr.CompareTo("T", TString::kIgnoreCase)) + unitTag = RRF_UNIT_T; + else { + cerr << endl << ">> PMsrGlobalBlock::SetRRFFreq: **ERROR** found undefined RRF unit '" << unit << "'!"; + cerr << endl << ">> Will set RRF frequency to 0.0." << endl; + fRRFFreq = 0.0; + fRRFUnitTag = RRF_UNIT_UNDEF; + } + + fRRFFreq = freq; + fRRFUnitTag = unitTag; +} + +//-------------------------------------------------------------------------- +// GetRRFUnit (public) +//-------------------------------------------------------------------------- +/** + *

returns RRF frequency unit. + */ +TString PMsrGlobalBlock::GetRRFUnit() +{ + TString unit; + + switch (fRRFUnitTag) { + case RRF_UNIT_UNDEF: + unit = TString("??"); + break; + case RRF_UNIT_kHz: + unit = TString("kHz"); + break; + case RRF_UNIT_MHz: + unit = TString("MHz"); + break; + case RRF_UNIT_Mcs: + unit = TString("Mc"); + break; + case RRF_UNIT_G: + unit = TString("G"); + break; + case RRF_UNIT_T: + unit = TString("T"); + break; + default: + unit = TString("??"); + break; + } + + return unit; +} + +//-------------------------------------------------------------------------- +// SetRRFPacking (public) +//-------------------------------------------------------------------------- +/** + *

set RRF packing. + * + * \param RRF packing + */ +void PMsrGlobalBlock::SetRRFPacking(Int_t pack) +{ + if (pack <= 0) { + cerr << endl << "PMsrGlobalBlock::SetRRFPacking: **WARNING** found RRF packing <= 0. Likely doesn't make any sense." << endl; + fRRFPacking = -1; // set to undefined + } + + fRRFPacking = pack; +} + //-------------------------------------------------------------------------- // GetDataRange (public) //-------------------------------------------------------------------------- @@ -1741,3 +1878,167 @@ void PMsrRunBlock::SetMapGlobal(UInt_t idx, Int_t ival) // else do nothing at the moment return; } + +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// implementation PStringNumberList +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +//-------------------------------------------------------------------------- +// Parse (public) +//-------------------------------------------------------------------------- +/** + *

Helper class which parses list of numbers of the following 3 forms and its combination. + * (i) list of integers separted by spaces, e.g. 1 3 7 14 + * (ii) a range of integers of the form nS-nE, e.g. 13-27 which will generate 13, 14, 15, .., 26, 27 + * (iii) a sequence of integers of the form nS:nE:nStep, e.g. 10:20:2 which will generate 10, 12, 14, .., 18, 20 + * + * \param errorMsg error message + * \param ignoreFirstToken if true, the first parse token will be ignored + * + * @return true if parse has been successful, otherwise false + */ +bool PStringNumberList::Parse(string &errorMsg, bool ignoreFirstToken) +{ + bool result=true; + vector splitVec; + int ival; + + // before checking tokens, remove 'forbidden' " - " and " : " + StripSpaces(); + + // split string into space separated tokens + split(splitVec, fString, is_any_of(" "), token_compress_on); + + unsigned int start=0; + if (ignoreFirstToken) + start=1; + + for (unsigned int i=start; i subSplitVec; + // split potential nS-nE token + split(subSplitVec, splitVec[i], is_any_of("-"), token_compress_on); + + int start=-1, end=-1; + unsigned int count=0; + for (unsigned int j=0; j end) { + int swap = end; + cerr << "**WARNING** start=" << start << " > end=" << end << ", hence I will swap them" << endl; + end = start; + start = swap; + } + for (int j=start; j<=end; j++) + fList.push_back(j); + } + } else if (splitVec[i].find(":") != string::npos) { // check for potential sequence + vector subSplitVec; + // split potential rStart:rEnd:rStep token + split(subSplitVec, splitVec[i], is_any_of(":"), token_compress_on); + + int start=-1, end=-1, step=-1; + unsigned int count=0; + for (unsigned int j=0; j end) { + int swap = end; + cerr << "**WARNING** start=" << start << " > end=" << end << ", hence I will swap them" << endl; + end = start; + start = swap; + } + for (int j=start; j<=end; j+=step) + fList.push_back(j); + } + } else if (IsNumber(splitVec[i])) { + ival = atoi(splitVec[i].c_str()); + fList.push_back(ival); + } else { + errorMsg = "**ERROR** invalid token: " + splitVec[i]; + result = false; + } + } + } + + return result; +} + +//-------------------------------------------------------------------------- +// StripSpaces (private) +//-------------------------------------------------------------------------- +/** + *

This routine removes arbitray number of spaces between '-' and ':', + * e.g. 123 - 125 will be converted to 123-125, etc. + */ +void PStringNumberList::StripSpaces() +{ + string str=fString; + int pos=-1; + + // backward scan + for (int i=str.size(); i>=0; --i) { // check if first space is found + if ((str[i] == ' ') && (pos == -1)) { + pos = i; + } else if ((str[i] == '-') || (str[i] == ':')) { // check for '-' or ':' + if (pos != -1) { + str.erase(i+1, pos-i); + } + } else if (str[i] != ' ') { // anything but different than a space leads to a reset of the pos counter + pos = -1; + } + } + // forward scan + for (unsigned int i=0; i #include #include +#include #include "PMusrCanvas.h" #include "PFourier.h" +static const char *gFiletypes[] = { "Data files", "*.dat", + "All files", "*", + 0, 0 }; + ClassImp(PMusrCanvasPlotRange) //-------------------------------------------------------------------------- @@ -70,7 +75,7 @@ PMusrCanvasPlotRange::PMusrCanvasPlotRange() void PMusrCanvasPlotRange::SetXRange(Double_t xmin, Double_t xmax) { if (xmin > xmax) { - cerr << endl << "PMusrCanvasPlotRange::SetXRange: **WARNING** xmin > xmax, will swap them." << endl; + cerr << endl << ">> PMusrCanvasPlotRange::SetXRange(): **WARNING** xmin > xmax, will swap them." << endl; fXmin = xmax; fXmax = xmin; } else { @@ -92,7 +97,7 @@ void PMusrCanvasPlotRange::SetXRange(Double_t xmin, Double_t xmax) void PMusrCanvasPlotRange::SetYRange(Double_t ymin, Double_t ymax) { if (ymin > ymax) { - cerr << endl << "PMusrCanvasPlotRange::SetYRange: **WARNING** ymin > ymax, will swap them." << endl; + cerr << endl << ">> PMusrCanvasPlotRange::SetYRange(): **WARNING** ymin > ymax, will swap them." << endl; fYmin = ymax; fYmax = ymin; } else { @@ -128,7 +133,6 @@ PMusrCanvas::PMusrCanvas() fImp = 0; fBar = 0; fPopupMain = 0; - fPopupSave = 0; fPopupFourier = 0; fStyle = 0; @@ -181,8 +185,8 @@ PMusrCanvas::PMusrCanvas() */ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, - const Bool_t batch) : - fBatchMode(batch), fPlotNumber(number) + const Bool_t batch, const Bool_t fourier) : + fStartWithFourier(fourier), fBatchMode(batch), fPlotNumber(number) { fTimeout = 0; fTimeoutTimer = 0; @@ -236,8 +240,8 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, PMsrFourierStructure fourierDefault, const PIntVector markerList, const PIntVector colorList, - const Bool_t batch) : - fBatchMode(batch), + const Bool_t batch, const Bool_t fourier) : + fStartWithFourier(fourier), fBatchMode(batch), fPlotNumber(number), fFourier(fourierDefault), fMarkerList(markerList), fColorList(colorList) { @@ -401,37 +405,76 @@ void PMusrCanvas::SetMsrHandler(PMsrHandler *msrHandler) } // check if RRF data are present - if ((fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) && - (fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq != 0.0)) { + if (((fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) && + (fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq != 0.0)) || + (fMsrHandler->GetMsrGlobal()->GetRRFPacking() > 0 && + fMsrHandler->GetMsrGlobal()->GetRRFUnit().CompareTo("??"))) { fRRFLatexText = new TLatex(); fRRFLatexText->SetNDC(kTRUE); fRRFLatexText->SetTextFont(62); fRRFLatexText->SetTextSize(0.03); - fRRFText = new TString("RRF: "); - if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_kHz) { - *fRRFText += TString("#nu_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (kHz)"); - } else if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_MHz) { - *fRRFText += TString("#nu_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (MHz)"); - } else if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_Mcs) { - *fRRFText += TString("#omega_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (Mc/s)"); - } else if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_G) { - *fRRFText += TString("B_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (G)"); - } else if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_T) { - *fRRFText += TString("B_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (T)"); + Int_t rrfUnitTag = -1; + Double_t rrfFreq = 0.0; + if (fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) { // RRF single histo PLOT + fRRFText = new TString("RRF: "); + rrfUnitTag = fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit; + rrfFreq = fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; + TString rrfFreqStr(""); + rrfFreqStr.Form("%.5g", rrfFreq); + if (rrfUnitTag == RRF_UNIT_kHz) { + *fRRFText += TString("#nu_{RRF} = "); + *fRRFText += rrfFreq; + *fRRFText += TString(" (kHz)"); + } else if (rrfUnitTag == RRF_UNIT_MHz) { + *fRRFText += TString("#nu_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (MHz)"); + } else if (rrfUnitTag == RRF_UNIT_Mcs) { + *fRRFText += TString("#omega_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (Mc/s)"); + } else if (rrfUnitTag == RRF_UNIT_G) { + *fRRFText += TString("B_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (G)"); + } else if (rrfUnitTag == RRF_UNIT_T) { + *fRRFText += TString("B_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (T)"); + } + *fRRFText += TString(", RRF packing = "); + *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking; + } else { // RRF single histo FIT + fRRFText = new TString("RRF: "); + rrfUnitTag = fMsrHandler->GetMsrGlobal()->GetRRFUnitTag(); + rrfFreq = fMsrHandler->GetMsrGlobal()->GetRRFFreq(fMsrHandler->GetMsrGlobal()->GetRRFUnit().Data()); + TString rrfFreqStr(""); + rrfFreqStr.Form("%.5g", rrfFreq); + if (rrfUnitTag == RRF_UNIT_kHz) { + *fRRFText += TString("#nu_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (kHz)"); + } else if (rrfUnitTag == RRF_UNIT_MHz) { + *fRRFText += TString("#nu_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (MHz)"); + } else if (rrfUnitTag == RRF_UNIT_Mcs) { + *fRRFText += TString("#omega_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (Mc/s)"); + } else if (rrfUnitTag == RRF_UNIT_G) { + *fRRFText += TString("B_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (G)"); + } else if (rrfUnitTag == RRF_UNIT_T) { + *fRRFText += TString("B_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (T)"); + } + *fRRFText += TString(", RRF packing = "); + *fRRFText += fMsrHandler->GetMsrGlobal()->GetRRFPacking(); } - *fRRFText += TString(", RRF packing = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking; } } @@ -605,7 +648,7 @@ void PMusrCanvas::UpdateDataTheoryPad() // first check that plot number is smaller than the maximal number of runs if ((Int_t)plotInfo.fRuns[i] > (Int_t)runs.size()) { fValid = false; - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** run plot number " << (Int_t)plotInfo.fRuns[i] << " is larger than the number of runs " << runs.size(); + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** run plot number " << (Int_t)plotInfo.fRuns[i] << " is larger than the number of runs " << runs.size(); cerr << endl; return; } @@ -616,7 +659,7 @@ void PMusrCanvas::UpdateDataTheoryPad() } if (fitType == -1) { fValid = false; - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** plottype = " << fPlotType; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** plottype = " << fPlotType; cerr << ", fittype = " << runs[runNo].GetFitType() << "(RUN block)/"; cerr << "fittype = " << globalBlock->GetFitType() << "(GLOBAL block). However, they have to correspond!"; cerr << endl; @@ -639,7 +682,19 @@ void PMusrCanvas::UpdateDataTheoryPad() if (!data) { // something wrong fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** couldn't obtain run no " << runNo << " for a single histogram plot"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a single histogram plot"; + cerr << endl; + return; + } + // handle data + HandleDataSet(i, runNo, data); + break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + data = fRunList->GetSingleHistoRRF(runNo, PRunListCollection::kRunNo); + if (!data) { // something wrong + fValid = false; + // error message + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a single histogram RRF plot"; cerr << endl; return; } @@ -651,7 +706,19 @@ void PMusrCanvas::UpdateDataTheoryPad() if (!data) { // something wrong fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** couldn't obtain run no " << runNo << " for a asymmetry plot"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a asymmetry plot"; + cerr << endl; + return; + } + // handle data + HandleDataSet(i, runNo, data); + break; + case MSR_FITTYPE_ASYM_RRF: + data = fRunList->GetAsymmetryRRF(runNo, PRunListCollection::kRunNo); + if (!data) { // something wrong + fValid = false; + // error message + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a asymmetry RRF plot"; cerr << endl; return; } @@ -663,7 +730,7 @@ void PMusrCanvas::UpdateDataTheoryPad() if (!data) { // something wrong fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** couldn't obtain run no " << runNo << " for a mu minus single histogram plot"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a mu minus single histogram plot"; cerr << endl; return; } @@ -675,7 +742,7 @@ void PMusrCanvas::UpdateDataTheoryPad() if (!data) { // something wrong fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** couldn't obtain run no " << runNo << " for a none musr data plot"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a none musr data plot"; cerr << endl; return; } @@ -695,7 +762,7 @@ void PMusrCanvas::UpdateDataTheoryPad() default: fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** wrong plottype tag?!"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** wrong plottype tag?!"; cerr << endl; return; break; @@ -703,7 +770,62 @@ void PMusrCanvas::UpdateDataTheoryPad() } // generate the histo plot - PlotData(); + if (!fStartWithFourier || (fPlotType == MSR_PLOT_NON_MUSR)) { + PlotData(); + } else { // show Fourier straight ahead. + // set the menu properly + if (!fBatchMode) + fPopupMain->UnCheckEntry(P_MENU_ID_DATA+P_MENU_PLOT_OFFSET*fPlotNumber); + + // filter proper Fourier plot tag, and set the menu tags properly + switch (fFourier.fPlotTag) { + case FOURIER_PLOT_REAL: + fCurrentPlotView = PV_FOURIER_REAL; + if (!fBatchMode) { + fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_REAL); + fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_PLUS); + fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_MINUS); + } + break; + case FOURIER_PLOT_IMAG: + fCurrentPlotView = PV_FOURIER_IMAG; + if (!fBatchMode) { + fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_IMAG); + fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_PLUS); + fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_MINUS); + } + break; + case FOURIER_PLOT_REAL_AND_IMAG: + fCurrentPlotView = PV_FOURIER_REAL_AND_IMAG; + if (!fBatchMode) { + fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_REAL_AND_IMAG); + fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_PLUS); + fPopupFourier->EnableEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE_MINUS); + } + break; + case FOURIER_PLOT_POWER: + fCurrentPlotView = PV_FOURIER_PWR; + if (!fBatchMode) { + fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PWR); + } + break; + case FOURIER_PLOT_PHASE: + fCurrentPlotView = PV_FOURIER_PHASE; + if (!fBatchMode) { + fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PHASE); + } + break; + default: + fCurrentPlotView = PV_FOURIER_PWR; + if (!fBatchMode) { + fPopupFourier->CheckEntry(P_MENU_ID_FOURIER+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_FOURIER_PWR); + } + break; + } + + HandleFourier(); + PlotFourier(); + } } //-------------------------------------------------------------------------- @@ -763,13 +885,15 @@ void PMusrCanvas::UpdateInfoPad() else tstr = *runs[runNo].GetRunName() + TString(","); // run_name // histo info (depending on the fittype - if (runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO) { + if ((runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO) || + (runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { tstr += TString("h:"); TString grouping; fMsrHandler->GetGroupingString(runNo, "forward", grouping); tstr += grouping; tstr += TString(","); - } else if (runs[runNo].GetFitType() == MSR_FITTYPE_ASYM) { + } else if ((runs[runNo].GetFitType() == MSR_FITTYPE_ASYM) || + (runs[runNo].GetFitType() == MSR_FITTYPE_ASYM_RRF)) { tstr += TString("h:"); TString grouping; fMsrHandler->GetGroupingString(runNo, "forward", grouping); @@ -1282,8 +1406,16 @@ void PMusrCanvas::HandleMenuPopup(Int_t id) cout << "**INFO** averaging of a single data set doesn't make any sense, will ignore 'a' ..." << endl; return; } - } else if (id == P_MENU_ID_SAVE_DATA+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_SAVE_ASCII) { - SaveDataAscii(); + } else if (id == P_MENU_ID_EXPORT_DATA+P_MENU_PLOT_OFFSET*fPlotNumber) { + static TString dir("."); + TGFileInfo fi; + fi.fFileTypes = gFiletypes; + fi.fIniDir = StrDup(dir); + fi.fOverwrite = true; + new TGFileDialog(0, fImp, kFDSave, &fi); + if (fi.fFilename && strlen(fi.fFilename)) { + ExportData(fi.fFilename); + } } // check if phase increment/decrement needs to be ghost @@ -1342,7 +1474,7 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat) } if (idx == -1) { - cerr << endl << "PMusrCanvas::SaveGraphicsAndQuit **ERROR**: fileName (" << fileName << ") is invalid." << endl; + cerr << endl << ">> PMusrCanvas::SaveGraphicsAndQuit(): **ERROR** fileName (" << fileName << ") is invalid." << endl; return; } @@ -1362,13 +1494,20 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat) } //-------------------------------------------------------------------------- -// SaveDataAscii +// ExportData //-------------------------------------------------------------------------- /** *

Saves the currently seen data (data, difference, Fourier spectra, ...) in ascii column format. + * + * \param fileName file name to be used to save the data. */ -void PMusrCanvas::SaveDataAscii() +void PMusrCanvas::ExportData(const Char_t *fileName) { + if (fileName == 0) { // path file name NOT provided, generate a default path file name + cerr << endl << ">> PMusrCanvas::ExportData(): **ERROR** NO path file name provided. Will do nothing." << endl; + return; + } + // collect relevant data PMusrCanvasAsciiDump dump; PMusrCanvasAsciiDumpVector dumpVector; @@ -2014,35 +2153,13 @@ void PMusrCanvas::SaveDataAscii() break; } - // generate output filename - - // in order to handle names with "." correctly this slightly odd data-filename generation - TObjArray *tokens = fMsrHandler->GetFileName().Tokenize("."); - TObjString *ostr; - TString str; - TString fln = TString(""); - for (Int_t i=0; iGetEntries()-1; i++) { - ostr = dynamic_cast(tokens->At(i)); - fln += ostr->GetString() + TString("."); - } - if (!fDifferenceView) { - fln += "data.ascii"; - } else { - fln += "diff.ascii"; - } - - if (tokens) { - delete tokens; - tokens = 0; - } - // open file ofstream fout; // open output data-file - fout.open(fln.Data(), iostream::out); + fout.open(fileName, iostream::out); if (!fout.is_open()) { - cerr << endl << ">> PMusrCanvas::SaveDataAscii: **ERROR** couldn't open file " << fln.Data() << " for writing." << endl; + cerr << endl << ">> PMusrCanvas::ExportData(): **ERROR** couldn't open file " << fileName << " for writing." << endl; return; } @@ -2366,7 +2483,6 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, fImp = 0; fBar = 0; fPopupMain = 0; - fPopupSave = 0; fPopupFourier = 0; fMainCanvas = 0; @@ -2382,7 +2498,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, canvasName += fPlotNumber; fMainCanvas = new TCanvas(canvasName.Data(), title, wtopx, wtopy, ww, wh); if (fMainCanvas == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke " << canvasName.Data(); + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data(); cerr << endl; return; } @@ -2415,10 +2531,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, fPopupMain->AddEntry("Average", P_MENU_ID_AVERAGE+P_MENU_PLOT_OFFSET*fPlotNumber); fPopupMain->AddSeparator(); - fPopupSave = new TGPopupMenu(); - fPopupSave->AddEntry("Save ascii", P_MENU_ID_SAVE_DATA+P_MENU_PLOT_OFFSET*fPlotNumber+P_MENU_ID_SAVE_ASCII); - - fPopupMain->AddPopup("&Save Data", fPopupSave); + fPopupMain->AddEntry("Export Data", P_MENU_ID_EXPORT_DATA+P_MENU_PLOT_OFFSET*fPlotNumber); fBar->MapSubwindows(); fBar->Layout(); @@ -2431,7 +2544,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // title pad fTitlePad = new TPaveText(0.0, YTITLE, 1.0, 1.0, "NDC"); if (fTitlePad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fTitlePad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fTitlePad"; cerr << endl; return; } @@ -2443,7 +2556,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // data/theory pad fDataTheoryPad = new TPad("dataTheoryPad", "dataTheoryPad", 0.0, YINFO, XTHEO, YTITLE); if (fDataTheoryPad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fDataTheoryPad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fDataTheoryPad"; cerr << endl; return; } @@ -2453,7 +2566,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // parameter pad fParameterPad = new TPaveText(XTHEO, 0.5, 1.0, YTITLE, "NDC"); if (fParameterPad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fParameterPad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fParameterPad"; cerr << endl; return; } @@ -2464,7 +2577,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // theory pad fTheoryPad = new TPaveText(XTHEO, 0.1, 1.0, 0.5, "NDC"); if (fTheoryPad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fTheoryPad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fTheoryPad"; cerr << endl; return; } @@ -2476,7 +2589,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // info pad fInfoPad = new TLegend(0.0, 0.0, 1.0, YINFO, "NDC"); if (fInfoPad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fInfoPad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fInfoPad"; cerr << endl; return; } @@ -2881,9 +2994,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) Double_t dval = (startFitRange - data->GetDataTimeStart())/data->GetDataTimeStep(); if (dval < 0.0) { // make sure that startBin >= 0 startBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that startBin <= length of data vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',"; cerr << endl << ">> will set it to data vector size" << endl << endl; startBin = data->GetValue()->size(); } else { @@ -2897,9 +3010,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) dval = (endFitRange - data->GetDataTimeStart())/data->GetDataTimeStep(); if (dval < 0.0) { // make sure that endBin >= 0 endBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that endBin <= length of data vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',"; cerr << endl << ">> will set it to data vector size" << endl << endl; endBin = data->GetValue()->size(); } else { @@ -2912,9 +3025,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) Double_t dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep(); if (dval < 0.0) { // make sure that startBin >= 0 startBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that startBin <= length of data vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',"; cerr << endl << ">> will set it to data vector size" << endl << endl; startBin = data->GetValue()->size(); } else { @@ -2924,9 +3037,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep(); if (dval < 0.0) { // make sure that endBin >= 0 endBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that endtBin <= length of data vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',"; cerr << endl << ">> will set it to data vector size" << endl << endl; endBin = data->GetValue()->size(); } else { @@ -3013,9 +3126,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) Double_t dval = (startFitRange - data->GetDataTimeStart())/data->GetTheoryTimeStep(); if (dval < 0.0) { // make sure that startBin >= 0 startBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that startBin <= length of theory vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',"; cerr << endl << ">> will set it to theory vector size" << endl << endl; startBin = data->GetTheory()->size(); } else { @@ -3029,9 +3142,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) dval = (endFitRange - data->GetDataTimeStart())/data->GetTheoryTimeStep(); if (dval < 0.0) { // make sure that endBin >= 0 endBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that endBin <= length of theory vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',"; cerr << endl << ">> will set it to theory vector size" << endl << endl; endBin = data->GetTheory()->size(); } else { @@ -3047,9 +3160,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) Double_t dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep(); if (dval < 0.0) { // make sure that startBin >= 0 startBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that startBin <= length of theory vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',"; cerr << endl << ">> will set it to theory vector size" << endl << endl; startBin = data->GetTheory()->size(); } else { @@ -3059,9 +3172,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep(); if (dval < 0.0) { // make sure that endBin >= 0 endBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that endtBin <= length of theory vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',"; cerr << endl << ">> will set it to theory vector size" << endl << endl; endBin = data->GetTheory()->size(); } else { @@ -3358,15 +3471,19 @@ void PMusrCanvas::HandleFourier() // check if fourier needs to be calculated if (fData[0].dataFourierRe == 0) { Int_t bin; - bin = fHistoFrame->GetXaxis()->GetFirst(); - double startTime = fHistoFrame->GetBinCenter(bin); - bin = fHistoFrame->GetXaxis()->GetLast(); - double endTime = fHistoFrame->GetBinCenter(bin); + double startTime = fXmin; + double endTime = fXmax; + if (!fStartWithFourier) { // fHistoFrame presen, hence get start/end from it + bin = fHistoFrame->GetXaxis()->GetFirst(); + startTime = fHistoFrame->GetBinCenter(bin); + bin = fHistoFrame->GetXaxis()->GetLast(); + endTime = fHistoFrame->GetBinCenter(bin); + } for (UInt_t i=0; i> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier data ..." << endl; return; } fourierData.Transform(fFourier.fApodization); @@ -3406,7 +3523,7 @@ void PMusrCanvas::HandleFourier() Int_t powerPad = (Int_t)round(log((endTime-startTime)/fData[i].theory->GetBinWidth(1))/log(2))+3; PFourier fourierTheory(fData[i].theory, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, powerPad); if (!fourierTheory.IsValid()) { - cerr << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier theory ..." << endl; + cerr << endl << ">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier theory ..." << endl; return; } fourierTheory.Transform(fFourier.fApodization); @@ -3526,7 +3643,7 @@ void PMusrCanvas::HandleDifferenceFourier() // calculate fourier transform of the data PFourier fourierData(fData[i].diff, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, fFourier.fFourierPower); if (!fourierData.IsValid()) { - cerr << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier diff ..." << endl; + cerr << endl << ">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier diff ..." << endl; return; } fourierData.Transform(fFourier.fApodization); @@ -3800,7 +3917,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].data, fData[0].data->GetBinCenter(i)); } fDataAvg.data->SetBinContent(i, dval/fData.size()); } @@ -3814,7 +3931,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].dataFourierRe, fData[0].dataFourierRe->GetBinCenter(i)); } fDataAvg.dataFourierRe->SetBinContent(i, dval/fData.size()); } @@ -3828,7 +3945,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].dataFourierIm, fData[0].dataFourierIm->GetBinCenter(i)); } fDataAvg.dataFourierIm->SetBinContent(i, dval/fData.size()); } @@ -3842,7 +3959,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].dataFourierPwr, fData[0].dataFourierPwr->GetBinCenter(i)); } fDataAvg.dataFourierPwr->SetBinContent(i, dval/fData.size()); } @@ -3856,7 +3973,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].dataFourierPhase, fData[0].dataFourierPhase->GetBinCenter(i)); } fDataAvg.dataFourierPhase->SetBinContent(i, dval/fData.size()); } @@ -3870,7 +3987,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].theory, fData[0].theory->GetBinCenter(i)); } fDataAvg.theory->SetBinContent(i, dval/fData.size()); } @@ -3880,7 +3997,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].theoryFourierRe, fData[0].theoryFourierRe->GetBinCenter(i)); } fDataAvg.theoryFourierRe->SetBinContent(i, dval/fData.size()); } @@ -3894,7 +4011,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].theoryFourierIm, fData[0].theoryFourierIm->GetBinCenter(i)); } fDataAvg.theoryFourierIm->SetBinContent(i, dval/fData.size()); } @@ -3908,7 +4025,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].theoryFourierPwr, fData[0].theoryFourierPwr->GetBinCenter(i)); } fDataAvg.theoryFourierPwr->SetBinContent(i, dval/fData.size()); } @@ -3922,7 +4039,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].theoryFourierPhase, fData[0].theoryFourierPhase->GetBinCenter(i)); } fDataAvg.theoryFourierPhase->SetBinContent(i, dval/fData.size()); } @@ -3936,7 +4053,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].diff, fData[0].diff->GetBinCenter(i)); } fDataAvg.diff->SetBinContent(i, dval/fData.size()); } @@ -3950,7 +4067,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].diffFourierRe, fData[0].diffFourierRe->GetBinCenter(i)); } fDataAvg.diffFourierRe->SetBinContent(i, dval/fData.size()); } @@ -3964,7 +4081,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].diffFourierIm, fData[0].diffFourierIm->GetBinCenter(i)); } fDataAvg.diffFourierIm->SetBinContent(i, dval/fData.size()); } @@ -3978,7 +4095,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].diffFourierPwr, fData[0].diffFourierPwr->GetBinCenter(i)); } fDataAvg.diffFourierPwr->SetBinContent(i, dval/fData.size()); } @@ -3992,7 +4109,7 @@ void PMusrCanvas::HandleAverage() for (Int_t i=0; iGetNbinsX(); i++) { dval = 0.0; for (UInt_t j=0; jGetBinContent(i)); + dval += GetInterpolatedValue(fData[j].diffFourierPhase, fData[0].diffFourierPhase->GetBinCenter(i)); } fDataAvg.diffFourierPhase->SetBinContent(i, dval/fData.size()); } @@ -4596,14 +4713,14 @@ void PMusrCanvas::PlotData(Bool_t unzoom) fDataTheoryPad->SetLogy(1); // set x-axis label - fHistoFrame->GetXaxis()->SetTitle("time (#mus)"); + fHistoFrame->GetXaxis()->SetTitle("Time (#mus)"); // set y-axis label TString yAxisTitle; PMsrRunList *runList = fMsrHandler->GetMsrRunList(); switch (fPlotType) { case MSR_PLOT_SINGLE_HISTO: if (runList->at(0).IsLifetimeCorrected()) { // lifetime correction - yAxisTitle = "asymmetry"; + yAxisTitle = "Asymmetry"; } else { // no liftime correction if (fScaleN0AndBkg) yAxisTitle = "N(t) per nsec"; @@ -4611,8 +4728,12 @@ void PMusrCanvas::PlotData(Bool_t unzoom) yAxisTitle = "N(t) per bin"; } break; + case MSR_PLOT_SINGLE_HISTO_RRF: + case MSR_PLOT_ASYM_RRF: + yAxisTitle = "RRF Asymmetry"; + break; case MSR_PLOT_ASYM: - yAxisTitle = "asymmetry"; + yAxisTitle = "Asymmetry"; break; case MSR_PLOT_MU_MINUS: yAxisTitle = "N(t) per bin"; @@ -4728,18 +4849,22 @@ void PMusrCanvas::PlotData(Bool_t unzoom) // add all data to fMultiGraphData for (UInt_t i=0; iSetEditable(false); fMultiGraphData->Add(ge, "p"); } // add all the theory to fMultiGraphData for (UInt_t i=0; iSetEditable(false); fMultiGraphData->Add(ge, "l"); } @@ -4784,6 +4909,11 @@ void PMusrCanvas::PlotData(Bool_t unzoom) if (fMultiGraphLegend) fMultiGraphLegend->Draw(); } + + // report canvas status events in non-musr plots + if (!fMainCanvas->GetShowEventStatus()) { + fMainCanvas->ToggleEventStatus(); + } } fDataTheoryPad->Update(); @@ -4966,10 +5096,12 @@ void PMusrCanvas::PlotDifference(Bool_t unzoom) // add all diff data to fMultiGraphDiff for (UInt_t i=0; iSetEditable(false); fMultiGraphDiff->Add(ge, "p"); } @@ -6043,6 +6175,11 @@ void PMusrCanvas::PlotAverage(Bool_t unzoom) break; } + // check if RRF and if yes show a label + if ((fRRFText != 0) && (fRRFLatexText != 0)) { + fRRFLatexText->DrawLatex(0.1, 0.92, fRRFText->Data()); + } + fDataTheoryPad->Update(); fMainCanvas->cd(); diff --git a/src/classes/PMusrT0.cpp b/src/classes/PMusrT0.cpp index dfedb61d..c13414fc 100644 --- a/src/classes/PMusrT0.cpp +++ b/src/classes/PMusrT0.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PPrepFourier.cpp b/src/classes/PPrepFourier.cpp index cf077229..a28bc29f 100644 --- a/src/classes/PPrepFourier.cpp +++ b/src/classes/PPrepFourier.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -27,6 +27,8 @@ * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ +#include + #include "PPrepFourier.h" //-------------------------------------------------------------------------- @@ -48,10 +50,11 @@ PPrepFourier::PPrepFourier() /** *

Constructor. */ -PPrepFourier::PPrepFourier(const Int_t *bkgRange, const Int_t packing) : +PPrepFourier::PPrepFourier(const Int_t packing, const Int_t *bkgRange, PDoubleVector bkg) : fPacking(packing) { SetBkgRange(bkgRange); + SetBkg(bkg); } //-------------------------------------------------------------------------- @@ -76,7 +79,7 @@ PPrepFourier::~PPrepFourier() */ void PPrepFourier::SetBkgRange(const Int_t *bkgRange) { - int err=0; + Int_t err=0; if (bkgRange[0] >= -1) { fBkgRange[0] = bkgRange[0]; } else { @@ -112,6 +115,20 @@ void PPrepFourier::SetBkgRange(const Int_t *bkgRange) } } +//-------------------------------------------------------------------------- +// SetBkgRange +//-------------------------------------------------------------------------- +/** + *

set the background values for all the histos. + * + * \param bkg vector + */ +void PPrepFourier::SetBkg(PDoubleVector bkg) +{ + for (UInt_t i=0; i= fRawData[i].rawData.size()) || (fBkgRange[1] >= fRawData[i].rawData.size())) { - cerr << endl << "PPrepFourier::DoBkgCorrection() **ERROR** bkg-range out of data-range!"; + if ((fBkgRange[0] != -1) && (fBkgRange[1] != -1)) { // background range is given + // make sure that the bkg range is ok + for (UInt_t i=0; i= (Int_t)fRawData[i].rawData.size()) || (fBkgRange[1] >= (Int_t)fRawData[i].rawData.size())) { + cerr << endl << "PPrepFourier::DoBkgCorrection() **ERROR** bkg-range out of data-range!"; + return; + } + } + + Double_t bkg=0.0; + for (UInt_t i=0; i background " << i << ": " << bkg << endl; + + // correct data + for (UInt_t j=0; jNot implemented yet. - */ -void PPrepFourier::DoFiltering() -{ - // make sure fData are already present, and if not create the necessary data sets - if (fData.size() != fRawData.size()) { - InitData(); - } -} - //-------------------------------------------------------------------------- // DoLifeTimeCorrection //-------------------------------------------------------------------------- @@ -251,9 +271,9 @@ void PPrepFourier::DoLifeTimeCorrection(Double_t fudge) // calc exp(+t/tau)*N(t), where N(t) is already background corrected Double_t scale; - for (unsigned int i=0; iReturns the data set tag of the object + * + * \param idx index of the object + */ +Int_t PPrepFourier::GetDataSetTag(const UInt_t idx) +{ + Int_t result = -1; + + if (idx < fRawData.size()) + result = fRawData[idx].dataSetTag; + + return result; +} + //-------------------------------------------------------------------------- // GetData //-------------------------------------------------------------------------- @@ -317,7 +355,7 @@ vector PPrepFourier::GetData() UInt_t startIdx; UInt_t endIdx; - for (unsigned int i=0; i PPrepFourier::GetData() } data[i] = new TH1F(name.Data(), fRawData[i].info.Data(), size, start, end); - for (unsigned int j=startIdx; jSetBinContent(j-startIdx+1, fData[i][j]); } @@ -410,14 +448,14 @@ TH1F *PPrepFourier::GetData(const UInt_t idx) } TH1F *data = new TH1F(name.Data(), fRawData[idx].info.Data(), size, start, end); - for (unsigned int i=startIdx; iSetBinContent(i-startIdx+1, fData[idx][i]); return data; } //-------------------------------------------------------------------------- -// InitData +// InitData (private) //-------------------------------------------------------------------------- /** *

Copy raw-data to internal data from t0 to the size of raw-data. @@ -425,13 +463,13 @@ TH1F *PPrepFourier::GetData(const UInt_t idx) void PPrepFourier::InitData() { fData.resize(fRawData.size()); - unsigned int t0; - for (unsigned int i=0; i= 0) t0 = fRawData[i].t0; else t0 = 0; - for (unsigned int j=t0; jGetMsrGlobal()->GetPacking(); } if (fPacking == -1) { // this should NOT happen, somethin is severely wrong - cerr << endl << ">> PRunAsymmetry::PRunAsymmetry: **SEVERE ERROR**: Couldn't find any packing information!"; + cerr << endl << ">> PRunAsymmetry::PRunAsymmetry(): **SEVERE ERROR**: Couldn't find any packing information!"; cerr << endl << ">> This is very bad :-(, will quit ..."; cerr << endl; fValid = false; @@ -342,7 +342,7 @@ void PRunAsymmetry::SetFitRangeBin(const TString fitRange) Int_t pos = 2*(fRunNo+1)-1; if (pos + 1 >= tok->GetEntries()) { - cerr << endl << ">> PRunSingleHisto::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; + cerr << endl << ">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; cerr << endl << ">> will ignore it. Sorry ..." << endl; } else { // handle fgb+n0 entry @@ -370,7 +370,7 @@ void PRunAsymmetry::SetFitRangeBin(const TString fitRange) fFitEndTime = (fGoodBins[1] - offset - fT0s[0]) * fTimeResolution; } } else { // error - cerr << endl << ">> PRunSingleHisto::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; + cerr << endl << ">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; cerr << endl << ">> will ignore it. Sorry ..." << endl; } diff --git a/src/classes/PRunAsymmetryRRF.cpp b/src/classes/PRunAsymmetryRRF.cpp new file mode 100644 index 00000000..7e7f21df --- /dev/null +++ b/src/classes/PRunAsymmetryRRF.cpp @@ -0,0 +1,1511 @@ +/*************************************************************************** + + PRunAsymmetryRRF.cpp + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2016 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_GOMP +#include +#endif + +#include + +#include +#include +using namespace std; + +#include +#include +#include + +#include "PMusr.h" +#include "PRunAsymmetryRRF.h" + +//-------------------------------------------------------------------------- +// Constructor +//-------------------------------------------------------------------------- +/** + *

Constructor + */ +PRunAsymmetryRRF::PRunAsymmetryRRF() : PRunBase() +{ + fNoOfFitBins = 0; + fRRFPacking = -1; + + // the 2 following variables are need in case fit range is given in bins, and since + // the fit range can be changed in the command block, these variables need to be accessible + fGoodBins[0] = -1; + fGoodBins[1] = -1; +} + +//-------------------------------------------------------------------------- +// Constructor +//-------------------------------------------------------------------------- +/** + *

Constructor + * + * \param msrInfo pointer to the msr-file handler + * \param rawData raw run data + * \param runNo number of the run within the msr-file + * \param tag tag showing what shall be done: kFit == fitting, kView == viewing + */ +PRunAsymmetryRRF::PRunAsymmetryRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) +{ + // the 2 following variables are need in case fit range is given in bins, and since + // the fit range can be changed in the command block, these variables need to be accessible + fGoodBins[0] = -1; + fGoodBins[1] = -1; + + fRRFPacking = fMsrInfo->GetMsrGlobal()->GetRRFPacking(); + if (fRRFPacking == -1) { // this should NOT happen, somethin is severely wrong + cerr << endl << ">> PRunAsymmetryRRF::PRunAsymmetryRRF(): **SEVERE ERROR**: Couldn't find any RRF packing information!"; + cerr << endl << ">> This is very bad :-(, will quit ..."; + cerr << endl; + fValid = false; + return; + } + + // check if alpha and/or beta is fixed -------------------- + + PMsrParamList *param = msrInfo->GetMsrParamList(); + + // check if alpha is given + if (fRunInfo->GetAlphaParamNo() == -1) { // no alpha given + cerr << endl << ">> PRunAsymmetryRRF::PRunAsymmetryRRF(): **ERROR** no alpha parameter given! This is needed for an asymmetry fit!"; + cerr << endl; + fValid = false; + return; + } + // check if alpha parameter is within proper bounds + if ((fRunInfo->GetAlphaParamNo() < 0) || (fRunInfo->GetAlphaParamNo() > (Int_t)param->size())) { + cerr << endl << ">> PRunAsymmetryRRF::PRunAsymmetryRRF(): **ERROR** alpha parameter no = " << fRunInfo->GetAlphaParamNo(); + cerr << endl << ">> This is out of bound, since there are only " << param->size() << " parameters."; + cerr << endl; + fValid = false; + return; + } + // check if alpha is fixed + Bool_t alphaFixedToOne = false; + if (((*param)[fRunInfo->GetAlphaParamNo()-1].fStep == 0.0) && + ((*param)[fRunInfo->GetAlphaParamNo()-1].fValue == 1.0)) + alphaFixedToOne = true; + + // check if beta is given + Bool_t betaFixedToOne = false; + if (fRunInfo->GetBetaParamNo() == -1) { // no beta given hence assuming beta == 1 + betaFixedToOne = true; + } else if ((fRunInfo->GetBetaParamNo() < 0) || (fRunInfo->GetBetaParamNo() > (Int_t)param->size())) { // check if beta parameter is within proper bounds + cerr << endl << ">> PRunAsymmetryRRF::PRunAsymmetryRRF(): **ERROR** beta parameter no = " << fRunInfo->GetBetaParamNo(); + cerr << endl << ">> This is out of bound, since there are only " << param->size() << " parameters."; + cerr << endl; + fValid = false; + return; + } else { // check if beta is fixed + if (((*param)[fRunInfo->GetBetaParamNo()-1].fStep == 0.0) && + ((*param)[fRunInfo->GetBetaParamNo()-1].fValue == 1.0)) + betaFixedToOne = true; + } + + // set fAlphaBetaTag + if (alphaFixedToOne && betaFixedToOne) // alpha == 1, beta == 1 + fAlphaBetaTag = 1; + else if (!alphaFixedToOne && betaFixedToOne) // alpha != 1, beta == 1 + fAlphaBetaTag = 2; + else if (alphaFixedToOne && !betaFixedToOne) // alpha == 1, beta != 1 + fAlphaBetaTag = 3; + else + fAlphaBetaTag = 4; + + // calculate fData + if (!PrepareData()) + fValid = false; +} + +//-------------------------------------------------------------------------- +// Destructor +//-------------------------------------------------------------------------- +/** + *

Destructor. + */ +PRunAsymmetryRRF::~PRunAsymmetryRRF() +{ + fForward.clear(); + fForwardErr.clear(); + fBackward.clear(); + fBackwardErr.clear(); +} + +//-------------------------------------------------------------------------- +// CalcChiSquare (public) +//-------------------------------------------------------------------------- +/** + *

Calculate chi-square. + * + * return: + * - chisq value + * + * \param par parameter vector iterated by minuit2 + */ +Double_t PRunAsymmetryRRF::CalcChiSquare(const std::vector& par) +{ + Double_t chisq = 0.0; + Double_t diff = 0.0; + Double_t asymFcnValue = 0.0; + Double_t a, b, f; + + // calculate functions + for (Int_t i=0; iGetNoOfFuncs(); i++) { + fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par); + } + + // calculate chi square + Double_t time(1.0); + Int_t i, N(static_cast(fData.GetValue()->size())); + + // In order not to have an IF in the next loop, determine the start and end bins for the fit range now + Int_t startTimeBin = static_cast(ceil((fFitStartTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())); + if (startTimeBin < 0) + startTimeBin = 0; + Int_t endTimeBin = static_cast(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1; + if (endTimeBin > N) + endTimeBin = N; + + // Calculate the theory function once to ensure one function evaluation for the current set of parameters. + // This is needed for the LF and user functions where some non-thread-save calculations only need to be calculated once + // for a given set of parameters---which should be done outside of the parallelized loop. + // For all other functions it means a tiny and acceptable overhead. + asymFcnValue = fTheory->Func(time, par, fFuncValues); + + #ifdef HAVE_GOMP + Int_t chunk = (endTimeBin - startTimeBin)/omp_get_num_procs(); + if (chunk < 10) + chunk = 10; + #pragma omp parallel for default(shared) private(i,time,diff,asymFcnValue,a,b,f) schedule(dynamic,chunk) reduction(+:chisq) + #endif + for (i=startTimeBin; iFunc(time, par, fFuncValues); + break; + case 2: // alpha != 1, beta == 1 + a = par[fRunInfo->GetAlphaParamNo()-1]; + f = fTheory->Func(time, par, fFuncValues); + asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0)); + break; + case 3: // alpha == 1, beta != 1 + b = par[fRunInfo->GetBetaParamNo()-1]; + f = fTheory->Func(time, par, fFuncValues); + asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0)); + break; + case 4: // alpha != 1, beta != 1 + a = par[fRunInfo->GetAlphaParamNo()-1]; + b = par[fRunInfo->GetBetaParamNo()-1]; + f = fTheory->Func(time, par, fFuncValues); + asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0)); + break; + default: + asymFcnValue = 0.0; + break; + } + diff = fData.GetValue()->at(i) - asymFcnValue; + chisq += diff*diff / (fData.GetError()->at(i)*fData.GetError()->at(i)); + } + + return chisq; +} + +//-------------------------------------------------------------------------- +// CalcChiSquareExpected (public) +//-------------------------------------------------------------------------- +/** + *

Calculate expected chi-square. Currently not implemented since not clear what to be done. + * + * return: + * - chisq value == 0.0 + * + * \param par parameter vector iterated by minuit2 + */ +Double_t PRunAsymmetryRRF::CalcChiSquareExpected(const std::vector& par) +{ + return 0.0; +} + +//-------------------------------------------------------------------------- +// CalcMaxLikelihood (public) +//-------------------------------------------------------------------------- +/** + *

NOT IMPLEMENTED!! + * + * \param par parameter vector iterated by minuit2 + */ +Double_t PRunAsymmetryRRF::CalcMaxLikelihood(const std::vector& par) +{ + cout << endl << "PRunAsymmetryRRF::CalcMaxLikelihood(): not implemented yet ..." << endl; + + return 1.0; +} + +//-------------------------------------------------------------------------- +// GetNoOfFitBins (public) +//-------------------------------------------------------------------------- +/** + *

Calculate the number of fitted bins for the current fit range. + * + * return: number of fitted bins. + */ +UInt_t PRunAsymmetryRRF::GetNoOfFitBins() +{ + CalcNoOfFitBins(); + + return fNoOfFitBins; +} + +//-------------------------------------------------------------------------- +// SetFitRangeBin (public) +//-------------------------------------------------------------------------- +/** + *

Allows to change the fit range on the fly. Used in the COMMAND block. + * The syntax of the string is: FIT_RANGE fgb[+n00] lgb[-n01] [fgb[+n10] lgb[-n11] ... fgb[+nN0] lgb[-nN1]]. + * If only one pair of fgb/lgb is given, it is used for all runs in the RUN block section. + * If multiple fgb/lgb's are given, the number N has to be the number of RUN blocks in + * the msr-file. + * + *

nXY are offsets which can be used to shift, limit the fit range. + * + * \param fitRange string containing the necessary information. + */ +void PRunAsymmetryRRF::SetFitRangeBin(const TString fitRange) +{ + TObjArray *tok = 0; + TObjString *ostr = 0; + TString str; + Ssiz_t idx = -1; + Int_t offset = 0; + + tok = fitRange.Tokenize(" \t"); + + if (tok->GetEntries() == 3) { // structure FIT_RANGE fgb+n0 lgb-n1 + // handle fgb+n0 entry + ostr = (TObjString*) tok->At(1); + str = ostr->GetString(); + // check if there is an offset present + idx = str.First("+"); + if (idx != -1) { // offset present + str.Remove(0, idx+1); + if (str.IsFloat()) // if str is a valid number, convert is to an integer + offset = str.Atoi(); + } + fFitStartTime = (fGoodBins[0] + offset - fT0s[0]) * fTimeResolution; + + // handle lgb-n1 entry + ostr = (TObjString*) tok->At(2); + str = ostr->GetString(); + // check if there is an offset present + idx = str.First("-"); + if (idx != -1) { // offset present + str.Remove(0, idx+1); + if (str.IsFloat()) // if str is a valid number, convert is to an integer + offset = str.Atoi(); + } + fFitEndTime = (fGoodBins[1] - offset - fT0s[0]) * fTimeResolution; + } else if ((tok->GetEntries() > 3) && (tok->GetEntries() % 2 == 1)) { // structure FIT_RANGE fgb[+n00] lgb[-n01] [fgb[+n10] lgb[-n11] ... fgb[+nN0] lgb[-nN1]] + Int_t pos = 2*(fRunNo+1)-1; + + if (pos + 1 >= tok->GetEntries()) { + cerr << endl << ">> PRunSingleHisto::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; + cerr << endl << ">> will ignore it. Sorry ..." << endl; + } else { + // handle fgb+n0 entry + ostr = (TObjString*) tok->At(pos); + str = ostr->GetString(); + // check if there is an offset present + idx = str.First("+"); + if (idx != -1) { // offset present + str.Remove(0, idx+1); + if (str.IsFloat()) // if str is a valid number, convert is to an integer + offset = str.Atoi(); + } + fFitStartTime = (fGoodBins[0] + offset - fT0s[0]) * fTimeResolution; + + // handle lgb-n1 entry + ostr = (TObjString*) tok->At(pos+1); + str = ostr->GetString(); + // check if there is an offset present + idx = str.First("-"); + if (idx != -1) { // offset present + str.Remove(0, idx+1); + if (str.IsFloat()) // if str is a valid number, convert is to an integer + offset = str.Atoi(); + } + fFitEndTime = (fGoodBins[1] - offset - fT0s[0]) * fTimeResolution; + } + } else { // error + cerr << endl << ">> PRunSingleHisto::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; + cerr << endl << ">> will ignore it. Sorry ..." << endl; + } + + // clean up + if (tok) { + delete tok; + } +} + +//-------------------------------------------------------------------------- +// CalcNoOfFitBins (protected) +//-------------------------------------------------------------------------- +/** + *

Calculate the number of fitted bins for the current fit range. + */ +void PRunAsymmetryRRF::CalcNoOfFitBins() +{ + // In order not having to loop over all bins and to stay consistent with the chisq method, calculate the start and end bins explicitly + Int_t startTimeBin = static_cast(ceil((fFitStartTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())); + if (startTimeBin < 0) + startTimeBin = 0; + Int_t endTimeBin = static_cast(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1; + if (endTimeBin > static_cast(fData.GetValue()->size())) + endTimeBin = fData.GetValue()->size(); + + if (endTimeBin > startTimeBin) + fNoOfFitBins = endTimeBin - startTimeBin; + else + fNoOfFitBins = 0; +} + +//-------------------------------------------------------------------------- +// CalcTheory (protected) +//-------------------------------------------------------------------------- +/** + *

Calculate theory for a given set of fit-parameters. + */ +void PRunAsymmetryRRF::CalcTheory() +{ + // feed the parameter vector + std::vector par; + PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); + for (UInt_t i=0; isize(); i++) + par.push_back((*paramList)[i].fValue); + + // calculate functions + for (Int_t i=0; iGetNoOfFuncs(); i++) { + fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par); + } + + // calculate asymmetry + Double_t asymFcnValue = 0.0; + Double_t a, b, f; + Double_t time; + for (UInt_t i=0; isize(); i++) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); + switch (fAlphaBetaTag) { + case 1: // alpha == 1, beta == 1 + asymFcnValue = fTheory->Func(time, par, fFuncValues); + break; + case 2: // alpha != 1, beta == 1 + a = par[fRunInfo->GetAlphaParamNo()-1]; + f = fTheory->Func(time, par, fFuncValues); + asymFcnValue = (f*(a+1.0)-(a-1.0))/((a+1.0)-f*(a-1.0)); + break; + case 3: // alpha == 1, beta != 1 + b = par[fRunInfo->GetBetaParamNo()-1]; + f = fTheory->Func(time, par, fFuncValues); + asymFcnValue = f*(b+1.0)/(2.0-f*(b-1.0)); + break; + case 4: // alpha != 1, beta != 1 + a = par[fRunInfo->GetAlphaParamNo()-1]; + b = par[fRunInfo->GetBetaParamNo()-1]; + f = fTheory->Func(time, par, fFuncValues); + asymFcnValue = (f*(a*b+1.0)-(a-1.0))/((a+1.0)-f*(a*b-1.0)); + break; + default: + asymFcnValue = 0.0; + break; + } + fData.AppendTheoryValue(asymFcnValue); + } + + // clean up + par.clear(); +} + +//-------------------------------------------------------------------------- +// PrepareData (protected) +//-------------------------------------------------------------------------- +/** + *

Prepare data for fitting or viewing. What is already processed at this stage: + * - get all needed forward/backward histograms + * - get time resolution + * - get start/stop fit time + * - get t0's and perform necessary cross checks (e.g. if t0 of msr-file (if present) are consistent with t0 of the data files, etc.) + * - add runs (if addruns are present) + * - group histograms (if grouping is present) + * - subtract background + * + * Error propagation for \f$ A_i = (f_i^{\rm c}-b_i^{\rm c})/(f_i^{\rm c}+b_i^{\rm c})\f$: + * \f[ \Delta A_i = \pm\frac{2}{(f_i^{\rm c}+b_i^{\rm c})^2}\left[ + * (b_i^{\rm c})^2 (\Delta f_i^{\rm c})^2 + + * (\Delta b_i^{\rm c})^2 (f_i^{\rm c})^2\right]^{1/2}\f] + * + * return: + * - true if everthing went smooth + * - false, otherwise. + */ +Bool_t PRunAsymmetryRRF::PrepareData() +{ + // keep the Global block info + PMsrGlobalBlock *globalBlock = fMsrInfo->GetMsrGlobal(); + + // get forward/backward histo from PRunDataHandler object ------------------------ + // get the correct run + PRawRunData *runData = fRawData->GetRunData(*(fRunInfo->GetRunName())); + if (!runData) { // run not found + cerr << endl << ">> PRunAsymmetryRRF::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->GetRunName()->Data() << "!"; + cerr << endl; + return false; + } + + // collect histogram numbers + PUIntVector forwardHistoNo; + PUIntVector backwardHistoNo; + for (UInt_t i=0; iGetForwardHistoNoSize(); i++) { + forwardHistoNo.push_back(fRunInfo->GetForwardHistoNo(i)); + + if (!runData->IsPresent(forwardHistoNo[i])) { + cerr << endl << ">> PRunAsymmetryRRF::PrepareData(): **PANIC ERROR**:"; + cerr << endl << ">> forwardHistoNo found = " << forwardHistoNo[i] << ", which is NOT present in the data file!?!?"; + cerr << endl << ">> Will quit :-("; + cerr << endl; + // clean up + forwardHistoNo.clear(); + backwardHistoNo.clear(); + return false; + } + } + for (UInt_t i=0; iGetBackwardHistoNoSize(); i++) { + backwardHistoNo.push_back(fRunInfo->GetBackwardHistoNo(i)); + + if (!runData->IsPresent(backwardHistoNo[i])) { + cerr << endl << ">> PRunAsymmetryRRF::PrepareData(): **PANIC ERROR**:"; + cerr << endl << ">> backwardHistoNo found = " << backwardHistoNo[i] << ", which is NOT present in the data file!?!?"; + cerr << endl << ">> Will quit :-("; + cerr << endl; + // clean up + forwardHistoNo.clear(); + backwardHistoNo.clear(); + return false; + } + } + if (forwardHistoNo.size() != backwardHistoNo.size()) { + cerr << endl << ">> PRunAsymmetryRRF::PrepareData(): **PANIC ERROR**:"; + cerr << endl << ">> # of forward histograms different from # of backward histograms."; + cerr << endl << ">> Will quit :-("; + cerr << endl; + // clean up + forwardHistoNo.clear(); + backwardHistoNo.clear(); + return false; + } + + // keep the time resolution in (us) + fTimeResolution = runData->GetTimeResolution()/1.0e3; + cout.precision(10); + cout << endl << ">> PRunAsymmetryRRF::PrepareData(): time resolution=" << fixed << runData->GetTimeResolution() << "(ns)" << endl; + + // get all the proper t0's and addt0's for the current RUN block + if (!GetProperT0(runData, globalBlock, forwardHistoNo, backwardHistoNo)) { + return false; + } + + // keep the histo of each group at this point (addruns handled below) + vector forward, backward; + forward.resize(forwardHistoNo.size()); // resize to number of groups + backward.resize(backwardHistoNo.size()); // resize to numer of groups + for (UInt_t i=0; iGetDataBin(forwardHistoNo[i])->size()); + backward[i].resize(runData->GetDataBin(backwardHistoNo[i])->size()); + forward[i] = *runData->GetDataBin(forwardHistoNo[i]); + backward[i] = *runData->GetDataBin(backwardHistoNo[i]); + } + + // check if addrun's are present, and if yes add data + // check if there are runs to be added to the current one + if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present + PRawRunData *addRunData; + for (UInt_t i=1; iGetRunNameSize(); i++) { + // get run to be added to the main one + addRunData = fRawData->GetRunData(*(fRunInfo->GetRunName(i))); + if (addRunData == 0) { // couldn't get run + cerr << endl << ">> PRunAsymmetryRRF::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!"; + cerr << endl; + return false; + } + + // add forward run + UInt_t addRunSize; + for (UInt_t k=0; kGetDataBin(forwardHistoNo[k])->size(); + for (UInt_t j=0; jGetDataBin(forwardHistoNo[k])->size(); j++) { // loop over the bin indices + // make sure that the index stays in the proper range + if ((j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k] < addRunSize)) { + forward[k][j] += addRunData->GetDataBin(forwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k]-(Int_t)fT0s[2*k]); + } + } + } + + // add backward run + for (UInt_t k=0; kGetDataBin(backwardHistoNo[k])->size(); + for (UInt_t j=0; jGetDataBin(backwardHistoNo[k])->size(); j++) { // loop over the bin indices + // make sure that the index stays in the proper range + if ((j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] >= 0) && (j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1] < addRunSize)) { + backward[k][j] += addRunData->GetDataBin(backwardHistoNo[k])->at(j+(Int_t)fAddT0s[i-1][2*k+1]-(Int_t)fT0s[2*k+1]); + } + } + } + } + } + + // set forward/backward histo data of the first group + fForward.resize(forward[0].size()); + fBackward.resize(backward[0].size()); + for (UInt_t i=0; iGetDataBin(forwardHistoNo[i])->size(); j++) { // loop over the bin indices + // make sure that the index stays within proper range + if ((j+fT0s[2*i]-fT0s[0] >= 0) && (j+fT0s[2*i]-fT0s[0] < runData->GetDataBin(forwardHistoNo[i])->size())) { + fForward[j] += forward[i][j+(Int_t)fT0s[2*i]-(Int_t)fT0s[0]]; + } + } + } + + // group histograms, add all the remaining backward histograms of the group + for (UInt_t i=1; iGetDataBin(backwardHistoNo[i])->size(); j++) { // loop over the bin indices + // make sure that the index stays within proper range + if ((j+fT0s[2*i+1]-fT0s[1] >= 0) && (j+fT0s[2*i+1]-fT0s[1] < runData->GetDataBin(backwardHistoNo[i])->size())) { + fBackward[j] += backward[i][j+(Int_t)fT0s[2*i+1]-(Int_t)fT0s[1]]; + } + } + } + + // subtract background from histogramms ------------------------------------------ + if (fRunInfo->GetBkgFix(0) == PMUSR_UNDEFINED) { // no fixed background given + if (fRunInfo->GetBkgRange(0) >= 0) { // background range given + if (!SubtractEstimatedBkg()) + return false; + } else { // no background given to do the job, try to estimate it + fRunInfo->SetBkgRange(static_cast(fT0s[0]*0.1), 0); + fRunInfo->SetBkgRange(static_cast(fT0s[0]*0.6), 1); + fRunInfo->SetBkgRange(static_cast(fT0s[1]*0.1), 2); + fRunInfo->SetBkgRange(static_cast(fT0s[1]*0.6), 3); + cerr << endl << ">> PRunAsymmetryRRF::PrepareData(): **WARNING** Neither fix background nor background bins are given!"; + cerr << endl << ">> Will try the following:"; + cerr << endl << ">> forward: bkg start = " << fRunInfo->GetBkgRange(0) << ", bkg end = " << fRunInfo->GetBkgRange(1); + cerr << endl << ">> backward: bkg start = " << fRunInfo->GetBkgRange(2) << ", bkg end = " << fRunInfo->GetBkgRange(3); + cerr << endl << ">> NO WARRANTY THAT THIS MAKES ANY SENSE! Better check ..."; + cerr << endl; + if (!SubtractEstimatedBkg()) + return false; + } + } else { // fixed background given + if (!SubtractFixBkg()) + return false; + } + + UInt_t histoNo[2] = {forwardHistoNo[0], backwardHistoNo[0]}; + + // get the data range (fgb/lgb) for the current RUN block + if (!GetProperDataRange(runData, histoNo)) { + return false; + } + + // get the fit range for the current RUN block + GetProperFitRange(globalBlock); + + // everything looks fine, hence fill data set + Bool_t status; + switch(fHandleTag) { + case kFit: + status = PrepareFitData(); + break; + case kView: + status = PrepareViewData(runData, histoNo); + break; + default: + status = false; + break; + } + + // clean up + forwardHistoNo.clear(); + backwardHistoNo.clear(); + + return status; +} + +//-------------------------------------------------------------------------- +// SubtractFixBkg (private) +//-------------------------------------------------------------------------- +/** + *

Subtracts a fixed background from the raw data. The background is given + * in units of (1/bin); for the Asymmetry representation (1/ns) doesn't make too much sense. + * The error propagation is done the following way: it is assumed that the error of the background + * is Poisson like, i.e. \f$\Delta\mathrm{bkg} = \sqrt{\mathrm{bkg}}\f$. + * + * Error propagation: + * \f[ \Delta f_i^{\rm c} = \pm\left[ (\Delta f_i)^2 + (\Delta \mathrm{bkg})^2 \right]^{1/2} = + * \pm\left[ f_i + \mathrm{bkg} \right]^{1/2}, \f] + * where \f$ f_i^{\rm c} \f$ is the background corrected histogram, \f$ f_i \f$ the raw histogram + * and \f$ \mathrm{bkg} \f$ the fix given background. + * + * return: + * - true + * + */ +Bool_t PRunAsymmetryRRF::SubtractFixBkg() +{ + Double_t dval; + for (UInt_t i=0; iGetBkgFix(0); + + // keep the error, and make sure that the bin is NOT empty + if (fBackward[i] != 0.0) + dval = TMath::Sqrt(fBackward[i]); + else + dval = 1.0; + fBackwardErr.push_back(dval); + fBackward[i] -= fRunInfo->GetBkgFix(1); + } + + return true; +} + +//-------------------------------------------------------------------------- +// SubtractEstimatedBkg (private) +//-------------------------------------------------------------------------- +/** + *

Subtracts the background which is estimated from a given interval (typically before t0). + * + * The background corrected histogramms are: + * \f$ f_i^{\rm c} = f_i - \mathrm{bkg} \f$, where \f$ f_i \f$ is the raw data histogram, + * \f$ \mathrm{bkg} \f$ the background estimate, and \f$ f_i^{\rm c} \f$ background corrected + * histogram. The error on \f$ f_i^{\rm c} \f$ is + * \f[ \Delta f_i^{\rm c} = \pm \sqrt{ (\Delta f_i)^2 + (\Delta \mathrm{bkg})^2 } = + * \pm \sqrt{f_i + (\Delta \mathrm{bkg})^2} \f] + * The background error \f$ \Delta \mathrm{bkg} \f$ is + * \f[ \Delta \mathrm{bkg} = \pm\frac{1}{N}\left[\sum_{i=0}^N (\Delta f_i)^2\right]^{1/2} = + * \pm\frac{1}{N}\left[\sum_{i=0}^N f_i \right]^{1/2},\f] + * where \f$N\f$ is the number of bins over which the background is formed. + * + * return: + * - true + */ +Bool_t PRunAsymmetryRRF::SubtractEstimatedBkg() +{ + Double_t beamPeriod = 0.0; + + // check if data are from PSI, RAL, or TRIUMF + if (fRunInfo->GetInstitute()->Contains("psi")) + beamPeriod = ACCEL_PERIOD_PSI; + else if (fRunInfo->GetInstitute()->Contains("ral")) + beamPeriod = ACCEL_PERIOD_RAL; + else if (fRunInfo->GetInstitute()->Contains("triumf")) + beamPeriod = ACCEL_PERIOD_TRIUMF; + else + beamPeriod = 0.0; + + // check if start and end are in proper order + UInt_t start[2] = {fRunInfo->GetBkgRange(0), fRunInfo->GetBkgRange(2)}; + UInt_t end[2] = {fRunInfo->GetBkgRange(1), fRunInfo->GetBkgRange(3)}; + for (UInt_t i=0; i<2; i++) { + if (end[i] < start[i]) { + cout << endl << "PRunAsymmetryRRF::SubtractEstimatedBkg(): end = " << end[i] << " > start = " << start[i] << "! Will swap them!"; + UInt_t keep = end[i]; + end[i] = start[i]; + start[i] = keep; + } + } + + // calculate proper background range + for (UInt_t i=0; i<2; i++) { + if (beamPeriod != 0.0) { + Double_t timeBkg = (Double_t)(end[i]-start[i])*fTimeResolution; // length of the background intervall in time + UInt_t fullCycles = (UInt_t)(timeBkg/beamPeriod); // how many proton beam cylces can be placed within the proposed background intervall + // correct the end of the background intervall such that the background is as close as possible to a multiple of the proton cylce + end[i] = start[i] + (UInt_t) ((fullCycles*beamPeriod)/fTimeResolution); + cout << "PRunAsymmetryRRF::SubtractEstimatedBkg(): Background " << start[i] << ", " << end[i] << endl; + if (end[i] == start[i]) + end[i] = fRunInfo->GetBkgRange(2*i+1); + } + } + + // check if start is within histogram bounds + if ((start[0] < 0) || (start[0] >= fForward.size()) || + (start[1] < 0) || (start[1] >= fBackward.size())) { + cerr << endl << ">> PRunAsymmetryRRF::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << ">> histo lengths (f/b) = (" << fForward.size() << "/" << fBackward.size() << ")."; + cerr << endl << ">> background start (f/b) = (" << start[0] << "/" << start[1] << ")."; + return false; + } + + // check if end is within histogram bounds + if ((end[0] < 0) || (end[0] >= fForward.size()) || + (end[1] < 0) || (end[1] >= fBackward.size())) { + cerr << endl << ">> PRunAsymmetryRRF::SubtractEstimatedBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << ">> histo lengths (f/b) = (" << fForward.size() << "/" << fBackward.size() << ")."; + cerr << endl << ">> background end (f/b) = (" << end[0] << "/" << end[1] << ")."; + return false; + } + + // calculate background + Double_t bkg[2] = {0.0, 0.0}; + Double_t errBkg[2] = {0.0, 0.0}; + + // forward + for (UInt_t i=start[0]; i<=end[0]; i++) + bkg[0] += fForward[i]; + errBkg[0] = TMath::Sqrt(bkg[0])/(end[0] - start[0] + 1); + bkg[0] /= static_cast(end[0] - start[0] + 1); + cout << endl << ">> estimated forward histo background: " << bkg[0]; + + // backward + for (UInt_t i=start[1]; i<=end[1]; i++) + bkg[1] += fBackward[i]; + errBkg[1] = TMath::Sqrt(bkg[1])/(end[1] - start[1] + 1); + bkg[1] /= static_cast(end[1] - start[1] + 1); + cout << endl << ">> estimated backward histo background: " << bkg[1] << endl; + + // correct error for forward, backward + Double_t errVal = 0.0; + for (UInt_t i=0; i 0.0) + errVal = TMath::Sqrt(fForward[i]+errBkg[0]*errBkg[0]); + else + errVal = 1.0; + fForwardErr.push_back(errVal); + if (fBackward[i] > 0.0) + errVal = TMath::Sqrt(fBackward[i]+errBkg[1]*errBkg[1]); + else + errVal = 1.0; + fBackwardErr.push_back(errVal); + } + + // subtract background from data + for (UInt_t i=0; iSetBkgEstimated(bkg[0], 0); + fRunInfo->SetBkgEstimated(bkg[1], 1); + + return true; +} + +//-------------------------------------------------------------------------- +// PrepareFitData (protected) +//-------------------------------------------------------------------------- +/** + *

Take the pre-processed data (i.e. grouping and addrun are preformed, background correction already carried out) + * and form the asymmetry for fitting. + */ +Bool_t PRunAsymmetryRRF::PrepareFitData() +{ + // transform raw histo data. At this point, the raw data are already background corrected. + + // 1st: form the asymmetry of the original data + + // forward and backward detectors might have different fgb-t0 offset. Take the maximum of both. + Int_t fgbOffset = fGoodBins[0]-(Int_t)fT0s[0]; + if (fgbOffset < fGoodBins[2]-(Int_t)fT0s[1]) + fgbOffset = fGoodBins[2]-(Int_t)fT0s[1]; + // last good bin (lgb) is the minimum of forward/backward lgb + Int_t lgb_offset = fGoodBins[1]-(Int_t)fT0s[0]+fgbOffset; + if (lgb_offset < fGoodBins[3]-(Int_t)fT0s[1]+fgbOffset) + lgb_offset = fGoodBins[3]-(Int_t)fT0s[1]+fgbOffset; + + Int_t fgb = (Int_t)fT0s[0]+fgbOffset; + Int_t lgb = fgb + lgb_offset; + Int_t dt0 = (Int_t)fT0s[0]-(Int_t)fT0s[1]; + + PDoubleVector asym; + PDoubleVector asymErr; + Double_t asymVal, asymValErr; + Double_t ff, bb, eff, ebb; + for (Int_t i=fgb; i 0.0) + asymValErr = 2.0/pow((ff+bb),2.0)*sqrt(bb*bb*eff*eff+ff*ff*ebb*ebb); + else + asymValErr = 1.0; + asymErr.push_back(asymValErr); + } + + // 2nd: a_rrf = a * 2*cos(w_rrf*t + phi_rrf) + PMsrGlobalBlock *globalBlock = fMsrInfo->GetMsrGlobal(); + Double_t wRRF = globalBlock->GetRRFFreq("Mc"); + Double_t phaseRRF = globalBlock->GetRRFPhase()*TMath::TwoPi()/180.0; + + Double_t startTime = fTimeResolution * (Double_t)fgbOffset; + Double_t time=0.0; + for (UInt_t i=0; iTake the pre-processed data (i.e. grouping and addrun are preformed) and form the asymmetry for view representation. + * Before forming the asymmetry, the following checks will be performed: + * -# check if view packing is whished. + * -# check if data range is given, if not try to estimate one. + * -# check that data range is present, that it makes any sense. + * -# check that 'first good bin'-'t0' is the same for forward and backward histogram. If not adjust it. + * -# pack data (rebin). + * -# if packed forward size != backward size, truncate the longer one such that an asymmetry can be formed. + * -# calculate the asymmetry: \f$ A_i = (\alpha f_i^c-b_i^c)/(\alpha \beta f_i^c+b_i^c) \f$ + * -# calculate the asymmetry errors: \f$ \delta A_i = 2 \sqrt{(b_i^c)^2 (\delta f_i^c)^2 + (\delta b_i^c)^2 (f_i^c)^2}/(f_i^c+b_i^c)^2\f$ + * -# calculate the theory vector. + * + * \param runData raw run data needed to perform some crosschecks + * \param histoNo histogram number (within a run). histoNo[0]: forward histogram number, histNo[1]: backward histogram number + */ +Bool_t PRunAsymmetryRRF::PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]) +{ + // feed the parameter vector + std::vector par; + PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); + for (UInt_t i=0; isize(); i++) + par.push_back((*paramList)[i].fValue); + + // first get start data, end data, and t0 + Int_t start[2] = {fGoodBins[0], fGoodBins[2]}; + Int_t end[2] = {fGoodBins[1], fGoodBins[3]}; + Int_t t0[2] = {(Int_t)fT0s[0], (Int_t)fT0s[1]}; + + // check if the data ranges and t0's between forward/backward are compatible + Int_t fgb[2]; + if (start[0]-t0[0] != start[1]-t0[1]) { // wrong fgb aligning + if (abs(start[0]-t0[0]) > abs(start[1]-t0[1])) { + fgb[0] = start[0]; + fgb[1] = t0[1] + start[0]-t0[0]; + cerr << endl << ">> PRunAsymmetryRRF::PrepareViewData(): **WARNING** needed to shift backward fgb from "; + cerr << start[1] << " to " << fgb[1] << endl; + } else { + fgb[0] = t0[0] + start[1]-t0[1]; + fgb[1] = start[1]; + cerr << endl << ">> PRunAsymmetryRRF::PrepareViewData(): **WARNING** needed to shift forward fgb from "; + cerr << start[0] << " to " << fgb[0] << endl; + } + } else { // fgb aligning is correct + fgb[0] = start[0]; + fgb[1] = start[1]; + } + start[0] = fgb[0]; + start[1] = fgb[1]; + + // make sure that there are equal number of bins in forward and backward + UInt_t noOfBins0 = runData->GetDataBin(histoNo[0])->size()-start[0]; + UInt_t noOfBins1 = runData->GetDataBin(histoNo[1])->size()-start[1]; + if (noOfBins0 > noOfBins1) + noOfBins0 = noOfBins1; + end[0] = start[0] + noOfBins0; + end[1] = start[1] + noOfBins0; + + // check if start, end, and t0 make any sense + for (UInt_t i=0; i<2; i++) { + // 1st check if start is within proper bounds + if ((start[i] < 0) || (start[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << ">> PRunAsymmetryRRF::PrepareViewData(): **ERROR** start data bin doesn't make any sense!"; + cerr << endl; + return false; + } + // 2nd check if end is within proper bounds + if ((end[i] < 0) || (end[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << ">> PRunAsymmetryRRF::PrepareViewData(): **ERROR** end data bin doesn't make any sense!"; + cerr << endl; + return false; + } + // 3rd check if t0 is within proper bounds + if ((t0[i] < 0) || (t0[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << ">> PRunAsymmetryRRF::PrepareViewData(): **ERROR** t0 data bin doesn't make any sense!"; + cerr << endl; + return false; + } + } + + // check if forward and backward histo have the same size, otherwise take the minimum size + UInt_t noOfBins = fForward.size(); + if (noOfBins > fBackward.size()) { + noOfBins = fBackward.size(); + } + + // form asymmetry including error propagation + Double_t asym, error; + Double_t f, b, ef, eb, alpha = 1.0, beta = 1.0; + + // get the proper alpha and beta + switch (fAlphaBetaTag) { + case 1: // alpha == 1, beta == 1 + alpha = 1.0; + beta = 1.0; + break; + case 2: // alpha != 1, beta == 1 + alpha = par[fRunInfo->GetAlphaParamNo()-1]; + beta = 1.0; + break; + case 3: // alpha == 1, beta != 1 + alpha = 1.0; + beta = par[fRunInfo->GetBetaParamNo()-1]; + break; + case 4: // alpha != 1, beta != 1 + alpha = par[fRunInfo->GetAlphaParamNo()-1]; + beta = par[fRunInfo->GetBetaParamNo()-1]; + break; + default: + break; + } + + PDoubleVector asymVec, asymErr; + Int_t dtBin = start[1]-start[0]; + for (Int_t i=start[0]; iGetMsrGlobal(); + Double_t wRRF = globalBlock->GetRRFFreq("Mc"); + Double_t phaseRRF = globalBlock->GetRRFPhase()*TMath::TwoPi()/180.0; + Double_t startTime=fTimeResolution*((Double_t)start[0]-t0[0]); + Double_t time = 0.0; + for (UInt_t i=0; iGetNoOfFuncs(); i++) { + fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par); + } + + // calculate theory + UInt_t size = runData->GetDataBin(histoNo[0])->size(); + Double_t factor = 1.0; + if (fData.GetValue()->size() * 10 > runData->GetDataBin(histoNo[0])->size()) { + size = fData.GetValue()->size() * 10; + factor = (Double_t)runData->GetDataBin(histoNo[0])->size() / (Double_t)size; + } + fData.SetTheoryTimeStart(fData.GetDataTimeStart()); + fData.SetTheoryTimeStep(fTimeResolution*factor); + for (UInt_t i=0; iFunc(time, par, fFuncValues); + if (fabs(dval) > 10.0) { // dirty hack needs to be fixed!! + dval = 0.0; + } + fData.AppendTheoryValue(dval); + } + + // clean up + par.clear(); + + return true; +} + +//-------------------------------------------------------------------------- +// GetProperT0 (private) +//-------------------------------------------------------------------------- +/** + *

Get the proper t0 for the single histogram run. + * -# the t0 vector size = number of detectors (grouping) for forward. + * -# initialize t0's with -1 + * -# fill t0's from RUN block + * -# if t0's are missing (i.e. t0 == -1), try to fill from the GLOBAL block. + * -# if t0's are missing, try t0's from the data file + * -# if t0's are missing, try to estimate them + * + * \param runData pointer to the current RUN block entry from the msr-file + * \param globalBlock pointer to the GLOBLA block entry from the msr-file + * \param forwardHistoNo histogram number vector of forward; forwardHistoNo = msr-file forward + redGreen_offset - 1 + * \param backwardHistoNo histogram number vector of backwardward; backwardHistoNo = msr-file backward + redGreen_offset - 1 + * + * return: + * - true if everthing went smooth + * - false, otherwise. + */ +Bool_t PRunAsymmetryRRF::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHistoNo, PUIntVector &backwardHistoNo) +{ + // feed all T0's + // first init T0's, T0's are stored as (forward T0, backward T0, etc.) + fT0s.clear(); + fT0s.resize(2*forwardHistoNo.size()); + for (UInt_t i=0; iGetT0BinSize(); i++) { + fT0s[i] = fRunInfo->GetT0Bin(i); + } + + // fill in the missing T0's from the GLOBAL block section (if present) + for (UInt_t i=0; iGetT0BinSize(); i++) { + if (fT0s[i] == -1) { // i.e. not given in the RUN block section + fT0s[i] = globalBlock->GetT0Bin(i); + } + } + + // fill in the missing T0's from the data file, if not already present in the msr-file + for (UInt_t i=0; iGetT0Bin(forwardHistoNo[i]) > 0.0) { + fT0s[2*i] = runData->GetT0Bin(forwardHistoNo[i]); + fRunInfo->SetT0Bin(fT0s[2*i], 2*i); + } + } + for (UInt_t i=0; iGetT0Bin(backwardHistoNo[i]) > 0.0) { + fT0s[2*i+1] = runData->GetT0Bin(backwardHistoNo[i]); + fRunInfo->SetT0Bin(fT0s[2*i+1], 2*i+1); + } + } + + // fill in the T0's gaps, i.e. in case the T0's are NEITHER in the msr-file and NOR in the data file + for (UInt_t i=0; iGetT0BinEstimated(forwardHistoNo[i]); + fRunInfo->SetT0Bin(fT0s[2*i], 2*i); + + cerr << endl << ">> PRunAsymmetryRRF::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl << ">> run: " << fRunInfo->GetRunName()->Data(); + cerr << endl << ">> will try the estimated one: forward t0 = " << runData->GetT0BinEstimated(forwardHistoNo[i]); + cerr << endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!"; + cerr << endl; + } + } + for (UInt_t i=0; iGetT0BinEstimated(backwardHistoNo[i]); + fRunInfo->SetT0Bin(fT0s[2*i+1], 2*i+1); + + cerr << endl << ">> PRunAsymmetryRRF::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl << ">> run: " << fRunInfo->GetRunName()->Data(); + cerr << endl << ">> will try the estimated one: backward t0 = " << runData->GetT0BinEstimated(backwardHistoNo[i]); + cerr << endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!"; + cerr << endl; + } + } + + // check if t0 is within proper bounds + for (UInt_t i=0; i (Int_t)runData->GetDataBin(forwardHistoNo[i])->size())) { + cerr << endl << ">> PRunAsymmetryRRF::GetProperT0(): **ERROR** t0 data bin (" << fT0s[2*i] << ") doesn't make any sense!"; + cerr << endl << ">> forwardHistoNo " << forwardHistoNo[i]; + cerr << endl; + return false; + } + if ((fT0s[2*i+1] < 0) || (fT0s[2*i+1] > (Int_t)runData->GetDataBin(backwardHistoNo[i])->size())) { + cerr << endl << ">> PRunAsymmetryRRF::PrepareData(): **ERROR** t0 data bin (" << fT0s[2*i+1] << ") doesn't make any sense!"; + cerr << endl << ">> backwardHistoNo " << backwardHistoNo[i]; + cerr << endl; + return false; + } + } + + // check if addrun's are present, and if yes add the necessary t0's + if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present + PRawRunData *addRunData; + fAddT0s.resize(fRunInfo->GetRunNameSize()-1); // resize to the number of addruns + for (UInt_t i=1; iGetRunNameSize(); i++) { + // get run to be added to the main one + addRunData = fRawData->GetRunData(*(fRunInfo->GetRunName(i))); + if (addRunData == 0) { // couldn't get run + cerr << endl << ">> PRunAsymmetryRRF::GetProperT0(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!"; + cerr << endl; + return false; + } + + // feed all T0's + // first init T0's, T0's are stored as (forward T0, backward T0, etc.) + fAddT0s[i-1].clear(); + fAddT0s[i-1].resize(2*forwardHistoNo.size()); + for (UInt_t j=0; jGetAddT0BinSize(i); j++) { + fAddT0s[i-1][j] = fRunInfo->GetAddT0Bin(i, j); + } + + // fill in the T0's from the data file, if not already present in the msr-file + for (UInt_t j=0; jGetT0Bin(forwardHistoNo[j]) > 0.0) { + fAddT0s[i-1][2*j] = addRunData->GetT0Bin(forwardHistoNo[j]); + fRunInfo->SetAddT0Bin(fAddT0s[i-1][2*j], i-1, 2*j); + } + } + for (UInt_t j=0; jGetT0Bin(backwardHistoNo[j]) > 0.0) { + fAddT0s[i-1][2*j+1] = addRunData->GetT0Bin(backwardHistoNo[j]); + fRunInfo->SetAddT0Bin(fAddT0s[i-1][2*j+1], i-1, 2*j+1); + } + } + + // fill in the T0's gaps, i.e. in case the T0's are NOT in the msr-file and NOT in the data file + for (UInt_t j=0; jGetT0BinEstimated(forwardHistoNo[j]); + fRunInfo->SetAddT0Bin(fAddT0s[i-1][2*j], i-1, 2*j); + + cerr << endl << ">> PRunAsymmetryRRF::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl << ">> run: " << fRunInfo->GetRunName(i)->Data(); + cerr << endl << ">> will try the estimated one: forward t0 = " << addRunData->GetT0BinEstimated(forwardHistoNo[j]); + cerr << endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!"; + cerr << endl; + } + } + for (UInt_t j=0; jGetT0BinEstimated(backwardHistoNo[j]); + fRunInfo->SetAddT0Bin(fAddT0s[i-1][2*j+1], i-1, 2*j+1); + + cerr << endl << ">> PRunAsymmetryRRF::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl << ">> run: " << fRunInfo->GetRunName(i)->Data(); + cerr << endl << ">> will try the estimated one: backward t0 = " << runData->GetT0BinEstimated(backwardHistoNo[j]); + cerr << endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!"; + cerr << endl; + } + } + } + } + + return true; +} + +//-------------------------------------------------------------------------- +// GetProperDataRange (private) +//-------------------------------------------------------------------------- +/** + *

Get the proper data range, i.e. first/last good bin (fgb/lgb). + * -# get fgb/lgb from the RUN block + * -# if fgb/lgb still undefined, try to get it from the GLOBAL block + * -# if fgb/lgb still undefined, try to estimate them. + * + * \param runData raw run data needed to perform some crosschecks + * \param histoNo histogram number (within a run). histoNo[0]: forward histogram number, histNo[1]: backward histogram number + * + * return: + * - true if everthing went smooth + * - false, otherwise. + */ +Bool_t PRunAsymmetryRRF::GetProperDataRange(PRawRunData* runData, UInt_t histoNo[2]) +{ + // first get start/end data + Int_t start[2] = {fRunInfo->GetDataRange(0), fRunInfo->GetDataRange(2)}; + Int_t end[2] = {fRunInfo->GetDataRange(1), fRunInfo->GetDataRange(3)}; + // check if data range has been provided in the RUN block. If not, try the GLOBAL block + if (start[0] == -1) { + start[0] = fMsrInfo->GetMsrGlobal()->GetDataRange(0); + } + if (start[1] == -1) { + start[1] = fMsrInfo->GetMsrGlobal()->GetDataRange(2); + } + if (end[0] == -1) { + end[0] = fMsrInfo->GetMsrGlobal()->GetDataRange(1); + } + if (end[1] == -1) { + end[1] = fMsrInfo->GetMsrGlobal()->GetDataRange(3); + } + + Double_t t0[2] = {fT0s[0], fT0s[1]}; + Int_t offset = (Int_t)(10.0e-3/fTimeResolution); // needed in case first good bin is not given, default = 10ns + + // check if data range has been provided, and if not try to estimate them + if (start[0] < 0) { + start[0] = (Int_t)t0[0]+offset; + fRunInfo->SetDataRange(start[0], 0); + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **WARNING** data range (forward) was not provided, will try data range start = t0+" << offset << "(=10ns) = " << start[0] << "."; + cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE."; + cerr << endl; + } + if (start[1] < 0) { + start[1] = (Int_t)t0[1]+offset; + fRunInfo->SetDataRange(start[1], 2); + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **WARNING** data range (backward) was not provided, will try data range start = t0+" << offset << "(=10ns) = " << start[1] << "."; + cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE."; + cerr << endl; + } + if (end[0] < 0) { + end[0] = runData->GetDataBin(histoNo[0])->size(); + fRunInfo->SetDataRange(end[0], 1); + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **WARNING** data range (forward) was not provided, will try data range end = " << end[0] << "."; + cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE."; + cerr << endl; + } + if (end[1] < 0) { + end[1] = runData->GetDataBin(histoNo[1])->size(); + fRunInfo->SetDataRange(end[1], 3); + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **WARNING** data range (backward) was not provided, will try data range end = " << end[1] << "."; + cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE."; + cerr << endl; + } + + // check if start, end, and t0 make any sense + // 1st check if start and end are in proper order + for (UInt_t i=0; i<2; i++) { + if (end[i] < start[i]) { // need to swap them + Int_t keep = end[i]; + end[i] = start[i]; + start[i] = keep; + } + // 2nd check if start is within proper bounds + if ((start[i] < 0) || (start[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **ERROR** start data bin doesn't make any sense!"; + cerr << endl; + return false; + } + // 3rd check if end is within proper bounds + if ((end[i] < 0) || (end[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **ERROR** end data bin doesn't make any sense!"; + cerr << endl; + return false; + } + // 4th check if t0 is within proper bounds + if ((t0[i] < 0) || (t0[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange(): **ERROR** t0 data bin doesn't make any sense!"; + cerr << endl; + return false; + } + } + + // check that start-t0 is the same for forward as for backward, otherwise take max(start[i]-t0[i]) + if (fabs(static_cast(start[0])-t0[0]) > fabs(static_cast(start[1])-t0[1])){ + start[1] = static_cast(t0[1] + static_cast(start[0]) - t0[0]); + end[1] = static_cast(t0[1] + static_cast(end[0]) - t0[0]); + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange **WARNING** needed to shift backward data range."; + cerr << endl << ">> given: " << fRunInfo->GetDataRange(2) << ", " << fRunInfo->GetDataRange(3); + cerr << endl << ">> used : " << start[1] << ", " << end[1]; + cerr << endl; + } + if (fabs(static_cast(start[0])-t0[0]) < fabs(static_cast(start[1])-t0[1])){ + start[0] = static_cast(t0[0] + static_cast(start[1]) - t0[1]); + end[0] = static_cast(t0[0] + static_cast(end[1]) - t0[1]); + cerr << endl << ">> PRunAsymmetryRRF::GetProperDataRange **WARNING** needed to shift forward data range."; + cerr << endl << ">> given: " << fRunInfo->GetDataRange(0) << ", " << fRunInfo->GetDataRange(1); + cerr << endl << ">> used : " << start[0] << ", " << end[0]; + cerr << endl; + } + + // keep good bins for potential latter use + fGoodBins[0] = start[0]; + fGoodBins[1] = end[0]; + fGoodBins[2] = start[1]; + fGoodBins[3] = end[1]; + + return true; +} + +//-------------------------------------------------------------------------- +// GetProperFitRange (private) +//-------------------------------------------------------------------------- +/** + *

Get the proper fit range. There are two possible fit range commands: + * fit given in (usec), or + * fit fgb+offset_0 lgb-offset_1 given in (bins), therefore it works the following way: + * -# get fit range assuming given in time from RUN block + * -# if fit range in RUN block is given in bins, replace start/end + * -# if fit range is NOT given yet, try fit range assuming given in time from GLOBAL block + * -# if fit range in GLOBAL block is given in bins, replace start/end + * -# if still no fit range is given, use fgb/lgb. + * + * \param globalBlock pointer to the GLOBAL block information form the msr-file. + */ +void PRunAsymmetryRRF::GetProperFitRange(PMsrGlobalBlock *globalBlock) +{ + // set fit start/end time; first check RUN Block + fFitStartTime = fRunInfo->GetFitRange(0); + fFitEndTime = fRunInfo->GetFitRange(1); + // if fit range is given in bins (and not time), the fit start/end time can be calculated at this point now + if (fRunInfo->IsFitRangeInBin()) { + fFitStartTime = (fGoodBins[0] + fRunInfo->GetFitRangeOffset(0) - fT0s[0]) * fTimeResolution; // (fgb+n0-t0)*dt + fFitEndTime = (fGoodBins[1] - fRunInfo->GetFitRangeOffset(1) - fT0s[0]) * fTimeResolution; // (lgb-n1-t0)*dt + // write these times back into the data structure. This way it is available when writting the log-file + fRunInfo->SetFitRange(fFitStartTime, 0); + fRunInfo->SetFitRange(fFitEndTime, 1); + } + if (fFitStartTime == PMUSR_UNDEFINED) { // fit start/end NOT found in the RUN block, check GLOBAL block + fFitStartTime = globalBlock->GetFitRange(0); + fFitEndTime = globalBlock->GetFitRange(1); + // if fit range is given in bins (and not time), the fit start/end time can be calculated at this point now + if (globalBlock->IsFitRangeInBin()) { + fFitStartTime = (fGoodBins[0] + globalBlock->GetFitRangeOffset(0) - fT0s[0]) * fTimeResolution; // (fgb+n0-t0)*dt + fFitEndTime = (fGoodBins[1] - globalBlock->GetFitRangeOffset(1) - fT0s[0]) * fTimeResolution; // (lgb-n1-t0)*dt + // write these times back into the data structure. This way it is available when writting the log-file + globalBlock->SetFitRange(fFitStartTime, 0); + globalBlock->SetFitRange(fFitEndTime, 1); + } + } + if ((fFitStartTime == PMUSR_UNDEFINED) || (fFitEndTime == PMUSR_UNDEFINED)) { + fFitStartTime = (fGoodBins[0] - fT0s[0]) * fTimeResolution; // (fgb-t0)*dt + fFitEndTime = (fGoodBins[1] - fT0s[0]) * fTimeResolution; // (lgb-t0)*dt + cerr << ">> PRunSingleHisto::GetProperFitRange(): **WARNING** Couldn't get fit start/end time!" << endl; + cerr << ">> Will set it to fgb/lgb which given in time is: " << fFitStartTime << "..." << fFitEndTime << " (usec)" << endl; + } +} diff --git a/src/classes/PRunBase.cpp b/src/classes/PRunBase.cpp index 7be37fe1..ffa15c86 100644 --- a/src/classes/PRunBase.cpp +++ b/src/classes/PRunBase.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index a6a8ed0d..b95c46fb 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -280,7 +280,8 @@ void PRunDataHandler::ReadData() fAllDataAvailable = ReadRootFile(); } else if ((fFileFormat == "NeXus") || (fFileFormat == "nexus")) { fAllDataAvailable = ReadNexusFile(); - } else if ((fFileFormat == "PsiBin") || (fFileFormat == "psibin")) { + } else if ((fFileFormat == "PsiBin") || (fFileFormat == "psibin") || + (fFileFormat == "PsiMdu") || (fFileFormat == "psimdu")) { fAllDataAvailable = ReadPsiBinFile(); } else if ((fFileFormat == "Mud") || (fFileFormat == "mud")) { fAllDataAvailable = ReadMudFile(); @@ -1733,8 +1734,33 @@ Bool_t PRunDataHandler::ReadRootFile() header->Get("RunInfo/RedGreen Offsets", ivec, ok); if (ok) { - redGreenOffsets = ivec; - runData.SetRedGreenOffset(ivec); + // check if any2many is used and a group histo list is defined, if NOT, only take the 0-offset data! + if (fAny2ManyInfo) { // i.e. any2many is called + if (fAny2ManyInfo->groupHistoList.size() == 0) { // NO group list defined -> use only the 0-offset data + redGreenOffsets.push_back(0); + } else { // group list defined + // make sure that the group list elements is a subset of present RedGreen offsets + Bool_t found = false; + for (UInt_t i=0; igroupHistoList.size(); i++) { + found = false; + for (UInt_t j=0; jgroupHistoList[i] == ivec[j]) + found = true; + } + if (!found) { + cerr << endl << ">> PRunDataHandler::ReadRootFile: **ERROR** requested histo group " << fAny2ManyInfo->groupHistoList[i]; + cerr << endl << ">> which is NOT present in the data file." << endl; + return false; + } + } + // found all requested histo groups, hence stuff it to the right places + redGreenOffsets = fAny2ManyInfo->groupHistoList; + runData.SetRedGreenOffset(fAny2ManyInfo->groupHistoList); + } + } else { // not any2many, i.e. musrfit, musrview, ... + redGreenOffsets = ivec; + runData.SetRedGreenOffset(ivec); + } } // check further for LEM specific stuff in RunInfo @@ -5058,7 +5084,11 @@ Bool_t PRunDataHandler::WriteWkmFile(TString fln) if (lem_wkm_style) cout << endl << "TOF(M3S1): nocut"; cout << endl << "Groups: " << fData[0].GetNoOfHistos(); - cout << endl << "Channels: " << static_cast(fData[0].GetDataBin(1)->size()/fAny2ManyInfo->rebin); + UInt_t histo0 = 1; + if (fAny2ManyInfo->groupHistoList.size() != 0) { // red/green list found + histo0 = fAny2ManyInfo->groupHistoList[0]+1; // take the first available red/green entry + } + cout << endl << "Channels: " << static_cast(fData[0].GetDataBin(histo0)->size()/fAny2ManyInfo->rebin); cout.precision(10); cout << endl << "Resolution: " << fData[0].GetTimeResolution()*fAny2ManyInfo->rebin/1.0e3; // ns->us cout.setf(ios::fixed,ios::floatfield); // floatfield set to fixed @@ -5147,7 +5177,11 @@ Bool_t PRunDataHandler::WritePsiBinFile(TString fln) // run number psibin.put_runNumber_int(fData[0].GetRunNumber()); // length of histograms - psibin.put_histoLength_bin((int)(fData[0].GetDataBin(1)->size()/fAny2ManyInfo->rebin)); + UInt_t histo0 = 1; + if (fAny2ManyInfo->groupHistoList.size() != 0) { // red/green list found + histo0 = fAny2ManyInfo->groupHistoList[0]+1; // take the first available red/green entry + } + psibin.put_histoLength_bin((int)(fData[0].GetDataBin(histo0)->size()/fAny2ManyInfo->rebin)); // number of histograms psibin.put_numberHisto_int((int)fData[0].GetNoOfHistos()); // run title = sample (10 char) / temp (10 char) / field (10 char) / orientation (10 char) @@ -5436,7 +5470,7 @@ Bool_t PRunDataHandler::WriteMudFile(TString fln) noOfEvents = 0; k = 0; for (UInt_t j=0; jGetData()->size(); j++) { - if ((j != 0) && (j % fAny2ManyInfo->rebin == 0)) { + if ((j > 0) && (j % fAny2ManyInfo->rebin == 0)) { data[k] = ival; noOfEvents += ival; k++; @@ -5621,7 +5655,7 @@ Bool_t PRunDataHandler::WriteAsciiFile(TString fln) } for (UInt_t i=0; irebin) == 0) { + if ((i > 0) && ((i % fAny2ManyInfo->rebin) == 0)) { cout << endl; for (UInt_t j=0; jCleanUp(); + fRunSingleHistoRRFList[i]->~PRunSingleHistoRRF(); + } + fRunSingleHistoRRFList.clear(); + for (UInt_t i=0; iCleanUp(); fRunAsymmetryList[i]->~PRunAsymmetry(); } fRunAsymmetryList.clear(); + for (UInt_t i=0; iCleanUp(); + fRunAsymmetryRRFList[i]->~PRunAsymmetryRRF(); + } + fRunAsymmetryRRFList.clear(); + for (UInt_t i=0; iCleanUp(); fRunMuMinusList[i]->~PRunMuMinus(); @@ -106,11 +118,21 @@ Bool_t PRunListCollection::Add(Int_t runNo, EPMusrHandleTag tag) if (!fRunSingleHistoList[fRunSingleHistoList.size()-1]->IsValid()) success = false; break; + case PRUN_SINGLE_HISTO_RRF: + fRunSingleHistoRRFList.push_back(new PRunSingleHistoRRF(fMsrInfo, fData, runNo, tag)); + if (!fRunSingleHistoRRFList[fRunSingleHistoRRFList.size()-1]->IsValid()) + success = false; + break; case PRUN_ASYMMETRY: fRunAsymmetryList.push_back(new PRunAsymmetry(fMsrInfo, fData, runNo, tag)); if (!fRunAsymmetryList[fRunAsymmetryList.size()-1]->IsValid()) success = false; break; + case PRUN_ASYMMETRY_RRF: + fRunAsymmetryRRFList.push_back(new PRunAsymmetryRRF(fMsrInfo, fData, runNo, tag)); + if (!fRunAsymmetryRRFList[fRunAsymmetryRRFList.size()-1]->IsValid()) + success = false; + break; case PRUN_MU_MINUS: fRunMuMinusList.push_back(new PRunMuMinus(fMsrInfo, fData, runNo, tag)); if (!fRunMuMinusList[fRunMuMinusList.size()-1]->IsValid()) @@ -147,8 +169,12 @@ void PRunListCollection::SetFitRange(const TString fitRange) { for (UInt_t i=0; iSetFitRangeBin(fitRange); + for (UInt_t i=0; iSetFitRangeBin(fitRange); for (UInt_t i=0; iSetFitRangeBin(fitRange); + for (UInt_t i=0; iSetFitRangeBin(fitRange); for (UInt_t i=0; iSetFitRangeBin(fitRange); for (UInt_t i=0; iSetFitRange(fitRange); + for (UInt_t i=0; iSetFitRange(fitRange); for (UInt_t i=0; iSetFitRange(fitRange); + for (UInt_t i=0; iSetFitRange(fitRange); for (UInt_t i=0; iSetFitRange(fitRange); for (UInt_t i=0; i& pa return chisq; } +//-------------------------------------------------------------------------- +// GetSingleHistoRRFChisq (public) +//-------------------------------------------------------------------------- +/** + *

Calculates chi-square of all single histogram RRF runs of a msr-file. + * + * return: + * - chi-square of all single histogram RRF runs of the msr-file + * + * \param par fit parameter vector + */ +Double_t PRunListCollection::GetSingleHistoRRFChisq(const std::vector& par) const +{ + Double_t chisq = 0.0; + + for (UInt_t i=0; iCalcChiSquare(par); + + return chisq; +} + //-------------------------------------------------------------------------- // GetAsymmetryChisq (public) //-------------------------------------------------------------------------- @@ -219,6 +270,27 @@ Double_t PRunListCollection::GetAsymmetryChisq(const std::vector& par) return chisq; } +//-------------------------------------------------------------------------- +// GetAsymmetryRRFChisq (public) +//-------------------------------------------------------------------------- +/** + *

Calculates chi-square of all asymmetry RRF runs of a msr-file. + * + * return: + * - chi-square of all asymmetry RRF runs of the msr-file + * + * \param par fit parameter vector + */ +Double_t PRunListCollection::GetAsymmetryRRFChisq(const std::vector& par) const +{ + Double_t chisq = 0.0; + + for (UInt_t i=0; iCalcChiSquare(par); + + return chisq; +} + //-------------------------------------------------------------------------- // GetMuMinusChisq (public) //-------------------------------------------------------------------------- @@ -299,9 +371,15 @@ Double_t PRunListCollection::GetSingleHistoChisqExpected(const std::vectorCalcChiSquareExpected(par); break; + case PRUN_SINGLE_HISTO_RRF: + expectedChisq = fRunSingleHistoRRFList[subIdx]->CalcChiSquareExpected(par); + break; case PRUN_ASYMMETRY: expectedChisq = fRunAsymmetryList[subIdx]->CalcChiSquareExpected(par); break; + case PRUN_ASYMMETRY_RRF: + expectedChisq = fRunAsymmetryRRFList[subIdx]->CalcChiSquareExpected(par); + break; case PRUN_MU_MINUS: expectedChisq = fRunMuMinusList[subIdx]->CalcChiSquareExpected(par); break; @@ -336,16 +414,17 @@ Double_t PRunListCollection::GetSingleRunChisq(const std::vector& par, return chisq; } + Int_t subIdx = 0; Int_t type = fMsrInfo->GetMsrRunList()->at(idx).GetFitType(); - if (type == -1) { // i.e. not forun in the RUN block, try the GLOBAL block + if (type == -1) { // i.e. not found in the RUN block, try the GLOBAL block type = fMsrInfo->GetMsrGlobal()->GetFitType(); - } - - // count how many entries of this fit-type are present up to idx - UInt_t subIdx = 0; - for (UInt_t i=0; iGetMsrRunList()->at(i).GetFitType() == type) - subIdx++; + subIdx = idx; + } else { // found in the RUN block + // count how many entries of this fit-type are present up to idx + for (UInt_t i=0; iGetMsrRunList()->at(i).GetFitType() == type) + subIdx++; + } } // return the chisq of the single run @@ -353,9 +432,15 @@ Double_t PRunListCollection::GetSingleRunChisq(const std::vector& par, case PRUN_SINGLE_HISTO: chisq = fRunSingleHistoList[subIdx]->CalcChiSquare(par); break; + case PRUN_SINGLE_HISTO_RRF: + chisq = fRunSingleHistoRRFList[subIdx]->CalcChiSquare(par); + break; case PRUN_ASYMMETRY: chisq = fRunAsymmetryList[subIdx]->CalcChiSquare(par); break; + case PRUN_ASYMMETRY_RRF: + chisq = fRunAsymmetryRRFList[subIdx]->CalcChiSquare(par); + break; case PRUN_MU_MINUS: chisq = fRunMuMinusList[subIdx]->CalcChiSquare(par); break; @@ -376,7 +461,7 @@ Double_t PRunListCollection::GetSingleRunChisq(const std::vector& par, *

Calculates log max-likelihood of all single histogram runs of a msr-file. * * return: - * - chi-square of all single histogram runs of the msr-file + * - log max-likelihood of all single histogram runs of the msr-file * * \param par fit parameter vector */ @@ -390,6 +475,27 @@ Double_t PRunListCollection::GetSingleHistoMaximumLikelihood(const std::vectorCalculates log max-likelihood of all single histogram RRF runs of a msr-file. + * + * return: + * - log max-likelihood of all single histogram runs of the msr-file + * + * \param par fit parameter vector + */ +Double_t PRunListCollection::GetSingleHistoRRFMaximumLikelihood(const std::vector& par) const +{ + Double_t mlh = 0.0; + + for (UInt_t i=0; iCalcMaxLikelihood(par); + + return mlh; +} + //-------------------------------------------------------------------------- // GetAsymmetryMaximumLikelihood (public) //-------------------------------------------------------------------------- @@ -412,6 +518,28 @@ Double_t PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vector Since it is not clear yet how to handle asymmetry fits with max likelihood + * the chi square will be used! + * + * return: + * - chi-square of all asymmetry RRF runs of the msr-file + * + * \param par fit parameter vector + */ +Double_t PRunListCollection::GetAsymmetryRRFMaximumLikelihood(const std::vector& par) const +{ + Double_t mlh = 0.0; + + for (UInt_t i=0; iCalcChiSquare(par); + + return mlh; +} + //-------------------------------------------------------------------------- // GetMuMinusMaximumLikelihood (public) //-------------------------------------------------------------------------- @@ -419,7 +547,7 @@ Double_t PRunListCollection::GetAsymmetryMaximumLikelihood(const std::vectorCalculates log max-likelihood of all mu minus runs of a msr-file. * * return: - * - chi-square of all mu minus runs of the msr-file + * - log max-likelihood of all mu minus runs of the msr-file * * \param par fit parameter vector */ @@ -493,9 +621,15 @@ UInt_t PRunListCollection::GetNoOfBinsFitted(const UInt_t idx) const case PRUN_SINGLE_HISTO: result = fRunSingleHistoList[subIdx]->GetNoOfFitBins(); break; + case PRUN_SINGLE_HISTO_RRF: + result = fRunSingleHistoRRFList[subIdx]->GetNoOfFitBins(); + break; case PRUN_ASYMMETRY: result = fRunAsymmetryList[subIdx]->GetNoOfFitBins(); break; + case PRUN_ASYMMETRY_RRF: + result = fRunAsymmetryRRFList[subIdx]->GetNoOfFitBins(); + break; case PRUN_MU_MINUS: result = fRunMuMinusList[subIdx]->GetNoOfFitBins(); break; @@ -526,9 +660,15 @@ UInt_t PRunListCollection::GetTotalNoOfBinsFitted() const for (UInt_t i=0; iGetNoOfFitBins(); + for (UInt_t i=0; iGetNoOfFitBins(); + for (UInt_t i=0; iGetNoOfFitBins(); + for (UInt_t i=0; iGetNoOfFitBins(); + for (UInt_t i=0; iGetNoOfFitBins(); @@ -558,7 +698,7 @@ PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: if ((index < 0) || (index >= fRunSingleHistoList.size())) { - cerr << endl << "PRunListCollection::GetSingleHisto: **ERROR** index = " << index << " out of bounds"; + cerr << endl << ">> PRunListCollection::GetSingleHisto(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; } @@ -581,6 +721,49 @@ PRunData* PRunListCollection::GetSingleHisto(UInt_t index, EDataSwitch tag) return data; } +//-------------------------------------------------------------------------- +// GetSingleHistoRRF (public) +//-------------------------------------------------------------------------- +/** + *

Get a processed single histogram RRF data set. + * + * return: + * - pointer to the run data set (processed data) if data set is found + * - null pointer otherwise + * + * \param index msr-file run index + * \param tag kIndex -> data at index, kRunNo -> data of given run no + */ +PRunData* PRunListCollection::GetSingleHistoRRF(UInt_t index, EDataSwitch tag) +{ + PRunData *data = 0; + + switch (tag) { + case kIndex: + if ((index < 0) || (index >= fRunSingleHistoRRFList.size())) { + cerr << endl << ">> PRunListCollection::GetSingleHistoRRF(): **ERROR** index = " << index << " out of bounds"; + cerr << endl; + return 0; + } + + fRunSingleHistoRRFList[index]->CalcTheory(); + data = fRunSingleHistoRRFList[index]->GetData(); + break; + case kRunNo: + for (UInt_t i=0; iGetRunNo() == index) { + data = fRunSingleHistoRRFList[i]->GetData(); + break; + } + } + break; + default: // error + break; + } + + return data; +} + //-------------------------------------------------------------------------- // GetAsymmetry (public) //-------------------------------------------------------------------------- @@ -601,7 +784,7 @@ PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: // called from musrfit when dumping the data if ((index < 0) || (index > fRunAsymmetryList.size())) { - cerr << endl << "PRunListCollection::GetAsymmetry: **ERROR** index = " << index << " out of bounds"; + cerr << endl << ">> PRunListCollection::GetAsymmetry(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; } @@ -624,6 +807,49 @@ PRunData* PRunListCollection::GetAsymmetry(UInt_t index, EDataSwitch tag) return data; } +//-------------------------------------------------------------------------- +// GetAsymmetryRRF (public) +//-------------------------------------------------------------------------- +/** + *

Get a processed asymmetry RRF data set. + * + * return: + * - pointer to the run data set (processed data) if data set is found + * - null pointer otherwise + * + * \param index msr-file run index + * \param tag kIndex -> data at index, kRunNo -> data of given run no + */ +PRunData* PRunListCollection::GetAsymmetryRRF(UInt_t index, EDataSwitch tag) +{ + PRunData *data = 0; + + switch (tag) { + case kIndex: // called from musrfit when dumping the data + if ((index < 0) || (index > fRunAsymmetryRRFList.size())) { + cerr << endl << ">> PRunListCollection::GetAsymmetryRRF(): **ERROR** index = " << index << " out of bounds"; + cerr << endl; + return 0; + } + + fRunAsymmetryRRFList[index]->CalcTheory(); + data = fRunAsymmetryRRFList[index]->GetData(); + break; + case kRunNo: // called from PMusrCanvas + for (UInt_t i=0; iGetRunNo() == index) { + data = fRunAsymmetryRRFList[i]->GetData(); + break; + } + } + break; + default: // error + break; + } + + return data; +} + //-------------------------------------------------------------------------- // GetMuMinus (public) //-------------------------------------------------------------------------- @@ -644,7 +870,7 @@ PRunData* PRunListCollection::GetMuMinus(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: if ((index < 0) || (index > fRunMuMinusList.size())) { - cerr << endl << "PRunListCollection::GetMuMinus: **ERROR** index = " << index << " out of bounds"; + cerr << endl << ">> PRunListCollection::GetMuMinus(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; } @@ -686,7 +912,7 @@ PRunData* PRunListCollection::GetNonMusr(UInt_t index, EDataSwitch tag) switch (tag) { case kIndex: if ((index < 0) || (index > fRunNonMusrList.size())) { - cerr << endl << "PRunListCollection::GetNonMusr: **ERROR** index = " << index << " out of bounds"; + cerr << endl << ">> PRunListCollection::GetNonMusr(): **ERROR** index = " << index << " out of bounds"; cerr << endl; return 0; } diff --git a/src/classes/PRunMuMinus.cpp b/src/classes/PRunMuMinus.cpp index a792f59b..bdcf7049 100644 --- a/src/classes/PRunMuMinus.cpp +++ b/src/classes/PRunMuMinus.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PRunNonMusr.cpp b/src/classes/PRunNonMusr.cpp index e8c5f3a8..2b188141 100644 --- a/src/classes/PRunNonMusr.cpp +++ b/src/classes/PRunNonMusr.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PRunSingleHisto.cpp b/src/classes/PRunSingleHisto.cpp index 66f46131..2881a32d 100644 --- a/src/classes/PRunSingleHisto.cpp +++ b/src/classes/PRunSingleHisto.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -861,7 +861,7 @@ Bool_t PRunSingleHisto::PrepareRawViewData(PRawRunData* runData, const UInt_t hi if (fScaleN0AndBkg) { dataNorm = 1.0/ (packing * (fTimeResolution * 1.0e3)); // fTimeResolution us->ns } else if (!fScaleN0AndBkg && (fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0)) { - theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)packing; + theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)fPacking; } // raw data, since PMusrCanvas is doing ranging etc. @@ -1052,7 +1052,7 @@ Bool_t PRunSingleHisto::PrepareViewData(PRawRunData* runData, const UInt_t histo if (fScaleN0AndBkg) { dataNorm = 1.0/ (packing * (fTimeResolution * 1.0e3)); // fTimeResolution us->ns } else if (!fScaleN0AndBkg && (fMsrInfo->GetMsrPlotList()->at(0).fViewPacking > 0)) { - theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)packing; + theoryNorm = (Double_t)fMsrInfo->GetMsrPlotList()->at(0).fViewPacking/(Double_t)fPacking; } // transform raw histo data. This is done the following way (for details see the manual): diff --git a/src/classes/PRunSingleHistoRRF.cpp b/src/classes/PRunSingleHistoRRF.cpp new file mode 100644 index 00000000..55f7ce02 --- /dev/null +++ b/src/classes/PRunSingleHistoRRF.cpp @@ -0,0 +1,1205 @@ +/*************************************************************************** + + PRunSingleHistoRRF.cpp + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2016 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_GOMP +#include +#endif + +#include +#include +#include +using namespace std; + +#include +#include +#include +#include + +#include "PMusr.h" +#include "PFourier.h" +#include "PRunSingleHistoRRF.h" + +//-------------------------------------------------------------------------- +// Constructor +//-------------------------------------------------------------------------- +/** + *

Constructor + */ +PRunSingleHistoRRF::PRunSingleHistoRRF() : PRunBase() +{ + fNoOfFitBins = 0; + fBackground = 0; + fRRFPacking = -1; + + // the 2 following variables are need in case fit range is given in bins, and since + // the fit range can be changed in the command block, these variables need to be accessible + fGoodBins[0] = -1; + fGoodBins[1] = -1; +} + +//-------------------------------------------------------------------------- +// Constructor +//-------------------------------------------------------------------------- +/** + *

Constructor + * + * \param msrInfo pointer to the msr-file handler + * \param rawData raw run data + * \param runNo number of the run within the msr-file + * \param tag tag showing what shall be done: kFit == fitting, kView == viewing + */ +PRunSingleHistoRRF::PRunSingleHistoRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag) : PRunBase(msrInfo, rawData, runNo, tag) +{ + fNoOfFitBins = 0; + + PMsrGlobalBlock *global = msrInfo->GetMsrGlobal(); + + if (!global->IsPresent()) { + cerr << endl << ">> PRunSingleHistoRRF::PRunSingleHistoRRF(): **SEVERE ERROR**: no GLOBAL-block present!"; + cerr << endl << ">> For Single Histo RRF the GLOBAL-block is mandatory! Please fix this first."; + cerr << endl; + fValid = false; + return; + } + + if (!global->GetRRFUnit().CompareTo("??")) { + cerr << endl << ">> PRunSingleHistoRRF::PRunSingleHistoRRF(): **SEVERE ERROR**: no RRF-Frequency found!"; + cerr << endl; + fValid = false; + return; + } + + fRRFPacking = global->GetRRFPacking(); + if (fRRFPacking == -1) { + cerr << endl << ">> PRunSingleHistoRRF::PRunSingleHistoRRF(): **SEVERE ERROR**: no RRF-Packing found!"; + cerr << endl; + fValid = false; + return; + } + + // the 2 following variables are need in case fit range is given in bins, and since + // the fit range can be changed in the command block, these variables need to be accessible + fGoodBins[0] = -1; + fGoodBins[1] = -1; + + if (!PrepareData()) { + cerr << endl << ">> PRunSingleHistoRRF::PRunSingleHistoRRF(): **SEVERE ERROR**: Couldn't prepare data for fitting!"; + cerr << endl << ">> This is very bad :-(, will quit ..."; + cerr << endl; + fValid = false; + } +} + +//-------------------------------------------------------------------------- +// Destructor +//-------------------------------------------------------------------------- +/** + *

Destructor + */ +PRunSingleHistoRRF::~PRunSingleHistoRRF() +{ + fForward.clear(); +} + +//-------------------------------------------------------------------------- +// CalcChiSquare (public) +//-------------------------------------------------------------------------- +/** + *

Calculate chi-square. + * + * return: + * - chisq value + * + * \param par parameter vector iterated by minuit2 + */ +Double_t PRunSingleHistoRRF::CalcChiSquare(const std::vector& par) +{ + Double_t chisq = 0.0; + Double_t diff = 0.0; + + // calculate functions + for (Int_t i=0; iGetNoOfFuncs(); i++) { + Int_t funcNo = fMsrInfo->GetFuncNo(i); + fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, *fRunInfo->GetMap(), par); + } + + // calculate chi square + Double_t time(1.0); + Int_t i, N(static_cast(fData.GetValue()->size())); + + // In order not to have an IF in the next loop, determine the start and end bins for the fit range now + Int_t startTimeBin = static_cast(ceil((fFitStartTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())); + if (startTimeBin < 0) + startTimeBin = 0; + Int_t endTimeBin = static_cast(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1; + if (endTimeBin > N) + endTimeBin = N; + + // Calculate the theory function once to ensure one function evaluation for the current set of parameters. + // This is needed for the LF and user functions where some non-thread-save calculations only need to be calculated once + // for a given set of parameters---which should be done outside of the parallelized loop. + // For all other functions it means a tiny and acceptable overhead. + time = fTheory->Func(time, par, fFuncValues); + + #ifdef HAVE_GOMP + Int_t chunk = (endTimeBin - startTimeBin)/omp_get_num_procs(); + if (chunk < 10) + chunk = 10; + #pragma omp parallel for default(shared) private(i,time,diff) schedule(dynamic,chunk) reduction(+:chisq) + #endif + for (i=startTimeBin; iat(i) - fTheory->Func(time, par, fFuncValues); + chisq += diff*diff / (fData.GetError()->at(i)*fData.GetError()->at(i)); + } + + return chisq; +} + +//-------------------------------------------------------------------------- +// CalcChiSquareExpected (public) +//-------------------------------------------------------------------------- +/** + *

Calculate expected chi-square. + * + * return: + * - chisq value + * + * \param par parameter vector iterated by minuit2 + */ +Double_t PRunSingleHistoRRF::CalcChiSquareExpected(const std::vector& par) +{ + Double_t chisq = 0.0; + Double_t diff = 0.0; + Double_t theo = 0.0; + + // calculate functions + for (Int_t i=0; iGetNoOfFuncs(); i++) { + Int_t funcNo = fMsrInfo->GetFuncNo(i); + fFuncValues[i] = fMsrInfo->EvalFunc(funcNo, *fRunInfo->GetMap(), par); + } + + // calculate chi square + Double_t time(1.0); + Int_t i, N(static_cast(fData.GetValue()->size())); + + // In order not to have an IF in the next loop, determine the start and end bins for the fit range now + Int_t startTimeBin = static_cast(ceil((fFitStartTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())); + if (startTimeBin < 0) + startTimeBin = 0; + Int_t endTimeBin = static_cast(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1; + if (endTimeBin > N) + endTimeBin = N; + + // Calculate the theory function once to ensure one function evaluation for the current set of parameters. + // This is needed for the LF and user functions where some non-thread-save calculations only need to be calculated once + // for a given set of parameters---which should be done outside of the parallelized loop. + // For all other functions it means a tiny and acceptable overhead. + time = fTheory->Func(time, par, fFuncValues); + + #ifdef HAVE_GOMP + Int_t chunk = (endTimeBin - startTimeBin)/omp_get_num_procs(); + if (chunk < 10) + chunk = 10; + #pragma omp parallel for default(shared) private(i,time,diff) schedule(dynamic,chunk) reduction(+:chisq) + #endif + for (i=startTimeBin; i < endTimeBin; ++i) { + time = fData.GetDataTimeStart() + (Double_t)i*fData.GetDataTimeStep(); + theo = fTheory->Func(time, par, fFuncValues); + diff = fData.GetValue()->at(i) - theo; + chisq += diff*diff / theo; + } + + return chisq; +} + +//-------------------------------------------------------------------------- +// CalcMaxLikelihood (public) +//-------------------------------------------------------------------------- +/** + *

Calculate log maximum-likelihood. See http://pdg.lbl.gov/index.html + * + * return: + * - log maximum-likelihood value + * + * \param par parameter vector iterated by minuit2 + */ +Double_t PRunSingleHistoRRF::CalcMaxLikelihood(const std::vector& par) +{ + // not yet implemented + + return 0.0; +} + +//-------------------------------------------------------------------------- +// CalcTheory (public) +//-------------------------------------------------------------------------- +/** + *

Calculate theory for a given set of fit-parameters. + */ +void PRunSingleHistoRRF::CalcTheory() +{ + // feed the parameter vector + std::vector par; + PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); + for (UInt_t i=0; isize(); i++) + par.push_back((*paramList)[i].fValue); + + // calculate functions + for (Int_t i=0; iGetNoOfFuncs(); i++) { + fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par); + } + + // calculate theory + UInt_t size = fData.GetValue()->size(); + Double_t start = fData.GetDataTimeStart(); + Double_t resolution = fData.GetDataTimeStep(); + Double_t time; + for (UInt_t i=0; iFunc(time, par, fFuncValues)); + } + + // clean up + par.clear(); +} + +//-------------------------------------------------------------------------- +// GetNoOfFitBins (public) +//-------------------------------------------------------------------------- +/** + *

Calculate the number of fitted bins for the current fit range. + * + * return: number of fitted bins. + */ +UInt_t PRunSingleHistoRRF::GetNoOfFitBins() +{ + CalcNoOfFitBins(); + + return fNoOfFitBins; +} + +//-------------------------------------------------------------------------- +// SetFitRangeBin (public) +//-------------------------------------------------------------------------- +/** + *

Allows to change the fit range on the fly. Used in the COMMAND block. + * The syntax of the string is: FIT_RANGE fgb[+n00] lgb[-n01] [fgb[+n10] lgb[-n11] ... fgb[+nN0] lgb[-nN1]]. + * If only one pair of fgb/lgb is given, it is used for all runs in the RUN block section. + * If multiple fgb/lgb's are given, the number N has to be the number of RUN blocks in + * the msr-file. + * + *

nXY are offsets which can be used to shift, limit the fit range. + * + * \param fitRange string containing the necessary information. + */ +void PRunSingleHistoRRF::SetFitRangeBin(const TString fitRange) +{ + TObjArray *tok = 0; + TObjString *ostr = 0; + TString str; + Ssiz_t idx = -1; + Int_t offset = 0; + + tok = fitRange.Tokenize(" \t"); + + if (tok->GetEntries() == 3) { // structure FIT_RANGE fgb+n0 lgb-n1 + // handle fgb+n0 entry + ostr = (TObjString*) tok->At(1); + str = ostr->GetString(); + // check if there is an offset present + idx = str.First("+"); + if (idx != -1) { // offset present + str.Remove(0, idx+1); + if (str.IsFloat()) // if str is a valid number, convert is to an integer + offset = str.Atoi(); + } + fFitStartTime = (fGoodBins[0] + offset - fT0s[0]) * fTimeResolution; + + // handle lgb-n1 entry + ostr = (TObjString*) tok->At(2); + str = ostr->GetString(); + // check if there is an offset present + idx = str.First("-"); + if (idx != -1) { // offset present + str.Remove(0, idx+1); + if (str.IsFloat()) // if str is a valid number, convert is to an integer + offset = str.Atoi(); + } + fFitEndTime = (fGoodBins[1] - offset - fT0s[0]) * fTimeResolution; + } else if ((tok->GetEntries() > 3) && (tok->GetEntries() % 2 == 1)) { // structure FIT_RANGE fgb[+n00] lgb[-n01] [fgb[+n10] lgb[-n11] ... fgb[+nN0] lgb[-nN1]] + Int_t pos = 2*(fRunNo+1)-1; + + if (pos + 1 >= tok->GetEntries()) { + cerr << endl << ">> PRunSingleHistoRRF::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; + cerr << endl << ">> will ignore it. Sorry ..." << endl; + } else { + // handle fgb+n0 entry + ostr = (TObjString*) tok->At(pos); + str = ostr->GetString(); + // check if there is an offset present + idx = str.First("+"); + if (idx != -1) { // offset present + str.Remove(0, idx+1); + if (str.IsFloat()) // if str is a valid number, convert is to an integer + offset = str.Atoi(); + } + fFitStartTime = (fGoodBins[0] + offset - fT0s[0]) * fTimeResolution; + + // handle lgb-n1 entry + ostr = (TObjString*) tok->At(pos+1); + str = ostr->GetString(); + // check if there is an offset present + idx = str.First("-"); + if (idx != -1) { // offset present + str.Remove(0, idx+1); + if (str.IsFloat()) // if str is a valid number, convert is to an integer + offset = str.Atoi(); + } + fFitEndTime = (fGoodBins[1] - offset - fT0s[0]) * fTimeResolution; + } + } else { // error + cerr << endl << ">> PRunSingleHistoRRF::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; + cerr << endl << ">> will ignore it. Sorry ..." << endl; + } + + // clean up + if (tok) { + delete tok; + } +} + +//-------------------------------------------------------------------------- +// CalcNoOfFitBins (protected) +//-------------------------------------------------------------------------- +/** + *

Calculate the number of fitted bins for the current fit range. + */ +void PRunSingleHistoRRF::CalcNoOfFitBins() +{ + // In order not having to loop over all bins and to stay consistent with the chisq method, calculate the start and end bins explicitly + Int_t startTimeBin = static_cast(ceil((fFitStartTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())); + if (startTimeBin < 0) + startTimeBin = 0; + Int_t endTimeBin = static_cast(floor((fFitEndTime - fData.GetDataTimeStart())/fData.GetDataTimeStep())) + 1; + if (endTimeBin > static_cast(fData.GetValue()->size())) + endTimeBin = fData.GetValue()->size(); + + if (endTimeBin > startTimeBin) + fNoOfFitBins = endTimeBin - startTimeBin; + else + fNoOfFitBins = 0; +} + +//-------------------------------------------------------------------------- +// PrepareData (protected) +//-------------------------------------------------------------------------- +/** + *

Prepare data for fitting or viewing. What is already processed at this stage: + * -# get proper raw run data + * -# get all needed forward histograms + * -# get time resolution + * -# get t0's and perform necessary cross checks (e.g. if t0 of msr-file (if present) are consistent with t0 of the data files, etc.) + * -# add runs (if addruns are present) + * -# group histograms (if grouping is present) + * + * return: + * - true if everthing went smooth + * - false, otherwise. + */ +Bool_t PRunSingleHistoRRF::PrepareData() +{ + Bool_t success = true; + + // keep the Global block info + PMsrGlobalBlock *globalBlock = fMsrInfo->GetMsrGlobal(); + + // get the proper run + PRawRunData* runData = fRawData->GetRunData(*fRunInfo->GetRunName()); + if (!runData) { // couldn't get run + cerr << endl << ">> PRunSingleHistoRRF::PrepareData(): **ERROR** Couldn't get run " << fRunInfo->GetRunName()->Data() << "!"; + cerr << endl; + return false; + } + + // collect histogram numbers + PUIntVector histoNo; // histoNo = msr-file forward + redGreen_offset - 1 + for (UInt_t i=0; iGetForwardHistoNoSize(); i++) { + histoNo.push_back(fRunInfo->GetForwardHistoNo(i)); + + if (!runData->IsPresent(histoNo[i])) { + cerr << endl << ">> PRunSingleHistoRRF::PrepareData(): **PANIC ERROR**:"; + cerr << endl << ">> histoNo found = " << histoNo[i] << ", which is NOT present in the data file!?!?"; + cerr << endl << ">> Will quit :-("; + cerr << endl; + histoNo.clear(); + return false; + } + } + + // keep the time resolution in (us) + fTimeResolution = runData->GetTimeResolution()/1.0e3; + cout.precision(10); + cout << endl << ">> PRunSingleHisto::PrepareData(): time resolution=" << fixed << runData->GetTimeResolution() << "(ns)" << endl; + + // get all the proper t0's and addt0's for the current RUN block + if (!GetProperT0(runData, globalBlock, histoNo)) { + return false; + } + + // keep the histo of each group at this point (addruns handled below) + vector forward; + forward.resize(histoNo.size()); // resize to number of groups + for (UInt_t i=0; iGetDataBin(histoNo[i])->size()); + forward[i] = *runData->GetDataBin(histoNo[i]); + } + + // check if there are runs to be added to the current one + if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present + PRawRunData *addRunData; + for (UInt_t i=1; iGetRunNameSize(); i++) { + + // get run to be added to the main one + addRunData = fRawData->GetRunData(*fRunInfo->GetRunName(i)); + if (addRunData == 0) { // couldn't get run + cerr << endl << ">> PRunSingleHistoRRF::PrepareData(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!"; + cerr << endl; + return false; + } + + // add forward run + UInt_t addRunSize; + for (UInt_t k=0; kGetDataBin(histoNo[k])->size(); + for (UInt_t j=0; jGetDataBin(histoNo[k])->size(); j++) { // loop over the bin indices + // make sure that the index stays in the proper range + if ((j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] >= 0) && (j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k] < addRunSize)) { + forward[k][j] += addRunData->GetDataBin(histoNo[k])->at(j+(Int_t)fAddT0s[i-1][k]-(Int_t)fT0s[k]); + } + } + } + } + } + + // set forward histo data of the first group + fForward.resize(forward[0].size()); + for (UInt_t i=0; iGetDataBin(histoNo[i])->size(); j++) { // loop over the bin indices + // make sure that the index stays within proper range + if ((j+fT0s[i]-fT0s[0] >= 0) && (j+fT0s[i]-fT0s[0] < runData->GetDataBin(histoNo[i])->size())) { + fForward[j] += forward[i][j+(Int_t)fT0s[i]-(Int_t)fT0s[0]]; + } + } + } + + // get the data range (fgb/lgb) for the current RUN block + if (!GetProperDataRange()) { + return false; + } + + // get the fit range for the current RUN block + GetProperFitRange(globalBlock); + + // do the more fit/view specific stuff + if (fHandleTag == kFit) + success = PrepareFitData(runData, histoNo[0]); + else if (fHandleTag == kView) + success = PrepareViewData(runData, histoNo[0]); + else + success = false; + + // cleanup + histoNo.clear(); + + return success; +} + +//-------------------------------------------------------------------------- +// PrepareFitData (protected) +//-------------------------------------------------------------------------- +/** + *

Take the pre-processed data (i.e. grouping and addrun are preformed) and form the RRF histogram for fitting. + * The following steps are preformed: + * -# get fit start/stop time + * -# check that 'first good data bin', 'last good data bin', and 't0' make any sense + * -# check how the background shall be handled, i.e. fitted, subtracted from background estimate data range, or subtacted from a given fixed background. + * -# estimate N0 + * -# RRF transformation + * -# packing (i.e rebinning) + * + * return: + * - true, if everything went smooth + * - false, otherwise + * + * \param runData raw run data handler + * \param histoNo forward histogram number + */ +Bool_t PRunSingleHistoRRF::PrepareFitData(PRawRunData* runData, const UInt_t histoNo) +{ + // keep the raw data for the RRF asymmetry error estimate for later + PDoubleVector rawNt; + for (UInt_t i=0; i freqMax=" << freqMax << " (MHz)" << endl; + + // "optimal packing" + Double_t optNoPoints = 8; + if (freqMax < 271.0) // < 271 MHz, i.e ~ 2T + optNoPoints = 5; + cout << "info> optimal packing: " << (Int_t)(1.0 / (fTimeResolution*(freqMax - fMsrInfo->GetMsrGlobal()->GetRRFFreq("MHz"))) / optNoPoints); + + // initially fForward is the "raw data set" (i.e. grouped histo and raw runs already added) to be fitted. This means fForward = N(t) at this point. + + // 1) check how the background shall be handled + // subtract background from histogramms ------------------------------------------ + if (fRunInfo->GetBkgFix(0) == PMUSR_UNDEFINED) { // no fixed background given + if (fRunInfo->GetBkgRange(0) >= 0) { + if (!EstimateBkg(histoNo)) + return false; + } else { // no background given to do the job, try estimate + fRunInfo->SetBkgRange(static_cast(fT0s[0]*0.1), 0); + fRunInfo->SetBkgRange(static_cast(fT0s[0]*0.6), 1); + cerr << endl << ">> PRunSingleHistoRRF::PrepareFitData(): **WARNING** Neither fix background nor background bins are given!"; + cerr << endl << ">> Will try the following: bkg start = " << fRunInfo->GetBkgRange(0) << ", bkg end = " << fRunInfo->GetBkgRange(1); + cerr << endl << ">> NO WARRANTY THAT THIS MAKES ANY SENSE! Better check ..."; + cerr << endl; + if (!EstimateBkg(histoNo)) + return false; + } + } else { // fixed background given + for (UInt_t i=0; iGetBkgFix(0); + } + fBackground = fRunInfo->GetBkgFix(0); + } + // here fForward = N(t) - Nbkg + + Int_t t0 = (Int_t)fT0s[0]; + + // 2) N(t) - Nbkg -> exp(+t/tau) [N(t)-Nbkg] + Double_t startTime = fTimeResolution * ((Double_t)fGoodBins[0] - (Double_t)t0); + + Double_t time_tau=0.0; + Double_t exp_t_tau=0.0; + for (Int_t i=fGoodBins[0]; i 0.0) + fW.push_back(1.0/(fMerr[i]*fMerr[i])); + else + fW.push_back(0.0); + } + // now fForward = exp(+t/tau) [N(t)-Nbkg] = M(t) + + // 3) estimate N0 + Double_t errN0 = 0.0; + Double_t n0 = EstimateN0(errN0, freqMax); + + // 4a) A(t) = exp(+t/tau) [N(t)-Nbkg] / N0 - 1.0 + for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) { + fForward[i] = fForward[i] / n0 - 1.0; + } + + // 4b) error estimate of A(t): errA(t) = exp(+t/tau)/N0 sqrt( N(t) + ([N(t)-N_bkg]/N0)^2 errN0^2 ) + for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) { + time_tau = (startTime + fTimeResolution * (i - fGoodBins[0])) / PMUON_LIFETIME; + exp_t_tau = exp(time_tau); + fAerr.push_back(exp_t_tau/n0*sqrt(rawNt[i]+pow(((rawNt[i]-fBackground)/n0)*errN0,2.0))); + } + + // 5) rotate A(t): A(t) -> 2* A(t) * cos(wRRF t + phiRRF), the factor 2.0 is needed since the high frequency part is suppressed. + PMsrGlobalBlock *globalBlock = fMsrInfo->GetMsrGlobal(); + Double_t wRRF = globalBlock->GetRRFFreq("Mc"); + Double_t phaseRRF = globalBlock->GetRRFPhase()*TMath::TwoPi()/180.0; + Double_t time = 0.0; + for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) { + time = startTime + fTimeResolution * ((Double_t)i - (Double_t)fGoodBins[0]); + fForward[i] *= 2.0*cos(wRRF * time + phaseRRF); + } + + // 6) RRF packing + Double_t dval=0.0; + for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) { + if (fRRFPacking == 1) { + fData.AppendValue(fForward[i]); + } else { // RRF packing > 1 + if (((i-fGoodBins[0]) % fRRFPacking == 0) && (i != fGoodBins[0])) { // fill data + dval /= fRRFPacking; + fData.AppendValue(dval); + // reset dval + dval = 0.0; + } + dval += fForward[i]; + } + } + + // 7) estimate packed RRF errors (see log-book p.204) + // the error estimate of the unpacked RRF asymmetry is: errA_RRF(t) \simeq exp(t/tau)/N0 sqrt( [N(t) + ((N(t)-N_bkg)/N0)^2 errN0^2] ) + dval = 0.0; + // the packed RRF asymmetry error + for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) { + if (((i-fGoodBins[0]) % fRRFPacking == 0) && (i != fGoodBins[0])) { // fill data + fData.AppendErrorValue(sqrt(2.0*dval)/fRRFPacking); // the factor 2.0 is needed since the high frequency part is suppressed. + dval = 0.0; + } + dval += fAerr[i-fGoodBins[0]]*fAerr[i-fGoodBins[0]]; + } + + // set start time and time step + fData.SetDataTimeStart(fTimeResolution*((Double_t)fGoodBins[0]-(Double_t)t0+(Double_t)(fRRFPacking-1)/2.0)); + fData.SetDataTimeStep(fTimeResolution*fRRFPacking); + + CalcNoOfFitBins(); + + return true; +} + +//-------------------------------------------------------------------------- +// PrepareViewData (protected) +//-------------------------------------------------------------------------- +/** + *

Take the pre-processed data (i.e. grouping and addrun are preformed) and form the histogram for viewing + * with life time correction, i.e. the exponential decay is removed. + *

The following steps are preformed: + * -# check if view packing is whished. + * -# check that 'first good data bin', 'last good data bin', and 't0' makes any sense + * -# transform data sets (see below). + * -# calculate theory + * + * return: + * - true, if everything went smooth + * - false, otherwise + * + * \param runData raw run data handler + * \param histoNo forward histogram number + */ +Bool_t PRunSingleHistoRRF::PrepareViewData(PRawRunData* runData, const UInt_t histoNo) +{ + // -------------- + // prepare data + // -------------- + + // prepare RRF single histo + PrepareFitData(runData, histoNo); + + // check for view packing + Int_t viewPacking = fMsrInfo->GetMsrPlotList()->at(0).fViewPacking; + if (viewPacking > 0) { + if (viewPacking < fRRFPacking) { + cerr << ">> PRunSingleHistoRRF::PrepareViewData(): **WARNING** Found View Packing (" << viewPacking << ") < RRF Packing (" << fRRFPacking << ")."; + cerr << ">> Will ignore View Packing." << endl; + } else { + // STILL MISSING + } + } + + // -------------- + // prepare theory + // -------------- + + // feed the parameter vector + std::vector par; + PMsrParamList *paramList = fMsrInfo->GetMsrParamList(); + for (UInt_t i=0; isize(); i++) + par.push_back((*paramList)[i].fValue); + + // calculate functions + for (Int_t i=0; iGetNoOfFuncs(); i++) { + fFuncValues[i] = fMsrInfo->EvalFunc(fMsrInfo->GetFuncNo(i), *fRunInfo->GetMap(), par); + } + + // check if a finer binning for the theory is needed + UInt_t size = fForward.size(); + Double_t factor = 1.0; + Double_t time = 0.0; + Double_t theoryValue = 0.0; + + if (fData.GetValue()->size() * 10 > fForward.size()) { + size = fData.GetValue()->size() * 10; + factor = (Double_t)fForward.size() / (Double_t)size; + } + fData.SetTheoryTimeStart(fData.GetDataTimeStart()); + fData.SetTheoryTimeStep(fTimeResolution*factor); + + // calculate theory + for (UInt_t i=0; iFunc(time, par, fFuncValues); + if (fabs(theoryValue) > 10.0) { // dirty hack needs to be fixed!! + theoryValue = 0.0; + } + fData.AppendTheoryValue(theoryValue); + } + + return true; +} + +//-------------------------------------------------------------------------- +// GetProperT0 (private) +//-------------------------------------------------------------------------- +/** + *

Get the proper t0 for the single histogram run. + * -# the t0 vector size = number of detectors (grouping) for forward. + * -# initialize t0's with -1 + * -# fill t0's from RUN block + * -# if t0's are missing (i.e. t0 == -1), try to fill from the GLOBAL block. + * -# if t0's are missing, try t0's from the data file + * -# if t0's are missing, try to estimate them + * + * \param runData pointer to the current RUN block entry from the msr-file + * \param globalBlock pointer to the GLOBLA block entry from the msr-file + * \param histoNo histogram number vector of forward; histoNo = msr-file forward + redGreen_offset - 1 + * + * return: + * - true if everthing went smooth + * - false, otherwise. + */ +Bool_t PRunSingleHistoRRF::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo) +{ + // feed all T0's + // first init T0's, T0's are stored as (forward T0, backward T0, etc.) + fT0s.clear(); + fT0s.resize(histoNo.size()); + for (UInt_t i=0; iGetT0BinSize(); i++) { + fT0s[i] = fRunInfo->GetT0Bin(i); + } + + // fill in the T0's from the GLOBAL block section (if present) + for (UInt_t i=0; iGetT0BinSize(); i++) { + if (fT0s[i] == -1) { // i.e. not given in the RUN block section + fT0s[i] = globalBlock->GetT0Bin(i); + } + } + + // fill in the T0's from the data file, if not already present in the msr-file + for (UInt_t i=0; iGetT0Bin(histoNo[i]) > 0.0) { + fT0s[i] = runData->GetT0Bin(histoNo[i]); + fRunInfo->SetT0Bin(fT0s[i], i); // keep value for the msr-file + } + } + } + + // fill in the T0's gaps, i.e. in case the T0's are NOT in the msr-file and NOT in the data file + for (UInt_t i=0; iGetT0BinEstimated(histoNo[i]); + fRunInfo->SetT0Bin(fT0s[i], i); // keep value for the msr-file + + cerr << endl << ">> PRunSingleHistoRRF::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl << ">> run: " << fRunInfo->GetRunName()->Data(); + cerr << endl << ">> will try the estimated one: forward t0 = " << runData->GetT0BinEstimated(histoNo[i]); + cerr << endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!"; + cerr << endl; + } + } + + // check if t0 is within proper bounds + for (UInt_t i=0; iGetForwardHistoNoSize(); i++) { + if ((fT0s[i] < 0) || (fT0s[i] > (Int_t)runData->GetDataBin(histoNo[i])->size())) { + cerr << endl << ">> PRunSingleHistoRRF::GetProperT0(): **ERROR** t0 data bin (" << fT0s[i] << ") doesn't make any sense!"; + cerr << endl; + return false; + } + } + + // check if there are runs to be added to the current one. If yes keep the needed t0's + if (fRunInfo->GetRunNameSize() > 1) { // runs to be added present + PRawRunData *addRunData; + fAddT0s.resize(fRunInfo->GetRunNameSize()-1); // resize to the number of addruns + for (UInt_t i=1; iGetRunNameSize(); i++) { + + // get run to be added to the main one + addRunData = fRawData->GetRunData(*fRunInfo->GetRunName(i)); + if (addRunData == 0) { // couldn't get run + cerr << endl << ">> PRunSingleHistoRRF::GetProperT0(): **ERROR** Couldn't get addrun " << fRunInfo->GetRunName(i)->Data() << "!"; + cerr << endl; + return false; + } + + // feed all T0's + // first init T0's, T0's are stored as (forward T0, backward T0, etc.) + fAddT0s[i-1].resize(histoNo.size()); + for (UInt_t j=0; jGetT0BinSize(); j++) { + fAddT0s[i-1][j] = fRunInfo->GetAddT0Bin(i-1,j); // addRunIdx starts at 0 + } + + // fill in the T0's from the data file, if not already present in the msr-file + for (UInt_t j=0; jGetT0Bin(histoNo[j]) > 0.0) { + fAddT0s[i-1][j] = addRunData->GetT0Bin(histoNo[j]); + fRunInfo->SetAddT0Bin(fAddT0s[i-1][j], i-1, j); // keep value for the msr-file + } + } + + // fill in the T0's gaps, i.e. in case the T0's are NOT in the msr-file and NOT in the data file + for (UInt_t j=0; jGetT0BinEstimated(histoNo[j]); + fRunInfo->SetAddT0Bin(fAddT0s[i-1][j], i-1, j); // keep value for the msr-file + + cerr << endl << ">> PRunSingleHistoRRF::GetProperT0(): **WARRNING** NO t0's found, neither in the run data nor in the msr-file!"; + cerr << endl << ">> run: " << fRunInfo->GetRunName(i)->Data(); + cerr << endl << ">> will try the estimated one: forward t0 = " << addRunData->GetT0BinEstimated(histoNo[j]); + cerr << endl << ">> NO WARRANTY THAT THIS OK!! For instance for LEM this is almost for sure rubbish!"; + cerr << endl; + } + } + + // check if t0 is within proper bounds + for (UInt_t j=0; jGetForwardHistoNoSize(); j++) { + if ((fAddT0s[i-1][j] < 0) || (fAddT0s[i-1][j] > (Int_t)addRunData->GetDataBin(histoNo[j])->size())) { + cerr << endl << ">> PRunSingleHistoRRF::GetProperT0(): **ERROR** addt0 data bin (" << fAddT0s[i-1][j] << ") doesn't make any sense!"; + cerr << endl; + return false; + } + } + } + } + + return true; +} + +//-------------------------------------------------------------------------- +// GetProperDataRange (private) +//-------------------------------------------------------------------------- +/** + *

Get the proper data range, i.e. first/last good bin (fgb/lgb). + * -# get fgb/lgb from the RUN block + * -# if fgb/lgb still undefined, try to get it from the GLOBAL block + * -# if fgb/lgb still undefined, try to estimate them. + * + * return: + * - true if everthing went smooth + * - false, otherwise. + */ +Bool_t PRunSingleHistoRRF::GetProperDataRange() +{ + // get start/end data + Int_t start; + Int_t end; + start = fRunInfo->GetDataRange(0); + end = fRunInfo->GetDataRange(1); + + // check if data range has been given in the RUN block, if not try to get it from the GLOBAL block + if (start < 0) { + start = fMsrInfo->GetMsrGlobal()->GetDataRange(0); + } + if (end < 0) { + end = fMsrInfo->GetMsrGlobal()->GetDataRange(1); + } + + // check if data range has been provided, and if not try to estimate them + if (start < 0) { + Int_t offset = (Int_t)(10.0e-3/fTimeResolution); + start = (Int_t)fT0s[0]+offset; + fRunInfo->SetDataRange(start, 0); + cerr << endl << ">> PRunSingleHistoRRF::GetProperDataRange(): **WARNING** data range was not provided, will try data range start = t0+" << offset << "(=10ns) = " << start << "."; + cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE."; + cerr << endl; + } + if (end < 0) { + end = fForward.size(); + fRunInfo->SetDataRange(end, 1); + cerr << endl << ">> PRunSingleHistoRRF::GetProperDataRange(): **WARNING** data range was not provided, will try data range end = " << end << "."; + cerr << endl << ">> NO WARRANTY THAT THIS DOES MAKE ANY SENSE."; + cerr << endl; + } + + // check if start and end make any sense + // 1st check if start and end are in proper order + if (end < start) { // need to swap them + Int_t keep = end; + end = start; + start = keep; + } + // 2nd check if start is within proper bounds + if ((start < 0) || (start > (Int_t)fForward.size())) { + cerr << endl << ">> PRunSingleHistoRRF::GetProperDataRange(): **ERROR** start data bin (" << start << ") doesn't make any sense!"; + cerr << endl; + return false; + } + // 3rd check if end is within proper bounds + if ((end < 0) || (end > (Int_t)fForward.size())) { + cerr << endl << ">> PRunSingleHistoRRF::GetProperDataRange(): **ERROR** end data bin (" << end << ") doesn't make any sense!"; + cerr << endl; + return false; + } + + // keep good bins for potential later use + fGoodBins[0] = start; + fGoodBins[1] = end; + + return true; +} + +//-------------------------------------------------------------------------- +// GetProperFitRange (private) +//-------------------------------------------------------------------------- +/** + *

Get the proper fit range. There are two possible fit range commands: + * fit given in (usec), or + * fit fgb+offset_0 lgb-offset_1 given in (bins), therefore it works the following way: + * -# get fit range assuming given in time from RUN block + * -# if fit range in RUN block is given in bins, replace start/end + * -# if fit range is NOT given yet, try fit range assuming given in time from GLOBAL block + * -# if fit range in GLOBAL block is given in bins, replace start/end + * -# if still no fit range is given, use fgb/lgb. + * + * \param globalBlock pointer to the GLOBAL block information form the msr-file. + */ +void PRunSingleHistoRRF::GetProperFitRange(PMsrGlobalBlock *globalBlock) +{ + // set fit start/end time; first check RUN Block + fFitStartTime = fRunInfo->GetFitRange(0); + fFitEndTime = fRunInfo->GetFitRange(1); + // if fit range is given in bins (and not time), the fit start/end time can be calculated at this point now + if (fRunInfo->IsFitRangeInBin()) { + fFitStartTime = (fGoodBins[0] + fRunInfo->GetFitRangeOffset(0) - fT0s[0]) * fTimeResolution; // (fgb+n0-t0)*dt + fFitEndTime = (fGoodBins[1] - fRunInfo->GetFitRangeOffset(1) - fT0s[0]) * fTimeResolution; // (lgb-n1-t0)*dt + // write these times back into the data structure. This way it is available when writting the log-file + fRunInfo->SetFitRange(fFitStartTime, 0); + fRunInfo->SetFitRange(fFitEndTime, 1); + } + if (fFitStartTime == PMUSR_UNDEFINED) { // fit start/end NOT found in the RUN block, check GLOBAL block + fFitStartTime = globalBlock->GetFitRange(0); + fFitEndTime = globalBlock->GetFitRange(1); + // if fit range is given in bins (and not time), the fit start/end time can be calculated at this point now + if (globalBlock->IsFitRangeInBin()) { + fFitStartTime = (fGoodBins[0] + globalBlock->GetFitRangeOffset(0) - fT0s[0]) * fTimeResolution; // (fgb+n0-t0)*dt + fFitEndTime = (fGoodBins[1] - globalBlock->GetFitRangeOffset(1) - fT0s[0]) * fTimeResolution; // (lgb-n1-t0)*dt + // write these times back into the data structure. This way it is available when writting the log-file + globalBlock->SetFitRange(fFitStartTime, 0); + globalBlock->SetFitRange(fFitEndTime, 1); + } + } + if ((fFitStartTime == PMUSR_UNDEFINED) || (fFitEndTime == PMUSR_UNDEFINED)) { + fFitStartTime = (fGoodBins[0] - fT0s[0]) * fTimeResolution; // (fgb-t0)*dt + fFitEndTime = (fGoodBins[1] - fT0s[0]) * fTimeResolution; // (lgb-t0)*dt + cerr << ">> PRunSingleHistoRRF::GetProperFitRange(): **WARNING** Couldn't get fit start/end time!" << endl; + cerr << ">> Will set it to fgb/lgb which given in time is: " << fFitStartTime << "..." << fFitEndTime << " (usec)" << endl; + } +} + +//-------------------------------------------------------------------------- +// GetMainFrequency (private) +//-------------------------------------------------------------------------- +/** + *

gets the maximum frequency of the given data. + * + * \param raw data set. + */ +Double_t PRunSingleHistoRRF::GetMainFrequency(PDoubleVector &data) +{ + Double_t freqMax = 0.0; + + // 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); + 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); + ft->Transform(F_APODIZATION_STRONG); + + // find frequency maximum + TH1F *power = ft->GetPowerFourier(); + Double_t maxFreqVal = 0.0; + for (Int_t i=1; iGetNbinsX(); i++) { + // ignore dc part at 0 frequency + if (iGetNbinsX()-1) { + if (power->GetBinContent(i)>power->GetBinContent(i+1)) + continue; + } + // check for maximum + if (power->GetBinContent(i) > maxFreqVal) { + maxFreqVal = power->GetBinContent(i); + freqMax = power->GetBinCenter(i); + } + } + + // clean up + if (power) + delete power; + if (ft) + delete ft; + if (histo) + delete histo; + + return freqMax; +} + +//-------------------------------------------------------------------------- +// EstimateN0 (private) +//-------------------------------------------------------------------------- +/** + *

Estimate the N0 for the given run. + * + * \param errN0 + */ +Double_t PRunSingleHistoRRF::EstimateN0(Double_t &errN0, Double_t freqMax) +{ + // endBin is estimated such that the number of full cycles (according to the maximum frequency of the data) + // is approximately the time fN0EstimateEndTime. + Int_t endBin = (Int_t)round(fN0EstimateEndTime / fTimeResolution * ceil(freqMax)/freqMax); + + Double_t n0 = 0.0; + Double_t wN = 0.0; + for (Int_t i=0; i PRunSingleHistoRRF::EstimateN0(): N0=" << n0 << "(" << errN0 << ")" << endl; + + return n0; +} + +//-------------------------------------------------------------------------- +// EstimatBkg (private) +//-------------------------------------------------------------------------- +/** + *

Estimate the background for a given interval. + * + * return: + * - true, if everything went smooth + * - false, otherwise + * + * \param histoNo forward histogram number of the run + */ +Bool_t PRunSingleHistoRRF::EstimateBkg(UInt_t histoNo) +{ + Double_t beamPeriod = 0.0; + + // check if data are from PSI, RAL, or TRIUMF + if (fRunInfo->GetInstitute()->Contains("psi")) + beamPeriod = ACCEL_PERIOD_PSI; + else if (fRunInfo->GetInstitute()->Contains("ral")) + beamPeriod = ACCEL_PERIOD_RAL; + else if (fRunInfo->GetInstitute()->Contains("triumf")) + beamPeriod = ACCEL_PERIOD_TRIUMF; + else + beamPeriod = 0.0; + + // check if start and end are in proper order + UInt_t start = fRunInfo->GetBkgRange(0); + UInt_t end = fRunInfo->GetBkgRange(1); + if (end < start) { + cout << endl << "PRunSingleHistoRRF::EstimatBkg(): end = " << end << " > start = " << start << "! Will swap them!"; + UInt_t keep = end; + end = start; + start = keep; + } + + // calculate proper background range + if (beamPeriod != 0.0) { + Double_t timeBkg = (Double_t)(end-start)*fTimeResolution; // length of the background intervall in time + UInt_t fullCycles = (UInt_t)(timeBkg/beamPeriod); // how many proton beam cylces can be placed within the proposed background intervall + // correct the end of the background intervall such that the background is as close as possible to a multiple of the proton cylce + end = start + (UInt_t) ((fullCycles*beamPeriod)/fTimeResolution); + cout << endl << "PRunSingleHistoRRF::EstimatBkg(): Background " << start << ", " << end; + if (end == start) + end = fRunInfo->GetBkgRange(1); + } + + // check if start is within histogram bounds + if ((start < 0) || (start >= fForward.size())) { + cerr << endl << ">> PRunSingleHistoRRF::EstimatBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << ">> histo lengths = " << fForward.size(); + cerr << endl << ">> background start = " << start; + cerr << endl; + return false; + } + + // check if end is within histogram bounds + if ((end < 0) || (end >= fForward.size())) { + cerr << endl << ">> PRunSingleHistoRRF::EstimatBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << ">> histo lengths = " << fForward.size(); + cerr << endl << ">> background end = " << end; + cerr << endl; + return false; + } + + // calculate background + Double_t bkg = 0.0; + + // forward + for (UInt_t i=start; i(end - start + 1); + + fBackground = bkg; // keep background (per bin) + + cout << endl << "info> fBackground=" << fBackground << endl; + + fRunInfo->SetBkgEstimated(fBackground, 0); + + return true; +} diff --git a/src/classes/PStartupHandler.cpp b/src/classes/PStartupHandler.cpp index 3f9b425e..47414ed3 100644 --- a/src/classes/PStartupHandler.cpp +++ b/src/classes/PStartupHandler.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PTheory.cpp b/src/classes/PTheory.cpp index 9da9847c..efa1c7d8 100644 --- a/src/classes/PTheory.cpp +++ b/src/classes/PTheory.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -2307,7 +2307,7 @@ Double_t PTheory::SkewedGauss(register Double_t t, const PDoubleVector& paramVal Double_t freq = TWO_PI*val[1]; if ((zp >= 25.0) || (zm >= 25.0)) // needed to prevent crash of 1F1 - skg = 2.0e300; + skg = 2.0e6; else if (fabs(val[2]) == fabs(val[3])) // sigma+ == sigma- -> Gaussian skg = TMath::Cos(phase+freq*tt) * gp; else diff --git a/src/classes/PUserFcn.cpp b/src/classes/PUserFcn.cpp index d0ed32a2..287d63aa 100644 --- a/src/classes/PUserFcn.cpp +++ b/src/classes/PUserFcn.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PUserFcnBase.cpp b/src/classes/PUserFcnBase.cpp index 2257613e..d5ec6525 100644 --- a/src/classes/PUserFcnBase.cpp +++ b/src/classes/PUserFcnBase.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/external/MusrRoot/TMusrRunHeader.cpp b/src/external/MusrRoot/TMusrRunHeader.cpp index 492808a2..1fbab84b 100644 --- a/src/external/MusrRoot/TMusrRunHeader.cpp +++ b/src/external/MusrRoot/TMusrRunHeader.cpp @@ -1437,14 +1437,14 @@ bool TMusrRunHeader::UpdateFolder(TObject *treeObj, TString path) // remove the first path element if (!RemoveFirst(path, '/')) { - cerr << endl << ">> TMusrRunHeader::FillFolder(): **ERROR** couldn't tokenize path!!" << endl; + cerr << endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't tokenize path!!" << endl; return false; } if (!obj) { // required object not present, create it TObjArray *oarray = new TObjArray(); if (!oarray) { - cerr << endl << ">> TMusrRunHeader::FillFolder(): **ERROR** couldn't create header structure!!" << endl; + cerr << endl << ">> TMusrRunHeader::UpdateFolder(): **ERROR** couldn't create header structure!!" << endl; return false; } // set the name of the new TObjArray @@ -1636,7 +1636,7 @@ TObjString TMusrRunHeader::GetHeaderString(UInt_t idx) str += subStr; str += "; "; } - subStr.Form(fmt, dvec.size()-1); + subStr.Form(fmt, dvec[dvec.size()-1]); str += subStr; str += " -@"; str += MRH_DOUBLE_VECTOR; diff --git a/src/external/libGapIntegrals/GapIntegrals.pdf b/src/external/libGapIntegrals/GapIntegrals.pdf index 8cad7fca..b03edf6c 100644 Binary files a/src/external/libGapIntegrals/GapIntegrals.pdf and b/src/external/libGapIntegrals/GapIntegrals.pdf differ diff --git a/src/external/libGapIntegrals/GapIntegrals.tex b/src/external/libGapIntegrals/GapIntegrals.tex index 5d9761c0..75812971 100644 --- a/src/external/libGapIntegrals/GapIntegrals.tex +++ b/src/external/libGapIntegrals/GapIntegrals.tex @@ -12,6 +12,7 @@ \usepackage{rotating} \usepackage{dcolumn} \usepackage{geometry} +\usepackage{color} \geometry{a4paper,left=20mm,right=20mm,top=20mm,bottom=20mm} @@ -72,7 +73,7 @@ E-Mail: & \verb?andreas.suter@psi.ch? && % \section*{\musrfithead plug-in for the calculation of the temperature dependence of $\bm{1/\lambda^2}$ for various gap symmetries}% -This memo is intended to give a short summary of the background on which the \gapint plug-in for \musrfit \cite{musrfit} has been developped. The aim of this implementation is the efficient calculation of integrals of the form +This memo is intended to give a short summary of the background on which the \gapint plug-in for \musrfit \cite{musrfit} has been developed. The aim of this implementation is the efficient calculation of integrals of the form \begin{equation}\label{int} I(T) = 1 + \frac{1}{\pi}\int_0^{2\pi}\int_{\Delta(\varphi,T)}^{\infty}\left(\frac{\partial f}{\partial E}\right) \frac{E}{\sqrt{E^2-\Delta^2(\varphi,T)}}\mathrm{d}E\mathrm{d}\varphi\,, \end{equation} @@ -104,18 +105,27 @@ For the numerical integration we use algorithms of the \textsc{Cuba} library \ci \subsection*{Implemented gap functions and function calls from MUSRFIT} Currently the calculation of $\tilde{I}(T)$ is implemented for various gap functions. The temperature dependence of the gap functions is either given by Eq.(\ref{eq:gapT_Prozorov}) \cite{Prozorov}, or by Eq.(\ref{eq:gapT_Manzano}) \cite{Manzano}. + +\vspace{2mm} + +\noindent \color{red}\textbf{A few words of warning:~}\color{black} The temperature dependence of the gap function is typically derived from within the BCS framework, +and strongly links $T_c$ and $\Delta_0$ (e.g.\xspace $\Delta_0 = 1.76\, k_{\rm B} T_c$ for an s-wave superconductor). In a self-consistent +description this would mean that $\Delta_0$ of $\Delta(\varphi)$ is locked to $T_c$ as well. In the implementation provided, this limitation +is lifted, and therefore the \emph{user} should judge and question the result if the ratio $\Delta_0/(k_{\rm B}T_c)$ is strongly deviating from +BCS values! + \begin{equation}\label{eq:gapT_Prozorov} - \Delta(\varphi,T) \simeq \Delta(\varphi,0)\,\tanh\left[\frac{\pi k_{\rm B} T_{\rm c}}{\Delta_0}\sqrt{a_{\rm G} \left(\frac{T_{\rm c}}{T}-1\right)}\right] + \Delta(\varphi,T) \simeq \Delta(\varphi)\,\tanh\left[c_0\,\sqrt{a_{\rm G} \left(\frac{T_{\rm c}}{T}-1\right)}\right] \end{equation} -\noindent with $\Delta_0$ as given below, and $a_{\rm G}$ depends on the pairing state: +\noindent with $\Delta(\varphi)$ as given below, and $c_0$ and $a_{\rm G}$ depends on the pairing state: \begin{description} - \item [\textit{s}-wave:] $a_{\rm G}=1$ \qquad with $\Delta_0 = 1.76\, k_{\rm B} T_c$ - \item [\textit{d}-wave:] $a_{\rm G}=4/3$ \quad with $\Delta_0 = 2.14\, k_{\rm B} T_c$ + \item [\textit{s}-wave:] $a_{\rm G}=1$ \qquad with $c_0 = \frac{\displaystyle\pi k_{\rm B} T_{\rm c}}{\displaystyle\Delta_0} = \pi/1.76 = 1.785$ + \item [\textit{d}-wave:] $a_{\rm G}=4/3$ \quad with $c_0 = \frac{\displaystyle\pi k_{\rm B} T_{\rm c}}{\displaystyle\Delta_0} = \pi/2.14 = 1.468$ \end{description} \begin{equation}\label{eq:gapT_Manzano} -\Delta(\varphi,T) \simeq \Delta(\varphi)\tanh\left(1.82\left(1.018\left(\frac{T_{\mathrm c}}{T}-1\right)\right)^{0.51}\right)\,. +\Delta(\varphi,T) \simeq \Delta(\varphi)\tanh\left[1.82\left(1.018\left(\frac{T_{\mathrm c}}{T}-1\right)\right)^{0.51}\right]\,. \end{equation} The \gapint plug-in calculates $\tilde{I}(T)$ for the following $\Delta(\varphi)$: @@ -124,37 +134,39 @@ The \gapint plug-in calculates $\tilde{I}(T)$ for the following $\Delta(\varphi) \begin{equation} \Delta(\varphi) = \Delta_0 \end{equation} - \musrfit theory line: \verb?userFcn libGapIntegrals TGapSWave 1 2 [3]?\\ - (Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $[a_{\rm G}~(1)]$. If $a_{\rm G}$ is given, the temperature dependence - according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized.) + \musrfit theory line: \verb?userFcn libGapIntegrals TGapSWave 1 2 [3 4]?\\[1.5ex] + Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $[c_0~(1),~ a_{\rm G}~(1)]$. If $c_0$ and $a_{\rm G}$ are provided, + the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized. \item[\textit{d}-wave gap \cite{Deutscher}:] \begin{equation} \Delta(\varphi) = \Delta_0\cos\left(2\varphi\right) \end{equation} - \musrfit theory line: \verb?userFcn libGapIntegrals TGapDWave 1 2 [3]?\\ - (Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $[a_{\rm G}~(1)]$. If $a_{\rm G}$ is given, the temperature dependence - according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized.) + \musrfit theory line: \verb?userFcn libGapIntegrals TGapDWave 1 2 [3 4]?\\[1.5ex] + Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $[c_0~(1),~a_{\rm G}~(1)]$. If $c_0$ and $a_{\rm G}$ are provided, + the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized. \item[non-monotonic \textit{d}-wave gap \cite{Matsui}:] \begin{equation} \Delta(\varphi) = \Delta_0\left[a \cos\left(2\varphi\right) + (1-a)\cos\left(6\varphi\right)\right] \end{equation} - \musrfit theory line: \verb?userFcn libGapIntegrals TGapNonMonDWave1 1 2 3 [4]?\\ - (Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $a~(1)$, $[a_{\rm G}~(1)]$. If $a_{\rm G}$ is given, the temperature dependence - according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized.) + \musrfit theory line: \verb?userFcn libGapIntegrals TGapNonMonDWave1 1 2 3 [4 5]?\\[1.5ex] + Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $a~(1)$, $[c_0~(1),~a_{\rm G}~(1)]$. If $c_0$ and $a_{\rm G}$ are provided, + the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized. \item[non-monotonic \textit{d}-wave gap \cite{Eremin}:] \begin{equation} \Delta(\varphi) = \Delta_0\left[\frac{2}{3} \sqrt{\frac{a}{3}}\cos\left(2\varphi\right) / \left( 1 + a\cos^2\left(2\varphi\right)\right)^{\frac{3}{2}}\right],\,a>1/2 \end{equation} - \musrfit theory line: \verb?userFcn libGapIntegrals TGapNonMonDWave2 1 2 3 [4]?\\ - (Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $a~(1)$, $a~(1)$, $[a_{\rm G}~(1)]$. If $a_{\rm G}$ is given, the temperature dependence - according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized.) + \musrfit theory line: \verb?userFcn libGapIntegrals TGapNonMonDWave2 1 2 3 [4 5]?\\[1.5ex] + Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $a~(1)$, $a~(1)$, $[c_0~(1),~a_{\rm G}~(1)]$. + If $c_0$ and $a_{\rm G}$ are provided, the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used, + otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized. \item[anisotropic \textit{s}-wave gap \cite{AnisotropicSWave}:] \begin{equation} \Delta(\varphi) = \Delta_0\left[1+a\cos\left(4\varphi\right)\right]\,,\,0\leqslant a\leqslant1 \end{equation} - \musrfit theory line: \verb?userFcn libGapIntegrals TGapAnSWave 1 2 3 [4]?\\ - (Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $a~(1)$, $[a_{\rm G}~(1)]$. If $a_{\rm G}$ is given, the temperature dependence - according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized.) + \musrfit theory line: \verb?userFcn libGapIntegrals TGapAnSWave 1 2 3 [4 5]?\\[1.5ex] + Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $a~(1)$, $[c_0~(1),~a_{\rm G}~(1)]$. + If $c_0$ and $a_{\rm G}$ are provided, the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used, + otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized. \end{description} \noindent It is also possible to calculate a power law temperature dependence (in the two fluid approximation $n=4$) and the dirty \textit{s}-wave expression. @@ -164,16 +176,16 @@ Obviously for this no integration is needed. \begin{equation} \frac{\lambda(0)^2}{\lambda(T)^2} = 1-\left(\frac{T}{T_{\mathrm c}}\right)^n \end{equation} - \musrfit theory line: \verb?userFcn libGapIntegrals TGapPowerLaw 1 2?\\ - (Parameters: $T_{\mathrm c}~(\mathrm{K})$, $n~(1)$) + \musrfit theory line: \verb?userFcn libGapIntegrals TGapPowerLaw 1 2?\\[1.5ex] + Parameters: $T_{\mathrm c}~(\mathrm{K})$, $n~(1)$ \item[dirty \textit{s}-wave \cite{Tinkham}:] \begin{equation} \frac{\lambda(0)^2}{\lambda(T)^2} = \frac{\Delta(T)}{\Delta_0}\,\tanh\left[\frac{\Delta(T)}{2 k_{\rm B} T}\right] \end{equation} - with $\Delta(T)$ given by Eq.(\ref{eq:gapT}).\\ - \musrfit theory line: \verb?userFcn libGapIntegrals TGapDirtySWave 1 2 [3]?\\ - (Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $[a_{\rm G}~(1)]$. If $a_{\rm G}$ is given, the temperature dependence - according to Eq.(\ref{eq:gapT_Prozorov}) will be used, otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized.) + \musrfit theory line: \verb?userFcn libGapIntegrals TGapDirtySWave 1 2 [3 4]?\\[1.5ex] + Parameters: $T_{\mathrm c}~(\mathrm{K})$, $\Delta_0~(\mathrm{meV})$, $[c_0~(1),~a_{\rm G}~(1)]$. + If $c_0$ and $a_{\rm G}$ are provided, the temperature dependence according to Eq.(\ref{eq:gapT_Prozorov}) will be used, + otherwise Eq.(\ref{eq:gapT_Manzano}) will be utilized. \end{description} \noindent Currently there are two gap functions to be found in the code which are \emph{not} documented here: @@ -187,7 +199,8 @@ The \gapint library is free software; you can redistribute it and/or modify it u \bibliographystyle{plain} \begin{thebibliography}{1} -\bibitem{musrfit} A.~Suter, \textit{\musrfit User Manual}, https://wiki.intranet.psi.ch/MUSR/MusrFit +\bibitem{musrfit} A. Suter, and B.M. Wojek, Physics Procedia \textbf{30}, 69 (2012). + A.~Suter, \textit{\musrfit User Manual}, http://lmu.web.psi.ch/musrfit/user/MUSR/WebHome.html \bibitem{cuba} T.~Hahn, \textit{Cuba -- a library for multidimensional numerical integration}, Comput.~Phys.~Commun.~\textbf{168}~(2005)~78-95, http://www.feynarts.de/cuba/ \bibitem{Prozorov} R.~Prozorov and R.W.~Giannetta, \textit{Magnetic penetration depth in unconventional superconductors}, Supercond.\ Sci.\ Technol.\ \textbf{19}~(2006)~R41-R67, and Erratum in Supercond.\ Sci.\ Technol.\ \textbf{21}~(2008)~082003. \bibitem{Manzano} A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 diff --git a/src/external/libGapIntegrals/TGapIntegrals.cpp b/src/external/libGapIntegrals/TGapIntegrals.cpp index 102fd02b..c2736ebc 100644 --- a/src/external/libGapIntegrals/TGapIntegrals.cpp +++ b/src/external/libGapIntegrals/TGapIntegrals.cpp @@ -459,10 +459,12 @@ TLambdaInvNonMonDWave2::~TLambdaInvNonMonDWave2() { */ double TGapSWave::operator()(double t, const vector &par) const { - assert((par.size() == 2) || (par.size() == 3)); // two or three parameters: Tc (K), Delta(0) (meV), [a (1)] - // 2 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 - // 3 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 + // parameters: [0] Tc (K), [1] Delta0 (meV), [[2] c0 (1), [3] aG (1)] + + assert((par.size() == 2) || (par.size() == 4)); // 2 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 + // 4 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 // and Erratum Supercond. Sci. Technol. 21 (2008) 082003 + // c0 in the original context is c0 = (pi kB Tc) / Delta0 if (t<=0.0) return 1.0; else if (t >= par[0]) @@ -509,7 +511,7 @@ double TGapSWave::operator()(double t, const vector &par) const { if (par.size() == 2) { // Carrington/Manzano intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[1]*tanh(0.2707214816*par[0]/par[1]*sqrt(par[2]*(par[0]/t-1.0)))); // tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[1]*tanh(par[2]*sqrt(par[3]*(par[0]/t-1.0)))); // Delta0*tanh(c0*sqrt(aG*(Tc/T-1))) } fGapIntegral->SetParameters(intPar); @@ -536,10 +538,12 @@ double TGapSWave::operator()(double t, const vector &par) const { */ double TGapDWave::operator()(double t, const vector &par) const { - assert((par.size() == 2) || (par.size() == 3)); // two or three parameters: Tc (K), Delta(0) (meV), [a (1)] - // 2 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 - // 3 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 + // parameters: [0] Tc (K), [1] Delta0 (meV), [[2] c0 (1), [3] aG (1)] + + assert((par.size() == 2) || (par.size() == 4)); // 2 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 + // 4 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 // and Erratum Supercond. Sci. Technol. 21 (2008) 082003 + // c0 in the original context is c0 = (pi kB Tc) / Delta0 if (t<=0.0) return 1.0; else if (t >= par[0]) @@ -585,7 +589,7 @@ double TGapDWave::operator()(double t, const vector &par) const { if (par.size() == 2) { // Carrington/Manzano intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[1]*tanh(0.2707214816*par[0]/par[1]*sqrt(par[2]*(par[0]/t-1.0)))); // tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[1]*tanh(par[2]*sqrt(par[3]*(par[0]/t-1.0)))); // Delta0*tanh(c0*sqrt(aG*(Tc/T-1))) } intPar.push_back(4.0*(t+intPar[1])); // upper limit of energy-integration: cutoff energy intPar.push_back(TMath::PiOver2()); // upper limit of phi-integration @@ -618,9 +622,10 @@ double TGapDWave::operator()(double t, const vector &par) const { */ double TGapCosSqDWave::operator()(double t, const vector &par) const { - assert((par.size() == 3) || (par.size() == 5)); // three or five parameters: Tc (K), DeltaD(0) (meV), DeltaS(0) (meV), [aD (1), aS (1)] - // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 - // 5 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 + // parameters: [0] Tc (K), [1] Delta0_D (meV), [2] Delta0_S (meV) [[3] c0_D (1), [4] aG_D (1), [5] c0_S (1), [6] aG_S (1)] + + assert((par.size() == 3) || (par.size() == 7)); // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 + // 7 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 // and Erratum Supercond. Sci. Technol. 21 (2008) 082003 if (t<=0.0) return 1.0; @@ -667,14 +672,14 @@ double TGapCosSqDWave::operator()(double t, const vector &par) const { if (par.size() == 3) { // Carrington/Manzano intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[1]*tanh(0.2707214816*par[0]/par[1]*sqrt(par[3]*(par[0]/t-1.0)))); // DeltaD(T) : tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[1]*tanh(par[3]*sqrt(par[4]*(par[0]/t-1.0)))); // Delta0_D*tanh(c0_D*sqrt(aG_D*(Tc/T-1))) } intPar.push_back(1.0*(t+intPar[1])); // upper limit of energy-integration: cutoff energy intPar.push_back(TMath::Pi()); // upper limit of phi-integration if (par.size() == 3) { // Carrington/Manzano intPar.push_back(par[2]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[2]*tanh(0.2707214816*par[0]/par[2]*sqrt(par[4]*(par[0]/t-1.0)))); // DeltaS(T) : tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[2]*tanh(par[5]*sqrt(par[6]*(par[0]/t-1.0)))); // Delta0_S*tanh(c0_S*sqrt(aG_S*(Tc/T-1))) } // double xl[] = {0.0, 0.0}; // lower bound E, phi @@ -705,10 +710,12 @@ double TGapCosSqDWave::operator()(double t, const vector &par) const { */ double TGapSinSqDWave::operator()(double t, const vector &par) const { - assert((par.size() == 3) || (par.size() == 5)); // three or five parameters: Tc (K), DeltaD(0) (meV), DeltaS(0) (meV), [aD (1), aS (1)] - // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 - // 5 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 + // parameters: [0] Tc (K), [1] Delta0_D (meV), [2] Delta0_S (meV) [[3] c0_D (1), [4] aG_D (1), [5] c0_S (1), [6] aG_S (1)] + + assert((par.size() == 3) || (par.size() == 7)); // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 + // 7 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 // and Erratum Supercond. Sci. Technol. 21 (2008) 082003 + // c0 in the original context is c0 = (pi kB Tc) / Delta0 if (t<=0.0) return 1.0; else if (t >= par[0]) @@ -754,14 +761,14 @@ double TGapSinSqDWave::operator()(double t, const vector &par) const { if (par.size() == 3) { // Carrington/Manzano intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[1]*tanh(0.2707214816*par[0]/par[1]*sqrt(par[3]*(par[0]/t-1.0)))); // DeltaD(T) : tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[1]*tanh(par[3]*sqrt(par[4]*(par[0]/t-1.0)))); // Delta0_D*tanh(c0_D*sqrt(aG_D*(Tc/T-1))) } intPar.push_back(1.0*(t+intPar[1])); // upper limit of energy-integration: cutoff energy intPar.push_back(TMath::Pi()); // upper limit of phi-integration if (par.size() == 3) { // Carrington/Manzano intPar.push_back(par[2]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[2]*tanh(0.2707214816*par[0]/par[2]*sqrt(par[4]*(par[0]/t-1.0)))); // DeltaS(T) : tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[2]*tanh(par[5]*sqrt(par[6]*(par[0]/t-1.0)))); // Delta0_S*tanh(c0_S*sqrt(aG_S*(Tc/T-1))) } // double xl[] = {0.0, 0.0}; // lower bound E, phi @@ -792,10 +799,13 @@ double TGapSinSqDWave::operator()(double t, const vector &par) const { */ double TGapAnSWave::operator()(double t, const vector &par) const { - assert((par.size() == 3) || (par.size() == 4)); // three or four parameters: Tc (K), Delta(0) (meV), a (1), [aS_Gap (1)] - // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 - // 4 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 + // parameters: [0] Tc (K), [1] Delta0 (meV), [2] a (1), [[3] c0 (1), [4] aG (1)] + + assert((par.size() == 3) || (par.size() == 5)); // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 + // 5 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 // and Erratum Supercond. Sci. Technol. 21 (2008) 082003 + // c0 in the original context is c0 = (pi kB Tc) / Delta0 + if (t<=0.0) return 1.0; else if (t >= par[0]) @@ -841,7 +851,7 @@ double TGapAnSWave::operator()(double t, const vector &par) const { if (par.size() == 3) { // Carrington/Manzano intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[1]*tanh(0.2707214816*par[0]/par[1]*sqrt(par[3]*(par[0]/t-1.0)))); // DeltaS(T) : tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[1]*tanh(par[3]*sqrt(par[4]*(par[0]/t-1.0)))); // Delta0*tanh(c0*sqrt(aG*(Tc/T-1))) } intPar.push_back(par[2]); intPar.push_back(4.0*(t+(1.0+par[2])*intPar[1])); // upper limit of energy-integration: cutoff energy @@ -875,10 +885,12 @@ double TGapAnSWave::operator()(double t, const vector &par) const { */ double TGapNonMonDWave1::operator()(double t, const vector &par) const { - assert((par.size() == 3) || (par.size() == 4)); // three or four parameters: Tc (K), Delta(0) (meV), a (1), [aD_Gap (1)] - // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 - // 4 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 + // parameters: [0] Tc (K), [1] Delta0 (meV), [2] a (1), [[3] c0 (1), [4] aG (1)] + + assert((par.size() == 3) || (par.size() == 5)); // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 + // 5 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 // and Erratum Supercond. Sci. Technol. 21 (2008) 082003 + // c0 in the original context is c0 = (pi kB Tc) / Delta0 if (t<=0.0) return 1.0; else if (t >= par[0]) @@ -924,7 +936,7 @@ double TGapNonMonDWave1::operator()(double t, const vector &par) const { if (par.size() == 3) { // Carrington/Manzano intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[1]*tanh(0.2707214816*par[0]/par[1]*sqrt(par[3]*(par[0]/t-1.0)))); // DeltaD(T) : tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[1]*tanh(par[3]*sqrt(par[4]*(par[0]/t-1.0)))); // Delta0*tanh(c0*sqrt(aG*(Tc/T-1))) } intPar.push_back(par[2]); intPar.push_back(4.0*(t+intPar[1])); // upper limit of energy-integration: cutoff energy @@ -955,10 +967,12 @@ double TGapNonMonDWave1::operator()(double t, const vector &par) const { */ double TGapNonMonDWave2::operator()(double t, const vector &par) const { - assert((par.size() == 3) || (par.size() == 4)); // three parameters: Tc (K), Delta(0) (meV), a (1), [aD_Gap (1)] - // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 - // 4 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 + // parameters: [0] Tc (K), [1] Delta0 (meV), [2] a (1), [[3] c0 (1), [4] aG (1)] + + assert((par.size() == 3) || (par.size() == 5)); // 3 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 + // 5 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 // and Erratum Supercond. Sci. Technol. 21 (2008) 082003 + // c0 in the original context is c0 = (pi kB Tc) / Delta0 if (t<=0.0) return 1.0; else if (t >= par[0]) @@ -1004,7 +1018,7 @@ double TGapNonMonDWave2::operator()(double t, const vector &par) const { if (par.size() == 3) { // Carrington/Manzano intPar.push_back(par[1]*tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51))); } else { // Prozorov/Giannetta - intPar.push_back(par[1]*tanh(0.2707214816*par[0]/par[1]*sqrt(par[3]*(par[0]/t-1.0)))); // DeltaD(T) : tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + intPar.push_back(par[1]*tanh(par[3]*sqrt(par[4]*(par[0]/t-1.0)))); // Delta0*tanh(c0*sqrt(aG*(Tc/T-1))) } intPar.push_back(par[2]); intPar.push_back(4.0*(t+intPar[1])); // upper limit of energy-integration: cutoff energy @@ -1056,9 +1070,10 @@ double TGapPowerLaw::operator()(double t, const vector &par) const { */ double TGapDirtySWave::operator()(double t, const vector &par) const { - assert((par.size() == 2) || (par.size() == 3)); // two or three parameters: Tc (K), Delta(0) (meV) [a (1)] - // 2 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 - // 3 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 + // parameters: [0] Tc (K), [1] Delta0 (meV), [[2] c0 (1), [3] aG (1)] + + assert((par.size() == 2) || (par.size() == 4)); // 2 parameters: see A.~Carrington and F.~Manzano, Physica~C~\textbf{385}~(2003)~205 + // 4 parameters: see R. Prozorov and R. Giannetta, Supercond. Sci. Technol. 19 (2006) R41-R67 // and Erratum Supercond. Sci. Technol. 21 (2008) 082003 if (t<=0.0) return 1.0; @@ -1069,7 +1084,7 @@ double TGapDirtySWave::operator()(double t, const vector &par) const { if (par.size() == 2) { // Carrington/Manzano deltaT = tanh(1.82*pow(1.018*(par[0]/t-1.0),0.51)); } else { // Prozorov/Giannetta - deltaT = tanh(0.2707214816*par[0]/par[1]*sqrt(par[2]*(par[0]/t-1.0))); // tanh(pi kB Tc / Delta(0) * sqrt()), pi kB = 0.2707214816 meV/K + deltaT = tanh(par[2]*sqrt(par[3]*(par[0]/t-1.0))); // tanh(c0*sqrt(aG*(Tc/T-1))) } return deltaT*tanh(par[1]*deltaT/(0.172346648*t)); // Delta(T)/Delta(0)*tanh(Delta(T)/2 kB T), kB in meV/K diff --git a/src/include/PFitter.h b/src/include/PFitter.h index 8445468c..c9a09014 100644 --- a/src/include/PFitter.h +++ b/src/include/PFitter.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFitterFcn.h b/src/include/PFitterFcn.h index 1c2d846f..94686e00 100644 --- a/src/include/PFitterFcn.h +++ b/src/include/PFitterFcn.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFourier.h b/src/include/PFourier.h index 787450e1..bff94450 100644 --- a/src/include/PFourier.h +++ b/src/include/PFourier.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -55,7 +55,9 @@ class PFourier virtual const char* GetDataTitle() { return fData->GetTitle(); } virtual const Int_t GetUnitTag() { return fUnitTag; } virtual Double_t GetResolution() { return fResolution; } + virtual Double_t GetMaxFreq(); virtual TH1F* GetRealFourier(const Double_t scale = 1.0); + virtual TH1F* GetPhaseOptRealFourier(Double_t &phase, const Double_t scale = 1.0, const Double_t min = -1.0, const Double_t max = -1.0); virtual TH1F* GetImaginaryFourier(const Double_t scale = 1.0); virtual TH1F* GetPowerFourier(const Double_t scale = 1.0); virtual TH1F* GetPhaseFourier(const Double_t scale = 1.0); diff --git a/src/include/PFourierCanvas.h b/src/include/PFourierCanvas.h index d509e39e..1229b34c 100644 --- a/src/include/PFourierCanvas.h +++ b/src/include/PFourierCanvas.h @@ -1,5 +1,14 @@ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + + PFourierCanvas.h + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -38,27 +47,31 @@ #include "PFourier.h" // Canvas menu id's -#define P_MENU_ID_FOURIER 10001 -#define P_MENU_ID_AVERAGE 10002 -#define P_MENU_ID_EXPORT_DATA 10003 +#define P_MENU_ID_FOURIER 10001 +#define P_MENU_ID_AVERAGE 10002 +#define P_MENU_ID_AVERAGE_PER_DATA_SET 10003 +#define P_MENU_ID_EXPORT_DATA 10004 -#define P_MENU_ID_FOURIER_REAL 100 -#define P_MENU_ID_FOURIER_IMAG 101 -#define P_MENU_ID_FOURIER_REAL_AND_IMAG 102 -#define P_MENU_ID_FOURIER_PWR 103 -#define P_MENU_ID_FOURIER_PHASE 104 -#define P_MENU_ID_FOURIER_PHASE_PLUS 105 -#define P_MENU_ID_FOURIER_PHASE_MINUS 106 +#define P_MENU_ID_FOURIER_REAL 100 +#define P_MENU_ID_FOURIER_IMAG 101 +#define P_MENU_ID_FOURIER_REAL_AND_IMAG 102 +#define P_MENU_ID_FOURIER_PWR 103 +#define P_MENU_ID_FOURIER_PHASE 104 +#define P_MENU_ID_FOURIER_PHASE_OPT_REAL 105 +#define P_MENU_ID_FOURIER_PHASE_PLUS 106 +#define P_MENU_ID_FOURIER_PHASE_MINUS 107 //------------------------------------------------------------------------ /** *

Structure holding all necessary Fourier histograms. */ typedef struct { - TH1F *dataFourierRe; ///< real part of the Fourier transform of the data histogram - TH1F *dataFourierIm; ///< imaginary part of the Fourier transform of the data histogram - TH1F *dataFourierPwr; ///< power spectrum of the Fourier transform of the data histogram - TH1F *dataFourierPhase; ///< phase spectrum of the Fourier transform of the data histogram + TH1F *dataFourierRe; ///< real part of the Fourier transform of the data histogram + TH1F *dataFourierIm; ///< imaginary part of the Fourier transform of the data histogram + TH1F *dataFourierPwr; ///< power spectrum of the Fourier transform of the data histogram + TH1F *dataFourierPhase; ///< phase spectrum of the Fourier transform of the data histogram + TH1F *dataFourierPhaseOptReal; ///< phase otpimized real Fourier transform of the data histogram + Double_t optPhase; ///< optimal phase which maximizes the real Fourier } PFourierCanvasDataSet; //------------------------------------------------------------------------ @@ -75,10 +88,12 @@ class PFourierCanvas : public TObject, public TQObject { public: PFourierCanvas(); - PFourierCanvas(vector &fourier, const Char_t* title, const Bool_t showAverage, + PFourierCanvas(vector &fourier, PIntVector dataSetTag, const Char_t* title, + const Bool_t showAverage, const Bool_t showAveragePerDataSet, const Int_t fourierPlotOpt, Double_t fourierXrange[2], Double_t phase, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch); - PFourierCanvas(vector &fourier, const Char_t* title, const Bool_t showAverage, + PFourierCanvas(vector &fourier, PIntVector dataSetTag, const Char_t* title, + const Bool_t showAverage, const Bool_t showAveragePerDataSet, const Int_t fourierPlotOpt, Double_t fourierXrange[2], Double_t phase, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const PIntVector markerList, const PIntVector colorList, const Bool_t batch); @@ -103,7 +118,9 @@ class PFourierCanvas : public TObject, public TQObject Int_t fTimeout; ///< timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place Bool_t fBatchMode; ///< musrview in ROOT batch mode Bool_t fValid; ///< if true, everything looks OK - Bool_t fAveragedView; ///< tag showing that the averaged view or normal view should be presented. + Bool_t fAveragedView; ///< tag showing that the averaged view for ALL data or normal view should be presented. + Bool_t fAveragedViewPerDataSet; ///< tag showing that the averaged view for individual data sets or normal view should be presented. + PIntVector fDataSetTag; ///< vector holding the data set tags Int_t fCurrentPlotView; ///< tag showing what the current plot view is: real, imag, power, phase, ... Double_t fInitialXRange[2]; ///< keeps the initial x-range Double_t fInitialYRange[2]; ///< keeps the initial y-range @@ -112,7 +129,7 @@ class PFourierCanvas : public TObject, public TQObject TString fXaxisTitle; vector fFourier; ///< keeps all the Fourier data, ownership is with the caller PFourierCanvasDataList fFourierHistos; ///< keeps all the Fourier histos - PFourierCanvasDataSet fFourierAverage; ///< keeps the average of the Fourier histos + PFourierCanvasDataList fFourierAverage; ///< keeps the average of the Fourier histos Double_t fCurrentFourierPhase; ///< keeps the current Fourier phase (real/imag) TLatex *fCurrentFourierPhaseText; ///< used in Re/Im Fourier to show the current phase in the pad @@ -127,7 +144,6 @@ class PFourierCanvas : public TObject, public TQObject TRootCanvas *fImp; ///< ROOT native GUI version of main window with menubar and drawing area TGMenuBar *fBar; ///< menu bar TGPopupMenu *fPopupMain; ///< popup menu MusrFT in the main menu bar -// TGPopupMenu *fPopupSave; ///< popup menu of the MusrFT/Save Data sub menu TGPopupMenu *fPopupFourier; ///< popup menu of the MusrFT/Fourier sub menu // canvas related variables @@ -135,6 +151,7 @@ class PFourierCanvas : public TObject, public TQObject TPaveText *fTitlePad; ///< title pad used to display a title TPad *fFourierPad; ///< fourier pad used to display the fourier TLegend *fInfoPad; ///< info pad used to display a legend of the data plotted + TLegend *fLegAvgPerDataSet; ///< legend used for averaged per data set view virtual void CreateXaxisTitle(); virtual void CreateStyle(); @@ -152,6 +169,7 @@ class PFourierCanvas : public TObject, public TQObject virtual Double_t GetMaximum(TH1F* histo, Double_t xmin=-1.0, Double_t xmax=-1.0); virtual Double_t GetMinimum(TH1F* histo, Double_t xmin=-1.0, Double_t xmax=-1.0); virtual Double_t GetInterpolatedValue(TH1F* histo, Double_t xVal); + virtual TString GetDataSetName(TString title); ClassDef(PFourierCanvas, 1) }; diff --git a/src/include/PFourierCanvasLinkDef.h b/src/include/PFourierCanvasLinkDef.h index 8ceb2d47..af10deb8 100644 --- a/src/include/PFourierCanvasLinkDef.h +++ b/src/include/PFourierCanvasLinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFunction.h b/src/include/PFunction.h index b4b60934..9efd48ff 100644 --- a/src/include/PFunction.h +++ b/src/include/PFunction.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFunctionGrammar.h b/src/include/PFunctionGrammar.h index 10c0c9f0..a03bcc4c 100644 --- a/src/include/PFunctionGrammar.h +++ b/src/include/PFunctionGrammar.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFunctionHandler.h b/src/include/PFunctionHandler.h index cd68390e..d8cc78b8 100644 --- a/src/include/PFunctionHandler.h +++ b/src/include/PFunctionHandler.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMsr2Data.h b/src/include/PMsr2Data.h index 292dc8c9..7974d99a 100644 --- a/src/include/PMsr2Data.h +++ b/src/include/PMsr2Data.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2009-2014 by Bastian M. Wojek / Andreas Suter * + * Copyright (C) 2009-2016 by Bastian M. Wojek / Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMsrHandler.h b/src/include/PMsrHandler.h index d2defec5..1dab817b 100644 --- a/src/include/PMsrHandler.h +++ b/src/include/PMsrHandler.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -102,6 +102,7 @@ class PMsrHandler virtual Bool_t CheckFuncs(); virtual Bool_t CheckHistoGrouping(); virtual Bool_t CheckAddRunParameters(); + virtual Bool_t CheckRRFSettings(); virtual void CheckMaxLikelihood(); virtual void GetGroupingString(Int_t runNo, TString detector, TString &groupingStr); @@ -152,7 +153,6 @@ class PMsrHandler virtual UInt_t NeededPrecision(Double_t dval, UInt_t precLimit=13); virtual UInt_t LastSignificant(Double_t dval, UInt_t precLimit=6); - virtual Bool_t ParseDetectorGrouping(TString str, PIntVector &group); virtual void MakeDetectorGroupingString(TString str, PIntVector &group, TString &result, Bool_t includeDetector = true); virtual void CheckLegacyLifetimecorrection(); diff --git a/src/include/PMusr.h b/src/include/PMusr.h index f083b13b..96df487f 100644 --- a/src/include/PMusr.h +++ b/src/include/PMusr.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -36,6 +36,12 @@ using namespace std; #include +// the following ifdef is needed for GCC 4.6 or higher, fftw 3.3 or higher and root 5.30.03 or lower +#ifdef __CINT__ +typedef struct { char a[7]; } __float128; // needed since cint doesn't know it +#endif +#include "fftw3.h" + #define PMUSR_SUCCESS 0 #define PMUSR_WRONG_STARTUP_SYNTAX -1 #define PMUSR_MSR_FILE_NOT_FOUND -2 @@ -46,10 +52,12 @@ using namespace std; #define PMUSR_MSR_FILE_WRITE_ERROR -7 #define PMUSR_DATA_FILE_READ_ERROR -8 -#define PRUN_SINGLE_HISTO 0 -#define PRUN_ASYMMETRY 2 -#define PRUN_MU_MINUS 4 -#define PRUN_NON_MUSR 8 +#define PRUN_SINGLE_HISTO 0 +#define PRUN_SINGLE_HISTO_RRF 1 +#define PRUN_ASYMMETRY 2 +#define PRUN_ASYMMETRY_RRF 3 +#define PRUN_MU_MINUS 4 +#define PRUN_NON_MUSR 8 // muon life time in (us), see PRL99, 032001 (2007) #define PMUON_LIFETIME 2.197019 @@ -86,17 +94,21 @@ using namespace std; //------------------------------------------------------------- // msr fit type tags -#define MSR_FITTYPE_SINGLE_HISTO 0 -#define MSR_FITTYPE_ASYM 2 -#define MSR_FITTYPE_MU_MINUS 4 -#define MSR_FITTYPE_NON_MUSR 8 +#define MSR_FITTYPE_SINGLE_HISTO 0 +#define MSR_FITTYPE_SINGLE_HISTO_RRF 1 +#define MSR_FITTYPE_ASYM 2 +#define MSR_FITTYPE_ASYM_RRF 3 +#define MSR_FITTYPE_MU_MINUS 4 +#define MSR_FITTYPE_NON_MUSR 8 //------------------------------------------------------------- // msr plot type tags -#define MSR_PLOT_SINGLE_HISTO 0 -#define MSR_PLOT_ASYM 2 -#define MSR_PLOT_MU_MINUS 4 -#define MSR_PLOT_NON_MUSR 8 +#define MSR_PLOT_SINGLE_HISTO 0 +#define MSR_PLOT_SINGLE_HISTO_RRF 1 +#define MSR_PLOT_ASYM 2 +#define MSR_PLOT_ASYM_RRF 3 +#define MSR_PLOT_MU_MINUS 4 +#define MSR_PLOT_NON_MUSR 8 //------------------------------------------------------------- // map and fun offsets for parameter parsing @@ -117,20 +129,24 @@ using namespace std; #define FOURIER_APOD_MEDIUM 3 #define FOURIER_APOD_STRONG 4 -#define FOURIER_PLOT_NOT_GIVEN 0 -#define FOURIER_PLOT_REAL 1 -#define FOURIER_PLOT_IMAG 2 -#define FOURIER_PLOT_REAL_AND_IMAG 3 -#define FOURIER_PLOT_POWER 4 -#define FOURIER_PLOT_PHASE 5 +#define FOURIER_PLOT_NOT_GIVEN 0 +#define FOURIER_PLOT_REAL 1 +#define FOURIER_PLOT_IMAG 2 +#define FOURIER_PLOT_REAL_AND_IMAG 3 +#define FOURIER_PLOT_POWER 4 +#define FOURIER_PLOT_PHASE 5 +#define FOURIER_PLOT_PHASE_OPT_REAL 6 //------------------------------------------------------------- // RRF related tags -#define RRF_UNIT_kHz 0 -#define RRF_UNIT_MHz 1 -#define RRF_UNIT_Mcs 2 -#define RRF_UNIT_G 3 -#define RRF_UNIT_T 4 +#define RRF_UNIT_UNDEF -1 +#define RRF_UNIT_kHz 0 +#define RRF_UNIT_MHz 1 +#define RRF_UNIT_Mcs 2 +#define RRF_UNIT_G 3 +#define RRF_UNIT_T 4 + +#define RRF_FREQ_UNDEF 1.0e10 //------------------------------------------------------------- /** @@ -535,6 +551,11 @@ class PMsrGlobalBlock { virtual ~PMsrGlobalBlock() {} virtual Bool_t IsPresent() { return fGlobalPresent; } + virtual Double_t GetRRFFreq(const char *unit); + virtual TString GetRRFUnit(); + virtual Int_t GetRRFUnitTag() { return fRRFUnitTag; } + virtual Double_t GetRRFPhase() { return fRRFPhase; } + virtual Int_t GetRRFPacking() { return fRRFPacking; } virtual Int_t GetFitType() { return fFitType; } virtual Int_t GetDataRange(UInt_t idx); virtual UInt_t GetT0BinSize() { return fT0.size(); } @@ -548,6 +569,9 @@ class PMsrGlobalBlock { virtual Int_t GetPacking() { return fPacking; } virtual void SetGlobalPresent(Bool_t bval) { fGlobalPresent = bval; } + virtual void SetRRFFreq(Double_t freq, const char *unit); + virtual void SetRRFPhase(Double_t phase) { fRRFPhase = phase; } + virtual void SetRRFPacking(Int_t pack); virtual void SetFitType(Int_t ival) { fFitType = ival; } virtual void SetDataRange(Int_t ival, Int_t idx); virtual void SetT0Bin(Double_t dval, Int_t idx=-1); @@ -559,10 +583,14 @@ class PMsrGlobalBlock { private: Bool_t fGlobalPresent; ///< flag showing if a GLOBAL block is present at all. - Int_t fFitType; ///< fit type: 0=single histo fit, 2=asymmetry fit, 4=mu^- single histo fit, 8=non muSR fit - Int_t fDataRange[4]; ///< data bin range (fit type 0, 2, 4) - PDoubleVector fT0; ///< t0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... - vector fAddT0; ///< addt0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... + Double_t fRRFFreq; ///< RRF frequency given in units of (MHz, Mc, T) + Int_t fRRFUnitTag; ///< RRF unit tag + Double_t fRRFPhase; ///< RRF phase in (°) + Int_t fRRFPacking; ///< RRF packing + Int_t fFitType; ///< fit type: 0=single histo fit, 1=single histo RRF fit, 2=asymmetry fit, 4=mu^- single histo fit, 8=non muSR fit + Int_t fDataRange[4]; ///< data bin range (fit type 0, 1, 2, 4) + PDoubleVector fT0; ///< t0 bins (fit type 0, 1, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... + vector fAddT0; ///< addt0 bins (fit type 0, 1, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... Bool_t fFitRangeInBins; ///< flag telling if fit range is given in time or in bins Double_t fFitRange[2]; ///< fit range in (us) Int_t fFitRangeOffset[2]; ///< if fit range is given in bins it can have the form fit fgb+n0 lgb-n1. This variable holds the n0 and n1. @@ -774,6 +802,7 @@ typedef struct { TString outTemplate; ///< holds the output file template TString year; ///< holds the information about the year to be used PIntVector runList; ///< holds the run number list to be converted + PIntVector groupHistoList; ///< holds the histo group list offset (used to define for MusrRoot files, what to be exported) PStringVector inFileName; ///< holds the file name of the input data file TString outFileName; ///< holds the output file name PStringVector outPathFileName; ///< holds the out path/file name @@ -794,4 +823,29 @@ typedef struct { Double_t alphaEstimateN0; ///< relates the Bkg to N0, i.e. Bkg = alpha*N0 } PStartupOptions; +//------------------------------------------------------------- +/** + *

Helper class which parses list of numbers of the following 3 forms and its combination. + * (i) list of integers separted by spaces, e.g. 1 3 7 14 + * (ii) a range of integers of the form nS-nE, e.g. 13-27 which will generate 13, 14, 15, .., 26, 27 + * (iii) a sequence of integers of the form nS:nE:nStep, e.g. 10:20:2 which will generate 10, 12, 14, .., 18, 20 + */ +class PStringNumberList { + public: + PStringNumberList(char *str) { fString = str; } + PStringNumberList(string str) { fString = str; } + virtual ~PStringNumberList() { fList.clear(); } + + virtual bool Parse(string &errorMsg, bool ignoreFirstToken=false); + virtual PUIntVector GetList() { return fList; } + + private: + string fString; + bool fIsValid; + PUIntVector fList; + + virtual bool IsNumber(string &str) { return (str.find_first_not_of("0123456789") == string::npos); } + virtual void StripSpaces(); +}; + #endif // _PMUSR_H_ diff --git a/src/include/PMusrCanvas.h b/src/include/PMusrCanvas.h index e8296e4c..735af4f4 100644 --- a/src/include/PMusrCanvas.h +++ b/src/include/PMusrCanvas.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -67,7 +67,7 @@ #define P_MENU_ID_FOURIER 10002 #define P_MENU_ID_DIFFERENCE 10003 #define P_MENU_ID_AVERAGE 10004 -#define P_MENU_ID_SAVE_DATA 10005 +#define P_MENU_ID_EXPORT_DATA 10005 #define P_MENU_PLOT_OFFSET 1000 @@ -79,8 +79,6 @@ #define P_MENU_ID_FOURIER_PHASE_PLUS 105 #define P_MENU_ID_FOURIER_PHASE_MINUS 106 -#define P_MENU_ID_SAVE_ASCII 200 - //------------------------------------------------------------------------ /** *

@@ -204,11 +202,13 @@ class PMusrCanvas : public TObject, public TQObject public: PMusrCanvas(); PMusrCanvas(const Int_t number, const Char_t* title, - Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch); + Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, const Bool_t batch, + const Bool_t fourier=false); PMusrCanvas(const Int_t number, const Char_t* title, Int_t wtopx, Int_t wtopy, Int_t ww, Int_t wh, PMsrFourierStructure fourierDefault, - const PIntVector markerList, const PIntVector colorList, const Bool_t batch); + const PIntVector markerList, const PIntVector colorList, const Bool_t batch, + const Bool_t fourier=false); virtual ~PMusrCanvas(); virtual Bool_t IsValid() { return fValid; } @@ -229,9 +229,10 @@ class PMusrCanvas : public TObject, public TQObject virtual void LastCanvasClosed(); // SLOT virtual void SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat); - virtual void SaveDataAscii(); + virtual void ExportData(const Char_t *fileName); private: + Bool_t fStartWithFourier; ///< flag if true, the Fourier transform will be presented bypassing the time domain representation Int_t fTimeout; ///< timeout after which the Done signal should be emited. If timeout <= 0, no timeout is taking place Bool_t fScaleN0AndBkg; ///< true=N0 and background is scaled to (1/ns), otherwise (1/bin) for the single histogram case Bool_t fBatchMode; ///< musrview in ROOT batch mode @@ -259,7 +260,6 @@ class PMusrCanvas : public TObject, public TQObject TRootCanvas *fImp; ///< ROOT native GUI version of main window with menubar and drawing area TGMenuBar *fBar; ///< menu bar TGPopupMenu *fPopupMain; ///< popup menu Musrfit in the main menu bar - TGPopupMenu *fPopupSave; ///< popup menu of the Musrfit/Save Data sub menu TGPopupMenu *fPopupFourier; ///< popup menu of the Musrfit/Fourier sub menu // canvas related variables diff --git a/src/include/PMusrCanvasLinkDef.h b/src/include/PMusrCanvasLinkDef.h index cf6b7dd3..c9c73b15 100644 --- a/src/include/PMusrCanvasLinkDef.h +++ b/src/include/PMusrCanvasLinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMusrT0.h b/src/include/PMusrT0.h index 91acf97f..b5a47c2f 100644 --- a/src/include/PMusrT0.h +++ b/src/include/PMusrT0.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMusrT0LinkDef.h b/src/include/PMusrT0LinkDef.h index a14248fd..d7e26cc4 100644 --- a/src/include/PMusrT0LinkDef.h +++ b/src/include/PMusrT0LinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PPrepFourier.h b/src/include/PPrepFourier.h index d1066809..dd40429f 100644 --- a/src/include/PPrepFourier.h +++ b/src/include/PPrepFourier.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -34,7 +34,8 @@ #include using namespace std; -#include "TH1F.h" +#include +#include #include "PMusr.h" @@ -44,11 +45,12 @@ using namespace std; * necessary meta information. */ typedef struct { - TString info; ///< keeps all the meta information - double timeResolution; ///< time resolution in (usec) - int t0; ///< keep the t0 bin - Double_t timeRange[2]; ///< time range to be used, given in (usec). - PDoubleVector rawData; ///< a single time domain data vector + Int_t dataSetTag; ///< tag to label the data set. Needed for average-per-data-set + TString info; ///< keeps all the meta information + Double_t timeResolution; ///< time resolution in (usec) + Int_t t0; ///< keep the t0 bin + Double_t timeRange[2]; ///< time range to be used, given in (usec). + PDoubleVector rawData; ///< a single time domain data vector } musrFT_data; //---------------------------------------------------------------------------- @@ -59,18 +61,19 @@ typedef struct { class PPrepFourier { public: PPrepFourier(); - PPrepFourier(const Int_t *bkgRange, const Int_t packing); + PPrepFourier(const Int_t packing, const Int_t *bkgRange, PDoubleVector bkg); virtual ~PPrepFourier(); - void SetBkgRange(const Int_t *bkgRange); - void SetPacking(const Int_t packing); - void AddData(musrFT_data &data); - void DoBkgCorrection(); - void DoPacking(); - void DoFiltering(); - void DoLifeTimeCorrection(Double_t fudge); + virtual void SetBkgRange(const Int_t *bkgRange); + virtual void SetBkg(PDoubleVector bkg); + virtual void SetPacking(const Int_t packing); + virtual void AddData(musrFT_data &data); + virtual void DoBkgCorrection(); + virtual void DoPacking(); + virtual void DoLifeTimeCorrection(Double_t fudge); TString GetInfo(const UInt_t idx); + Int_t GetDataSetTag(const UInt_t idx); UInt_t GetNoOfData() { return fRawData.size(); } vector GetData(); TH1F *GetData(const UInt_t idx); @@ -79,9 +82,10 @@ class PPrepFourier { vector fRawData; vectorfData; Int_t fBkgRange[2]; + PDoubleVector fBkg; Int_t fPacking; - void InitData(); + virtual void InitData(); }; #endif // _PPREPFOURIER_H_ diff --git a/src/include/PRunAsymmetry.h b/src/include/PRunAsymmetry.h index 6d18983b..1bb04701 100644 --- a/src/include/PRunAsymmetry.h +++ b/src/include/PRunAsymmetry.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PRunAsymmetryRRF.h b/src/include/PRunAsymmetryRRF.h new file mode 100644 index 00000000..d0aefd7d --- /dev/null +++ b/src/include/PRunAsymmetryRRF.h @@ -0,0 +1,81 @@ +/*************************************************************************** + + PRunAsymmetryRRF.h + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2016 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _PRUNASYMMETRYRRF_H_ +#define _PRUNASYMMETRYRRF_H_ + +#include "PRunBase.h" + +//--------------------------------------------------------------------------- +/** + *

Class handling the asymmetry fit. + */ +class PRunAsymmetryRRF : public PRunBase +{ + public: + PRunAsymmetryRRF(); + PRunAsymmetryRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag); + virtual ~PRunAsymmetryRRF(); + + virtual Double_t CalcChiSquare(const std::vector& par); + virtual Double_t CalcChiSquareExpected(const std::vector& par); + virtual Double_t CalcMaxLikelihood(const std::vector& par); + virtual void CalcTheory(); + + virtual UInt_t GetNoOfFitBins(); + + virtual void SetFitRangeBin(const TString fitRange); + + protected: + virtual void CalcNoOfFitBins(); + virtual Bool_t PrepareData(); + virtual Bool_t PrepareFitData(); + virtual Bool_t PrepareViewData(PRawRunData* runData, UInt_t histoNo[2]); + + private: + UInt_t fAlphaBetaTag; ///< \f$ 1 \to \alpha = \beta = 1\f$; \f$ 2 \to \alpha \neq 1, \beta = 1\f$; \f$ 3 \to \alpha = 1, \beta \neq 1\f$; \f$ 4 \to \alpha \neq 1, \beta \neq 1\f$. + UInt_t fNoOfFitBins; ///< number of bins to be be fitted + Int_t fRRFPacking; ///< RRF packing for this particular run. Given in the GLOBAL-block. + + PDoubleVector fForward; ///< forward histo data + PDoubleVector fForwardErr; ///< forward histo errors + PDoubleVector fBackward; ///< backward histo data + PDoubleVector fBackwardErr; ///< backward histo errors + + Int_t fGoodBins[4]; ///< keep first/last good bins. 0=fgb, 1=lgb (forward); 2=fgb, 3=lgb (backward) + + Bool_t SubtractFixBkg(); + Bool_t SubtractEstimatedBkg(); + + virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &forwardHisto, PUIntVector &backwardHistoNo); + virtual Bool_t GetProperDataRange(PRawRunData* runData, UInt_t histoNo[2]); + virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock); +}; + +#endif // _PRUNASYMMETRYRRF_H_ diff --git a/src/include/PRunBase.h b/src/include/PRunBase.h index 3e81b2be..37fad18b 100644 --- a/src/include/PRunBase.h +++ b/src/include/PRunBase.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PRunDataHandler.h b/src/include/PRunDataHandler.h index 68c27eab..f75c1428 100644 --- a/src/include/PRunDataHandler.h +++ b/src/include/PRunDataHandler.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -61,7 +61,7 @@ class PRunDataHandler virtual Bool_t IsAllDataAvailable() const { return fAllDataAvailable; } virtual PRawRunData* GetRunData(const TString &runName); virtual PRawRunData* GetRunData(const UInt_t idx=0); - virtual TString GetRunPathName() {return fRunPathName; } + virtual Int_t GetNoOfRunData() {return fData.size(); } private: PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler diff --git a/src/include/PRunListCollection.h b/src/include/PRunListCollection.h index 8a741416..00b1112e 100644 --- a/src/include/PRunListCollection.h +++ b/src/include/PRunListCollection.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -37,7 +37,9 @@ using namespace std; #include "PMsrHandler.h" #include "PRunDataHandler.h" #include "PRunSingleHisto.h" +#include "PRunSingleHistoRRF.h" #include "PRunAsymmetry.h" +#include "PRunAsymmetryRRF.h" #include "PRunMuMinus.h" #include "PRunNonMusr.h" @@ -58,7 +60,9 @@ class PRunListCollection virtual void SetFitRange(const TString fitRange); virtual Double_t GetSingleHistoChisq(const std::vector& par) const; + virtual Double_t GetSingleHistoRRFChisq(const std::vector& par) const; virtual Double_t GetAsymmetryChisq(const std::vector& par) const; + virtual Double_t GetAsymmetryRRFChisq(const std::vector& par) const; virtual Double_t GetMuMinusChisq(const std::vector& par) const; virtual Double_t GetNonMusrChisq(const std::vector& par) const; @@ -66,7 +70,9 @@ class PRunListCollection virtual Double_t GetSingleRunChisq(const std::vector& par, const UInt_t idx) const; virtual Double_t GetSingleHistoMaximumLikelihood(const std::vector& par) const; + virtual Double_t GetSingleHistoRRFMaximumLikelihood(const std::vector& par) const; virtual Double_t GetAsymmetryMaximumLikelihood(const std::vector& par) const; + virtual Double_t GetAsymmetryRRFMaximumLikelihood(const std::vector& par) const; virtual Double_t GetMuMinusMaximumLikelihood(const std::vector& par) const; virtual Double_t GetNonMusrMaximumLikelihood(const std::vector& par) const; @@ -74,12 +80,16 @@ class PRunListCollection virtual UInt_t GetTotalNoOfBinsFitted() const; virtual UInt_t GetNoOfSingleHisto() const { return fRunSingleHistoList.size(); } ///< returns the number of single histogram data sets present in the msr-file + virtual UInt_t GetNoOfSingleHistoRRF() const { return fRunSingleHistoRRFList.size(); } ///< returns the number of single histogram RRF data sets present in the msr-file virtual UInt_t GetNoOfAsymmetry() const { return fRunAsymmetryList.size(); } ///< returns the number of asymmetry data sets present in the msr-file + virtual UInt_t GetNoOfAsymmetryRRF() const { return fRunAsymmetryRRFList.size(); } ///< returns the number of asymmetry RRF data sets present in the msr-file virtual UInt_t GetNoOfMuMinus() const { return fRunMuMinusList.size(); } ///< returns the number of mu minus data sets present in the msr-file virtual UInt_t GetNoOfNonMusr() const { return fRunNonMusrList.size(); } ///< returns the number of non-muSR data sets present in the msr-file virtual PRunData* GetSingleHisto(UInt_t index, EDataSwitch tag=kIndex); + virtual PRunData* GetSingleHistoRRF(UInt_t index, EDataSwitch tag=kIndex); virtual PRunData* GetAsymmetry(UInt_t index, EDataSwitch tag=kIndex); + virtual PRunData* GetAsymmetryRRF(UInt_t index, EDataSwitch tag=kIndex); virtual PRunData* GetMuMinus(UInt_t index, EDataSwitch tag=kIndex); virtual PRunData* GetNonMusr(UInt_t index, EDataSwitch tag=kIndex); @@ -94,10 +104,12 @@ class PRunListCollection PMsrHandler *fMsrInfo; ///< pointer to the msr-file handler PRunDataHandler *fData; ///< pointer to the run-data handler - vector fRunSingleHistoList; ///< stores all processed single histogram data - vector fRunAsymmetryList; ///< stores all processed asymmetry data - vector fRunMuMinusList; ///< stores all processed mu-minus data - vector fRunNonMusrList; ///< stores all processed non-muSR data + vector fRunSingleHistoList; ///< stores all processed single histogram data + vector fRunSingleHistoRRFList; ///< stores all processed single histogram RRF data + vector fRunAsymmetryList; ///< stores all processed asymmetry data + vector fRunAsymmetryRRFList; ///< stores all processed asymmetry RRF data + vector fRunMuMinusList; ///< stores all processed mu-minus data + vector fRunNonMusrList; ///< stores all processed non-muSR data }; #endif // _PRUNLISTCOLLECTION_H_ diff --git a/src/include/PRunMuMinus.h b/src/include/PRunMuMinus.h index 5c13ce68..6c731dd6 100644 --- a/src/include/PRunMuMinus.h +++ b/src/include/PRunMuMinus.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PRunNonMusr.h b/src/include/PRunNonMusr.h index 7b4685e5..3bb7ce97 100644 --- a/src/include/PRunNonMusr.h +++ b/src/include/PRunNonMusr.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PRunSingleHisto.h b/src/include/PRunSingleHisto.h index 4e9347f3..3980cff1 100644 --- a/src/include/PRunSingleHisto.h +++ b/src/include/PRunSingleHisto.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PRunSingleHistoRRF.h b/src/include/PRunSingleHistoRRF.h new file mode 100644 index 00000000..63b063eb --- /dev/null +++ b/src/include/PRunSingleHistoRRF.h @@ -0,0 +1,83 @@ +/*************************************************************************** + + PRunSingleHistoRRF.h + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2016 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _PRUNSINGLEHISTORRF_H_ +#define _PRUNSINGLEHISTORRF_H_ + +#include "PRunBase.h" + +/** + *

Class handling single histogram fit type. + */ +class PRunSingleHistoRRF : public PRunBase +{ + public: + PRunSingleHistoRRF(); + PRunSingleHistoRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag); + virtual ~PRunSingleHistoRRF(); + + virtual Double_t CalcChiSquare(const std::vector& par); + virtual Double_t CalcChiSquareExpected(const std::vector& par); + virtual Double_t CalcMaxLikelihood(const std::vector& par); + virtual void CalcTheory(); + + virtual UInt_t GetNoOfFitBins(); + + virtual void SetFitRangeBin(const TString fitRange); + + protected: + virtual void CalcNoOfFitBins(); + virtual Bool_t PrepareData(); + virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo); + virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo); + + private: + static const Double_t fN0EstimateEndTime = 1.0; ///< end time in (us) over which N0 is estimated. Should eventually be estimated automatically ... + + UInt_t fNoOfFitBins; ///< number of bins to be fitted + Double_t fBackground; ///< needed if background range is given (units: 1/bin) + Int_t fRRFPacking; ///< RRF packing for this particular run. Given in the GLOBAL-block. + + Int_t fGoodBins[2]; ///< keep first/last good bins. 0=fgb, 1=lgb + + PDoubleVector fForward; ///< forward histo data + PDoubleVector fM; ///< vector holding M(t) = [N(t)-N_bkg] exp(+t/tau). Needed to estimate N0. + PDoubleVector fMerr; ///< vector holding the error of M(t): M_err = exp(+t/tau) sqrt(N(t)). + PDoubleVector fW; ///< vector holding the weight needed to estimate N0, and errN0. + PDoubleVector fAerr; ///< vector holding the errors of estimated A(t) + + virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo); + virtual Bool_t GetProperDataRange(); + virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock); + virtual Double_t GetMainFrequency(PDoubleVector &data); + virtual Double_t EstimateN0(Double_t &errN0, Double_t freqMax); + virtual Bool_t EstimateBkg(UInt_t histoNo); +}; + +#endif // _PRUNSINGLEHISTORRF_H_ diff --git a/src/include/PStartupHandler.h b/src/include/PStartupHandler.h index f91dc679..9125a67b 100644 --- a/src/include/PStartupHandler.h +++ b/src/include/PStartupHandler.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PStartupHandlerLinkDef.h b/src/include/PStartupHandlerLinkDef.h index dd099371..036977e7 100644 --- a/src/include/PStartupHandlerLinkDef.h +++ b/src/include/PStartupHandlerLinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PTheory.h b/src/include/PTheory.h index 7baa44bc..85f79ddf 100644 --- a/src/include/PTheory.h +++ b/src/include/PTheory.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PUserFcn.h b/src/include/PUserFcn.h index 0c5c1fa6..dacb4041 100644 --- a/src/include/PUserFcn.h +++ b/src/include/PUserFcn.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PUserFcnBase.h b/src/include/PUserFcnBase.h index 558c8c41..a920727c 100644 --- a/src/include/PUserFcnBase.h +++ b/src/include/PUserFcnBase.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PUserFcnBaseLinkDef.h b/src/include/PUserFcnBaseLinkDef.h index 5f78c800..843c143a 100644 --- a/src/include/PUserFcnBaseLinkDef.h +++ b/src/include/PUserFcnBaseLinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/msr2data.cpp b/src/msr2data.cpp index ec2d43ba..58babb8b 100644 --- a/src/msr2data.cpp +++ b/src/msr2data.cpp @@ -37,6 +37,7 @@ #endif #include "git-revision.h" +#include "PMusr.h" #include "PMsr2Data.h" #include @@ -87,12 +88,17 @@ void msr2data_syntax() cout << endl << " [fit [-k] [-t] | fit-