Merged master into beta-NMR

This commit is contained in:
Zaher Salman 2018-12-18 10:01:28 +01:00
commit d1cf374354
49 changed files with 1603 additions and 266 deletions

View File

@ -1,107 +1,107 @@
153
MnSi, FLC68.2, 50 K
###############################################################
FITPARAMETER
# Nr. Name Value Step Pos_Error Boundaries
1 Rate_1 1.6687 0.0083 none
2 Field_1 73089.883 0.089 none
3 Rate_2 1.968 0.031 none
1 Rate_1 1.6687 0.0086 none
2 Field_1 73089.883 0.090 none
3 Rate_2 1.968 0.032 none
4 Field_2 72289.02 0.24 none
5 Asym_1 0.2949 0.0027 none
6 Frc_1 0.7316 0.0052 none
5 Asym_1 0.2949 0.0030 none
6 Frc_1 0.7316 0.0059 none
7 Phase_1 55.61 0.52 none
8 N0_1 940.35 0.44 none
9 Bkg_1 1.523 0.052 none
8 N0_1 940.35 0.54 none
9 Bkg_1 1.523 0.064 none
10 Asym_2 0.2960 0.0026 none
11 Frc_2 0.7475 0.0051 none
10 Asym_2 0.2960 0.0030 none
11 Frc_2 0.7475 0.0059 none
12 Phase_2 30.77 0.50 none
13 N0_2 961.49 0.45 none
14 Bkg_2 1.928 0.053 none
13 N0_2 961.49 0.55 none
14 Bkg_2 1.928 0.065 none
15 Asym_3 0.3002 0.0026 none
16 Frc_3 0.7462 0.0050 none
15 Asym_3 0.3002 0.0029 none
16 Frc_3 0.7462 0.0056 none
17 Phase_3 18.03 0.48 none
18 N0_3 1024.28 0.46 none
19 Bkg_3 1.919 0.055 none
18 N0_3 1024.28 0.57 none
19 Bkg_3 1.919 0.067 none
20 Asym_4 0.3088 0.0026 none
21 Frc_4 0.7333 0.0048 none
20 Asym_4 0.3088 0.0029 none
21 Frc_4 0.7333 0.0054 none
22 Phase_4 336.94 0.47 none
23 N0_4 1029.36 0.46 none
24 Bkg_4 1.863 0.055 none
23 N0_4 1029.36 0.57 none
24 Bkg_4 1.863 0.067 none
25 Asym_5 0.3094 0.0026 none
26 Frc_5 0.7416 0.0049 none
25 Asym_5 0.3094 0.0029 none
26 Frc_5 0.7416 0.0055 none
27 Phase_5 280.32 0.48 none
28 N0_5 1002.69 0.46 none
29 Bkg_5 1.979 0.054 none
28 N0_5 1002.69 0.56 none
29 Bkg_5 1.979 0.067 none
30 Asym_6 0.3153 0.0028 none
31 Frc_6 0.7403 0.0051 none
32 Phase_6 211.07 0.50 none
33 N0_6 853.43 0.42 none
34 Bkg_6 1.656 0.050 none
30 Asym_6 0.3153 0.0032 none
31 Frc_6 0.7403 0.0058 none
32 Phase_6 211.07 0.51 none
33 N0_6 853.43 0.52 none
34 Bkg_6 1.656 0.061 none
35 Asym_7 0.3118 0.0028 none
36 Frc_7 0.7378 0.0052 none
35 Asym_7 0.3118 0.0032 none
36 Frc_7 0.7378 0.0059 none
37 Phase_7 161.74 0.51 none
38 N0_7 858.76 0.42 none
39 Bkg_7 1.594 0.050 none
38 N0_7 858.76 0.52 none
39 Bkg_7 1.594 0.061 none
40 Asym_8 0.2985 0.0028 none
41 Frc_8 0.7373 0.0053 none
42 Phase_8 133.70 0.53 none
43 N0_8 871.20 0.42 none
44 Bkg_8 1.746 0.051 none
40 Asym_8 0.2985 0.0031 none
41 Frc_8 0.7373 0.0061 none
42 Phase_8 133.69 0.53 none
43 N0_8 871.20 0.52 none
44 Bkg_8 1.746 0.062 none
45 Asym_9 0.2874 0.0024 none
46 Frc_9 0.7341 0.0048 none
45 Asym_9 0.2874 0.0027 none
46 Frc_9 0.7340 0.0054 none
47 Phase_9 158.63 0.47 none
48 N0_9 1184.29 0.50 none
49 Bkg_9 2.542 0.060 none
48 N0_9 1184.29 0.61 none
49 Bkg_9 2.542 0.073 none
50 Asym_10 0.2846 0.0026 none
51 Frc_10 0.7453 0.0053 none
52 Phase_10 128.05 0.49 none
53 N0_10 1193.66 0.50 none
54 Bkg_10 2.394 0.060 none
50 Asym_10 0.2846 0.0027 none
51 Frc_10 0.7453 0.0055 none
52 Phase_10 128.05 0.47 none
53 N0_10 1193.66 0.61 none
54 Bkg_10 2.394 0.073 none
55 Asym_11 0.2876 0.0024 none
56 Frc_11 0.7463 0.0049 none
57 Phase_11 102.57 0.46 none
58 N0_11 1280.00 0.52 none
59 Bkg_11 2.730 0.061 none
55 Asym_11 0.2877 0.0026 none
56 Frc_11 0.7463 0.0053 none
57 Phase_11 102.43 0.45 none
58 N0_11 1280.00 0.63 none
59 Bkg_11 2.730 0.075 none
60 Asym_12 0.2919 0.0022 none
61 Frc_12 0.7405 0.0045 none
62 Phase_12 42.97 0.44 none
63 N0_12 1383.96 0.54 none
64 Bkg_12 2.807 0.064 none
60 Asym_12 0.2919 0.0025 none
61 Frc_12 0.7405 0.0050 none
62 Phase_12 42.97 0.43 none
63 N0_12 1383.96 0.66 none
64 Bkg_12 2.807 0.078 none
65 Asym_13 0.2903 0.0021 none
66 Frc_13 0.7494 0.0044 none
65 Asym_13 0.2903 0.0025 none
66 Frc_13 0.7494 0.0050 none
67 Phase_13 350.74 0.43 none
68 N0_13 1393.01 0.55 none
69 Bkg_13 2.738 0.064 none
68 N0_13 1393.01 0.66 none
69 Bkg_13 2.738 0.078 none
70 Asym_14 0.2968 0.0022 none
71 Frc_14 0.7327 0.0045 none
70 Asym_14 0.2968 0.0025 none
71 Frc_14 0.7327 0.0049 none
72 Phase_14 288.56 0.43 none
73 N0_14 1374.46 0.54 none
74 Bkg_14 2.768 0.064 none
73 N0_14 1374.46 0.66 none
74 Bkg_14 2.768 0.078 none
75 Asym_15 0.2799 0.0021 none
76 Frc_15 0.7427 0.0044 none
77 Phase_15 282.56 0.47 none
78 N0_15 1365.97 0.54 none
79 Bkg_15 2.809 0.063 none
75 Asym_15 0.2799 0.0025 none
76 Frc_15 0.7427 0.0052 none
77 Phase_15 282.56 0.45 none
78 N0_15 1365.97 0.65 none
79 Bkg_15 2.809 0.078 none
80 Asym_16 0.2771 0.0023 none
81 Frc_16 0.7344 0.0048 none
82 Phase_16 212.46 0.47 none
83 N0_16 1256.93 0.52 none
84 Bkg_16 2.458 0.062 none
80 Asym_16 0.2771 0.0026 none
81 Frc_16 0.7344 0.0055 none
82 Phase_16 212.46 0.48 none
83 N0_16 1256.94 0.63 none
84 Bkg_16 2.458 0.074 none
###############################################################
THEORY
@ -265,17 +265,18 @@ SAVE
###############################################################
PLOT 0 (single histo plot)
lifetimecorrection
runs 1 11
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 Tesla # units either 'Gauss', 'MHz', or 'Mc/s'
units Tesla # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s'
fourier_power 12
apodization STRONG # NONE, WEAK, MEDIUM, STRONG
plot POWER # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL
phase par(7, 5, 16)
range 7.1 7.5
###############################################################
STATISTIC --- 2014-12-03 15:42:56
STATISTIC --- 2018-10-15 15:55:36
maxLH = 1286508.7, NDF = 1246064, maxLH/NDF = 1.032458

View File

@ -2,7 +2,7 @@ LSCO x=0.02 (224-227), T=12.00 (K), E=5.57 keV, WEW B=~49(G)/8.62(A), Tr=15.02 (
###############################################################
FITPARAMETER
# No Name Value Step Pos_Error Boundaries
1 AsymT 0.05052 -0.00071 0.00072 0 0.33
1 AsymT 0.05053 -0.00071 0.00072 0 0.33
2 Field 48.298 -0.094 0.095
3 RateT 0.129 -0.010 0.010 0 none
4 AsymL 0 0 none 0 0.33
@ -10,15 +10,15 @@ FITPARAMETER
6 AlphaLR 0.9784 -0.0013 0.0013
7 PhaseL 6.6 -1.6 1.6 -40 40
8 BkgL 6.920 -0.048 0.048
9 RelPhaseR 178.7 -1.9 1.9 150 210
10 NormR 419.47 -0.40 0.40
9 RelPhaseR 178.8 -1.9 1.9 150 210
10 NormR 419.46 -0.40 0.40
11 BkgR 8.393 -0.050 0.050
12 AlphaTB 1.1025 -0.0015 0.0015
13 RelPhaseT 269.0 -1.9 1.9 240 300
13 RelPhaseT 269.1 -1.9 1.9 240 300
14 BkgT 7.466 -0.049 0.049
15 NormB 393.08 -0.39 0.38
15 NormB 393.08 -0.39 0.39
16 RelPhaseB 90.7 -2.0 2.0 60 120
17 BkgB 7.091 -0.047 0.048
17 BkgB 7.092 -0.048 0.048
18 One 1 0 none
19 Zero 0 0 none
@ -84,17 +84,17 @@ FOURIER
units Gauss # units either 'Gauss', 'Tesla', 'MHz', or 'Mc/s'
fourier_power 10
apodization STRONG # NONE, WEAK, MEDIUM, STRONG
plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE
plot REAL # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL
dc-corrected true
phase par7
phase parR7, par9, par13, par16
###############################################################
PLOT 0 (single histo plot)
lifetimecorrection
runs 1 3
runs 1 2 3 4
range 0 9 -0.15 0.15
view_packing 500
###############################################################
STATISTIC --- 2015-01-05 13:58:40
STATISTIC --- 2018-11-13 07:58:56
maxLH = 3971.7, NDF = 4001, maxLH/NDF = 0.992668

View File

@ -3,8 +3,8 @@
You can adapt this file completely to your liking, but it should at least
contain the root `toctree` directive.
Welcome to musrfit documentation!
=================================
Welcome to the musrfit documentation!
=====================================
.. toctree::
:maxdepth: 2

View File

@ -407,3 +407,341 @@ Nonlocal superconductivity related Meissner screening functions (AS libs)
-------------------------------------------------------------------------
To be written yet ...
.. index:: BNMR-libs
.. _BNMR-libs:
Functions to analyze |bgr|-NMR data (BNMR libs)
-------------------------------------------------------------------------
This is a collection of ``C++`` classes using the ``musrfit`` :ref:`user-functions <user-functions>`
interface in order to facilitate the usage in conjunction with ``musrfit``. It consists of two libraries:
* ``libBNMR`` contains functions to fit spin lattice relaxation (SLR) data.
* ``libLineProfile`` contains functions to fit resonance lineshapes.
.. note::
Currently it is recommended to read in the data in ASCII format as a non-|mgr|\SR fit :ref:`(fit type 8) <non-musr-fit>`.
.. index:: libBNMR
libBNMR
++++++++++
In |bgr|-NMR the SLR is usually measured by implanting a pulse of :math:`^8`\ Li with a length :math:`t_0` into the sample.
The asymmetry is measured both during the pulse and afterwards. For a a general spin relaxation function :math:`f(t)` the time evolution of the asymmetry is then given by [`Z. Salman, et al., PRL 96, 147601 (2006) <http://dx.doi.org/10.1103/PhysRevLett.96.147601>`_]:
.. index:: SLR
.. _SLR:
.. math::
P(t) = \left\{\begin{matrix}
\frac{\int_0^t e^{-(t-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^t e^{-t'/\tau_{\mathrm{Li}}}dt' } & t\leq t_0\\[6pt]
\frac{\int_0^{t_0}e^{-(t_0-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^{t_0}e^{-t'/\tau_{\mathrm{Li}}}dt'} & t> t_0,
\end{matrix}\right.
where :math:`\tau_{\mathrm{Li}}=1.21`\ s is the :math:`^8`\ Li lifetime.
Functions
^^^^^^^^^^^^
The ``libLineProfile`` library currently contains the following functions:
.. index:: ExpRlx
**Exponential relaxation**
::
userFcn libBNMR ExpRlx 1 2
The parameters are:
#. pulse length :math:`t_0` (ms)
#. relaxation rate :math:`\sigma` (ms\ :math:`^{-1}`\ )
This function implements :math:`f(t)=e^{-\sigma t}`.
.. index:: SExpRlx
**Stretched exponential relaxation**
::
userFcn libBNMR SExpRlx 1 2 3
The parameters are:
#. pulse length :math:`t_0` (ms)
#. relaxation rate :math:`\sigma` (ms\ :math:`^{-1}`\ )
#. stretching exponent :math:`\beta`
This function implements :math:`f(t)=e^{-(\sigma t)^{\beta}}`.
.. index:: libLineProfile
libLineProfile
+++++++++++++++++
In addition to some simple line shapes ``libLineProfile`` contains functions to fit chemical shift anisotropies in the powder average.
Their functional form can be found in `M. Mehring, Principles of High Resolution NMR in Solids (Springer 1983) <http://dx.doi.org/10.1007/978-3-642-68756-3_2>`_.
For an axially symmetric interaction it is given by:
.. index:: Iax
.. _Iax:
.. math::
I_{\mathrm ax}(f)=\left\{\begin{matrix} \frac{1}{2\sqrt{(f_\parallel-f_\perp)(f-f_\perp)}}& f\in(f_\perp,f_\parallel)\cup(f_\parallel,f_\perp)\\[6pt] 0 & \text{otherwise}\end{matrix} \right.
where :math:`f_\parallel` and :math:`f_\perp` are the frequencies that would be observed if the field is oriented paralell or perpendicular to the symmetry axis, respectively.
| In case of a completely anisotropic interaction, the powder average can be described by the frequencies along the three principle axis :math:`f_1,f_2,f_3`.
| Assume without loss of generality that :math:`f_1<f_2<f_3`, then
.. index:: Ianiso
.. _Ianiso:
.. math::
I(f)&=\left\{\begin{matrix}
\frac{K(m)}{\pi\sqrt{(f-f_1)(f_3-f_2)}},& f_3\geq f>f_2 \\[9pt]
\frac{K(m)}{\pi\sqrt{(f_3-f)(f_2-f_1)}},& f_2>f\geq f_1\\[9pt]
0 & \text{otherwise}
\end{matrix} \right. \\
\\
m&=\left\{\begin{matrix}
\frac{(f_2-f_1)(f_3-f)}{(f_3-f_2)(f-f_1)},& f_3\geq f>f_2 \\[6pt]
\frac{(f-f_1)(f_3-f_2)}{(f_3-f)(f_2-f_1)},& f_2>f\geq f_1\\[6pt]
\end{matrix} \right. \\
\\
K(m)&=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},
:math:`K(m)` is the complete elliptic integral of the first kind.
Functions
^^^^^^^^^^^^
The ``libLineProfile`` library currently contains the following functions:
.. index:: LineGauss
**Gaussian**
::
userFcn libLineProfile LineGauss 1 2
The parameters are:
#. center of the line :math:`f_0`
#. FWHM of the line :math:`\sigma`
| The height of the peak is 1.
| The functional form is given by
.. math::
A(f)=e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}}
.. index:: LineLorentzian
**Lorentzian**
::
userFcn libLineProfile LineLorentzian 1 2
The parameters are:
#. center of the line :math:`f_0`
#. FWHM of the line :math:`w`
| The height of the peak is 1.
| The functional form is given by
.. math::
A(f)= \frac{w^2}{4(f-f_0)^2+w^2}
.. index:: LineLaplace
**Laplacian**
::
userFcn libLineProfile LineLaplace 1 2
The parameters are:
#. center of the line :math:`f_0`
#. FWHM of the line :math:`w`
| The height of the peak is 1.
| The functional form is given by
.. math::
A(f)=e^{-2\ln 2 \left|\frac{f-f_0}{w}\right|}
.. index:: LineSkewLorentzian
**Skewed Lorentzian**
::
userFcn libLineProfile LineSkewLorentzian 1 2 3
The parameters are:
#. center of the line :math:`f_0`
#. width of the line :math:`w`
#. skewness parameter :math:`a`
| The height of the peak is 1.
| The functional form is given by
.. math::
A(f)= \frac{w w_a}{4(f-f_0)^2+w_a^2}, \quad w_a=\frac{2w}{1+e^{a(f-f_0)}}
.. index:: LineSkewLorentzian2
**Skewed Lorentzian 2**
::
userFcn libLineProfile LineSkewLorentzian2 1 2 3
The parameters are:
#. center of the line :math:`f_0`
#. width left of the center :math:`w_1`
#. width right of the center :math:`w_2`
| The height of the peak is 1.
| The functional form is given by
.. math::
A(f)= \left\{\begin{matrix}\frac{{w_1}^2}{4{(f-f_0)}^2+{w_1}^2},&f\leq f_0\\[9pt] \frac{{w_2}^2}{4{(f-f_0)}^2+{w_2}^2},&f>f_0\end{matrix}\right.
.. index:: PowderLineAxialLor
**Powder average of an axially symmetric interaction convoluted with a Lorentzian**
::
userFcn libLineProfile PowderLineAxialLor 1 2 3
The parameters are:
#. frequency for the field oriented paralell to the symmetry axis :math:`f_\parallel`
#. frequency for the field oriented perpendicular to the symmetry axis :math:`f_\parallel`
#. FWHM of the Lorentzian :math:`w`
| The height of the peak is :math:`\sim`\ 1.
| The functional form is given by
.. math::
A(f)= I_{\mathrm ax}(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)
with :math:`I_{\mathrm ax}(f)` defined :ref:`above <Iax>`.
.. index:: PowderLineAxialGss
**Powder average of an axially symmetric interaction convoluted with a Gaussian**
::
userFcn libLineProfile PowderLineAxialGss 1 2 3
The parameters are:
#. frequency for the field oriented paralell to the symmetry axis :math:`f_\parallel`
#. frequency for the field oriented perpendicular to the symmetry axis :math:`f_\parallel`
#. FWHM of the Gaussian :math:`\sigma`
| The height of the peak is :math:`\sim`\ 1.
| The functional form is given by
.. math::
A(f)= I_{\mathrm ax}(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)
with :math:`I_{\mathrm ax}(f)` defined :ref:`above <Iax>`.
.. index:: PowderLineAsymLor
**Powder average of an anisotropic interaction convoluted with a Lorentzian**
::
userFcn libLineProfile PowderLineAsymLor 1 2 3 4
The parameters are:
#. :math:`f_1`
#. :math:`f_1`
#. :math:`f_3` frequencies along the principal axes
#. FWHM of the Lorentzian :math:`w`
| The height of the peak is :math:`\sim`\ 1.
| The functional form is given by
.. math::
A(f)= I(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)
with :math:`I(f)` defined :ref:`above <Ianiso>`. Note that :math:`f_1<f_2<f_3` is not required by the code.
.. index:: PowderLineAsymGss
**Powder average of an anisotropic interaction convoluted with a Gaussian**
::
userFcn libLineProfile PowderLineAsymGss 1 2 3 4
The parameters are:
#. :math:`f_1`
#. :math:`f_1`
#. :math:`f_3` frequencies along the principal axes
#. FWHM of the Gaussian :math:`\sigma`
| The height of the peak is :math:`\sim`\ 1.
| The functional form is given by
.. math::
A(f)= I(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)
with :math:`I(f)` defined :ref:`above <Ianiso>`. Note that :math:`f_1<f_2<f_3` is not required by the code.

View File

@ -1497,8 +1497,68 @@ The block starts with the *FOURIER* keyword and may contain the following entrie
.. _msr-fourier-block-phase:
**phase**
The initial phase of the input data is given here in degrees. Optionally the phase parameter from the :ref:`FITPARAMETER block <msr-fitparameter-block>` can be given,
*e.g.* par3, which would take the value of parameter number 3.
If a real Fourier shall be plotted, it is necessary to adopt the phases of the different detectors. The number of potentially provided phases can be either **one**, which means that this phase will be applied to *all* Fourier spectra,
or the number of phases have to correspond to the number of runs in the plot block.
Currently there are three options:
#. The phases for each run/detector are given explicitly, *i.e.*
.. code-block:: bash
phase val0 sep val1 sep ... sep valN
where ``val0``, ``val1``, etc. are explicitly given phases (*i.e.* doubles), and ``sep`` is one of the following allowed separators: ``space``, ``,``, ``;``, or ``tab``.
For example
.. code-block:: bash
phase -3.2, 175.9
#. The phases for each run/detector are given as phase parameter from the :ref:`FITPARAMETER block <msr-fitparameter-block>`, *e.g.* par3, which would
take the value of parameter number 3. More explicitly
.. code-block:: bash
phase parX0 sep parX1 sep ... sep parXN
where the same rules applies as for explicit phase values. An example could look like this
.. code-block:: bash
phase par7, par12, par17, par22, par27, par32, par37, par42, par47, par52, par57, par62, par67, par72, par77, par82
One might prefer to express the phases in respect to a reference counter, *e.g.* the forward counter is the reference counter phase (fcp) whereas
the backward counter phase (bcp) is expressed as bcp = fcp + relative_bcp. If the fitting is done along these lines, the phases in the Fourier
block can be expressed the following way
.. code-block:: bash
phase parRX0 sep parX1 sep ... sep parXN
which means that ``X0`` is the reference phase, and all the other phases are relative phases in respect to ``X0``, *i.e.* the absolut phase of
``Xj`` would be the summ of the values of ``parX0`` and ``parXj`` etc. The reference phase in the list is marked by ``parR`` rather than ``par``.
Obviously only *one* reference phase can be defined!
#. Often the phases in the parameter block follow a clear list structure. This allows to write the Fourier phase parameters in a more compact form
.. code-block:: none
phase par(X0, offset, #param)
with ``X0`` the first phase parameter index, ``offset`` being the offset to the next phase parameter, and ``#param`` being the number of phase parameters to be used.
This means that the previous example can be compacted to
.. code-block:: none
phase par(7, 5, 16)
As in the phase parameter list examples before, also here a reference phase with relative phases might be wished. Differently to the phase parameter
list example, the first parameter number will be the reference phase. The compact notation here is
.. code-block:: none
phase parR(X0, offest, #param)
.. index:: fourier-block-range_for_phase_correction
.. _msr-fourier-block-range_for_phase_correction:
@ -1522,8 +1582,7 @@ Altogether, a possible FOURIER block might look like that:
fourier_power 12
apodization NONE
plot real_and_imag
phase 22.6 # par3
range_for_phase_correction all
phase par5, par8
range 0.0 17.03
.. index:: msr-plot-block

View File

@ -113,7 +113,7 @@ extremely competent way to deal with his projects as well as to deal with the ch
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -107,7 +107,7 @@ For a detailed description see <a class="reference internal" href="user-manual.h
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -98,7 +98,7 @@ or send an e-mail to A. Suter at PSI.</p>
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -26,7 +26,7 @@
<script type="text/javascript" src="http://cdn.mathjax.org/mathjax/latest/MathJax.js?config=TeX-AMS-MML_HTMLorMML"></script>
<link rel="top" title="musrfit 1.4.0 documentation" href="index.html" />
<link rel="next" title="Tutorial for musrfit" href="tutorial.html" />
<link rel="prev" title="Welcome to musrfit documentation!" href="index.html" />
<link rel="prev" title="Welcome to the musrfit documentation!" href="index.html" />
</head>
<body>
<div class="related">
@ -39,7 +39,7 @@
<a href="tutorial.html" title="Tutorial for musrfit"
accesskey="N">next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to musrfit documentation!"
<a href="index.html" title="Welcome to the musrfit documentation!"
accesskey="P">previous</a> |</li>
<li><a href="index.html">musrfit 1.4.0 documentation</a> &raquo;</li>
</ul>
@ -76,7 +76,7 @@
<div class="sphinxsidebarwrapper">
<h4>Previous topic</h4>
<p class="topless"><a href="index.html"
title="previous chapter">Welcome to musrfit documentation!</a></p>
title="previous chapter">Welcome to the musrfit documentation!</a></p>
<h4>Next topic</h4>
<p class="topless"><a href="tutorial.html"
title="next chapter">Tutorial for <tt class="docutils literal"><span class="pre">musrfit</span></tt></a></p>
@ -112,14 +112,14 @@
<a href="tutorial.html" title="Tutorial for musrfit"
>next</a> |</li>
<li class="right" >
<a href="index.html" title="Welcome to musrfit documentation!"
<a href="index.html" title="Welcome to the musrfit documentation!"
>previous</a> |</li>
<li><a href="index.html">musrfit 1.4.0 documentation</a> &raquo;</li>
</ul>
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -52,9 +52,11 @@
| <a href="#B"><strong>B</strong></a>
| <a href="#C"><strong>C</strong></a>
| <a href="#D"><strong>D</strong></a>
| <a href="#E"><strong>E</strong></a>
| <a href="#F"><strong>F</strong></a>
| <a href="#G"><strong>G</strong></a>
| <a href="#H"><strong>H</strong></a>
| <a href="#I"><strong>I</strong></a>
| <a href="#L"><strong>L</strong></a>
| <a href="#M"><strong>M</strong></a>
| <a href="#N"><strong>N</strong></a>
@ -138,17 +140,21 @@
<dt><a href="user-manual.html#index-28">background-single-histo</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-libs.html#index-1">BMW-libs</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-libs.html#index-13">BMWlibs-XML</a>
</dt>
<dt><a href="user-libs.html#index-14">BNMR-libs</a>
</dt>
<dt><a href="setup-standard.html#index-2">boost-c++</a>
</dt>
@ -219,6 +225,16 @@
</dl></td>
</tr></table>
<h2 id="E">E</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-libs.html#index-17">ExpRlx</a>
</dt>
</dl></td>
</tr></table>
<h2 id="F">F</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
@ -323,21 +339,65 @@
</dl></td>
</tr></table>
<h2 id="I">I</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-libs.html#index-21">Ianiso</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-libs.html#index-20">Iax</a>
</dt>
</dl></td>
</tr></table>
<h2 id="L">L</h2>
<table style="width: 100%" class="indextable genindextable"><tr>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-libs.html#index-15">libBNMR</a>
</dt>
<dt><a href="user-libs.html#index-2">libFitPofB</a>
</dt>
<dt><a href="user-libs.html#index-19">libLineProfile</a>
</dt>
<dt><a href="setup-standard.html#index-6">libxml2</a>
</dt>
<dt><a href="user-manual.html#index-23">lifetime</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-manual.html#index-23">lifetime</a>
<dt><a href="user-libs.html#index-22">LineGauss</a>
</dt>
<dt><a href="user-libs.html#index-24">LineLaplace</a>
</dt>
<dt><a href="user-libs.html#index-23">LineLorentzian</a>
</dt>
<dt><a href="user-libs.html#index-25">LineSkewLorentzian</a>
</dt>
<dt><a href="user-libs.html#index-26">LineSkewLorentzian2</a>
</dt>
</dl></td>
@ -692,6 +752,24 @@
<dt><a href="user-manual.html#index-38">packing</a>
</dt>
<dt><a href="user-libs.html#index-30">PowderLineAsymGss</a>
</dt>
<dt><a href="user-libs.html#index-29">PowderLineAsymLor</a>
</dt>
</dl></td>
<td style="width: 33%" valign="top"><dl>
<dt><a href="user-libs.html#index-28">PowderLineAxialGss</a>
</dt>
<dt><a href="user-libs.html#index-27">PowderLineAxialLor</a>
</dt>
</dl></td>
</tr></table>
@ -741,6 +819,10 @@
</dt>
<dt><a href="user-libs.html#index-18">SExpRlx</a>
</dt>
<dt><a href="user-manual.html#index-64">single-histogram-fit</a>
</dt>
@ -751,6 +833,10 @@
</dt>
<dt><a href="user-libs.html#index-16">SLR</a>
</dt>
<dt><a href="setup-standard.html#index-1">supported-operating-systems</a>
</dt>
@ -901,7 +987,7 @@
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Nov 13, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -6,7 +6,7 @@
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Welcome to musrfit documentation! &mdash; musrfit 1.4.0 documentation</title>
<title>Welcome to the musrfit documentation! &mdash; musrfit 1.4.0 documentation</title>
<link rel="stylesheet" href="_static/nature.css" type="text/css" />
<link rel="stylesheet" href="_static/pygments.css" type="text/css" />
@ -46,8 +46,8 @@
<div class="bodywrapper">
<div class="body">
<div class="section" id="welcome-to-musrfit-documentation">
<h1>Welcome to musrfit documentation!<a class="headerlink" href="#welcome-to-musrfit-documentation" title="Permalink to this headline"></a></h1>
<div class="section" id="welcome-to-the-musrfit-documentation">
<h1>Welcome to the musrfit documentation!<a class="headerlink" href="#welcome-to-the-musrfit-documentation" title="Permalink to this headline"></a></h1>
<div class="toctree-wrapper compound">
<ul>
<li class="toctree-l1"><a class="reference internal" href="cite.html">How to Cite <tt class="docutils literal"><span class="pre">musrfit</span></tt>?</a></li>
@ -68,6 +68,7 @@
<li class="toctree-l1"><a class="reference internal" href="user-libs.html">Documentation of user libs (user functions)</a><ul>
<li class="toctree-l2"><a class="reference internal" href="user-libs.html#meissner-profiles-vortex-lattice-related-functions-bmw-libs">Meissner-Profiles / Vortex-Lattice related functions (BMW libs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-libs.html#nonlocal-superconductivity-related-meissner-screening-functions-as-libs">Nonlocal superconductivity related Meissner screening functions (AS libs)</a></li>
<li class="toctree-l2"><a class="reference internal" href="user-libs.html#functions-to-analyze-bgr-nmr-data-bnmr-libs">Functions to analyze β-NMR data (BNMR libs)</a></li>
</ul>
</li>
<li class="toctree-l1"><a class="reference internal" href="setup-standard.html">Setting up <tt class="docutils literal"><span class="pre">musrfit</span></tt> on Different Platforms</a><ul>
@ -141,7 +142,7 @@
<div class="sphinxsidebarwrapper">
<h3><a href="#">Table Of Contents</a></h3>
<ul>
<li><a class="reference internal" href="#">Welcome to musrfit documentation!</a></li>
<li><a class="reference internal" href="#">Welcome to the musrfit documentation!</a></li>
<li><a class="reference internal" href="#indices-and-tables">Indices and tables</a></li>
</ul>
@ -184,7 +185,7 @@
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Nov 13, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -439,7 +439,7 @@ fit serves as template for the second and so on. The template field stays empty
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -257,7 +257,7 @@ SCRIPT COMMANDS:
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -928,7 +928,7 @@ the entry has been added. The last token, <tt class="docutils literal"><span cla
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -555,7 +555,7 @@ the corresponding fit parameter value, except the phases where the step will be
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

Binary file not shown.

View File

@ -94,7 +94,7 @@
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Nov 13, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

File diff suppressed because one or more lines are too long

View File

@ -359,7 +359,7 @@ The only thing you need <tt class="docutils literal"><span class="pre">DKS</span
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -1486,7 +1486,7 @@ $ musrview test-histo-ROOT-NPP.msr
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -448,7 +448,7 @@ For a complete description please refer to the manuals of <a class="reference in
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -370,6 +370,233 @@ The expected name of the <tt class="docutils literal"><span class="pre">RGE</spa
<h2>Nonlocal superconductivity related Meissner screening functions (AS libs)<a class="headerlink" href="#nonlocal-superconductivity-related-meissner-screening-functions-as-libs" title="Permalink to this headline"></a></h2>
<p>To be written yet ...</p>
</div>
<div class="section" id="functions-to-analyze-bgr-nmr-data-bnmr-libs">
<span id="bnmr-libs"></span><span id="index-14"></span><h2>Functions to analyze β-NMR data (BNMR libs)<a class="headerlink" href="#functions-to-analyze-bgr-nmr-data-bnmr-libs" title="Permalink to this headline"></a></h2>
<p>This is a collection of <tt class="docutils literal"><span class="pre">C++</span></tt> classes using the <tt class="docutils literal"><span class="pre">musrfit</span></tt> <a class="reference internal" href="user-manual.html#id20"><em>user-functions</em></a>
interface in order to facilitate the usage in conjunction with <tt class="docutils literal"><span class="pre">musrfit</span></tt>. It consists of two libraries:</p>
<ul class="simple">
<li><tt class="docutils literal"><span class="pre">libBNMR</span></tt> contains functions to fit spin lattice relaxation (SLR) data.</li>
<li><tt class="docutils literal"><span class="pre">libLineProfile</span></tt> contains functions to fit resonance lineshapes.</li>
</ul>
<div class="admonition note">
<p class="first admonition-title">Note</p>
<p class="last">Currently it is recommended to read in the data in ASCII format as a non-μSR fit <a class="reference internal" href="user-manual.html#non-musr-fit"><em>(fit type 8)</em></a>.</p>
</div>
<div class="section" id="libbnmr">
<span id="index-15"></span><h3>libBNMR<a class="headerlink" href="#libbnmr" title="Permalink to this headline"></a></h3>
<p>In β-NMR the SLR is usually measured by implanting a pulse of <span class="math">\(^8\)</span>Li with a length <span class="math">\(t_0\)</span> into the sample.
The asymmetry is measured both during the pulse and afterwards. For a a general spin relaxation function <span class="math">\(f(t)\)</span> the time evolution of the asymmetry is then given by [<a class="reference external" href="http://dx.doi.org/10.1103/PhysRevLett.96.147601">Z. Salman, et al., PRL 96, 147601 (2006)</a>]:</p>
<div class="math" id="slr">
<span id="index-16"></span>\[\begin{split}P(t) = \left\{\begin{matrix}
\frac{\int_0^t e^{-(t-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^t e^{-t'/\tau_{\mathrm{Li}}}dt' } &amp; t\leq t_0\\[6pt]
\frac{\int_0^{t_0}e^{-(t_0-t')/\tau_{\mathrm{Li}}}f(t-t')dt'}{\int_0^{t_0}e^{-t'/\tau_{\mathrm{Li}}}dt'} &amp; t&gt; t_0,
\end{matrix}\right.\end{split}\]</div>
<p>where <span class="math">\(\tau_{\mathrm{Li}}=1.21\)</span>s is the <span class="math">\(^8\)</span>Li lifetime.</p>
<div class="section" id="functions">
<h4>Functions<a class="headerlink" href="#functions" title="Permalink to this headline"></a></h4>
<p>The <tt class="docutils literal"><span class="pre">libLineProfile</span></tt> library currently contains the following functions:</p>
<p id="index-17"><strong>Exponential relaxation</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libBNMR ExpRlx 1 2
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>pulse length <span class="math">\(t_0\)</span> (ms)</li>
<li>relaxation rate <span class="math">\(\sigma\)</span> (ms<span class="math">\(^{-1}\)</span>)</li>
</ol>
<p>This function implements <span class="math">\(f(t)=e^{-\sigma t}\)</span>.</p>
<p id="index-18"><strong>Stretched exponential relaxation</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libBNMR SExpRlx 1 2 3
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>pulse length <span class="math">\(t_0\)</span> (ms)</li>
<li>relaxation rate <span class="math">\(\sigma\)</span> (ms<span class="math">\(^{-1}\)</span>)</li>
<li>stretching exponent <span class="math">\(\beta\)</span></li>
</ol>
<p>This function implements <span class="math">\(f(t)=e^{-(\sigma t)^{\beta}}\)</span>.</p>
</div>
</div>
<div class="section" id="liblineprofile">
<span id="index-19"></span><h3>libLineProfile<a class="headerlink" href="#liblineprofile" title="Permalink to this headline"></a></h3>
<p>In addition to some simple line shapes <tt class="docutils literal"><span class="pre">libLineProfile</span></tt> contains functions to fit chemical shift anisotropies in the powder average.
Their functional form can be found in <a class="reference external" href="http://dx.doi.org/10.1007/978-3-642-68756-3_2">M. Mehring, Principles of High Resolution NMR in Solids (Springer 1983)</a>.</p>
<p>For an axially symmetric interaction it is given by:</p>
<div class="math" id="iax">
<span id="index-20"></span>\[\begin{split}I_{\mathrm ax}(f)=\left\{\begin{matrix} \frac{1}{2\sqrt{(f_\parallel-f_\perp)(f-f_\perp)}}&amp; f\in(f_\perp,f_\parallel)\cup(f_\parallel,f_\perp)\\[6pt] 0 &amp; \text{otherwise}\end{matrix} \right.\end{split}\]</div>
<p>where <span class="math">\(f_\parallel\)</span> and <span class="math">\(f_\perp\)</span> are the frequencies that would be observed if the field is oriented paralell or perpendicular to the symmetry axis, respectively.</p>
<div class="line-block">
<div class="line">In case of a completely anisotropic interaction, the powder average can be described by the frequencies along the three principle axis <span class="math">\(f_1,f_2,f_3\)</span>.</div>
<div class="line">Assume without loss of generality that <span class="math">\(f_1&lt;f_2&lt;f_3\)</span>, then</div>
</div>
<div class="math" id="ianiso">
<span id="index-21"></span>\[\begin{split}I(f)&amp;=\left\{\begin{matrix}
\frac{K(m)}{\pi\sqrt{(f-f_1)(f_3-f_2)}},&amp; f_3\geq f&gt;f_2 \\[9pt]
\frac{K(m)}{\pi\sqrt{(f_3-f)(f_2-f_1)}},&amp; f_2&gt;f\geq f_1\\[9pt]
0 &amp; \text{otherwise}
\end{matrix} \right. \\
\\
m&amp;=\left\{\begin{matrix}
\frac{(f_2-f_1)(f_3-f)}{(f_3-f_2)(f-f_1)},&amp; f_3\geq f&gt;f_2 \\[6pt]
\frac{(f-f_1)(f_3-f_2)}{(f_3-f)(f_2-f_1)},&amp; f_2&gt;f\geq f_1\\[6pt]
\end{matrix} \right. \\
\\
K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\end{split}\]</div>
<p><span class="math">\(K(m)\)</span> is the complete elliptic integral of the first kind.</p>
<div class="section" id="id1">
<h4>Functions<a class="headerlink" href="#id1" title="Permalink to this headline"></a></h4>
<p>The <tt class="docutils literal"><span class="pre">libLineProfile</span></tt> library currently contains the following functions:</p>
<p id="index-22"><strong>Gaussian</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile LineGauss 1 2
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>center of the line <span class="math">\(f_0\)</span></li>
<li>FWHM of the line <span class="math">\(\sigma\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is 1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[A(f)=e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}}\]</div>
<p id="index-23"><strong>Lorentzian</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile LineLorentzian 1 2
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>center of the line <span class="math">\(f_0\)</span></li>
<li>FWHM of the line <span class="math">\(w\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is 1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[A(f)= \frac{w^2}{4(f-f_0)^2+w^2}\]</div>
<p id="index-24"><strong>Laplacian</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile LineLaplace 1 2
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>center of the line <span class="math">\(f_0\)</span></li>
<li>FWHM of the line <span class="math">\(w\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is 1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[A(f)=e^{-2\ln 2 \left|\frac{f-f_0}{w}\right|}\]</div>
<p id="index-25"><strong>Skewed Lorentzian</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile LineSkewLorentzian 1 2 3
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>center of the line <span class="math">\(f_0\)</span></li>
<li>width of the line <span class="math">\(w\)</span></li>
<li>skewness parameter <span class="math">\(a\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is 1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[A(f)= \frac{w w_a}{4(f-f_0)^2+w_a^2}, \quad w_a=\frac{2w}{1+e^{a(f-f_0)}}\]</div>
<p id="index-26"><strong>Skewed Lorentzian 2</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile LineSkewLorentzian2 1 2 3
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>center of the line <span class="math">\(f_0\)</span></li>
<li>width left of the center <span class="math">\(w_1\)</span></li>
<li>width right of the center <span class="math">\(w_2\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is 1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[\begin{split}A(f)= \left\{\begin{matrix}\frac{{w_1}^2}{4{(f-f_0)}^2+{w_1}^2},&amp;f\leq f_0\\[9pt] \frac{{w_2}^2}{4{(f-f_0)}^2+{w_2}^2},&amp;f&gt;f_0\end{matrix}\right.\end{split}\]</div>
<p id="index-27"><strong>Powder average of an axially symmetric interaction convoluted with a Lorentzian</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile PowderLineAxialLor 1 2 3
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>frequency for the field oriented paralell to the symmetry axis <span class="math">\(f_\parallel\)</span></li>
<li>frequency for the field oriented perpendicular to the symmetry axis <span class="math">\(f_\parallel\)</span></li>
<li>FWHM of the Lorentzian <span class="math">\(w\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is <span class="math">\(\sim\)</span>1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[A(f)= I_{\mathrm ax}(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)\]</div>
<p>with <span class="math">\(I_{\mathrm ax}(f)\)</span> defined <a class="reference internal" href="#iax"><em>above</em></a>.</p>
<p id="index-28"><strong>Powder average of an axially symmetric interaction convoluted with a Gaussian</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile PowderLineAxialGss 1 2 3
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li>frequency for the field oriented paralell to the symmetry axis <span class="math">\(f_\parallel\)</span></li>
<li>frequency for the field oriented perpendicular to the symmetry axis <span class="math">\(f_\parallel\)</span></li>
<li>FWHM of the Gaussian <span class="math">\(\sigma\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is <span class="math">\(\sim\)</span>1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[A(f)= I_{\mathrm ax}(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)\]</div>
<p>with <span class="math">\(I_{\mathrm ax}(f)\)</span> defined <a class="reference internal" href="#iax"><em>above</em></a>.</p>
<p id="index-29"><strong>Powder average of an anisotropic interaction convoluted with a Lorentzian</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile PowderLineAsymLor 1 2 3 4
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li><span class="math">\(f_1\)</span></li>
<li><span class="math">\(f_1\)</span></li>
<li><span class="math">\(f_3\)</span> frequencies along the principal axes</li>
<li>FWHM of the Lorentzian <span class="math">\(w\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is <span class="math">\(\sim\)</span>1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[A(f)= I(f)\circledast\left( \frac{w^2}{4f^2+w^2} \right)\]</div>
<p>with <span class="math">\(I(f)\)</span> defined <a class="reference internal" href="#ianiso"><em>above</em></a>. Note that <span class="math">\(f_1&lt;f_2&lt;f_3\)</span> is not required by the code.</p>
<p id="index-30"><strong>Powder average of an anisotropic interaction convoluted with a Gaussian</strong></p>
<div class="highlight-python"><div class="highlight"><pre><span></span>userFcn libLineProfile PowderLineAsymGss 1 2 3 4
</pre></div>
</div>
<p>The parameters are:</p>
<ol class="arabic simple">
<li><span class="math">\(f_1\)</span></li>
<li><span class="math">\(f_1\)</span></li>
<li><span class="math">\(f_3\)</span> frequencies along the principal axes</li>
<li>FWHM of the Gaussian <span class="math">\(\sigma\)</span></li>
</ol>
<div class="line-block">
<div class="line">The height of the peak is <span class="math">\(\sim\)</span>1.</div>
<div class="line">The functional form is given by</div>
</div>
<div class="math">
\[A(f)= I(f)\circledast\left( e^{-\frac{4\ln 2 (f-f_0)^2}{ \sigma^2}} \right)\]</div>
<p>with <span class="math">\(I(f)\)</span> defined <a class="reference internal" href="#ianiso"><em>above</em></a>. Note that <span class="math">\(f_1&lt;f_2&lt;f_3\)</span> is not required by the code.</p>
</div>
</div>
</div>
</div>
@ -386,6 +613,11 @@ The expected name of the <tt class="docutils literal"><span class="pre">RGE</spa
</ul>
</li>
<li><a class="reference internal" href="#nonlocal-superconductivity-related-meissner-screening-functions-as-libs">Nonlocal superconductivity related Meissner screening functions (AS libs)</a></li>
<li><a class="reference internal" href="#functions-to-analyze-bgr-nmr-data-bnmr-libs">Functions to analyze β-NMR data (BNMR libs)</a><ul>
<li><a class="reference internal" href="#libbnmr">libBNMR</a></li>
<li><a class="reference internal" href="#liblineprofile">libLineProfile</a></li>
</ul>
</li>
</ul>
</li>
</ul>
@ -435,7 +667,7 @@ The expected name of the <tt class="docutils literal"><span class="pre">RGE</spa
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -1552,8 +1552,56 @@ The argument may be one of the following:</p>
</dl>
<span id="index-47"></span><dl class="docutils" id="msr-fourier-block-phase">
<dt><strong>phase</strong></dt>
<dd>The initial phase of the input data is given here in degrees. Optionally the phase parameter from the <a class="reference internal" href="#msr-fitparameter-block"><em>FITPARAMETER block</em></a> can be given,
<em>e.g.</em> par3, which would take the value of parameter number 3.</dd>
<dd><p class="first">If a real Fourier shall be plotted, it is necessary to adopt the phases of the different detectors. The number of potentially provided phases can be either <strong>one</strong>, which means that this phase will be applied to <em>all</em> Fourier spectra,
or the number of phases have to correspond to the number of runs in the plot block.</p>
<p>Currently there are three options:</p>
<ol class="last arabic">
<li><p class="first">The phases for each run/detector are given explicitly, <em>i.e.</em></p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>phase val0 sep val1 sep ... sep valN
</pre></div>
</div>
<p>where <tt class="docutils literal"><span class="pre">val0</span></tt>, <tt class="docutils literal"><span class="pre">val1</span></tt>, etc. are explicitly given phases (<em>i.e.</em> doubles), and <tt class="docutils literal"><span class="pre">sep</span></tt> is one of the following allowed separators: <tt class="docutils literal"><span class="pre">space</span></tt>, <tt class="docutils literal"><span class="pre">,</span></tt>, <tt class="docutils literal"><span class="pre">;</span></tt>, or <tt class="docutils literal"><span class="pre">tab</span></tt>.
For example</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>phase -3.2, <span class="m">175</span>.9
</pre></div>
</div>
</li>
<li><p class="first">The phases for each run/detector are given as phase parameter from the <a class="reference internal" href="#msr-fitparameter-block"><em>FITPARAMETER block</em></a>, <em>e.g.</em> par3, which would
take the value of parameter number 3. More explicitly</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>phase parX0 sep parX1 sep ... sep parXN
</pre></div>
</div>
<p>where the same rules applies as for explicit phase values. An example could look like this</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>phase par7, par12, par17, par22, par27, par32, par37, par42, par47, par52, par57, par62, par67, par72, par77, par82
</pre></div>
</div>
<p>One might prefer to express the phases in respect to a reference counter, <em>e.g.</em> the forward counter is the reference counter phase (fcp) whereas
the backward counter phase (bcp) is expressed as bcp = fcp + relative_bcp. If the fitting is done along these lines, the phases in the Fourier
block can be expressed the following way</p>
<div class="highlight-bash"><div class="highlight"><pre><span></span>phase parRX0 sep parX1 sep ... sep parXN
</pre></div>
</div>
<p>which means that <tt class="docutils literal"><span class="pre">X0</span></tt> is the reference phase, and all the other phases are relative phases in respect to <tt class="docutils literal"><span class="pre">X0</span></tt>, <em>i.e.</em> the absolut phase of
<tt class="docutils literal"><span class="pre">Xj</span></tt> would be the summ of the values of <tt class="docutils literal"><span class="pre">parX0</span></tt> and <tt class="docutils literal"><span class="pre">parXj</span></tt> etc. The reference phase in the list is marked by <tt class="docutils literal"><span class="pre">parR</span></tt> rather than <tt class="docutils literal"><span class="pre">par</span></tt>.
Obviously only <em>one</em> reference phase can be defined!</p>
</li>
<li><p class="first">Often the phases in the parameter block follow a clear list structure. This allows to write the Fourier phase parameters in a more compact form</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>phase par(X0, offset, #param)
</pre></div>
</div>
<p>with <tt class="docutils literal"><span class="pre">X0</span></tt> the first phase parameter index, <tt class="docutils literal"><span class="pre">offset</span></tt> being the offset to the next phase parameter, and <tt class="docutils literal"><span class="pre">#param</span></tt> being the number of phase parameters to be used.
This means that the previous example can be compacted to</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>phase par(7, 5, 16)
</pre></div>
</div>
<p>As in the phase parameter list examples before, also here a reference phase with relative phases might be wished. Differently to the phase parameter
list example, the first parameter number will be the reference phase. The compact notation here is</p>
<div class="highlight-none"><div class="highlight"><pre><span></span>phase parR(X0, offest, #param)
</pre></div>
</div>
</li>
</ol>
</dd>
</dl>
<span id="index-48"></span><dl class="docutils" id="msr-fourier-block-range-for-phase-correction">
<dt><strong>range_for_phase_correction</strong></dt>
@ -1570,8 +1618,7 @@ units Mc/s
fourier_power 12
apodization NONE
plot real_and_imag
phase 22.6 # par3
range_for_phase_correction all
phase par5, par8
range 0.0 17.03
</pre></div>
</div>
@ -2162,7 +2209,7 @@ In case this cannot be ensured, the parallelization can be disabled by <em>&#821
</div>
<div class="footer">
&copy; Copyright 2018, Andreas Suter.
Last updated on Jul 03, 2018.
Last updated on Nov 13, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div>
</body>

View File

@ -49,6 +49,7 @@ add_executable(any2many git-revision.h any2many.cpp)
target_compile_options(any2many BEFORE PRIVATE "-DHAVE_CONFIG_H")
target_include_directories(any2many
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
@ -93,6 +94,7 @@ add_executable(musrfit git-revision.h musrfit.cpp)
target_compile_options(musrfit BEFORE PRIVATE "-DHAVE_CONFIG_H")
target_include_directories(musrfit
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
@ -104,6 +106,7 @@ add_executable(musrFT git-revision.h musrFT.cpp)
target_compile_options(musrFT BEFORE PRIVATE "-DHAVE_CONFIG_H")
target_include_directories(musrFT
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
@ -127,6 +130,7 @@ add_executable(musrt0 git-revision.h musrt0.cpp)
target_compile_options(musrt0 BEFORE PRIVATE "-DHAVE_CONFIG_H")
target_include_directories(musrt0
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>
@ -138,6 +142,7 @@ add_executable(musrview git-revision.h musrview.cpp)
target_compile_options(musrview BEFORE PRIVATE "-DHAVE_CONFIG_H")
target_include_directories(musrview
BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}>
$<BUILD_INTERFACE:${CMAKE_BINARY_DIR}/src>

View File

@ -11,13 +11,13 @@ root_generate_dictionary(
)
root_generate_dictionary(
PMusrCanvasDict
-I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PMusrCanvas.h
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PMusrCanvas.h
LINKDEF ${MUSRFIT_INC}/PMusrCanvasLinkDef.h
MODULE PMusrCanvas
)
root_generate_dictionary(
PMusrT0Dict
-I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PMusrT0.h
-I${Boost_INCLUDE_DIR} -I${FFTW3_INCLUDE_DIR} ${MUSRFIT_INC}/PMusrT0.h
LINKDEF ${MUSRFIT_INC}/PMusrT0LinkDef.h
MODULE PMusrT0
)
@ -81,6 +81,7 @@ add_library(PMusr SHARED
#--- make sure that the include directory is found ----------------------------
target_include_directories(
PMusr BEFORE PRIVATE
$<BUILD_INTERFACE:${Boost_INCLUDE_DIR}>
$<BUILD_INTERFACE:${FFTW3_INCLUDE_DIR}>
$<BUILD_INTERFACE:${NEXUS_INCLUDE_DIR}>
$<BUILD_INTERFACE:${MUSRFIT_INC}>

View File

@ -1025,12 +1025,11 @@ bool PMsr2Data::PrepareGlobalInputFile(unsigned int tempRun, const string &msrOu
}
// FOURIER block - in case a parameter is used for the phase
tempPar = fMsrHandler->GetMsrFourierList()->fPhaseParamNo;
if (tempPar > 0) {
if (fMsrHandler->GetMsrFourierList()->fPhaseParamNo.size() > 0) {
// go through the whole parameter list ...
for (unsigned int k(0); k < msrParamList->size(); ++k) {
if (tempPar == msrParamList->at(k).fNo) {
fMsrHandler->GetMsrFourierList()->fPhaseParamNo = k + 1;
fMsrHandler->GetMsrFourierList()->fPhaseParamNo.push_back(k + 1);
break;
}
}
@ -2199,7 +2198,8 @@ int PMsr2Data::WriteOutput(const string &outfile, const vector<unsigned int>& pa
WriteValue(outFile, (*msrParamList)[i].fValue, (*msrParamList)[i].fPosError, outFile.width(), db);
outFile << ", ";
} else {
outFile << (*msrParamList)[i].fValue << ", ";
WriteValue(outFile, (*msrParamList)[i].fValue, fabs((*msrParamList)[i].fStep), outFile.width(), db);
outFile << ", ";
}
if ((*msrParamList)[i].fPosErrorPresent) {
WriteValue(outFile, (*msrParamList)[i].fPosError, (*msrParamList)[i].fPosError, outFile.width(), db);
@ -2417,7 +2417,7 @@ int PMsr2Data::WriteOutput(const string &outfile, const vector<unsigned int>& pa
if ((*msrParamList)[i].fPosErrorPresent)
WriteValue(outFile, (*msrParamList)[i].fValue, (*msrParamList)[i].fPosError, maxlength, db);
else
WriteValue(outFile, (*msrParamList)[i].fValue, maxlength);
WriteValue(outFile, (*msrParamList)[i].fValue, fabs((*msrParamList)[i].fStep), maxlength, db);
if ((*msrParamList)[i].fPosErrorPresent)
WriteValue(outFile, (*msrParamList)[i].fPosError, (*msrParamList)[i].fPosError, maxlength, db);

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2016 by Andreas Suter *
* Copyright (C) 2007-2018 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -324,6 +324,15 @@ Int_t PMsrHandler::ReadMsrFile()
CheckLegacyLifetimecorrection(); // check if lifetimecorrection is found in RUN blocks, if yes transfer it to PLOT blocks
}
// check if the given phases in the Fourier block are in agreement with the Plot block settings
if ((fFourier.fPhase.size() > 1) && (fPlots.size() > 0)) {
if (fFourier.fPhase.size() != fPlots[0].fRuns.size()) {
cerr << endl << ">> PMsrHandler::ReadMsrFile: **ERROR** if more than one phase is given in the Fourier block,";
cerr << endl << ">> it needs to correspond to the number of runs in the Plot block!" << endl;
result = PMUSR_MSR_SYNTAX_ERROR;
}
}
// clean up
fit_parameter.clear();
theory.clear();
@ -1122,12 +1131,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
fout << " # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL";
fout << endl;
} else if (sstr.BeginsWith("phase")) {
if (fFourier.fPhaseParamNo > 0) {
fout << "phase par" << fFourier.fPhaseParamNo << endl;
} else {
if (fFourier.fPhase != -999.0) {
fout << "phase " << fFourier.fPhase << endl;
if (fFourier.fPhaseParamNo.size() > 0) {
TString phaseParamStr = BeautifyFourierPhaseParameterString();
fout << "phase " << phaseParamStr << endl;
} else if (fFourier.fPhase.size() > 0) {
fout << "phase ";
for (UInt_t i=0; i<fFourier.fPhase.size()-1; i++) {
fout << fFourier.fPhase[i] << ", ";
}
fout << fFourier.fPhase[fFourier.fPhase.size()-1] << endl;
}
} else if (sstr.BeginsWith("range_for_phase_correction")) {
fout << "range_for_phase_correction " << fFourier.fRangeForPhaseCorrection[0] << " " << fFourier.fRangeForPhaseCorrection[1] << endl;
@ -2213,11 +2225,16 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map<UInt_t, TString> *co
fout << endl;
}
// phase
if (fFourier.fPhaseParamNo > 0) {
fout << "phase par" << fFourier.fPhaseParamNo << endl;
} else if (fFourier.fPhase != -999.0) {
fout << "phase " << fFourier.fPhase << endl;
// phase
if (fFourier.fPhaseParamNo.size() > 0) {
TString phaseParamStr = BeautifyFourierPhaseParameterString();
fout << "phase " << phaseParamStr << endl;
} else if (fFourier.fPhase.size() > 0) {
fout << "phase ";
for (UInt_t i=0; i<fFourier.fPhase.size()-1; i++) {
fout << fFourier.fPhase[i] << ", ";
}
fout << fFourier.fPhase[fFourier.fPhase.size()-1] << endl;
}
// range_for_phase_correction
@ -3879,14 +3896,306 @@ void PMsrHandler::InitFourierParameterStructure(PMsrFourierStructure &fourier)
fourier.fDCCorrected = false; // dc-corrected FFT, default: false
fourier.fApodization = FOURIER_APOD_NOT_GIVEN; // apodization, default: NOT GIVEN
fourier.fPlotTag = FOURIER_PLOT_NOT_GIVEN; // initial plot tag, default: NOT GIVEN
fourier.fPhaseParamNo = 0; // initial parameter no = 0 means not a parameter
fourier.fPhase = -999.0; // fourier phase: -999 = NOT GIVEN
fourier.fPhaseRef = -1; // initial phase reference -1 means: use absolute phases
fourier.fPhaseParamNo.clear(); // initial phase parameter no vector is empty
fourier.fPhase.clear(); // initial phase vector is empty
for (UInt_t i=0; i<2; i++) {
fourier.fRangeForPhaseCorrection[i] = -1.0; // frequency range for phase correction, default: {-1, -1} = NOT GIVEN
fourier.fPlotRange[i] = -1.0; // fourier plot range, default: {-1, -1} = NOT GIVEN
fourier.fRangeForPhaseCorrection[i] = -1.0; // frequency range for phase correction, default: {-1, -1} = NOT GIVEN
fourier.fPlotRange[i] = -1.0; // fourier plot range, default: {-1, -1} = NOT GIVEN
}
}
//--------------------------------------------------------------------------
// RemoveComment (private)
//--------------------------------------------------------------------------
/**
* <p>Removes a potentially present comment from str and returns the truncated
* string in truncStr. A comment starts with '#'
*
* @param str original string which might contain a comment
* @param truncStr string from which the comment has been removed
*/
void PMsrHandler::RemoveComment(const TString &str, TString &truncStr)
{
truncStr = str;
Ssiz_t idx = str.First('#'); // find the index of the comment character
// truncate string if comment is found
if (idx > 0) {
truncStr.Resize(idx-1);
}
}
//--------------------------------------------------------------------------
// ParseFourierPhaseValueVector (private)
//--------------------------------------------------------------------------
/**
* <p>examines if str has the form 'phase val0 [sep val1 ... sep valN]'.
* If this form is found, fill in val0 ... valN to fFourier.fPhase
* vector.
*
* @param fourier msr-file Fourier structure
* @param str string to be analyzed
* @param error flag needed to propagate a fatal error
*
* @return true if a phase value form is found, otherwise return false
*/
Bool_t PMsrHandler::ParseFourierPhaseValueVector(PMsrFourierStructure &fourier, const TString &str, Bool_t &error)
{
Bool_t result = true;
TObjArray *tok = str.Tokenize(" ,;\t");
if (tok == 0) {
cerr << endl << ">> PMsrHandler::ParseFourierPhaseValueVector: **ERROR** couldn't tokenize Fourier phase line." << endl << endl;
return false;
}
// make sure there are enough tokens
if (tok->GetEntries() < 2) {
error = true;
return false;
}
// convert all acceptable tokens
TObjString *ostr=0;
TString sstr("");
for (Int_t i=1; i<tok->GetEntries(); i++) {
ostr = dynamic_cast<TObjString*>(tok->At(i));
sstr = ostr->GetString();
if (sstr.IsFloat()) {
fourier.fPhase.push_back(sstr.Atof());
} else {
result = false;
if (i>1) { // make sure that no 'phase val, parX' mixture is present
cerr << endl << ">> PMsrHandler::ParseFourierPhaseValueVector: **ERROR** in Fourier phase line.";
cerr << endl << ">> Attempt to mix val, parX? This is currently not supported." << endl << endl;
error = true;
}
break;
}
}
// clean up
if (tok) {
delete tok;
}
return result;
}
//--------------------------------------------------------------------------
// ParseFourierPhaseParVector (private)
//--------------------------------------------------------------------------
/**
* <p> examines if str has the form 'phase parX0 [sep parX1 ... sep parXN]'.
* Also allowed is that instead of parXn only one of the parameters could have the
* form parRn which markes a reference phase for relative phase fittings.
* If this form is found, fill in parX0 ... parXN to fourier.fPhaseParamNo, and
* in case a parR is present, set the fourier.fPhaseRef accordingly.
*
* @param fourier msr-file Fourier structure
* @param str string to be analyzed
* @param error flag needed to propagate a fatal error
*
* @return true if a phase parameter form is found, otherwise return false
*/
Bool_t PMsrHandler::ParseFourierPhaseParVector(PMsrFourierStructure &fourier, const TString &str, Bool_t &error)
{
Bool_t result = true;
Int_t refCount = 0;
TObjArray *tok = str.Tokenize(" ,;\t");
if (tok == 0) {
cerr << endl << ">> PMsrHandler::ParseFourierPhaseParVector: **ERROR** couldn't tokenize Fourier phase line." << endl << endl;
return false;
}
// make sure there are enough tokens
if (tok->GetEntries() < 2) {
error = true;
return false;
}
// check that all tokens start with par
TString sstr;
for (Int_t i=1; i<tok->GetEntries(); i++) {
TObjString *ostr = dynamic_cast<TObjString*>(tok->At(i));
sstr = ostr->GetString();
if (!sstr.BeginsWith("par")) {
cerr << ">> PMsrHandler::ParseFourierPhaseParVector: **ERROR** found unhandable token '" << sstr << "'" << endl;
error = true;
result = false;
break;
}
if (sstr.BeginsWith("parR")) {
refCount++;
}
// rule out par(X, offset, #Param) syntax
if (sstr.BeginsWith("par(")) {
result = false;
break;
}
}
if (refCount > 1) {
cerr << ">> PMsrHandler::ParseFourierPhaseParVector: **ERROR** found multiple parR's! Only one reference phase is accepted." << endl;
result = false;
}
// check that token has the form parX, where X is an int
Int_t rmNoOf = 3;
if (result != false) {
for (Int_t i=1; i<tok->GetEntries(); i++) {
TObjString *ostr = dynamic_cast<TObjString*>(tok->At(i));
sstr = ostr->GetString();
rmNoOf = 3;
if (sstr.BeginsWith("parR")) {
rmNoOf++;
}
sstr.Remove(0, rmNoOf); // remove 'par' of 'parR' part. Rest should be an integer
if (sstr.IsDigit()) {
if (rmNoOf == 4) // parR
fourier.fPhaseRef = sstr.Atoi();
fourier.fPhaseParamNo.push_back(sstr.Atoi());
} else {
cerr << ">> PMsrHandler::ParseFourierPhaseParVector: **ERROR** found token '" << ostr->GetString() << "' which is not parX with X an integer." << endl;
fourier.fPhaseParamNo.clear();
error = true;
break;
}
}
}
if (fourier.fPhaseParamNo.size() == tok->GetEntries()-1) { // everything as expected
result = true;
} else {
result = false;
}
// clean up
if (tok) {
delete tok;
}
return result;
}
//--------------------------------------------------------------------------
// ParseFourierPhaseParIterVector (private)
//--------------------------------------------------------------------------
/**
* <p> examines if str has the form 'phase par(X0, offset, #params)' or 'phase parR(X0, offset, #params)'.
* If this form is found, fill in parX0 ... parXN to fourier.fPhaseParamNo, and
* in case of 'parR' also set the fourier.fPhaseRef accordingly.
*
* @param fourier msr-file Fourier structure
* @param str string to be analyzed
* @param error flag needed to propagate a fatal error
*
* @return true if a phase parameter iterator form is found, otherwise return false
*/
Bool_t PMsrHandler::ParseFourierPhaseParIterVector(PMsrFourierStructure &fourier, const TString &str, Bool_t &error)
{
TString wstr = str;
// remove 'phase' from string
wstr.Remove(0, 5);
wstr = wstr.Strip(TString::kLeading, ' ');
// remove 'par(' from string if present, otherwise and error is issued
if (!wstr.BeginsWith("par(") && !wstr.BeginsWith("parR(")) {
cout << ">> PMsrHandler::ParseFourierPhaseParIterVector: **ERROR** token should start with 'par(' or 'parR(', found: '" << wstr << "' -> ERROR" << endl;
error = true;
return false;
}
Int_t noOf = 4; // number of characters to be removed
Bool_t relativePhase = false; // relative phase handling wished
if (wstr.BeginsWith("parR(")) {
noOf += 1;
relativePhase = true;
}
wstr.Remove(0, noOf);
// remove trailing white spaces
wstr = wstr.Strip(TString::kTrailing, ' ');
// remove last ')'
Ssiz_t idx=wstr.Last(')');
wstr.Remove(idx, wstr.Length()-idx);
// tokenize rest which should have the form 'X0, offset, #Param'
TObjArray *tok = wstr.Tokenize(",;");
if (tok == 0) {
cerr << ">> PMsrHandler::ParseFourierPhaseParIterVector: **ERROR** tokenize failed." << endl;
error = true;
return false;
}
// check for proper number of expected elements
if (tok->GetEntries() != 3) {
cerr << ">> PMsrHandler::ParseFourierPhaseParIterVector: **ERROR** wrong syntax for the expected par(X0, offset, #param)." << endl;
error = true;
delete tok;
return false;
}
Int_t x0, offset, noParam;
// get X0
TObjString *ostr = dynamic_cast<TObjString*>(tok->At(0));
wstr = ostr->GetString();
if (wstr.IsDigit()) {
x0 = wstr.Atoi();
} else {
cerr << ">> PMsrHandler::ParseFourierPhaseParIterVector: **ERROR** X0='" << wstr << "' is not an integer." << endl;
error = true;
delete tok;
return false;
}
// get offset
ostr = dynamic_cast<TObjString*>(tok->At(1));
wstr = ostr->GetString();
if (wstr.IsDigit()) {
offset = wstr.Atoi();
} else {
cerr << ">> PMsrHandler::ParseFourierPhaseParIterVector: **ERROR** offset='" << wstr << "' is not an integer." << endl;
error = true;
delete tok;
return false;
}
// get noParam
ostr = dynamic_cast<TObjString*>(tok->At(2));
wstr = ostr->GetString();
if (wstr.IsDigit()) {
noParam = wstr.Atoi();
} else {
cerr << ">> PMsrHandler::ParseFourierPhaseParIterVector: **ERROR** #Param='" << wstr << "' is not an integer." << endl;
error = true;
delete tok;
return false;
}
// set the reference phase parameter number for 'parR'
if (relativePhase)
fourier.fPhaseRef = x0;
else
fourier.fPhaseRef = -1;
for (Int_t i=0; i<noParam; i++)
fourier.fPhaseParamNo.push_back(x0 + i*offset);
// clean up
if (tok) {
delete tok;
}
return true;
}
//--------------------------------------------------------------------------
// HandleFourierEntry (private)
//--------------------------------------------------------------------------
@ -4031,39 +4340,66 @@ Bool_t PMsrHandler::HandleFourierEntry(PMsrLines &lines)
}
}
} else if (iter->fLine.BeginsWith("phase", TString::kIgnoreCase)) { // phase
if (tokens->GetEntries() < 2) { // phase value is missing
if (tokens->GetEntries() < 2) { // phase value(s)/par(s) is(are) missing
error = true;
continue;
} else {
ostr = dynamic_cast<TObjString*>(tokens->At(1));
str = ostr->GetString();
if (str.BeginsWith("par", TString::kIgnoreCase)) { // parameter value
if (fFourierOnly) {
cerr << endl << ">> PMsrHandler::HandleFourierEntry: **WARNING** Found phase parameter for Fourier only.";
cerr << endl << ">> This is currently not supported. Will set the phase to 0." << endl;
fourier.fPhase = 0.0;
} else {
Int_t no = 0;
if (FilterNumber(str, "par", 0, no)) {
// check that the parameter is in range
if ((Int_t)fParam.size() < no) {
error = true;
continue;
}
// keep the parameter number
fourier.fPhaseParamNo = no;
// get parameter value
fourier.fPhase = fParam[no-1].fValue;
} else {
// allowed phase parameter patterns:
// (i) phase val [sep val sep val ...] [# comment], val=double, sep=' ,;\t'
// (ii) phase parX0 [sep parX1 sep parX2 ...] [# comment], val=double, sep=' ,;\t'
// (iii) phase par(X0 sep1 offset sep1 #param) [# comment], sep1= ',;'
// remove potential comment
TString wstr("");
RemoveComment(iter->fLine, wstr);
// check for 'phase val ...'
Bool_t result = ParseFourierPhaseValueVector(fourier, wstr, error);
if (error)
continue;
// check for 'phase parX0 ...' if not already val are found
if (!result) {
result = ParseFourierPhaseParVector(fourier, wstr, error);
if (error)
continue;
}
// check for 'phase par(X0, offset, #param)' if not already covered by the previous ones
if (!result) {
result = ParseFourierPhaseParIterVector(fourier, wstr, error);
}
if (!result || error) {
continue;
}
// if parameter vector is given: check that all parameters are within range
if (fourier.fPhaseParamNo.size() > 0) {
for (UInt_t i=0; i<fourier.fPhaseParamNo.size(); i++) {
if (fourier.fPhaseParamNo[i] > fParam.size()) {
cerr << ">> PMsrHandler::HandleFourierEntry: found Fourier parameter entry par" << fourier.fPhaseParamNo[i] << " > #Param = " << fParam.size() << endl;
error = true;
--iter;
continue;
}
}
} else if (str.IsFloat()) { // phase value
fourier.fPhase = str.Atof();
} else {
error = true;
continue;
}
// if parameter vector is given -> fill corresponding phase values
Double_t phaseRef = 0.0;
if (fourier.fPhaseParamNo.size() > 0) {
// check if a relative parameter phase number is set
if (fourier.fPhaseRef != -1) {
phaseRef = fParam[fourier.fPhaseRef-1].fValue;
}
fourier.fPhase.clear();
for (UInt_t i=0; i<fourier.fPhaseParamNo.size(); i++) {
if (fourier.fPhaseRef == fourier.fPhaseParamNo[i]) // reference phase
fourier.fPhase.push_back(fParam[fourier.fPhaseParamNo[i]-1].fValue);
else
fourier.fPhase.push_back(fParam[fourier.fPhaseParamNo[i]-1].fValue+phaseRef);
}
}
}
} else if (iter->fLine.BeginsWith("range_for_phase_correction", TString::kIgnoreCase)) {
@ -4162,7 +4498,11 @@ Bool_t PMsrHandler::HandleFourierEntry(PMsrLines &lines)
cerr << endl << ">> [dc-corrected true | false]";
cerr << endl << ">> [apodization none | weak | medium | strong]";
cerr << endl << ">> [plot real | imag | real_and_imag | power | phase | phase_opt_real]";
cerr << endl << ">> [phase value]";
cerr << endl << ">> [phase valList | parList | parIterList [# comment]]";
cerr << endl << ">> valList : val [sep val ... sep val]. sep=' ,;\\t'";
cerr << endl << ">> parList : parX0 [sep parX1 ... sep parX1]";
cerr << endl << ">> parIterList : par(X0,offset,#param), with X0=first parameter number";
cerr << endl << ">> offset=parameter offset, #param=number of phase parameters.";
cerr << endl << ">> [range_for_phase_correction min max | all]";
cerr << endl << ">> [range min max]";
cerr << endl;
@ -6294,6 +6634,75 @@ void PMsrHandler::MakeDetectorGroupingString(TString str, PIntVector &group, TSt
} while (i<group.size());
}
//--------------------------------------------------------------------------
// BeautifyFourierPhaseParameterString (private)
//--------------------------------------------------------------------------
/**
* <p>Returns the Fourier phase string if the phase is either of type
* phase parX0 sep ... sep parXn where sep = ',' or
* phase par(X0, offset, #param)
*
* @return Fourier phase parameter string if phase parameter(s) is(are) given, "??" otherwise
*/
TString PMsrHandler::BeautifyFourierPhaseParameterString()
{
TString str("??");
TString formatStr("par%d, par%d");
if (fFourier.fPhaseParamNo.size() == 0)
return str;
Int_t phaseRef = fFourier.fPhaseRef;
if (fFourier.fPhaseParamNo.size() == 1) {
str = TString::Format("par%d", fFourier.fPhaseParamNo[0]);
} else if (fFourier.fPhaseParamNo.size() == 2) {
if (phaseRef == fFourier.fPhaseParamNo[0])
formatStr = "parR%d, par%d";
if (phaseRef == fFourier.fPhaseParamNo[1])
formatStr = "par%d, parR%d";
str = TString::Format(formatStr, fFourier.fPhaseParamNo[0], fFourier.fPhaseParamNo[1]);
} else {
Bool_t phaseIter = true;
// first check if fPhaseParamNo vector can be compacted into par(X0, offset, #param) form
Int_t offset = fFourier.fPhaseParamNo[1] - fFourier.fPhaseParamNo[0];
for (Int_t i=2; i<fFourier.fPhaseParamNo.size(); i++) {
if (fFourier.fPhaseParamNo[i]-fFourier.fPhaseParamNo[i-1] != offset) {
phaseIter = false;
break;
}
}
if (phaseIter) {
if (phaseRef != -1) {
str = TString::Format("parR(%d, %d, %d)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
} else {
str = TString::Format("par(%d, %d, %d)", fFourier.fPhaseParamNo[0], offset, fFourier.fPhaseParamNo.size());
}
} else {
str = TString("");
for (Int_t i=0; i<fFourier.fPhaseParamNo.size()-1; i++) {
if (phaseRef == fFourier.fPhaseParamNo[i]) {
str += "parR";
} else {
str += "par";
}
str += fFourier.fPhaseParamNo[i];
str += ", ";
}
if (phaseRef == fFourier.fPhaseParamNo[fFourier.fPhaseParamNo.size()-1]) {
str += "parR";
} else {
str += "par";
}
str += fFourier.fPhaseParamNo[fFourier.fPhaseParamNo.size()-1];
}
}
return str;
}
//--------------------------------------------------------------------------
// CheckLegacyLifetimecorrection (private)
//--------------------------------------------------------------------------

View File

@ -28,6 +28,7 @@
***************************************************************************/
#include <iostream>
#include <iomanip>
#include <fstream>
using namespace std;
@ -152,7 +153,6 @@ PMusrCanvas::PMusrCanvas()
InitFourier();
InitAverage();
fCurrentFourierPhase = fFourier.fPhaseIncrement;
fCurrentFourierPhaseText = 0;
fRRFText = 0;
@ -205,7 +205,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
CreateStyle();
InitMusrCanvas(title, wtopx, wtopy, ww, wh);
fCurrentFourierPhase = 0.0;
fCurrentFourierPhaseText = 0;
fRRFText = 0;
@ -262,7 +261,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
CreateStyle();
InitMusrCanvas(title, wtopx, wtopy, ww, wh);
fCurrentFourierPhase = 0.0;
fCurrentFourierPhaseText = 0;
fRRFText = 0;
@ -322,10 +320,6 @@ PMusrCanvas::~PMusrCanvas()
CleanupDataSet(fNonMusrData[i]);
fNonMusrData.clear();
}
if (fCurrentFourierPhaseText) {
delete fCurrentFourierPhaseText;
fCurrentFourierPhaseText = 0;
}
if (fMultiGraphLegend) {
fMultiGraphLegend->Clear();
delete fMultiGraphLegend;
@ -394,9 +388,8 @@ void PMusrCanvas::SetMsrHandler(PMsrHandler *msrHandler)
if (fMsrHandler->GetMsrFourierList()->fPlotTag != FOURIER_PLOT_NOT_GIVEN) {
fFourier.fPlotTag = fMsrHandler->GetMsrFourierList()->fPlotTag;
}
if (fMsrHandler->GetMsrFourierList()->fPhase != -999.0) {
fFourier.fPhase = fMsrHandler->GetMsrFourierList()->fPhase;
}
fFourier.fPhase = fMsrHandler->GetMsrFourierList()->fPhase;
if ((fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0] != -1.0) &&
(fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[1] != -1.0)) {
fFourier.fRangeForPhaseCorrection[0] = fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0];
@ -2221,10 +2214,10 @@ void PMusrCanvas::ExportData(const Char_t *fileName)
// write data/theory
for (UInt_t j=0; j<dumpVector.size()-1; j++) {
if (i<dumpVector[j].dataX.size()) {
fout << dumpVector[j].dataX[i] << ", ";
fout << dumpVector[j].data[i] << ", ";
fout << setprecision(9) << dumpVector[j].dataX[i] << ", ";
fout << setprecision(9) << dumpVector[j].data[i] << ", ";
if (dumpVector[j].dataErr.size() > 0)
fout << dumpVector[j].dataErr[i] << ", ";
fout << setprecision(9) << dumpVector[j].dataErr[i] << ", ";
} else {
if (dumpVector[j].dataErr.size() > 0)
fout << " , , , ";
@ -2234,8 +2227,8 @@ void PMusrCanvas::ExportData(const Char_t *fileName)
}
// write last data/theory entry
if (i<dumpVector[dumpVector.size()-1].dataX.size()) {
fout << dumpVector[dumpVector.size()-1].dataX[i] << ", ";
fout << dumpVector[dumpVector.size()-1].data[i];
fout << setprecision(9) << dumpVector[dumpVector.size()-1].dataX[i] << ", ";
fout << setprecision(9) << dumpVector[dumpVector.size()-1].data[i];
} else {
fout << " , ";
}
@ -2326,7 +2319,8 @@ void PMusrCanvas::InitFourier()
fFourier.fFourierPower = 0; // no zero padding
fFourier.fApodization = FOURIER_APOD_NONE; // no apodization
fFourier.fPlotTag = FOURIER_PLOT_REAL_AND_IMAG; // initial plot tag, plot real and imaginary part
fFourier.fPhase = 0.0; // fourier phase 0°
fFourier.fPhaseParamNo.clear();
fFourier.fPhase.clear();
for (UInt_t i=0; i<2; i++) {
fFourier.fRangeForPhaseCorrection[i] = -1.0; // frequency range for phase correction, default: {-1, -1} = NOT GIVEN
fFourier.fPlotRange[i] = -1.0; // fourier plot range, default: {-1, -1} = NOT GIVEN
@ -3480,13 +3474,20 @@ void PMusrCanvas::HandleFourier()
}
// apply global phase if present
if (fFourier.fPhase != 0.0) {
const double cp = TMath::Cos(fFourier.fPhase/180.0*TMath::Pi());
const double sp = TMath::Sin(fFourier.fPhase/180.0*TMath::Pi());
if (fFourier.fPhase.size() != 0.0) {
double cp;
double sp;
fCurrentFourierPhase = fFourier.fPhase;
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets
if (fFourier.fPhase.size() == 1) {
cp = TMath::Cos(fFourier.fPhase[0]/180.0*TMath::Pi());
sp = TMath::Sin(fFourier.fPhase[0]/180.0*TMath::Pi());
} else {
cp = TMath::Cos(fFourier.fPhase[i]/180.0*TMath::Pi());
sp = TMath::Sin(fFourier.fPhase[i]/180.0*TMath::Pi());
}
if ((fData[i].dataFourierRe != 0) && (fData[i].dataFourierIm != 0)) {
for (Int_t j=0; j<fData[i].dataFourierRe->GetNbinsX(); j++) { // loop over a fourier data set
// calculate new fourier data set value
@ -3583,16 +3584,23 @@ void PMusrCanvas::HandleDifferenceFourier()
fData[i].diffFourierTag = 1; // d-f
}
// apply global phase
if (fFourier.fPhase != 0.0) {
// apply phase
if (fFourier.fPhase.size() != 0.0) {
double re, im;
const double cp = TMath::Cos(fFourier.fPhase/180.0*TMath::Pi());
const double sp = TMath::Sin(fFourier.fPhase/180.0*TMath::Pi());
double cp;
double sp;
fCurrentFourierPhase = fFourier.fPhase;
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets
if ((fData[i].diffFourierRe != 0) && (fData[i].diffFourierIm != 0)) {
if (fFourier.fPhase.size() == 1) {
cp = TMath::Cos(fFourier.fPhase[0]/180.0*TMath::Pi());
sp = TMath::Sin(fFourier.fPhase[0]/180.0*TMath::Pi());
} else {
cp = TMath::Cos(fFourier.fPhase[i]/180.0*TMath::Pi());
sp = TMath::Sin(fFourier.fPhase[i]/180.0*TMath::Pi());
}
for (Int_t j=0; j<fData[i].diffFourierRe->GetNbinsX(); j++) { // loop over a fourier data set
// calculate new fourier data set value
re = fData[i].diffFourierRe->GetBinContent(j) * cp + fData[i].diffFourierIm->GetBinContent(j) * sp;
@ -6074,7 +6082,10 @@ void PMusrCanvas::PlotFourierPhaseValue(Bool_t unzoom)
// plot Fourier phase
str = TString("phase = ");
str += fCurrentFourierPhase;
str += fCurrentFourierPhase[0];
if (fFourier.fPhase.size() > 1) { // if more than one phase is present, do NOT plot phase info
str = TString("");
}
x = 0.7;
y = 0.85;
fCurrentFourierPhaseText = new TLatex();
@ -6336,7 +6347,8 @@ void PMusrCanvas::IncrementFourierPhase()
const double cp = TMath::Cos(fFourier.fPhaseIncrement/180.0*TMath::Pi());
const double sp = TMath::Sin(fFourier.fPhaseIncrement/180.0*TMath::Pi());
fCurrentFourierPhase += fFourier.fPhaseIncrement;
for (UInt_t i=0; i<fCurrentFourierPhase.size(); i++)
fCurrentFourierPhase[i] += fFourier.fPhaseIncrement;
PlotFourierPhaseValue();
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets
@ -6388,7 +6400,8 @@ void PMusrCanvas::DecrementFourierPhase()
const double cp = TMath::Cos(fFourier.fPhaseIncrement/180.0*TMath::Pi());
const double sp = TMath::Sin(fFourier.fPhaseIncrement/180.0*TMath::Pi());
fCurrentFourierPhase -= fFourier.fPhaseIncrement;
for (UInt_t i=0; i<fCurrentFourierPhase.size(); i++)
fCurrentFourierPhase[i] -= fFourier.fPhaseIncrement;
PlotFourierPhaseValue();
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets

View File

@ -1640,8 +1640,8 @@ Bool_t PRunAsymmetry::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *globalB
}
// fill in the T0's from the msr-file (if present)
for (Int_t j=0; j<fRunInfo->GetAddT0BinSize(i); j++) {
fAddT0s[i-1][j] = fRunInfo->GetAddT0Bin(i, j);
for (Int_t j=0; j<fRunInfo->GetAddT0BinSize(i-1); j++) {
fAddT0s[i-1][j] = fRunInfo->GetAddT0Bin(i-1, j);
}
// fill in the T0's from the data file, if not already present in the msr-file

View File

@ -1278,8 +1278,8 @@ Bool_t PRunAsymmetryRRF::GetProperT0(PRawRunData* runData, PMsrGlobalBlock *glob
}
// fill in the T0's from the msr-file (if present)
for (Int_t j=0; j<fRunInfo->GetAddT0BinSize(i); j++) {
fAddT0s[i-1][j] = fRunInfo->GetAddT0Bin(i, j);
for (Int_t j=0; j<fRunInfo->GetAddT0BinSize(i-1); j++) {
fAddT0s[i-1][j] = fRunInfo->GetAddT0Bin(i-1, j);
}
// fill in the T0's from the data file, if not already present in the msr-file

View File

@ -192,7 +192,6 @@ void PStartupHandler::OnStartDocument()
fFourierDefaults.fFourierPower = 0;
fFourierDefaults.fApodization = FOURIER_APOD_NONE;
fFourierDefaults.fPlotTag = FOURIER_PLOT_REAL_AND_IMAG;
fFourierDefaults.fPhase = 0.0;
fFourierDefaults.fRangeForPhaseCorrection[0] = -1.0;
fFourierDefaults.fRangeForPhaseCorrection[1] = -1.0;
fFourierDefaults.fPlotRange[0] = -1.0;
@ -412,7 +411,7 @@ void PStartupHandler::OnCharacters(const Char_t *str)
case ePhase:
tstr = TString(str);
if (tstr.IsFloat()) {
fFourierDefaults.fPhase = tstr.Atof();
fFourierDefaults.fPhase.push_back(tstr.Atof());
} else {
cerr << endl << "PStartupHandler **WARNING** '" << str << "' is not a valid phase, will ignore it.";
cerr << endl;

View File

@ -2,9 +2,10 @@
#--- generate necessary dictionaries ------------------------------------------
set(MUSRFIT_INC ${CMAKE_SOURCE_DIR}/src/include)
root_generate_dictionary(
PMagProximityFitterDict
-I${FFTW3_INCLUDE}
-I${FFTW3_INCLUDE_DIR}
-I${MUSRFIT_INC}
PMagProximityFitter.h
LINKDEF PMagProximityFitterLinkDef.h

View File

@ -4,18 +4,18 @@
set(MUSRFIT_INC ${CMAKE_SOURCE_DIR}/src/include)
root_generate_dictionary(
libLineProfileDict
LineProfileDict
-I${FFTW3_INCLUDE_DIR}
-I${MUSRFIT_INC}
libLineProfile.h
LINKDEF libLineProfileLinkDef.h
MODULE libLineProfile
LineProfile.h
LINKDEF LineProfileLinkDef.h
MODULE LineProfile
)
#--- lib creation -------------------------------------------------------------
add_library(LineProfile SHARED
libLineProfile.cpp
libLineProfileDict.cxx
LineProfile.cpp
LineProfileDict.cxx
)
#--- make sure that the include directory is found ----------------------------
@ -48,7 +48,7 @@ install(
#--- install libLineProfile header ---------------------------------------------------
install(
FILES
libLineProfile.h
LineProfile.h
DESTINATION
include
)

View File

@ -20,7 +20,7 @@
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
#include "libLineProfile.h"
#include "LineProfile.h"
#include <iostream> //for testing purposes
//Implement helperfunctions

View File

@ -1,19 +1,19 @@
## Process this file with automake to create Makefile.in
h_sources = \
libLineProfile.h
LineProfile.h
h_linkdef = \
libLineProfile.h
LineProfile.h
dict_h_sources = \
libLineProfileDict.h
LineProfileDict.h
cpp_sources = \
libLineProfile.cpp
LineProfile.cpp
dict_cpp_sources = \
libLineProfileDict.cpp
LineProfileDict.cpp
include_HEADERS = $(h_sources)
noinst_HEADERS = $(h_linkdef) $(dict_h_sources)

View File

@ -146,6 +146,10 @@ class PMsrHandler
virtual void FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLines &run);
virtual void InitFourierParameterStructure(PMsrFourierStructure &fourier);
virtual void RemoveComment(const TString &str, TString &truncStr);
virtual Bool_t ParseFourierPhaseValueVector(PMsrFourierStructure &fourier, const TString &str, Bool_t &error);
virtual Bool_t ParseFourierPhaseParVector(PMsrFourierStructure &fourier, const TString &str, Bool_t &error);
virtual Bool_t ParseFourierPhaseParIterVector(PMsrFourierStructure &fourier, const TString &str, Bool_t &error);
virtual Bool_t FilterNumber(TString str, const Char_t *filter, Int_t offset, Int_t &no);
@ -153,6 +157,7 @@ class PMsrHandler
virtual UInt_t LastSignificant(Double_t dval, UInt_t precLimit=6);
virtual void MakeDetectorGroupingString(TString str, PIntVector &group, TString &result, Bool_t includeDetector = true);
virtual TString BeautifyFourierPhaseParameterString();
virtual void CheckLegacyLifetimecorrection();
};

View File

@ -8,7 +8,7 @@
***************************************************************************/
/***************************************************************************
* Copyright (C) 2007-2016 by Andreas Suter *
* Copyright (C) 2007-2018 by Andreas Suter *
* andreas.suter@psi.ch *
* *
* This program is free software; you can redistribute it and/or modify *
@ -745,8 +745,9 @@ typedef struct {
Int_t fFourierPower; ///< i.e. zero padding up to 2^fFourierPower, default = 0 which means NO zero padding
Int_t fApodization; ///< tag indicating the kind of apodization wished, 0=no appodization (default), 1=weak, 2=medium, 3=strong (for details see the docu)
Int_t fPlotTag; ///< tag used for initial plot. 0=real, 1=imaginary, 2=real & imaginary (default), 3=power, 4=phase
Int_t fPhaseParamNo; ///< parameter number if used instead of a phase value
Double_t fPhase; ///< phase
Int_t fPhaseRef; ///< phase reference for relative phase(s)
PIntVector fPhaseParamNo; ///< parameter number(s) if used instead of a phase value
PDoubleVector fPhase; ///< phase(s)
Double_t fRangeForPhaseCorrection[2]; ///< field/frequency range for automatic phase correction
Double_t fPlotRange[2]; ///< field/frequency plot range
Double_t fPhaseIncrement; ///< phase increment for manual phase optimization

View File

@ -252,7 +252,7 @@ class PMusrCanvas : public TObject, public TQObject
Bool_t fXRangePresent, fYRangePresent; ///< flag indicating if x-/y-range is present
Double_t fXmin, fXmax, fYmin, fYmax; ///< data/theory frame range
Double_t fCurrentFourierPhase; ///< holds the current Fourier phase
PDoubleVector fCurrentFourierPhase; ///< holds the current Fourier phase(s)
TLatex *fCurrentFourierPhaseText; ///< used in Re/Im Fourier to show the current phase in the pad
TString *fRRFText; ///< RRF information
TLatex *fRRFLatexText; ///< used to display RRF info

View File

@ -21,6 +21,9 @@ set(CMAKE_AUTOUIC OFF)
# add qt/rcc
qt5_add_resources(musrStep_rcc musrStep.qrc)
# remove generated files from automoc and autouic
set_property(SOURCE qrc_musrStep.cpp PROPERTY SKIP_AUTOMOC ON)
set(macosx_icon icons/musrStep.icns)
if (APPLE)
add_executable(musrStep MACOSX_BUNDLE

View File

@ -25,6 +25,9 @@ set(CMAKE_AUTOUIC OFF)
# add qt/rcc
qt5_add_resources(musrWiz_rcc musrWiz.qrc)
# remove generated files from automoc and autouic
set_property(SOURCE qrc_musrWiz.cpp PROPERTY SKIP_AUTOMOC ON)
set(macosx_icon icons/musrWiz.icns)
if (APPLE)
add_executable(musrWiz MACOSX_BUNDLE

View File

@ -5,16 +5,20 @@ find_package(Qt5WebEngine QUIET)
find_package(Qt5WebKit QUIET)
set(qt_libs Qt5::Core Qt5::Widgets Qt5::Network Qt5::Xml Qt5::Svg Qt5::PrintSupport)
set(Qt5NoWeb 0)
if (Qt5WebEngine_FOUND)
message("-- Qt5WebEngine is present.")
find_package(Qt5WebEngineWidgets QUIET CONFIG REQUIRED)
set(qt_libs ${qt_libs} Qt5::WebEngine Qt5::WebEngineWidgets)
# unset a potentially found Qt5Webkit
unset(Qt5WebKit_FOUND)
elseif (Qt5WebKit_FOUND)
message("-- Qt5WebKit is present.")
find_package(Qt5WebKitWidgets QUIET CONFIG REQUIRED)
set(qt_libs ${qt_libs} Qt5::WebKit Qt5::WebKitWidgets)
else (Qt5WebEngine_FOUND)
message("-- Neither Qt5WebEngine nor Qt5WebKit found.")
set(Qt5NoWeb 1)
endif (Qt5WebEngine_FOUND)
set(musredit_src
@ -80,6 +84,26 @@ qt5_wrap_ui(out_ui ${musredit_ui})
# add qt/rcc
qt5_add_resources(musredit_rcc musredit.qrc)
# remove generated files from automoc and autouic
set_property(SOURCE ui_PFindDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PReplaceDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PReplaceConfirmationDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PMusrEditAbout.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PPrefsDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetMusrFTOptionsDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetTitleBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetParameterBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetTheoryBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetFunctionsBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetAsymmetryRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetSingleHistoRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetNonMusrRunBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetFourierBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PGetPlotBlockDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PMsr2DataDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE ui_PChangeDefaultPathsDialog.h PROPERTY SKIP_AUTOMOC ON)
set_property(SOURCE qrc_musredit.cpp PROPERTY SKIP_AUTOMOC ON)
set(macosx_icon icons/musredit.icns)
if (APPLE)
add_executable(musredit MACOSX_BUNDLE
@ -96,6 +120,15 @@ else (APPLE)
)
endif (APPLE)
# set necessary tags depending if QtWebEngine, QtWebKit,
# or none of both are given
if (Qt5WebKit_FOUND)
target_compile_options(musredit
BEFORE PRIVATE
-DHAVE_QT_WEB_KIT
)
endif (Qt5WebKit_FOUND)
if (Qt5WebEngine_FOUND)
target_compile_options(musredit
BEFORE PRIVATE
@ -103,6 +136,13 @@ if (Qt5WebEngine_FOUND)
)
endif (Qt5WebEngine_FOUND)
if (Qt5NoWeb)
target_compile_options(musredit
BEFORE PRIVATE
-DHAVE_QT_NO_WEB
)
endif (Qt5NoWeb)
target_include_directories(musredit
BEFORE PRIVATE
$<BUILD_INTERFACE:${CMAKE_CURRENT_BINARY_DIR}>

View File

@ -302,6 +302,17 @@ void PChangeDefaultPathsDialog::saveDefaultPathList()
}
fileIn.close();
// check if there is any data_path is present in the musrfit_startup.xml
bool dataPathPresent = false;
QString str;
for (int i=0; i<fileContent.count(); i++) {
str = fileContent[i];
if (str.trimmed().startsWith("<data_path>")) {
dataPathPresent = true;
break;
}
}
// write the new musrfit_startup.xml
QFile fileOut(fDefaultPath->getPrefPathName());
if (!fileOut.open(QIODevice::WriteOnly | QIODevice::Text)) {
@ -309,11 +320,15 @@ void PChangeDefaultPathsDialog::saveDefaultPathList()
return;
}
QTextStream out(&fileOut);
QString str;
bool first = true;
for (int i=0; i<fileContent.count(); i++) {
str = fileContent[i];
if (!str.trimmed().startsWith("<data_path>")) {
// if not data_path was present, add the new data_paths just before the end of the musrfit_start.xml close tag
if ((dataPathPresent == false) && (str.trimmed().startsWith("</musrfit>"))) {
for (int j=0; j<fSearchPath_listWidget->count(); j++)
out << " <data_path>" << fSearchPath_listWidget->item(j)->text() << "</data_path>" << endl;
}
out << fileContent[i] << endl;
} else {
if (first) {

View File

@ -30,9 +30,13 @@
#include <QtWidgets>
#ifdef HAVE_QT_WEB_ENGINE
#include <QWebEngineView>
#else
#endif
#ifdef HAVE_QT_WEB_KIT
#include <QtWebKitWidgets>
#endif
#ifdef HAVE_QT_NO_WEB
#include <QPlainTextEdit>
#endif
#include <QNetworkProxyFactory>
#include <QtDebug>
@ -61,14 +65,24 @@ PHelp::PHelp(const QString &url, const bool isDarkTheme) :
#ifdef HAVE_QT_WEB_ENGINE
fView = new QWebEngineView(this);
#else
#endif
#ifdef HAVE_QT_WEB_KIT
fView = new QWebView(this);
#endif
#ifdef HAVE_QT_NO_WEB
fView = new QPlainTextEdit(this);
#endif
#ifndef HAVE_QT_NO_WEB
fView->load(QUrl(url));
connect(fView, SIGNAL(loadFinished(bool)), SLOT(adjustLocation()));
connect(fView, SIGNAL(titleChanged(QString)), SLOT(adjustTitle()));
connect(fView, SIGNAL(loadProgress(int)), SLOT(setProgress(int)));
connect(fView, SIGNAL(loadFinished(bool)), SLOT(finishLoading(bool)));
#else
fView->setPlainText("Within the current setup there is NO Help available.");
fView->appendPlainText("The necessary Qt web libs where not found when setting up musredit.");
fView->setReadOnly(true);
#endif
fLocationEdit = new QLineEdit(this);
fLocationEdit->setSizePolicy(QSizePolicy::Expanding, fLocationEdit->sizePolicy().verticalPolicy());
@ -80,12 +94,13 @@ PHelp::PHelp(const QString &url, const bool isDarkTheme) :
toolBar->addAction(fView->pageAction(QWebEnginePage::Forward));
toolBar->addAction(fView->pageAction(QWebEnginePage::Reload));
toolBar->addAction(fView->pageAction(QWebEnginePage::Stop));
#else
#endif
#ifdef HAVE_QT_WEB_KIT
toolBar->addAction(fView->pageAction(QWebPage::Back));
toolBar->addAction(fView->pageAction(QWebPage::Forward));
toolBar->addAction(fView->pageAction(QWebPage::Reload));
toolBar->addAction(fView->pageAction(QWebPage::Stop));
#endif
#endif
toolBar->addWidget(fLocationEdit);
QMenu *exitMenu = menuBar()->addMenu(tr("&File"));
@ -127,7 +142,9 @@ void PHelp::done()
*/
void PHelp::adjustLocation()
{
#ifndef HAVE_QT_NO_WEB
fLocationEdit->setText(fView->url().toString());
#endif
}
//---------------------------------------------------------------------------
@ -138,8 +155,10 @@ void PHelp::adjustLocation()
void PHelp::changeLocation()
{
QUrl url = QUrl(fLocationEdit->text());
#ifndef HAVE_QT_NO_WEB
fView->load(url);
fView->setFocus();
#endif
}
//---------------------------------------------------------------------------
@ -149,10 +168,12 @@ void PHelp::changeLocation()
*/
void PHelp::adjustTitle()
{
#ifndef HAVE_QT_NO_WEB
if (fProgress <= 0 || fProgress >= 100)
setWindowTitle(fView->title());
setWindowTitle(fView->title());
else
setWindowTitle(QString("%1 (%2%)").arg(fView->title()).arg(fProgress));
#endif
}
//---------------------------------------------------------------------------

View File

@ -34,7 +34,8 @@
#ifdef HAVE_QT_WEB_ENGINE
class QWebEngineView;
#else
#endif
#ifdef HAVE_QT_WEB_KIT
class QWebView;
#endif
QT_BEGIN_NAMESPACE
@ -66,8 +67,12 @@ class PHelp : public QMainWindow
bool fDarkTheme;
#ifdef HAVE_QT_WEB_ENGINE
QWebEngineView *fView; ///< web viewer
#else
#endif
#ifdef HAVE_QT_WEB_KIT
QWebView *fView; ///< web viewer
#endif
#ifdef HAVE_QT_NO_WEB
QPlainTextEdit *fView; ///< dialog stating that there is NO web viewer
#endif
QLineEdit *fLocationEdit; ///< url address line edit
int fProgress; ///< progress value (0-100) while loading an url

View File

@ -100,10 +100,13 @@ PSimulateMuTransition::PSimulateMuTransition(UInt_t seed)
}
fNmuons = 100; // number of muons to simulate
fNshowProgress = 100; // print progress on screen every fNshowProgress events
fMuPrecFreq34 = 4463.; // vacuum Mu hyperfine coupling constant
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
fMuPrecFreq13 = 0.; // Mu precession frequency of a 13 transition
fMuPrecFreq24 = 0.; // Mu precession frequency of a 24 transition
fMuonPrecFreq = 0.; // muon precession frequency
fBfield = 0.01; // magnetic field (T)
fCaptureRate = 0.01; // Mu+ capture rate (MHz)
@ -118,6 +121,9 @@ PSimulateMuTransition::PSimulateMuTransition(UInt_t seed)
fMuFractionState34 = 0.25;
fMuFractionState23 = 0.25;
fMuFractionState14 = 0.25;
fMuFractionState13 = 0.;
fMuFractionState24 = 0.;
fDebugFlag = kFALSE;
}
@ -147,6 +153,8 @@ void PSimulateMuTransition::PrintSettings() const
cout << endl << "Mu0 precession frequency 34 (MHz) = " << fMuPrecFreq34;
cout << endl << "Mu0 precession frequency 23 (MHz) = " << fMuPrecFreq23;
cout << endl << "Mu0 precession frequency 14 (MHz) = " << fMuPrecFreq14;
cout << endl << "Mu0 precession frequency 13 (MHz) = " << fMuPrecFreq13;
cout << endl << "Mu0 precession frequency 24 (MHz) = " << fMuPrecFreq24;
cout << endl << "Mu+ precession frequency (MHz) = " << fMuonGyroRatio * fBfield;
cout << endl << "B field (T) = " << fBfield;
cout << endl << "Mu+ electron capture rate (MHz) = " << fCaptureRate;
@ -164,7 +172,10 @@ void PSimulateMuTransition::PrintSettings() const
cout << endl << "Muonium fraction state34 = " << fMuFractionState34;
cout << endl << "Muonium fraction state23 = " << fMuFractionState23;
cout << endl << "Muonium fraction state14 = " << fMuFractionState14;
cout << endl << "Muonium fraction state13 = " << fMuFractionState13;
cout << endl << "Muonium fraction state24 = " << fMuFractionState24;
cout << endl << "Number of particles to simulate = " << fNmuons;
cout << endl << "Print progress on screen frequency = " << fNshowProgress;
cout << endl << "Initial muon spin phase (degree) = " << fInitialPhase;
cout << endl << "Debug flag = " << fDebugFlag;
cout << endl << endl;
@ -224,7 +235,7 @@ void PSimulateMuTransition::Run(TH1F *histoForward, TH1F *histoBackward)
else
histoBackward->Fill(fMuonDecayTime*1000., 1. - fAsymmetry*TMath::Cos(fMuonPhase));
if ( (i%100000) == 0) cout << "number of events processed: " << i << endl;
if ( (i%fNshowProgress) == 0) cout << "number of events processed: " << i << endl;
}
cout << "number of events processed: " << i << endl;
return;
@ -291,11 +302,14 @@ TComplex PSimulateMuTransition::GTFunction(const Double_t &time, const TString c
complexPol = TComplex::Exp(-TComplex::I()*twoPi*fMuonPrecFreq*time);
else{
complexPol =
(fMuFractionState12 * TComplex::Exp(TComplex::I()*twoPi*fMuPrecFreq12*time) +
(fMuFractionState12 * TComplex::Exp(+TComplex::I()*twoPi*fMuPrecFreq12*time) +
fMuFractionState34 * TComplex::Exp(-TComplex::I()*twoPi*fMuPrecFreq34*time))
+
(fMuFractionState23 * TComplex::Exp(TComplex::I()*twoPi*fMuPrecFreq23*time) +
fMuFractionState14 * TComplex::Exp(TComplex::I()*twoPi*fMuPrecFreq14*time));
(fMuFractionState23 * TComplex::Exp(+TComplex::I()*twoPi*fMuPrecFreq23*time) +
fMuFractionState14 * TComplex::Exp(+TComplex::I()*twoPi*fMuPrecFreq14*time))
+
(fMuFractionState13 * TComplex::Exp(+TComplex::I()*twoPi*fMuPrecFreq13*time) +
fMuFractionState24 * TComplex::Exp(+TComplex::I()*twoPi*fMuPrecFreq24*time));
}
return complexPol;
@ -354,9 +368,6 @@ Double_t PSimulateMuTransition::GTSpinFlip(const Double_t &time)
* after ionization process is given by Px(t_i+1)*Px(t_i).
* 4) get the next electron capture time, continue until t_d is reached.
*
* <p> For isotropic muonium, TF:
* 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
*
* <p>Calculates Mu0 polarization in x direction during cyclic charge exchange.
* See M. Senba, J.Phys. B23, 1545 (1990), equations (9), (11)

View File

@ -47,13 +47,16 @@ class PSimulateMuTransition : public TObject
virtual ~PSimulateMuTransition();
virtual void PrintSettings() const;
virtual void SetNmuons(Int_t value) { fNmuons = value; } //!< number of muons
virtual void SetDebugFlag(Bool_t value) { fDebugFlag = value; } //!< debug flag
virtual void SetBfield(Double_t value) { fBfield = value; } //!< sets magnetic field (T)
virtual void SetNmuons(Int_t value) { fNmuons = value; } //!< number of muons
virtual void SetNshowProgress(Int_t value) { fNshowProgress = value; } //!< frequency of output on screen how many muons have been processed
virtual void SetDebugFlag(Bool_t value) { fDebugFlag = value; } //!< debug flag
virtual void SetBfield(Double_t value) { fBfield = value; } //!< sets magnetic field (T)
virtual void SetMuPrecFreq12(Double_t value) { fMuPrecFreq12 = value; } //!< sets Mu transition frequency (MHz)
virtual void SetMuPrecFreq34(Double_t value) { fMuPrecFreq34 = value; } //!< sets Mu transition frequency (MHz)
virtual void SetMuPrecFreq23(Double_t value) { fMuPrecFreq23 = value; } //!< sets Mu transition frequency (MHz)
virtual void SetMuPrecFreq14(Double_t value) { fMuPrecFreq14 = value; } //!< sets Mu transition frequency (MHz)
virtual void SetMuPrecFreq13(Double_t value) { fMuPrecFreq13 = value; } //!< sets Mu transition frequency (MHz)
virtual void SetMuPrecFreq24(Double_t value) { fMuPrecFreq24 = value; } //!< sets Mu transition frequency (MHz)
virtual void SetCaptureRate(Double_t value){ fCaptureRate = value; } //!< sets Mu+ electron capture rate (MHz)
virtual void SetIonizationRate(Double_t value){ fIonizationRate = value; } //!< sets Mu0 ionization rate (MHz)
virtual void SetSpinFlipRate(Double_t value){ fSpinFlipRate = value; } //!< sets Mu0 spin flip rate (MHz)
@ -63,6 +66,8 @@ class PSimulateMuTransition : public TObject
virtual void SetMuFractionState34(Double_t value){ fMuFractionState34 = value; }
virtual void SetMuFractionState23(Double_t value){ fMuFractionState23 = value; }
virtual void SetMuFractionState14(Double_t value){ fMuFractionState14 = value; }
virtual void SetMuFractionState13(Double_t value){ fMuFractionState13 = value; }
virtual void SetMuFractionState24(Double_t value){ fMuFractionState24 = value; }
virtual Bool_t IsValid() { return fValid; }
virtual void SetSeed(UInt_t seed);
@ -81,6 +86,8 @@ 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 fMuPrecFreq13; //!< Mu transition frequency 13 (MHz)
Double_t fMuPrecFreq24; //!< Mu transition frequency 24 (MHz)
Double_t fMuonPrecFreq; //!< muon precession frequency (MHz)
Double_t fCaptureRate; //!< Mu+ electron capture rate (MHz)
Double_t fIonizationRate; //!< Mu0 ionization rate (MHz)
@ -94,8 +101,11 @@ class PSimulateMuTransition : public TObject
Double_t fMuFractionState34; //!< fraction of Mu in state 34
Double_t fMuFractionState23; //!< fraction of Mu in state 23
Double_t fMuFractionState14; //!< fraction of Mu in state 14
Int_t fNmuons; //!< number of muons to simulate
Bool_t fDebugFlag; //!< debug flag
Double_t fMuFractionState13; //!< fraction of Mu in state 13
Double_t fMuFractionState24; //!< fraction of Mu in state 24
Int_t fNmuons; //!< number of muons to simulate
Int_t fNshowProgress; //!< output on screen how many muons have been processed
Bool_t fDebugFlag; //!< debug flag
virtual Double_t NextEventTime(const Double_t &EventRate);
// virtual Double_t PrecessionPhase(const Double_t &time, const TString chargeState);

View File

@ -63,32 +63,47 @@ void runMuSimulation()
Double_t T = 300.; //temperature
Double_t EA = 100; //activation energy (meV)
Double_t spinFlipRate = 0.01; //if spinFlipRate > 0.001 only spin-flip processes will be simulated
Double_t capRate = 0.0001;//*sqrt(T/200.); //assume that capture rate varies as sqrt(T), capRate = sigma*v*p , v ~ sqrt(T)
Double_t capRate = 0.001;//*sqrt(T/200.); //assume that capture rate varies as sqrt(T), capRate = sigma*v*p , v ~ sqrt(T)
Double_t preFac = 6.7e7;
Double_t ionRate; //assume Arrhenius behaviour ionRate = preFac*exp(-EA/kT)
ionRate = 0.1; //2.9e7 * exp(-EA/(0.08625*T)); // Ge: 2.9*10^7MHz "attempt" frequency; 1K = 0.08625 meV
Double_t B = 106.5; //field in G
Double_t Bvar = 0.; //field variance
Double_t Freq12 = 40.433; //Mu freq of the 12 transition
Double_t Freq34 = 59.567; //Mu freq of the 34 transition
Double_t Freq23 = 256.245; //Mu freq of the 23 transition
Double_t Freq14 = 356.245; //Mu freq of the 14 transition
Double_t MuFrac = 1.0; //total Mu fraction
Double_t MuFrac12 = 0.487; //weight of transition 12
Double_t MuFrac34 = 0.487; //weight of transition 34
Double_t MuFrac23 = 0.013; //weight of transition 23
Double_t MuFrac14 = 0.013; //weight of transition 14
Int_t Nmuons = 5e6; //number of muons
Double_t Asym = 0.27; //muon decay asymmetry
Int_t debugFlag = 0; //print debug information on screen
ionRate = 0.001; //preFac * exp(-EA/(0.08625*T)); // Ge: 2.9*10^7MHz "attempt" frequency; 1K = 0.08625 meV
Double_t B = 100.0; //field in G
Double_t Bvar = 0.; //field variance
Double_t Freq12 = 40.023; //Mu freq of the 12 transition
Double_t Freq34 = 59.977; //Mu freq of the 34 transition
Double_t Freq23 = 238.549; //Mu freq of the 23 transition
Double_t Freq14 = 338.549; //Mu freq of the 14 transition
Double_t Freq13 = 278.571; //Mu freq of the 23 transition
Double_t Freq24 = 325.165; //Mu freq of the 14 transition
Double_t MuFrac = 1.0; //total Mu fraction
Double_t MuFrac12 = 0.486; //weight of transition 12
Double_t MuFrac34 = 0.486; //weight of transition 34
Double_t MuFrac23 = 0.014; //weight of transition 23
Double_t MuFrac14 = 0.014; //weight of transition 14
Double_t MuFrac13 = 0.0; //weight of transition 13
Double_t MuFrac24 = 0.0; //weight of transition 24
Int_t Nmuons = 5e6; //number of muons
Int_t NshowProgress = 1e4; //frequency to show progress on screen
Double_t Asym = 0.27; //muon decay asymmetry
Int_t debugFlag = 0; //print debug information on screen
TTimeStamp *timeStampStart = new TTimeStamp();
cout << endl << "Simulation started on:" << endl;
timeStampStart->Print("l);
cout << endl;
histogramFileName = TString("0");
histogramFileName += runNo;
histogramFileName += TString(".root");
sprintf(titleStr,"- complexMuPol, A0 100MHz, Mu-frac %3.2f, Mu12 %6.2f MHz(%3.2f), Mu23 %6.2f MHz(%3.2f), ionRate %8.3f MHz, capRate %6.3f MHz, SF rate %6.3f MHz, %5.1f G", MuFrac, Freq12, MuFrac12/2, Freq23, MuFrac23/2, ionRate, capRate, spinFlipRate, B);
sprintf(titleStr,"- complexMuPol, A0 100MHz, Mu-frac %3.2f, Mu12 %6.2f MHz(%3.2f), Mu23 %6.2f MHz(%3.2f), ionRate %8.3f MHz, capRate %6.3f MHz, SF rate %6.3f MHz, %5.1f G", MuFrac, Freq12, MuFrac12, Freq23, MuFrac23, ionRate, capRate, spinFlipRate, B);
runTitle = TString("0");
runTitle += runNo;
runTitle += TString(titleStr);
cout << runTitle << endl << endl;
PSimulateMuTransition *simulateMuTransition = new PSimulateMuTransition();
if (!simulateMuTransition->IsValid()){
@ -99,15 +114,20 @@ void runMuSimulation()
simulateMuTransition->SetMuPrecFreq34(Freq34); // MHz
simulateMuTransition->SetMuPrecFreq23(Freq23); // MHz
simulateMuTransition->SetMuPrecFreq14(Freq14); // MHz
simulateMuTransition->SetMuPrecFreq13(Freq13); // MHz
simulateMuTransition->SetMuPrecFreq24(Freq24); // MHz
simulateMuTransition->SetMuFraction(MuFrac); // initial Mu fraction
simulateMuTransition->SetMuFractionState12(MuFrac12);
simulateMuTransition->SetMuFractionState34(MuFrac34);
simulateMuTransition->SetMuFractionState23(MuFrac23);
simulateMuTransition->SetMuFractionState14(MuFrac14);
simulateMuTransition->SetMuFractionState14(MuFrac14);
simulateMuTransition->SetMuFractionState13(MuFrac13);
simulateMuTransition->SetMuFractionState24(MuFrac24);
simulateMuTransition->SetBfield(B/10000.); // Tesla
simulateMuTransition->SetCaptureRate(capRate); // MHz
simulateMuTransition->SetIonizationRate(ionRate); // MHz
simulateMuTransition->SetSpinFlipRate(spinFlipRate); // MHz
simulateMuTransition->SetNshowProgress(NshowProgress);
simulateMuTransition->SetNmuons(Nmuons);
simulateMuTransition->SetDecayAsymmetry(Asym);
simulateMuTransition->SetDebugFlag(debugFlag); // to print time and phase during charge-changing cycle
@ -179,12 +199,18 @@ void runMuSimulation()
header->Set("Simulation/Mu0 Precession frequency 34", Freq34);
header->Set("Simulation/Mu0 Precession frequency 23", Freq23);
header->Set("Simulation/Mu0 Precession frequency 14", Freq14);
header->Set("Simulation/Mu0 Precession frequency 13", Freq13);
header->Set("Simulation/Mu0 Precession frequency 24", Freq24);
header->Set("Simulation/Mu0 Fraction", MuFrac);
header->Set("Simulation/Mu0 Fraction 12", MuFrac12);
header->Set("Simulation/Mu0 Fraction 34", MuFrac34);
header->Set("Simulation/Mu0 Fraction 23", MuFrac23);
header->Set("Simulation/Mu0 Fraction 14", MuFrac14);
header->Set("Simulation/muon Capture Rate", capRate);
header->Set("Simulation/Mu0 Fraction 13", MuFrac13);
header->Set("Simulation/Mu0 Fraction 24", MuFrac24);
header->Set("Simulation/Mu0 Activation Energy", EA);
header->Set("Simulation/Mu0 Activation PreFactor", preFac);
header->Set("Simulation/Mux Capture Rate", capRate);
header->Set("Simulation/Mu0 Ionization Rate", ionRate);
header->Set("Simulation/Mu0 Spin Flip Rate", spinFlipRate);
header->Set("Simulation/Number of Muons", Nmuons);
@ -206,7 +232,7 @@ void runMuSimulation()
histo[i] = new TH1F(str, str, 18001, -0.5, 18000.5);
}
for (i=0; i<NDECAYHISTS; i++)
for (UInt_t i=0; i<NDECAYHISTS; i++)
decayAnaModule->Add(histo[i]);
// run simulation
@ -230,6 +256,11 @@ void runMuSimulation()
gRunHeader->Write();
fout->Close();
cout << "Histograms written to " << histogramFileName.Data() << endl;
cout << endl << "Simulation stopped on:" << endl;
TTimeStamp *timeStampEnd = new TTimeStamp();
timeStampEnd->Print("l");
cout << endl;
// delete fout;
// delete header;