diff --git a/ChangeLog b/ChangeLog index 2bd3a9c1..249b9c8d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,10 +4,17 @@ changes since 0.13.0 =================================== +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 2015-01-17 adding a branch for ROOT 6.x. This needs some minor adaptations due to the new rootcint/rootclang and the stricter c++11. NEW 2014-12-18 first implementation of a GLOBAL block which allows to shorten diff --git a/configure.ac b/configure.ac index 74e1ecb6..ecd1034c 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.14.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=14 MUSR_MICRO_VERSION=0 #release versioning @@ -733,6 +733,12 @@ dnl ----------------------------------------------- AC_ARG_ENABLE([ASlibs], [AS_HELP_STRING([--enable-ASlibs],[build optional AS plug-ins [default=no]])],[BUILD_AS_LIBS=1], [BUILD_AS_LIBS=0]) +dnl ----------------------------------------------- +dnl Ask user if BNMRlibs should be built +dnl ----------------------------------------------- + +AC_ARG_ENABLE([BNMRlibs], [AS_HELP_STRING([--enable-BNMRlibs],[build optional BNMR plug-ins [default=no]])],[BUILD_BNMR_LIBS=1], [BUILD_BNMR_LIBS=0]) + dnl ----------------------------------------------- dnl Set some paths and flags for PMusr, MusrRoot, TLemRunHeader, Class_MuSR_PSI, mud, NeXus (if enabled), etc. dnl ----------------------------------------------- @@ -780,6 +786,14 @@ if test "${PNEXUS_ENABLED}" = "1"; then AC_SUBST(PNEXUS_CXXFLAGS) fi +if test "${BUILD_BNMR_LIBS}" = "1"; then + BNMRLIBS_SRCDIR="${SRCDIR}/external/libBNMR" + BNMRLIBS_LIBS="${BNMRLIBS_SRCDIR}/libBNMR.la" + BNMRLIBS_CFLAGS="-I${BNMRLIBS_SRCDIR}" + AC_SUBST(BNMRLIBS_LIBS) + AC_SUBST(BNMRLIBS_CFLAGS) +fi + if test "${BUILD_BMW_LIBS}" = "1"; then BMWTOOLS_SRCDIR="${SRCDIR}/external/BMWtools" BMWTOOLS_LIBS="${BMWTOOLS_SRCDIR}/libBMWtools.la" @@ -1114,6 +1128,7 @@ AM_CONDITIONAL([PNEXUS_ENABLED], [test "${PNEXUS_ENABLED}" = "1"]) AM_CONDITIONAL([BUILD_CUBALIB], [test "${BUILD_CUBA}" = "1"]) AM_CONDITIONAL([BUILD_BMWLIBS], [test "${BUILD_BMW_LIBS}" = "1"]) AM_CONDITIONAL([BUILD_ASLIBS], [test "${BUILD_AS_LIBS}" = "1"]) +AM_CONDITIONAL([BUILD_BNMRLIBS], [test "${BUILD_BNMR_LIBS}" = "1"]) AC_CONFIG_FILES([Makefile \ src/Makefile \ @@ -1154,6 +1169,9 @@ AC_CONFIG_FILES([Makefile \ src/external/libSpinValve/classes/Makefile \ src/external/libPhotoMeissner/Makefile \ src/external/libPhotoMeissner/classes/Makefile \ + src/external/libBNMR/Makefile \ + src/musredit/Makefile \ + src/musrgui/Makefile \ src/musredit/musredit_startup.xml \ src/musrgui/musrgui_startup.xml]) @@ -1273,6 +1291,11 @@ if test "${BUILD_AS_LIBS}" -eq 1; then else echo " ASlibs: no" fi +if test "${BUILD_BNMR_LIBS}" -eq 1; then + echo " BNMRlibs: yes" +else + echo " BNMRlibs: no" +fi if test "${BUILD_BMW_LIBS}" -eq 1; then echo " BMWlibs: yes" else diff --git a/doc/html/user/MUSR/BmwLibs.html b/doc/html/user/MUSR/BmwLibs.html index 492bc7f1..3ee693e6 100644 --- a/doc/html/user/MUSR/BmwLibs.html +++ b/doc/html/user/MUSR/BmwLibs.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {
Print version

- - - + + +

@@ -144,7 +144,7 @@ pre {
Topic revision: r5 - 10 Jul 2011, wojek
@@ -168,7 +168,7 @@ pre {
  • newtopic Create New Topic
  • index Show All Topics
  • searchtopic Search in Topics -
  • changes Recent Changes +
  • changes Recent Changes
  • notify Define Notifications
  • @@ -181,12 +181,11 @@ pre {

    -

    @@ -195,7 +194,7 @@ pre { - +

    diff --git a/doc/html/user/MUSR/CiteMusrFit.html b/doc/html/user/MUSR/CiteMusrFit.html index fe86b5fd..6db84c60 100644 --- a/doc/html/user/MUSR/CiteMusrFit.html +++ b/doc/html/user/MUSR/CiteMusrFit.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {
    Print version

    - - - + + +

    @@ -142,7 +142,7 @@ Since quite some effort is going into the development and maintenance of the
    Topic revision: r2 - 19 Jun 2012, AndreasSuter
    @@ -166,7 +166,7 @@ Since quite some effort is going into the development and maintenance of the newtopic Create New Topic
  • index Show All Topics
  • searchtopic Search in Topics -
  • changes Recent Changes +
  • changes Recent Changes
  • notify Define Notifications
  • @@ -179,12 +179,11 @@ Since quite some effort is going into the development and maintenance of the

    -

    @@ -193,7 +192,7 @@ Since quite some effort is going into the development and maintenance of the - +

    diff --git a/doc/html/user/MUSR/LibFitPofB.html b/doc/html/user/MUSR/LibFitPofB.html index 734a904d..66a1108f 100644 --- a/doc/html/user/MUSR/LibFitPofB.html +++ b/doc/html/user/MUSR/LibFitPofB.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

    - - - + + +

    @@ -420,7 +420,7 @@ An example XML file looks as follows:
    Topic revision: r16 - 10 Jul 2011, wojek
    @@ -444,7 +444,7 @@ An example XML file looks as follows:
  • newtopic Create New Topic
  • index Show All Topics
  • searchtopic Search in Topics -
  • changes Recent Changes +
  • changes Recent Changes
  • notify Define Notifications
  • @@ -457,12 +457,11 @@ An example XML file looks as follows:

      -
    • +

    -

    @@ -471,7 +470,7 @@ An example XML file looks as follows: - +

    diff --git a/doc/html/user/MUSR/LibZFRelaxation.html b/doc/html/user/MUSR/LibZFRelaxation.html index e0e3358c..6ee6e133 100644 --- a/doc/html/user/MUSR/LibZFRelaxation.html +++ b/doc/html/user/MUSR/LibZFRelaxation.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

    - - - + + +

    @@ -225,7 +225,7 @@ The parameters are:
    Topic revision: r2 - 10 Jul 2011, wojek
    @@ -249,7 +249,7 @@ The parameters are:
    1. newtopic Create New Topic
    2. index Show All Topics
    3. searchtopic Search in Topics -
    4. changes Recent Changes +
    5. changes Recent Changes
    6. notify Define Notifications
    7. @@ -262,12 +262,11 @@ The parameters are:

          -
        • +

        -

        @@ -276,7 +275,7 @@ The parameters are:
          - +

          diff --git a/doc/html/user/MUSR/Msr2Data.html b/doc/html/user/MUSR/Msr2Data.html index d4ace4e6..d290fd3a 100644 --- a/doc/html/user/MUSR/Msr2Data.html +++ b/doc/html/user/MUSR/Msr2Data.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

          - - - + + +

          @@ -349,7 +349,7 @@ For reporting bugs or requesting new features and improvements please use the - @@ -395,7 +395,7 @@ For reporting bugs or requesting new features and improvements please use the newtopic Create New Topic
        1. index Show All Topics
        2. searchtopic Search in Topics -
        3. changes Recent Changes +
        4. changes Recent Changes
        5. notify Define Notifications
        6. @@ -408,12 +408,11 @@ For reporting bugs or requesting new features and improvements please use the Paul Scherrer Institut

            -
          • +

          -

          @@ -422,7 +421,7 @@ For reporting bugs or requesting new features and improvements please use the - +

          diff --git a/doc/html/user/MUSR/MusrFit.html b/doc/html/user/MUSR/MusrFit.html index 42e934d2..395627be 100644 --- a/doc/html/user/MUSR/MusrFit.html +++ b/doc/html/user/MUSR/MusrFit.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

          - - - + + +

          @@ -124,11 +124,12 @@ pre {
        7. 2 Available Executables, Configuration Files and their Basic Usage
        8. 3 Auxiliary Programs
        9. 4 Description of the msr File Format
            @@ -210,7 +211,7 @@ In the menu bar the Musrfit menu can be found. From there some
            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,8 +222,56 @@ 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 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 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. +
            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. +
            u
            reset the plotting range to the area given in the msr-file or the form the command line ("unzoom") +
            +

            -

            2.3 musrt0

            +

            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>. @@ -253,7 +302,7 @@ Using the key Q, musrt0 can be interrupted. No cha 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. @@ -309,7 +358,7 @@ An example would look like:

            -

            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) @@ -321,7 +370,7 @@ A typical example then looks like: 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:
              @@ -367,7 +416,7 @@ Will take the runs 100 through 117 and convert the NeXus input file 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.

              @@ -1540,20 +1589,8 @@ For reporting bugs or requesting new features and improvements please use the -
              -

              Attachments (2)

              -
              -
               
              -
              - - - - - - -
        10. @@ -1562,9 +1599,9 @@ For reporting bugs or requesting new features and improvements please use the -
          Topic revision: r117 - 18 Dec 2014, AndreasSuter
          +
          Topic revision: r123 - 19 Feb 2015, AndreasSuter
          @@ -1586,7 +1623,7 @@ For reporting bugs or requesting new features and improvements please use the newtopic Create New Topic
        11. index Show All Topics
        12. searchtopic Search in Topics -
        13. changes Recent Changes +
        14. changes Recent Changes
        15. notify Define Notifications
        16. @@ -1599,12 +1636,11 @@ For reporting bugs or requesting new features and improvements please use the Paul Scherrer Institut

            -
          • +

          -

          @@ -1613,7 +1649,7 @@ For reporting bugs or requesting new features and improvements please use the - +

          diff --git a/doc/html/user/MUSR/MusrFitAcknowledgements.html b/doc/html/user/MUSR/MusrFitAcknowledgements.html index 927d0854..1bfe6d00 100644 --- a/doc/html/user/MUSR/MusrFitAcknowledgements.html +++ b/doc/html/user/MUSR/MusrFitAcknowledgements.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

          - - - + + +

          @@ -142,7 +142,7 @@ pre {
          Topic revision: r4 - 10 Jul 2011, wojek
          @@ -166,7 +166,7 @@ pre {
        17. newtopic Create New Topic
        18. index Show All Topics
        19. searchtopic Search in Topics -
        20. changes Recent Changes +
        21. changes Recent Changes
        22. notify Define Notifications
        23. @@ -179,12 +179,11 @@ pre {

            -
          • +

          -

          @@ -193,7 +192,7 @@ pre { - +

          diff --git a/doc/html/user/MUSR/MusrFitSetup.html b/doc/html/user/MUSR/MusrFitSetup.html index bdc0e1e6..e36c8315 100644 --- a/doc/html/user/MUSR/MusrFitSetup.html +++ b/doc/html/user/MUSR/MusrFitSetup.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

          - - - + + +

          @@ -846,7 +846,7 @@ musrview test-histo-ROOT-NPP.msr
          Topic revision: r60 - 25 Oct 2014, AndreasSuter
          @@ -870,7 +870,7 @@ musrview test-histo-ROOT-NPP.msr
        24. newtopic Create New Topic
        25. index Show All Topics
        26. searchtopic Search in Topics -
        27. changes Recent Changes +
        28. changes Recent Changes
        29. notify Define Notifications
        30. @@ -883,12 +883,11 @@ musrview test-histo-ROOT-NPP.msr

            -
          • +

          -

          @@ -897,7 +896,7 @@ musrview test-histo-ROOT-NPP.msr - +

          diff --git a/doc/html/user/MUSR/MusrGui.html b/doc/html/user/MUSR/MusrGui.html index 222bf1a4..c76fb0d9 100644 --- a/doc/html/user/MUSR/MusrGui.html +++ b/doc/html/user/MUSR/MusrGui.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,22 +108,22 @@ pre {

          - - - + + +

          -

          musrgui / musredit

          +

          musredit / (musrgui)

          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.
          +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.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 @@ -148,10 +148,10 @@ 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) @@ -291,6 +291,9 @@ The features of musrfit which can be accessed by the graphical fron

          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. @@ -310,9 +313,9 @@ Besides the functions described above and which are mostly interfacing mus

          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
          +-- AS & BMW
          @@ -324,8 +327,8 @@ For reporting bugs or requesting new features and improvements please use the -
          Topic revision: r19 - 25 May 2012, AndreasSuter
          +
          Topic revision: r20 - 19 Feb 2015, AndreasSuter
          @@ -370,7 +373,7 @@ For reporting bugs or requesting new features and improvements please use the newtopic Create New Topic
        31. index Show All Topics
        32. searchtopic Search in Topics -
        33. changes Recent Changes +
        34. changes Recent Changes
        35. notify Define Notifications
        36. @@ -383,12 +386,11 @@ For reporting bugs or requesting new features and improvements please use the Paul Scherrer Institut

            -
          • +

          -

          @@ -397,7 +399,7 @@ For reporting bugs or requesting new features and improvements please use the - +

          diff --git a/doc/html/user/MUSR/MusrRoot.html b/doc/html/user/MUSR/MusrRoot.html index c81b5d54..8d53c6cd 100644 --- a/doc/html/user/MUSR/MusrRoot.html +++ b/doc/html/user/MUSR/MusrRoot.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

          - - - + + +

          @@ -1038,7 +1038,7 @@ Result in the RunHeader/SampleEnvironmentInfo: -
          +

          Attachments (2)

           
          @@ -1060,7 +1060,7 @@ Result in the RunHeader/SampleEnvironmentInfo:
          Topic revision: r7 - 29 Mar 2012, AndreasSuter
          @@ -1084,7 +1084,7 @@ Result in the RunHeader/SampleEnvironmentInfo:
        37. newtopic Create New Topic
        38. index Show All Topics
        39. searchtopic Search in Topics -
        40. changes Recent Changes +
        41. changes Recent Changes
        42. notify Define Notifications
        43. @@ -1097,12 +1097,11 @@ Result in the RunHeader/SampleEnvironmentInfo:

            -
          • +

          -

          @@ -1111,7 +1110,7 @@ Result in the RunHeader/SampleEnvironmentInfo:
          - +

          diff --git a/doc/html/user/MUSR/QuickStart.html b/doc/html/user/MUSR/QuickStart.html index 67007c7b..b7f0eccd 100644 --- a/doc/html/user/MUSR/QuickStart.html +++ b/doc/html/user/MUSR/QuickStart.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

          - - - + + +

          @@ -280,7 +280,7 @@ RUN 2008/lem08_his_8472 MUE4 PSI ROOT-NPP (name beamline institute dat
          Topic revision: r7 - 10 Jul 2011, wojek
          @@ -304,7 +304,7 @@ RUN 2008/lem08_his_8472 MUE4 PSI ROOT-NPP (name beamline institute dat
        44. newtopic Create New Topic
        45. index Show All Topics
        46. searchtopic Search in Topics -
        47. changes Recent Changes +
        48. changes Recent Changes
        49. notify Define Notifications
        50. @@ -317,12 +317,11 @@ RUN 2008/lem08_his_8472 MUE4 PSI ROOT-NPP (name beamline institute dat

            -
          • +

          -

          @@ -331,7 +330,7 @@ RUN 2008/lem08_his_8472 MUE4 PSI ROOT-NPP (name beamline institute dat - +

          diff --git a/doc/html/user/MUSR/TutorialSingleHisto.html b/doc/html/user/MUSR/TutorialSingleHisto.html index 34873b08..4a4a5f62 100644 --- a/doc/html/user/MUSR/TutorialSingleHisto.html +++ b/doc/html/user/MUSR/TutorialSingleHisto.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {

          - - - + + +

          @@ -281,7 +281,7 @@ This page only summarizes the very basic features and options of the programs co -
          +

          Attachments (6)

           
          @@ -303,7 +303,7 @@ This page only summarizes the very basic features and options of the programs co
          Topic revision: r9 - 02 Sep 2011, wojek
          @@ -327,7 +327,7 @@ This page only summarizes the very basic features and options of the programs co
        51. newtopic Create New Topic
        52. index Show All Topics
        53. searchtopic Search in Topics -
        54. changes Recent Changes +
        55. changes Recent Changes
        56. notify Define Notifications
        57. @@ -340,12 +340,11 @@ This page only summarizes the very basic features and options of the programs co

            -
          • +

          -

          @@ -354,7 +353,7 @@ This page only summarizes the very basic features and options of the programs co
          - +

          diff --git a/doc/html/user/MUSR/WebHome.html b/doc/html/user/MUSR/WebHome.html index eef6a90e..9318645f 100644 --- a/doc/html/user/MUSR/WebHome.html +++ b/doc/html/user/MUSR/WebHome.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -108,9 +108,9 @@ pre {
          @@ -156,9 +156,9 @@ pre {
          Topic revision: r46 - 18 Dec 2014, AndreasSuter
          +
          Topic revision: r49 - 19 Feb 2015, AndreasSuter
          @@ -180,7 +180,7 @@ pre {
        58. newtopic Create New Topic
        59. index Show All Topics
        60. searchtopic Search in Topics -
        61. changes Recent Changes +
        62. changes Recent Changes
        63. notify Define Notifications
        64. @@ -193,12 +193,11 @@ pre {

            -
          • +

          -

          @@ -207,7 +206,7 @@ pre { - +

          diff --git a/src/Makefile.am b/src/Makefile.am index 3d0d9c75..733f3445 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -22,15 +22,17 @@ SUBDIRS = external/MusrRoot \ external/mud \ $(PNEXUSDIRS) \ classes \ - external + external \ + 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 diff --git a/src/classes/PFourier.cpp b/src/classes/PFourier.cpp index a660e141..38f94d12 100644 --- a/src/classes/PFourier.cpp +++ b/src/classes/PFourier.cpp @@ -200,6 +200,23 @@ void PFourier::Transform(UInt_t apodizationTag) } } +//-------------------------------------------------------------------------- +// GetMaxFreq +//-------------------------------------------------------------------------- +/** + *

          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 //-------------------------------------------------------------------------- diff --git a/src/classes/PFourierCanvas.cpp b/src/classes/PFourierCanvas.cpp index 9c33bd04..b31cc3e6 100644 --- a/src/classes/PFourierCanvas.cpp +++ b/src/classes/PFourierCanvas.cpp @@ -43,8 +43,8 @@ using namespace std; #define YINFO 0.2 #define YTITLE 0.95 -static const char *gFiletypes[] = { "All files", "*", - "Data files", "*.dat", +static const char *gFiletypes[] = { "Data files", "*.dat", + "All files", "*", 0, 0 }; ClassImpQ(PFourierCanvas) @@ -119,7 +119,7 @@ PFourierCanvas::PFourierCanvas(vector &fourier, const Char_t* title, CreateXaxisTitle(); CreateStyle(); InitFourierDataSets(); - InitFourierCanvas(title, wtopx, wtopy, ww, wh); + InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh); gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling } @@ -163,7 +163,7 @@ PFourierCanvas::PFourierCanvas(vector &fourier, const Char_t* title, CreateXaxisTitle(); CreateStyle(); InitFourierDataSets(); - InitFourierCanvas(title, wtopx, wtopy, ww, wh); + InitFourierCanvas(fTitle, wtopx, wtopy, ww, wh); gStyle->SetHistMinimumZero(kTRUE); // needed to enforce proper bar option handling } @@ -856,7 +856,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(); @@ -918,7 +918,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; @@ -1345,8 +1345,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); diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 9a91f134..226374aa 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -2861,29 +2861,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; } @@ -5054,7 +5031,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; @@ -5338,6 +5315,9 @@ Bool_t PMsrHandler::CheckFuncs() { Bool_t result = true; + if (fFourierOnly) + return result; + PIntVector funVec; PIntVector funBlock; PIntVector funLineBlockNo; diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index 4fcf2bd5..760d7b2f 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -35,10 +35,15 @@ using namespace std; #include #include #include +#include #include "PMusrCanvas.h" #include "PFourier.h" +static const char *gFiletypes[] = { "Data files", "*.dat", + "All files", "*", + 0, 0 }; + ClassImp(PMusrCanvasPlotRange) //-------------------------------------------------------------------------- @@ -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) { @@ -703,7 +707,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(); + } } //-------------------------------------------------------------------------- @@ -1282,8 +1341,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 @@ -1362,13 +1429,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 +2088,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 +2418,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; @@ -2415,10 +2466,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(); @@ -3358,10 +3406,14 @@ 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; 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 +3866,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 +3880,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 +3894,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 +3908,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 +3922,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 +3932,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 +3946,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 +3960,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 +3974,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 +3988,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 +4002,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 +4016,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 +4030,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 +4044,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()); } diff --git a/src/classes/PPrepFourier.cpp b/src/classes/PPrepFourier.cpp index cf077229..4af9c662 100644 --- a/src/classes/PPrepFourier.cpp +++ b/src/classes/PPrepFourier.cpp @@ -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); } //-------------------------------------------------------------------------- @@ -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 (unsigned int 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 (unsigned int i=0; i= fRawData[i].rawData.size()) || (fBkgRange[1] >= fRawData[i].rawData.size())) { + cerr << endl << "PPrepFourier::DoBkgCorrection() **ERROR** bkg-range out of data-range!"; + return; + } + } + + Double_t bkg=0.0; + for (unsigned int i=0; i background " << i << ": " << bkg << endl; + + // correct data + for (unsigned int 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 //-------------------------------------------------------------------------- @@ -417,7 +437,7 @@ TH1F *PPrepFourier::GetData(const UInt_t idx) } //-------------------------------------------------------------------------- -// InitData +// InitData (private) //-------------------------------------------------------------------------- /** *

          Copy raw-data to internal data from t0 to the size of raw-data. diff --git a/src/external/Makefile.am b/src/external/Makefile.am index 360579d1..755d9210 100644 --- a/src/external/Makefile.am +++ b/src/external/Makefile.am @@ -19,4 +19,8 @@ if BUILD_BMWLIBS libCalcMeanFieldsLEM endif -SUBDIRS = $(ASDIRS) $(CUBADIRS) $(BMWDIRS) +if BUILD_BNMRLIBS + BNMRDIRS = libBNMR +endif + +SUBDIRS = $(ASDIRS) $(CUBADIRS) $(BMWDIRS) $(BNMRDIRS) diff --git a/src/external/libBNMR/Makefile.am b/src/external/libBNMR/Makefile.am new file mode 100644 index 00000000..8023d07b --- /dev/null +++ b/src/external/libBNMR/Makefile.am @@ -0,0 +1,52 @@ +## Process this file with automake to create Makefile.in + +h_sources = \ + TBNMR.h + +h_linkdef = \ + TBNMRLinkDef.h + +dict_h_sources = \ + TBNMRDict.h + +cpp_sources = \ + TBNMR.cpp + +dict_cpp_sources = \ + TBNMRDict.cpp + +include_HEADERS = $(h_sources) +noinst_HEADERS = $(h_linkdef) $(dict_h_sources) + +AM_CPPFLAGS = -I$(top_srcdir)/src/include $(PMUSR_CFLAGS) -I$(ROOTINCDIR) +AM_CXXFLAGS = $(LOCAL_LIB_CXXFLAGS) + +BUILT_SOURCES = $(dict_cpp_sources) $(dict_h_sources) +AM_LDFLAGS = $(LOCAL_LIB_LDFLAGS) -L@ROOTLIBDIR@ +CLEANFILES = *Dict.cpp *Dict.h *~ core + +%Dict.cpp %Dict.h: %.h %LinkDef.h + @ROOTCINT@ -v -f $*Dict.cpp -c -p $(AM_CPPFLAGS) $^ + +lib_LTLIBRARIES = libBNMR.la + +libBNMR_la_SOURCES = $(h_sources) $(cpp_sources) $(dict_h_sources) $(dict_cpp_sources) +libBNMR_la_LIBADD = $(ROOT_LIBS) +libBNMR_la_LDFLAGS = -version-info $(PLUGIN_LIBRARY_VERSION) -release $(PLUGIN_RELEASE) $(AM_LDFLAGS) + +## However, create some symbolic links to the shared library +## in order to unify the function call on different operating systems + +if IS_DARWIN +install-exec-hook: + $(LN_S) -f $(libdir)/libBNMR.dylib $(libdir)/libBNMR.so +uninstall-hook: + rm -f $(libdir)/libBNMR.so +endif + +if IS_CYGWIN +install-exec-hook: + $(LN_S) -f $(bindir)/cygBNMR-$(PLUGIN_MAJOR_VERSION)-$(PLUGIN_MINOR_VERSION)-$(PLUGIN_MAJOR_VERSION).dll $(libdir)/libBNMR.so +uninstall-hook: + rm -f $(libdir)/libBNMR.so +endif diff --git a/src/include/PFourier.h b/src/include/PFourier.h index 787450e1..868b1d09 100644 --- a/src/include/PFourier.h +++ b/src/include/PFourier.h @@ -55,6 +55,7 @@ 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* GetImaginaryFourier(const Double_t scale = 1.0); virtual TH1F* GetPowerFourier(const Double_t scale = 1.0); diff --git a/src/include/PFourierCanvas.h b/src/include/PFourierCanvas.h index d509e39e..a1a1913d 100644 --- a/src/include/PFourierCanvas.h +++ b/src/include/PFourierCanvas.h @@ -127,7 +127,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 diff --git a/src/include/PMusr.h b/src/include/PMusr.h index f083b13b..8a501d59 100644 --- a/src/include/PMusr.h +++ b/src/include/PMusr.h @@ -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 diff --git a/src/include/PMusrCanvas.h b/src/include/PMusrCanvas.h index e8296e4c..19241149 100644 --- a/src/include/PMusrCanvas.h +++ b/src/include/PMusrCanvas.h @@ -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/PPrepFourier.h b/src/include/PPrepFourier.h index d1066809..de945f4b 100644 --- a/src/include/PPrepFourier.h +++ b/src/include/PPrepFourier.h @@ -34,7 +34,8 @@ #include using namespace std; -#include "TH1F.h" +#include +#include #include "PMusr.h" @@ -59,16 +60,16 @@ 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); UInt_t GetNoOfData() { return fRawData.size(); } @@ -79,9 +80,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/musrFT.cpp b/src/musrFT.cpp index 68d3c47b..c0f0b230 100644 --- a/src/musrFT.cpp +++ b/src/musrFT.cpp @@ -65,7 +65,8 @@ typedef struct { TString graphicFormat; ///< format for the graphical output dump TString dumpFln; ///< dump file name for Fourier data output TString msrFlnOut; ///< dump file name for msr-file generation - int bkg[2]; ///< background range + int bkg_range[2]; ///< background range + vector bkg; ///< background value TString fourierOpt; ///< Fourier options, i.e. real, imag, power, phase TString apodization; ///< apodization setting: none, weak, medium, strong int fourierPower; ///< Fourier power for zero padding, i.e. 2^fourierPower points @@ -95,7 +96,7 @@ void musrFT_syntax() cout << endl << " -df, --data-file : This allows to feed only muSR data file(s) to"; cout << endl << " perform the Fourier transform. Since the extended information"; cout << endl << " are missing, they will need to be provided by to options, or musrFT"; - cout << endl << " tries to guess, based on musrFT_startup.xml settings."; + cout << endl << " tries to guess, based on musrfit_startup.xml settings."; cout << endl << " Options: "; cout << endl << " --help : display this help and exit"; cout << endl << " --version : output version information and exit"; @@ -106,13 +107,13 @@ void musrFT_syntax() cout << endl << " Supported graphic-format-extension: eps, pdf, gif, jpg, png, svg, xpm, root"; cout << endl << " --dump : rather than starting a root session and showing Fourier graphs of the data,"; cout << endl << " it will output the Fourier data in an ascii file ."; - cout << endl << " --filter : filter and filter-specific-information -- ***TO BE WRITTEN YET***."; - cout << endl << " -b, --background : background interval used to estimate the backround to be"; + cout << endl << " -br, --background-range : background interval used to estimate the background to be"; cout << endl << " subtracted before the Fourier transform. , to be given in bins."; + cout << endl << " -bg, --background : gives the background explicit for each histogram."; cout << endl << " -fo, --fourier-option : can be 'real', 'imag', 'real+imag', 'power', or 'phase'."; - cout << endl << " If this is not defined (neither on the command line nor in the musrFT_startup.xml),"; + cout << endl << " If this is not defined (neither on the command line nor in the musrfit_startup.xml),"; cout << endl << " default will be 'power'."; - cout << endl << " -apod, --apodization : can be either 'none', 'weak', 'medium', 'strong'."; + cout << endl << " -ap, --apodization : can be either 'none', 'weak', 'medium', 'strong'."; cout << endl << " Default will be 'none'."; cout << endl << " -fp, --fourier-power : being the Fourier power, i.e. 2^ used for zero padding."; cout << endl << " Default is -1, i.e. no zero padding will be performed."; @@ -132,9 +133,10 @@ void musrFT_syntax() cout << endl << " E.g. musrFT -df lem15_his_01234.root --histo 1 3, will only be needed together with"; cout << endl << " the option --data-file. If multiple data file are given, will apply"; cout << endl << " to all data-files given. If --histo is not given, all histos of a data file will be used."; + cout << endl << " can be anything like: 2 3 6, or 2-17, or 1-6 9, etc."; cout << endl << " -a, --average : show the average of all Fourier transformed data."; cout << endl << " --t0 : A list of t0's can be provided. This in conjunction with --data-file and"; - cout << endl << " --fourier-option real allows to get the proper inital phase if t0's are known."; + cout << endl << " --fourier-option real allows to get the proper initial phase if t0's are known."; cout << endl << " If a single t0 for multiple histos is given, it is assume, that this t0 is common"; cout << endl << " to all histos."; cout << endl << " Example: musrFT -df lem15_his_01234.root -fo real --t0 2750 --histo 1 3"; @@ -160,8 +162,8 @@ void musrFT_init(musrFT_startup_param &startupParam) startupParam.graphicFormat = TString(""); startupParam.dumpFln = TString(""); startupParam.msrFlnOut = TString(""); - startupParam.bkg[0] = -1; - startupParam.bkg[1] = -1; + startupParam.bkg_range[0] = -1; + startupParam.bkg_range[1] = -1; startupParam.fourierOpt = TString("??"); startupParam.apodization = TString("none"); startupParam.fourierPower = -1; @@ -321,27 +323,44 @@ int musrFT_parse_options(int argc, char *argv[], musrFT_startup_param &startupPa } startupParam.dumpFln = argv[i+1]; i++; - } else if (tstr.Contains("--filter")) { - cout << endl << "debug> found option filter. NOT YET ANY FUNCTIONALITY." << endl; - } else if (tstr.Contains("-b") || tstr.Contains("--background")) { + } else if (tstr.Contains("-br") || tstr.Contains("--background-range")) { if (i+2 >= argc) { // something is wrong since there needs to be two arguments here - cerr << endl << ">> musrFT **ERROR** found option --background with wrong number of arguments." << endl; + cerr << endl << ">> musrFT **ERROR** found option --background-range with wrong number of arguments." << endl; return 2; } - TString bkg[2]; - bkg[0] = argv[i+1]; - bkg[1] = argv[i+2]; - if (!bkg[0].IsDigit()) { - cerr << endl << ">> musrFT **ERROR** bin of option --background is NOT an int-number! ('" << bkg[0] << "')." << endl; + TString bkgRange[2]; + bkgRange[0] = argv[i+1]; + bkgRange[1] = argv[i+2]; + if (!bkgRange[0].IsDigit()) { + cerr << endl << ">> musrFT **ERROR** bin of option --background-range is NOT an int-number! ('" << bkgRange[0] << "')." << endl; return 2; } - if (!bkg[1].IsDigit()) { - cerr << endl << ">> musrFT **ERROR** bin of option --background is NOT an int-number! ('" << bkg[1] << "')." << endl; + if (!bkgRange[1].IsDigit()) { + cerr << endl << ">> musrFT **ERROR** bin of option --background-range is NOT an int-number! ('" << bkgRange[1] << "')." << endl; return 2; } - startupParam.bkg[0] = bkg[0].Atoi(); - startupParam.bkg[1] = bkg[1].Atoi(); + startupParam.bkg_range[0] = bkgRange[0].Atoi(); + startupParam.bkg_range[1] = bkgRange[1].Atoi(); i += 2; + } else if (tstr.BeginsWith("-bg") || !tstr.CompareTo("--background")) { + TString topt(""); + while (++i < argc) { + if (argv[i][0] == '-') { + --i; + break; + } else { + topt = argv[i]; + if (!topt.IsFloat()) { + cerr << endl << ">> musrFT **ERROR** found option --background='" << topt << "' which is not a float" << endl; + return 2; + } + startupParam.bkg.push_back(topt.Atoi()); + } + } + if (startupParam.bkg.size() == 0) { // something is wrong since there needs to be an argument here + cerr << endl << ">> musrFT **ERROR** found option --background without argument!" << endl; + return 2; + } } else if (tstr.BeginsWith("-fo") || tstr.BeginsWith("--fourier-option")) { if (i+1 >= argc) { // something is wrong since there needs to be two arguments here cerr << endl << ">> musrFT **ERROR** found option --fourier-option without arguments." << endl; @@ -354,7 +373,7 @@ int musrFT_parse_options(int argc, char *argv[], musrFT_startup_param &startupPa } startupParam.fourierOpt = topt; i++; - } else if (tstr.BeginsWith("-apod") || tstr.BeginsWith("--apodization")) { + } else if (tstr.BeginsWith("-ap") || tstr.BeginsWith("--apodization")) { if (i+1 >= argc) { // something is wrong since there needs to be two arguments here cerr << endl << ">> musrFT **ERROR** found option --apodization without arguments." << endl; return 2; @@ -453,7 +472,7 @@ int musrFT_parse_options(int argc, char *argv[], musrFT_startup_param &startupPa startupParam.t0.push_back(topt.Atoi()); } } - if (startupParam.dataFln.size() == 0) { // something is wrong since there needs to be an argument here + if (startupParam.t0.size() == 0) { // something is wrong since there needs to be an argument here cerr << endl << ">> musrFT **ERROR** found option --t0 without argument!" << endl; return 2; } @@ -550,11 +569,11 @@ int musrFT_parse_options(int argc, char *argv[], musrFT_startup_param &startupPa cerr << endl << ">> musrFT **ERROR** neither nor defined." << endl; return 2; } - if (startupParam.bkg[0] > startupParam.bkg[1]) { - cerr << endl << ">> musrFT **WARNING** in --background, start=" << startupParam.bkg[0] << " > end=" << startupParam.bkg[1] << ", will swap them." << endl; - double swap = startupParam.bkg[0]; - startupParam.bkg[0] = startupParam.bkg[1]; - startupParam.bkg[1] = swap; + if (startupParam.bkg_range[0] > startupParam.bkg_range[1]) { + cerr << endl << ">> musrFT **WARNING** in --background-range, start=" << startupParam.bkg_range[0] << " > end=" << startupParam.bkg_range[1] << ", will swap them." << endl; + double swap = startupParam.bkg_range[0]; + startupParam.bkg_range[0] = startupParam.bkg_range[1]; + startupParam.bkg_range[1] = swap; } if (startupParam.fourierRange[0] > startupParam.fourierRange[1]) { cerr << endl << ">> musrFT **WARNING** in --fourier-range, start=" << startupParam.fourierRange[0] << " > end=" << startupParam.fourierRange[1] << ", will swap them." << endl; @@ -875,8 +894,8 @@ void musrFT_dumpMsrFile(musrFT_startup_param ¶m) if ((param.t0.size() > 1) && (j < param.t0.size())) { fout << "t0 " << param.t0[j] << endl; } - if ((param.bkg[0] > -1) && (param.bkg[1] > -1)) - fout << "background " << param.bkg[0] << " " << param.bkg[1] << endl; + if ((param.bkg_range[0] > -1) && (param.bkg_range[1] > -1)) + fout << "background " << param.bkg_range[0] << " " << param.bkg_range[1] << endl; fout << "#--------------------------------------------------------------" << endl; } } @@ -1027,7 +1046,7 @@ int main(int argc, char *argv[]) startupHandler->SetStartupOptions(startup_options); // defines the raw time-domain data vector - PPrepFourier data(startupParam.bkg, startupParam.packing); + PPrepFourier data(startupParam.packing, startupParam.bkg_range, startupParam.bkg); // load msr-file(s) vector msrHandler; @@ -1146,6 +1165,24 @@ int main(int argc, char *argv[]) if (fourierBlock->fFourierBlockPresent) { // get units unitTag = fourierBlock->fUnits; + if (startupParam.fourierUnits.BeginsWith("??")) { + switch (unitTag) { + case FOURIER_UNIT_GAUSS: + startupParam.fourierUnits = TString("Gauss"); + break; + case FOURIER_UNIT_TESLA: + startupParam.fourierUnits = TString("Tesla"); + break; + case FOURIER_UNIT_FREQ: + startupParam.fourierUnits = TString("MHz"); + break; + case FOURIER_UNIT_CYCLES: + startupParam.fourierUnits = TString("Mc/s"); + break; + default: + break; + } + } // get fourier power if (startupParam.fourierPower == -1) { // no Fourier power given from the command line, hence check FOURIER block if (fourierBlock->fFourierPower > 1) @@ -1277,9 +1314,6 @@ int main(int argc, char *argv[]) // calculate background levels and subtract them from the data data.DoBkgCorrection(); - // do the time domain filtering now - data.DoFiltering(); - // do lifetime correction if (startupParam.lifetimecorrection != 0.0) data.DoLifeTimeCorrection(startupParam.lifetimecorrection); @@ -1321,7 +1355,13 @@ int main(int argc, char *argv[]) fourier[i]->Transform(apodTag); } double end = millitime(); - cout << endl << "debug> after FFT. calculation time: " << (end-start)/1.0e3 << " (sec)." << endl; + cout << endl << "info> after FFT. calculation time: " << (end-start)/1.0e3 << " (sec)." << endl; + + // make sure that a Fourier range is provided, if not calculate one + if ((startupParam.fourierRange[0] == -1.0) && (startupParam.fourierRange[1] == -1.0)) { + startupParam.fourierRange[0] = 0.0; + startupParam.fourierRange[1] = fourier[0]->GetMaxFreq(); + } PFourierCanvas *fourierCanvas = 0; diff --git a/src/musredit/Makefile.am b/src/musredit/Makefile.am new file mode 100644 index 00000000..2f509505 --- /dev/null +++ b/src/musredit/Makefile.am @@ -0,0 +1,5 @@ +## Process this file with automake to create Makefile.in + +CLEANFILES = *~ core + + diff --git a/src/musredit/PAdmin.cpp b/src/musredit/PAdmin.cpp index a94b3d70..ac360c58 100644 --- a/src/musredit/PAdmin.cpp +++ b/src/musredit/PAdmin.cpp @@ -85,6 +85,8 @@ bool PAdminXMLParser::startElement( const QString&, const QString&, fKeyWord = eDefaultSavePath; } else if (qName == "title_from_data_file") { fKeyWord = eTitleFromDataFile; + } else if (qName == "musrview_show_fourier") { + fKeyWord = eMusrviewShowFourier; } else if (qName == "enable_musrt0") { fKeyWord = eEnableMusrT0; } else if (qName == "keep_minuit2_output") { @@ -130,7 +132,9 @@ bool PAdminXMLParser::startElement( const QString&, const QString&, } else if (qName == "musr_web_statistic") { fKeyWord = eHelpStatistic; } else if (qName == "musr_web_msr2data") { - fKeyWord = eHelpMsr2Data; + fKeyWord = eHelpMsr2Data; + } else if (qName == "musr_web_musrFT") { + fKeyWord = eHelpMusrFT; } else if (qName == "chain_fit") { fKeyWord = eChainFit; } else if (qName == "write_data_header") { @@ -240,6 +244,13 @@ bool PAdminXMLParser::characters(const QString& str) flag = false; fAdmin->setTitleFromDataFileFlag(flag); break; + case eMusrviewShowFourier: + if (str == "y") + flag = true; + else + flag = false; + fAdmin->setMusrviewShowFourierFlag(flag); + break; case eEnableMusrT0: if (str == "y") flag = true; @@ -338,6 +349,9 @@ bool PAdminXMLParser::characters(const QString& str) case eHelpMsr2Data: fAdmin->setHelpUrl("msr2data", str); break; + case eHelpMusrFT: + fAdmin->setHelpUrl("musrFT", str); + break; case eChainFit: if (str == "y") flag = true; @@ -598,6 +612,8 @@ PAdmin::PAdmin() : QObject() fInstitute = QString(""); fFileFormat = QString(""); + fMusrviewShowFourier = false; + fTitleFromDataFile = false; fEnableMusrT0 = false; fLifetimeCorrection = true; diff --git a/src/musredit/PAdmin.h b/src/musredit/PAdmin.h index 2fae7258..998a0e3a 100644 --- a/src/musredit/PAdmin.h +++ b/src/musredit/PAdmin.h @@ -69,12 +69,12 @@ class PAdminXMLParser : public QXmlDefaultHandler private: enum EAdminKeyWords {eEmpty, eTimeout, eKeepMinuit2Output, eDumpAscii, eDumpRoot, - eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eEnableMusrT0, + eTitleFromDataFile, eChisqPreRunBlock, eEstimateN0, eMusrviewShowFourier, eEnableMusrT0, eFontName, eFontSize, eExecPath, eDefaultSavePath, eRecentFile, eBeamline, eInstitute, eFileFormat, eLifetimeCorrection, eMsrDefaultFilePath, eTheoFuncPixmapPath, eFunc, eFuncName, eFuncComment, eFuncLabel, eFuncPixmap, eFuncParams, eHelpMain, eHelpTitle, eHelpParameters, eHelpTheory, eHelpFunctions, - eHelpRun, eHelpCommand, eHelpFourier, eHelpPlot, eHelpStatistic, eHelpMsr2Data, + eHelpRun, eHelpCommand, eHelpFourier, eHelpPlot, eHelpStatistic, eHelpMsr2Data, eHelpMusrFT, eChainFit, eWriteDataHeader, eIgnoreDataHeaderInfo, eWriteColumnData, eRecreateDataFile, eOpenFileAfterFitting, eCreateMsrFileOnly, eFitOnly, eGlobal, eGlobalPlus}; @@ -118,6 +118,7 @@ class PAdmin : public QObject QString getExecPath() { return fExecPath; } QString getDefaultSavePath() { return fDefaultSavePath; } bool getTitleFromDataFileFlag() { return fTitleFromDataFile; } + bool getMusrviewShowFourierFlag() { return fMusrviewShowFourier; } bool getEnableMusrT0Flag() { return fEnableMusrT0; } bool getKeepMinuit2OutputFlag() { return fKeepMinuit2Output; } bool getDumpAsciiFlag() { return fDumpAscii; } @@ -139,6 +140,7 @@ class PAdmin : public QObject void setTimeout(const int ival) { fTimeout = ival; } void setTitleFromDataFileFlag(const bool flag) { fTitleFromDataFile = flag; } + void setMusrviewShowFourierFlag(const bool flag) { fMusrviewShowFourier = flag; } void setEnableMusrT0Flag(const bool flag) { fEnableMusrT0 = flag; } void setKeepMinuit2OutputFlag(const bool flag) { fKeepMinuit2Output = flag; } void setDumpAsciiFlag(const bool flag) { fDumpAscii = flag; } @@ -180,13 +182,14 @@ class PAdmin : public QObject QVector fRecentFile; ///< keep vector of recent path-file names - bool fKeepMinuit2Output; ///< flag indicating if the Minuit2 output shall be kept (default: no) - bool fDumpAscii; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no). - bool fDumpRoot; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no). - bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes). - bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no). - bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes). - bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes). + bool fMusrviewShowFourier; ///< flag indicating if musrview should show at startup data (=false) or Fourier of data (=true). + bool fKeepMinuit2Output; ///< flag indicating if the Minuit2 output shall be kept (default: no) + bool fDumpAscii; ///< flag indicating if musrfit shall make an ascii-dump file (for debugging purposes, default: no). + bool fDumpRoot; ///< flag indicating if musrfit shall make an root-dump file (for debugging purposes, default: no). + bool fTitleFromDataFile; ///< flag indicating if the title should be extracted from the data file (default: yes). + bool fChisqPreRunBlock; ///< flag indicating if musrfit shall write 'per run block' chisq to the msr-file (default: no). + bool fEstimateN0; ///< flag indicating if musrfit shall estimate N0 for single histogram fits (default: yes). + bool fEnableMusrT0; ///< flag indicating if musrT0 shall be enabled at startup from within musredit (default: yes). QString fBeamline; ///< name of the beamline. Used to generate default run header lines. QString fInstitute; ///< name of the institute. Used to generate default run header lines. diff --git a/src/musredit/PGetMusrFTOptionsDialog.cpp b/src/musredit/PGetMusrFTOptionsDialog.cpp new file mode 100644 index 00000000..8c05f541 --- /dev/null +++ b/src/musredit/PGetMusrFTOptionsDialog.cpp @@ -0,0 +1,565 @@ +/**************************************************************************** + + PGetMusrFTOptionsDialog.cpp + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +*****************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2009-2015 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#include +#include +#include +#include + +#include "PHelp.h" + +#include "PGetMusrFTOptionsDialog.h" + +#define MUSRFT_OPT_UNDEF 0 +#define MUSRFT_OPT_REAL 1 +#define MUSRFT_OPT_IMAG 2 +#define MUSRFT_OPT_REAL_AND_IMAG 3 +#define MUSRFT_OPT_POWER 4 +#define MUSRFT_OPT_PHASE 5 + +#define MUSRFT_APOD_UNDEF 0 +#define MUSRFT_APOD_WEAK 1 +#define MUSRFT_APOD_MEDIUM 2 +#define MUSRFT_APOD_STRONG 3 + +#define MUSRFT_UNIT_UNDEF 0 +#define MUSRFT_UNIT_GAUSS 1 +#define MUSRFT_UNIT_TESLA 2 +#define MUSRFT_UNIT_FREQ 3 +#define MUSRFT_UNIT_CYCLE 4 + +//---------------------------------------------------------------------------------------------------- +/** + *

          Constructor. + * + * \param currentMsrFile path-file name of the currently active msr-file in musredit + * \param prevCmd list of the last (potential) previously call. + * \param helpUrl help url for the asymmetry run block + */ +PGetMusrFTOptionsDialog::PGetMusrFTOptionsDialog(QString currentMsrFile, QStringList &prevCmd, const QString helpUrl) : + fCurrentMsrFileName(currentMsrFile), fHelpUrl(helpUrl) +{ + setupUi(this); + setModal(true); + + fBkgRangeStartBin_lineEdit->setValidator( new QIntValidator(fBkgRangeStartBin_lineEdit) ); + fBkgRangeEndBin_lineEdit->setValidator( new QIntValidator(fBkgRangeEndBin_lineEdit) ); + fPacking_lineEdit->setValidator( new QIntValidator(fPacking_lineEdit) ); + fTimeRangeStart_lineEdit->setValidator( new QDoubleValidator(fTimeRangeStart_lineEdit) ); + fTimeRangeEnd_lineEdit->setValidator( new QDoubleValidator(fTimeRangeEnd_lineEdit) ); + fFourierPower_lineEdit->setValidator( new QIntValidator(fFourierPower_lineEdit) ); + fLifetimeCorrection_lineEdit->setValidator( new QDoubleValidator(fLifetimeCorrection_lineEdit) ); + fFourierRangeStart_lineEdit->setValidator( new QDoubleValidator(fFourierRangeStart_lineEdit) ); + fFourierRangeEnd_lineEdit->setValidator( new QDoubleValidator(fFourierRangeEnd_lineEdit) ); + fPacking_lineEdit->setText("1"); + + // populate dialog with the previous cmd call + bool msrTag = true; + QString str, str1, line; + int idx; + for (int i=0; isetText(line); + msrTag = false; + } + // collect data-file-names + if (prevCmd[i] == "-df") { + i++; + line = ""; + while (!prevCmd[i].startsWith("-") && (isetText(line); + } + // background-range + if (prevCmd[i] == "-br") { + fBkgRangeStartBin_lineEdit->setText(prevCmd[++i]); + fBkgRangeEndBin_lineEdit->setText(prevCmd[++i]); + } + // fourier-option + if (prevCmd[i] == "-fo") { + if (prevCmd[i+1] == "real") + fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_REAL); + else if (prevCmd[i+1] == "imag") + fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_IMAG); + else if (prevCmd[i+1] == "real+imag") + fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_REAL_AND_IMAG); + else if (prevCmd[i+1] == "power") + fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_POWER); + else if (prevCmd[i+1] == "phase") + fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_PHASE); + else + fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_UNDEF); + i++; + } + // apodization + if (prevCmd[i] == "-ap") { + if (prevCmd[i+1] == "weak") + fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_WEAK); + else if (prevCmd[i+1] == "medium") + fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_MEDIUM); + else if (prevCmd[i+1] == "strong") + fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_STRONG); + else + fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_UNDEF); + i++; + } + // fourier-power + if (prevCmd[i] == "-fp") { + fFourierPower_lineEdit->setText(prevCmd[++i]); + } + // units + if (prevCmd[i] == "-u") { + if (prevCmd[i+1] == "Gauss") + fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_GAUSS); + else if (prevCmd[i+1] == "Tesla") + fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_TESLA); + else if (prevCmd[i+1] == "MHz") + fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_FREQ); + else if (prevCmd[i+1] == "Mc/s") + fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_CYCLE); + else + fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_UNDEF); + i++; + } + // phase + if (prevCmd[i] == "-ph") { + // NOT YET IMPLEMENTED + } + // fourier-range + if (prevCmd[i] == "-fr") { + fFourierRangeStart_lineEdit->setText(prevCmd[++i]); + fFourierRangeEnd_lineEdit->setText(prevCmd[++i]); + } + // time-range + if (prevCmd[i] == "-tr") { + fTimeRangeStart_lineEdit->setText(prevCmd[++i]); + fTimeRangeEnd_lineEdit->setText(prevCmd[++i]); + } + // histo list + if (prevCmd[i] == "--histo") { + i++; + line = ""; + while (!prevCmd[i].startsWith("-") && (isetText(line); + } + // average tag + if (prevCmd[i] == "-a") { + fAveragedView_checkBox->setCheckState(Qt::Checked); + } + // t0 list + if (prevCmd[i] == "--t0") { + i++; + line = ""; + while (!prevCmd[i].startsWith("-") && (isetText(line); + } + // packing + if (prevCmd[i] == "-pa") { + fPacking_lineEdit->setText(prevCmd[++i]); + } + // title + if (prevCmd[i] == "--title") { + fFourierTitle_lineEdit->setText(prevCmd[i+1]); + } + // create msr-file tag + if (prevCmd[i] == "--create-msr-file") { + fCreateMsrFileName = prevCmd[++i]; + fCreateMsrFile_checkBox->setCheckState(Qt::Checked); + } + // lifetime correction + if (prevCmd[i] == "-lc") { + fLifetimeCorrection_lineEdit->setText(prevCmd[++i]); + } + } + + // connect all necessary single and slots + connect(fCurrentMsrFile_checkBox, SIGNAL( stateChanged(int) ), this, SLOT( currentMsrFileTagChanged(int) ) ); + connect(fAllMsrFiles_checkBox, SIGNAL( stateChanged(int) ), this, SLOT( allMsrFileTagChanged(int) ) ); + connect(fMsrFileSelector_pushButton, SIGNAL( clicked() ), this, SLOT( selectMsrFileNames() ) ); + connect(fDataFileSelector_pushButton, SIGNAL( clicked() ), this, SLOT( selectDataFileNames() ) ); + connect(fCreateMsrFile_checkBox, SIGNAL( stateChanged(int) ), this, SLOT( createMsrFileChanged(int) ) ); + connect(fMsrFileNameClear_pushButton, SIGNAL (clicked() ), this, SLOT( clearMsrFileNames() ) ); + connect(fDataFileNameClear_pushButton, SIGNAL (clicked() ), this, SLOT( clearDataFileNames() ) ); + connect(fResetAll_pushButton, SIGNAL( clicked() ), this, SLOT( resetAll() ) ); +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          returns the musrFT command line options. + */ +QStringList PGetMusrFTOptionsDialog::getMusrFTOptions() +{ + QStringList cmd; + QString str(""); + QStringList strList; + + // check if currently active msr-file shall be used + if (fCurrentMsrFile_checkBox->checkState() == Qt::Checked) { + cmd << fCurrentMsrFileName; + } else { + // msr-files + for (int i=0; i 0) { + cmd << "-df"; + for (int i=0; itext().length() > 0) && (fBkgRangeEndBin_lineEdit->text().length() > 0)) { + cmd << "-br"; + cmd << fBkgRangeStartBin_lineEdit->text(); + cmd << fBkgRangeEndBin_lineEdit->text(); + } + + // background values + if (fBkgList_lineEdit->text().length() > 0) { + + } + + // fourier-option + if (fFourierOption_comboBox->currentText() != "UnDef") { + cmd << "-fo"; + cmd << fFourierOption_comboBox->currentText(); + } + + // apodization + cmd << "-ap"; + cmd << fApodization_comboBox->currentText(); + + // fourier-power + if (fFourierPower_lineEdit->text().length() > 0) { + cmd << "-fp"; + cmd << fFourierPower_lineEdit->text(); + } + + // units + if (fFourierUnits_comboBox->currentText() != "UnDef") { + cmd << "-u"; + cmd << fFourierUnits_comboBox->currentText(); + } + + // phase + + // fourier-range + if ((fFourierRangeStart_lineEdit->text().length() > 0) && (fFourierRangeEnd_lineEdit->text().length() > 0)) { + cmd << "-fr"; + cmd << fFourierRangeStart_lineEdit->text(); + cmd << fFourierRangeEnd_lineEdit->text(); + } + + // time-range + if ((fTimeRangeStart_lineEdit->text().length() > 0) && (fTimeRangeEnd_lineEdit->text().length() > 0)) { + cmd << "-tr"; + cmd << fTimeRangeStart_lineEdit->text(); + cmd << fTimeRangeEnd_lineEdit->text(); + } + + // histo list + if (fHistoList_lineEdit->text().length() > 0) { + cmd << "--histo"; + strList = fHistoList_lineEdit->text().split(" ", QString::SkipEmptyParts); + for (int i=0; icheckState() == Qt::Checked) + cmd << "-a"; + + // t0 list + if (fT0_lineEdit->text().length() > 0) { + cmd << "--t0"; + strList = fT0_lineEdit->text().split(" ", QString::SkipEmptyParts); + for (int i=0; itext().length() > 0) { + cmd << "-pa"; + cmd << fPacking_lineEdit->text(); + } + + // title + if (fFourierTitle_lineEdit->text().length() > 0) { + cmd << "--title"; + cmd << fFourierTitle_lineEdit->text(); + } + + // create-msr-file + if (fCreateMsrFile_checkBox->checkState() == Qt::Checked) { + cmd << "--create-msr-file"; + cmd << fCreateMsrFileName; + } + + // lifetimecorrection + if (fLifetimeCorrection_lineEdit->text().length() > 0) { + cmd << "-lc"; + cmd << fLifetimeCorrection_lineEdit->text(); + } + + return cmd; +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          SLOT called when fCurrentMsrFile_checkBox is checked/unchecked. If checked, it will clean up + * the msr-file path-file list and the data-file path-file list. + */ +void PGetMusrFTOptionsDialog::currentMsrFileTagChanged(int state) +{ + if (state == Qt::Checked) { + fAllMsrFiles_checkBox->setCheckState(Qt::Unchecked); + + // remove all msr-data-file-names and data-path-file-names + fMsrFilePaths.clear(); + fMsrFileNames.clear(); + fMsrFileSelector_lineEdit->setText(""); + fDataFilePaths.clear(); + fDataFileNames.clear(); + fDataFileSelector_lineEdit->setText(""); + } +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          SLOT called when fAllMsrFiles_checkBox is checked/unchecked. Currently it has no functionality. + */ +void PGetMusrFTOptionsDialog::allMsrFileTagChanged(int state) +{ + if (state == Qt::Checked) { + fCurrentMsrFile_checkBox->setCheckState(Qt::Unchecked); + } +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          SLOT called when fMsrFileSelector_pushButton is clicked. Collects the msr-file path-name list. + */ +void PGetMusrFTOptionsDialog::selectMsrFileNames() +{ + QStringList flns = QFileDialog::getOpenFileNames( this, tr("Open msr-File(s)"), tr( "./" ), + tr( "msr-Files (*.msr);;All Files (*)" )); + + QString str(""), str1(""); + int idx; + if (flns.size() > 0) { + // delete already present elements + fMsrFilePaths.clear(); + fMsrFileNames.clear(); + + // split path-name into path and name + for (int i=0; isetText(str); + } +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          SLOT called when the fMsrFileNameClear_pushButton is clicked. + */ +void PGetMusrFTOptionsDialog::clearMsrFileNames() +{ + fMsrFileSelector_lineEdit->setText(""); + fMsrFilePaths.clear(); + fMsrFileNames.clear(); +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          SLOT called when fDataFileSelector_pushButton is clicked. Collects the data-file path-name list. + */ +void PGetMusrFTOptionsDialog::selectDataFileNames() +{ + QStringList flns = QFileDialog::getOpenFileNames( this, tr("Open msr-File(s)"), tr( "./" ), + tr( "data-Files (*.root *.bin *.msr *.nxs *.mdu);;All Files (*)" )); + + QString str(""), str1(""); + int idx; + if (flns.size() > 0) { + // delete already present elements + fDataFilePaths.clear(); + fDataFileNames.clear(); + + // split path-name into path and name + for (int i=0; isetText(str); + } +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          SLOT called when the fDataFileNameClear_pushButton is clicked. + */ +void PGetMusrFTOptionsDialog::clearDataFileNames() +{ + fDataFileSelector_lineEdit->setText(""); + fDataFilePaths.clear(); + fDataFileNames.clear(); +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          SLOT called when the create-msr-file tag has changed + */ +void PGetMusrFTOptionsDialog::createMsrFileChanged(int state) +{ + if (state == Qt::Checked) { + fCreateMsrFileName = QFileDialog::getSaveFileName(this, tr("Create msr-file"), "./", tr("msr-Files (*.msr);;All Files (*)")); + if (fCreateMsrFileName.length() == 0) + fCreateMsrFile_checkBox->setCheckState(Qt::Unchecked); + } else { + fCreateMsrFileName = ""; + } +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          SLOT called when the Reset All button is pressed. Will remove all settings. + */ +void PGetMusrFTOptionsDialog::resetAll() +{ + fCurrentMsrFile_checkBox->setCheckState(Qt::Unchecked); + fAllMsrFiles_checkBox->setCheckState(Qt::Unchecked); + fMsrFilePaths.clear(); + fMsrFileNames.clear(); + fMsrFileSelector_lineEdit->setText(""); + fDataFilePaths.clear(); + fDataFileNames.clear(); + fDataFileSelector_lineEdit->setText(""); + fBkgRangeStartBin_lineEdit->setText(""); + fBkgRangeEndBin_lineEdit->setText(""); + fBkgList_lineEdit->setText(""); + fApodization_comboBox->setCurrentIndex(MUSRFT_APOD_UNDEF); + fPacking_lineEdit->setText(""); + fTimeRangeStart_lineEdit->setText(""); + fTimeRangeEnd_lineEdit->setText(""); + fHistoList_lineEdit->setText(""); + fT0_lineEdit->setText(""); + fFourierOption_comboBox->setCurrentIndex(MUSRFT_OPT_UNDEF); + fFourierUnits_comboBox->setCurrentIndex(MUSRFT_UNIT_UNDEF); + fFourierPower_lineEdit->setText(""); + fLifetimeCorrection_lineEdit->setText(""); + fFourierRangeStart_lineEdit->setText(""); + fFourierRangeEnd_lineEdit->setText(""); + fAveragedView_checkBox->setCheckState(Qt::Unchecked); + fCreateMsrFile_checkBox->setCheckState(Qt::Unchecked); + fFourierTitle_lineEdit->setText(""); +} + +//---------------------------------------------------------------------------------------------------- +/** + *

          Generates a help content window showing the description for musrFT. + */ +void PGetMusrFTOptionsDialog::helpContent() +{ + if (fHelpUrl.isEmpty()) { + QMessageBox::information(this, "**INFO**", "Will eventually show a help window"); + } else { +#ifdef _WIN32GCC + QMessageBox::information(this, "**INFO**", "If a newer Qt version was available, a help window would be shown!"); +#else + PHelp *help = new PHelp(fHelpUrl); + help->show(); +#endif // _WIN32GCC + } +} diff --git a/src/musredit/PGetMusrFTOptionsDialog.h b/src/musredit/PGetMusrFTOptionsDialog.h new file mode 100644 index 00000000..8d3e0942 --- /dev/null +++ b/src/musredit/PGetMusrFTOptionsDialog.h @@ -0,0 +1,69 @@ +/**************************************************************************** + + PGetMusrFTOptionsDialog.h + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +*****************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2010-2015 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 _PGETMUSRFTOPTIONSDIALOG_H_ +#define _PGETMUSRFTOPTIONSDIALOG_H_ + +#include +#include + +#include "ui_PGetMusrFTOptionsDialog.h" + +class PGetMusrFTOptionsDialog : public QDialog, private Ui::PGetMusrFTOptionsDialog +{ + Q_OBJECT + + public: + PGetMusrFTOptionsDialog(QString currentMsrFile, QStringList &prevCmd, const QString helpUrl); + QStringList getMusrFTOptions(); + + public slots: + void helpContent(); + + private slots: + void currentMsrFileTagChanged(int state); + void allMsrFileTagChanged(int state); + void selectMsrFileNames(); + void clearMsrFileNames(); + void selectDataFileNames(); + void clearDataFileNames(); + void createMsrFileChanged(int state); + void resetAll(); + + private: + QStringList fMsrFilePaths; ///< list keeping all the paths from the msr-file path-name list + QStringList fMsrFileNames; ///< list keeping all the names from the msr-file path-name list + QStringList fDataFilePaths; ///< list keeping all the paths from the data-file path-name list + QStringList fDataFileNames; ///< list keeping all the names from the data-file path-name list + QString fCreateMsrFileName; ///< keeps the msr-path-file name for msr-file creation + QString fCurrentMsrFileName; ///< keeps the msr-path-file name of the currently active msr-file in musredit. + QString fHelpUrl; ///< help url for the asymmetry run block +}; + +#endif // _PGETMUSRFTOPTIONSDIALOG_H_ diff --git a/src/musredit/PPrefsDialog.cpp b/src/musredit/PPrefsDialog.cpp index fb18d832..a6fb9ca3 100644 --- a/src/musredit/PPrefsDialog.cpp +++ b/src/musredit/PPrefsDialog.cpp @@ -61,6 +61,7 @@ PPrefsDialog::PPrefsDialog(PAdmin *admin) : fAdmin(admin) fEnableMusrT0_checkBox->setChecked(fAdmin->getEnableMusrT0Flag()); fPerRunBlockChisq_checkBox->setChecked(fAdmin->getChisqPerRunBlockFlag()); fEstimateN0_checkBox->setChecked(fAdmin->getEstimateN0Flag()); + fFourier_checkBox->setChecked(fAdmin->getMusrviewShowFourierFlag()); fTimeout_lineEdit->setText(QString("%1").arg(fAdmin->getTimeout())); fTimeout_lineEdit->setValidator(new QIntValidator(fTimeout_lineEdit)); diff --git a/src/musredit/PPrefsDialog.h b/src/musredit/PPrefsDialog.h index 7bf6d89f..5f113eb1 100644 --- a/src/musredit/PPrefsDialog.h +++ b/src/musredit/PPrefsDialog.h @@ -46,6 +46,7 @@ class PPrefsDialog : public QDialog, private Ui::PPrefsDialog public: PPrefsDialog(PAdmin *admin); + bool getMusrviewShowFourierFlag() { return fFourier_checkBox->isChecked(); } bool getKeepMinuit2OutputFlag() { return fKeepMn2Output_checkBox->isChecked(); } bool getTitleFromDataFileFlag() { return fTitleFromData_checkBox->isChecked(); } bool getEnableMusrT0Flag() { return fEnableMusrT0_checkBox->isChecked(); } diff --git a/src/musredit/PTextEdit.cpp b/src/musredit/PTextEdit.cpp index 08cc9e18..94334ab3 100644 --- a/src/musredit/PTextEdit.cpp +++ b/src/musredit/PTextEdit.cpp @@ -55,6 +55,7 @@ using namespace std; #include #include #include +#include #include @@ -68,6 +69,7 @@ using namespace std; #include "PFitOutputHandler.h" #include "PDumpOutputHandler.h" #include "PPrefsDialog.h" +#include "PGetMusrFTOptionsDialog.h" #include "PGetDefaultDialog.h" #include "PMusrEditAbout.h" #include "PMsr2DataDialog.h" @@ -550,6 +552,12 @@ void PTextEdit::setupMusrActions() menu->addAction(fMusrT0Action); fMusrT0Action->setEnabled(fAdmin->getEnableMusrT0Flag()); + a = new QAction( QIcon( QPixmap (":/images/musrFT.xpm") ), tr( "Raw Fourier" ), this ); + a->setStatusTip( tr("Start musrFT") ); + connect( a, SIGNAL( triggered() ), this, SLOT( musrFT() ) ); + tb->addAction(a); + menu->addAction(a); + a = new QAction( QIcon( QPixmap( ":/images/musrprefs.xpm" ) ), tr( "&Preferences" ), this ); a->setStatusTip( tr("Show Preferences") ); connect( a, SIGNAL( triggered() ), this, SLOT( musrPrefs() ) ); @@ -2183,7 +2191,10 @@ void PTextEdit::musrView() str = *fFilenames.find( currentEditor() ); QString numStr; numStr.setNum(fAdmin->getTimeout()); - cmd += str + "\" --timeout " + numStr + " &"; + cmd += str + "\" --timeout " + numStr; + if (fAdmin->getMusrviewShowFourierFlag()) + cmd += " -f "; + cmd += " &"; int status=system(cmd.toLatin1()); } @@ -2223,6 +2234,33 @@ void PTextEdit::musrT0() QString fln = *fFilenames.find( currentEditor() ); } +//---------------------------------------------------------------------------------------------------- +/** + *

          Calls musrFT via selection/option dialog. It will ask the user if he/she wants to overwrite some + * of the default settings. + */ +void PTextEdit::musrFT() +{ + + PGetMusrFTOptionsDialog *dlg = new PGetMusrFTOptionsDialog(*fFilenames.find( currentEditor() ), fMusrFTPrevCmd, fAdmin->getHelpUrl("musrFT")); + + if (dlg == 0) { + QMessageBox::critical(this, "**ERROR** musrFT", "Couldn't invoke musrFT Options Dialog."); + return; + } + + if (dlg->exec() == QDialog::Accepted) { + fMusrFTPrevCmd = dlg->getMusrFTOptions(); + QProcess proc(this); + proc.setStandardOutputFile("musrFT.log"); + proc.setStandardErrorFile("musrFT.log"); + proc.startDetached("musrFT", fMusrFTPrevCmd); + } + + delete dlg; + dlg = 0; +} + //---------------------------------------------------------------------------------------------------- /** *

          Calls the preferences dialog which is used to set some global options. @@ -2237,6 +2275,7 @@ void PTextEdit::musrPrefs() } if (dlg->exec() == QDialog::Accepted) { + fAdmin->setMusrviewShowFourierFlag(dlg->getMusrviewShowFourierFlag()); fAdmin->setKeepMinuit2OutputFlag(dlg->getKeepMinuit2OutputFlag()); fAdmin->setTitleFromDataFileFlag(dlg->getTitleFromDataFileFlag()); fAdmin->setEnableMusrT0Flag(dlg->getEnableMusrT0Flag()); diff --git a/src/musredit/PTextEdit.h b/src/musredit/PTextEdit.h index f565ed61..149ab0bf 100644 --- a/src/musredit/PTextEdit.h +++ b/src/musredit/PTextEdit.h @@ -131,6 +131,7 @@ private slots: void musrMsr2Data(); void musrView(); void musrT0(); + void musrFT(); void musrPrefs(); void musrSwapMsrMlog(); void musrDump(); @@ -157,6 +158,7 @@ private: bool fFileSystemWatcherActive; ///< flag to enable/disable the file system watcher QTimer fFileSystemWatcherTimeout; ///< timer used to re-enable file system watcher. Needed to delay the re-enabling QString fLastDirInUse; ///< string holding the path from where the last file was loaded. + QStringList fMusrFTPrevCmd; QAction *fMusrT0Action; diff --git a/src/musredit/forms/PGetMusrFTOptionsDialog.ui b/src/musredit/forms/PGetMusrFTOptionsDialog.ui new file mode 100644 index 00000000..d2cf38be --- /dev/null +++ b/src/musredit/forms/PGetMusrFTOptionsDialog.ui @@ -0,0 +1,842 @@ + + + PGetMusrFTOptionsDialog + + + Qt::WindowModal + + + + 0 + 0 + 711 + 650 + + + + musrFT Options + + + + + 20 + 400 + 671 + 201 + + + + + 75 + true + + + + Fourier + + + + + 20 + 30 + 641 + 156 + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Options</span></p></body></html> + + + + + + + + UnDef + + + + + real + + + + + imag + + + + + real+imag + + + + + power + + + + + phase + + + + + + + + + + Qt::Horizontal + + + + 218 + 20 + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Units</span></p></body></html> + + + + + + + + UnDef + + + + + Gauss + + + + + Tesla + + + + + MHz + + + + + Mc/s + + + + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Power</span></p></body></html> + + + + + + + + + + + + Qt::Horizontal + + + + 88 + 20 + + + + + + + + + + Lifetime Correction + + + + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Range</span></p></body></html> + + + + + + + + + Start + + + + + + + + + + + + + + End + + + + + + + + + + + + Qt::Horizontal + + + + 118 + 20 + + + + + + + + + + + + Averaged View + + + + + + + Qt::Horizontal + + + + 278 + 20 + + + + + + + + Create msr-File + + + + + + + + + + + Title + + + + + + + + + + + + + + + 20 + 160 + 671 + 231 + + + + + 75 + true + + + + Histo Info + + + + + 20 + 30 + 641 + 188 + + + + + + + + + + 75 + true + + + + Background Range (in Bins) + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">StartBin</p></body></html> + + + + + + + + + + + + + + EndBin: + + + + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Background List</span></p></body></html> + + + + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:400; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;"><span style=" font-weight:600;">Apodization</span></p></body></html> + + + + + + + + none + + + + + weak + + + + + medium + + + + + strong + + + + + + + + + + + + Packing + + + + + + + + + + + + Qt::Horizontal + + + + 168 + 20 + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Time Range (usec)</p></body></html> + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Start</p></body></html> + + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">End</p></body></html> + + + + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">Histo List</p></body></html> + + + + + + + + + + + + + + <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/REC-html40/strict.dtd"> +<html><head><meta name="qrichtext" content="1" /><style type="text/css"> +p, li { white-space: pre-wrap; } +</style></head><body style=" font-family:'Sans Serif'; font-size:10pt; font-weight:600; font-style:normal;"> +<p style=" margin-top:0px; margin-bottom:0px; margin-left:0px; margin-right:0px; -qt-block-indent:0; text-indent:0px;">T0's</p></body></html> + + + + + + + + + + + + + + + 20 + 10 + 671 + 141 + + + + + 75 + true + + + + File Selection + + + + + 19 + 31 + 641 + 96 + + + + + + + + + Current msr-File + + + + + + + ALL msr-Files + + + + + + + Qt::Horizontal + + + + 318 + 20 + + + + + + + + + + + + Select msr-File(s) + + + + + + + + + + clear msr-file name list + + + Clear + + + + + + + + + + + Select data-File(s) + + + + + + + + + + clear data-file name list + + + Clear + + + + + + + + + + + + 20 + 610 + 671 + 29 + + + + + + + Help + + + + + + + Qt::Horizontal + + + + 78 + 20 + + + + + + + + + 75 + true + + + + Reset All + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + + fCurrentMsrFile_checkBox + fAllMsrFiles_checkBox + fMsrFileSelector_pushButton + fMsrFileSelector_lineEdit + fMsrFileNameClear_pushButton + fDataFileSelector_pushButton + fDataFileSelector_lineEdit + fDataFileNameClear_pushButton + fBkgRangeStartBin_lineEdit + fBkgRangeEndBin_lineEdit + fBkgList_lineEdit + fApodization_comboBox + fPacking_lineEdit + fTimeRangeStart_lineEdit + fTimeRangeEnd_lineEdit + fHistoList_lineEdit + fT0_lineEdit + fFourierOption_comboBox + fFourierUnits_comboBox + fFourierPower_lineEdit + fLifetimeCorrection_lineEdit + fFourierRangeStart_lineEdit + fFourierRangeEnd_lineEdit + fAveragedView_checkBox + fCreateMsrFile_checkBox + fFourierTitle_lineEdit + fResetAll_pushButton + fHelp_pushButton + buttonBox + + + + + buttonBox + accepted() + PGetMusrFTOptionsDialog + accept() + + + 683 + 611 + + + 157 + 274 + + + + + buttonBox + rejected() + PGetMusrFTOptionsDialog + reject() + + + 689 + 611 + + + 286 + 274 + + + + + fHelp_pushButton + clicked() + PGetMusrFTOptionsDialog + helpContent() + + + 85 + 627 + + + 147 + 624 + + + + + + helpContent() + + diff --git a/src/musredit/forms/PPrefsDialog.ui b/src/musredit/forms/PPrefsDialog.ui index c77f5d71..90f3e0b9 100644 --- a/src/musredit/forms/PPrefsDialog.ui +++ b/src/musredit/forms/PPrefsDialog.ui @@ -33,9 +33,9 @@ - 1 + 0 - + general @@ -75,7 +75,7 @@ - + musrfit @@ -158,7 +158,25 @@ - + + + musrview + + + + + 10 + 10 + 141 + 22 + + + + start with Fourier + + + + musrt0 diff --git a/src/musredit/images/musrFT.xpm b/src/musredit/images/musrFT.xpm new file mode 100644 index 00000000..406c21dc --- /dev/null +++ b/src/musredit/images/musrFT.xpm @@ -0,0 +1,28 @@ +/* XPM */ +static char *dummy[]={ +"22 22 3 1", +". c None", +"# c #000000", +"a c #ff0000", +"..##....###...##......", +"......................", +"######################", +"......................", +".........a............", +".........a............", +".........a............", +".........a............", +".........aa...........", +"........aaa...........", +"........aaa...........", +"........a.a...........", +"........a.a...........", +".......aa.aa..........", +".......aa..aa.........", +"a.aaa..a....aaa...aa..", +"aa.aaa.a......aaa.aaaa", +"......a..........aa...", +"######################", +"......................", +".#######.####..####...", +"......................"}; diff --git a/src/musredit/musredit.pro b/src/musredit/musredit.pro index 1662fe0b..245e6fdc 100644 --- a/src/musredit/musredit.pro +++ b/src/musredit/musredit.pro @@ -83,6 +83,7 @@ HEADERS = musredit.h \ PFitOutputHandler.h \ PDumpOutputHandler.h \ PPrefsDialog.h \ + PGetMusrFTOptionsDialog.h \ PGetDefaultDialog.h \ PGetTitleBlockDialog.h \ PGetParameterBlockDialog.h \ @@ -106,6 +107,7 @@ SOURCES = PHelp.cpp \ PFitOutputHandler.cpp \ PDumpOutputHandler.cpp \ PPrefsDialog.cpp \ + PGetMusrFTOptionsDialog.cpp \ PGetDefaultDialog.cpp \ PGetTitleBlockDialog.cpp \ PGetParameterBlockDialog.cpp \ @@ -126,6 +128,7 @@ FORMS = forms/PFindDialog.ui \ forms/PGetDefaultDialog.ui \ forms/PMusrEditAbout.ui \ forms/PPrefsDialog.ui \ + forms/PGetMusrFTOptionsDialog.ui \ forms/PGetTitleBlockDialog.ui \ forms/PGetParameterBlockDialog.ui \ forms/PGetTheoryBlockDialog.ui \ diff --git a/src/musredit/musredit.qrc b/src/musredit/musredit.qrc index 10fcf342..808a7ea8 100644 --- a/src/musredit/musredit.qrc +++ b/src/musredit/musredit.qrc @@ -1,40 +1,41 @@ - - images/editcopy.xpm - images/editcut.xpm - images/editfind.xpm - images/editnext.xpm - images/editpaste.xpm - images/editprevious.xpm - images/editredo.xpm - images/editundo.xpm - images/filenew.xpm - images/fileopen.xpm - images/fileprint.xpm - images/filereload.xpm - images/filesave.xpm - images/musrasym.xpm - images/musrcalcchisq.xpm - images/musrfit.xpm - images/musrmsr2data.xpm - images/musrprefs.xpm - images/musrsinglehisto.xpm - images/musrswap.xpm - images/musrt0.xpm - images/musrview.xpm - images/musrdump.xpm - latex_images/abragam.png - latex_images/asymmetry.png - latex_images/bessel.png - latex_images/combiLGKT.png - latex_images/generalExp.png - latex_images/internalBessel.png - latex_images/internalField.png - latex_images/polynom.png - latex_images/simpleExp.png - latex_images/simpleGauss.png - latex_images/statExpKT.png - latex_images/statGssKT.png - latex_images/tfCos.png - + + images/editcopy.xpm + images/editcut.xpm + images/editfind.xpm + images/editnext.xpm + images/editpaste.xpm + images/editprevious.xpm + images/editredo.xpm + images/editundo.xpm + images/filenew.xpm + images/fileopen.xpm + images/fileprint.xpm + images/filereload.xpm + images/filesave.xpm + images/musrasym.xpm + images/musrcalcchisq.xpm + images/musrfit.xpm + images/musrmsr2data.xpm + images/musrprefs.xpm + images/musrsinglehisto.xpm + images/musrswap.xpm + images/musrt0.xpm + images/musrview.xpm + images/musrFT.xpm + images/musrdump.xpm + latex_images/abragam.png + latex_images/asymmetry.png + latex_images/bessel.png + latex_images/combiLGKT.png + latex_images/generalExp.png + latex_images/internalBessel.png + latex_images/internalField.png + latex_images/polynom.png + latex_images/simpleExp.png + latex_images/simpleGauss.png + latex_images/statExpKT.png + latex_images/statGssKT.png + latex_images/tfCos.png + diff --git a/src/musredit/musredit_startup.xml.in b/src/musredit/musredit_startup.xml.in index a921d10f..bdcf0b4e 100644 --- a/src/musredit/musredit_startup.xml.in +++ b/src/musredit/musredit_startup.xml.in @@ -31,6 +31,7 @@ file://@DOCDIR@/html/user/MUSR/MusrFit.html#ThePlotBlock file://@DOCDIR@/html/user/MUSR/MusrFit.html#TheStatisticBlock file://@DOCDIR@/html/user/MUSR/Msr2Data.html + file://@DOCDIR@/html/user/MUSR/MusrFit.html#A_2.3_musrFT Courier New diff --git a/src/musrgui/Makefile.am b/src/musrgui/Makefile.am new file mode 100644 index 00000000..2f509505 --- /dev/null +++ b/src/musrgui/Makefile.am @@ -0,0 +1,5 @@ +## Process this file with automake to create Makefile.in + +CLEANFILES = *~ core + + diff --git a/src/musrview.cpp b/src/musrview.cpp index 17d3d978..f91dd6fd 100644 --- a/src/musrview.cpp +++ b/src/musrview.cpp @@ -57,9 +57,12 @@ using namespace std; */ void musrview_syntax() { - cout << endl << "usage: musrview [--] [--timeout ] | --version | --help"; + cout << endl << "usage: musrview [Options]"; cout << endl << " : msr/mlog input file"; - cout << endl << " 'musrview ' will execute musrview"; + cout << endl << " Options:"; + cout << endl << " --help : display this help and exit."; + cout << endl << " --version : output version information and exit."; + cout << endl << " -f, --fourier: will directly present the Fourier transform of the ."; cout << endl << " --: "; cout << endl << " will produce a graphics-output-file without starting a root session."; cout << endl << " the name is based on the , e.g. 3310.msr -> 3310_0.png"; @@ -71,9 +74,6 @@ void musrview_syntax() cout << endl << " will produce an ascii dump of the data and fit as plotted."; cout << endl << " --timeout : given in seconds after which musrview terminates."; cout << endl << " If <= 0, no timeout will take place. Default is 0."; - cout << endl; - cout << endl << " 'musrview' or 'musrview --help' will show this help"; - cout << endl << " 'musrview --version' will print the musrview version"; cout << endl << endl; } @@ -101,6 +101,7 @@ int main(int argc, char *argv[]) int status; bool success = true; char fileName[128]; + bool fourier = false; bool graphicsOutput = false; bool asciiOutput = false; char graphicsExtension[128]; @@ -132,6 +133,8 @@ int main(int argc, char *argv[]) } else if (!strcmp(argv[i], "--help")) { show_syntax = true; break; + } else if (!strcmp(argv[i], "-f") || !strcmp(argv[i], "--fourier")) { + fourier = true; } else if (!strcmp(argv[i], "--eps") || !strcmp(argv[i], "--pdf") || !strcmp(argv[i], "--gif") || !strcmp(argv[i], "--jpg") || !strcmp(argv[i], "--png") || !strcmp(argv[i], "--svg") || !strcmp(argv[i], "--xpm") || !strcmp(argv[i], "--root")) { @@ -304,10 +307,13 @@ int main(int argc, char *argv[]) startupHandler->GetFourierDefaults(), startupHandler->GetMarkerList(), startupHandler->GetColorList(), - graphicsOutput||asciiOutput); + graphicsOutput||asciiOutput, + fourier); else musrCanvas = new PMusrCanvas(i, msrHandler->GetMsrTitle()->Data(), - 10+i*100, 10+i*100, 800, 600, graphicsOutput||asciiOutput); + 10+i*100, 10+i*100, 800, 600, + graphicsOutput||asciiOutput, + fourier); if (!musrCanvas->IsValid()) { cerr << endl << ">> musrview **SEVERE ERROR** Couldn't invoke all necessary objects, will quit."; @@ -340,8 +346,12 @@ int main(int argc, char *argv[]) } if (asciiOutput) { + // generate export data file name + TString str(fileName); + str.Remove(str.Last('.')); + str += ".dat"; // save data in batch mode - musrCanvas->SaveDataAscii(); + musrCanvas->ExportData(str.Data()); musrCanvas->Done(0); }