diff --git a/ChangeLog b/ChangeLog index 2ce607c0..12086aae 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,8 +2,14 @@ # ChangeLog #--------------------------------------------------------------------- +changes since 0.16.0 +=================================== +NEW 2016-01-22 update of the docu which now describes the RRF option. + changes since 0.15.0 =================================== +NEW 2016-01-22 add RRF fit option. At the same time, the version has been + increased to 0.16.0. For details see the documentation. FIXED 2015-10-29 TMusrRunHeader didn't map a double vector properly into a string. The last element was a copy of the 2nd last instead if the proper last. This is now fixed. Fixed also some diff --git a/configure.ac b/configure.ac index 0e61d697..536f5455 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.15.0],[andreas.suter@psi.ch]) +AC_INIT([musrfit],[0.16.0],[andreas.suter@psi.ch]) AC_CONFIG_AUX_DIR(admin) AC_CANONICAL_HOST #AC_MSG_RESULT([${host} ${host_cpu} ${host_vendor} ${host_os}]) @@ -35,7 +35,7 @@ dnl ----------------------------------------------- #release versioning MUSR_MAJOR_VERSION=0 -MUSR_MINOR_VERSION=15 +MUSR_MINOR_VERSION=16 MUSR_MICRO_VERSION=0 #release versioning diff --git a/doc/examples/test-asy-HAL9500-RRF.msr b/doc/examples/test-asy-HAL9500-RRF.msr new file mode 100644 index 00000000..e7676ea5 --- /dev/null +++ b/doc/examples/test-asy-HAL9500-RRF.msr @@ -0,0 +1,178 @@ +MnSi, FLC68.2, 50 K +############################################################### +FITPARAMETER +# Nr. Name Value Step Pos_Error Boundaries + 1 rate_1 1.680 0.019 none + 2 field_1 1589.71 0.20 none + 3 rate_2 1.863 0.065 none + 4 field_2 788.86 0.49 none + + 5 alpha_f15 1.0029 0.0015 none + 6 frac_f15 0.7350 0.0090 none + 7 asym_f15 0.2713 0.0043 none 0 none + 8 phase_f15 79.37 0.80 none + + 9 alpha_f26 0.9996 0.0015 none + 10 frac_f26 0.7408 0.0085 none + 11 asym_f26 0.3029 0.0046 none 0 none + 12 phase_f26 30.22 0.73 none + + 13 alpha_f37 1.0003 0.0015 none + 14 frac_f37 0.88 0.23 none + 15 asym_f37 0.0126 0.0045 none 0 none + 16 phase_f37 58.0 15.0 none + + 17 alpha_f48 0.9999 0.0015 none + 18 frac_f48 0.7344 0.0084 none + 19 asym_f48 0.2929 0.0043 none 0 none + 20 phase_f48 -33.13 0.76 none + + 21 alpha_b15 0.9991 0.0013 none + 22 frac_b15 0.7439 0.0077 none + 23 asym_b15 0.2807 0.0038 none 0 none + 24 phase_b15 164.98 0.68 none + + 25 alpha_b26 1.0003 0.0013 none + 26 frac_b26 0.7331 0.0078 none + 27 asym_b26 0.2810 0.0038 none 0 none + 28 phase_b26 119.49 0.70 none + + 29 alpha_b37 0.9989 0.0012 none + 30 frac_b37 0.7504 0.0078 none + 31 asym_b37 0.2755 0.0037 none 0 none + 32 phase_b37 102.07 0.69 none + + 33 alpha_b48 0.9990 0.0012 none + 34 frac_b48 0.7391 0.0080 none + 35 asym_b48 0.2763 0.0039 none 0 none + 36 phase_b48 37.66 0.67 none + +############################################################### +THEORY +asymmetry fun1 +simplExpo 1 (rate) +TFieldCos map3 fun3 (phase frequency) ++ +asymmetry fun2 +simplExpo 3 (rate) +TFieldCos map3 fun4 (phase frequency) + +############################################################### +FUNCTIONS +fun1 = map1 * map2 +fun2 = (1 - map1) * map2 +fun3 = gamma_mu * par2 +fun4 = gamma_mu * par4 + +############################################################### +GLOBAL +fittype 3 (asymmetry RRF fit) +fit 0.0005 6 +rrf_freq 7.15 T +rrf_packing 300 +rrf_phase 0.00 + +############################################################### +# Fw1-Fw5 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 5 +map 6 7 8 0 0 0 0 0 0 0 0 +forward 2 +backward 6 +background 500 15000 500 15000 # estimated bkg: 0.0492 / 0.0501 +data 20158 409500 20130 409500 +t0 20108.0 20080.0 + +# Fw2-Fw6 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 9 +map 10 11 12 0 0 0 0 0 0 0 0 +forward 3 +backward 7 +background 500 15000 500 15000 # estimated bkg: 0.0501 / 0.0451 +data 20138 409500 20121 409500 +t0 20088.0 20071.0 + +# Fw3-Fw7 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 13 +map 14 15 16 0 0 0 0 0 0 0 0 +forward 3 +backward 8 +background 500 15000 500 15000 # estimated bkg: 0.0501 / 0.0449 +data 20111 409500 20116 409500 +t0 20061.0 20066.0 + +# Fw4-Fw8 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 17 +map 18 19 20 0 0 0 0 0 0 0 0 +forward 5 +backward 9 +background 500 15000 500 15000 # estimated bkg: 0.0560 / 0.0462 +data 20121 409500 20082 409500 +t0 20071.0 20032.0 + +# Bw1-Bw5 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 21 +map 22 23 24 0 0 0 0 0 0 0 0 +forward 10 +backward 14 +background 500 15000 500 15000 # estimated bkg: 0.0641 / 0.0806 +data 20072 409500 20067 409500 +t0 20022.0 20017.0 + +# Bw2-Bw6 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 25 +map 26 27 28 0 0 0 0 0 0 0 0 +forward 11 +backward 15 +background 500 15000 500 15000 # estimated bkg: 0.0689 / 0.0768 +data 20076 409500 20069 409500 +t0 20026.0 20019.0 + +# Bw3-Bw7 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 29 +map 30 31 32 0 0 0 0 0 0 0 0 +forward 12 +backward 16 +background 500 15000 500 15000 # estimated bkg: 0.0769 / 0.0795 +data 20060 409500 20069 409500 +t0 20010.0 20019.0 + +# Bw4-Bw8 +++++++ +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +alpha 33 +map 34 35 36 0 0 0 0 0 0 0 0 +forward 13 +backward 17 +background 500 15000 500 15000 # estimated bkg: 0.0761 / 0.0702 +data 20063 409500 20089 409500 +t0 20013.0 20039.0 + +############################################################### +COMMANDS +#MAX_LIKELIHOOD +PRINT_LEVEL 2 +MINIMIZE +#MINOS +SAVE + +############################################################### +PLOT 3 (asymmetry RRF plot) +runs 1 2 3 4 5 6 7 8 +range 0 9.07 -0.5 0.5 + +############################################################### +FOURIER +units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s' +fourier_power 11 +apodization STRONG # NONE, WEAK, MEDIUM, STRONG +plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE + +############################################################### +STATISTIC --- 2016-01-18 16:23:00 + chisq = 7402.2, NDF = 6516, chisq/NDF = 1.135997 diff --git a/doc/examples/test-histo-HAL9500-RRF.msr b/doc/examples/test-histo-HAL9500-RRF.msr new file mode 100644 index 00000000..24891bf9 --- /dev/null +++ b/doc/examples/test-histo-HAL9500-RRF.msr @@ -0,0 +1,235 @@ +MnSi, FLC68.2, 50 K +############################################################### +FITPARAMETER +# Nr. Name Value Step Pos_Error Boundaries + 1 Rate_1 1.678 0.018 none + 2 Field_1_RRF 1589.66 0.19 none + 3 Rate_2 1.948 0.064 none + 4 Field_2_RRF 788.93 0.47 none + + 5 Asym_1 0.3102 0.0067 none + 6 Frc_1 0.728 0.012 none + 7 Phase_1 57.3 1.1 none + + 8 Asym_2 0.3073 0.0066 none + 9 Frc_2 0.748 0.012 none + 10 Phase_2 30.6 1.0 none + + 11 Asym_3 0.3245 0.0065 none + 12 Frc_3 0.728 0.011 none + 13 Phase_3 18.70 0.96 none + + 14 Asym_4 0.3290 0.0062 none + 15 Frc_4 0.733 0.011 none + 16 Phase_4 339.27 0.96 none + + 17 Asym_5 0.3213 0.0062 none + 18 Frc_5 0.730 0.011 none + 19 Phase_5 282.5 1.0 none + + 20 Asym_6 0.3424 0.0072 none + 21 Frc_6 0.726 0.012 none + 22 Phase_6 211.3 1.0 none + + 23 Asym_7 0.3321 0.0069 none + 24 Frc_7 0.731 0.012 none + 25 Phase_7 161.7 1.1 none + + 26 Asym_8 0.3219 0.0067 none + 27 Frc_8 0.730 0.012 none + 28 Phase_8 133.7 1.1 none + + 29 Asym_9 0.3030 0.0058 none + 30 Frc_9 0.730 0.011 none + 31 Phase_9 158.87 0.97 none + + 32 Asym_10 0.3046 0.0057 none + 33 Frc_10 0.731 0.011 none + 34 Phase_10 129.97 0.97 none + + 35 Asym_11 0.2898 0.0055 none + 36 Frc_11 0.754 0.011 none + 37 Phase_11 101.80 0.96 none + + 38 Asym_12 0.3013 0.0055 none + 39 Frc_12 0.740 0.010 none + 40 Phase_12 43.00 0.88 none + + 41 Asym_13 0.3009 0.0054 none + 42 Frc_13 0.747 0.010 none + 43 Phase_13 351.72 0.88 none + + 44 Asym_14 0.3054 0.0053 none + 45 Frc_14 0.729 0.010 none + 46 Phase_14 289.91 0.91 none + + 47 Asym_15 0.2931 0.0053 none + 48 Frc_15 0.740 0.010 none + 49 Phase_15 282.39 0.94 none + + 50 Asym_16 0.2814 0.0058 none + 51 Frc_16 0.729 0.011 none + 52 Phase_16 212.89 0.99 none + +############################################################### +THEORY +asymmetry fun1 +simplExpo 1 (rate) +TFieldCos map3 fun3 (phase frequency) ++ +asymmetry fun2 +simplExpo 3 (rate) +TFieldCos map3 fun4 (phase frequency) + +############################################################### +FUNCTIONS +fun1 = map1 * map2 +fun2 = map1 * (1 - map2) +fun3 = par2 * gamma_mu +fun4 = par4 * gamma_mu + +############################################################### +GLOBAL +fittype 1 (single histogram RRF fit) +rrf_freq 7.15 T +rrf_packing 300 +rrf_phase 0.00 +fit 0.0005 10 + +############################################################### +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 5 6 7 0 0 0 0 0 0 0 0 +forward 2 +background 100 18000 # estimated bkg: 0.0476 +data 20208 409500 +t0 20108.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 8 9 10 0 0 0 0 0 0 0 0 +forward 3 +background 100 18000 # estimated bkg: 0.0490 +data 20188 409500 +t0 20088.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 11 12 13 0 0 0 0 0 0 0 0 +forward 4 +background 100 18000 # estimated bkg: 0.0582 +data 20161 409500 +t0 20061.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 14 15 16 0 0 0 0 0 0 0 0 +forward 5 +background 100 18000 # estimated bkg: 0.0553 +data 20171 409500 +t0 20071.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 17 18 19 0 0 0 0 0 0 0 0 +forward 6 +background 100 18000 # estimated bkg: 0.0515 +data 20180 409500 +t0 20080.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 20 21 22 0 0 0 0 0 0 0 0 +forward 7 +background 100 18000 # estimated bkg: 0.0458 +data 20171 409500 +t0 20071.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 23 24 25 0 0 0 0 0 0 0 0 +forward 8 +background 100 18000 # estimated bkg: 0.0466 +data 20166 409500 +t0 20066.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 26 27 28 0 0 0 0 0 0 0 0 +forward 9 +background 100 18000 # estimated bkg: 0.0457 +data 20132 409500 +t0 20032.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 29 30 31 0 0 0 0 0 0 0 0 +forward 10 +background 100 18000 # estimated bkg: 0.0635 +data 20122 409500 +t0 20022.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 32 33 34 0 0 0 0 0 0 0 0 +forward 11 +background 100 18000 # estimated bkg: 0.0685 +data 20126 409500 +t0 20026.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 35 36 37 0 0 0 0 0 0 0 0 +forward 12 +background 100 18000 # estimated bkg: 0.0752 +data 20110 409500 +t0 20010.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 38 39 40 0 0 0 0 0 0 0 0 +forward 13 +background 100 18000 # estimated bkg: 0.0760 +data 20113 409500 +t0 20013.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 41 42 43 0 0 0 0 0 0 0 0 +forward 14 +background 100 18000 # estimated bkg: 0.0809 +data 20117 409500 +t0 20017.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 44 45 46 0 0 0 0 0 0 0 0 +forward 15 +background 100 18000 # estimated bkg: 0.0755 +data 20119 409500 +t0 20019.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 47 48 49 0 0 0 0 0 0 0 0 +forward 16 +background 100 18000 # estimated bkg: 0.0796 +data 20119 409500 +t0 20019.0 +#-------------------------------------------------------------- +RUN data/tdc_hifi_2014_00153 PIE3 PSI PSI-MDU (name beamline institute data-file-format) +map 50 51 52 0 0 0 0 0 0 0 0 +forward 17 +background 100 18000 # estimated bkg: 0.0702 +data 20139 409500 +t0 20039.0 + +############################################################### +COMMANDS +#MAX_LIKELIHOOD +PRINT_LEVEL 2 +MINIMIZE +#MINOS +SAVE + +############################################################### +PLOT 1 (single histo RRF plot) +runs 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 +range 0 9.07 -0.5 0.5 + +############################################################### +FOURIER +units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s' +fourier_power 12 +apodization MEDIUM # NONE, WEAK, MEDIUM, STRONG +plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE +#range 7.1 7.5 + +############################################################### +STATISTIC --- 2016-01-14 13:24:36 + chisq = 22007.6, NDF = 20700, chisq/NDF = 1.063168 diff --git a/doc/html/user/MUSR/BmwLibs.html b/doc/html/user/MUSR/BmwLibs.html index b70eadf7..12c12d36 100644 --- a/doc/html/user/MUSR/BmwLibs.html +++ b/doc/html/user/MUSR/BmwLibs.html @@ -1,35 +1,38 @@ - + - - + + - MUSR :: BmwLibs - + MUSR :: BmwLibs + + + + + + + - + - - + + + + - - - - - - - -
+ + + + + + + + + + + + + + + + +
-
+
-
-
-
- -
-

    -

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

-

-

-

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

-

- - - -

-

-

-

-

-

-

How to Cite musrfit?

+
+
+

How to Cite musrfit?

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

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

    -

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

-

-

-

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

-

- - - -

-

-

-

-

-

-
- -

libFitPofB

-
    +
    +
    +
    + +

    libFitPofB

    + - -

    1 Introduction

    + +

    1 Introduction

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

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

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


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

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

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

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

    -

    2 LE-μSR

    -

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

    +

    2 LE-μSR

    +

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

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

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

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

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

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

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

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

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

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

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

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

          Notes

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


          -

          3 Conventional (bulk) μSR

          -

          3.1 Field distributions in the mixed state of isotropic superconductors

          +

          3 Conventional (bulk) μSR

          +

          3.1 Field distributions in the mixed state of isotropic superconductors

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

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

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

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

          -
          Modified London model(3)

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

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

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

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

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

          +
          Modified London model(3)

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

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

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

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

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

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

          Notes

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

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

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

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


          - -

          4 The XML startup file

          + +

          4 The XML startup file

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

          --- BMW & AS
    -
    - - - - - - - -
    - -
    - Edit | Attach | Print version | PDF | History: r17 < r16 < r15 < r14 | Backlinks | View wiki text | Refresh | More topic actions -
    -
    Topic revision: r17 - 03 Jul 2015, AndreasSuter
    -
    -
-
 
-
-
-
- -
-

    -

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

-

-

-

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

-

- - - -

-

-

-

-

-

-
- -

libZFRelaxation

-
-
 
-
-
-
- -
-

    -

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

-

-

-

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

msr2data

-

- - - -

-

-

-

-

-

-
-

msr2data

-

-
    +

    - -

    1 Introduction

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

    1 Introduction

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

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

    @@ -149,14 +189,14 @@ Before the usage of msr2data will be explained in greater detail first be aware

    Notes

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


    - -

    2 Basic Types of Usage

    + +

    2 Basic Types of Usage

    Apart from numerous optional parameters that might be set or not, in principle there are four different ways of calling msr2data. These differ in how the list of runs which should be processed is supplied:
    msr2data <run> <extension> [optional parameters]
    A single run number.
    msr2data <firstRunNo> <lastRunNo> <extension> [optional parameters]
    An interval of run numbers is specified through the first and the last run number. The condition <firstRunNo> < <lastRunNo> is not necessary. @@ -165,20 +205,20 @@ Apart from numerous msr2data 8472 _tf_h13 generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr. +
    msr2data 8472 _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr.
    msr2data 8472 8474 _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr, 8473_tf_h13.msr, and 8474_tf_h13.msr. -
    msr2data [8472 8470] _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr and 8470_tf_h13.msr. -
    msr2data [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 [8472 8470] _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8472_tf_h13.msr and 8470_tf_h13.msr. +
    msr2data [8470:8474:2] _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from 8470_tf_h13.msr, 8472_tf_h13.msr, and 8474_tf_h13.msr.
    msr2data run.list _tf_h13
    generates the DB file out.db (can be changed by using the -o option) from all runs listed in the ASCII file run.list in the working directory. In this file it is also possible to include external parameters which should be put in the resulting DB file. The structure of the run.list is the following: - +
     RUN VAR1 VAR2 VAR3 ...
     8460 200 27.1 46.2 ...
     8472 205 27.1 46.3 ...
     8453 210 27.2 45.9 ...
    -·     ·    ·    ·
    -·     ·    ·    ·
    -·     ·    ·    ·
    +·     ·    ·    ·
    +·     ·    ·    ·
    +·     ·    ·    ·
     
    The first not commented and not empty line determines the parameter names and labels and has to be present!
    It is allowed to add comments (with a preceding #) or empty lines to the run-list file. @@ -187,14 +227,14 @@ The following should be mentioned together with the above examples:
    • The output files in the examples above are only newly created if they did not exist before invoking msr2data. If the files were already present the msr-file data would be appended!
    • If the files have been newly created, also the DB file header is written. If the files were present before, only the data blocks are appended. The output of the header can either be forced or completely suppressed with the header and noheader options as shall be seen later.
    -
      +
      • If the musrfit output files do not have an <extension> as specified above like 8472.msr one has to call msr2data like in the following example:
         msr2data 8472 8460 ""
         

      - -

      3 Optional Parameters

      + +

      3 Optional Parameters

      As mentioned already above there are some optional parameters which change the behavior of msr2data and can be passed in any order. Here is a complete list:
      data
      The output file format is changed to a simple column ASCII file (default output file name: out.dat).
      new
      An existing output file is deleted before new information is written to it. @@ -215,7 +255,7 @@ 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 8502-8504 8507] _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, 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.
      @@ -231,12 +271,12 @@ msr2data 8472 8475 _tf_h13 msr-8471!
       
      Using 8471_tf_h13.msr as template for all runs, msr2data generates the msr input files 8472_tf_h13.msr through 8475_tf_h13.msr. No fitting will be performed and no DB or ASCII output will be generated!

      - -

      4 The Global Mode

      + +

      4 The Global Mode

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

      - -

      4.1 File Generation

      + +

      4.1 File Generation

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

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

      -

      4.2 Parameter Extraction

      +

      4.2 Parameter Extraction

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

      - -

      4.3 The Extended Global Mode

      + +

      4.3 The Extended Global Mode

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

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

      - -

      5 Known Limitations

        + +

        5 Known Limitations

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

        - -

        6 The Graphical User Interface Provided by musrgui / musredit

        + +

        6 The Graphical User Interface Provided by musrgui / musredit

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

        - -

        7 Bugtracking

        + +

        7 Bugtracking

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

        --- BMW & AS
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r39 < r38 < r37 < r36 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r39 - 16 Aug 2015, AndreasSuter
-
-
-
-
 
-
-
-
- -
-

    -

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

-

-

-

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

-

- - - -

-

-

-

-

-

-
- -

musrfit User Manual

-
    +
    +
    +
    + +

    musrfit User Manual

    + - -

    1 Introduction

    + +

    1 Introduction

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

    -

    2 Available Executables, Configuration Files and their Basic Usage

    +

    2 Available Executables, Configuration Files and their Basic Usage

    - -

    2.1 musrfit

    + +

    2.1 musrfit

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

    - -

    2.2 musrview

    + +

    2.2 musrview

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

    Within the drawn canvas all standard actions applicable to ROOT canvases might be performed. In the menu bar the Musrfit menu can be found. From there some musrfit-specific actions might be taken:
    @@ -224,8 +246,8 @@ 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

    + +

    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:
    @@ -275,11 +297,11 @@ Additionally, some functions can be accessed using key-shortcuts:
    u
    reset the plotting range to the area given in the msr-file or the form the command line ("unzoom")

    - -

    2.4 musrt0

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

    2.4 musrt0

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

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

    - -

    2.5 musrfit_startup.xml

    + +

    2.5 musrfit_startup.xml

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

    - -

    2.6 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) @@ -374,8 +396,8 @@ A typical example then looks like:
    msr2msr 8472-WKM.msr 8472-musrfit.msr
    If the input file has already the musrfit msr file structure, the output file will be just a copy of the input file.

    - -

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

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

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

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

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

    - -

    2.8 dump_header

    + +

    2.8 dump_header

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

    - -

    3 Auxiliary Programs

    + +

    3 Auxiliary Programs

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

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

    - -

    4 Description of the msr File Format

    + +

    4 Description of the msr File Format

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

    - -

    4.1 The Title

    + +

    4.1 The Title

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

    - -

    4.2 The FITPARAMETER Block

    + +

    4.2 The FITPARAMETER Block

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

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

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

    Notes

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

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


    - -

    4.3 The THEORY Block

    + +

    4.3 The THEORY Block

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

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

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

    Notes

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

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

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

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

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

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

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


    - -

    4.3.1 Maps

    + +

    4.3.1 Maps

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

    - -

    4.3.2 Functions

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

    4.3.2 Functions

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

    - -

    4.3.3 User Functions

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

    4.3.3 User Functions

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

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

    - -

    4.4 The FUNCTIONS Block

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

    4.4 The FUNCTIONS Block

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

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

    - -

    4.5 The GLOBAL Block

    + +

    4.5 The GLOBAL Block

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

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

      -There is one specific entry for the GLOBAL block which is
        -
      • time_base <tag> -
      -with the recognized tags: <tag> = usec, msec, sec. This will set the time base (not the time resolution) for fitting, plotting, and exporting data. +The single histo RRF fit and asymmetry RRF fit related entries (fittype 1 and 3 only) have the following syntax: +

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

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

      - -

      4.6 The RUN Block

      + +

      4.6 The RUN Block

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

        - -

        4.7 The COMMANDS Block

        + +

        4.7 The COMMANDS Block

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

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

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

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

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

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

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

        - -

        4.8 The FOURIER Block

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

        4.8 The FOURIER Block

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

        - -

        4.9 The PLOT Block

        +Notes +

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

        +

        +

        +
        +

        + +

        4.9 The PLOT Block

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

        - -

        4.10 The STATISTIC Block

        + +

        4.10 The STATISTIC Block

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

        - -

        5 The Fit Types

        + +

        5 The Fit Types

        - -

        5.1 Single Histogram Fit

        + +

        5.1 Single Histogram Fit

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

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

        - -

        5.2 Asymmetry Fit

        + +

        5.2 Single Histogram RRF Fit

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

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

        + +

        5.3 Asymmetry Fit

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

        - -

        5.3 Negative Muon μSR Fit

        + +

        5.4 Asymmetry RRF Fit

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

        + +

        5.5 Negative Muon μSR Fit

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

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

        - -

        5.4 Non-μSR Fit

        + +

        5.6 Non-μSR Fit

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

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

        - -

        6 User Functions

        + +

        6 User Functions

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

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

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

          - -

          6.1 User Function without global user-function-object access

          + +

          6.1 User Function without global user-function-object access

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

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

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

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

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

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

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

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

        -Good luck! wink +Good luck! wink

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

        - -

        6.2 User Function with global user-function-object access

        + +

        6.2 User Function with global user-function-object access

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

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

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

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

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

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

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

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


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

        - -

        7 Technical Description of the musrfit framework

        + +

        7 Technical Description of the musrfit framework

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

        - -

        8 Bugtracking

        + +

        8 Bugtracking

        +

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

        +-- AS & BMW

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

        --- AS & BMW -
        - - - - - - - -
        - -
        - Edit | Attach | Print version | PDF | History: r126 < r125 < r124 < r123 | Backlinks | View wiki text | Refresh | More topic actions -
        -
        Topic revision: r126 - 29 May 2015, AndreasSuter
        - - - -
         
        -
        -
        -
      RUN-block tag comment RUN-block tag comment
      - -
      -

        -

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

-

-

-

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

-

- - - -

-

-

-

-

-

-

Acknowledgements - musrfit

+
+
+

Acknowledgements - musrfit

-
Bastian M. Wojek
I am very much indebted to BMW for his rigorous testing of musrfit, his many useful suggestions, contributions, and for the largest part of the user manual of musrfit which makes it accessible to a broader audience! Many thanks Bastian! -
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r5 < r4 < r3 < r2 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r5 - 03 Jul 2015, AndreasSuter
-
-
-
- +
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! +

-PSI Webs -
-System Webs -
-

-
-
 
-
-
-
- -
-

    -

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

-

-

-

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

Setting up musrfit on Different Platforms

-

- - - -

-

-

-

-

-

-

Setting up musrfit on Different Platforms

-

-
    +

    -

    1 Supported Operating Systems and Software Requirements

    +

    1 Supported Operating Systems and Software Requirements

    -This page is intended to demonstrate for the interested user which steps are necessary to set up the free software μSR data analysis framework musrfit. While the preferred way is to run the software on GNU/Linux 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! +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 (gcc, g++), the GNU build tools autoconf, automake and libtool as well as the helper tool pkg-config musrfit requires the installation of a few open-source libraries and programs including their header packages:
    -
    boost C++ libraries
    The powerful Spirit parser framework used by musrfit is included in that collection of libraries. Required version ≥ 1.33 -
    GNU Scientific Library
    A numerical C and C++ library which provides efficient implementations of various mathematical routines. Required version ≥ 1.9 -
    FFTW
    A C implementation for the fast computation of discrete Fourier transforms. Required version ≥ 3.1 -
    ROOT
    A C++ data analysis framework developed at CERN. Required version ≥ 5.22 -
    libxml2
    The XML C parser and toolkit of Gnome. Required version ≥ 2.0 -
    + +Apart from GCC, the GNU Compiler Collection (gcc, g++), the GNU build tools autoconf, automake and libtool as well as the helper tool pkg-config musrfit requires the installation of a few open-source libraries and programs including their header packages: + $ boost C++ libraries: The powerful Spirit parser framework used by musrfit is included in that collection of libraries. Required version ≥ 1.33 + $ GNU Scientific Library: A numerical C and C++ library which provides efficient implementations of various mathematical routines. Required version ≥ 1.9 + $ FFTW: A C implementation for the fast computation of discrete Fourier transforms. Required version ≥ 3.1 + $ ROOT: A C++ data analysis framework developed at CERN. Required version ≥ 5.22 + $ libxml2: The XML C parser and toolkit of Gnome. Required version ≥ 2.0

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

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

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

    -

    2 OS Restrictions

    +

    2 OS Restrictions

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

    -

    3 GNU/Linux

    -

    3.1 Requirements

    -

    3.1.1 Everything but ROOT and NeXus

    +

    3 GNU/Linux

    +

    3.1 Requirements

    +

    3.1.1 Everything but ROOT and NeXus

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

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

    -

    3.1.2 Installation of NeXus requirements (optional)

    +

    3.1.2 Installation of NeXus requirements (optional)

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

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

    -

    3.1.3 ROOT

    +

    3.1.3 ROOT

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

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

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

    - -

    3.2 musrfit

    + +

    3.2 musrfit

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

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

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

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

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

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

    Normally it should not be necessary to make use of any of the options except for specifying the installation path with --prefix. The other paths should be detected automatically. If this does not work for some reason the configure script will terminate and ask for the information. -When the configure script has been called successfully everything is ready for building the musrfit libraries and executables. A standard installation sequence (without NeXus support) might then look like(3): +When the configure script has been called successfully everything is ready for building the musrfit libraries and executables. A standard installation sequence (without NeXus support) might then look like(3):
    -$ cd $HOME/Apps/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):
      @@ -342,54 +344,54 @@ export MUSRFITPATH=/opt/root-system/bin
       
    • Adjust the paths where musrfit will search for data files in the installed musrfit_startup.xml. For detailed information on this XML file refer to the manual.

    - -

    3.3 musredit

    + +

    3.3 musredit

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

    -

    3.4 musrgui

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

    3.4 musrgui

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

    -

    3.5 Check of the installation

    +

    3.5 Check of the installation

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

    Notes

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


    -

    4 MS Windows

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

    4 MS Windows

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

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

    -

    4.1 Requirements

    -

    4.1.1 Setting up Cygwin

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

    4.1 Requirements

    +

    4.1.1 Setting up Cygwin

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

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

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

    -

    4.1.2 Installation of NeXus requirements (optional)

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

    4.1.2 Installation of NeXus requirements (optional)

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

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

    -

    4.1.3 ROOT

    +

    4.1.3 ROOT

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

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

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

    -

    4.2 musrfit

    +

    4.2 musrfit

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

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

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

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

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

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

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

    - -

    4.3 musredit

    + +

    4.3 musredit

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

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

    -

    4.4 musrgui

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

    4.4 musrgui

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

    -

    4.5 Check of the installation

    +

    4.5 Check of the installation

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

    -

    4.6 Possible problems

    +

    4.6 Possible problems

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

    -

    5 Mac OS X

    +

    5 Mac OS X

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

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

    -

    5.1 Requirements (MacPorts)

    -

    5.1.1 Everything but ROOT and NeXus

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

    5.1 Requirements (MacPorts)

    +

    5.1.1 Everything but ROOT and NeXus

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

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

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

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

    -

    5.1.2 Installation of NeXus requirements (optional)

    +

    5.1.2 Installation of NeXus requirements (optional)

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

    -

    5.1.3 ROOT

    +

    5.1.3 ROOT

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

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

    -For further 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: +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:
    @@ -658,82 +660,41 @@ In order to finalize the ROOT installation and to prepare already t
     <plist version="1.0">
     <dict>
             <key>MUSRFITPATH</key>
    -        <string>$HOME/Apps/root/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>$HOME/Apps/root</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: +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: +One needs to add some system variables in ~/.profile:
    -export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
    +export ROOTSYS=$HOME/Apps/root
    +launchctl setenv ROOTSYS $ROOTSYS
    +export MUSRFITPATH=$ROOTSYS/bin
    +launchctl setenv MUSRFITPATH $MUSRFITPATH
    +export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
     

    -

    5.2 Requirements (Fink)

    -

    5.2.1 Everything but ROOT and NeXus

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

    5.2 Requirements (Fink)

    +

    5.2.1 Everything but ROOT and NeXus

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

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

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

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

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

    -

    5.2.2 Installation of NeXus requirements (optional)

    +

    5.2.2 Installation of NeXus requirements (optional)

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

    libjpeg hdf hdf5-18 hdf5-18-shlibs

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

    -

    5.2.3 ROOT

    -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). +

    5.2.3 ROOT

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

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

    -For further 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: +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:
    @@ -815,90 +776,49 @@ In order to finalize the ROOT installation and to prepare already t
     <plist version="1.0">
     <dict>
             <key>MUSRFITPATH</key>
    -        <string>$HOME/Apps/root/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>$HOME/Apps/root</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: +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: +One needs to add some system variables in ~/.profile:
    -export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
    +export ROOTSYS=$HOME/Apps/root
    +launchctl setenv ROOTSYS $ROOTSYS
    +export MUSRFITPATH=$ROOTSYS/bin
    +launchctl setenv MUSRFITPATH $MUSRFITPATH
    +export PATH=$ROOTSYS/bin:$QTDIR/bin:$PATH
     
    -

    5.3 musrfit

    +

    5.3 musrfit

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

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

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

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

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

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

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

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

    - -

    5.4 musredit

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

    5.4 musredit

    +In the latest version of musrfit the configure script tries to determine automatically if Qt4.5 or higher is set up on the machine. In case this is found, the editor musredit is built already together with musrfit. If not, one can either try to call the configure script with the "--with-qt4" option (MacPort: for Mac OS X < 10.11 this is likley /opt/local/libexec/qt4, for Mac OS X >= 10.11 this is likely /usr/local/libexec/qt4) or install this editor separately:
    -$ cd ~/Apps/musrfit/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 (obsolete)

    +

    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 ~/Apps/musrfit/src/musrgui
    -$ qmake musrgui.pro
    -$ make
    -$ make install
    +$ cd ~/Apps/musrfit/src/musrgui
    +$ qmake musrgui.pro
    +$ make
    +$ make install
     
    -The last command copies musrgui.app to the standard program directory /Applications (4) and the musrgui_startup.xml to $ROOTSYS/bin/musrgui_startup.xml. Eventually, in the installed musrgui_startup.xml the path-specifications have to be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual. +The last command copies musrgui.app to the standard program directory /Applications (4) and the musrgui_startup.xml to $ROOTSYS/bin/musrgui_startup.xml. Eventually, in the installed musrgui_startup.xml the path-specifications have to be adjusted to match the local musrfit installation. For detailed information on this XML file refer to the manual.

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

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

    Notes

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


    -

    5.6 Check of the installation

    +

    5.6 Check of the installation

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

    --- AS & BMW
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r61 < r60 < r59 < r58 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r61 - 03 Jul 2015, AndreasSuter
-
-
-
 
-
-
-
- -
-

    -

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

-

-

-

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

musredit / (musrgui)

-

- - - -

-

-

-

-

-

-
-

musredit / (musrgui)

-

-
    +

    -

    1 Introduction

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

    1 Introduction

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

    -

    2 Available Executables, Configuration Files and their Basic Usage

    - -

    2.1 musredit / (musrgui)

    +

    2 Available Executables, Configuration Files and their Basic Usage

    + +

    2.1 musredit / (musrgui)

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

    If called without any parameters an empty editor window opens.

    - -

    2.2 musredit_startup.xml / musrgui_startup.xml

    + +

    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 musredit / musrgui:
    @@ -190,13 +230,13 @@ Additionally, there are some settings defined in this XML file which should be o
    <help_section></help_section>
    define various help messages in this environment
    <help_main>HELP TEXT</help_main>
    set the main help message HELP TEXT here (inside a <help_section> environment)
    -
    <func_pixmap_path>PIX_PATH</func_pixmap_path>
    set the path PIX_PATH to LaTeX_logo.png pixmaps visualizing the various supported theory functions +
    <func_pixmap_path>PIX_PATH</func_pixmap_path>
    set the path PIX_PATH to LaTeX_logo.png pixmaps visualizing the various supported theory functions
    <theory_functions></theory_functions>
    define the functions for a msr file's THEORY block according to the correct syntax in this environment
    <func></func>
    specify a function here (inside a <theory_functions> environment)
    <name>NAME</name>
    the NAME of the function in the msr file (inside a <func> environment)
    <comment>COMMENT</comment>
    description of the used parameters (inside a <func> environment)
    <label>LABEL</label>
    LABEL of the function in the musrgui / musredit menu (inside a <func> environment) -
    <pixmap>PIXMAP</pixmap>
    LaTeX_logo.png picture used to describe the function and stored in the PIX_PATH (inside a <func> environment) +
    <pixmap>PIXMAP</pixmap>
    LaTeX_logo.png picture used to describe the function and stored in the PIX_PATH (inside a <func> environment)
    <params>N</params>
    number of parameters N used by the function (inside a <func> environment)
    @@ -266,141 +306,94 @@ An example of the musrgui_startup.xml looks like: </musrgui_startup>

    - -

    3 musrfit Features

    + +

    3 musrfit Features

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

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

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

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

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

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

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

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

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

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

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

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

    - -

    4 Editor Features

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

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

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

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

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

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

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

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

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

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

    + +

    4 Editor Features

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

      - -

      5 Bugtracking

      + +

      5 Bugtracking

      -For reporting bugs or requesting new features and improvements please use the Bitbucket Tracker, PSI Tracker (PSI account needed) 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.

      --- AS & BMW
-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r20 < r19 < r18 < r17 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r20 - 19 Feb 2015, AndreasSuter
-
-
-
-
 
-
-
-
- -
-

    -

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

-

-

-

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

MusrRoot

-

- - - -

-

-

-

-

-

-
-

MusrRoot

-

-
    +

    -

    1 Introduction

    +

    1 Introduction

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

    -

    2 Some Basics Concerning ROOT Files

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

    2 Some Basics Concerning ROOT Files

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

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

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

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

    -

    3 MusrRoot an Extensible Open File Format for μSR

    +

    3 MusrRoot an Extensible Open File Format for μSR

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

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

    -

    3.1 Run Information Contained in RunHeader

    +

    3.1 Run Information Contained in RunHeader

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

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

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

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

    - -

    3.1.1 RunInfo Overview

    + +

    3.1.1 RunInfo Overview

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

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

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

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

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

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

    - -

    4 TMusrRunHeader Concept

    + +

    4 TMusrRunHeader Concept

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

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

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

      -

      4.1 User Interface for MusrRoot Run Header

      +

      4.1 User Interface for MusrRoot Run Header

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

      -

      4.1.1 Writing a MusrRoot Run Header

      +

      4.1.1 Writing a MusrRoot Run Header

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

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

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

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

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

      -

      4.1.2 Reading a MusrRoot Run Header

      +

      4.1.2 Reading a MusrRoot Run Header

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

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

      - -

      4.2 Validation of a MusrRoot File

      + +

      4.2 Validation of a MusrRoot File

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

      - +MusrRootValidationScheme.png

      MusrRoot validation scheme

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

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

      - -

      5 RunInfo Required

      + +

      5 RunInfo Required

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

      - -

      6 DetectorInfo Required

      + +

      6 DetectorInfo Required

      The DetectorInfo is organized in a sub-tree like

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

      Detector<XXX> has the elements

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

      - -

      7 SampleEnvironmentInfo Required

      + +

      7 SampleEnvironmentInfo Required

      Here only a single entry is required, namely

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

      - -

      8 MagneticFieldEnvironmentInfo Required

      + +

      8 MagneticFieldEnvironmentInfo Required

      Here only a single entry is required, namely

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

      - -

      9 BeamlineInfo Required

      + +

      9 BeamlineInfo Required

      Here only a single entry is required, namely

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

      -

      10 Exhaustive MusrRoot Tree Including Everything Required

      +

      10 Exhaustive MusrRoot Tree Including Everything Required

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

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

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

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

      - -

      11 TMusrRunPhysicalQuantity - Possible Representations

      + +

      11 TMusrRunPhysicalQuantity - Possible Representations

      A physical property can be described as

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

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

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

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

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

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

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

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

    -

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

-

-

-

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

-

- - - -

-

-

-

-

-

-

Quickstart for WKM users

-
    +
    +
    +

    Quickstart for WKM users

    + -

    Introduction

    +

    Introduction

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

    -

    Differences between WKM and musrfit msr files

    +

    Differences between WKM and musrfit msr files

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

    -

    Selected new features in musrfit

      +

      Selected new features in musrfit

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

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

    -

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

-

-

-

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

-

- - - -

-

-

-

-

-

-

musrfit Single-Histogram-Fit Tutorial

+
+
+

musrfit Single-Histogram-Fit Tutorial

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

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

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

-

1 The msr file

+

1 The msr file

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

-

2 Determine t0 and the data range using musrt0

+

2 Determine t0 and the data range using musrt0

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

-

3 Fit the model to the data using musrfit

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

3 Fit the model to the data using musrfit

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

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

-

4 View the data and the fit using musrview

+

4 View the data and the fit using musrview

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

-

5 Process multiple msr files using msr2data

+

5 Process multiple msr files using msr2data

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

-

6 Further reading

+

6 Further reading

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

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

    -

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

-

-

-

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

Welcome to the MUSR web

-

- - - -

-

-

-

-

-

-

Welcome to the MUSR web

-

-

Documentation of the μSR data analysis suite musrfit

-
- - - - - - - -
- -
- Edit | Attach | Print version | PDF | History: r52 < r51 < r50 < r49 | Backlinks | View wiki text | Refresh | More topic actions -
-
Topic revision: r52 - 16 Aug 2015, AndreasSuter
-
-
-
- +-- AS & (BMW) - last update January 19, 2016

-PSI Webs -
-System Webs -
-

-
-
 
-
-
-
- -
-

    -

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

-

-

-

\ No newline at end of file + + + + + + + + + + + \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkin/print.css b/doc/html/user/pub/System/PatternSkin/print.css index 420b3aaa..8fb202ee 100644 --- a/doc/html/user/pub/System/PatternSkin/print.css +++ b/doc/html/user/pub/System/PatternSkin/print.css @@ -1 +1 @@ -body{margin:0;padding:0;}#patternScreen, #patternPageShadow, #patternPage, #patternOuter{margin:0;padding:0;top:0;border:none;float:none;}#patternMain{width:100%;float:none;display:inline;overflow:visible;}#patternSideBar{display:none;}#patternWrapper{height:1%;}#patternTopBar, #patternClearHeaderCenter, #patternClearHeaderLeft, #patternClearHeaderRight, #patternTopBarContentsOuter{display:none;}.patternTopicAction, .patternToolBar, .patternToolBarBottom, .patternHomePath img, .patternHomePathTitle, .foswikiActionFormStepSign{display:none;}#patternMainContents{margin:0;padding:1em 2em;}#patternBottomBar{border:none;}.patternTopicFooter{margin:1em 0 0 0;}#attachmentsshow, #attachmentshide{display:none;}pre, html>body pre{overflow:visible !important;}h1, h2, h3, h4, h5, h6{page-break-after:avoid;page-break-inside:avoid;}img{page-break-inside:avoid;page-break-after:avoid;}blockquote, table, pre{page-break-inside:avoid;}ul, ol, dl{page-break-before:avoid;}.commentPlugin{display:none;}.twistyTrigger{display:none;}.editTableEditImageButton{display:none;}html body{background-color:#fff;}h2, h3, h4, h5, h6{background-color:transparent;}#patternBottomBar{background-color:transparent;}pre, code, tt{color:#5b4221;}.foswikiTable th{border-style:solid;border-width:0 0 1px 1px;border-color:#ccc;color:#000;}.foswikiTable th a:link, .foswikiTable th a:visited, .foswikiTable th a font, .foswikiAttachments .foswikiTable th a:link, .foswikiAttachments .foswikiTable th a:visited, .foswikiAttachments .foswikiTable th a font{color:#000;text-decoration:none;}:visited, .foswikiTopic a:visited{color:#06c;background-color:transparent;}.foswikiAttachments, .patternContent .foswikiAttachments, .foswikiForm, .patternContent .foswikiForm{background-color:#fff;}.patternRevInfo, .foswikiGrayText{color:#666;}.patternRevInfo a:link, .patternRevInfo a:visited .foswikiGrayText a:link, .foswikiGrayText a:visited{color:#666;}@media print{body{margin:0;padding:0;}#patternScreen, #patternPageShadow, #patternPage, #patternOuter{margin:0;padding:0;top:0;border:none;float:none;}#patternMain{width:100%;float:none;display:inline;overflow:visible;}#patternSideBar{display:none;}#patternWrapper{height:1%;}#patternTopBar, #patternClearHeaderCenter, #patternClearHeaderLeft, #patternClearHeaderRight, #patternTopBarContentsOuter{display:none;}.patternTopicAction, .patternToolBar, .patternToolBarBottom, .patternHomePath img, .patternHomePathTitle, .foswikiActionFormStepSign{display:none;}#patternMainContents{margin:0;padding:1em 2em;}#patternBottomBar{border:none;}.patternTopicFooter{margin:1em 0 0 0;}#attachmentsshow, #attachmentshide{display:none;}pre, html>body pre{overflow:visible !important;}h1, h2, h3, h4, h5, h6{page-break-after:avoid;page-break-inside:avoid;}img{page-break-inside:avoid;page-break-after:avoid;}blockquote, table, pre{page-break-inside:avoid;}ul, ol, dl{page-break-before:avoid;}.commentPlugin{display:none;}.twistyTrigger{display:none;}.editTableEditImageButton{display:none;}html body{background-color:#fff;}h2, h3, h4, h5, h6{background-color:transparent;}#patternBottomBar{background-color:transparent;}pre, code, tt{color:#5b4221;}.foswikiTable th{border-style:solid;border-width:0 0 1px 1px;border-color:#ccc;color:#000;}.foswikiTable th a:link, .foswikiTable th a:visited, .foswikiTable th a font, .foswikiAttachments .foswikiTable th a:link, .foswikiAttachments .foswikiTable th a:visited, .foswikiAttachments .foswikiTable th a font{color:#000;text-decoration:none;}:visited, .foswikiTopic a:visited{color:#06c;background-color:transparent;}.foswikiAttachments, .patternContent .foswikiAttachments, .foswikiForm, .patternContent .foswikiForm{background-color:#fff;}.patternRevInfo, .foswikiGrayText{color:#666;}.patternRevInfo a:link, .patternRevInfo a:visited .foswikiGrayText a:link, .foswikiGrayText a:visited{color:#666;}} #peopleIcon {display: none;} #tooltip {display: none;} .ecpHeading img {display: none;} .foswikiTopicInfo { border-bottom: 0; } #patternBottomBar, .patternTopicActions, .foswikiFormSteps { display:none; } .foswikiTopicInfo {margin-top: 50px;} .foswikiTopicInfo h1 a {text-decoration:none;} h1 a:visited { color: #D1400E; }html{overflow:visible} +body{margin:0;padding:0}#patternScreen,#patternPageShadow,#patternPage,.patternViewPage #patternOuter{margin:0;padding:0;top:0;border:0;float:none}#patternMain{width:auto;float:none;display:inline;overflow:visible}#patternSideBar{display:none}#patternWrapper{height:1%}#patternTopBarButtons,#patternTopBar,#patternClearHeaderCenter,#patternClearHeaderLeft,#patternClearHeaderRight,#patternTopBarContentsOuter{display:none}.patternTop,.patternTopicAction,.patternTopicActions,.patternToolBar,.patternToolBarBottom,.patternHomePath img,.patternHomePathTitle,.foswikiContentFooter+.foswikiFormSteps,.foswikiActionFormStepSign{display:none}#patternMainContents{margin:0;padding:1em 2em}#patternBottomBar{display:none}.patternTopicFooter{margin:1em 0 0 0}#attachmentsshow,#attachmentshide{display:none}pre,html>body pre{overflow:visible!important}h1,h2,h3,h4,h5,h6{page-break-after:avoid;page-break-inside:avoid}img{page-break-inside:avoid;page-break-after:avoid}blockquote,table,pre{page-break-inside:avoid}ul,ol,dl{page-break-before:avoid}.commentPlugin{display:none}.twistyTrigger{display:none}.editTableEditImageButton{display:none}html body{background-color:#fff}h2,h3,h4,h5,h6{background-color:transparent}#patternBottomBar{background-color:transparent}pre,code,tt{color:#5b4221}.foswikiTable th{border-style:solid;border-width:0 0 1px 1px;border-color:#ccc;color:#000}.foswikiTable th a:link,.foswikiTable th a:visited,.foswikiTable th a font,.foswikiAttachments .foswikiTable th a:link,.foswikiAttachments .foswikiTable th a:visited,.foswikiAttachments .foswikiTable th a font{color:#000;text-decoration:none}:visited,.foswikiTopic a:visited{color:#06c;background-color:transparent}.foswikiAttachments,.patternContent .foswikiAttachments,.foswikiForm,.patternContent .foswikiForm{background-color:#fff}.patternRevInfo,.foswikiGrayText{color:#666}.patternRevInfo a:link,.patternRevInfo a:visited .foswikiGrayText a:link,.foswikiGrayText a:visited{color:#666}@media print{body{margin:0;padding:0}#patternScreen,#patternPageShadow,#patternPage,#patternOuter{margin:0;padding:0;top:0;border:0;float:none}#patternMain{width:100%;float:none;display:inline;overflow:visible}#patternSideBar{display:none}#patternWrapper{height:1%}#patternTopBar,#patternClearHeaderCenter,#patternClearHeaderLeft,#patternClearHeaderRight,#patternTopBarContentsOuter{display:none}.patternTopicAction,.patternToolBar,.patternToolBarBottom,.patternHomePath img,.patternHomePathTitle,.foswikiActionFormStepSign{display:none}#patternMainContents{margin:0;padding:1em 2em}#patternBottomBar{border:0}.patternTopicFooter{margin:1em 0 0 0}#attachmentsshow,#attachmentshide{display:none}pre,html>body pre{overflow:visible!important}h1,h2,h3,h4,h5,h6{page-break-after:avoid;page-break-inside:avoid}img{page-break-inside:avoid;page-break-after:avoid}blockquote,table,pre{page-break-inside:avoid}ul,ol,dl{page-break-before:avoid}.commentPlugin{display:none}.twistyTrigger{display:none}.editTableEditImageButton{display:none}html body{background-color:#fff}h2,h3,h4,h5,h6{background-color:transparent}#patternBottomBar{background-color:transparent}pre,code,tt{color:#5b4221}.foswikiTable th{border-style:solid;border-width:0 0 1px 1px;border-color:#ccc;color:#000}.foswikiTable th a:link,.foswikiTable th a:visited,.foswikiTable th a font,.foswikiAttachments .foswikiTable th a:link,.foswikiAttachments .foswikiTable th a:visited,.foswikiAttachments .foswikiTable th a font{color:#000;text-decoration:none}:visited,.foswikiTopic a:visited{color:#06c;background-color:transparent}.foswikiAttachments,.patternContent .foswikiAttachments,.foswikiForm,.patternContent .foswikiForm{background-color:#fff}.patternRevInfo,.foswikiGrayText{color:#666}.patternRevInfo a:link,.patternRevInfo a:visited .foswikiGrayText a:link,.foswikiGrayText a:visited{color:#666}html,body{height:auto}#patternFloatWrap{float:none}} \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkinTheme2009/colors.css b/doc/html/user/pub/System/PatternSkinTheme2009/colors.css index 1ff74d91..c14ef204 100644 --- a/doc/html/user/pub/System/PatternSkinTheme2009/colors.css +++ b/doc/html/user/pub/System/PatternSkinTheme2009/colors.css @@ -1,794 +1 @@ -/* PatternSkin colors */ -/* Generated by AttachContentPlugin from System.PatternSkinColorSettings */ - -/* LAYOUT ELEMENTS */ - -#patternScreen { - background:#e2e2e2; -} -#patternPage { - border-color:#ccc; -} -#patternTopBar { - border-color:#e2e2e2; - /* color is defined as WEBHEADERBGCOLOR in System/DefaultPreferences */ -} -#patternMain { /* don't set a background here; use patternOuter */ } -#patternOuter { - background:none; - border-color:#dadada; -} -#patternSideBar, -#patternWrapper { - background:#fff; -} -#patternBottomBar { - border-color:#ccc; - background-color:#f5f5f5; -} -#patternBottomBarContents, -#patternBottomBarContents a:link, -#patternBottomBarContents a:visited { - color:#777; -} -#patternBottomBarContents a:hover { - color:#fff; -} - -/* GENERAL HTML ELEMENTS */ - -html body { - background-color:#f5f5f5; - color:#000; -} -html body.patternEditPage, -.mceContentBody { - background-color:#fff; -} - -/* be kind to netscape 4 that doesn't understand inheritance */ -body, p, li, ul, ol, dl, dt, dd, acronym, h1, h2, h3, h4, h5, h6 { - background-color:transparent; -} -hr { - color:#e2e2e2; - background-color:#e2e2e2; -} -pre, code, tt { - color:#333; -} -pre { - background:#f5f5f5; - border-color:#ddd; -} -blockquote { - background-color:#f5f5f5; - border-color:#ddd; -} -blockquote h2 { - background:none; -} -h1 { - color:#2989bb; -} -h2, h3, h4, h5, h6 { - color:#d1400e; -} -h2 { - border-color:#e2e2e2; -} -h3, h4, h5, h6 { - border-color:#e2e2e2; -} - -/* to override old Render.pm coded font color style */ -.foswikiNewLink font { - color:inherit; -} -.foswikiNewLink a:link sup, -.foswikiNewLink a:visited sup { - color:#777; - border-color:#ddd; -} -.foswikiNewLink a:hover sup { - background-color:#0055b5; - color:#fff; - border-color:#0055b5; -} -.foswikiNewLink { - border-color:#ddd; -} -:link:focus, -:visited:focus, -:link, -:visited, -:link:active, -:visited:active { - color:#4571d0; - background-color:transparent; -} -:link:hover, -:visited:hover { - color:#fff; - background-color:#0055b5; - background-image:none; -} -:link:hover img, -:visited:hover img { - background-color:transparent; -} -.foswikiTopic a:visited { - color:#666; -} -.foswikiTopic a:hover { - color:#fff; -} -.foswikiTopic .foswikiUnvisited a:visited { - color:#4571d0; -} -.foswikiTopic .foswikiUnvisited a:hover { - color:#fff; -} - -/* Form elements */ - -textarea, -input, -select { - border-color:#aaa; - color:#000; - background-color:#fff; -} -.foswikiSubmit, -.foswikiButton { - border-color:#fff #888 #888 #fff; -} -.foswikiSubmit { - color:#fff; - background-color:#06c; -} -.foswikiButton { - color:#000; - background-color:#e2e3e3; -} -.foswikiButtonCancel { - color:#000; - background-color:#f2d5d0; -} -.foswikiSubmitDisabled, -.foswikiSubmitDisabled:active { - border-color:#fff #ccc #ccc #fff; - color:#aaa; - background-color:#eef7fa; -} -.foswikiTextarea, -.foswikiInputField, -.foswikiInputFieldDisabled, -.foswikiInputFieldReadOnly, -.foswikiSelect { - border-color:#bbb #f2f2f2 #f2f2f2 #bbb; -} -.foswikiTextarea, -.foswikiInputField, -.foswikiSelect { - color:#000; - background-color:#fff; -} -.foswikiInputField:active, -.foswikiInputField:focus, -.foswikiInputFieldFocus { - background-color:#ffffe0; -} - -.foswikiTextareaRawView { - color:#000; -} -.foswikiInputFieldDisabled { - color:#aaa; - background-color:#fafaf8; -} -.foswikiInputFieldReadOnly { - color:#777; -} -.foswikiSelect { - border-color:#bbb #f2f2f2 #f2f2f2 #bbb; - color:#000; - background-color:#fff; -} -.foswikiInputFieldDisabled, -.foswikiSelectDisabled { - color:#aaa; - border-color:#bbb #f2f2f2 #f2f2f2 #bbb; - background-color:#fafaf8; -} -.foswikiInputFieldBeforeFocus { - color:#777; -} - -/* ----------------------------------------------------------- - Plugin elements - ----------------------------------------------------------- */ - -/* TablePlugin */ -.foswikiTable, -.foswikiTable td, -.foswikiTable th { - border-color:#eee; -} -.foswikiTable th { - background:#d6d3cf; -} -.foswikiTable th, -.foswikiTable th a:link, -.foswikiTable th a:visited { - color:#000; -} - -/* TwistyContrib */ -.twistyPlaceholder { - color:#777; -} -a:hover.twistyTrigger { - color:#fff; -} - -/* TipsContrib */ -.tipsOfTheDay { -} - -/* RevCommentPlugin */ -.revComment .patternTopicActions { - background-color:#eef7fa; -} - -/* ----------------------------------------------------------- - Foswiki styles - ----------------------------------------------------------- */ - -.foswikiGrayText { - color:#777; -} -.foswikiGrayText a:link, -.foswikiGrayText a:visited { - color:#777; -} -.foswikiGrayText a:hover { - color:#fff; -} - -table.foswikiFormTable th.foswikiFormTableHRow, -table.foswikiFormTable td.foswikiFormTableRow { - color:#777; -} -.foswikiEditForm { - color:#000; -} -.foswikiEditForm .foswikiFormTable, -.foswikiEditForm .foswikiFormTable th, -.foswikiEditForm .foswikiFormTable td { - border-color:#e2e2e2; -} -/* use a different table background color mix: no odd/even rows, no white background */ -.foswikiEditForm .foswikiFormTable td { - background-color:#f7fafc; -} -.foswikiEditForm .foswikiFormTable th { - background-color:#f0f6fb; -} -.patternTwistyButton h3 { - color:#d1400e; -} -.foswikiAttachments table, -table.foswikiFormTable { - border-color:#e2e2e2; - background-color:#fff; -} -.foswikiAttachments table { - background-color:#fff; -} -.foswikiForm td, -.foswikiForm th, -.foswikiAttachments td, -.foswikiAttachments th { - border-color:#e2e2e2; -} -.foswikiAttachments .foswikiTable th font, -table.foswikiFormTable th.foswikiFormTableHRow font { - color:#4571d0; -} - -.foswikiFormSteps { - background-color:#eef7fa; - border-color:#e2e2e2; -} -.foswikiFormStep { - border-color:#e2e2e2; -} -.foswikiFormStep h2 { - color:#2989bb; -} -.foswikiFormStep h3, -.foswikiFormStep h4 { - color:#d1400e; -} -.foswikiFormStep h3, -.foswikiFormStep h4 { - background-color:transparent; -} -.foswikiFormStep .foswikiHelp { - background:#fff; -} -.foswikiToc .foswikiTocTitle { - color:#777; -} -.foswikiBroadcastMessage, -.foswikiNotification { - background-color:#ffe67b; -} -.foswikiNotification { - border:2px solid #ffdf4c; -} -.foswikiMessage { - background-color:#ffe67b; -} -#foswikiLogin .patternLoginNotification { - background-color:#fff; - border-color:#f00; -} -.foswikiHelp { - background-color:#edf5fa; - border-color:#e2e2e2; -} -.foswikiBroadcastMessage b, -.foswikiBroadcastMessage strong { - color:#f00; -} -.foswikiAlert, -.foswikiAlert code { - color:#f00; -} -.foswikiEmulatedLink { - color:#4571d0; -} -.foswikiPageForm table { - border-color:#e2e2e2; - background:#fff; -} -.foswikiPageForm hr { - border-color:#cfcfcf; - background-color:#cfcfcf; - color:#cfcfcf; -} -.foswikiAccessKey { - color:inherit; - border-color:#777; -} -a:link .foswikiAccessKey, -a:visited .foswikiAccessKey { - color:inherit; -} -a:hover .foswikiAccessKey { - color:inherit; -} -.foswikiImage img { - border-color:#eee; - background-color:#fff; -} -#patternTopBar .foswikiImage img { - background-color:transparent; -} -.foswikiImage a:hover img { - border-color:#0055b5; -} - -/* ----------------------------------------------------------- - Pattern skin specific elements - ----------------------------------------------------------- */ -#patternPage { - background-color:#fff; -} -.patternHomePathTitle, -.patternRevInfo, -.patternHomePath a:link, -.patternHomePath a:visited { - border-color:#ddd; - color:#666; -} -.patternTop a:hover { - border:none; - color:#fff; -} -.patternHomePath .patternRevInfo, -.patternHomePath .patternRevInfo a:link, -.patternHomePath .patternRevInfo a:visited { - color:#777; -} -.patternHomePath .patternRevInfo a:hover { - color:#fff; -} - -/* Left bar */ -#patternSideBarContents { - color:#000; -} -#patternSideBarContents hr { - color:#e2e2e2; - background-color:#e2e2e2; -} -#patternSideBarContents a:link, -#patternSideBarContents a:visited { - color:#444; -} -#patternSideBarContents a:hover { - color:#fff; -} -#patternSideBarContents .patternLeftBarPersonal, -#patternSideBarContents .patternWebIndicator { - border-color:#dadada; -} -#patternSideBarContents b, -#patternSideBarContents strong { - color:#d1400e; -} - -.patternTopicActions { - background-color:#2989bb; - color:#bbb; -} -.patternTopicActions s, -.patternTopicActions strike { - color:#aaa; -} -.patternTopicActions .foswikiSeparator { - color:#e2e2e2; -} -.patternActionButtons a:link, -.patternActionButtons a:visited { - color:#fff; -} -.patternActionButtons a:hover { - color:#fff; -} -.patternTopicActions a:link .foswikiAccessKey, -.patternTopicActions a:visited .foswikiAccessKey { - color:#fff; - border-color:#fff; -} -.patternTopicActions a:hover .foswikiAccessKey { - color:#fff; -} -.patternTopicActions label { - color:#000; -} -.patternHelpCol { - color:#777; -} -.patternSigLine { - color:#777; -} -.patternEditTopic { - background:#eef7fa; -} -.patternToolBar a:link .foswikiAccessKey, -.patternToolBar a:visited .foswikiAccessKey { - color:inherit; - border-color:#666; -} -.patternToolBar a:hover .foswikiAccessKey { - background-color:transparent; - color:inherit; - border-color:#666; -} - -/* WebSearch, WebSearchAdvanced */ -table#foswikiSearchTable { - border-color:#e2e2e2; -} -table#foswikiSearchTable th, -table#foswikiSearchTable td { - background-color:#fff; - border-color:#e2e2e2; -} -table#foswikiSearchTable hr { - border-color:#e2e2e2; - background-color:#e2e2e2; -} -table#foswikiSearchTable th { - color:#000; -} - -/* ----------------------------------------------------------- - Search results - styles and overridden styles used in search.pattern.tmpl - ----------------------------------------------------------- */ - -.foswikiSearchResult .foswikiAlert { - color:#f00; -} -.foswikiSearchResult .foswikiSummary .foswikiAlert { - color:#900; -} -.foswikiSearchResult .foswikiBottomRow, -.foswikiSearchResult .foswikiBottomRow a:link, -.foswikiSearchResult .foswikiBottomRow a:visited { - color:#049804; -} -.foswikiSearchResult .foswikiBottomRow:hover a:link, -.foswikiSearchResult .foswikiBottomRow:hover a:visited { - color:#06c; -} -.foswikiSearchResult .foswikiBottomRow:hover a:hover { - color:#fff; -} -.patternViewPage .patternSearchResultsBegin { - border-color:#eee; -} - -/* Search results in book view format */ - -.patternBookView .foswikiTopRow { - background-color:transparent; /* set to WEBBGCOLOR in css.pattern.tmpl */ - color:#777; -} -.patternBookView .foswikiBottomRow { - border-color:#e2e2e2; -} -.patternBookView .patternSearchResultCount { - color:#777; -} - -/* preview.pattern.tmpl */ - -.foswikiPreviewArea { - border-color:#f00; - background-color:#fff; -} - -/* rdiff.pattern.tmpl */ - -.patternDiff { - border-color:#6b7f93; -} -#patternMainContents .patternDiff h4.patternSearchResultsHeader { - background-color:#6b7f93; - color:#fff; -} -#patternMainContents .patternDiff h4.patternSearchResultsHeader a:link, -#patternMainContents .patternDiff h4.patternSearchResultsHeader a:visited { - color:#fff; -} -tr.foswikiDiffDebug td { - border-color:#e2e2e2; -} -.patternDiffPage .foswikiDiffTable th { - background-color:#ccc; -} -/* Changed */ -.foswikiDiffChangedHeader, -tr.foswikiDiffDebug .foswikiDiffChangedText, -tr.foswikiDiffDebug .foswikiDiffChangedText { - background:#9f9; /* green - do not change */ -} -/* Deleted */ -tr.foswikiDiffDebug .foswikiDiffDeletedMarker, -tr.foswikiDiffDebug .foswikiDiffDeletedText { - background-color:#f99; /* red - do not change */ -} -/* Added */ -.foswikiDiffAddedHeader, -tr.foswikiDiffDebug .foswikiDiffAddedMarker, -tr.foswikiDiffDebug .foswikiDiffAddedText { - background-color:#ccf; /* violet - do not change */ -} -/* Unchanged */ -tr.foswikiDiffDebug .foswikiDiffUnchangedText { - color:#777; -} -.foswikiDiffUnchangedTextContents { } -.foswikiDiffLineNumberHeader { - background-color:#ccc; -} - - -/* IMAGES */ -/* image positions are set here as well as these are dependent on the image */ - -#patternTopBar { - /* image is defined as WEBHEADERART in System/DefaultPreferences */ -} -.foswikiToc li { - background-image:url(bullet-toc.gif); - background-repeat:no-repeat; - background-position:0 .4em; -} -.patternPrintPage #patternOuter { - background:#fff; /* white - do not change */ -} -.foswikiSubmit, -.foswikiSubmitDisabled { - background-image:url(bg_submit_gradient.gif); - background-repeat:repeat-x; -} -.foswikiSubmit, -a.foswikiSubmit:link, -a.foswikiSubmit:visited { - background-position:0px 0px; - background-color:#06c; - border-color:#94cce2 #0e66a2 #0e66a2 #94cce2; - color:#fff; -} -.foswikiSubmit:hover, -a.foswikiSubmit:hover { - background-position:0px -80px; - background-color:#0047b7; - border-color:#0e66a2 #94cce2 #94cce2 #0e66a2; - color:#fff; -} -.foswikiSubmit:active, -a.foswikiSubmit:active { - background-position:0px -160px; - background-color:#73ace6; - border-color:#0e66a2 #94cce2 #94cce2 #0e66a2; - color:#fff; -} -.foswikiSubmitDisabled, -.foswikiSubmitDisabled:hover, -.foswikiSubmitDisabled:active { - background-position:0px -240px; - background-color:#d9e8f7; - border-color:#ccc #ccc #ccc #ccc; - color:#ccc; -} -.foswikiButton, -a.foswikiButton:link, -a.foswikiButton:visited { - background-image:url(bg_button_gradient.gif); - background-repeat:repeat-x; - background-position:0px 0px; - border-color:#fff #94cce2 #94cce2 #fff; - background-color:#cce7f1; - color:#333; -} -.foswikiButton:hover, -.foswikiButton:active, -a.foswikiButton:hover, -a.foswikiButton:active { - background-position:0px -160px; - border-color:#94cce2 #94cce2 #94cce2 #94cce2; - background-color:#cce7f1; - color:#333; -} -.foswikiButtonDisabled, -.foswikiButtonDisabled:hover, -.foswikiButtonDisabled:active { - background-image:url(bg_button_gradient.gif); - background-repeat:repeat-x; - background-position:0px -240px; - border-color:#ccc #ccc #ccc #ccc; - background-color:#edece6; - color:#bbb; -} -.foswikiButtonCancel { - background-image:url(bg_buttoncancel_gradient.gif); - background-repeat:repeat-x; - background-position:0px 0px; - border-color:#f3ddd7 #ce5232 #ce5232 #f3ddd7; - background-color:#dd724d; - color:#fff; -} -.foswikiButtonCancel:hover { - background-position:0px -80px; - border-color:#ce5232 #f3ddd7 #f3ddd7 #ce5232; - background-color:#dd724d; - color:#fff; -} -.foswikiButtonCancel:active { - background-position:0px -160px; - border-color:#ce5232 #f3ddd7 #f3ddd7 #ce5232; - background-color:#dd724d; - color:#fff; -} -.patternToolBar span a:link, -.patternToolBar span a:visited, -.patternToolBar span s, -.patternToolBar span strike { - background-image:url(bg_button_gradient.gif); - background-repeat:repeat-x; -} -.patternToolBar span a:link, -.patternToolBar span a:visited { - background-position:0px 0px; - border-color:#fff #94cce2 #94cce2 #fff; - background-color:#cce7f1; - color:#333; -} -.patternToolBar span a:hover { - background-position:0px -80px; - border-color:#94cce2 #94cce2 #94cce2 #94cce2; - background-color:#cce7f1; - color:#222; -} -.patternToolBar span a:active { - background-position:0px -160px; - border-color:#94cce2 #94cce2 #94cce2 #94cce2; - background-color:#e8e5d7; - color:#222; -} -.patternToolBar span s, -.patternToolBar span strike { - background-position:0px -240px; - border-color:#eae9e7 #eae9e7 #eae9e7 #eae9e7; - background-color:#edece6; - color:#bbb; -} -.patternTextareaButton { - border-color:#fffefd #b8b6ad #b8b6ad #fffefd; - overflow:hidden; -} -.patternButtonFontSelector { - background-image:url(button_font_selector.gif); - width:33px; - height:16px; -} -.patternButtonFontSelectorProportional { - background-position:0 0; -} -.patternButtonFontSelectorMonospace { - background-position:0 -16px; -} -.patternButtonEnlarge, -.patternButtonShrink { - background-image:url(button_arrow.gif); - width:16px; - height:16px; -} -.patternButtonEnlarge { - background-position:0 0; -} -.patternButtonEnlarge:hover { - background-position:0 -42px; -} -.patternButtonEnlarge:active { - background-position:0 -84px; -} -.patternButtonShrink { - background-position:16px 0; -} -.patternButtonShrink:hover { - background-position:16px -42px; -} -.patternButtonShrink:active { - background-position:16px -84px; -} -.foswikiBroadcastMessage { - background-image:url(background_alert.gif); - background-repeat:repeat-x; -} - -/* common settings */ -.patternLeftBarPersonal li, -li.patternLogOut, -li.patternLogIn { - padding-left:13px; - background-position:0 .4em; - background-repeat:no-repeat; -} -.patternLeftBarPersonal li { - background-image:url(bullet-personal_sidebar.gif); -} -.patternLeftBarPersonal li.patternLogOut { - background-image:url(bullet-lock.gif); -} -.patternLeftBarPersonal li.patternLogIn { - background-image:url(bullet-lock.gif); -} - -.foswikiJs a.jqPopUpWindow:link, -.foswikiJs a.jqPopUpWindow:visited, -.foswikiJs a.jqPopUpWindow:hover { - background-image:url(popup.gif); - background-repeat:no-repeat; - background-position:right; - padding-right:14px; - margin-right:3px; -} +#patternScreen{background:#e2e2e2}#patternPage{border-color:#ccc}#patternTopBar{border-color:#e2e2e2}#patternOuter{background:0;border-color:#dadada}#patternSideBar,#patternWrapper{background:#fff}#patternBottomBar{border-color:#ccc;background-color:#f5f5f5}#patternBottomBarContents,#patternBottomBarContents a:link,#patternBottomBarContents a:visited{color:#777}#patternBottomBarContents a:hover{color:#fff}html body{background-color:#f5f5f5;color:#000}html body.patternEditPage,.mceContentBody{background-color:#fff}body,p,li,ul,ol,dl,dt,dd,acronym,h1,h2,h3,h4,h5,h6{background-color:transparent}hr{color:#e2e2e2;background-color:#e2e2e2}pre,code,tt{color:#333}pre{background:#f5f5f5;border-color:#ddd}blockquote{background-color:#f5f5f5;border-color:#ddd}blockquote h2{background:0}h1{color:#2989bb}h2,h3,h4,h5,h6{color:#d1400e}h2{border-color:#e2e2e2}h3,h4,h5,h6{border-color:#e2e2e2}.foswikiNewLink font{color:inherit}.foswikiNewLink a:link sup,.foswikiNewLink a:visited sup{color:#777;border-color:#ddd}.foswikiNewLink a:hover sup{background-color:#0055b5;color:#fff;border-color:#0055b5}.foswikiNewLink{border-color:#ddd}:link:focus,:visited:focus,:link,:visited,:link:active,:visited:active{color:#4571d0;background-color:transparent}:link:hover,:visited:hover{color:#fff;background-color:#0055b5;background-image:none}:link:hover img,:visited:hover img{background-color:transparent}.foswikiTopic a:visited{color:#666}.foswikiTopic a:hover{color:#fff}.foswikiTopic .foswikiUnvisited a:visited{color:#4571d0}.foswikiTopic .foswikiUnvisited a:hover{color:#fff}textarea,input,select{border-color:#aaa;color:#000;background-color:#fff}.foswikiSubmit,.foswikiButton{border-color:#fff #888 #888 #fff}.foswikiSubmit{color:#fff;background-color:#06c}.foswikiButton{color:#000;background-color:#e2e3e3}.foswikiButtonCancel{color:#000;background-color:#f2d5d0}.foswikiSubmitDisabled,.foswikiSubmitDisabled:active{border-color:#fff #ccc #ccc #fff;color:#aaa;background-color:#eef7fa}.foswikiTextarea,.foswikiInputField,.foswikiInputFieldDisabled,.foswikiInputFieldReadOnly,.foswikiSelect{border-color:#bbb #f2f2f2 #f2f2f2 #bbb}.foswikiTextarea,.foswikiInputField,.foswikiSelect{color:#000;background-color:#fff}.foswikiInputField:active,.foswikiInputField:focus,.foswikiInputFieldFocus{background-color:#ffffe0}.foswikiTextareaRawView{color:#000}.foswikiInputFieldDisabled{color:#aaa;background-color:#fafaf8}.foswikiInputFieldReadOnly{color:#777}.foswikiSelect{border-color:#bbb #f2f2f2 #f2f2f2 #bbb;color:#000;background-color:#fff}.foswikiInputFieldDisabled,.foswikiSelectDisabled{color:#aaa;border-color:#bbb #f2f2f2 #f2f2f2 #bbb;background-color:#fafaf8}.foswikiInputFieldBeforeFocus{color:#777}.foswikiTable,.foswikiTable td,.foswikiTable th{border-color:#eee}.foswikiTable th{background:#d6d3cf}.foswikiTable th,.foswikiTable th a:link,.foswikiTable th a:visited{color:#000}.twistyPlaceholder{color:#777}a:hover.twistyTrigger{color:#fff}.revComment .patternTopicActions{background-color:#eef7fa}.foswikiGrayText{color:#777}.foswikiGrayText a:link,.foswikiGrayText a:visited{color:#777}.foswikiGrayText a:hover{color:#fff}table.foswikiFormTable th.foswikiFormTableHRow,table.foswikiFormTable td.foswikiFormTableRow{color:#777}.foswikiEditForm{color:#000}.foswikiEditForm .foswikiFormTable,.foswikiEditForm .foswikiFormTable th,.foswikiEditForm .foswikiFormTable td{border-color:#e2e2e2}.foswikiEditForm .foswikiFormTable td{background-color:#f7fafc}.foswikiEditForm .foswikiFormTable th{background-color:#f0f6fb}.patternTwistyButton h3{color:#d1400e}.foswikiAttachments table,table.foswikiFormTable{border-color:#e2e2e2;background-color:#fff}.foswikiAttachments table{background-color:#fff}.foswikiForm td,.foswikiForm th,.foswikiAttachments td,.foswikiAttachments th{border-color:#e2e2e2}.foswikiAttachments .foswikiTable th font,table.foswikiFormTable th.foswikiFormTableHRow font{color:#4571d0}.foswikiFormSteps{background-color:#eef7fa;border-color:#e2e2e2}.foswikiFormStep{border-color:#e2e2e2}.foswikiFormStep h2{color:#2989bb}.foswikiFormStep h3,.foswikiFormStep h4{color:#d1400e}.foswikiFormStep h3,.foswikiFormStep h4{background-color:transparent}.foswikiFormStep .foswikiHelp{background:#fff}.foswikiToc .foswikiTocTitle{color:#777}.foswikiBroadcastMessage,.foswikiNotification{background-color:#ffe67b}.foswikiNotification{border:2px solid #ffdf4c}.foswikiMessage{background-color:#ffe67b}#foswikiLogin .patternLoginNotification{background-color:#fff;border-color:#f00}.foswikiHelp{background-color:#edf5fa;border-color:#e2e2e2}.foswikiBroadcastMessage b,.foswikiBroadcastMessage strong{color:#f00}.foswikiAlert,.foswikiAlert code{color:#f00}.foswikiEmulatedLink{color:#4571d0}.foswikiPageForm table{border-color:#e2e2e2;background:#fff}.foswikiPageForm hr{border-color:#cfcfcf;background-color:#cfcfcf;color:#cfcfcf}.foswikiAccessKey{color:inherit;border-color:#777}a:link .foswikiAccessKey,a:visited .foswikiAccessKey{color:inherit}a:hover .foswikiAccessKey{color:inherit}.foswikiImage img{border-color:#eee;background-color:#fff}#patternTopBar .foswikiImage img{background-color:transparent}.foswikiImage a:hover img{border-color:#0055b5}#patternPage{background-color:#fff}.patternHomePathTitle,.patternRevInfo,.patternHomePath a:link,.patternHomePath a:visited{border-color:#ddd;color:#666}.patternTop a:hover{border:0;color:#fff}.patternHomePath .patternRevInfo,.patternHomePath .patternRevInfo a:link,.patternHomePath .patternRevInfo a:visited{color:#777}.patternHomePath .patternRevInfo a:hover{color:#fff}#patternSideBarContents{color:#000}#patternSideBarContents hr{color:#e2e2e2;background-color:#e2e2e2}#patternSideBarContents a:link,#patternSideBarContents a:visited{color:#444}#patternSideBarContents a:hover{color:#fff}#patternSideBarContents .patternLeftBarPersonal,#patternSideBarContents .patternWebIndicator{border-color:#dadada}#patternSideBarContents b,#patternSideBarContents strong{color:#d1400e}.patternTopicActions{background-color:#2989bb;color:#bbb}.patternTopicActions s,.patternTopicActions strike{color:#aaa}.patternTopicActions .foswikiSeparator{color:#e2e2e2}.patternActionButtons a:link,.patternActionButtons a:visited{color:#fff}.patternActionButtons a:hover{color:#fff}.patternTopicActions a:link .foswikiAccessKey,.patternTopicActions a:visited .foswikiAccessKey{color:#fff;border-color:#fff}.patternTopicActions a:hover .foswikiAccessKey{color:#fff}.patternTopicActions label{color:#000}.patternHelpCol{color:#777}.patternSigLine{color:#777}.patternEditTopic{background:#eef7fa}.patternToolBar a:link .foswikiAccessKey,.patternToolBar a:visited .foswikiAccessKey{color:inherit;border-color:#666}.patternToolBar a:hover .foswikiAccessKey{background-color:transparent;color:inherit;border-color:#666}table#foswikiSearchTable{border-color:#e2e2e2}table#foswikiSearchTable th,table#foswikiSearchTable td{background-color:#fff;border-color:#e2e2e2}table#foswikiSearchTable hr{border-color:#e2e2e2;background-color:#e2e2e2}table#foswikiSearchTable th{color:#000}.foswikiSearchResult .foswikiAlert{color:#f00}.foswikiSearchResult .foswikiSummary .foswikiAlert{color:#900}.foswikiSearchResult .foswikiBottomRow,.foswikiSearchResult .foswikiBottomRow a:link,.foswikiSearchResult .foswikiBottomRow a:visited{color:#049804}.foswikiSearchResult .foswikiBottomRow:hover a:link,.foswikiSearchResult .foswikiBottomRow:hover a:visited{color:#06c}.foswikiSearchResult .foswikiBottomRow:hover a:hover{color:#fff}.patternViewPage .patternSearchResultsBegin{border-color:#eee}.patternBookView .foswikiTopRow{background-color:transparent;color:#777}.patternBookView .foswikiBottomRow{border-color:#e2e2e2}.patternBookView .patternSearchResultCount{color:#777}.foswikiPreviewArea{border-color:#f00;background-color:#fff}.patternDiff{border-color:#6b7f93}#patternMainContents .patternDiff h4.patternSearchResultsHeader{background-color:#6b7f93;color:#fff}#patternMainContents .patternDiff h4.patternSearchResultsHeader a:link,#patternMainContents .patternDiff h4.patternSearchResultsHeader a:visited{color:#fff}tr.foswikiDiffDebug td{border-color:#e2e2e2}.patternDiffPage .foswikiDiffTable th{background-color:#ccc}.foswikiDiffChangedHeader,tr.foswikiDiffDebug .foswikiDiffChangedText,tr.foswikiDiffDebug .foswikiDiffChangedText{background:#9f9}tr.foswikiDiffDebug .foswikiDiffDeletedMarker,tr.foswikiDiffDebug .foswikiDiffDeletedText{background-color:#f99}.foswikiDiffAddedHeader,tr.foswikiDiffDebug .foswikiDiffAddedMarker,tr.foswikiDiffDebug .foswikiDiffAddedText{background-color:#ccf}tr.foswikiDiffDebug .foswikiDiffUnchangedText{color:#777}.foswikiDiffLineNumberHeader{background-color:#ccc}.foswikiToc li{background-image:url(bullet-toc.gif);background-repeat:no-repeat;background-position:0 .4em}.patternPrintPage #patternOuter{background:#fff}.foswikiSubmit,.foswikiSubmitDisabled{background-image:url(bg_submit_gradient.gif);background-repeat:repeat-x}.foswikiSubmit,a.foswikiSubmit:link,a.foswikiSubmit:visited{background-position:0 0;background-color:#06c;border-color:#94cce2 #0e66a2 #0e66a2 #94cce2;color:#fff}.foswikiSubmit:hover,a.foswikiSubmit:hover{background-position:0 -80px;background-color:#0047b7;border-color:#0e66a2 #94cce2 #94cce2 #0e66a2;color:#fff}.foswikiSubmit:active,a.foswikiSubmit:active{background-position:0 -160px;background-color:#73ace6;border-color:#0e66a2 #94cce2 #94cce2 #0e66a2;color:#fff}.foswikiSubmitDisabled,.foswikiSubmitDisabled:hover,.foswikiSubmitDisabled:active{background-position:0 -240px;background-color:#d9e8f7;border-color:#ccc #ccc #ccc #ccc;color:#ccc}.foswikiButton,a.foswikiButton:link,a.foswikiButton:visited{background-image:url(bg_button_gradient.gif);background-repeat:repeat-x;background-position:0 0;border-color:#fff #94cce2 #94cce2 #fff;background-color:#cce7f1;color:#333}.foswikiButton:hover,.foswikiButton:active,a.foswikiButton:hover,a.foswikiButton:active{background-position:0 -160px;border-color:#94cce2 #94cce2 #94cce2 #94cce2;background-color:#cce7f1;color:#333}.foswikiButtonDisabled,.foswikiButtonDisabled:hover,.foswikiButtonDisabled:active{background-image:url(bg_button_gradient.gif);background-repeat:repeat-x;background-position:0 -240px;border-color:#ccc #ccc #ccc #ccc;background-color:#edece6;color:#bbb}.foswikiButtonCancel{background-image:url(bg_buttoncancel_gradient.gif);background-repeat:repeat-x;background-position:0 0;border-color:#f3ddd7 #ce5232 #ce5232 #f3ddd7;background-color:#dd724d;color:#fff}.foswikiButtonCancel:hover{background-position:0 -80px;border-color:#ce5232 #f3ddd7 #f3ddd7 #ce5232;background-color:#dd724d;color:#fff}.foswikiButtonCancel:active{background-position:0 -160px;border-color:#ce5232 #f3ddd7 #f3ddd7 #ce5232;background-color:#dd724d;color:#fff}.patternToolBar span a:link,.patternToolBar span a:visited,.patternToolBar span s,.patternToolBar span strike{background-image:url(bg_button_gradient.gif);background-repeat:repeat-x}.patternToolBar span a:link,.patternToolBar span a:visited{background-position:0 0;border-color:#fff #94cce2 #94cce2 #fff;background-color:#cce7f1;color:#333}.patternToolBar span a:hover{background-position:0 -80px;border-color:#94cce2 #94cce2 #94cce2 #94cce2;background-color:#cce7f1;color:#222}.patternToolBar span a:active{background-position:0 -160px;border-color:#94cce2 #94cce2 #94cce2 #94cce2;background-color:#e8e5d7;color:#222}.patternToolBar span s,.patternToolBar span strike{background-position:0 -240px;border-color:#eae9e7 #eae9e7 #eae9e7 #eae9e7;background-color:#edece6;color:#bbb}.patternTextareaButton{border-color:#fffefd #b8b6ad #b8b6ad #fffefd;overflow:hidden}.patternButtonFontSelector{background-image:url(button_font_selector.gif);width:33px;height:16px}.patternButtonFontSelectorProportional{background-position:0 0}.patternButtonFontSelectorMonospace{background-position:0 -16px}.patternButtonEnlarge,.patternButtonShrink{background-image:url(button_arrow.gif);width:16px;height:16px}.patternButtonEnlarge{background-position:0 0}.patternButtonEnlarge:hover{background-position:0 -42px}.patternButtonEnlarge:active{background-position:0 -84px}.patternButtonShrink{background-position:16px 0}.patternButtonShrink:hover{background-position:16px -42px}.patternButtonShrink:active{background-position:16px -84px}.foswikiBroadcastMessage{background-image:url(background_alert.gif);background-repeat:repeat-x}.patternLeftBarPersonal li,li.patternLogOut,li.patternLogIn{padding-left:13px;background-position:0 .4em;background-repeat:no-repeat}.patternLeftBarPersonal li{background-image:url(bullet-personal_sidebar.gif)}.patternLeftBarPersonal li.patternLogOut{background-image:url(bullet-lock.gif)}.patternLeftBarPersonal li.patternLogIn{background-image:url(bullet-lock.gif)}.foswikiJs a.jqPopUpWindow:link,.foswikiJs a.jqPopUpWindow:visited,.foswikiJs a.jqPopUpWindow:hover{background-image:url(popup.gif);background-repeat:no-repeat;background-position:right;padding-right:14px;margin-right:3px} \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkinTheme2009/column_left.css b/doc/html/user/pub/System/PatternSkinTheme2009/column_left.css index c6d6ae50..b47ad089 100644 --- a/doc/html/user/pub/System/PatternSkinTheme2009/column_left.css +++ b/doc/html/user/pub/System/PatternSkinTheme2009/column_left.css @@ -1,12 +1 @@ -/* -places the side bar at the left -depends on global settings in layout.css -*/ - -#patternOuter { - margin-left:16em; -} -#patternSideBar { - width:16em; - margin-left:-16em; -} +#patternOuter{margin-left:16em}#patternSideBar{width:16em;margin-left:-16em} \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkinTheme2009/style.css b/doc/html/user/pub/System/PatternSkinTheme2009/style.css index df75ca68..0792bcda 100644 --- a/doc/html/user/pub/System/PatternSkinTheme2009/style.css +++ b/doc/html/user/pub/System/PatternSkinTheme2009/style.css @@ -1,1096 +1 @@ -/* ----------------------------------------------------------- - STYLE - Appearance: margins, padding, fonts, borders - ----------------------------------------------------------- */ - - -/* ---------------------------------------------------------------------------- - CONSTANTS - - Sizes - ---------------------------------------- - S1 line-height 1.5em - S2 somewhat smaller font size font-size:94% - S3 small font size, foswikiSmall font-size:86%; line-height:110%; - S4 horizontal bar padding (h2, patternTop) 5px - S5 form and attachment padding 20px - S6 left margin left bar 1em - - ------------------------------------------------------------------------- */ - -/* GENERAL HTML ELEMENTS */ - -html body { - font-family:arial, verdana, sans-serif; - font-size:104%; - voice-family:"\"}\""; - voice-family:inherit; - font-size:small; -} -html>body { /* Mozilla */ - font-size:small; -} -body { - line-height:1.5em; /*S1*/ - /* change font size here */ - font-size:103%; -} -body font { - line-height:135%; -} -th { - line-height:1.15em; -} -label { - padding:.15em .3em .15em 0; /* same vertical padding as foswikiInputField */ -} -hr { - height:1px; - border:none; -} -/* put overflow pre in a scroll area */ -pre { - width:auto; - margin:1em 0; /* Win IE tries to make this bigger otherwise */ - border-style:solid; - border-width:1px; - padding:1em; -} -pre, code, tt { - font-family: "Bitstream Vera Sans Mono","Andale Mono",Courier,monospace; - font-size:86%; -} - -/* IE behavior for pre is defined in css.pattern.tmpl in conditional comment */ -html>body pre { /* hide from IE */ - /*\*/ overflow:auto !important; /* */ overflow:scroll; width:auto; /* for Mac Safari */ -} -ol, ul { - margin-top:0; -} -blockquote { - padding:.5em 1.25em; - border-style:solid; - border-width:1px 1px 1px 5px; -} - -/* Text */ -h1 { - margin:0 0 .5em 0; -} -h1, h2, h3, h4, h5, h6 { - font-weight:normal; - line-height:1em; -} -h1 { font-size:190%; } -h2 { font-size:153%; } -h3 { font-size:133%; } -h4 { font-size:122%; font-weight:bold; } -h5 { font-size:110%; font-weight:bold; } -h6 { font-size:95%; font-weight:bold; } -h2, h3, h4, h5, h6 { - display:block; - /* give header a background color for easy scanning:*/ - padding:.25em 10px; - margin:1em -10px .35em -10px; - height:auto; -} -h1.patternTemplateTitle { - font-size:170%; - text-align:center; -} -h2.patternTemplateTitle { - text-align:center; - margin-top:.5em; - background:none; - border:none; -} -/* Links */ -/* somehow the foswikiNewLink style have to be before the general link styles */ -.foswikiNewLink { - border-width:0 0 1px 0; - border-style:solid; -} -.foswikiNewLink a { - text-decoration:none; - margin-left:1px; -} -.foswikiNewLink a sup { - text-align:center; - padding:0 2px; - vertical-align:baseline; - font-size:100%; - text-decoration:none; -} -.foswikiNewLink a:link sup, -.foswikiNewLink a:visited sup { - border-width:1px; - border-style:solid; - text-decoration:none; -} -.foswikiNewLink a:hover sup { - text-decoration:none; -} - -:link:focus, -:visited:focus, -:link, -:visited, -:link:active, -:visited:active { - text-decoration:underline; -} -:link:hover, -:visited:hover { - text-decoration:none; -} -img { - vertical-align:text-bottom; - border:0; -} - -/* Form elements */ -form { - display:inline; - margin:0; - padding:0; -} -textarea, -input, -select { - vertical-align:middle; - font-family:arial, verdana, sans-serif; - font-size:100%; -} -label input { - vertical-align:text-bottom; -} -.foswikiTextarea { - padding:1px 4px; -} -.foswikiSubmit, -.foswikiSubmitDisabled, -.foswikiButton, -.foswikiButtonDisabled, -.foswikiButtonCancel, -a.foswikiButton, -a.foswikiSubmit, -a.foswikiButtonCancel, -.foswikiCheckbox { - border-width:1px; - border-style:solid; - padding:.1em .2em; - font-weight:bold; - vertical-align:middle; - text-align:center; -} -.foswikiSubmit, -.foswikiSubmitDisabled, -.foswikiButton, -.foswikiButtonDisabled, -.foswikiButtonCancel, -.foswikiSubmit:hover, -.foswikiSubmitDisabled:hover, -.foswikiButton:hover, -.foswikiSubmit:active, -.foswikiSubmitDisabled:active, -.foswikiButton:active { - cursor:default; - outline:none; -} -a.foswikiButton, -a.foswikiButton:hover, -a.foswikiButton:link:active, -a.foswikiButton:visited:active, -a.foswikiButtonCancel, -a.foswikiButtonCancel:hover, -a.foswikiButtonCancel:link:active, -a.foswikiButtonCancel:visited:active, -a.foswikiSubmit, -a.foswikiSubmit:hover, -a.foswikiSubmit:link:active, -a.foswikiSubmit:visited:active { - text-decoration:none; -} -.jqButton.foswikiButtonCancel, -.jqButton.foswikiButtonCancel:hover { - border:none; - padding:0; - font-weight:normal; - margin:0; -} -.foswikiCheckbox, -.foswikiRadioButton { - margin:1px .25em 1px .1em; - padding:0 0 0 .5em; - border:0; -} -.foswikiTextarea, -.foswikiInputField, -.foswikiInputFieldDisabled, -.foswikiInputFieldReadOnly, -.foswikiSelect { - border-width:2px; - border-style:solid; -} -.foswikiTextarea, -.foswikiInputField, -.foswikiInputFieldDisabled, -.foswikiInputFieldReadOnly { - font-size:100%; -} -.foswikiInputField, -.foswikiInputFieldDisabled, -.foswikiInputFieldReadOnly { - padding:.1em .2em; -} - -/* ----------------------------------------------------------- - Plugin elements - ----------------------------------------------------------- */ - -/* TagMePlugin */ -.tagMePlugin select { - margin:0 .25em 0 0; -} -.tagMePlugin input { - border:0px; -} - -/* RevCommentPlugin */ -.patternEditPage .revComment { - padding:1em 0 2em 0; -} - -/* EditTablePlugin */ -.editTable .foswikiTable { - margin:0 0 2px 0; -} -.editTableEditImageButton { - border:none; -} - -/* TablePlugin */ -.foswikiTable, -.foswikiTable td, -.foswikiTable th { - border-width:1px; -} -.foswikiTable { - border-style:solid; - margin:2px 0; - border-collapse:collapse; -} -.foswikiTable td { - padding:3px 6px; - border-top-style:solid; - border-bottom-style:solid; -} -.foswikiTable th { - border-left-style:solid; - border-right-style:solid; - padding:4px 6px; -} -.foswikiTable .tableSortIcon { - margin:0 0 0 5px; -} -.foswikiTable a:link, -.foswikiTable a:visited { - text-decoration:underline; -} -.foswikiTable a:hover { - text-decoration:underline; -} - -/* TwistyContrib */ -.twistyTrigger a:link, -.twistyTrigger a:visited { - text-decoration:none; -} -.twistyTrigger a:link .foswikiLinkLabel, -.twistyTrigger a:visited .foswikiLinkLabel { - text-decoration:none; -} -.twistyTrigger a img { - margin:0 .25em 0 0; -} - -/*tipsOfTheDay*/ -.tipsOfTheDay { - padding:10px; -} - -/* ----------------------------------------------------------- - Foswiki styles - ----------------------------------------------------------- */ - -#foswikiLogin { - width:44em; - margin:0 auto; - text-align:center; -} -#foswikiLogin .foswikiFormSteps { - border-width:5px; - text-align:left; -} -#foswikiLogin .patternLoginNotification { - padding-left:.5em; - padding-right:.5em; - border-style:solid; - border-width:2px; -} -.foswikiTable h2, .foswikiFormTable h2, -.foswikiTable h3, .foswikiFormTable h3, -.foswikiTable h4, .foswikiFormTable h4, -.foswikiTable h5, .foswikiFormTable h5, -.foswikiTable h6, .foswikiFormTable h6 { - border:0; - margin:0; - padding-left:0; - padding-right:0; -} -.foswikiFormTable th { - font-weight:normal; -} -.foswikiFormTable .foswikiTable th { - font-weight:bold; -} -.patternEditPage .foswikiFormTable td, -.patternEditPage .foswikiFormTable th { - padding:.3em .4em; - border-style:solid; - border-width:0 0 1px 0; - vertical-align:middle; -} -.foswikiAttachments .foswikiTable, -table.foswikiFormTable { - margin:10px 0 5px 0; - border-collapse:collapse; - padding:0px; - border-spacing:0px; - empty-cells:show; - border-style:solid; - border-width:1px; -} -.foswikiAttachments table { - line-height:1.5em; /*S1*/ - width:auto; - width:100%; -} -.foswikiAttachments .foswikiTable th { - border-style:none none solid solid; - border-width:1px; -} -.foswikiAttachments .foswikiTable th, -table.foswikiFormTable th.foswikiFormTableHRow { - padding:3px 6px; - height:2.5em; - vertical-align:middle; -} -table.foswikiFormTable th.foswikiFormTableHRow { - text-align:center; -} -.foswikiFormTableFooter {} -.foswikiAttachments .foswikiTable td, -table.foswikiFormTable td { - padding:3px 2em 3px 1em; - height:1.5em; /*S1*/ - text-align:left; - vertical-align:top; -} -.foswikiAttachments .foswikiTable th.foswikiFirstCol, -.foswikiAttachments .foswikiTable td.foswikiFirstCol { - /* make more width for the icon column */ - width:26px; - text-align:center; -} -.foswikiAttachments .foswikiTable caption { - display:none; -} -table.foswikiFormTable th.foswikiFormTableHRow a:link, -table.foswikiFormTable th.foswikiFormTableHRow a:visited { - text-decoration:none; -} -.foswikiAttachments h3, -.foswikiForm h3, -.patternTwistyButton h3 { - font-size:1.1em; - font-weight:bold; - display:inline; - margin:0; - padding:0; -} -.patternTwistyButton h3 { - /* always add class foswikiButton as well */ - padding:.1em .2em; -} -.foswikiForm h3 a:link, -.foswikiForm h3 a:visited { - text-decoration:none; -} -.patternTwistyButton { - font-weight:bold; - margin:.25em 0; - display:inline-block; -} -.foswikiForm h3 .foswikiSmall { - font-weight:normal; - font-size:86%; - margin:0 0 0 .15em; -} -.foswikiFormSteps { - padding:0 40px; - border-width:1px; - border-style:solid; -} -.foswikiFormStep { - padding:12px 40px; - margin:-1px -40px -1px -40px; - border-width:1px; - border-style:solid none; -} -.foswikiFormStep h2, -.foswikiFormStep h3, -.foswikiFormStep h4 { - border:none; - margin-top:0; - margin-left:0; - margin-right:0; - padding:0; - background:none; -} -.foswikiFormStep p { - margin:.5em 0; -} -.foswikiFormSteps h2 { - font-size:115%; - font-weight:bold; -} -.foswikiFormSteps h3 { - font-size:100%; - font-weight:bold; -} -.foswikiFormSteps h4 { - font-size:100%; - font-weight:bold; -} -.foswikiFormSteps blockquote { - margin-left:1em; - padding-top:.25em; - padding-bottom:.25em; -} -.foswikiToc { - margin:1em 0; - padding:.3em 0 .6em 0; -} -.foswikiToc ul { - list-style:none; - padding:0 0 0 .5em; - margin:0; -} -.foswikiToc li { - margin-left:1em; - padding-left:1em; - background-repeat:no-repeat; - background-position:0 .5em; -} -.foswikiToc .foswikiTocTitle { - margin:0; - padding:0; - font-weight:bold; -} -.foswikiSmall { - font-size:86%; /*S3*/ - line-height:1.5em; /*S1*/ -} -.foswikiSmallish { - font-size:94%; /*S2*/ - line-height:1.5em; /*S1*/ -} -.foswikiEmulatedLink { - text-decoration:underline; -} -.foswikiPageForm table { - border-width:1px; - border-style:solid; -} -.foswikiPageForm table { - width:100%; -} -.foswikiPageForm th, -.foswikiPageForm td { - border:0; - padding:.5em 1em; -} -.foswikiPageForm td {} -.foswikiPageForm td.first { - padding-top:1em; -} -.foswikiBroadcastMessage, -.foswikiNotification { - padding:1em 20px; /*S5*/ -} -.foswikiNotification { - margin:1em 0; - border-style:solid; - border-width:2px; -} -.foswikiBroadcastMessage { - margin:0 0 1.25em 0; -} -.foswikiMessage { - padding:.5em 10px; - border:none; -} -.foswikiHelp { - padding:1em; - margin:.25em 0 0 0; - border-style:solid; - border-width:2px; -} -.foswikiHelp ul { - margin:0; - padding-left:20px; -} -.foswikiAccessKey { - border:none; -} -a:hover .foswikiAccessKey { - text-decoration:none; - border-width:0 0 1px 0; - border-style:solid; -} -.foswikiWebIndent { - margin:0 0 0 1em; -} -.foswikiLinkLabel {} -.foswikiImage img { - padding:3px; - border-width:1px; - border-style:solid; -} -.foswikiImage a:link, -.foswikiImage a:visited { - background:none; -} -#foswikiLogo img { - margin:0; - padding:0; - border:0px; -} -.foswikiNoBreak { - white-space:nowrap; -} -.foswikiSearchResultCount { - font-weight:bold; -} - -/* ----------------------------------------------------------- - Pattern skin specific elements - ----------------------------------------------------------- */ - -/* LAYOUT ELEMENTS */ -/* for specific layout sub-elements see further down */ - -.patternNoViewPage #patternOuter { - margin-left:0; - margin-right:0; -} -#patternTopBar { - border-width:1px; - border-style:none none solid none; -} -#patternBottomBar { - border-width:1px 0 0 0; - border-style:solid; -} -#patternWebBottomBar { - font-size:94%; /*S2*/ - line-height:125%; - text-align:left; -} -#patternSideBarContents { - margin:0 0 1em 0; - padding-right:.5em; - padding-left:1em; -} -#patternMainContents, -#patternBottomBarContents, -#patternSideBarContents, -#patternTopBarContents { - padding-right:2em; - padding-left:2em; -} -#patternSideBarContents, -#patternMainContents { - padding-top:2em; -} -#patternSideBarContents { - padding-bottom:2em; -} -#patternTopBarContents { - padding-top:1em; -} -#patternBottomBarContents { - padding-top:1em; -} -.patternNoViewPage .foswikiTopic { - margin-top:2em; -} - -/* bottom paddings */ -#patternMainContents { - padding-bottom:4em; -} -#patternBottomBarContents { - padding-bottom:2em; -} -.foswikiTopic { - margin:0 0 2em 0; -} -.patternNoViewPage #patternMainContents, -.patternNoViewPage #patternBottomBarContents { - margin-left:4%; - margin-right:4%; -} -.patternEditPage #patternMainContents, -.patternEditPage #patternBottomBarContents { - margin-left:2%; - margin-right:2%; -} - -.patternTop { - margin:0 0 .5em 0; -} -.patternNoViewPage .patternTop { - font-size:94%; -} -#patternSideBarContents img { - margin:0 3px 0 0; - vertical-align:text-bottom; -} -#patternSideBarContents a:link, -#patternSideBarContents a:visited { - text-decoration:none; -} -#patternSideBarContents ul { - padding:0; - margin:0; - list-style:none; -} -#patternSideBarContents, -#patternSideBarContents ul, -#patternSideBarContents li { - line-height:1.35em; -} -#patternSideBarContents h2 { - border:none; - background-color:transparent; -} -#patternSideBarContents .patternLeftBarPersonal, -#patternSideBarContents .patternWebIndicator { - padding:0 1em .75em 1em; - margin:0 -1em .75em -1em; /*S6*/ - border-style:none none solid none; - border-width:1px; -} -.patternWebIndicator a { - font-size:1.1em; - font-weight:bold; -} -.patternLeftBarPersonalContent { - padding:1em 0 0 0; -} -#patternSideBarContents li { - overflow:hidden; -} -html>body #patternSideBarContents li { /* Mozilla */ - overflow:visible; -} - -/* form options in top bar */ -.patternMetaMenu {} -.patternMetaMenu input, -.patternMetaMenu select, -.patternMetaMenu select option { - margin:0; -} -.patternMetaMenu select option { - padding:1px 0 0 0; -} -.patternMetaMenu ul { - padding:0; - margin:0; - list-style:none; -} -.patternMetaMenu ul li { - padding:0; - display:inline; -} -.patternMetaMenu ul li .foswikiInputField, -.patternMetaMenu ul li .foswikiSelect { - margin:0 0 0 .5em; -} -.patternHomePath .foswikiSeparator { - padding:0 .5em; -} -.patternHomePath a:link, -.patternHomePath a:visited { - text-decoration:none; - border-style:none none solid none; - border-width:1px; -} - -.patternToolBar { -} -.patternToolBar span { - float:left; -} -.patternToolBar span s, -.patternToolBar span strike, -.patternToolBar span a:link, -.patternToolBar span a:visited { - display:block; - border-width:1px; - border-style:solid; - padding:.1em .35em; - margin:0 0 .2em .25em; - font-weight:bold; -} -.patternToolBar span a:link, -.patternToolBar span a:visited { - text-decoration:none; - outline:none; -} -.patternToolBar span a:hover, -.patternToolBar span a:hover { - border-width:1px; - border-style:solid; -} -.patternToolBar span a:active { - outline:none; -} -.patternToolBar span.foswikiAccessKey { - float:none; -} -.patternToolBar span s, -.patternToolBar span strike { - text-decoration:none; -} - -.patternActionButtons a:link, -.patternActionButtons a:visited { - padding:1px 1px 2px 1px; -} -.patternTopicActions .patternActionButtons a:link, -.patternTopicActions .patternActionButtons a:visited { - text-decoration:none; -} -.patternTopicActions .patternActionButtons span s, -.patternTopicActions .patternActionButtons span strike { - text-decoration:none; -} -.patternActionButtons a.foswikiButton, -.patternActionButtons a.foswikiSubmit, -.patternActionButtons a.foswikiButtonCancel { - padding:.1em .2em; -} -.patternInfo { - margin:1.5em 0 0 0; -} -.patternHomePath .patternRevInfo { - font-size:94%; - white-space:nowrap; -} -.patternTopicFooter { - margin:1em 0 0 0; -} -.patternSimpleLogo { - margin:1em 0 0 0; -} - -/* WebSearch, WebSearchAdvanced */ -.foswikiWebSearchForm form { - width:100%; -} -.foswikiWebSearchForm ul { - list-style:none; - margin-top:0; -} - -#foswikiSearchTable { - width:100%; - margin:.5em 0; - background:none; - border-bottom:0; -} -#foswikiSearchTable th, -#foswikiSearchTable td { - padding:1em; - border-width:0 0 1px 0; - border-style:solid; -} -#foswikiSearchTable th { - width:20%; - text-align:right; -} -#foswikiSearchTable td { - width:80%; -} - -/* ----------------------------------------------------------- - Search results - styles and overridden styles used in search.pattern.tmpl - ----------------------------------------------------------- */ - -.patternSearchResults { - /* no longer used in search.pattern.tmpl, but remains in rename templates */ - margin:0 0 1em 0; -} -#renamehelpshow a span, -#renamehelphide a span { - font-size: 1.1em; -} -.patternSearchResults blockquote { - margin:1em 0 1em 5em; -} -h3.patternSearchResultsHeader, -h4.patternSearchResultsHeader { - display:block; - border-width:0 0 1px 0; - border-style:solid; - font-weight:bold; -} -.patternSearchResults h3 { - font-size:115%; /* same as foswikiFormStep */ - margin:0; - padding:.5em 40px; /*S5*/ - font-weight:bold; -} -h4.patternSearchResultsHeader { - font-size:100%; - padding-top:.3em; - padding-bottom:.3em; - font-weight:normal; -} -.patternSearchResult .foswikiTopRow { - padding-top:.2em; - margin-top:.1em; -} -.patternSearchResult .foswikiBottomRow { - margin-bottom:.1em; - padding-bottom:.25em; - border-width:0 0 1px 0; - border-style:solid; -} -.patternSearchResult .foswikiAlert { - font-weight:bold; -} -.patternSearchResult .foswikiSummary .foswikiAlert { - font-weight:normal; -} -.patternSearchResult .foswikiNew { - border-width:1px; - border-style:solid; - font-size:86%; /*S3*/ - padding:0 1px; - font-weight:bold; -} -.foswikiSearchResultsHeader span { - padding:0 .5em 0 0; -} - -.foswikiSearchResultCount { - font-weight:bold; -} -.foswikiSearchResult { - margin:0 0 1em 0; -} -.foswikiSearchResult .foswikiTopRow {} -.foswikiSearchResult .foswikiBottomRow {} -.foswikiSearchResult .foswikiAlert { - font-weight:bold; -} -.foswikiSummary, -.foswikiSearchResult .foswikiBottomRow { - font-size:86%; /*S3*/ -} -.foswikiSearchResult .foswikiSummary .foswikiAlert { - font-weight:normal; -} -.foswikiSearchResultsPager { - margin:1em 0; - padding:.25em 0; -} -.patternSearchResults .foswikiHelp { - display:block; - width:auto; - padding:.1em 5px; - margin:1em -5px .35em -5px; -} -.patternSearchResultCount { - margin:1em 0 3em 0; -} -.patternSearched {} - -/* Search results in book view format */ - -.patternBookView { - border-width:0 0 2px 2px; - border-style:solid; - /* border color in cssdynamic.pattern.tmpl */ - margin:.5em 0 1.5em -5px; - padding:0 0 0 5px; -} -.patternBookView .foswikiTopRow { - padding:.25em 5px .15em 5px; /*S4*/ - margin:1em -5px .15em -5px; /*S4*/ -} -.patternBookView .foswikiBottomRow { - font-size:100%; - padding:1em 0 1em 0; - width:auto; - border:none; -} - -/* pages that are not view */ - -/* edit.pattern.tmpl */ - -#edithelphide a span, -#edithelpshow a span { - font-size:1.1em; -} - -.patternNoViewPage #patternMainContents { - padding-top:0; -} -.patternEditPage #patternMainContents { - padding-left:0; - padding-right:0; -} -.patternEditPage .patternEditTopic { - padding:5px; - margin:0 0 1em 0; -} -.patternEditPage .foswikiTextarea { -} -.patternEditPage .foswikiForm { - border:none; -} -.foswikiFormHolder { /* constrains the textarea */ - width:100%; -} -.patternEditPage .foswikiForm h1, -.patternEditPage .foswikiForm h2, -.patternEditPage .foswikiForm h3 { - /* same as foswikiFormStep */ - font-size:120%; - font-weight:bold; -} -.foswikiEditboxStyleMono { - font-family: "Bitstream Vera Sans Mono","Andale Mono",Courier,monospace; -} -.foswikiEditboxStyleProportional { - font-family:arial, verdana, sans-serif; -} -.patternSig { - text-align:right -} -.patternSigLine { - margin:.5em 0 0 0; - border-style:none; -} -.foswikiAddFormButton { - float:right; -} -.patternTextareaButton { - margin:0 0 0 1px; - display:block; - cursor:pointer; - border-style:solid; - border-width:1px; -} -.patternButtonFontSelector { - margin:0 8px 0 0; -} -.patternSaveHelp { - margin:1em 0 0 0; - line-height:1.5em; -} - -/* preview.pattern.tmpl */ - -.patternPreviewPage #patternMainContents { - padding-left:0; - padding-right:0; -} -.patternPreviewPage .foswikiTopic { - margin-bottom:0; -} -.foswikiPreviewArea { - border-width:1px; - border-style:solid; - margin:0 0 1.5em 0; - padding:2em; -} - -/* attach.pattern.tmpl */ - -.patternAttachPage .foswikiAttachments .foswikiTable { - width:auto; -} -.patternAttachPage .foswikiAttachments { - margin-top:0; -} -.patternMoveAttachment { - margin:.5em 0 0 0; - text-align:right; -} - -/* rdiff.pattern.tmpl */ - -.patternDiff { - /* same as patternBookView */ - border-width:0 0 2px 2px; - border-style:solid; - margin:.5em 0 1.5em 0; - padding:0 0 0 10px; -} -.patternDiff h4.patternSearchResultsHeader { - padding:.5em 10px; -} -.patternDiffPage .patternRevInfo ul { - padding:0; - margin:2em 0 0 0; - list-style:none; -} -.patternDiffPage .foswikiDiffTable { - margin:2em 0; -} -.foswikiDiffDebug { - /* same styling as pre and code */ - font-family: "Bitstream Vera Sans Mono","Andale Mono",Courier,monospace; - font-size:86%; - white-space:pre; -} -tr.foswikiDiffDebug td { - border-width:1px; - border-style:solid; -} -.patternDiffPage td.foswikiDiffDebugLeft { - border-bottom:none; -} -.patternDiffPage .foswikiDiffTable th { - padding:.25em .5em; -} -.patternDiffPage .foswikiDiffTable td { - padding:.25em; -} -.foswikiDiffLineNumberHeader { - padding:.3em 0; -} - -.mceContentBody { - padding: 1px 4px; -} +html body{font-family:arial,verdana,sans-serif;font-size:104%;voice-family:"\"}\"";voice-family:inherit;font-size:small}html>body{font-size:small}body{line-height:1.5em;font-size:103%}body font{line-height:135%}th{line-height:1.15em}label{padding:.15em .3em .15em 0}hr{height:1px;border:0}pre{width:auto;margin:1em 0;border-style:solid;border-width:1px;padding:1em}pre,code,tt{font-family:"Bitstream Vera Sans Mono","Andale Mono",Courier,monospace;font-size:86%}html>body pre{/*\*/overflow:auto!important;/**/overflow:scroll;width:auto}ol,ul{margin-top:0}blockquote{padding:.5em 1.25em;border-style:solid;border-width:1px 1px 1px 5px}h1{margin:0 0 .5em 0}h1,h2,h3,h4,h5,h6{font-weight:normal;line-height:1em}h1{font-size:190%}h2{font-size:153%}h3{font-size:133%}h4{font-size:122%;font-weight:bold}h5{font-size:110%;font-weight:bold}h6{font-size:95%;font-weight:bold}h2,h3,h4,h5,h6{display:block;padding:.25em 10px;margin:1em -10px .35em -10px;height:auto}h1.patternTemplateTitle{font-size:170%;text-align:center}h2.patternTemplateTitle{text-align:center;margin-top:.5em;background:0;border:0}.foswikiNewLink{border-width:0 0 1px 0;border-style:solid}.foswikiNewLink a{text-decoration:none;margin-left:1px}.foswikiNewLink a sup{text-align:center;padding:0 2px;vertical-align:baseline;font-size:100%;text-decoration:none}.foswikiNewLink a:link sup,.foswikiNewLink a:visited sup{border-width:1px;border-style:solid;text-decoration:none}.foswikiNewLink a:hover sup{text-decoration:none}:link:focus,:visited:focus,:link,:visited,:link:active,:visited:active{text-decoration:underline}:link:hover,:visited:hover{text-decoration:none}img{vertical-align:text-bottom;border:0}form{display:inline;margin:0;padding:0}textarea,input,select{vertical-align:middle;font-family:arial,verdana,sans-serif;font-size:100%}label input{vertical-align:text-bottom}.foswikiTextarea{padding:1px 4px}.foswikiSubmit,.foswikiSubmitDisabled,.foswikiButton,.foswikiButtonDisabled,.foswikiButtonCancel,a.foswikiButton,a.foswikiSubmit,a.foswikiButtonCancel,.foswikiCheckbox{border-width:1px;border-style:solid;padding:.1em .2em;font-weight:bold;vertical-align:middle;text-align:center}.foswikiSubmit,.foswikiSubmitDisabled,.foswikiButton,.foswikiButtonDisabled,.foswikiButtonCancel,.foswikiSubmit:hover,.foswikiSubmitDisabled:hover,.foswikiButton:hover,.foswikiSubmit:active,.foswikiSubmitDisabled:active,.foswikiButton:active{cursor:default;outline:0}a.foswikiButton,a.foswikiButton:hover,a.foswikiButton:link:active,a.foswikiButton:visited:active,a.foswikiButtonCancel,a.foswikiButtonCancel:hover,a.foswikiButtonCancel:link:active,a.foswikiButtonCancel:visited:active,a.foswikiSubmit,a.foswikiSubmit:hover,a.foswikiSubmit:link:active,a.foswikiSubmit:visited:active{text-decoration:none}.jqButton.foswikiButtonCancel,.jqButton.foswikiButtonCancel:hover{border:0;padding:0;font-weight:normal;margin:0}.foswikiCheckbox,.foswikiRadioButton{margin:1px .25em 1px .1em;padding:0 0 0 .5em;border:0}.foswikiTextarea,.foswikiInputField,.foswikiInputFieldDisabled,.foswikiInputFieldReadOnly,.foswikiSelect{border-width:2px;border-style:solid}.foswikiTextarea,.foswikiInputField,.foswikiInputFieldDisabled,.foswikiInputFieldReadOnly{font-size:100%}.foswikiInputField,.foswikiInputFieldDisabled,.foswikiInputFieldReadOnly{padding:.1em .2em}.tagMePlugin select{margin:0 .25em 0 0}.tagMePlugin input{border:0}.patternEditPage .revComment{padding:1em 0 2em 0}.editTable .foswikiTable{margin:0 0 2px 0}.editTableEditImageButton{border:0}.foswikiTable,.foswikiTable td,.foswikiTable th{border-width:1px}.foswikiTable{border-style:solid;margin:2px 0;border-collapse:collapse}.foswikiTable td{padding:3px 6px;border-top-style:solid;border-bottom-style:solid}.foswikiTable th{border-left-style:solid;border-right-style:solid;padding:4px 6px}.foswikiTable .tableSortIcon{margin:0 0 0 5px}.foswikiTable a:link,.foswikiTable a:visited{text-decoration:underline}.foswikiTable a:hover{text-decoration:underline}.twistyTrigger a:link,.twistyTrigger a:visited{text-decoration:none}.twistyTrigger a:link .foswikiLinkLabel,.twistyTrigger a:visited .foswikiLinkLabel{text-decoration:none}.twistyTrigger a img{margin:0 .25em 0 0}.tipsOfTheDay{padding:10px}#foswikiLogin{width:44em;margin:0 auto;text-align:center}#foswikiLogin .foswikiFormSteps{border-width:5px;text-align:left}#foswikiLogin .patternLoginNotification{padding-left:.5em;padding-right:.5em;border-style:solid;border-width:2px}.foswikiTable h2,.foswikiFormTable h2,.foswikiTable h3,.foswikiFormTable h3,.foswikiTable h4,.foswikiFormTable h4,.foswikiTable h5,.foswikiFormTable h5,.foswikiTable h6,.foswikiFormTable h6{border:0;margin:0;padding-left:0;padding-right:0}.foswikiFormTable th{font-weight:normal}.foswikiFormTable .foswikiTable th{font-weight:bold}.patternEditPage .foswikiFormTable td,.patternEditPage .foswikiFormTable th{padding:.3em .4em;border-style:solid;border-width:0 0 1px 0;vertical-align:middle}.foswikiAttachments .foswikiTable,table.foswikiFormTable{margin:10px 0 5px 0;border-collapse:collapse;padding:0;border-spacing:0;empty-cells:show;border-style:solid;border-width:1px}.foswikiAttachments table{line-height:1.5em;width:auto;width:100%}.foswikiAttachments .foswikiTable th{border-style:none none solid solid;border-width:1px}.foswikiAttachments .foswikiTable th,table.foswikiFormTable th.foswikiFormTableHRow{padding:3px 6px;height:2.5em;vertical-align:middle}table.foswikiFormTable th.foswikiFormTableHRow{text-align:center}.foswikiAttachments .foswikiTable td,table.foswikiFormTable td{padding:3px 2em 3px 1em;height:1.5em;text-align:left;vertical-align:top}.foswikiAttachments .foswikiTable th.foswikiFirstCol,.foswikiAttachments .foswikiTable td.foswikiFirstCol{width:26px;text-align:center}.foswikiAttachments .foswikiTable caption{display:none}table.foswikiFormTable th.foswikiFormTableHRow a:link,table.foswikiFormTable th.foswikiFormTableHRow a:visited{text-decoration:none}.foswikiAttachments h3,.foswikiForm h3,.patternTwistyButton h3{font-size:1.1em;font-weight:bold;display:inline;margin:0;padding:0}.patternTwistyButton h3{padding:.1em .2em}.foswikiForm h3 a:link,.foswikiForm h3 a:visited{text-decoration:none}.patternTwistyButton{font-weight:bold;margin:.25em 0;display:inline-block}.foswikiForm h3 .foswikiSmall{font-weight:normal;font-size:86%;margin:0 0 0 .15em}.foswikiFormSteps{padding:0 40px;border-width:1px;border-style:solid}.foswikiFormStep{padding:12px 40px;margin:-1px -40px -1px -40px;border-width:1px;border-style:solid none}.foswikiFormStep h2,.foswikiFormStep h3,.foswikiFormStep h4{border:0;margin-top:0;margin-left:0;margin-right:0;padding:0;background:0}.foswikiFormStep p{margin:.5em 0}.foswikiFormSteps h2{font-size:115%;font-weight:bold}.foswikiFormSteps h3{font-size:100%;font-weight:bold}.foswikiFormSteps h4{font-size:100%;font-weight:bold}.foswikiFormSteps blockquote{margin-left:1em;padding-top:.25em;padding-bottom:.25em}.foswikiToc{margin:1em 0;padding:.3em 0 .6em 0}.foswikiToc ul{list-style:none;padding:0 0 0 .5em;margin:0}.foswikiToc li{margin-left:1em;padding-left:1em;background-repeat:no-repeat;background-position:0 .5em}.foswikiToc .foswikiTocTitle{margin:0;padding:0;font-weight:bold}.foswikiSmall{font-size:86%;line-height:1.5em}.foswikiSmallish{font-size:94%;line-height:1.5em}.foswikiEmulatedLink{text-decoration:underline}.foswikiPageForm table{border-width:1px;border-style:solid}.foswikiPageForm table{width:100%}.foswikiPageForm th,.foswikiPageForm td{border:0;padding:.5em 1em}.foswikiPageForm td.first{padding-top:1em}.foswikiBroadcastMessage,.foswikiNotification{padding:1em 20px}.foswikiNotification{margin:1em 0;border-style:solid;border-width:2px}.foswikiBroadcastMessage{margin:0 0 1.25em 0}.foswikiMessage{padding:.5em 10px;border:0}.foswikiHelp{padding:1em;margin:.25em 0 0 0;border-style:solid;border-width:2px}.foswikiHelp ul{margin:0;padding-left:20px}.foswikiAccessKey{border:0}a:hover .foswikiAccessKey{text-decoration:none;border-width:0 0 1px 0;border-style:solid}.foswikiWebIndent{margin:0 0 0 1em}.foswikiImage img{padding:3px;border-width:1px;border-style:solid}.foswikiImage a:link,.foswikiImage a:visited{background:0}#foswikiLogo img{margin:0;padding:0;border:0}.foswikiNoBreak{white-space:nowrap}.foswikiSearchResultCount{font-weight:bold}.patternNoViewPage #patternOuter{margin-left:0;margin-right:0}#patternTopBar{border-width:1px;border-style:none none solid none}#patternBottomBar{border-width:1px 0 0 0;border-style:solid}#patternWebBottomBar{font-size:94%;line-height:125%;text-align:left}#patternSideBarContents{margin:0 0 1em 0;padding-right:.5em;padding-left:1em}#patternMainContents,#patternBottomBarContents,#patternSideBarContents,#patternTopBarContents{padding-right:2em;padding-left:2em}#patternSideBarContents,#patternMainContents{padding-top:2em}#patternSideBarContents{padding-bottom:2em}#patternTopBarContents{padding-top:1em}#patternBottomBarContents{padding-top:1em}.patternNoViewPage .foswikiTopic{margin-top:2em}#patternMainContents{padding-bottom:4em}#patternBottomBarContents{padding-bottom:2em}.foswikiTopic{margin:0 0 2em 0}.patternNoViewPage #patternMainContents,.patternNoViewPage #patternBottomBarContents{margin-left:4%;margin-right:4%}.patternEditPage #patternMainContents,.patternEditPage #patternBottomBarContents{margin-left:2%;margin-right:2%}.patternTop{margin:0 0 .5em 0}.patternNoViewPage .patternTop{font-size:94%}#patternSideBarContents img{margin:0 3px 0 0;vertical-align:text-bottom}#patternSideBarContents a:link,#patternSideBarContents a:visited{text-decoration:none}#patternSideBarContents ul{padding:0;margin:0;list-style:none}#patternSideBarContents,#patternSideBarContents ul,#patternSideBarContents li{line-height:1.35em}#patternSideBarContents h2{border:0;background-color:transparent}#patternSideBarContents .patternLeftBarPersonal,#patternSideBarContents .patternWebIndicator{padding:0 1em .75em 1em;margin:0 -1em .75em -1em;border-style:none none solid none;border-width:1px}.patternWebIndicator a{font-size:1.1em;font-weight:bold}.patternLeftBarPersonalContent{padding:1em 0 0 0}#patternSideBarContents li{overflow:hidden}html>body #patternSideBarContents li{overflow:visible}.patternMetaMenu input,.patternMetaMenu select,.patternMetaMenu select option{margin:0}.patternMetaMenu select option{padding:1px 0 0 0}.patternMetaMenu ul{padding:0;margin:0;list-style:none}.patternMetaMenu ul li{padding:0;display:inline}.patternMetaMenu ul li .foswikiInputField,.patternMetaMenu ul li .foswikiSelect{margin:0 0 0 .5em}.patternHomePath .foswikiSeparator{padding:0 .5em}.patternHomePath a:link,.patternHomePath a:visited{text-decoration:none;border-style:none none solid none;border-width:1px}.patternToolBar span{float:left}.patternToolBar span s,.patternToolBar span strike,.patternToolBar span a:link,.patternToolBar span a:visited{display:block;border-width:1px;border-style:solid;padding:.1em .35em;margin:0 0 .2em .25em;font-weight:bold}.patternToolBar span a:link,.patternToolBar span a:visited{text-decoration:none;outline:0}.patternToolBar span a:hover,.patternToolBar span a:hover{border-width:1px;border-style:solid}.patternToolBar span a:active{outline:0}.patternToolBar span.foswikiAccessKey{float:none}.patternToolBar span s,.patternToolBar span strike{text-decoration:none}.patternActionButtons a:link,.patternActionButtons a:visited{padding:1px 1px 2px 1px}.patternTopicActions .patternActionButtons a:link,.patternTopicActions .patternActionButtons a:visited{text-decoration:none}.patternTopicActions .patternActionButtons span s,.patternTopicActions .patternActionButtons span strike{text-decoration:none}.patternActionButtons a.foswikiButton,.patternActionButtons a.foswikiSubmit,.patternActionButtons a.foswikiButtonCancel{padding:.1em .2em}.patternInfo{margin:1.5em 0 0 0}.patternHomePath .patternRevInfo{font-size:94%;white-space:nowrap}.patternTopicFooter{margin:1em 0 0 0}.patternSimpleLogo{margin:1em 0 0 0}.foswikiWebSearchForm form{width:100%}.foswikiWebSearchForm ul{list-style:none;margin-top:0}#foswikiSearchTable{width:100%;margin:.5em 0;background:0;border-bottom:0}#foswikiSearchTable th,#foswikiSearchTable td{padding:1em;border-width:0 0 1px 0;border-style:solid}#foswikiSearchTable th{width:20%;text-align:right}#foswikiSearchTable td{width:80%}.patternSearchResults{margin:0 0 1em 0}#renamehelpshow a span,#renamehelphide a span{font-size:1.1em}.patternSearchResults blockquote{margin:1em 0 1em 5em}h3.patternSearchResultsHeader,h4.patternSearchResultsHeader{display:block;border-width:0 0 1px 0;border-style:solid;font-weight:bold}.patternSearchResults h3{font-size:115%;margin:0;padding:.5em 40px;font-weight:bold}h4.patternSearchResultsHeader{font-size:100%;padding-top:.3em;padding-bottom:.3em;font-weight:normal}.patternSearchResult .foswikiTopRow{padding-top:.2em;margin-top:.1em}.patternSearchResult .foswikiBottomRow{margin-bottom:.1em;padding-bottom:.25em;border-width:0 0 1px 0;border-style:solid}.patternSearchResult .foswikiAlert{font-weight:bold}.patternSearchResult .foswikiSummary .foswikiAlert{font-weight:normal}.patternSearchResult .foswikiNew{border-width:1px;border-style:solid;font-size:86%;padding:0 1px;font-weight:bold}.foswikiSearchResultsHeader span{padding:0 .5em 0 0}.foswikiSearchResultCount{font-weight:bold}.foswikiSearchResult{margin:0 0 1em 0}.foswikiSearchResult .foswikiAlert{font-weight:bold}.foswikiSummary,.foswikiSearchResult .foswikiBottomRow{font-size:86%}.foswikiSearchResult .foswikiSummary .foswikiAlert{font-weight:normal}.foswikiSearchResultsPager{margin:1em 0;padding:.25em 0}.patternSearchResults .foswikiHelp{display:block;width:auto;padding:.1em 5px;margin:1em -5px .35em -5px}.patternSearchResultCount{margin:1em 0 3em 0}.patternBookView{border-width:0 0 2px 2px;border-style:solid;margin:.5em 0 1.5em -5px;padding:0 0 0 5px}.patternBookView .foswikiTopRow{padding:.25em 5px .15em 5px;margin:1em -5px .15em -5px}.patternBookView .foswikiBottomRow{font-size:100%;padding:1em 0 1em 0;width:auto;border:0}#edithelphide a span,#edithelpshow a span{font-size:1.1em}.patternNoViewPage #patternMainContents{padding-top:0}.patternEditPage #patternMainContents{padding-left:0;padding-right:0}.patternEditPage .patternEditTopic{padding:5px;margin:0 0 1em 0}.patternEditPage .foswikiForm{border:0}.foswikiFormHolder{width:100%}.patternEditPage .foswikiForm h1,.patternEditPage .foswikiForm h2,.patternEditPage .foswikiForm h3{font-size:120%;font-weight:bold}.foswikiEditboxStyleMono{font-family:"Bitstream Vera Sans Mono","Andale Mono",Courier,monospace}.foswikiEditboxStyleProportional{font-family:arial,verdana,sans-serif}.patternSig{text-align:right}.patternSigLine{margin:.5em 0 0 0;border-style:none}.foswikiAddFormButton{float:right}.patternTextareaButton{margin:0 0 0 1px;display:block;cursor:pointer;border-style:solid;border-width:1px}.patternButtonFontSelector{margin:0 8px 0 0}.patternSaveHelp{margin:1em 0 0 0;line-height:1.5em}.patternPreviewPage #patternMainContents{padding-left:0;padding-right:0}.patternPreviewPage .foswikiTopic{margin-bottom:0}.foswikiPreviewArea{border-width:1px;border-style:solid;margin:0 0 1.5em 0;padding:2em}.patternAttachPage .foswikiAttachments .foswikiTable{width:auto}.patternAttachPage .foswikiAttachments{margin-top:0}.patternMoveAttachment{margin:.5em 0 0 0;text-align:right}.patternDiff{border-width:0 0 2px 2px;border-style:solid;margin:.5em 0 1.5em 0;padding:0 0 0 10px}.patternDiff h4.patternSearchResultsHeader{padding:.5em 10px}.patternDiffPage .patternRevInfo ul{padding:0;margin:2em 0 0 0;list-style:none}.patternDiffPage .foswikiDiffTable{margin:2em 0}.foswikiDiffDebug{font-family:"Bitstream Vera Sans Mono","Andale Mono",Courier,monospace;font-size:86%;white-space:pre}tr.foswikiDiffDebug td{border-width:1px;border-style:solid}.patternDiffPage td.foswikiDiffDebugLeft{border-bottom:0}.patternDiffPage .foswikiDiffTable th{padding:.25em .5em}.patternDiffPage .foswikiDiffTable td{padding:.25em}.foswikiDiffLineNumberHeader{padding:.3em 0}.mceContentBody{padding:1px 4px} \ No newline at end of file diff --git a/doc/html/user/pub/System/PatternSkinTheme2009/variant_twiki.css b/doc/html/user/pub/System/PatternSkinTheme2009/variant_twiki.css index f545a73e..03da46c8 100644 --- a/doc/html/user/pub/System/PatternSkinTheme2009/variant_twiki.css +++ b/doc/html/user/pub/System/PatternSkinTheme2009/variant_twiki.css @@ -1,45 +1 @@ -/* -Compatible skin for TWiki-like installations -Overrides global settings in layout.css, style.css and colors.css -*/ - -/* outer 'frame' */ -#patternScreen { - padding:0; -} -#patternPage { - border:none; -} - -/* paddings of main content elements */ -#patternBottomBarContents, -#patternTopBarContents { - padding-right:2em; - padding-left:1em; -} -#patternMainContents { - padding-right:2em; - padding-left:2em; -} -#patternSideBarContents, -#patternMainContents { - padding-top:1em; -} -#patternBottomBarContents { - padding-top:1em; -} - -/* top bar */ -#patternTopBarContents { - background-image:url(TWiki_header.gif); - background-repeat:no-repeat; - background-color:#fff; -} -#patternTopBar, -#patternClearHeaderCenter, -#patternClearHeaderLeft, -#patternClearHeaderRight, -#patternTopBarContents { - height:64px; - overflow:hidden; -} +#patternScreen{padding:0}#patternPage{border:0}#patternBottomBarContents,#patternTopBarContents{padding-right:2em;padding-left:1em}#patternMainContents{padding-right:2em;padding-left:2em}#patternSideBarContents,#patternMainContents{padding-top:1em}#patternBottomBarContents{padding-top:1em}#patternTopBarContents{background-image:url(TWiki_header.gif);background-repeat:no-repeat;background-color:#fff}#patternTopBar,#patternTopBarContents{height:64px;overflow:hidden} \ No newline at end of file diff --git a/doc/html/user/pub/System/PsiSkin/psistyle.css b/doc/html/user/pub/System/PsiSkin/psistyle.css index 8626dd6b..00c5ebb6 100644 --- a/doc/html/user/pub/System/PsiSkin/psistyle.css +++ b/doc/html/user/pub/System/PsiSkin/psistyle.css @@ -99,7 +99,8 @@ blockquote.psi { /* DMS Icon */ -.patternContent a[href^="http:"] { +.patternContent a[href^="http:"], +.patternContent a[href^="https:"] { background-image: url(../DocumentGraphics/external.gif); background-position: right center; background-repeat: no-repeat; @@ -107,11 +108,14 @@ blockquote.psi { } .patternContent a[href^="http:"]:hover, -.patternContent a[href^="http:"]:visited:hover { +.patternContent a[href^="http:"]:visited:hover, +.patternContent a[href^="https:"]:hover, +.patternContent a[href^="https:"]:visited:hover { background-image: url(../DocumentGraphics/external-hover.gif); } -.patternContent a[href^="http:"]:visited { +.patternContent a[href^="http:"]:visited, +.patternContent a[href^="https:"]:visited { background-image: url(../DocumentGraphics/external-visited.gif); } @@ -128,14 +132,17 @@ blockquote.psi { padding-right: 0px; } -.patternContent a[href^="http://i.psi.ch"] { +.patternContent a[href^="http://i.psi.ch"], +.patternContent a[href^="https://intranet.psi.ch"] { background: transparent; padding-right: 0px; background-repeat: no-repeat; background-image: none; } .patternContent a[href^="http://i.psi.ch"]:hover, -.patternContent a[href^="http://i.psi.ch"]:visited:hover { +.patternContent a[href^="http://i.psi.ch"]:visited:hover, +.patternContent a[href^="https://intranet.psi.ch"]:hover, +.patternContent a[href^="https://intranet.psi.ch"]:visited:hover { background-image: none; background-color: #0055B5; } @@ -175,7 +182,7 @@ caption { :lang(de) { quotes:"\201E" "\201C" "\201A" "\2018"; } :lang(en) { quotes:"\201C" "\201D" "\2018" "\2019"; } -:lang(fr) { quotes:"\00AB\A0" "\A0\00BB" "\2039\A0" "\A0\203A"; } +:lang(fr) { quotes:"\00AB" "\00BB" "\2039" "\203A"; } q:before { content:open-quote; color:#000000; } q:after { content:close-quote; color:#000000; } diff --git a/doc/html/user/pub/System/SkinTemplates/base.css b/doc/html/user/pub/System/SkinTemplates/base.css index f3445348..f50c8b3d 100644 --- a/doc/html/user/pub/System/SkinTemplates/base.css +++ b/doc/html/user/pub/System/SkinTemplates/base.css @@ -1 +1 @@ -.foswikiMakeVisible,.foswikiMakeVisibleInline,.foswikiMakeVisibleBlock{display:none;}.foswikiJs .foswikiMakeVisible{display:inline;}.foswikiJs p.foswikiMakeVisible,.foswikiJs h1.foswikiMakeVisible,.foswikiJs h2.foswikiMakeVisible,.foswikiJs h3.foswikiMakeVisible,.foswikiJs h4.foswikiMakeVisible,.foswikiJs h5.foswikiMakeVisible,.foswikiJs h6.foswikiMakeVisible,.foswikiJs dl.foswikiMakeVisible,.foswikiJs dt.foswikiMakeVisible,.foswikiJs dd.foswikiMakeVisible,.foswikiJs ol.foswikiMakeVisible,.foswikiJs ul.foswikiMakeVisible,.foswikiJs li.foswikiMakeVisible,.foswikiJs address.foswikiMakeVisible,.foswikiJs blockquote.foswikiMakeVisible,.foswikiJs center.foswikiMakeVisible,.foswikiJs del.foswikiMakeVisible,.foswikiJs div.foswikiMakeVisible,.foswikiJs form.foswikiMakeVisible,.foswikiJs hr.foswikiMakeVisible,.foswikiJs ins.foswikiMakeVisible,.foswikiJs noscript.foswikiMakeVisible,.foswikiJs pre.foswikiMakeVisible,.foswikiJs table.foswikiMakeVisible{display:block;}.foswikiJs .foswikiMakeVisibleInline{display:inline;}.foswikiJs .foswikiMakeVisibleBlock{display:block;}.foswikiJs .foswikiMakeHidden{display:none;}.foswikiLeft{float:left;position:relative;}.foswikiRight{position:relative;float:right;display:inline;margin:0;}.foswikiClear,.foswikiFormStep p.foswikiClear{margin:0;padding:0;height:0;line-height:0;clear:both;display:block;}.foswikiHidden{display:none;}.foswikiSmall{font-size:86%;line-height:110%;}.foswikiSmallish{font-size:94%;}.foswikiLarge{font-size:1.3em;line-height:1.5em;}.foswikiBroadcastMessage,.foswikiNotification{background-color:#fff7e7;padding:.25em .5em;margin:0 0 1em 0;}.foswikiBroadcastMessage b,.foswikiBroadcastMessage strong{color:#f00;}.foswikiMessage{padding:.5em 10px;background-color:#fff7e7;border:none;}.foswikiAlert,.foswikiAlert code{color:#f00;}.foswikiEmulatedLink{text-decoration:underline;}.foswikiAccessKey{text-decoration:none;border-width:0 0 1px 0;border-style:solid;}a:hover .foswikiAccessKey{text-decoration:none;border:none;}img{border:0;vertical-align:middle;}.foswikiImage img{padding:3px;border-width:1px;border-style:solid;}.foswikiPreviewArea{border-width:1px;border-style:solid;border-color:#f00;margin:1em 0;padding:1em;}.foswikiSummary em{font-weight:bold;font-style:normal;color:#000;}.foswikiTabs ul{margin:0;padding:0;list-style:none;position:relative;bottom:0;}.foswikiTabs ul li{display:inline;}.foswikiTabs ul li a,.foswikiTabs ul li a:link,.foswikiTabs ul li a:hover,.foswikiTabs ul li a:visited{text-decoration:none;color:#000;}.foswikiTabs ul li a,.foswikiTabs ul li span{display:block;float:left;margin:0 6px 0 0;padding:.35em .7em;border-style:solid;border-width:1px;border-color:#ccc;background:#eee;}.foswikiTabs ul li a,.foswikiTabs ul li span,.foswikiTabContent{border-style:solid;border-width:1px;border-color:#ccc;}.foswikiTabs ul li.foswikiActiveTab a,.foswikiTabs ul li a:hover,.foswikiTabs ul li span{border-bottom-color:#fff;background:#fff;}.foswikiTabContent{margin:-1px 0 1em 0;padding:.7em;background:#fff;}.foswikiHorizontalList ul{margin:0;padding:0;list-style:none;clear:both;}.foswikiHorizontalList ul li{float:left;display:block;padding:0 .5em;border-style:none solid none none;border-width:1px;}.foswikiHorizontalList ul li.foswikiLast{border:none;}.foswikiYellowFG{color:#ff0;}.foswikiOrangeFG{color:#f60;}.foswikiRedFG{color:#f00;}.foswikiPinkFG{color:#f0f;}.foswikiPurpleFG{color:#800080;}.foswikiTealFG{color:#008080;}.foswikiNavyFG{color:#000080;}.foswikiBlueFG{color:#00f;}.foswikiAquaFG{color:#0ff;}.foswikiLimeFG{color:#0f0;}.foswikiGreenFG{color:#008000;}.foswikiOliveFG{color:#808000;}.foswikiMaroonFG{color:#800000;}.foswikiBrownFG{color:#963;}.foswikiBlackFG{color:#000;}.foswikiGrayFG{color:#808080;}.foswikiSilverFG{color:#c0c0c0;}.foswikiWhiteFG{color:#fff;}.foswikiYellowBG{background-color:#ff0;}.foswikiOrangeBG{background-color:#f60;}.foswikiRedBG{background-color:#f00;}.foswikiPinkBG{background-color:#f0f;}.foswikiPurpleBG{background-color:#800080;}.foswikiNavyBG{background-color:#000080;}.foswikiBlueBG{background-color:#00f;}.foswikiTealBG{background-color:#008080;}.foswikiAquaBG{background-color:#0ff;}.foswikiLimeBG{background-color:#0f0;}.foswikiGreenBG{background-color:#008000;}.foswikiOliveBG{background-color:#808000;}.foswikiMaroonBG{background-color:#800000;}.foswikiBrownBG{background-color:#963;}.foswikiBlackBG{background-color:#000;}.foswikiGrayBG{background-color:#808080;}.foswikiSilverBG{background-color:#c0c0c0;}.foswikiWhiteBG{background-color:#fff;} \ No newline at end of file +.foswikiNoJs .foswikiMakeVisible,.foswikiNoJs .foswikiMakeVisibleInline,.foswikiNoJs .foswikiMakeVisibleBlock{display:none}.foswikiMakeVisible{display:inline}a.foswikiMakeVisible,p.foswikiMakeVisible,h1.foswikiMakeVisible,h2.foswikiMakeVisible,h3.foswikiMakeVisible,h4.foswikiMakeVisible,h5.foswikiMakeVisible,h6.foswikiMakeVisible,dl.foswikiMakeVisible,dt.foswikiMakeVisible,dd.foswikiMakeVisible,ol.foswikiMakeVisible,ul.foswikiMakeVisible,li.foswikiMakeVisible,address.foswikiMakeVisible,blockquote.foswikiMakeVisible,center.foswikiMakeVisible,del.foswikiMakeVisible,div.foswikiMakeVisible,form.foswikiMakeVisible,hr.foswikiMakeVisible,ins.foswikiMakeVisible,noscript.foswikiMakeVisible,pre.foswikiMakeVisible,table.foswikiMakeVisible{display:block}.foswikiMakeVisibleInline{display:inline}.foswikiMakeVisibleBlock{display:block}.foswikiMakeHidden{display:none}.foswikiLeft{float:left}.foswikiRight{float:right}.foswikiClear,.foswikiFormStep p.foswikiClear{margin:0;padding:0;height:0;line-height:0;clear:both;display:block}.foswikiHidden{display:none}.foswikiSmall{font-size:86%;line-height:110%}.foswikiSmallish{font-size:94%}.foswikiLarge{font-size:1.3em;line-height:1.5em}.foswikiBroadcastMessage,.foswikiNotification{background-color:#fff7e7;padding:.25em .5em;margin:0 0 1em 0}.foswikiBroadcastMessage b,.foswikiBroadcastMessage strong{color:#f00}.foswikiMessage{padding:.5em 10px;background-color:#fff7e7;border:0}.foswikiAlert,.foswikiAlert code{color:#f00}.foswikiNewLink,.foswikiNewLink:link,.foswikiNewLink:visited{color:#b00000;text-decoration:none;border-bottom:1px dotted #b00000}.foswikiNewLink:link:hover{color:#b00000;text-decoration:none;border-bottom:1px solid #b00000}.foswikiEmulatedLink{text-decoration:underline}.foswikiAccessKey{text-decoration:none;border-width:0 0 1px 0;border-style:solid}a:hover .foswikiAccessKey{text-decoration:none;border:0}img{border:0;vertical-align:middle}pre{white-space:pre-wrap;white-space:-pre-wrap;white-space:-o-pre-wrap;word-wrap:break-word;white-space:-moz-pre-wrap;width:auto;margin:1em 0;padding:1em}.foswikiImage img{padding:3px;border-width:1px;border-style:solid}.foswikiPreviewArea{border-width:1px;border-style:solid;border-color:#f00;margin:1em 0;padding:1em}.foswikiSummary em{font-weight:bold;font-style:normal;color:#000}.foswikiTabs{position:relative}.foswikiTabs:after{content:'';position:absolute;width:100%;height:1px;border-bottom-width:1px;border-bottom-style:solid;border-bottom-color:#ccc;bottom:0}.foswikiTabs>ul{margin:0;padding:0;list-style:none;bottom:0;margin-bottom:-1px;*zoom:1}.foswikiTabs>ul:before,.foswikiTabs>ul:after{display:table;content:"";line-height:0}.foswikiTabs>ul:after{clear:both}.foswikiTabs>ul>li{display:inline}.foswikiTabs>ul>li>a{position:relative;display:inline-block;float:left;margin-right:6px;border-style:solid;border-width:1px;border-color:#ccc;background-image:none;background:#eee}.foswikiTabs>ul>li>a:link,.foswikiTabs>ul>li>a:visited,.foswikiTabs>ul>li>a:hover,.foswikiTabs>ul>li>a:active{padding:.35em .7em;text-decoration:none;color:#000}.foswikiTabs>ul>li>a:visited{color:#000}.foswikiTabs>ul>li>a:hover{background:#eee}.foswikiTabs>ul>li.foswikiActiveTab a:hover,.foswikiTabs>ul>li.foswikiActive a:hover{cursor:default}.foswikiTabs>ul>li.foswikiActiveTab a,.foswikiTabs>ul>li.foswikiActive a{border-bottom-color:#fff;background:#fff;z-index:1}.foswikiTabContent{border-style:solid;border-width:1px;border-color:#ccc;background:#fff;margin-bottom:1.5em}.foswikiNoJs .foswikiTabs>ul{display:none}.foswikiWebSearchForm{margin:1em 0}.foswikiHorizontalList ul{margin:0;padding:0;list-style:none;clear:both}.foswikiHorizontalList ul li{float:left;display:block;padding:0 .5em;border-style:none solid none none;border-width:1px}.foswikiHorizontalList ul li.foswikiLast{border:0}.foswikiIndent{padding-left:3em}.foswikiToc.foswikiRight{margin:0 0 1em 2em;max-width:40%}.foswikiToc.foswikiLeft{margin:0 2em 1em 0;max-width:40%}.foswikiToc .foswikiTocTitle{font-weight:bold}.foswikiYellowFG{color:#ff0}.foswikiOrangeFG{color:#f60}.foswikiRedFG{color:#f00}.foswikiPinkFG{color:#f0f}.foswikiPurpleFG{color:#800080}.foswikiTealFG{color:#008080}.foswikiNavyFG{color:#000080}.foswikiBlueFG{color:#00f}.foswikiAquaFG{color:#0ff}.foswikiLimeFG{color:#0f0}.foswikiGreenFG{color:#008000}.foswikiOliveFG{color:#808000}.foswikiMaroonFG{color:#800000}.foswikiBrownFG{color:#963}.foswikiBlackFG{color:#000}.foswikiGrayFG{color:#808080}.foswikiSilverFG{color:#c0c0c0}.foswikiWhiteFG{color:#fff}.foswikiYellowBG{background-color:#ff0}.foswikiOrangeBG{background-color:#f60}.foswikiRedBG{background-color:#f00}.foswikiPinkBG{background-color:#f0f}.foswikiPurpleBG{background-color:#800080}.foswikiNavyBG{background-color:#000080}.foswikiBlueBG{background-color:#00f}.foswikiTealBG{background-color:#008080}.foswikiAquaBG{background-color:#0ff}.foswikiLimeBG{background-color:#0f0}.foswikiGreenBG{background-color:#008000}.foswikiOliveBG{background-color:#808000}.foswikiMaroonBG{background-color:#800000}.foswikiBrownBG{background-color:#963}.foswikiBlackBG{background-color:#000}.foswikiGrayBG{background-color:#808080}.foswikiSilverBG{background-color:#c0c0c0}.foswikiWhiteBG{background-color:#fff} \ No newline at end of file diff --git a/doc/memos/rrf/08011-Fourier-Averaged.pdf b/doc/memos/rrf/08011-Fourier-Averaged.pdf new file mode 100644 index 00000000..c95586d5 Binary files /dev/null and b/doc/memos/rrf/08011-Fourier-Averaged.pdf differ diff --git a/doc/memos/rrf/08011-RRF-Asym-Fourier-Averaged-Ghost.pdf b/doc/memos/rrf/08011-RRF-Asym-Fourier-Averaged-Ghost.pdf new file mode 100644 index 00000000..85876e84 Binary files /dev/null and b/doc/memos/rrf/08011-RRF-Asym-Fourier-Averaged-Ghost.pdf differ diff --git a/doc/memos/rrf/08011-RRF-Histo-Fourier-Averaged-Ghost.pdf b/doc/memos/rrf/08011-RRF-Histo-Fourier-Averaged-Ghost.pdf new file mode 100644 index 00000000..74eb41cc Binary files /dev/null and b/doc/memos/rrf/08011-RRF-Histo-Fourier-Averaged-Ghost.pdf differ diff --git a/doc/memos/rrf/08019-Fourier-Averaged.pdf b/doc/memos/rrf/08019-Fourier-Averaged.pdf new file mode 100644 index 00000000..baee392f Binary files /dev/null and b/doc/memos/rrf/08019-Fourier-Averaged.pdf differ diff --git a/doc/memos/rrf/HAL-9500-t0.pdf b/doc/memos/rrf/HAL-9500-t0.pdf new file mode 100644 index 00000000..90fe700d Binary files /dev/null and b/doc/memos/rrf/HAL-9500-t0.pdf differ diff --git a/doc/memos/rrf/PSI_Logo_narrow_blau.jpg b/doc/memos/rrf/PSI_Logo_narrow_blau.jpg new file mode 100644 index 00000000..aa253979 Binary files /dev/null and b/doc/memos/rrf/PSI_Logo_narrow_blau.jpg differ diff --git a/doc/memos/rrf/PSI_Logo_wide_blau.pdf b/doc/memos/rrf/PSI_Logo_wide_blau.pdf new file mode 100644 index 00000000..13482e93 Binary files /dev/null and b/doc/memos/rrf/PSI_Logo_wide_blau.pdf differ diff --git a/doc/memos/rrf/rrf-notes.pdf b/doc/memos/rrf/rrf-notes.pdf new file mode 100644 index 00000000..89b20118 Binary files /dev/null and b/doc/memos/rrf/rrf-notes.pdf differ diff --git a/doc/memos/rrf/rrf-notes.tex b/doc/memos/rrf/rrf-notes.tex new file mode 100644 index 00000000..74dd9903 --- /dev/null +++ b/doc/memos/rrf/rrf-notes.tex @@ -0,0 +1,265 @@ +\documentclass[twoside]{article} + +\usepackage[english]{babel} +\usepackage{a4} +\usepackage{amssymb} +\usepackage{graphicx} +\usepackage{fancyhdr} +\usepackage{array} +\usepackage{float} +\usepackage{hyperref} +\usepackage{xspace} +\usepackage{rotating} +\usepackage{dcolumn} +\usepackage{url} + +\setlength{\topmargin}{10mm} +\setlength{\topmargin}{-13mm} +% \setlength{\oddsidemargin}{0.5cm} +% \setlength{\evensidemargin}{0cm} +\setlength{\oddsidemargin}{1cm} +\setlength{\evensidemargin}{1cm} +\setlength{\textwidth}{14.5cm} +\setlength{\textheight}{23.8cm} + +\def\mathbi#1{\textbf{\em #1}} + +\pagestyle{fancyplain} +\addtolength{\headwidth}{0.6cm} +\fancyhead{}% +\fancyhead[RE,LO]{\bf RRF Fits}% +\fancyhead[LE,RO]{\thepage} +\cfoot{--- Andreas Suter -- \today ---} +\rfoot{\includegraphics[width=6.4cm]{PSI_Logo_wide_blau.pdf}} + +\DeclareMathAlphabet{\bi}{OML}{cmm}{b}{it} + +\newcommand{\mean}[1]{\langle #1 \rangle} +\newcommand{\lem}{LE-$\mu$SR\xspace} +\newcommand{\musr}{$\mu$SR\xspace} +\newcommand{\etal}{\emph{et al.\xspace}} +\newcommand{\ie}{\emph{i.e.\xspace}} +\newcommand{\eg}{\emph{e.g.\xspace}} + +\newcolumntype{d}[1]{D{.}{.}{#1}} + +\begin{document} + +% Header info -------------------------------------------------- +\thispagestyle{empty} +\noindent +\begin{tabular}{@{\hspace{-0.7cm}}l@{\hspace{6cm}}r} +\noindent\includegraphics[width=3.4cm]{PSI_Logo_narrow_blau.jpg} & + {\Huge\sf Memorandum} +\end{tabular} +% +\vskip 1cm +% +\begin{tabular}{@{\hspace{-0.5cm}}ll@{\hspace{4cm}}ll} +Datum: & \today & & \\[3ex] +Von: & Andreas Suter & An: & \\ +Telefon: & +41\, (0)56\, 310\, 4238 & & \\ +Raum: & WLGA / 119 & cc: & \\ +e-mail: & \verb?andreas.suter@psi.ch? & & \\ +\end{tabular} +% +\vskip 0.3cm +\noindent\hrulefill +\vskip 1cm +% +\section{Rotating Reference Frame Fits} + +High transverse field \musr (HTF-\musr) experiments will typically lead to +rather large data sets since it is necessary to follow the high frequencies +present in the positron decay histograms. Currently the HAL-9500 instrument +at PSI \cite{HAL9500} is operated with $2\time 8$ positron detector, with a +typical number of $\sim 4\times 10^5$ histogram bins. To analyze HTF-\musr +data on rather slugish computer hardware is a challenge. In the last millennium +the people invented the rotating reference frame transformation (RRF) \cite{Riseman90} +to reduce to data sets to be handled. + +Here I will shortly describe the ways how it is implemented in \textsc{Musrfit}, +and why it should be avoided to be used altogether. The starting point of all +is given by the positron decay spectrum which formally takes the form + +\begin{equation}\label{eq:positron_decay_spectrum} + N^{(j)}(t) = N_0^{(j)} \exp(-t / \tau_\mu) \, \left[ 1 + A^{(j)}(t) \right] + N_{\rm bkg}^{(j)}, +\end{equation} + +\noindent where $(j)$ is the index of the positron counter, $N_0$ gives the scale +of recorded positrons, $\tau_\mu$ is the muon lifetime, $A(t)$ the asymmetry, and $N_{\rm bkg}$ +describes the background due to uncorrelated events. + +The idea behind the RRF is twofolded: (i) try to extract $A(t)$, and (ii) shift the high frequency +data set $A(t)$ to lower frequencies such that the number of necessary bins needed can be +reduced (packing / rebinning), and hence the overall number of bins is much smaller. + +As I will try to explain, this is not for free, and there are problems arising from +this kind of data treatment. + +\subsection{Single Histogram RRF Implementation} + +In a first step the asymmetry needs to be determined. This is done the following way: +\begin{enumerate} + \item Determine the background, $N_{\rm bkg}$, at times before $t_0$ ($t_0$ is the time of the muon + implantation). Hopefully the background before and after $t_0$ is equal, which is not always + the case. + \item Multiple the background corrected histogram with $\exp(+t / \tau_\mu)$, this is leading to +\end{enumerate} + +\begin{equation}\label{eq:Mt} + M(t) \equiv \left[ N(t) - N_{\rm bkg} \right]\,\exp(+t / \tau_\mu) = N_0 \left[ 1 + A(t) \right]. +\end{equation} + +\begin{enumerate} + \setcounter{enumi}{2} + \item In order to extract $A(t)$ from $M(t)$, $N_0$ needs to be determined, which is almost the + most tricky part here. The idea is simple: since $A(t)$ is dominated by high frequency signals, + proper averaging over $M(t)$ should allow to determine $N_0$, assuming that $\langle A(t) \rangle = 0$. + Is this assumption always true? \emph{No!} For instance it is \emph{not} true if the averaging is preformed + over incomplete periodes of a single assumed signal. Another case where it will fail is if multiple signals + with too far apart frequencies is present, as \eg in the case of muonium. Said all this, let's come + back and try to determine $N_0$: +\end{enumerate} + +\begin{equation}\label{eq:N0estimate} + N_0 = \sum_{k=0}^{N_{\rm avg}} w_k M(t_k), +\end{equation} + +\noindent where $N_{\rm avg}$ is determined such that $N_{\rm avg} \Delta t \simeq 1 \mu$s ($\Delta t$ being the +time resolution. $1 \mu$s means averaging over many cyles). In order to get a good estimate for $N_{\rm avg}$, $N(t)$ is Fourier +transformed, and from this power spectrum the frequency with the largest amplitude is determined, $\nu_{\rm 0}$. From $\nu_0$, +$\Delta t$, the number of cycles fitting into $1 \mu$s can be determined, and from this and the time resolution $N_{\rm avg}$ +can be calculated. The weight $w_k$ is given by: + +\begin{equation} + w_k = \frac{\left[\Delta M(t_k)\right]^{-2}}{\sum_{j=0}^{N_{\rm avg}} \left[\Delta M(t_j)\right]^{-2}}, +\end{equation} + +\noindent where + +\begin{equation} + \Delta M(t) = \left[ \left(\frac{\partial M}{\partial N} \Delta N\right)^2 + + \left(\frac{\partial M}{\partial N_{\rm bkg}} \Delta N_{\rm bkg}\right)^2 \right]^{1/2} + \simeq \exp(+t/\tau_\mu) \sqrt{N(t)}. +\end{equation} + +\noindent The error estimate on $N_0$ is then + +\begin{equation}\label{eq:N0-rrf} + \Delta N_0 = \sigma_{N_0} = \sqrt{\sum_k w_k^2 \Delta M(t_k)^2}. +\end{equation} + +\noindent Having estimated $N_0$, the asymmetry can be extracted as: + +\begin{equation} + A(t) = M(t) / N_0 - 1. +\end{equation} + +\begin{enumerate} + \setcounter{enumi}{3} + \item Now the actual RRF transformation can take place: $A_{\rm rrf}(t) = 2 \times A(t) \cos(\omega_{\rm rrf} t + \phi_{\rm rrf})$. + The factor of 2 is introduced to conserve the asymmetry amplitude. The idea is the following: Fourier transform theory tells as that +\end{enumerate} + +\begin{equation} + {\cal F}\left\{2 \times A(t) \cos(\omega_{\rm rrf} t + \phi_{\rm rrf}) \right\} = + {\cal F}\left\{A(t)\right\}(\omega-\omega_{\rm rrf}) + {\cal F}\left\{A(t)\right\}(\omega+\omega_{\rm rrf}), +\end{equation} + +\noindent \ie that the Fourier spectrum of $A(t)$ is shifted down and up by $\omega - \omega_{\rm rrf}$ and $\omega + \omega_{\rm rrf}$, respectively. +In order to get rid of the high frequency part (${\cal F}\left\{A(t)\right\}(\omega+\omega_{\rm rrf})$), $A_{\rm rrf}(t)$ will be heavily over-binned, +\ie + +\begin{enumerate} + \setcounter{enumi}{4} + \item Do the rrf packing: $A_{\rm rrf}(t) \rightarrow \langle A_{\rm rrf}(t) \rangle_p$. Packing itself is a filtering of data! Especially this + kind of filter is dispersive \cite{King89}, \ie that it potentially is leading to line shape distortions. For symmetric, rather narrow + lines, this is unlikely to be a problem. However, this might be quite different for complex line shapes as in the case of vortex lattices. +\end{enumerate} + +\noindent The property $\langle A_{\rm rrf}(t) \rangle_p$ is what is fitted. The error on this property is estimated the following way: (i) the +unpacked error of $A(t)$ is: + +\begin{equation} + \Delta A(t) \simeq \frac{\exp(+t/\tau_\mu)}{N_0}\,\left[ N(t) + \left( \frac{N(t)-N_{\rm bkg}}{N_0} \right)^2 \Delta N_0^2 \right]^{1/2}, +\end{equation} + +\noindent and form this the packed $A_{\rm rrf}(t)$ error can be calculated. + +\subsection{Asymmetry RRF Implementation} + +\begin{enumerate} + \item In order to circumvent the difficulties to estimate $N_0$ the asymmetry of the starting positron histograms is formed. For details + see \cite{musrfit_userManual15}. For this, positron detectors geometrically under $180^\circ$ are used. However, due the the spiraling + of the positron in sufficiently high magnetic fields, and the uncertainties of the $t_0$'s, the geometrical phase might \emph{not} + correspond to the positron signal phase! At $B=9$T the uncertainty in $t_0$ by one channel leads to a phase shift of + $\gamma_\mu B \Delta t \cdot (180 / \pi) = 1.7^\circ$. Fig.\ref{fig:hal-9500-t0} shows the $t_0$-region of a typical HAL-9500 spectrum. + It shows that it is very hard to get the absolut value of $t_0$ right. + \item Carry out the RRF transformation $A_{\rm rrf}(t) = 2 \times A(t) \cos(\omega_{\rm rrf} t + \phi_{\rm rrf})$. + \item Do the rrf packing. +\end{enumerate} + +\begin{figure}[h] + \centering + \includegraphics[width=0.5\textwidth]{HAL-9500-t0.pdf} + \caption{The $t_0$ region of a typical HAL-9500 spectrum. The broad black hump with the green line, is the ``prompt'' peak. + It is \emph{not} straight forward how to define $t_0$.}\label{fig:hal-9500-t0} +\end{figure} + + +\section{Discussion} + +Both RRF transformation sketched above have weak points which makes it hard to estimate systematic errors. Both methods will fail at too +low fields of $\lesssim 1$T. The only and single purpose of the RRF transformation is slughish computer power! We developed GPU based fitting +which overcomes \emph{all} this uncontrolled weaknesses and henceforth RRF could be omitted altogether. I still added it for the time being, +since strong GPU/CPU hardware is still a bit costly and therefore not affordable to everyone. + +In order to give a feeling about what might go ``wrong'' with the RRF, I was running a couple of test cases. The chosen asymmetry is + +\begin{equation}\label{eq:asymmetry-simulation} + A^{(j)}(t) = A_0^{(j)} \sum_{k=1}^3 f_k \exp\left[-0.5\cdot (\sigma_k t)^2 \right] \cos(\gamma_\mu B_k t + \phi^{(j)}), +\end{equation} + +\noindent with values found in Tab.\ref{tab:asymmetry-parameters}. For the simulation 4 positron detector signals were generated with +$A_0^{(j)} = \left\{ 0.2554, 0.2574, 0.2576, 0.2566 \right\}$. The further ingredients were: $N_0^{(j)} = \left\{ 27.0, 25.3, 25.6, 26.9 \right\}$, +$N_{\rm bkg}^{(j)} = \left\{ 0.055, 0.060, 0.069, 0.064 \right\}$, and $ \phi^{(j)} = \left\{ 5.0, 95.0, 185.0, 275.0 \right\}$. + +\begin{table}[h] + \centering + \begin{tabular}{c|c|c|c} + $k$ & $f_k$ & $\sigma_k$ & $B_k$ \\ + & & ($1/\mu$s) & (T) \\ \hline\hline + 1 & 0.5 & 7 & $1$ or $9$ \\ + 2 & 0.2 & 0.75 & $1.02$ or $9.02$ \\ + 3 & 0.3 & 0.25 & $1.06$ or $9.06$ + \end{tabular} + \caption{Parameters used in Eq.(\ref{eq:asymmetry-simulation}).}\label{tab:asymmetry-parameters} +\end{table} + +\begin{figure}[h] + \centering + \includegraphics[width=0.45\textwidth]{08011-Fourier-Averaged.pdf} \quad + \includegraphics[width=0.45\textwidth]{08011-RRF-Histo-Fourier-Averaged-Ghost.pdf} \\ + \includegraphics[width=0.45\textwidth]{08011-RRF-Asym-Fourier-Averaged-Ghost.pdf} + \caption{Averaged Fourier power spectra. Top left: from single histogram fit for the 1T data set. + Top right: from single histogram RRF fit. Bottom: from asymmetry RRF fit. Both RRF + sets show ghost lines.}\label{fig:08011-Fourier} +\end{figure} + +Figure.\ref{fig:08011-Fourier} shows the averaged Fourier power spectra for the simulated data sets at 1T. Both RRF transformation are +showing ghost lines, even for optimally chosen RRF rebinning. At higher fields this is less pronounced. The ghost lines have various origins +such as aliasing effects due to the RRF packing not prefectly suppressing the high frequency part of $A_{\rm rrf}(t)$, leakage of the RRF frequency +for not sufficently precise known $N_0$ (see Eq.(\ref{eq:N0-rrf})) for single histogram RRF fits, etc. + +Fits of simulated data as described above (see Eq.(\ref{eq:asymmetry-simulation}), with fields 0.5, 1.0, 3.0, 5.0, 7.0, and 9.0T) show that above +about 1T the model parameters of the RRF fits are acceptable, but the error bars are typically about a factor 3 larger compared to single histogram +fits. The asymmetries of the RRF fits are ``substantially'' too small. The $\chi^2$ values are close to meaningless for the RRF fits, since they +are strongly depending on the RRF packing, time interval chosen, etc. + +To summaries: RRF fits can be used for online analysis if no GPU accelerator is available, but \emph{must not} be used for any final analysis! + +\bibliographystyle{amsplain} +\bibliography{rrf} + +\end{document} \ No newline at end of file diff --git a/doc/memos/rrf/rrf.bib b/doc/memos/rrf/rrf.bib new file mode 100644 index 00000000..6106f488 --- /dev/null +++ b/doc/memos/rrf/rrf.bib @@ -0,0 +1,29 @@ +@Article{ Riseman90, + title = {{The Rotating Reference Frame Transformation in $\mu$SR}}, + author = "T. M. Riseman and J. H. Brewer", + journal = "Hyperfine Interact.", + volume = "65", + year = "1990", + pages = "1107" +} + +@Misc{ HAL9500, + title = {{HAL-9500}}, + author = "", + note = {{\verb!https://www.psi.ch/smus/hal-9500!}}, +} + +@book{ King89, + Address = {New York}, + Author = {R. King and M. Ahmadi and R. Gorgui-Naguib and A. Kwabwe and M. Azimi-Sajadi}, + Edition = {1st}, + Publisher = {Plenum Press}, + Title = {Digital Filtering in one and two Dimensions}, + Year = 1989 +} + +@Misc{ musrfit_userManual15, + title = {{Musrfit User Guide}}, + author = "", + note = {{\verb!https://intranet.psi.ch/MUSR/MusrFit#A_5.3_Asymmetry_Fit!}}, +} diff --git a/src/classes/Makefile.am b/src/classes/Makefile.am index cd0cbef8..f3020253 100644 --- a/src/classes/Makefile.am +++ b/src/classes/Makefile.am @@ -15,12 +15,14 @@ h_sources = \ ../include/PMusrT0.h \ ../include/PPrepFourier.h \ ../include/PRunAsymmetry.h \ + ../include/PRunAsymmetryRRF.h \ ../include/PRunBase.h \ ../include/PRunDataHandler.h \ ../include/PRunListCollection.h \ ../include/PRunNonMusr.h \ ../include/PRunMuMinus.h \ ../include/PRunSingleHisto.h \ + ../include/PRunSingleHistoRRF.h \ ../include/PStartupHandler.h \ ../include/PTheory.h @@ -59,12 +61,14 @@ cpp_sources = \ PMusrT0.cpp \ PPrepFourier.cpp \ PRunAsymmetry.cpp \ + PRunAsymmetryRRF.cpp \ PRunBase.cpp \ PRunDataHandler.cpp \ PRunListCollection.cpp \ PRunNonMusr.cpp \ PRunMuMinus.cpp \ PRunSingleHisto.cpp \ + PRunSingleHistoRRF.cpp \ PStartupHandler.cpp \ PTheory.cpp diff --git a/src/classes/PFitter.cpp b/src/classes/PFitter.cpp index fa9b88cb..e366bda1 100644 --- a/src/classes/PFitter.cpp +++ b/src/classes/PFitter.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PFitterFcn.cpp b/src/classes/PFitterFcn.cpp index e67ac505..c6a8566a 100644 --- a/src/classes/PFitterFcn.cpp +++ b/src/classes/PFitterFcn.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -77,12 +77,16 @@ Double_t PFitterFcn::operator()(const std::vector& par) const if (fUseChi2) { // chi square value += fRunListCollection->GetSingleHistoChisq(par); + value += fRunListCollection->GetSingleHistoRRFChisq(par); value += fRunListCollection->GetAsymmetryChisq(par); + value += fRunListCollection->GetAsymmetryRRFChisq(par); value += fRunListCollection->GetMuMinusChisq(par); value += fRunListCollection->GetNonMusrChisq(par); } else { // max likelihood value += fRunListCollection->GetSingleHistoMaximumLikelihood(par); + value += fRunListCollection->GetSingleHistoRRFMaximumLikelihood(par); value += fRunListCollection->GetAsymmetryMaximumLikelihood(par); + value += fRunListCollection->GetAsymmetryRRFMaximumLikelihood(par); value += fRunListCollection->GetMuMinusMaximumLikelihood(par); value += fRunListCollection->GetNonMusrMaximumLikelihood(par); } diff --git a/src/classes/PFourier.cpp b/src/classes/PFourier.cpp index bbfbf542..ec516096 100644 --- a/src/classes/PFourier.cpp +++ b/src/classes/PFourier.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PFourierCanvas.cpp b/src/classes/PFourierCanvas.cpp index f83da656..07813ff4 100644 --- a/src/classes/PFourierCanvas.cpp +++ b/src/classes/PFourierCanvas.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PFunction.cpp b/src/classes/PFunction.cpp index 35bd9f42..951153d8 100644 --- a/src/classes/PFunction.cpp +++ b/src/classes/PFunction.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PFunctionHandler.cpp b/src/classes/PFunctionHandler.cpp index a7ac7e6b..de8abaa5 100644 --- a/src/classes/PFunctionHandler.cpp +++ b/src/classes/PFunctionHandler.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PMsr2Data.cpp b/src/classes/PMsr2Data.cpp index d00cd073..f5e19160 100644 --- a/src/classes/PMsr2Data.cpp +++ b/src/classes/PMsr2Data.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2009-2015 by Bastian M. Wojek / Andreas Suter * + * Copyright (C) 2009-2016 by Bastian M. Wojek / Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PMsrHandler.cpp b/src/classes/PMsrHandler.cpp index 8ce87844..d6d4e049 100644 --- a/src/classes/PMsrHandler.cpp +++ b/src/classes/PMsrHandler.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -311,6 +311,11 @@ Int_t PMsrHandler::ReadMsrFile() if (!CheckAddRunParameters()) result = PMUSR_MSR_SYNTAX_ERROR; + // check that if RRF settings are present, the RUN block settings do correspond + if (result == PMUSR_SUCCESS) + if (!CheckRRFSettings()) + result = PMUSR_MSR_SYNTAX_ERROR; + if (result == PMUSR_SUCCESS) { CheckMaxLikelihood(); // check if the user wants to use max likelihood with asymmetry/non-muSR fit (which is not implemented) CheckLegacyLifetimecorrection(); // check if lifetimecorrection is found in RUN blocks, if yes transfer it to PLOT blocks @@ -348,7 +353,7 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) { const UInt_t prec = 6; // default output precision for float/doubles UInt_t neededPrec = 0; - UInt_t neededWidth = 9; + UInt_t neededWidth = 9; Int_t tag, lineNo = 0, number; Int_t runNo = -1, addRunNo = 0; @@ -612,9 +617,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) case MSR_FITTYPE_SINGLE_HISTO: fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl; + break; case MSR_FITTYPE_ASYM: fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; break; + case MSR_FITTYPE_ASYM_RRF: + fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ; + break; case MSR_FITTYPE_MU_MINUS: fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; break; @@ -624,6 +635,27 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) default: break; } + } else if (sstr.BeginsWith("rrf_freq", TString::kIgnoreCase) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << left << "rrf_freq "; + fout.width(8); + neededPrec = LastSignificant(fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()),10); + fout.precision(neededPrec); + fout << left << fixed << fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()); + fout << " " << fGlobal.GetRRFUnit(); + fout << endl; + } else if (sstr.BeginsWith("rrf_phase", TString::kIgnoreCase) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << "rrf_phase "; + fout.width(8); + fout << left << fGlobal.GetRRFPhase(); + fout << endl; + } else if (sstr.BeginsWith("rrf_packing", TString::kIgnoreCase) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << "rrf_packing "; + fout.width(8); + fout << left << fGlobal.GetRRFPacking(); + fout << endl; } else if (sstr.BeginsWith("data")) { fout.width(16); fout << left << "data"; @@ -749,9 +781,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) case MSR_FITTYPE_SINGLE_HISTO: fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl; + break; case MSR_FITTYPE_ASYM: fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; break; + case MSR_FITTYPE_ASYM_RRF: + fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ; + break; case MSR_FITTYPE_MU_MINUS: fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; break; @@ -1107,9 +1145,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages) case MSR_PLOT_SINGLE_HISTO: fout << "PLOT " << fPlots[plotNo].fPlotType << " (single histo plot)" << endl; break; + case MSR_PLOT_SINGLE_HISTO_RRF: + fout << "PLOT " << fPlots[plotNo].fPlotType << " (single histo RRF plot)" << endl; + break; case MSR_PLOT_ASYM: fout << "PLOT " << fPlots[plotNo].fPlotType << " (asymmetry plot)" << endl; break; + case MSR_PLOT_ASYM_RRF: + fout << "PLOT " << fPlots[plotNo].fPlotType << " (asymmetry RRF plot)" << endl; + break; case MSR_PLOT_MU_MINUS: fout << "PLOT " << fPlots[plotNo].fPlotType << " (mu minus plot)" << endl; break; @@ -1604,9 +1648,15 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co case MSR_FITTYPE_SINGLE_HISTO: fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl; + break; case MSR_FITTYPE_ASYM: fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; break; + case MSR_FITTYPE_ASYM_RRF: + fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ; + break; case MSR_FITTYPE_MU_MINUS: fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; break; @@ -1618,6 +1668,30 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co } } + // RRF related stuff + if ((fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) > 0.0) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << left << "rrf_freq "; + fout.width(8); + fout << left << fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()); + fout << " " << fGlobal.GetRRFUnit(); + fout << endl; + } + if ((fGlobal.GetRRFPhase() != 0.0) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << "rrf_phase "; + fout.width(8); + fout << left << fGlobal.GetRRFPhase(); + fout << endl; + } + if ((fGlobal.GetRRFPacking() != -1) && (fGlobal.GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { + fout.width(16); + fout << "rrf_packing "; + fout.width(8); + fout << left << fGlobal.GetRRFPacking(); + fout << endl; + } + // data range if ((fGlobal.GetDataRange(0) != -1) || (fGlobal.GetDataRange(1) != -1) || (fGlobal.GetDataRange(2) != -1) || (fGlobal.GetDataRange(3) != -1)) { fout.width(16); @@ -1765,9 +1839,15 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co case MSR_FITTYPE_SINGLE_HISTO: fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO << " (single histogram fit)" << endl; break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + fout << left << "fittype" << MSR_FITTYPE_SINGLE_HISTO_RRF << " (single histogram RRF fit)" << endl; + break; case MSR_FITTYPE_ASYM: fout << left << "fittype" << MSR_FITTYPE_ASYM << " (asymmetry fit)" << endl ; break; + case MSR_FITTYPE_ASYM_RRF: + fout << left << "fittype" << MSR_FITTYPE_ASYM_RRF << " (asymmetry RRF fit)" << endl ; + break; case MSR_FITTYPE_MU_MINUS: fout << left << "fittype" << MSR_FITTYPE_MU_MINUS << " (mu minus fit)" << endl ; break; @@ -2108,9 +2188,15 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map *co case MSR_PLOT_SINGLE_HISTO: fout << "PLOT " << fPlots[i].fPlotType << " (single histo plot)" << endl; break; + case MSR_PLOT_SINGLE_HISTO_RRF: + fout << "PLOT " << fPlots[i].fPlotType << " (single histo RRF plot)" << endl; + break; case MSR_PLOT_ASYM: fout << "PLOT " << fPlots[i].fPlotType << " (asymmetry plot)" << endl; break; + case MSR_PLOT_ASYM_RRF: + fout << "PLOT " << fPlots[i].fPlotType << " (asymmetry RRF plot)" << endl; + break; case MSR_PLOT_MU_MINUS: fout << "PLOT " << fPlots[i].fPlotType << " (mu minus plot)" << endl; break; @@ -2796,8 +2882,8 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines) TString str; TObjArray *tokens = 0; TObjString *ostr = 0; - Int_t ival; - Double_t dval; + Int_t ival = 0; + Double_t dval = 0.0; UInt_t addT0Counter = 0; // since this routine is called, a GLOBAL block is present @@ -2828,7 +2914,9 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines) if (str.IsDigit()) { Int_t fittype = str.Atoi(); if ((fittype == MSR_FITTYPE_SINGLE_HISTO) || + (fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) || (fittype == MSR_FITTYPE_ASYM) || + (fittype == MSR_FITTYPE_ASYM_RRF) || (fittype == MSR_FITTYPE_MU_MINUS) || (fittype == MSR_FITTYPE_NON_MUSR)) { global.SetFitType(fittype); @@ -2839,6 +2927,55 @@ Bool_t PMsrHandler::HandleGlobalEntry(PMsrLines &lines) error = true; } } + } else if (iter->fLine.BeginsWith("rrf_freq", TString::kIgnoreCase)) { + if (tokens->GetEntries() < 3) { + error = true; + } else { + ostr = dynamic_cast(tokens->At(1)); + str = ostr->GetString(); + if (str.IsFloat()) { + dval = str.Atof(); + if (dval <= 0.0) + error = true; + } + if (!error) { + ostr = dynamic_cast(tokens->At(2)); + str = ostr->GetString(); + global.SetRRFFreq(dval, str.Data()); + if (global.GetRRFFreq(str.Data()) == RRF_FREQ_UNDEF) + error = true; + } + } + } else if (iter->fLine.BeginsWith("rrf_packing", TString::kIgnoreCase)) { + if (tokens->GetEntries() < 2) { + error = true; + } else { + ostr = dynamic_cast(tokens->At(1)); + str = ostr->GetString(); + if (str.IsDigit()) { + ival = str.Atoi(); + if (ival > 0) { + global.SetRRFPacking(ival); + } else { + error = true; + } + } else { + error = true; + } + } + } else if (iter->fLine.BeginsWith("rrf_phase", TString::kIgnoreCase)) { + if (tokens->GetEntries() < 2) { + error = true; + } else { + ostr = dynamic_cast(tokens->At(1)); + str = ostr->GetString(); + if (str.IsFloat()) { + dval = str.Atof(); + global.SetRRFPhase(dval); + } else { + error = true; + } + } } else if (iter->fLine.BeginsWith("data", TString::kIgnoreCase)) { // data if (tokens->GetEntries() < 3) { error = true; @@ -3113,7 +3250,9 @@ Bool_t PMsrHandler::HandleRunEntry(PMsrLines &lines) if (str.IsDigit()) { Int_t fittype = str.Atoi(); if ((fittype == MSR_FITTYPE_SINGLE_HISTO) || + (fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) || (fittype == MSR_FITTYPE_ASYM) || + (fittype == MSR_FITTYPE_ASYM_RRF) || (fittype == MSR_FITTYPE_MU_MINUS) || (fittype == MSR_FITTYPE_NON_MUSR)) { param.SetFitType(fittype); @@ -4027,7 +4166,9 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines) error = true; break; case MSR_PLOT_SINGLE_HISTO: // like: runs 1 5 13 + case MSR_PLOT_SINGLE_HISTO_RRF: case MSR_PLOT_ASYM: + case MSR_PLOT_ASYM_RRF: case MSR_PLOT_NON_MUSR: case MSR_PLOT_MU_MINUS: rl = new PStringNumberList(iter1->fLine.Data()); @@ -4439,8 +4580,10 @@ Bool_t PMsrHandler::HandlePlotEntry(PMsrLines &lines) cerr << endl << ">> [use_fit_ranges [ymin ymax]]"; cerr << endl << ">> [view_packing n]"; cerr << endl; - cerr << endl << ">> where is: 0=single histo asym,"; + cerr << endl << ">> where is: 0=single histo,"; + cerr << endl << ">> 1=RRF single histo,"; cerr << endl << ">> 2=forward-backward asym,"; + cerr << endl << ">> 3=forward-backward RRF asym,"; cerr << endl << ">> 4=mu minus single histo,"; cerr << endl << ">> 8=non muSR."; cerr << endl << ">> is the list of runs, e.g. runs 1 3"; @@ -5193,6 +5336,53 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity() fRuns[i].SetPacking(1); } break; + case PRUN_SINGLE_HISTO_RRF: + // check that there is a forward parameter number + if (fRuns[i].GetForwardHistoNo() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> forward parameter number not defined. Necessary for single histogram RRF fits." << endl; + return false; + } + if ((fRuns[i].GetNormParamNo() > static_cast(fParam.size())) && !fFourierOnly) { + // check if forward histogram number is a function + if (fRuns[i].GetNormParamNo() - MSR_PARAM_FUN_OFFSET > static_cast(fParam.size())) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> forward histogram number " << fRuns[i].GetNormParamNo() << " is larger than the number of fit parameters (" << fParam.size() << ")."; + cerr << endl << ">> Consider to check the manual ;-)" << endl; + return false; + } + } + // check fit range + if (!fRuns[i].IsFitRangeInBin() && !fFourierOnly) { // fit range given as times in usec (RUN block) + if ((fRuns[i].GetFitRange(0) == PMUSR_UNDEFINED) || (fRuns[i].GetFitRange(1) == PMUSR_UNDEFINED)) { // check fit range in RUN block + if (!fGlobal.IsFitRangeInBin()) { // fit range given as times in usec (GLOBAL block) + if ((fGlobal.GetFitRange(0) == PMUSR_UNDEFINED) || (fGlobal.GetFitRange(1) == PMUSR_UNDEFINED)) { // check fit range in GLOBAL block + cerr << endl << "PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << " Fit range is not defined. Necessary for single histogram fits." << endl; + return false; + } + } + } + } + // check number of T0's provided + if ((fRuns[i].GetT0BinSize() > fRuns[i].GetForwardHistoNoSize()) && + (fGlobal.GetT0BinSize() > fRuns[i].GetForwardHistoNoSize())) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> Found " << fRuns[i].GetT0BinSize() << " T0 entries. Expecting only " << fRuns[i].GetForwardHistoNoSize() << ". Needs to be fixed." << endl; + cerr << endl << ">> In GLOBAL block: " << fGlobal.GetT0BinSize() << " T0 entries. Expecting only " << fRuns[i].GetForwardHistoNoSize() << ". Needs to be fixed." << endl; + return false; + } + // check that RRF frequency is given + if (fGlobal.GetRRFUnitTag() == RRF_UNIT_UNDEF) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** no RRF frequency found in the GLOBAL block." << endl; + return false; + } + // check that RRF packing is given + if (fGlobal.GetRRFPacking() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** no RRF packing found in the GLOBAL block." << endl; + return false; + } + break; case PRUN_ASYMMETRY: // check alpha if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) { @@ -5245,6 +5435,62 @@ Bool_t PMsrHandler::CheckRunBlockIntegrity() fRuns[i].SetPacking(1); } break; + case PRUN_ASYMMETRY_RRF: + // check alpha + if ((fRuns[i].GetAlphaParamNo() == -1) && !fFourierOnly) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> alpha parameter number missing which is needed for an asymmetry RRF fit."; + cerr << endl << ">> Consider to check the manual ;-)" << endl; + return false; + } + // check that there is a forward parameter number + if (fRuns[i].GetForwardHistoNo() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> forward histogram number not defined. Necessary for asymmetry RRF fits." << endl; + return false; + } + // check that there is a backward parameter number + if (fRuns[i].GetBackwardHistoNo() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> backward histogram number not defined. Necessary for asymmetry RRF fits." << endl; + return false; + } + // check fit range + if (!fRuns[i].IsFitRangeInBin()) { // fit range given as times in usec + if ((fRuns[i].GetFitRange(0) == PMUSR_UNDEFINED) || (fRuns[i].GetFitRange(1) == PMUSR_UNDEFINED)) { + if ((fGlobal.GetFitRange(0) == PMUSR_UNDEFINED) || (fGlobal.GetFitRange(1) == PMUSR_UNDEFINED)) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> Fit range is not defined, also NOT present in the GLOBAL block. Necessary for asymmetry RRF fits." << endl; + return false; + } + } + } + // check number of T0's provided + if ((fRuns[i].GetT0BinSize() > 2*fRuns[i].GetForwardHistoNoSize()) && + (fGlobal.GetT0BinSize() > 2*fRuns[i].GetForwardHistoNoSize())) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> Found " << fRuns[i].GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetForwardHistoNoSize() << " in forward. Needs to be fixed." << endl; + cerr << endl << ">> In GLOBAL block: " << fGlobal.GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetForwardHistoNoSize() << ". Needs to be fixed." << endl; + return false; + } + if ((fRuns[i].GetT0BinSize() > 2*fRuns[i].GetBackwardHistoNoSize()) && + (fGlobal.GetT0BinSize() > 2*fRuns[i].GetBackwardHistoNoSize())) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** in RUN block number " << i+1; + cerr << endl << ">> Found " << fRuns[i].GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetBackwardHistoNoSize() << " in backward. Needs to be fixed." << endl; + cerr << endl << ">> In GLOBAL block: " << fGlobal.GetT0BinSize() << " T0 entries. Expecting only " << 2*fRuns[i].GetBackwardHistoNoSize() << ". Needs to be fixed." << endl; + return false; + } + // check that RRF frequency is given + if (fGlobal.GetRRFUnitTag() == RRF_UNIT_UNDEF) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** no RRF frequency found in the GLOBAL block." << endl; + return false; + } + // check that RRF packing is given + if (fGlobal.GetRRFPacking() == -1) { + cerr << endl << ">> PMsrHandler::CheckRunBlockIntegrity(): **ERROR** no RRF packing found in the GLOBAL block." << endl; + return false; + } + break; case PRUN_MU_MINUS: // needs eventually to be implemented break; @@ -5631,6 +5877,103 @@ void PMsrHandler::CheckMaxLikelihood() } } +//-------------------------------------------------------------------------- +// CheckRRFSettings (public) +//-------------------------------------------------------------------------- +/** + *

Make sure that if RRF settings are found in the GLOBAL section, the fit types + * in the RUN blocks correspond. + */ +Bool_t PMsrHandler::CheckRRFSettings() +{ + Bool_t result = true; + Int_t fittype = fGlobal.GetFitType(); + + // first set of tests: if RRF parameters are set, check if RRF fit is chosen. + if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) != RRF_FREQ_UNDEF) { + if (fittype != -1) { // check if GLOBAL fittype is set + if ((fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) && + (fittype != MSR_FITTYPE_ASYM_RRF)) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** found GLOBAL fittype " << fittype << " and"; + cerr << endl << ">> RRF settings in the GLOBAL section. This is NOT compatible. Fix it first."; + result = false; + } + } else { // GLOBAL fittype is NOT set + for (UInt_t i=0; i> PMsrHandler::CheckRRFSettings: **ERROR** found RUN with fittype " << fittype << " and"; + cerr << endl << ">> RRF settings in the GLOBAL section. This is NOT compatible. Fix it first."; + result = false; + break; + } + } + } + } else { + if (fGlobal.GetRRFPacking() != -1) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **WARNING** found in the GLOBAL section rrf_packing, without"; + cerr << endl << ">> rrf_freq. Doesn't make any sense. Will drop rrf_packing"; + cerr << endl << endl; + fGlobal.SetRRFPacking(-1); + } + if (fGlobal.GetRRFPhase() != 0.0) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **WARNING** found in the GLOBAL section rrf_phase, without"; + cerr << endl << ">> rrf_freq. Doesn't make any sense. Will drop rrf_phase"; + cerr << endl << endl; + fGlobal.SetRRFPhase(0.0); + } + } + + // if not a RRF fit, done at this point + if ((fittype != MSR_FITTYPE_SINGLE_HISTO_RRF) && + (fittype != MSR_FITTYPE_ASYM_RRF)) { + return true; + } + + // second set of tests: if RRF fit is chosen, do I find the necessary RRF parameters? + fittype = fGlobal.GetFitType(); + if ((fittype == MSR_FITTYPE_SINGLE_HISTO_RRF) || + (fittype == MSR_FITTYPE_ASYM_RRF)) { // make sure RRF freq and RRF packing are set + if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == RRF_FREQ_UNDEF) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but"; + cerr << endl << ">> no RRF frequency found in the GLOBAL section! Fix it."; + return false; + } + if (fGlobal.GetRRFPacking() == -1) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but"; + cerr << endl << ">> no RRF packing found in the GLOBAL section! Fix it."; + return false; + } + } else { // check single runs for RRF + UInt_t rrfFitCounter = 0; + for (UInt_t i=0; i> PMsrHandler::CheckRRFSettings: **ERROR** #Runs (" << fRuns.size() << ") != # RRF fits found (" << rrfFitCounter << ")"; + cerr << endl << ">> This is currently not supported."; + return false; + } + if (fGlobal.GetRRFFreq(fGlobal.GetRRFUnit().Data()) == RRF_FREQ_UNDEF) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but"; + cerr << endl << ">> no RRF frequency found in the GLOBAL section! Fix it."; + return false; + } + if (fGlobal.GetRRFPacking() == -1) { + cerr << endl << ">> PMsrHandler::CheckRRFSettings: **ERROR** RRF fit chosen, but"; + cerr << endl << ">> no RRF packing found in the GLOBAL section! Fix it."; + return false; + } + } + + return result; +} + //-------------------------------------------------------------------------- // GetGroupingString (public) //-------------------------------------------------------------------------- diff --git a/src/classes/PMusr.cpp b/src/classes/PMusr.cpp index 478db109..a84f4765 100644 --- a/src/classes/PMusr.cpp +++ b/src/classes/PMusr.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -34,6 +34,8 @@ using namespace std; #include using namespace boost; +#include "TMath.h" + #include "PMusr.h" //+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ @@ -708,6 +710,10 @@ void PRawRunData::SetTempError(const UInt_t idx, const Double_t errTemp) PMsrGlobalBlock::PMsrGlobalBlock() { fGlobalPresent = false; + fRRFFreq = RRF_FREQ_UNDEF; // rotating reference frequency in units given by fRRFUnitTag. Only needed for fittype 1 + fRRFUnitTag = RRF_UNIT_UNDEF; // RRF unit tag. Default: undefined + fRRFPhase = 0.0; + fRRFPacking = -1; // undefined RRF packing/rebinning fFitType = -1; // undefined fit type for (UInt_t i=0; i<4; i++) { fDataRange[i] = -1; // undefined data bin range @@ -720,6 +726,135 @@ PMsrGlobalBlock::PMsrGlobalBlock() fPacking = -1; // undefined packing/rebinning } +//-------------------------------------------------------------------------- +// GetRRFFreq (public) +//-------------------------------------------------------------------------- +/** + *

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

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

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

set RRF packing. + * + * \param RRF packing + */ +void PMsrGlobalBlock::SetRRFPacking(Int_t pack) +{ + if (pack <= 0) { + cerr << endl << "PMsrGlobalBlock::SetRRFPacking: **WARNING** found RRF packing <= 0. Likely doesn't make any sense." << endl; + fRRFPacking = -1; // set to undefined + } + + fRRFPacking = pack; +} + //-------------------------------------------------------------------------- // GetDataRange (public) //-------------------------------------------------------------------------- diff --git a/src/classes/PMusrCanvas.cpp b/src/classes/PMusrCanvas.cpp index e34486bf..ec99e93a 100644 --- a/src/classes/PMusrCanvas.cpp +++ b/src/classes/PMusrCanvas.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -75,7 +75,7 @@ PMusrCanvasPlotRange::PMusrCanvasPlotRange() void PMusrCanvasPlotRange::SetXRange(Double_t xmin, Double_t xmax) { if (xmin > xmax) { - cerr << endl << "PMusrCanvasPlotRange::SetXRange: **WARNING** xmin > xmax, will swap them." << endl; + cerr << endl << ">> PMusrCanvasPlotRange::SetXRange(): **WARNING** xmin > xmax, will swap them." << endl; fXmin = xmax; fXmax = xmin; } else { @@ -97,7 +97,7 @@ void PMusrCanvasPlotRange::SetXRange(Double_t xmin, Double_t xmax) void PMusrCanvasPlotRange::SetYRange(Double_t ymin, Double_t ymax) { if (ymin > ymax) { - cerr << endl << "PMusrCanvasPlotRange::SetYRange: **WARNING** ymin > ymax, will swap them." << endl; + cerr << endl << ">> PMusrCanvasPlotRange::SetYRange(): **WARNING** ymin > ymax, will swap them." << endl; fYmin = ymax; fYmax = ymin; } else { @@ -405,37 +405,76 @@ void PMusrCanvas::SetMsrHandler(PMsrHandler *msrHandler) } // check if RRF data are present - if ((fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) && - (fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq != 0.0)) { + if (((fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) && + (fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq != 0.0)) || + (fMsrHandler->GetMsrGlobal()->GetRRFPacking() > 0 && + fMsrHandler->GetMsrGlobal()->GetRRFUnit().CompareTo("??"))) { fRRFLatexText = new TLatex(); fRRFLatexText->SetNDC(kTRUE); fRRFLatexText->SetTextFont(62); fRRFLatexText->SetTextSize(0.03); - fRRFText = new TString("RRF: "); - if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_kHz) { - *fRRFText += TString("#nu_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (kHz)"); - } else if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_MHz) { - *fRRFText += TString("#nu_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (MHz)"); - } else if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_Mcs) { - *fRRFText += TString("#omega_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (Mc/s)"); - } else if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_G) { - *fRRFText += TString("B_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (G)"); - } else if (fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit == RRF_UNIT_T) { - *fRRFText += TString("B_{RRF} = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; - *fRRFText += TString(" (T)"); + Int_t rrfUnitTag = -1; + Double_t rrfFreq = 0.0; + if (fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking > 0) { // RRF single histo PLOT + fRRFText = new TString("RRF: "); + rrfUnitTag = fMsrHandler->GetMsrPlotList()->at(0).fRRFUnit; + rrfFreq = fMsrHandler->GetMsrPlotList()->at(0).fRRFFreq; + TString rrfFreqStr(""); + rrfFreqStr.Form("%.5g", rrfFreq); + if (rrfUnitTag == RRF_UNIT_kHz) { + *fRRFText += TString("#nu_{RRF} = "); + *fRRFText += rrfFreq; + *fRRFText += TString(" (kHz)"); + } else if (rrfUnitTag == RRF_UNIT_MHz) { + *fRRFText += TString("#nu_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (MHz)"); + } else if (rrfUnitTag == RRF_UNIT_Mcs) { + *fRRFText += TString("#omega_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (Mc/s)"); + } else if (rrfUnitTag == RRF_UNIT_G) { + *fRRFText += TString("B_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (G)"); + } else if (rrfUnitTag == RRF_UNIT_T) { + *fRRFText += TString("B_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (T)"); + } + *fRRFText += TString(", RRF packing = "); + *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking; + } else { // RRF single histo FIT + fRRFText = new TString("RRF: "); + rrfUnitTag = fMsrHandler->GetMsrGlobal()->GetRRFUnitTag(); + rrfFreq = fMsrHandler->GetMsrGlobal()->GetRRFFreq(fMsrHandler->GetMsrGlobal()->GetRRFUnit().Data()); + TString rrfFreqStr(""); + rrfFreqStr.Form("%.5g", rrfFreq); + if (rrfUnitTag == RRF_UNIT_kHz) { + *fRRFText += TString("#nu_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (kHz)"); + } else if (rrfUnitTag == RRF_UNIT_MHz) { + *fRRFText += TString("#nu_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (MHz)"); + } else if (rrfUnitTag == RRF_UNIT_Mcs) { + *fRRFText += TString("#omega_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (Mc/s)"); + } else if (rrfUnitTag == RRF_UNIT_G) { + *fRRFText += TString("B_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (G)"); + } else if (rrfUnitTag == RRF_UNIT_T) { + *fRRFText += TString("B_{RRF} = "); + *fRRFText += rrfFreqStr; + *fRRFText += TString(" (T)"); + } + *fRRFText += TString(", RRF packing = "); + *fRRFText += fMsrHandler->GetMsrGlobal()->GetRRFPacking(); } - *fRRFText += TString(", RRF packing = "); - *fRRFText += fMsrHandler->GetMsrPlotList()->at(0).fRRFPacking; } } @@ -609,7 +648,7 @@ void PMusrCanvas::UpdateDataTheoryPad() // first check that plot number is smaller than the maximal number of runs if ((Int_t)plotInfo.fRuns[i] > (Int_t)runs.size()) { fValid = false; - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** run plot number " << (Int_t)plotInfo.fRuns[i] << " is larger than the number of runs " << runs.size(); + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** run plot number " << (Int_t)plotInfo.fRuns[i] << " is larger than the number of runs " << runs.size(); cerr << endl; return; } @@ -620,7 +659,7 @@ void PMusrCanvas::UpdateDataTheoryPad() } if (fitType == -1) { fValid = false; - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** plottype = " << fPlotType; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** plottype = " << fPlotType; cerr << ", fittype = " << runs[runNo].GetFitType() << "(RUN block)/"; cerr << "fittype = " << globalBlock->GetFitType() << "(GLOBAL block). However, they have to correspond!"; cerr << endl; @@ -643,7 +682,19 @@ void PMusrCanvas::UpdateDataTheoryPad() if (!data) { // something wrong fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** couldn't obtain run no " << runNo << " for a single histogram plot"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a single histogram plot"; + cerr << endl; + return; + } + // handle data + HandleDataSet(i, runNo, data); + break; + case MSR_FITTYPE_SINGLE_HISTO_RRF: + data = fRunList->GetSingleHistoRRF(runNo, PRunListCollection::kRunNo); + if (!data) { // something wrong + fValid = false; + // error message + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a single histogram RRF plot"; cerr << endl; return; } @@ -655,7 +706,19 @@ void PMusrCanvas::UpdateDataTheoryPad() if (!data) { // something wrong fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** couldn't obtain run no " << runNo << " for a asymmetry plot"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a asymmetry plot"; + cerr << endl; + return; + } + // handle data + HandleDataSet(i, runNo, data); + break; + case MSR_FITTYPE_ASYM_RRF: + data = fRunList->GetAsymmetryRRF(runNo, PRunListCollection::kRunNo); + if (!data) { // something wrong + fValid = false; + // error message + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a asymmetry RRF plot"; cerr << endl; return; } @@ -667,7 +730,7 @@ void PMusrCanvas::UpdateDataTheoryPad() if (!data) { // something wrong fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** couldn't obtain run no " << runNo << " for a mu minus single histogram plot"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a mu minus single histogram plot"; cerr << endl; return; } @@ -679,7 +742,7 @@ void PMusrCanvas::UpdateDataTheoryPad() if (!data) { // something wrong fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** couldn't obtain run no " << runNo << " for a none musr data plot"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** couldn't obtain run no " << runNo << " for a none musr data plot"; cerr << endl; return; } @@ -699,7 +762,7 @@ void PMusrCanvas::UpdateDataTheoryPad() default: fValid = false; // error message - cerr << endl << "PMusrCanvas::UpdateDataTheoryPad: **ERROR** wrong plottype tag?!"; + cerr << endl << ">> PMusrCanvas::UpdateDataTheoryPad(): **ERROR** wrong plottype tag?!"; cerr << endl; return; break; @@ -822,13 +885,15 @@ void PMusrCanvas::UpdateInfoPad() else tstr = *runs[runNo].GetRunName() + TString(","); // run_name // histo info (depending on the fittype - if (runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO) { + if ((runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO) || + (runs[runNo].GetFitType() == MSR_FITTYPE_SINGLE_HISTO_RRF)) { tstr += TString("h:"); TString grouping; fMsrHandler->GetGroupingString(runNo, "forward", grouping); tstr += grouping; tstr += TString(","); - } else if (runs[runNo].GetFitType() == MSR_FITTYPE_ASYM) { + } else if ((runs[runNo].GetFitType() == MSR_FITTYPE_ASYM) || + (runs[runNo].GetFitType() == MSR_FITTYPE_ASYM_RRF)) { tstr += TString("h:"); TString grouping; fMsrHandler->GetGroupingString(runNo, "forward", grouping); @@ -1409,7 +1474,7 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat) } if (idx == -1) { - cerr << endl << "PMusrCanvas::SaveGraphicsAndQuit **ERROR**: fileName (" << fileName << ") is invalid." << endl; + cerr << endl << ">> PMusrCanvas::SaveGraphicsAndQuit(): **ERROR** fileName (" << fileName << ") is invalid." << endl; return; } @@ -1439,7 +1504,7 @@ void PMusrCanvas::SaveGraphicsAndQuit(Char_t *fileName, Char_t *graphicsFormat) 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; + cerr << endl << ">> PMusrCanvas::ExportData(): **ERROR** NO path file name provided. Will do nothing." << endl; return; } @@ -2094,7 +2159,7 @@ void PMusrCanvas::ExportData(const Char_t *fileName) // open output data-file fout.open(fileName, iostream::out); if (!fout.is_open()) { - cerr << endl << ">> PMusrCanvas::ExportData: **ERROR** couldn't open file " << fileName << " for writing." << endl; + cerr << endl << ">> PMusrCanvas::ExportData(): **ERROR** couldn't open file " << fileName << " for writing." << endl; return; } @@ -2433,7 +2498,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, canvasName += fPlotNumber; fMainCanvas = new TCanvas(canvasName.Data(), title, wtopx, wtopy, ww, wh); if (fMainCanvas == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke " << canvasName.Data(); + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke " << canvasName.Data(); cerr << endl; return; } @@ -2479,7 +2544,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // title pad fTitlePad = new TPaveText(0.0, YTITLE, 1.0, 1.0, "NDC"); if (fTitlePad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fTitlePad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fTitlePad"; cerr << endl; return; } @@ -2491,7 +2556,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // data/theory pad fDataTheoryPad = new TPad("dataTheoryPad", "dataTheoryPad", 0.0, YINFO, XTHEO, YTITLE); if (fDataTheoryPad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fDataTheoryPad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fDataTheoryPad"; cerr << endl; return; } @@ -2501,7 +2566,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // parameter pad fParameterPad = new TPaveText(XTHEO, 0.5, 1.0, YTITLE, "NDC"); if (fParameterPad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fParameterPad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fParameterPad"; cerr << endl; return; } @@ -2512,7 +2577,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // theory pad fTheoryPad = new TPaveText(XTHEO, 0.1, 1.0, 0.5, "NDC"); if (fTheoryPad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fTheoryPad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fTheoryPad"; cerr << endl; return; } @@ -2524,7 +2589,7 @@ void PMusrCanvas::InitMusrCanvas(const Char_t* title, Int_t wtopx, Int_t wtopy, // info pad fInfoPad = new TLegend(0.0, 0.0, 1.0, YINFO, "NDC"); if (fInfoPad == 0) { - cerr << endl << "PMusrCanvas::PMusrCanvas: **PANIC ERROR**: Couldn't invoke fInfoPad"; + cerr << endl << ">> PMusrCanvas::PMusrCanvas(): **PANIC ERROR** Couldn't invoke fInfoPad"; cerr << endl; return; } @@ -2929,9 +2994,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) Double_t dval = (startFitRange - data->GetDataTimeStart())/data->GetDataTimeStep(); if (dval < 0.0) { // make sure that startBin >= 0 startBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that startBin <= length of data vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',"; cerr << endl << ">> will set it to data vector size" << endl << endl; startBin = data->GetValue()->size(); } else { @@ -2945,9 +3010,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) dval = (endFitRange - data->GetDataTimeStart())/data->GetDataTimeStep(); if (dval < 0.0) { // make sure that endBin >= 0 endBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data < 0 for 'use_fit_range', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that endBin <= length of data vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'use_fit_range',"; cerr << endl << ">> will set it to data vector size" << endl << endl; endBin = data->GetValue()->size(); } else { @@ -2960,9 +3025,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) Double_t dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep(); if (dval < 0.0) { // make sure that startBin >= 0 startBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that startBin <= length of data vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',"; cerr << endl << ">> will set it to data vector size" << endl << endl; startBin = data->GetValue()->size(); } else { @@ -2972,9 +3037,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] - data->GetDataTimeStart())/data->GetDataTimeStep(); if (dval < 0.0) { // make sure that endBin >= 0 endBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data < 0 for 'sub_ranges', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetValue()->size()) { // make sure that endtBin <= length of data vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin data=" << (UInt_t)dval << " >= data vector size=" << data->GetValue()->size() << " for 'sub_ranges',"; cerr << endl << ">> will set it to data vector size" << endl << endl; endBin = data->GetValue()->size(); } else { @@ -3061,9 +3126,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) Double_t dval = (startFitRange - data->GetDataTimeStart())/data->GetTheoryTimeStep(); if (dval < 0.0) { // make sure that startBin >= 0 startBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that startBin <= length of theory vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',"; cerr << endl << ">> will set it to theory vector size" << endl << endl; startBin = data->GetTheory()->size(); } else { @@ -3077,9 +3142,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) dval = (endFitRange - data->GetDataTimeStart())/data->GetTheoryTimeStep(); if (dval < 0.0) { // make sure that endBin >= 0 endBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory < 0 for 'use_fit_range', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that endBin <= length of theory vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'use_fit_range',"; cerr << endl << ">> will set it to theory vector size" << endl << endl; endBin = data->GetTheory()->size(); } else { @@ -3095,9 +3160,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) Double_t dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmin[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep(); if (dval < 0.0) { // make sure that startBin >= 0 startBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found startBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that startBin <= length of theory vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found startBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',"; cerr << endl << ">> will set it to theory vector size" << endl << endl; startBin = data->GetTheory()->size(); } else { @@ -3107,9 +3172,9 @@ void PMusrCanvas::HandleDataSet(UInt_t plotNo, UInt_t runNo, PRunData *data) dval = (fMsrHandler->GetMsrPlotList()->at(fPlotNumber).fTmax[runNo] -data->GetDataTimeStart())/data->GetTheoryTimeStep(); if (dval < 0.0) { // make sure that endBin >= 0 endBin = 0; - cerr << endl << "PMusrCanvas::HandleDataSet() **WARNING** found endBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory < 0 for 'sub_ranges', will set it to 0" << endl << endl; } else if (dval >= (Double_t)data->GetTheory()->size()) { // make sure that endtBin <= length of theory vector - cerr << endl << ">> PMusrCanvas::HandleDataSet() **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',"; + cerr << endl << ">> PMusrCanvas::HandleDataSet(): **WARNING** found endBin theory=" << (UInt_t)dval << " >= theory vector size=" << data->GetTheory()->size() << " for 'sub_ranges',"; cerr << endl << ">> will set it to theory vector size" << endl << endl; endBin = data->GetTheory()->size(); } else { @@ -3418,7 +3483,7 @@ void PMusrCanvas::HandleFourier() // calculate fourier transform of the data PFourier fourierData(fData[i].data, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, fFourier.fFourierPower); if (!fourierData.IsValid()) { - cerr << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier data ..." << endl; + cerr << endl << ">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier data ..." << endl; return; } fourierData.Transform(fFourier.fApodization); @@ -3458,7 +3523,7 @@ void PMusrCanvas::HandleFourier() Int_t powerPad = (Int_t)round(log((endTime-startTime)/fData[i].theory->GetBinWidth(1))/log(2))+3; PFourier fourierTheory(fData[i].theory, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, powerPad); if (!fourierTheory.IsValid()) { - cerr << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier theory ..." << endl; + cerr << endl << ">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier theory ..." << endl; return; } fourierTheory.Transform(fFourier.fApodization); @@ -3578,7 +3643,7 @@ void PMusrCanvas::HandleDifferenceFourier() // calculate fourier transform of the data PFourier fourierData(fData[i].diff, fFourier.fUnits, startTime, endTime, fFourier.fDCCorrected, fFourier.fFourierPower); if (!fourierData.IsValid()) { - cerr << endl << "**SEVERE ERROR** PMusrCanvas::HandleFourier: couldn't invoke PFourier to calculate the Fourier diff ..." << endl; + cerr << endl << ">> PMusrCanvas::HandleFourier(): **SEVERE ERROR** couldn't invoke PFourier to calculate the Fourier diff ..." << endl; return; } fourierData.Transform(fFourier.fApodization); @@ -4648,14 +4713,14 @@ void PMusrCanvas::PlotData(Bool_t unzoom) fDataTheoryPad->SetLogy(1); // set x-axis label - fHistoFrame->GetXaxis()->SetTitle("time (#mus)"); + fHistoFrame->GetXaxis()->SetTitle("Time (#mus)"); // set y-axis label TString yAxisTitle; PMsrRunList *runList = fMsrHandler->GetMsrRunList(); switch (fPlotType) { case MSR_PLOT_SINGLE_HISTO: if (runList->at(0).IsLifetimeCorrected()) { // lifetime correction - yAxisTitle = "asymmetry"; + yAxisTitle = "Asymmetry"; } else { // no liftime correction if (fScaleN0AndBkg) yAxisTitle = "N(t) per nsec"; @@ -4663,8 +4728,12 @@ void PMusrCanvas::PlotData(Bool_t unzoom) yAxisTitle = "N(t) per bin"; } break; + case MSR_PLOT_SINGLE_HISTO_RRF: + case MSR_PLOT_ASYM_RRF: + yAxisTitle = "RRF Asymmetry"; + break; case MSR_PLOT_ASYM: - yAxisTitle = "asymmetry"; + yAxisTitle = "Asymmetry"; break; case MSR_PLOT_MU_MINUS: yAxisTitle = "N(t) per bin"; @@ -6106,6 +6175,11 @@ void PMusrCanvas::PlotAverage(Bool_t unzoom) break; } + // check if RRF and if yes show a label + if ((fRRFText != 0) && (fRRFLatexText != 0)) { + fRRFLatexText->DrawLatex(0.1, 0.92, fRRFText->Data()); + } + fDataTheoryPad->Update(); fMainCanvas->cd(); diff --git a/src/classes/PMusrT0.cpp b/src/classes/PMusrT0.cpp index dfedb61d..c13414fc 100644 --- a/src/classes/PMusrT0.cpp +++ b/src/classes/PMusrT0.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PPrepFourier.cpp b/src/classes/PPrepFourier.cpp index 1b542c5b..a28bc29f 100644 --- a/src/classes/PPrepFourier.cpp +++ b/src/classes/PPrepFourier.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -181,7 +181,7 @@ void PPrepFourier::DoBkgCorrection() if ((fBkgRange[0] != -1) && (fBkgRange[1] != -1)) { // background range is given // make sure that the bkg range is ok for (UInt_t i=0; i= fRawData[i].rawData.size()) || (fBkgRange[1] >= fRawData[i].rawData.size())) { + if ((fBkgRange[0] >= (Int_t)fRawData[i].rawData.size()) || (fBkgRange[1] >= (Int_t)fRawData[i].rawData.size())) { cerr << endl << "PPrepFourier::DoBkgCorrection() **ERROR** bkg-range out of data-range!"; return; } diff --git a/src/classes/PRunAsymmetry.cpp b/src/classes/PRunAsymmetry.cpp index 03d1e45a..69db279a 100644 --- a/src/classes/PRunAsymmetry.cpp +++ b/src/classes/PRunAsymmetry.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -87,7 +87,7 @@ PRunAsymmetry::PRunAsymmetry(PMsrHandler *msrInfo, PRunDataHandler *rawData, UIn fPacking = fMsrInfo->GetMsrGlobal()->GetPacking(); } if (fPacking == -1) { // this should NOT happen, somethin is severely wrong - cerr << endl << ">> PRunAsymmetry::PRunAsymmetry: **SEVERE ERROR**: Couldn't find any packing information!"; + cerr << endl << ">> PRunAsymmetry::PRunAsymmetry(): **SEVERE ERROR**: Couldn't find any packing information!"; cerr << endl << ">> This is very bad :-(, will quit ..."; cerr << endl; fValid = false; @@ -342,7 +342,7 @@ void PRunAsymmetry::SetFitRangeBin(const TString fitRange) Int_t pos = 2*(fRunNo+1)-1; if (pos + 1 >= tok->GetEntries()) { - cerr << endl << ">> PRunSingleHisto::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; + cerr << endl << ">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; cerr << endl << ">> will ignore it. Sorry ..." << endl; } else { // handle fgb+n0 entry @@ -370,7 +370,7 @@ void PRunAsymmetry::SetFitRangeBin(const TString fitRange) fFitEndTime = (fGoodBins[1] - offset - fT0s[0]) * fTimeResolution; } } else { // error - cerr << endl << ">> PRunSingleHisto::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; + cerr << endl << ">> PRunAsymmetry::SetFitRangeBin(): **ERROR** invalid FIT_RANGE command found: '" << fitRange << "'"; cerr << endl << ">> will ignore it. Sorry ..." << endl; } diff --git a/src/classes/PRunAsymmetryRRF.cpp b/src/classes/PRunAsymmetryRRF.cpp new file mode 100644 index 00000000..7e7f21df --- /dev/null +++ b/src/classes/PRunAsymmetryRRF.cpp @@ -0,0 +1,1511 @@ +/*************************************************************************** + + PRunAsymmetryRRF.cpp + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2016 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifdef HAVE_CONFIG_H +#include "config.h" +#endif + +#ifdef HAVE_GOMP +#include +#endif + +#include + +#include +#include +using namespace std; + +#include +#include +#include + +#include "PMusr.h" +#include "PRunAsymmetryRRF.h" + +//-------------------------------------------------------------------------- +// Constructor +//-------------------------------------------------------------------------- +/** + *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Get the proper fit range. There are two possible fit range commands: + * fit given in (usec), or + * fit fgb+offset_0 lgb-offset_1 given in (bins), therefore it works the following way: + * -# get fit range assuming given in time from RUN block + * -# if fit range in RUN block is given in bins, replace start/end + * -# if fit range is NOT given yet, try fit range assuming given in time from GLOBAL block + * -# if fit range in GLOBAL block is given in bins, replace start/end + * -# if still no fit range is given, use fgb/lgb. + * + * \param globalBlock pointer to the GLOBAL block information form the msr-file. + */ +void PRunAsymmetryRRF::GetProperFitRange(PMsrGlobalBlock *globalBlock) +{ + // set fit start/end time; first check RUN Block + fFitStartTime = fRunInfo->GetFitRange(0); + fFitEndTime = fRunInfo->GetFitRange(1); + // if fit range is given in bins (and not time), the fit start/end time can be calculated at this point now + if (fRunInfo->IsFitRangeInBin()) { + fFitStartTime = (fGoodBins[0] + fRunInfo->GetFitRangeOffset(0) - fT0s[0]) * fTimeResolution; // (fgb+n0-t0)*dt + fFitEndTime = (fGoodBins[1] - fRunInfo->GetFitRangeOffset(1) - fT0s[0]) * fTimeResolution; // (lgb-n1-t0)*dt + // write these times back into the data structure. This way it is available when writting the log-file + fRunInfo->SetFitRange(fFitStartTime, 0); + fRunInfo->SetFitRange(fFitEndTime, 1); + } + if (fFitStartTime == PMUSR_UNDEFINED) { // fit start/end NOT found in the RUN block, check GLOBAL block + fFitStartTime = globalBlock->GetFitRange(0); + fFitEndTime = globalBlock->GetFitRange(1); + // if fit range is given in bins (and not time), the fit start/end time can be calculated at this point now + if (globalBlock->IsFitRangeInBin()) { + fFitStartTime = (fGoodBins[0] + globalBlock->GetFitRangeOffset(0) - fT0s[0]) * fTimeResolution; // (fgb+n0-t0)*dt + fFitEndTime = (fGoodBins[1] - globalBlock->GetFitRangeOffset(1) - fT0s[0]) * fTimeResolution; // (lgb-n1-t0)*dt + // write these times back into the data structure. This way it is available when writting the log-file + globalBlock->SetFitRange(fFitStartTime, 0); + globalBlock->SetFitRange(fFitEndTime, 1); + } + } + if ((fFitStartTime == PMUSR_UNDEFINED) || (fFitEndTime == PMUSR_UNDEFINED)) { + fFitStartTime = (fGoodBins[0] - fT0s[0]) * fTimeResolution; // (fgb-t0)*dt + fFitEndTime = (fGoodBins[1] - fT0s[0]) * fTimeResolution; // (lgb-t0)*dt + cerr << ">> PRunSingleHisto::GetProperFitRange(): **WARNING** Couldn't get fit start/end time!" << endl; + cerr << ">> Will set it to fgb/lgb which given in time is: " << fFitStartTime << "..." << fFitEndTime << " (usec)" << endl; + } +} diff --git a/src/classes/PRunBase.cpp b/src/classes/PRunBase.cpp index 7be37fe1..ffa15c86 100644 --- a/src/classes/PRunBase.cpp +++ b/src/classes/PRunBase.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PRunDataHandler.cpp b/src/classes/PRunDataHandler.cpp index bebc1cf0..b95c46fb 100644 --- a/src/classes/PRunDataHandler.cpp +++ b/src/classes/PRunDataHandler.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PRunListCollection.cpp b/src/classes/PRunListCollection.cpp index 4082e91e..c9c5e56f 100644 --- a/src/classes/PRunListCollection.cpp +++ b/src/classes/PRunListCollection.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -58,12 +58,24 @@ PRunListCollection::~PRunListCollection() } fRunSingleHistoList.clear(); + for (UInt_t i=0; iCleanUp(); + fRunSingleHistoRRFList[i]->~PRunSingleHistoRRF(); + } + fRunSingleHistoRRFList.clear(); + for (UInt_t i=0; iCleanUp(); fRunAsymmetryList[i]->~PRunAsymmetry(); } fRunAsymmetryList.clear(); + for (UInt_t i=0; iCleanUp(); + fRunAsymmetryRRFList[i]->~PRunAsymmetryRRF(); + } + fRunAsymmetryRRFList.clear(); + for (UInt_t i=0; iCleanUp(); fRunMuMinusList[i]->~PRunMuMinus(); @@ -106,11 +118,21 @@ Bool_t PRunListCollection::Add(Int_t runNo, EPMusrHandleTag tag) if (!fRunSingleHistoList[fRunSingleHistoList.size()-1]->IsValid()) success = false; break; + case PRUN_SINGLE_HISTO_RRF: + fRunSingleHistoRRFList.push_back(new PRunSingleHistoRRF(fMsrInfo, fData, runNo, tag)); + if (!fRunSingleHistoRRFList[fRunSingleHistoRRFList.size()-1]->IsValid()) + success = false; + break; case PRUN_ASYMMETRY: fRunAsymmetryList.push_back(new PRunAsymmetry(fMsrInfo, fData, runNo, tag)); if (!fRunAsymmetryList[fRunAsymmetryList.size()-1]->IsValid()) success = false; break; + case PRUN_ASYMMETRY_RRF: + fRunAsymmetryRRFList.push_back(new PRunAsymmetryRRF(fMsrInfo, fData, runNo, tag)); + if (!fRunAsymmetryRRFList[fRunAsymmetryRRFList.size()-1]->IsValid()) + success = false; + break; case PRUN_MU_MINUS: fRunMuMinusList.push_back(new PRunMuMinus(fMsrInfo, fData, runNo, tag)); if (!fRunMuMinusList[fRunMuMinusList.size()-1]->IsValid()) @@ -147,8 +169,12 @@ void PRunListCollection::SetFitRange(const TString fitRange) { for (UInt_t i=0; iSetFitRangeBin(fitRange); + for (UInt_t i=0; iSetFitRangeBin(fitRange); for (UInt_t i=0; iSetFitRangeBin(fitRange); + for (UInt_t i=0; iSetFitRangeBin(fitRange); for (UInt_t i=0; iSetFitRangeBin(fitRange); for (UInt_t i=0; iSetFitRange(fitRange); + for (UInt_t i=0; iSetFitRange(fitRange); for (UInt_t i=0; iSetFitRange(fitRange); + for (UInt_t i=0; iSetFitRange(fitRange); for (UInt_t i=0; iSetFitRange(fitRange); for (UInt_t i=0; i& pa return chisq; } +//-------------------------------------------------------------------------- +// GetSingleHistoRRFChisq (public) +//-------------------------------------------------------------------------- +/** + *

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

gets the maximum frequency of the given data. + * + * \param raw data set. + */ +Double_t PRunSingleHistoRRF::GetMainFrequency(PDoubleVector &data) +{ + Double_t freqMax = 0.0; + + // create histo + Double_t startTime = (fGoodBins[0]-fT0s[0]) * fTimeResolution; + Int_t noOfBins = fGoodBins[1]-fGoodBins[0]+1; + TH1F *histo = new TH1F("data", "data", noOfBins, startTime-fTimeResolution/2.0, startTime+fTimeResolution/2.0+noOfBins*fTimeResolution); + for (Int_t i=fGoodBins[0]; i<=fGoodBins[1]; i++) { + histo->SetBinContent(i-fGoodBins[0]+1, data[i]); + } + + // Fourier transform + PFourier *ft = new PFourier(histo, FOURIER_UNIT_FREQ); + ft->Transform(F_APODIZATION_STRONG); + + // find frequency maximum + TH1F *power = ft->GetPowerFourier(); + Double_t maxFreqVal = 0.0; + for (Int_t i=1; iGetNbinsX(); i++) { + // ignore dc part at 0 frequency + if (iGetNbinsX()-1) { + if (power->GetBinContent(i)>power->GetBinContent(i+1)) + continue; + } + // check for maximum + if (power->GetBinContent(i) > maxFreqVal) { + maxFreqVal = power->GetBinContent(i); + freqMax = power->GetBinCenter(i); + } + } + + // clean up + if (power) + delete power; + if (ft) + delete ft; + if (histo) + delete histo; + + return freqMax; +} + +//-------------------------------------------------------------------------- +// EstimateN0 (private) +//-------------------------------------------------------------------------- +/** + *

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

Estimate the background for a given interval. + * + * return: + * - true, if everything went smooth + * - false, otherwise + * + * \param histoNo forward histogram number of the run + */ +Bool_t PRunSingleHistoRRF::EstimateBkg(UInt_t histoNo) +{ + Double_t beamPeriod = 0.0; + + // check if data are from PSI, RAL, or TRIUMF + if (fRunInfo->GetInstitute()->Contains("psi")) + beamPeriod = ACCEL_PERIOD_PSI; + else if (fRunInfo->GetInstitute()->Contains("ral")) + beamPeriod = ACCEL_PERIOD_RAL; + else if (fRunInfo->GetInstitute()->Contains("triumf")) + beamPeriod = ACCEL_PERIOD_TRIUMF; + else + beamPeriod = 0.0; + + // check if start and end are in proper order + UInt_t start = fRunInfo->GetBkgRange(0); + UInt_t end = fRunInfo->GetBkgRange(1); + if (end < start) { + cout << endl << "PRunSingleHistoRRF::EstimatBkg(): end = " << end << " > start = " << start << "! Will swap them!"; + UInt_t keep = end; + end = start; + start = keep; + } + + // calculate proper background range + if (beamPeriod != 0.0) { + Double_t timeBkg = (Double_t)(end-start)*fTimeResolution; // length of the background intervall in time + UInt_t fullCycles = (UInt_t)(timeBkg/beamPeriod); // how many proton beam cylces can be placed within the proposed background intervall + // correct the end of the background intervall such that the background is as close as possible to a multiple of the proton cylce + end = start + (UInt_t) ((fullCycles*beamPeriod)/fTimeResolution); + cout << endl << "PRunSingleHistoRRF::EstimatBkg(): Background " << start << ", " << end; + if (end == start) + end = fRunInfo->GetBkgRange(1); + } + + // check if start is within histogram bounds + if ((start < 0) || (start >= fForward.size())) { + cerr << endl << ">> PRunSingleHistoRRF::EstimatBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << ">> histo lengths = " << fForward.size(); + cerr << endl << ">> background start = " << start; + cerr << endl; + return false; + } + + // check if end is within histogram bounds + if ((end < 0) || (end >= fForward.size())) { + cerr << endl << ">> PRunSingleHistoRRF::EstimatBkg(): **ERROR** background bin values out of bound!"; + cerr << endl << ">> histo lengths = " << fForward.size(); + cerr << endl << ">> background end = " << end; + cerr << endl; + return false; + } + + // calculate background + Double_t bkg = 0.0; + + // forward + for (UInt_t i=start; i(end - start + 1); + + fBackground = bkg; // keep background (per bin) + + cout << endl << "info> fBackground=" << fBackground << endl; + + fRunInfo->SetBkgEstimated(fBackground, 0); + + return true; +} diff --git a/src/classes/PStartupHandler.cpp b/src/classes/PStartupHandler.cpp index 3f9b425e..47414ed3 100644 --- a/src/classes/PStartupHandler.cpp +++ b/src/classes/PStartupHandler.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PTheory.cpp b/src/classes/PTheory.cpp index 08d7f176..efa1c7d8 100644 --- a/src/classes/PTheory.cpp +++ b/src/classes/PTheory.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PUserFcn.cpp b/src/classes/PUserFcn.cpp index d0ed32a2..287d63aa 100644 --- a/src/classes/PUserFcn.cpp +++ b/src/classes/PUserFcn.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/classes/PUserFcnBase.cpp b/src/classes/PUserFcnBase.cpp index 2257613e..d5ec6525 100644 --- a/src/classes/PUserFcnBase.cpp +++ b/src/classes/PUserFcnBase.cpp @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFitter.h b/src/include/PFitter.h index 8445468c..c9a09014 100644 --- a/src/include/PFitter.h +++ b/src/include/PFitter.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFitterFcn.h b/src/include/PFitterFcn.h index 1c2d846f..94686e00 100644 --- a/src/include/PFitterFcn.h +++ b/src/include/PFitterFcn.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFourier.h b/src/include/PFourier.h index 3e120b7c..bff94450 100644 --- a/src/include/PFourier.h +++ b/src/include/PFourier.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFourierCanvas.h b/src/include/PFourierCanvas.h index 096097c1..1229b34c 100644 --- a/src/include/PFourierCanvas.h +++ b/src/include/PFourierCanvas.h @@ -1,5 +1,14 @@ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + + PFourierCanvas.h + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFourierCanvasLinkDef.h b/src/include/PFourierCanvasLinkDef.h index 8ceb2d47..af10deb8 100644 --- a/src/include/PFourierCanvasLinkDef.h +++ b/src/include/PFourierCanvasLinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFunction.h b/src/include/PFunction.h index b4b60934..9efd48ff 100644 --- a/src/include/PFunction.h +++ b/src/include/PFunction.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFunctionGrammar.h b/src/include/PFunctionGrammar.h index 10c0c9f0..a03bcc4c 100644 --- a/src/include/PFunctionGrammar.h +++ b/src/include/PFunctionGrammar.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PFunctionHandler.h b/src/include/PFunctionHandler.h index cd68390e..d8cc78b8 100644 --- a/src/include/PFunctionHandler.h +++ b/src/include/PFunctionHandler.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMsr2Data.h b/src/include/PMsr2Data.h index 292dc8c9..7974d99a 100644 --- a/src/include/PMsr2Data.h +++ b/src/include/PMsr2Data.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2009-2014 by Bastian M. Wojek / Andreas Suter * + * Copyright (C) 2009-2016 by Bastian M. Wojek / Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMsrHandler.h b/src/include/PMsrHandler.h index fbc6b98b..1dab817b 100644 --- a/src/include/PMsrHandler.h +++ b/src/include/PMsrHandler.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -102,6 +102,7 @@ class PMsrHandler virtual Bool_t CheckFuncs(); virtual Bool_t CheckHistoGrouping(); virtual Bool_t CheckAddRunParameters(); + virtual Bool_t CheckRRFSettings(); virtual void CheckMaxLikelihood(); virtual void GetGroupingString(Int_t runNo, TString detector, TString &groupingStr); diff --git a/src/include/PMusr.h b/src/include/PMusr.h index 9074a34b..96df487f 100644 --- a/src/include/PMusr.h +++ b/src/include/PMusr.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * @@ -52,10 +52,12 @@ typedef struct { char a[7]; } __float128; // needed since cint doesn't know it #define PMUSR_MSR_FILE_WRITE_ERROR -7 #define PMUSR_DATA_FILE_READ_ERROR -8 -#define PRUN_SINGLE_HISTO 0 -#define PRUN_ASYMMETRY 2 -#define PRUN_MU_MINUS 4 -#define PRUN_NON_MUSR 8 +#define PRUN_SINGLE_HISTO 0 +#define PRUN_SINGLE_HISTO_RRF 1 +#define PRUN_ASYMMETRY 2 +#define PRUN_ASYMMETRY_RRF 3 +#define PRUN_MU_MINUS 4 +#define PRUN_NON_MUSR 8 // muon life time in (us), see PRL99, 032001 (2007) #define PMUON_LIFETIME 2.197019 @@ -92,17 +94,21 @@ typedef struct { char a[7]; } __float128; // needed since cint doesn't know it //------------------------------------------------------------- // msr fit type tags -#define MSR_FITTYPE_SINGLE_HISTO 0 -#define MSR_FITTYPE_ASYM 2 -#define MSR_FITTYPE_MU_MINUS 4 -#define MSR_FITTYPE_NON_MUSR 8 +#define MSR_FITTYPE_SINGLE_HISTO 0 +#define MSR_FITTYPE_SINGLE_HISTO_RRF 1 +#define MSR_FITTYPE_ASYM 2 +#define MSR_FITTYPE_ASYM_RRF 3 +#define MSR_FITTYPE_MU_MINUS 4 +#define MSR_FITTYPE_NON_MUSR 8 //------------------------------------------------------------- // msr plot type tags -#define MSR_PLOT_SINGLE_HISTO 0 -#define MSR_PLOT_ASYM 2 -#define MSR_PLOT_MU_MINUS 4 -#define MSR_PLOT_NON_MUSR 8 +#define MSR_PLOT_SINGLE_HISTO 0 +#define MSR_PLOT_SINGLE_HISTO_RRF 1 +#define MSR_PLOT_ASYM 2 +#define MSR_PLOT_ASYM_RRF 3 +#define MSR_PLOT_MU_MINUS 4 +#define MSR_PLOT_NON_MUSR 8 //------------------------------------------------------------- // map and fun offsets for parameter parsing @@ -133,11 +139,14 @@ typedef struct { char a[7]; } __float128; // needed since cint doesn't know it //------------------------------------------------------------- // RRF related tags -#define RRF_UNIT_kHz 0 -#define RRF_UNIT_MHz 1 -#define RRF_UNIT_Mcs 2 -#define RRF_UNIT_G 3 -#define RRF_UNIT_T 4 +#define RRF_UNIT_UNDEF -1 +#define RRF_UNIT_kHz 0 +#define RRF_UNIT_MHz 1 +#define RRF_UNIT_Mcs 2 +#define RRF_UNIT_G 3 +#define RRF_UNIT_T 4 + +#define RRF_FREQ_UNDEF 1.0e10 //------------------------------------------------------------- /** @@ -542,6 +551,11 @@ class PMsrGlobalBlock { virtual ~PMsrGlobalBlock() {} virtual Bool_t IsPresent() { return fGlobalPresent; } + virtual Double_t GetRRFFreq(const char *unit); + virtual TString GetRRFUnit(); + virtual Int_t GetRRFUnitTag() { return fRRFUnitTag; } + virtual Double_t GetRRFPhase() { return fRRFPhase; } + virtual Int_t GetRRFPacking() { return fRRFPacking; } virtual Int_t GetFitType() { return fFitType; } virtual Int_t GetDataRange(UInt_t idx); virtual UInt_t GetT0BinSize() { return fT0.size(); } @@ -555,6 +569,9 @@ class PMsrGlobalBlock { virtual Int_t GetPacking() { return fPacking; } virtual void SetGlobalPresent(Bool_t bval) { fGlobalPresent = bval; } + virtual void SetRRFFreq(Double_t freq, const char *unit); + virtual void SetRRFPhase(Double_t phase) { fRRFPhase = phase; } + virtual void SetRRFPacking(Int_t pack); virtual void SetFitType(Int_t ival) { fFitType = ival; } virtual void SetDataRange(Int_t ival, Int_t idx); virtual void SetT0Bin(Double_t dval, Int_t idx=-1); @@ -566,10 +583,14 @@ class PMsrGlobalBlock { private: Bool_t fGlobalPresent; ///< flag showing if a GLOBAL block is present at all. - Int_t fFitType; ///< fit type: 0=single histo fit, 2=asymmetry fit, 4=mu^- single histo fit, 8=non muSR fit - Int_t fDataRange[4]; ///< data bin range (fit type 0, 2, 4) - PDoubleVector fT0; ///< t0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... - vector fAddT0; ///< addt0 bins (fit type 0, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... + Double_t fRRFFreq; ///< RRF frequency given in units of (MHz, Mc, T) + Int_t fRRFUnitTag; ///< RRF unit tag + Double_t fRRFPhase; ///< RRF phase in (°) + Int_t fRRFPacking; ///< RRF packing + Int_t fFitType; ///< fit type: 0=single histo fit, 1=single histo RRF fit, 2=asymmetry fit, 4=mu^- single histo fit, 8=non muSR fit + Int_t fDataRange[4]; ///< data bin range (fit type 0, 1, 2, 4) + PDoubleVector fT0; ///< t0 bins (fit type 0, 1, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... + vector fAddT0; ///< addt0 bins (fit type 0, 1, 2, 4). if fit type 0 -> f0, f1, f2, ...; if fit type 2, 4 -> f0, b0, f1, b1, ... Bool_t fFitRangeInBins; ///< flag telling if fit range is given in time or in bins Double_t fFitRange[2]; ///< fit range in (us) Int_t fFitRangeOffset[2]; ///< if fit range is given in bins it can have the form fit fgb+n0 lgb-n1. This variable holds the n0 and n1. diff --git a/src/include/PMusrCanvas.h b/src/include/PMusrCanvas.h index 19241149..735af4f4 100644 --- a/src/include/PMusrCanvas.h +++ b/src/include/PMusrCanvas.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMusrCanvasLinkDef.h b/src/include/PMusrCanvasLinkDef.h index cf6b7dd3..c9c73b15 100644 --- a/src/include/PMusrCanvasLinkDef.h +++ b/src/include/PMusrCanvasLinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMusrT0.h b/src/include/PMusrT0.h index 91acf97f..b5a47c2f 100644 --- a/src/include/PMusrT0.h +++ b/src/include/PMusrT0.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PMusrT0LinkDef.h b/src/include/PMusrT0LinkDef.h index a14248fd..d7e26cc4 100644 --- a/src/include/PMusrT0LinkDef.h +++ b/src/include/PMusrT0LinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PPrepFourier.h b/src/include/PPrepFourier.h index 12f2b5f4..dd40429f 100644 --- a/src/include/PPrepFourier.h +++ b/src/include/PPrepFourier.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2015 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PRunAsymmetry.h b/src/include/PRunAsymmetry.h index 6d18983b..1bb04701 100644 --- a/src/include/PRunAsymmetry.h +++ b/src/include/PRunAsymmetry.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PRunAsymmetryRRF.h b/src/include/PRunAsymmetryRRF.h new file mode 100644 index 00000000..d0aefd7d --- /dev/null +++ b/src/include/PRunAsymmetryRRF.h @@ -0,0 +1,81 @@ +/*************************************************************************** + + PRunAsymmetryRRF.h + + Author: Andreas Suter + e-mail: andreas.suter@psi.ch + +***************************************************************************/ + +/*************************************************************************** + * Copyright (C) 2007-2016 by Andreas Suter * + * andreas.suter@psi.ch * + * * + * This program is free software; you can redistribute it and/or modify * + * it under the terms of the GNU General Public License as published by * + * the Free Software Foundation; either version 2 of the License, or * + * (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the * + * Free Software Foundation, Inc., * + * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * + ***************************************************************************/ + +#ifndef _PRUNASYMMETRYRRF_H_ +#define _PRUNASYMMETRYRRF_H_ + +#include "PRunBase.h" + +//--------------------------------------------------------------------------- +/** + *

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

Class handling single histogram fit type. + */ +class PRunSingleHistoRRF : public PRunBase +{ + public: + PRunSingleHistoRRF(); + PRunSingleHistoRRF(PMsrHandler *msrInfo, PRunDataHandler *rawData, UInt_t runNo, EPMusrHandleTag tag); + virtual ~PRunSingleHistoRRF(); + + virtual Double_t CalcChiSquare(const std::vector& par); + virtual Double_t CalcChiSquareExpected(const std::vector& par); + virtual Double_t CalcMaxLikelihood(const std::vector& par); + virtual void CalcTheory(); + + virtual UInt_t GetNoOfFitBins(); + + virtual void SetFitRangeBin(const TString fitRange); + + protected: + virtual void CalcNoOfFitBins(); + virtual Bool_t PrepareData(); + virtual Bool_t PrepareFitData(PRawRunData* runData, const UInt_t histoNo); + virtual Bool_t PrepareViewData(PRawRunData* runData, const UInt_t histoNo); + + private: + static const Double_t fN0EstimateEndTime = 1.0; ///< end time in (us) over which N0 is estimated. Should eventually be estimated automatically ... + + UInt_t fNoOfFitBins; ///< number of bins to be fitted + Double_t fBackground; ///< needed if background range is given (units: 1/bin) + Int_t fRRFPacking; ///< RRF packing for this particular run. Given in the GLOBAL-block. + + Int_t fGoodBins[2]; ///< keep first/last good bins. 0=fgb, 1=lgb + + PDoubleVector fForward; ///< forward histo data + PDoubleVector fM; ///< vector holding M(t) = [N(t)-N_bkg] exp(+t/tau). Needed to estimate N0. + PDoubleVector fMerr; ///< vector holding the error of M(t): M_err = exp(+t/tau) sqrt(N(t)). + PDoubleVector fW; ///< vector holding the weight needed to estimate N0, and errN0. + PDoubleVector fAerr; ///< vector holding the errors of estimated A(t) + + virtual Bool_t GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalBlock, PUIntVector &histoNo); + virtual Bool_t GetProperDataRange(); + virtual void GetProperFitRange(PMsrGlobalBlock *globalBlock); + virtual Double_t GetMainFrequency(PDoubleVector &data); + virtual Double_t EstimateN0(Double_t &errN0, Double_t freqMax); + virtual Bool_t EstimateBkg(UInt_t histoNo); +}; + +#endif // _PRUNSINGLEHISTORRF_H_ diff --git a/src/include/PStartupHandler.h b/src/include/PStartupHandler.h index f91dc679..9125a67b 100644 --- a/src/include/PStartupHandler.h +++ b/src/include/PStartupHandler.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PStartupHandlerLinkDef.h b/src/include/PStartupHandlerLinkDef.h index dd099371..036977e7 100644 --- a/src/include/PStartupHandlerLinkDef.h +++ b/src/include/PStartupHandlerLinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PTheory.h b/src/include/PTheory.h index 7baa44bc..85f79ddf 100644 --- a/src/include/PTheory.h +++ b/src/include/PTheory.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PUserFcn.h b/src/include/PUserFcn.h index 0c5c1fa6..dacb4041 100644 --- a/src/include/PUserFcn.h +++ b/src/include/PUserFcn.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PUserFcnBase.h b/src/include/PUserFcnBase.h index 558c8c41..a920727c 100644 --- a/src/include/PUserFcnBase.h +++ b/src/include/PUserFcnBase.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/include/PUserFcnBaseLinkDef.h b/src/include/PUserFcnBaseLinkDef.h index 5f78c800..843c143a 100644 --- a/src/include/PUserFcnBaseLinkDef.h +++ b/src/include/PUserFcnBaseLinkDef.h @@ -8,7 +8,7 @@ ***************************************************************************/ /*************************************************************************** - * Copyright (C) 2007-2014 by Andreas Suter * + * Copyright (C) 2007-2016 by Andreas Suter * * andreas.suter@psi.ch * * * * This program is free software; you can redistribute it and/or modify * diff --git a/src/musrfit.cpp b/src/musrfit.cpp index 060534f0..f5f5ac44 100644 --- a/src/musrfit.cpp +++ b/src/musrfit.cpp @@ -175,10 +175,10 @@ void musrfit_dump_ascii(char *fileName, PRunListCollection *runList) // go through the run list, get the data and dump it in a file int runCounter = 0; + PRunData *data; // single histos unsigned int size = runList->GetNoOfSingleHisto(); - PRunData *data; if (size > 0) { for (unsigned int i=0; iGetSingleHisto(i); @@ -190,6 +190,19 @@ void musrfit_dump_ascii(char *fileName, PRunListCollection *runList) } } + // single histos + size = runList->GetNoOfSingleHistoRRF(); + if (size > 0) { + for (unsigned int i=0; iGetSingleHistoRRF(i); + if (data) { + // dump data + musrfit_write_ascii(fln, data, runCounter); + runCounter++; + } + } + } + // asymmetry size = runList->GetNoOfAsymmetry(); if (size > 0) { @@ -203,6 +216,19 @@ void musrfit_dump_ascii(char *fileName, PRunListCollection *runList) } } + // asymmetry RRF + size = runList->GetNoOfAsymmetryRRF(); + if (size > 0) { + for (unsigned int i=0; iGetAsymmetryRRF(i); + if (data) { + // dump data + musrfit_write_ascii(fln, data, runCounter); + runCounter++; + } + } + } + // muMinus size = runList->GetNoOfMuMinus(); if (size > 0) { @@ -308,10 +334,10 @@ void musrfit_dump_root(char *fileName, PRunListCollection *runList) // go through the run list, get the data and dump it in a file int runCounter = 0; + PRunData *data; // single histos unsigned int size = runList->GetNoOfSingleHisto(); - PRunData *data; if (size > 0) { for (unsigned int i=0; iGetSingleHisto(i); @@ -323,6 +349,19 @@ void musrfit_dump_root(char *fileName, PRunListCollection *runList) } } + // single histo RRF + size = runList->GetNoOfSingleHistoRRF(); + if (size > 0) { + for (unsigned int i=0; iGetSingleHistoRRF(i); + if (data) { + // dump data + musrfit_write_root(f, fln, data, runCounter); + runCounter++; + } + } + } + // asymmetry size = runList->GetNoOfAsymmetry(); if (size > 0) { @@ -336,6 +375,19 @@ void musrfit_dump_root(char *fileName, PRunListCollection *runList) } } + // asymmetry RRF + size = runList->GetNoOfAsymmetryRRF(); + if (size > 0) { + for (unsigned int i=0; iGetAsymmetryRRF(i); + if (data) { + // dump data + musrfit_write_root(f, fln, data, runCounter); + runCounter++; + } + } + } + // muMinus size = runList->GetNoOfMuMinus(); if (size > 0) { diff --git a/src/musrt0.cpp b/src/musrt0.cpp index d1a118c9..272ebe18 100644 --- a/src/musrt0.cpp +++ b/src/musrt0.cpp @@ -669,6 +669,7 @@ Int_t main(Int_t argc, Char_t *argv[]) } switch (fitType) { case MSR_FITTYPE_SINGLE_HISTO: + case MSR_FITTYPE_SINGLE_HISTO_RRF: case MSR_FITTYPE_MU_MINUS: if ((runList->at(i).GetRunNameSize() == 1) && (runList->at(i).GetForwardHistoNoSize() == 1)) { // no addruns / no grouping // feed necessary data @@ -796,6 +797,7 @@ Int_t main(Int_t argc, Char_t *argv[]) } break; case MSR_FITTYPE_ASYM: + case MSR_FITTYPE_ASYM_RRF: if ((runList->at(i).GetRunNameSize() == 1) && (runList->at(i).GetForwardHistoNoSize() == 1)) { // no addruns / no grouping // feed necessary data forward musrT0Data.InitData(); diff --git a/src/tests/MuTransition/PSimulateMuTransition.cpp b/src/tests/MuTransition/PSimulateMuTransition.cpp index 113e0982..15e558c1 100644 --- a/src/tests/MuTransition/PSimulateMuTransition.cpp +++ b/src/tests/MuTransition/PSimulateMuTransition.cpp @@ -14,9 +14,15 @@ Description: Root class to simulate muon spin phase under successive Mu+/Mu0 charge-exchange - processes by a Monte-Carlo method. Up to 3 Mu0 states are considered at the moment - (analogous to MuBC in Si, B||(100)), a non-precessing signal, and two precessing - states ("nu_12" and "nu_34"). + processes by a Monte-Carlo method. Consider transverse field geometry, and assume + initial muon spin direction in x, and field applied along z. For PxMu(t) in + muonium use the equation 8.22 of the muSR book of Yaounc and Dalmas de Réotier, in + slightly modified form (see Senba, J. Phys. B 23, 1545 (1990)); note that PxMu(t) + is given by a superposition of the four frequencies "nu_12", "nu_34", "nu_23", "nu_14". + These frequencies and the corresponding probabilities ("SetMuFractionState12" for + transitions 12 and 34, "SetMuFractionState23" for states 23 and 14) can be calculated + for a given field with the root macro AnisotropicMu.C + Parameters: 1) Precession frequencies of "nu_12", "nu_34", "nu_23", "nu_14" 2) fractions of nu_12, nu_34; and nu_23 and nu_14 @@ -33,15 +39,14 @@ The muon event simulation with a sequence of charge-changing processes is done in Event(): - simulate muon spin phase under charge-exchange with "3 Mu states" - (as MuBC in Si, B || (100), for example): a non-precessing, - and two precessing signals (nu_12, nu_34). + simulate muon spin phase under charge-exchange with "4 Mu transitions" 1) according to Mu+/Mu0 fraction begin either with a Mu+ state or Mu state 2) Mu+: determine next electron-capture time t_c. If t_c is larger than decay time t_d calculate muon spin precession for t_d; else calculate spin precession for t_c. - 3) Determine next ionization time t_i, also determine which Mu0 state has been formed - at the capture event. Calculate muon spin precession. - 4) get the next electron capture time, continue until t_d is reached. + 3) Determine next ionization time t_i; calculate Px(t_i) in Muonium; calculate the + muon spin phase by acos(Px(t_i)). + 4) get the next electron capture time, continue until t_d is reached; accumulate muon spin + phase. ***************************************************************************/ @@ -95,6 +100,7 @@ PSimulateMuTransition::PSimulateMuTransition(UInt_t seed) fMuPrecFreq12 = 0.; // Mu precession frequency of a 12 transition fMuPrecFreq23 = 0.; // Mu precession frequency of a 23 transition fMuPrecFreq14 = 0.; // Mu precession frequency of a 14 transition + fMuonPrecFreq = 0.; // muon precession frequency fBfield = 0.01; // magnetic field (T) fCaptureRate = 0.01; // Mu+ capture rate (MHz) fIonizationRate = 10.; // Mu0 ionization rate (MHz) @@ -103,8 +109,8 @@ PSimulateMuTransition::PSimulateMuTransition(UInt_t seed) fMuonDecayTime = 0.; fAsymmetry = 0.27; fMuFraction = 0.; - fMuFractionState1 = 0.; - fMuFractionState2 = 0.; + fMuFractionState12 = 0.; + fMuFractionState23 = 0.; fDebugFlag = kFALSE; } @@ -139,8 +145,8 @@ void PSimulateMuTransition::PrintSettings() const cout << endl << "Mu ionizatioan rate (MHz) = " << fIonizationRate; cout << endl << "Decay asymmetry = " << fAsymmetry; cout << endl << "Muonium fraction = " << fMuFraction; - cout << endl << "Muonium fraction state1 = " << fMuFractionState1; - cout << endl << "Muonium fraction state2 = " << fMuFractionState2; + cout << endl << "Muonium fraction state12 = " << fMuFractionState12; + cout << endl << "Muonium fraction state23 = " << fMuFractionState23; cout << endl << "Number of particles to simulate = " << fNmuons; cout << endl << "Initial muon spin phase (degree) = " << fInitialPhase; cout << endl << "Debug flag = " << fDebugFlag; @@ -224,38 +230,53 @@ Double_t PSimulateMuTransition::NextEventTime(const Double_t &EventRate) * \param time duration of precession (us); * \param frequency muon spin precession frequency (MHz); */ -Double_t PSimulateMuTransition::PrecessionPhase(const Double_t &time, const Double_t &frequency) +Double_t PSimulateMuTransition::PrecessionPhase(const Double_t &time, const TString chargeState) { - return TMath::TwoPi()*frequency*time; + Double_t muonPhaseX; + Double_t muoniumPolX = 0; + + if (chargeState == "Mu+") + muonPhaseX = TMath::TwoPi()*fMuonPrecFreq*time; + else if (chargeState == "Mu0"){ + muoniumPolX = 0.5 * + (fMuFractionState12 * (TMath::Cos(TMath::TwoPi()*fMuPrecFreq12*time) + TMath::Cos(TMath::TwoPi()*fMuPrecFreq34*time)) + + fMuFractionState23 * (TMath::Cos(TMath::TwoPi()*fMuPrecFreq23*time) + TMath::Cos(TMath::TwoPi()*fMuPrecFreq14*time))); + muonPhaseX = TMath::ACos(muoniumPolX); + } + else + muonPhaseX = 0.; + + return muonPhaseX; } //-------------------------------------------------------------------------- // Event (private) //-------------------------------------------------------------------------- /** - *

Generates "muon event": simulate muon spin phase under charge-exchange - * with "3 Mu states" (as MuBC in Si, B || (100), for example): a non-precessing, - * and two precessing signals (nu_12, nu_34). + *

Generates "muon event": simulate muon spin phase under charge-exchange with + * a neutral muonium state in transverse field, where the polarization evolution + * PxMu(t) of the muon spin in muonium is determined by a superposition of the + * four "Mu transitions" nu_12, nu_34, nu_23, and nu_14. * 1) according to Mu+/Mu0 fraction begin either with a Mu+ state or Mu state * 2) Mu+: determine next electron-capture time t_c. If t_c is larger than decay time t_d * calculate muon spin precession for t_d; else calculate spin precession for t_c. - * 3) Determine next ionization time t_i, also determine which Mu0 state has been formed - * at the capture event. Calculate muon spin precession. + * 3) Determine next ionization time t_i; calculate Px(t_i) in Muonium; calculate the + * muon spin phase by acos(Px(t_i)). * 4) get the next electron capture time, continue until t_d is reached. * *

For isotropic muonium, TF: - * nu_12 and nu_34 with equal probabilities, probability for both states fMuFractionState1 - * ni_23 and nu_14 with equal probabilities, probability for both states fMuFractionState2 + * nu_12 and nu_34 with equal probabilities, probability for both states fMuFractionState12 + * ni_23 and nu_14 with equal probabilities, probability for both states fMuFractionState23 * * \param muonString if eq. "Mu+" begin with Mu+ precession */ void PSimulateMuTransition::Event(const TString muonString) { Double_t eventTime, eventDiffTime, captureTime, ionizationTime; - Double_t muonPrecessionFreq, muoniumPrecessionFreq; // MHz - Double_t rndm, frac1, frac2; +// Double_t muonPrecessionFreq, muoniumPrecessionFreq; // MHz +// Double_t rndm, frac1, frac2; - muonPrecessionFreq = fMuonGyroRatio * fBfield; + fMuonPrecFreq = fMuonGyroRatio * fBfield; // charge-exchange loop until muon decay eventTime = 0.; @@ -270,10 +291,10 @@ void PSimulateMuTransition::Event(const TString muonString) eventTime += captureTime; if (fDebugFlag) cout << "Capture time = " << captureTime << " Phase = " << fMuonPhase << endl; if (eventTime < fMuonDecayTime) - fMuonPhase += PrecessionPhase(captureTime, muonPrecessionFreq); + fMuonPhase += PrecessionPhase(captureTime, "Mu+"); else{ //muon decays; handle precession prior to muon decay eventDiffTime = fMuonDecayTime - (eventTime - captureTime); - fMuonPhase += PrecessionPhase(eventDiffTime, muonPrecessionFreq); + fMuonPhase += PrecessionPhase(eventDiffTime, "Mu+"); break; } @@ -281,31 +302,30 @@ void PSimulateMuTransition::Event(const TString muonString) ionizationTime = NextEventTime(fIonizationRate); eventTime += ionizationTime; // determine Mu state - rndm = fRandom->Rndm(); - frac1 = 1. - fMuFractionState1 - fMuFractionState2; // non-precessing Mu states - frac2 = 1. - fMuFractionState2; - if ( rndm < frac1 ) - muoniumPrecessionFreq = 0.; - else if (rndm >= frac1 && rndm <= frac2){ - if (fRandom->Rndm() <= 0.5) - muoniumPrecessionFreq = fMuPrecFreq12; - else - muoniumPrecessionFreq = fMuPrecFreq34; - } - else{ - if (fRandom->Rndm() <= 0.5) - muoniumPrecessionFreq = fMuPrecFreq23; - else - muoniumPrecessionFreq = fMuPrecFreq14; - } +// rndm = fRandom->Rndm(); +// frac1 = 1. - fMuFractionState1 - fMuFractionState2; // non-precessing Mu states +// frac2 = 1. - fMuFractionState2; +// if ( rndm < frac1 ) +// muoniumPrecessionFreq = 0.; +// else if (rndm >= frac1 && rndm <= frac2){ +// if (fRandom->Rndm() <= 0.5) +// muoniumPrecessionFreq = fMuPrecFreq12; +// else +// muoniumPrecessionFreq = fMuPrecFreq34; +// } +// else{ +// if (fRandom->Rndm() <= 0.5) +// muoniumPrecessionFreq = fMuPrecFreq23; +// else +// muoniumPrecessionFreq = fMuPrecFreq14; +// } - if (fDebugFlag) cout << "Ioniza. time = " << ionizationTime << " Freq = " << muoniumPrecessionFreq - << " Phase = " << fMuonPhase << endl; + if (fDebugFlag) cout << "Ioniza. time = " << ionizationTime << " Phase = " << fMuonPhase << endl; if (eventTime < fMuonDecayTime) - fMuonPhase += PrecessionPhase(ionizationTime, muoniumPrecessionFreq); + fMuonPhase += PrecessionPhase(ionizationTime, "Mu0"); else{ //muon decays; handle precession prior to muon decay eventDiffTime = fMuonDecayTime - (eventTime - ionizationTime); - fMuonPhase += PrecessionPhase(eventDiffTime, muoniumPrecessionFreq); + fMuonPhase += PrecessionPhase(eventDiffTime, "Mu0"); break; } } @@ -314,32 +334,31 @@ void PSimulateMuTransition::Event(const TString muonString) ionizationTime = NextEventTime(fIonizationRate); eventTime += ionizationTime; // determine Mu state - rndm = fRandom->Rndm(); - frac1 = 1. - fMuFractionState1 - fMuFractionState2; // non-precessing Mu states - frac2 = 1. - fMuFractionState2; - if ( rndm < frac1 ) - muoniumPrecessionFreq = 0.; - else if (rndm >= frac1 && rndm <= frac2){ - if (fRandom->Rndm() <= 0.5) - muoniumPrecessionFreq = fMuPrecFreq12; - else - muoniumPrecessionFreq = fMuPrecFreq34; - } - else{ - if (fRandom->Rndm() <= 0.5) - muoniumPrecessionFreq = fMuPrecFreq23; - else - muoniumPrecessionFreq = fMuPrecFreq14; - } +// rndm = fRandom->Rndm(); +// frac1 = 1. - fMuFractionState1 - fMuFractionState2; // non-precessing Mu states +// frac2 = 1. - fMuFractionState2; +// if ( rndm < frac1 ) +// muoniumPrecessionFreq = 0.; +// else if (rndm >= frac1 && rndm <= frac2){ +// if (fRandom->Rndm() <= 0.5) +// muoniumPrecessionFreq = fMuPrecFreq12; +// else +// muoniumPrecessionFreq = fMuPrecFreq34; +// } +// else{ +// if (fRandom->Rndm() <= 0.5) +// muoniumPrecessionFreq = fMuPrecFreq23; +// else +// muoniumPrecessionFreq = fMuPrecFreq14; +// } if (fDebugFlag) - cout << "Mu Ioniza. time = " << ionizationTime << " Freq = " << muoniumPrecessionFreq - << " Phase = " << fMuonPhase << endl; + cout << "Mu Ioniza. time = " << ionizationTime << " Phase = " << fMuonPhase << endl; if (eventTime < fMuonDecayTime) - fMuonPhase += PrecessionPhase(ionizationTime, muoniumPrecessionFreq); + fMuonPhase += PrecessionPhase(ionizationTime, "Mu0"); else{ //muon decays; handle precession prior to muon decay eventDiffTime = fMuonDecayTime - (eventTime - ionizationTime); - fMuonPhase += PrecessionPhase(eventDiffTime, muoniumPrecessionFreq); + fMuonPhase += PrecessionPhase(eventDiffTime, "Mu0"); break; } @@ -348,10 +367,10 @@ void PSimulateMuTransition::Event(const TString muonString) eventTime += captureTime; if (fDebugFlag) cout << "Capture time = " << captureTime << " Phase = " << fMuonPhase << endl; if (eventTime < fMuonDecayTime) - fMuonPhase += PrecessionPhase(captureTime, muonPrecessionFreq); + fMuonPhase += PrecessionPhase(captureTime, "Mu+"); else{ //muon decays; handle precession prior to muon decay eventDiffTime = fMuonDecayTime - (eventTime - captureTime); - fMuonPhase += PrecessionPhase(eventDiffTime, muonPrecessionFreq); + fMuonPhase += PrecessionPhase(eventDiffTime, "Mu+"); break; } } diff --git a/src/tests/MuTransition/PSimulateMuTransition.h b/src/tests/MuTransition/PSimulateMuTransition.h index cbe5cc66..6640fd3b 100644 --- a/src/tests/MuTransition/PSimulateMuTransition.h +++ b/src/tests/MuTransition/PSimulateMuTransition.h @@ -57,8 +57,8 @@ class PSimulateMuTransition : public TObject virtual void SetIonizationRate(Double_t value){ fIonizationRate = value; } //!< sets Mu0 ionization rate (MHz) virtual void SetDecayAsymmetry(Double_t value){ fAsymmetry = value; } //!< muon decay asymmetry virtual void SetMuFraction(Double_t value){ fMuFraction = value; } //!< Muonium fraction - virtual void SetMuFractionState1(Double_t value){ fMuFractionState1 = value; } - virtual void SetMuFractionState2(Double_t value){ fMuFractionState2 = value; } + virtual void SetMuFractionState12(Double_t value){ fMuFractionState12 = value; } + virtual void SetMuFractionState23(Double_t value){ fMuFractionState23 = value; } virtual Bool_t IsValid() { return fValid; } virtual void SetSeed(UInt_t seed); @@ -77,6 +77,7 @@ class PSimulateMuTransition : public TObject Double_t fMuPrecFreq34; //!< Mu transition frequency 34 (MHz) Double_t fMuPrecFreq23; //!< Mu transition frequency 23 (MHz) Double_t fMuPrecFreq14; //!< Mu transition frequency 14 (MHz) + Double_t fMuonPrecFreq; //!< muon precession frequency (MHz) Double_t fCaptureRate; //!< Mu+ electron capture rate (MHz) Double_t fIonizationRate; //!< Mu0 ionization rate (MHz) Double_t fInitialPhase; //!< initial muon spin phase @@ -84,13 +85,14 @@ class PSimulateMuTransition : public TObject Double_t fMuonPhase; //!< phase of muon spin Double_t fAsymmetry; //!< muon decay asymmetry Double_t fMuFraction; //!< total Mu fraction [0,1] - Double_t fMuFractionState1; //!< fraction of Mu in state 1 - Double_t fMuFractionState2; //!< fraction of Mu in state 2 + Double_t fMuFractionState12; //!< fraction of Mu in state 12, 34 + Double_t fMuFractionState23; //!< fraction of Mu in state 23, 14 Int_t fNmuons; //!< number of muons to simulate Bool_t fDebugFlag; //!< debug flag virtual Double_t NextEventTime(const Double_t &EventRate); - virtual Double_t PrecessionPhase(const Double_t &time, const Double_t &frequency); +// virtual Double_t PrecessionPhase(const Double_t &time, const Double_t &frequency); + virtual Double_t PrecessionPhase(const Double_t &time, const TString chargeState); virtual void Event(const TString muonString); ClassDef(PSimulateMuTransition, 0) diff --git a/src/tests/MuTransition/runMuSimulation.C b/src/tests/MuTransition/runMuSimulation.C index a769d071..4e2a55d2 100644 --- a/src/tests/MuTransition/runMuSimulation.C +++ b/src/tests/MuTransition/runMuSimulation.C @@ -110,8 +110,8 @@ void runMuSimulation() simulateMuTransition->SetMuPrecFreq23(Freq23); // MHz simulateMuTransition->SetMuPrecFreq14(Freq14); // MHz simulateMuTransition->SetMuFraction(MuFrac); // initial Mu fraction - simulateMuTransition->SetMuFractionState1(MuFrac12); // Mu in states 12, 34 - simulateMuTransition->SetMuFractionState2(MuFrac23); // Mu in states 23, 14 + simulateMuTransition->SetMuFractionState12(MuFrac12); // Mu in states 12, 34 + simulateMuTransition->SetMuFractionState23(MuFrac23); // Mu in states 23, 14 simulateMuTransition->SetBfield(B/10000.); // Tesla simulateMuTransition->SetCaptureRate(capRate); // MHz simulateMuTransition->SetIonizationRate(ionRate); // MHz diff --git a/src/tests/analyticFakeData/analyticFakeData.C b/src/tests/analyticFakeData/analyticFakeData.C index 2d80c0ac..65a954da 100644 --- a/src/tests/analyticFakeData/analyticFakeData.C +++ b/src/tests/analyticFakeData/analyticFakeData.C @@ -179,14 +179,20 @@ void analyticFakeData(const TString type, UInt_t runNo) phase.push_back((5.0 + 2.0*rand.Rndm())*TMath::Pi()/180.0 + TMath::TwoPi()/noOfHistos * (Double_t)i); const Double_t gamma = 0.0000135538817; // gamma/(2pi) - Double_t bb0 = 90000.0; // field in Gauss - Double_t rate0 = 1.0/1000.0; // in 1/ns + Double_t bb0 = 5000.0; // field in Gauss + Double_t rate0 = 7.0/1000.0; // in 1/ns + Double_t frac0 = 0.5; + Double_t bb1 = bb0 + 200.0; // field in Gauss + Double_t rate1 = 0.75/1000.0; // in 1/ns + Double_t frac1 = 0.2; + Double_t bb2 = bb0 + 600.0; // field in Gauss + Double_t rate2 = 0.25/1000.0; // in 1/ns // fake function parameters header info: only for test purposes cout << ">> write fake header for TMusrRoot" << endl; if (type.CompareTo("TLemRunHeader")) { TDoubleVector dvec; - header->Set("FakeFct/Def", "N0 exp(-t/tau_mu) [1 + A exp(-1/2 (t sigma)^2) cos(gamma_mu B t + phi)] + bkg"); + header->Set("FakeFct/Def", "N0 exp(-t/tau_mu) [1 + sum_{k=0}^2 frac_k A_0 exp(-1/2 (t sigma_k)^2) cos(gamma_mu B_k t + phi)] + bkg"); for (UInt_t i=0; iSet("FakeFct/N0", dvec); @@ -202,10 +208,20 @@ void analyticFakeData(const TString type, UInt_t runNo) for (UInt_t i=0; iSet("FakeFct/phase", dvec); - prop.Set("B", bb0, "G"); - header->Set("FakeFct/B", prop); - prop.Set("lambda", rate0, "1/usec"); - header->Set("FakeFct/lambda", prop); + prop.Set("B0", bb0, "G"); + header->Set("FakeFct/B0", prop); + prop.Set("rate0", 1.0e3*rate0, "1/usec"); + header->Set("FakeFct/rate0", prop); + header->Set("FakeFct/frac0", frac0); + prop.Set("B1", bb1, "G"); + header->Set("FakeFct/B1", prop); + prop.Set("rate1", 1.0e3*rate1, "1/usec"); + header->Set("FakeFct/rate1", prop); + header->Set("FakeFct/frac1", frac1); + prop.Set("B2", bb2, "G"); + header->Set("FakeFct/B2", prop); + prop.Set("rate2", 1.0e3*rate2, "1/usec"); + header->Set("FakeFct/rate2", prop); } cout << ">> create histo objects" << endl; @@ -228,7 +244,10 @@ void analyticFakeData(const TString type, UInt_t runNo) histo[i]->SetBinContent(j+1, bkg[i]); } else { time = (Double_t)(j-t0[i])*timeResolution; - dval = (Double_t)n0[i]*TMath::Exp(-time/tau)*(1.0+a0[i]*TMath::Exp(-0.5*TMath::Power(time*rate0,2))*TMath::Cos(TMath::TwoPi()*gamma*bb0*time+phase[i]))+(Double_t)bkg[i]; + dval = (Double_t)n0[i]*TMath::Exp(-time/tau)*(1.0+ + frac0*a0[i]*TMath::Exp(-0.5*TMath::Power(time*rate0,2))*TMath::Cos(TMath::TwoPi()*gamma*bb0*time+phase[i]) + + frac1*a0[i]*TMath::Exp(-0.5*TMath::Power(time*rate1,2))*TMath::Cos(TMath::TwoPi()*gamma*bb1*time+phase[i]) + + (1.0-frac0-frac1)*a0[i]*TMath::Exp(-0.5*TMath::Power(time*rate2,2))*TMath::Cos(TMath::TwoPi()*gamma*bb2*time+phase[i]))+(Double_t)bkg[i]; histo[i]->SetBinContent(j+1, dval); } }