diff --git a/ChangeLog b/ChangeLog index 7f4dc8b5..32e077e2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,41 @@ # ChangeLog #--------------------------------------------------------------------- +changes since 0.14.0 +=================================== +NEW 2015-02-23 implemented an average-per-data-set option for musrFT. +NEW 2015-02-21 add proper Mac icon to musredit +FIXED 2015-06-30 changed setf/unsetf bug (PMsr2Data.cpp) +FIXED 2015-05-15 another path check for HDF5 with ubuntu 15.04 +FIXED 2015-03-16 some minor correction for ASCII export in any2many +FIXED 2015-02-26 some more bug fixing for average per data set. +FIXED 2015-02-20 for graphical export in the batch mode, menus mustn't be set. +CHANGED 2015-08-17 updated ChangeLog which was orphaned since V0.13.0 +CHANGED 2015-08-16 updated the docu +CHANGED 2015-08-16 added the class PStringNumberList which allow to parse a + generic encoded list of numbers. Used this class to improve + PMsrHandler, and improved the runList feature of msr2data. + For details see the documentation of msr2data. +CHANGED 2015-06-25 adopted the temperature dependence of the gap function + (see Eq.(8) of the memo), which breaks the self-consistency. + Makes it more flexible but requires that the user is using + his brain. +CHANGED 2015-06-25 small correction of the skewed Gaussian for extrem parameter + values. +CHANGED 2015-05-29 updated docu and removed an unsed variable +CHANGED 2015-05-29 added a group histo selector in any2many for MusrRoot when + exporting to a too limited file format as PSI-BIN. +CHANGED 2015-04-01 update of the technical docu +CHANGED 2015-02-28 check that FOURIER block phase parameter as parX is not leading + to an error message. +CHANGED 2015-02-24 added missing background range from msr-file (musrFT) +CHANGED 2015-02-24 separated PSI-BIN and PSI-MDU file format +CHANGED 2015-02-21 make sure that musrFT is found +CHANGED 2015-02-21 needed to adopted includes for dictionary generation due to + adding fftw.h in PMusr.h +CHANGED 2015-02-21 have now README and README.md for automake and bitbucket, + respectively. + changes since 0.13.0 =================================== NEW 2015-02-23 implemented an average-per-data-set option for musrFT. diff --git a/doc/html/user/MUSR/BmwLibs.html b/doc/html/user/MUSR/BmwLibs.html index b747dd89..b70eadf7 100644 --- a/doc/html/user/MUSR/BmwLibs.html +++ b/doc/html/user/MUSR/BmwLibs.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -124,7 +124,7 @@ pre {
  • libZFRelaxation: routines for calculating zero-field muon-spin depolarization functions from various static field distributions
  • --- BMW & AS +-- BMW & AS
    @@ -146,9 +146,9 @@ pre {
    - Edit | Attach | Print version | PDF | History: r5 < r4 < r3 < r2 | Backlinks | View wiki text | Refresh | More topic actions + Edit | Attach | Print version | PDF | History: r6 < r5 < r4 < r3 | Backlinks | View wiki text | Refresh | More topic actions
    -
    Topic revision: r5 - 10 Jul 2011, wojek
    +
    Topic revision: r6 - 03 Jul 2015, AndreasSuter
    @@ -192,7 +192,7 @@ pre {
    - +

    diff --git a/doc/html/user/MUSR/CiteMusrFit.html b/doc/html/user/MUSR/CiteMusrFit.html index 0cb0a7b7..64ab417f 100644 --- a/doc/html/user/MUSR/CiteMusrFit.html +++ b/doc/html/user/MUSR/CiteMusrFit.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -144,7 +144,7 @@ Since quite some effort is going into the development and maintenance of the
    - Edit | Attach | Print version | PDF | History: r2 < r1 | Backlinks | View wiki text | Refresh | More topic actions + Edit | Attach | Print version | PDF | History: r2 < r1 | Backlinks | View wiki text | Refresh | More topic actions
    Topic revision: r2 - 19 Jun 2012, AndreasSuter
    @@ -190,7 +190,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 224e9082..48c20d8a 100644 --- a/doc/html/user/MUSR/LibFitPofB.html +++ b/doc/html/user/MUSR/LibFitPofB.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -400,7 +400,7 @@ An example XML file looks as follows: </BMW>

    --- BMW & AS +-- BMW & AS
    @@ -422,9 +422,9 @@ An example XML file looks as follows:
    Topic revision: r16 - 10 Jul 2011, wojek
    +
    Topic revision: r17 - 03 Jul 2015, AndreasSuter
    @@ -468,7 +468,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 6f5336b3..c163dfaf 100644 --- a/doc/html/user/MUSR/LibZFRelaxation.html +++ b/doc/html/user/MUSR/LibZFRelaxation.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -205,7 +205,7 @@ The parameters are:
    1. Θ (°).

    --- BMW & AS +-- BMW & AS
    @@ -227,9 +227,9 @@ The parameters are:
      Topic revision: r2 - 10 Jul 2011, wojek
      +
      Topic revision: r3 - 03 Jul 2015, AndreasSuter
      @@ -273,7 +273,7 @@ The parameters are:
      - +

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

      @@ -168,6 +168,7 @@ All four basic types of calling msr2data contain the mandatory<
      msr2data 8472 _tf_h13
      generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr.
      msr2data 8472 8474 _tf_h13
      generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr, 8473_tf_h13.msr, and 8474_tf_h13.msr.
      msr2data [8472 8470] _tf_h13
      generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr and 8470_tf_h13.msr. +
      msr2data [8470:8474:2] _tf_h13
      generates the DB file out.db (can be changed by using the -o option) from 8470_tf_h13.msr, 8472_tf_h13.msr, and 8474_tf_h13.msr.
      msr2data run.list _tf_h13
      generates the DB file out.db (can be changed by using the -o option) from all runs listed in the ASCII file run.list in the working directory. In this file it is also possible to include external parameters which should be put in the resulting DB file. The structure of the run.list is the following:
      @@ -214,9 +215,9 @@ msr2data 8400 8460 _tf_h13 -oABC.db fit-8472
       
      Using 8472_tf_h13.msr as first template, msr2data generates subsequent msr input files 8400_tf_h13.msr through 8460_tf_h13.msr, calls musrfit to perform a fit of these files and collects the results of the fits together with the DB header in the new file ABC.db. Additionally, some information about external parameters like the temperature will be passed to ABC.db if it is present in the data files.
      -msr2data [8500 8505] _zf fit-8472 noheader nosummary -o DEF.db 
      +msr2data [8500 8502-8504 8507] _zf fit-8472 noheader nosummary -o DEF.db 
       
      -Using 8472_zf.msr as first template, msr2data generates subsequent msr input files 8500_zf.msr and 8505_zf.msr, calls musrfit to perform a fit of these files and collects the results of the fits in the file DEF.db without writing the DB file header or attempting to read additional information from the data files. +Using 8472_zf.msr as first template, msr2data generates subsequent msr input files 8500_zf.msr, 8502_zf.msr, 8503_zf.msr, 8504_zf.msr and 8507_zf.msr, calls musrfit to perform a fit of these files and collects the results of the fits in the file DEF.db without writing the DB file header or attempting to read additional information from the data files.
       msr2data 8595 8585 "" noheader fit-8472! -oGHI.dat data nosummary -k 
       
      @@ -337,7 +338,7 @@ msr2data 8471 8470 -OneRunFit_example -o OneRunFits.db

      7 Bugtracking

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

      -- BMW & AS
      @@ -351,7 +352,7 @@ For reporting bugs or requesting new features and improvements please use the -
      Topic revision: r39 - 16 Aug 2015, AndreasSuter
      @@ -419,7 +420,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 f3e74c9d..c44f32da 100644 --- a/doc/html/user/MUSR/MusrFit.html +++ b/doc/html/user/MUSR/MusrFit.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -1610,7 +1610,7 @@ For reporting bugs or requesting new features and improvements please use the
      Topic revision: r126 - 29 May 2015, AndreasSuter
      @@ -1656,7 +1656,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 4ca69046..9109829f 100644 --- a/doc/html/user/MUSR/MusrFitAcknowledgements.html +++ b/doc/html/user/MUSR/MusrFitAcknowledgements.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -120,9 +120,7 @@ pre {

      Acknowledgements - musrfit

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

      --- BMW & AS
      +
      @@ -144,9 +142,9 @@ pre {
      -
      Topic revision: r4 - 10 Jul 2011, wojek
      +
      Topic revision: r5 - 03 Jul 2015, AndreasSuter
      @@ -190,7 +188,7 @@ pre {
      - +

      diff --git a/doc/html/user/MUSR/MusrFitSetup.html b/doc/html/user/MUSR/MusrFitSetup.html index e1c4458f..a7828a22 100644 --- a/doc/html/user/MUSR/MusrFitSetup.html +++ b/doc/html/user/MUSR/MusrFitSetup.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -159,7 +159,7 @@ pre {
    1. 5.3 musrfit
    2. 5.4 musredit -
    3. 5.5 musrgui +
    4. 5.5 musrgui (obsolete)
    5. 5.6 Check of the installation
    6. @@ -167,10 +167,10 @@ pre {

      1 Supported Operating Systems and Software Requirements

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

      -Apart from GCC, the GNU Compiler Collection, the GNU build tools autoconf, automake and libtool as well as the helper tool pkg-config musrfit requires the installation of a few open-source libraries and programs:
      +Apart from GCC, the GNU Compiler Collection (gcc, g++), the GNU build tools autoconf, automake and libtool as well as the helper tool pkg-config musrfit requires the installation of a few open-source libraries and programs including their header packages:
      boost C++ libraries
      The powerful Spirit parser framework used by musrfit is included in that collection of libraries. Required version ≥ 1.33
      GNU Scientific Library
      A numerical C and C++ library which provides efficient implementations of various mathematical routines. Required version ≥ 1.9
      FFTW
      A C implementation for the fast computation of discrete Fourier transforms. Required version ≥ 3.1 @@ -196,73 +196,102 @@ Each of the following sections focusing on the installation of musrfit
      GNU/Linux
      No serious problems are known at the moment.
      MS Windows
      The setup of musrfit (including the requirements) using Visual C++ has not been tested. If anybody likes to do this: Just go ahead and have fun! However, not very much assistance can be expected, although it would be an interesting experiment. -
      Mac OS X
      On 10.6 Snow Leopard Qt3 for Mac is not supported any more since this was based on a 32-bit only API. Snow Leopard -users are advised to use the Qt4 based musredit or to rely on the standard Qt3 version for X11 in order to run musrgui. +
      Mac OS X
      On 10.6 Snow Leopard Qt3 for Mac is not supported any more since this was based on a 32-bit only API. Snow Leopard -users are advised to use the Qt4 based musredit or to rely on the standard Qt3 version for X11 in order to run musrgui. On newer Mac OS X versions (>= 10.8) you should use the Qt4 base musredit only.

      3 GNU/Linux

      3.1 Requirements

      3.1.1 Everything but ROOT and NeXus

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

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

      3.1.2 Installation of NeXus requirements (optional)

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

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

      3.1.3 ROOT

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

      -The ROOT system may or may not be part of the GNU/Linux distribution. If it is, it should be checked that the provided binaries are of a recent version and then these in principle can be installed using a package manager as described above.
      -In case the distribution provides no or only outdated binary packages there are the following possibilities:
        -
      • Visit the ROOT web page and download the packed precompiled binary version matching best the GNU/Linux distribution. Then unpack the bundle to its final destination. -
      • If there is no precompiled binary version of ROOT available for your system or e.g. ROOT should be compiled with another version of GCC visit the web page and download the 'complete source tree for all systems'. Then unpack this source tree to its destination (e.g. /opt/root-system)(1), configure(2) it (here using the minimal set of options) and compile it as follows right below:
        -cd /opt/root-system
        -./configure linux --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml
        -            (or in case of a 64 bit installation: ./configure linuxx8664gcc --gminimal --enable-asimage --enable-mathmore --enable-minuit2 --enable-xml)
        -make
        -            (or in case there are multiple processors available, e.g.: make -j4)
        +The ROOT system may or may not be part of the GNU/Linux distribution. Some distributions are packing ROOT in a manner incompatible with the way it is needed for musrfit. Therefore we advise to install ROOT from source. Before installing ROOT from source you will need to install some additional header packages. 
        +

        +For RPM based systems (RedHat, Fedora, etc) this will likely to be libX11-devel, libXft-devel, libXpm-devel, and libXext-devel: +
        +$ yum install libX11-devel libXft-devel libXpm-devel libXext-devel
        +
        +

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

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

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

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

          +If an update of ROOT is needed, simple do the following:
          +$ cd $HOME/Apps/root
          +$ git pull
          +$ make
           
          -
        • Additionally, as normal user one should append the following lines to the ~/.bashrc and/or ~/.bash_profile (and then either restart the shell or call the same commands once more from the shell) in order to change some path-setting environment variables:
          -export ROOTSYS=/opt/root-system/
          -export PATH=$ROOTSYS/bin:$PATH
          -
          -

        3.2 musrfit

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

        Note: musrfit has moved from svn to git. In case you still have an old svn version of musrfit, it is advised to remove it first. For svn users: for a smooth transition from svn to git, please check the following link: @@ -270,8 +299,11 @@ git clone git://gitorious.psi.ch/nemu/musrfit.git

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

        As an alternative (if git is not available), the source code can also be downloaded from the following web-page: musrfit at bitbucket. @@ -294,14 +326,14 @@ After the source-code extraction the autogen.sh script is calle

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

        3.3 musredit

        In the latest version of musrfit the configure script tries to determine automatically if Qt4.6 or higher is set up on the machine. In case this is found, the editor musredit is built already together with musrfit. If not, one can either try to call the configure script with the "--with-qt4" option or install this editor separately:
        -cd src/musredit
        -qmake musredit.pro
        +$ cd $HOME/Apps/musrfit/src/musredit
        +$ # for some distributions you will need qmake-qt4 for the next command
        +$ qmake musredit.pro
         
        If everything went fine musredit can be compiled and installed:
        -make
        -make install
        +$ make
        +$ make install
         
        In case one does not like the executable musredit to be copied to the default installation directory $ROOTSYS/bin the last "make install" can be skipped and the executable can be copied somewhere else instead. However, the musredit_startup.xml should go to the installation directory MUSRFITPATH of the musrfit executables. Eventually, in the installed musredit_startup.xml the path specifications should be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual. @@ -333,19 +366,15 @@ If there are problems during the qmake step, e.g. "uic: File genera In order to perform a quick test for finding out if the installation has been completed successfully, a few msr files together with the corresponding data files can be found in the musrfit source tree at doc/examples/.
        If musrgui has been installed, just open one of the test-*.msr files in the editor and test the musrfit functionalities. Otherwise, if only the terminal should be used, as an initial test for instance the following could be done:
        -cd doc/examples
        -musrview test-histo-ROOT-NPP.msr
        +$ cd $HOME/Apps/musrfit/doc/examples
        +$ musrview test-histo-ROOT-NPP.msr
         

        Notes

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

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

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

        @@ -369,7 +398,7 @@ After these installations already most of the required software is present and t

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

        @@ -378,46 +407,46 @@ where x_yy_z has to be substituted by the correct version numbe

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

        4.1.3 ROOT

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

        @@ -435,13 +464,13 @@ Afterwards close the Cygwin shell and reopen it again for the installation of 4.2 musrfit First, the most recent source code should be downloaded. First, the most recent source code should be downloaded. The preferred way of doing so is to clone the musrfit repository via git. Assuming the code should be located in ~/musrfit this is achieved most easily calling from the terminal
        -cd
        -git clone https://bitbucket.org/muonspin/musrfit.git 
        +$ cd
        +$ git clone https://bitbucket.org/muonspin/musrfit.git 
         
        or
        -cd
        -git clone git://gitorious.psi.ch/nemu/musrfit.git
        +$ cd
        +$ git clone git://gitorious.psi.ch/nemu/musrfit.git
         

        Note: musrfit has moved from svn to git. In case you still have an old svn version of musrfit, it is advised to remove it first. For svn users: for a smooth transition from svn to git, please check the following link: @@ -449,8 +478,8 @@ git clone git://gitorious.psi.ch/nemu/musrfit.git

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

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

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

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

        4.6 Possible problems

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

        5 Mac OS X

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

        +WARNING: The instruction for Fink haven't been updated/tested for quite a while and likely are slightly outdated. +
        +

        +

        5.1 Requirements (MacPorts)

        5.1.1 Everything but ROOT and NeXus

        @@ -543,26 +577,26 @@ Before proceeding with the usage of the MacPorts install page, download the installer for your system and follow the installation instructions on the page. By default the MacPorts system will be installed in /opt/local.
        To be sure that the newest version of the software is used a MacPorts upgrade should be performed by typing in a terminal:
        -sudo port -v selfupdate
        +$ sudo port -v selfupdate
         

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

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

        @@ -570,40 +604,52 @@ With qt4-mac, musredit will be installed. If it

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

        5.1.3 ROOT

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

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

        +For further details see Installing ROOT from Source. +

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

        +For Mac OS X <= 10.8:

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

        +For Mac OS X > 10.8: +

        +Here we will need two files placed under ~/Library/LaunchAgents, the first called setenv.ROOTSYS.plist with the content +
        +<?xml version="1.0" encoding="UTF-8"?>
        +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        +  <plist version="1.0">
        +  <dict>
        +  <key>Label</key>
        +  <string>setenv.ROOTSYS</string>
        +  <key>ProgramArguments</key>
        +  <array>
        +    <string>/bin/launchctl</string>
        +    <string>setenv</string>
        +    <string>ROOTSYS</string>
        +    <string>$HOME/Apps/root</string>
        +  </array>
        +  <key>RunAtLoad</key>
        +  <true/>
        +  <key>ServiceIPC</key>
        +  <false/>
        +</dict>
        +</plist>
        +
        +and the second called setenv.MUSRFITPATH.plist in the same directory with the content +
        +<?xml version="1.0" encoding="UTF-8"?>
        +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        +  <plist version="1.0">
        +  <dict>
        +  <key>Label</key>
        +  <string>setenv.MUSRFITPATH</string>
        +  <key>ProgramArguments</key>
        +  <array>
        +    <string>/bin/launchctl</string>
        +    <string>setenv</string>
        +    <string>MUSRFITPATH</string>
        +    <string>$HOME/Apps/root/bin</string>
        +  </array>
        +  <key>RunAtLoad</key>
        +  <true/>
        +  <key>ServiceIPC</key>
        +  <false/>
        +</dict>
        +</plist>
        +
        +

        Additionally, one might want to put a line in ~/.profile (or ~/.bash_profile) to look for executables also in the ROOT and Qt binary directories:
         export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
        @@ -640,7 +733,7 @@ Trees: local/main stable/main stable/crypto unstable/main
         
        After applying the changes above to the configuration file, the Fink core system should be upgraded to its newest version by typing in a terminal:
        -sudo fink selfupdate
        +$ sudo fink selfupdate
         
        Then the Fink system should be set up and can be used to install additional software.
        The Fink installer package also contains a graphical user interface called FinkCommander and it is suggested to use that for installing the following packages (or packages with revisions close to the following)—it is necessary to compile a few packages from source since no binary packages are available, however, this is done automatically by the FinkCommander after you have chosen the software packages for installation: @@ -651,16 +744,16 @@ Under OS X 10.6 Snow Leopard it will not be possible to install qt3mac<

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

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

        @@ -672,34 +765,48 @@ where x_yy_z has to be substituted by the correct version numbe

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

        5.2.3 ROOT

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

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

        +For further details see Installing ROOT from Source. +

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

        +For Mac OS X <= 10.8:

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

        +For Mac OS X > 10.8: +

        +Here we will need two files placed under ~/Library/LaunchAgents, the first called setenv.ROOTSYS.plist with the content +
        +<?xml version="1.0" encoding="UTF-8"?>
        +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        +  <plist version="1.0">
        +  <dict>
        +  <key>Label</key>
        +  <string>setenv.ROOTSYS</string>
        +  <key>ProgramArguments</key>
        +  <array>
        +    <string>/bin/launchctl</string>
        +    <string>setenv</string>
        +    <string>ROOTSYS</string>
        +    <string>$HOME/Apps/root</string>
        +  </array>
        +  <key>RunAtLoad</key>
        +  <true/>
        +  <key>ServiceIPC</key>
        +  <false/>
        +</dict>
        +</plist>
        +
        +and the second called setenv.MUSRFITPATH.plist in the same directory with the content +
        +<?xml version="1.0" encoding="UTF-8"?>
        +<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
        +  <plist version="1.0">
        +  <dict>
        +  <key>Label</key>
        +  <string>setenv.MUSRFITPATH</string>
        +  <key>ProgramArguments</key>
        +  <array>
        +    <string>/bin/launchctl</string>
        +    <string>setenv</string>
        +    <string>MUSRFITPATH</string>
        +    <string>$HOME/Apps/root/bin</string>
        +  </array>
        +  <key>RunAtLoad</key>
        +  <true/>
        +  <key>ServiceIPC</key>
        +  <false/>
        +</dict>
        +</plist>
        +
        +

        Additionally, one might want to put a line in ~/.profile (or ~/.bash_profile) to look for executables also in the ROOT and Qt binary directories:
         export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
         
        -

        -

        5.3 musrfit

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

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

        @@ -742,8 +894,8 @@ git clone git://gitorious.psi.ch/nemu/musrfit.git

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

        As an alternative (if git is not available), the source code can also be downloaded from the following web-page: musrfit at bitbucket. @@ -768,11 +920,11 @@ After the source-code extraction the autogen.sh script is calle Normally it should not be necessary to make use of any of the options except for specifying the installation path with --prefix. The other paths should be detected automatically. If this does not work for some reason the configure script will terminate and ask for the information. When the configure script has been called successfully everything is ready for building the musrfit libraries and executables. A standard installation sequence (without NeXus support) might then look like:
        -cd musrfit
        -sh autogen.sh
        -./configure --prefix=$ROOTSYS
        -make
        -make install
        +$ cd ~/Apps/musrfit
        +$ sh autogen.sh
        +$ ./configure --prefix=$ROOTSYS
        +$ make
        +$ make install
         
        In order to finish the installation of musrfit the paths where musrfit searches for data files should be adjusted in the installed musrfit_startup.xml ($ROOTSYS/bin/musrfit_startup.xml). For detailed information on this XML file refer to the manual.

        @@ -780,25 +932,25 @@ In order to finish the installation of musrfit the paths where 5.4 musredit In the latest version of musrfit the configure script tries to determine automatically if Qt4.5 or higher is set up on the machine. In case this is found, the editor musredit is built already together with musrfit. If not, one can either try to call the configure script with the "--with-qt4" option or install this editor separately:
        -cd src/musredit
        -qmake musredit.pro
        +$ cd ~/Apps/musrfit/src/musredit
        +$ qmake musredit.pro
         
        If everything went fine musredit can be compiled and installed:
        -make
        -make install
        +$ make
        +$ make install
         
        The last command copies musredit.app to the standard program directory /Applications and the musredit_startup.xml to $ROOTSYS/bin/musredit_startup.xml. Eventually, in the installed musredit_startup.xml the path specifications have to be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual.

        -

        5.5 musrgui

        +

        5.5 musrgui (obsolete)

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

        Under some circumstances it might happen, that if musrgui was called from Finder the necessary libraries for executing musrfit could not be found. In that case, the only workaround for the moment is to export the environment variable DYLD_LIBRARY_PATH in the shell and call musrgui from a terminal! @@ -812,7 +964,9 @@ alias mgui='/Applications/musrgui.app/Contents/MacOS/musrgui'

        Notes

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

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

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

        --- BMW & AS +-- AS & BMW
        @@ -848,9 +1002,9 @@ musrview test-histo-ROOT-NPP.msr
        Topic revision: r60 - 25 Oct 2014, AndreasSuter
        +
        Topic revision: r61 - 03 Jul 2015, AndreasSuter
        @@ -894,7 +1048,7 @@ musrview test-histo-ROOT-NPP.msr
        - +

        diff --git a/doc/html/user/MUSR/MusrGui.html b/doc/html/user/MUSR/MusrGui.html index 3e3fe0ab..fec3b3c6 100644 --- a/doc/html/user/MUSR/MusrGui.html +++ b/doc/html/user/MUSR/MusrGui.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -329,7 +329,7 @@ For reporting bugs or requesting new features and improvements please use the - @@ -397,7 +397,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 fd8e52e1..8c58a595 100644 --- a/doc/html/user/MUSR/MusrRoot.html +++ b/doc/html/user/MUSR/MusrRoot.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -1040,7 +1040,7 @@ Result in the RunHeader/SampleEnvironmentInfo: -
        + @@ -1108,7 +1108,7 @@ Result in the RunHeader/SampleEnvironmentInfo:
        - +

        diff --git a/doc/html/user/MUSR/QuickStart.html b/doc/html/user/MUSR/QuickStart.html index d424e328..c533e784 100644 --- a/doc/html/user/MUSR/QuickStart.html +++ b/doc/html/user/MUSR/QuickStart.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -282,7 +282,7 @@ RUN 2008/lem08_his_8472 MUE4 PSI ROOT-NPP (name beamline institute dat
        Topic revision: r7 - 10 Jul 2011, wojek
        @@ -328,7 +328,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 fba0a695..6d3235c8 100644 --- a/doc/html/user/MUSR/TutorialSingleHisto.html +++ b/doc/html/user/MUSR/TutorialSingleHisto.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -283,7 +283,7 @@ This page only summarizes the very basic features and options of the programs co -
        +

        Attachments (6)

         
        @@ -305,7 +305,7 @@ This page only summarizes the very basic features and options of the programs co
        Topic revision: r9 - 02 Sep 2011, wojek
        @@ -351,7 +351,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 6f89856e..c2cf9dd6 100644 --- a/doc/html/user/MUSR/WebHome.html +++ b/doc/html/user/MUSR/WebHome.html @@ -1,6 +1,6 @@ - + @@ -8,7 +8,7 @@ - + @@ -136,7 +136,7 @@ pre {
      • Acknowledgements

      --- AS & (BMW) - last update May 29, 2015 +-- AS & (BMW) - last update August 16, 2015
      @@ -158,9 +158,9 @@ pre {
      Topic revision: r50 - 29 May 2015, AndreasSuter
      +
      Topic revision: r52 - 16 Aug 2015, AndreasSuter
      @@ -204,7 +204,7 @@ pre {
      - +

      diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index cafb2637..e851b315 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -3165,15 +3165,19 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines) if (tokens->GetEntries() < 2) { error = true; } else { - PIntVector group; + PUIntVector group; str = iter->fLine; - if (ParseDetectorGrouping(str, group)) { + PStringNumberList *rl = new PStringNumberList(str.Data()); + string errorMsg(""); + if (rl->Parse(errorMsg, true)) { + group = rl->GetList(); for (UInt_t i=0; iGetEntries() < 2) { error = true; } else { - PIntVector group; + PUIntVector group; str = iter->fLine; - if (ParseDetectorGrouping(str, group)) { + PStringNumberList *rl = new PStringNumberList(str.Data()); + string errorMsg(""); + if (rl->Parse(errorMsg, true)) { + group = rl->GetList(); for (UInt_t i=0; ifLine.Contains("runs", TString::kIgnoreCase)) { // handle plot runs TComplex run; + PStringNumberList *rl; + string errorMsg; + PUIntVector runList; switch (param.fPlotType) { case -1: error = true; @@ -3900,31 +3911,21 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines) case MSR_PLOT_ASYM: case MSR_PLOT_NON_MUSR: case MSR_PLOT_MU_MINUS: - tokens = iter1->fLine.Tokenize(" \t"); - if (!tokens) { + rl = new PStringNumberList(iter1->fLine.Data()); + if (!rl->Parse(errorMsg, true)) { cerr << endl << ">> PMsrHandler::HandlePlotEntry: **SEVERE ERROR** Couldn't tokenize PLOT in line " << iter1->fLineNo; + cerr << endl << ">> Error Message: " << errorMsg; cerr << endl << endl; return false; } - if (tokens->GetEntries() < 2) { // runs missing - error = true; - } else { - for (Int_t i=1; iGetEntries(); i++) { - ostr = dynamic_cast(tokens->At(i)); - str = ostr->GetString(); - if (str.IsDigit()) { - run = TComplex(str.Atoi(),-1.0); - param.fRuns.push_back(run); - } else { - error = true; - } - } + runList = rl->GetList(); + for (UInt_t i=0; i - * - * \param str forward/backward string to be decoded - * \param group decoded detector grouping vector - * - * return: true if parsing was successful, false otherwise. - */ -Bool_t PMsrHandler::ParseDetectorGrouping(TString str, PIntVector &group) -{ - TObjArray *tok=0, *tok1=0; - TObjString *ostr=0; - Int_t first=0, last=0; - - // change cn - cm to cn-cm. Will *NOT* handle cn - cm etc - str = str.ReplaceAll(" - ", "-"); - - group.clear(); - tok = str.Tokenize(" \t"); - - // check that there are indeed enough tokens - if (tok->GetEntries() < 2) { - delete tok; - return false; - } - - for (Int_t i=1; iGetEntries(); i++) { - ostr = dynamic_cast(tok->At(i)); - if (ostr->GetString().Contains("-")) { // hopefully a cn-cm token - tok1 = ostr->GetString().Tokenize("-"); - if (tok1->GetEntries() == 2) { - ostr = dynamic_cast(tok1->At(0)); - if (ostr->GetString().IsDigit()) { - first = ostr->GetString().Atoi(); - } else { - if (tok) delete tok; - if (tok1) delete tok1; - return false; - } - ostr = dynamic_cast(tok1->At(1)); - if (ostr->GetString().IsDigit()) { - last = ostr->GetString().Atoi(); - } else { - if (tok) delete tok; - if (tok1) delete tok1; - return false; - } - - if (last < first) { - if (tok) delete tok; - return false; - } - - for (Int_t i=first; i<=last; i++) - group.push_back(i); - } else { - if (tok) delete tok; - if (tok1) delete tok1; - return false; - } - } else { // hopefully a number - if (ostr->GetString().IsDigit()) { - group.push_back(ostr->GetString().Atoi()); - } else { - if (tok) delete tok; - return false; - } - } - } - - // clean up - if (tok) delete tok; - if (tok1) delete tok1; - - return true; -} - //-------------------------------------------------------------------------- // MakeDetectorGroupingString (private) //-------------------------------------------------------------------------- diff --git a/src/classes/PMusr.cpp b/src/classes/PMusr.cpp index ee618411..478db109 100644 --- a/src/classes/PMusr.cpp +++ b/src/classes/PMusr.cpp @@ -28,10 +28,12 @@ ***************************************************************************/ #include - #include using namespace std; +#include +using namespace boost; + #include "PMusr.h" //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -1741,3 +1743,167 @@ void PMsrRunBlock::SetMapGlobal(UInt_t idx, Int_t ival) // else do nothing at the moment return; } + +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ +// implementation PStringNumberList +//+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ + +//-------------------------------------------------------------------------- +// Parse (public) +//-------------------------------------------------------------------------- +/** + *

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

      This routine removes arbitray number of spaces between '-' and ':', + * e.g. 123 - 125 will be converted to 123-125, etc. + */ +void PStringNumberList::StripSpaces() +{ + string str=fString; + int pos=-1; + + // backward scan + for (int i=str.size(); i>=0; --i) { // check if first space is found + if ((str[i] == ' ') && (pos == -1)) { + pos = i; + } else if ((str[i] == '-') || (str[i] == ':')) { // check for '-' or ':' + if (pos != -1) { + str.erase(i+1, pos-i); + } + } else if (str[i] != ' ') { // anything but different than a space leads to a reset of the pos counter + pos = -1; + } + } + // forward scan + for (unsigned int i=0; iHelper class which parses list of numbers of the following 3 forms and its combination. + * (i) list of integers separted by spaces, e.g. 1 3 7 14 + * (ii) a range of integers of the form nS-nE, e.g. 13-27 which will generate 13, 14, 15, .., 26, 27 + * (iii) a sequence of integers of the form nS:nE:nStep, e.g. 10:20:2 which will generate 10, 12, 14, .., 18, 20 + */ +class PStringNumberList { + public: + PStringNumberList(char *str) { fString = str; } + PStringNumberList(string str) { fString = str; } + virtual ~PStringNumberList() { fList.clear(); } + + virtual bool Parse(string &errorMsg, bool ignoreFirstToken=false); + virtual PUIntVector GetList() { return fList; } + + private: + string fString; + bool fIsValid; + PUIntVector fList; + + virtual bool IsNumber(string &str) { return (str.find_first_not_of("0123456789") == string::npos); } + virtual void StripSpaces(); +}; + #endif // _PMUSR_H_ diff --git a/src/msr2data.cpp b/src/msr2data.cpp index ec2d43ba..58babb8b 100644 --- a/src/msr2data.cpp +++ b/src/msr2data.cpp @@ -37,6 +37,7 @@ #endif #include "git-revision.h" +#include "PMusr.h" #include "PMsr2Data.h" #include @@ -87,12 +88,17 @@ void msr2data_syntax() cout << endl << " [fit [-k] [-t] | fit-