Merged muonspin/musrfit:root6 into master

This commit is contained in:
Zaher Salman 2018-10-16 10:04:36 +02:00
commit d05a858e7e
28 changed files with 615 additions and 175 deletions

View File

@ -28,7 +28,7 @@ endif()
#--- perform some checks and generate the config.h ---------------------------- #--- perform some checks and generate the config.h ----------------------------
#--- the next three lines are needed that the math functions are found -------- #--- the next two lines are needed that the math functions are found ----------
set(CMAKE_REQUIRED_INCLUDES math.h) set(CMAKE_REQUIRED_INCLUDES math.h)
set(CMAKE_REQUIRED_LIBRARIES m) set(CMAKE_REQUIRED_LIBRARIES m)

View File

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

View File

@ -1486,8 +1486,49 @@ The block starts with the *FOURIER* keyword and may contain the following entrie
.. _msr-fourier-block-phase: .. _msr-fourier-block-phase:
**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, 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,
*e.g.* par3, which would take the value of parameter number 3. 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
#. 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)
.. index:: fourier-block-range_for_phase_correction .. index:: fourier-block-range_for_phase_correction
.. _msr-fourier-block-range_for_phase_correction: .. _msr-fourier-block-range_for_phase_correction:
@ -1511,8 +1552,7 @@ Altogether, a possible FOURIER block might look like that:
fourier_power 12 fourier_power 12
apodization NONE apodization NONE
plot real_and_imag plot real_and_imag
phase 22.6 # par3 phase par5, par8
range_for_phase_correction all
range 0.0 17.03 range 0.0 17.03
.. index:: msr-plot-block .. 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>
<div class="footer"> <div class="footer">
&copy; Copyright 2018, Andreas Suter. &copy; Copyright 2018, Andreas Suter.
Last updated on Aug 23, 2018. Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div> </div>
</body> </body>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

Binary file not shown.

View File

@ -94,7 +94,7 @@
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2018, Andreas Suter. &copy; Copyright 2018, Andreas Suter.
Last updated on Aug 23, 2018. Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div> </div>
</body> </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>
<div class="footer"> <div class="footer">
&copy; Copyright 2018, Andreas Suter. &copy; Copyright 2018, Andreas Suter.
Last updated on Aug 23, 2018. Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div> </div>
</body> </body>

View File

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

View File

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

View File

@ -667,7 +667,7 @@ K(m)&amp;=\int_0^{\pi/2}\frac{\mathrm d\varphi}{\sqrt{1-m^2\sin^2{\varphi}}},\en
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2018, Andreas Suter. &copy; Copyright 2018, Andreas Suter.
Last updated on Aug 23, 2018. Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div> </div>
</body> </body>

View File

@ -1552,8 +1552,42 @@ The argument may be one of the following:</p>
</dl> </dl>
<span id="index-47"></span><dl class="docutils" id="msr-fourier-block-phase"> <span id="index-47"></span><dl class="docutils" id="msr-fourier-block-phase">
<dt><strong>phase</strong></dt> <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, <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,
<em>e.g.</em> par3, which would take the value of parameter number 3.</dd> 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>
</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>
</li>
</ol>
</dd>
</dl> </dl>
<span id="index-48"></span><dl class="docutils" id="msr-fourier-block-range-for-phase-correction"> <span id="index-48"></span><dl class="docutils" id="msr-fourier-block-range-for-phase-correction">
<dt><strong>range_for_phase_correction</strong></dt> <dt><strong>range_for_phase_correction</strong></dt>
@ -1570,8 +1604,7 @@ units Mc/s
fourier_power 12 fourier_power 12
apodization NONE apodization NONE
plot real_and_imag plot real_and_imag
phase 22.6 # par3 phase par5, par8
range_for_phase_correction all
range 0.0 17.03 range 0.0 17.03
</pre></div> </pre></div>
</div> </div>
@ -2162,7 +2195,7 @@ In case this cannot be ensured, the parallelization can be disabled by <em>&#821
</div> </div>
<div class="footer"> <div class="footer">
&copy; Copyright 2018, Andreas Suter. &copy; Copyright 2018, Andreas Suter.
Last updated on Aug 23, 2018. Last updated on Oct 15, 2018.
Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3. Created using <a href="http://sphinx-doc.org/">Sphinx</a> 1.2.3.
</div> </div>
</body> </body>

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 // FOURIER block - in case a parameter is used for the phase
tempPar = fMsrHandler->GetMsrFourierList()->fPhaseParamNo; if (fMsrHandler->GetMsrFourierList()->fPhaseParamNo.size() > 0) {
if (tempPar > 0) {
// go through the whole parameter list ... // go through the whole parameter list ...
for (unsigned int k(0); k < msrParamList->size(); ++k) { for (unsigned int k(0); k < msrParamList->size(); ++k) {
if (tempPar == msrParamList->at(k).fNo) { if (tempPar == msrParamList->at(k).fNo) {
fMsrHandler->GetMsrFourierList()->fPhaseParamNo = k + 1; fMsrHandler->GetMsrFourierList()->fPhaseParamNo.push_back(k + 1);
break; break;
} }
} }

View File

@ -324,6 +324,15 @@ Int_t PMsrHandler::ReadMsrFile()
CheckLegacyLifetimecorrection(); // check if lifetimecorrection is found in RUN blocks, if yes transfer it to PLOT blocks 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 // clean up
fit_parameter.clear(); fit_parameter.clear();
theory.clear(); theory.clear();
@ -1116,12 +1125,15 @@ Int_t PMsrHandler::WriteMsrLogFile(const Bool_t messages)
fout << " # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL"; fout << " # REAL, IMAG, REAL_AND_IMAG, POWER, PHASE, PHASE_OPT_REAL";
fout << endl; fout << endl;
} else if (sstr.BeginsWith("phase")) { } else if (sstr.BeginsWith("phase")) {
if (fFourier.fPhaseParamNo > 0) { if (fFourier.fPhaseParamNo.size() > 0) {
fout << "phase par" << fFourier.fPhaseParamNo << endl; TString phaseParamStr = BeautifyFourierPhaseParameterString();
} else { fout << "phase " << phaseParamStr << endl;
if (fFourier.fPhase != -999.0) { } else if (fFourier.fPhase.size() > 0) {
fout << "phase " << fFourier.fPhase << endl; 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")) { } else if (sstr.BeginsWith("range_for_phase_correction")) {
fout << "range_for_phase_correction " << fFourier.fRangeForPhaseCorrection[0] << " " << fFourier.fRangeForPhaseCorrection[1] << endl; fout << "range_for_phase_correction " << fFourier.fRangeForPhaseCorrection[0] << " " << fFourier.fRangeForPhaseCorrection[1] << endl;
@ -2199,10 +2211,15 @@ Int_t PMsrHandler::WriteMsrFile(const Char_t *filename, map<UInt_t, TString> *co
} }
// phase // phase
if (fFourier.fPhaseParamNo > 0) { if (fFourier.fPhaseParamNo.size() > 0) {
fout << "phase par" << fFourier.fPhaseParamNo << endl; TString phaseParamStr = BeautifyFourierPhaseParameterString();
} else if (fFourier.fPhase != -999.0) { fout << "phase " << phaseParamStr << endl;
fout << "phase " << fFourier.fPhase << 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 // range_for_phase_correction
@ -3859,14 +3876,274 @@ void PMsrHandler::InitFourierParameterStructure(PMsrFourierStructure &fourier)
fourier.fDCCorrected = false; // dc-corrected FFT, default: false fourier.fDCCorrected = false; // dc-corrected FFT, default: false
fourier.fApodization = FOURIER_APOD_NOT_GIVEN; // apodization, default: NOT GIVEN fourier.fApodization = FOURIER_APOD_NOT_GIVEN; // apodization, default: NOT GIVEN
fourier.fPlotTag = FOURIER_PLOT_NOT_GIVEN; // initial plot tag, 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.fPhaseParamNo.clear(); // initial phase parameter no vector is empty
fourier.fPhase = -999.0; // fourier phase: -999 = NOT GIVEN fourier.fPhase.clear(); // initial phase vector is empty
for (UInt_t i=0; i<2; i++) { for (UInt_t i=0; i<2; i++) {
fourier.fRangeForPhaseCorrection[i] = -1.0; // frequency range for phase correction, 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 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]'.
* If this form is found, fill in parX0 ... parXN to fFourier.fPhaseParamNo
* and furthermore fill fFourier.fPhase 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;
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;
}
// rule out par(X, offset, #Param) syntax
if (sstr.BeginsWith("par(")) {
result = false;
break;
}
}
// check that token has the form parX, where X is an int
if (result != false) {
for (Int_t i=1; i<tok->GetEntries(); i++) {
TObjString *ostr = dynamic_cast<TObjString*>(tok->At(i));
sstr = ostr->GetString();
sstr.Remove(0, 3); // remove 'par' part. Rest should be an integer
if (sstr.IsDigit()) {
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)'.
* If this form is found, fill in parX0 ... parXN to fFourier.fPhaseParamNo
* and furthermore fill fFourier.fPhase 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(")) {
cout << ">> PMsrHandler::ParseFourierPhaseParIterVector: **ERROR** token should start with 'par(', found: '" << wstr << "' -> ERROR" << endl;
error = true;
return false;
}
wstr.Remove(0, 4);
// 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;
}
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) // HandleFourierEntry (private)
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
@ -4011,39 +4288,59 @@ Bool_t PMsrHandler::HandleFourierEntry(PMsrLines &lines)
} }
} }
} else if (iter->fLine.BeginsWith("phase", TString::kIgnoreCase)) { // phase } 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; error = true;
continue; continue;
} else { } else {
ostr = dynamic_cast<TObjString*>(tokens->At(1)); // allowed phase parameter patterns:
str = ostr->GetString(); // (i) phase val [sep val sep val ...] [# comment], val=double, sep=' ,;\t'
if (str.BeginsWith("par", TString::kIgnoreCase)) { // parameter value // (ii) phase parX0 [sep parX1 sep parX2 ...] [# comment], val=double, sep=' ,;\t'
if (fFourierOnly) { // (iii) phase par(X0 sep1 offset sep1 #param) [# comment], sep1= ',;'
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; // remove potential comment
fourier.fPhase = 0.0; TString wstr("");
} else { RemoveComment(iter->fLine, wstr);
Int_t no = 0;
if (FilterNumber(str, "par", 0, no)) { // check for 'phase val ...'
// check that the parameter is in range Bool_t result = ParseFourierPhaseValueVector(fourier, wstr, error);
if ((Int_t)fParam.size() < no) { if (error)
error = true; continue;
continue;
} // check for 'phase parX0 ...' if not already val are found
// keep the parameter number if (!result) {
fourier.fPhaseParamNo = no; result = ParseFourierPhaseParVector(fourier, wstr, error);
// get parameter value if (error)
fourier.fPhase = fParam[no-1].fValue; continue;
} else { }
// 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; error = true;
--iter;
continue; continue;
} }
} }
} else if (str.IsFloat()) { // phase value }
fourier.fPhase = str.Atof();
} else { // if parameter vector is given -> fill corresponding phase values
error = true; if (fourier.fPhaseParamNo.size() > 0) {
continue; fourier.fPhase.clear();
UInt_t idx;
for (UInt_t i=0; i<fourier.fPhaseParamNo.size(); i++) {
fourier.fPhase.push_back(fParam[fourier.fPhaseParamNo[i]-1].fValue);
}
} }
} }
} else if (iter->fLine.BeginsWith("range_for_phase_correction", TString::kIgnoreCase)) { } else if (iter->fLine.BeginsWith("range_for_phase_correction", TString::kIgnoreCase)) {
@ -4142,7 +4439,11 @@ Bool_t PMsrHandler::HandleFourierEntry(PMsrLines &lines)
cerr << endl << ">> [dc-corrected true | false]"; cerr << endl << ">> [dc-corrected true | false]";
cerr << endl << ">> [apodization none | weak | medium | strong]"; cerr << endl << ">> [apodization none | weak | medium | strong]";
cerr << endl << ">> [plot real | imag | real_and_imag | power | phase | phase_opt_real]"; 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_for_phase_correction min max | all]";
cerr << endl << ">> [range min max]"; cerr << endl << ">> [range min max]";
cerr << endl; cerr << endl;
@ -6220,6 +6521,56 @@ void PMsrHandler::MakeDetectorGroupingString(TString str, PIntVector &group, TSt
} while (i<group.size()); } 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("??");
if (fFourier.fPhaseParamNo.size() == 0)
return str;
if (fFourier.fPhaseParamNo.size() == 1) {
str = TString::Format("par%d", fFourier.fPhaseParamNo[0]);
} else if (fFourier.fPhaseParamNo.size() == 2) {
str = TString::Format("par%d, par%d", 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) {
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++) {
str += "par";
str += fFourier.fPhaseParamNo[i];
str += ", ";
}
str += "par";
str += fFourier.fPhaseParamNo[fFourier.fPhaseParamNo.size()-1];
}
}
return str;
}
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------
// CheckLegacyLifetimecorrection (private) // CheckLegacyLifetimecorrection (private)
//-------------------------------------------------------------------------- //--------------------------------------------------------------------------

View File

@ -152,7 +152,6 @@ PMusrCanvas::PMusrCanvas()
InitFourier(); InitFourier();
InitAverage(); InitAverage();
fCurrentFourierPhase = fFourier.fPhaseIncrement;
fCurrentFourierPhaseText = 0; fCurrentFourierPhaseText = 0;
fRRFText = 0; fRRFText = 0;
@ -205,7 +204,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
CreateStyle(); CreateStyle();
InitMusrCanvas(title, wtopx, wtopy, ww, wh); InitMusrCanvas(title, wtopx, wtopy, ww, wh);
fCurrentFourierPhase = 0.0;
fCurrentFourierPhaseText = 0; fCurrentFourierPhaseText = 0;
fRRFText = 0; fRRFText = 0;
@ -262,7 +260,6 @@ PMusrCanvas::PMusrCanvas(const Int_t number, const Char_t* title,
CreateStyle(); CreateStyle();
InitMusrCanvas(title, wtopx, wtopy, ww, wh); InitMusrCanvas(title, wtopx, wtopy, ww, wh);
fCurrentFourierPhase = 0.0;
fCurrentFourierPhaseText = 0; fCurrentFourierPhaseText = 0;
fRRFText = 0; fRRFText = 0;
@ -322,10 +319,6 @@ PMusrCanvas::~PMusrCanvas()
CleanupDataSet(fNonMusrData[i]); CleanupDataSet(fNonMusrData[i]);
fNonMusrData.clear(); fNonMusrData.clear();
} }
if (fCurrentFourierPhaseText) {
delete fCurrentFourierPhaseText;
fCurrentFourierPhaseText = 0;
}
if (fMultiGraphLegend) { if (fMultiGraphLegend) {
fMultiGraphLegend->Clear(); fMultiGraphLegend->Clear();
delete fMultiGraphLegend; delete fMultiGraphLegend;
@ -394,9 +387,8 @@ void PMusrCanvas::SetMsrHandler(PMsrHandler *msrHandler)
if (fMsrHandler->GetMsrFourierList()->fPlotTag != FOURIER_PLOT_NOT_GIVEN) { if (fMsrHandler->GetMsrFourierList()->fPlotTag != FOURIER_PLOT_NOT_GIVEN) {
fFourier.fPlotTag = fMsrHandler->GetMsrFourierList()->fPlotTag; 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) && if ((fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0] != -1.0) &&
(fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[1] != -1.0)) { (fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[1] != -1.0)) {
fFourier.fRangeForPhaseCorrection[0] = fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0]; fFourier.fRangeForPhaseCorrection[0] = fMsrHandler->GetMsrFourierList()->fRangeForPhaseCorrection[0];
@ -2312,7 +2304,8 @@ void PMusrCanvas::InitFourier()
fFourier.fFourierPower = 0; // no zero padding fFourier.fFourierPower = 0; // no zero padding
fFourier.fApodization = FOURIER_APOD_NONE; // no apodization fFourier.fApodization = FOURIER_APOD_NONE; // no apodization
fFourier.fPlotTag = FOURIER_PLOT_REAL_AND_IMAG; // initial plot tag, plot real and imaginary part 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++) { for (UInt_t i=0; i<2; i++) {
fFourier.fRangeForPhaseCorrection[i] = -1.0; // frequency range for phase correction, default: {-1, -1} = NOT GIVEN 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 fFourier.fPlotRange[i] = -1.0; // fourier plot range, default: {-1, -1} = NOT GIVEN
@ -3464,13 +3457,20 @@ void PMusrCanvas::HandleFourier()
} }
// apply global phase if present // apply global phase if present
if (fFourier.fPhase != 0.0) { if (fFourier.fPhase.size() != 0.0) {
const double cp = TMath::Cos(fFourier.fPhase/180.0*TMath::Pi()); double cp;
const double sp = TMath::Sin(fFourier.fPhase/180.0*TMath::Pi()); double sp;
fCurrentFourierPhase = fFourier.fPhase; fCurrentFourierPhase = fFourier.fPhase;
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets 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)) { 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 for (Int_t j=0; j<fData[i].dataFourierRe->GetNbinsX(); j++) { // loop over a fourier data set
// calculate new fourier data set value // calculate new fourier data set value
@ -3567,16 +3567,23 @@ void PMusrCanvas::HandleDifferenceFourier()
fData[i].diffFourierTag = 1; // d-f fData[i].diffFourierTag = 1; // d-f
} }
// apply global phase // apply phase
if (fFourier.fPhase != 0.0) { if (fFourier.fPhase.size() != 0.0) {
double re, im; double re, im;
const double cp = TMath::Cos(fFourier.fPhase/180.0*TMath::Pi()); double cp;
const double sp = TMath::Sin(fFourier.fPhase/180.0*TMath::Pi()); double sp;
fCurrentFourierPhase = fFourier.fPhase; fCurrentFourierPhase = fFourier.fPhase;
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets
if ((fData[i].diffFourierRe != 0) && (fData[i].diffFourierIm != 0)) { 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 for (Int_t j=0; j<fData[i].diffFourierRe->GetNbinsX(); j++) { // loop over a fourier data set
// calculate new fourier data set value // calculate new fourier data set value
re = fData[i].diffFourierRe->GetBinContent(j) * cp + fData[i].diffFourierIm->GetBinContent(j) * sp; re = fData[i].diffFourierRe->GetBinContent(j) * cp + fData[i].diffFourierIm->GetBinContent(j) * sp;
@ -6053,7 +6060,10 @@ void PMusrCanvas::PlotFourierPhaseValue(Bool_t unzoom)
// plot Fourier phase // plot Fourier phase
str = TString("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; x = 0.7;
y = 0.85; y = 0.85;
fCurrentFourierPhaseText = new TLatex(); fCurrentFourierPhaseText = new TLatex();
@ -6311,7 +6321,8 @@ void PMusrCanvas::IncrementFourierPhase()
const double cp = TMath::Cos(fFourier.fPhaseIncrement/180.0*TMath::Pi()); const double cp = TMath::Cos(fFourier.fPhaseIncrement/180.0*TMath::Pi());
const double sp = TMath::Sin(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(); PlotFourierPhaseValue();
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets
@ -6363,7 +6374,8 @@ void PMusrCanvas::DecrementFourierPhase()
const double cp = TMath::Cos(fFourier.fPhaseIncrement/180.0*TMath::Pi()); const double cp = TMath::Cos(fFourier.fPhaseIncrement/180.0*TMath::Pi());
const double sp = TMath::Sin(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(); PlotFourierPhaseValue();
for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets for (UInt_t i=0; i<fData.size(); i++) { // loop over all data sets

View File

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

View File

@ -146,6 +146,10 @@ class PMsrHandler
virtual void FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLines &run); virtual void FillParameterInUse(PMsrLines &theory, PMsrLines &funcs, PMsrLines &run);
virtual void InitFourierParameterStructure(PMsrFourierStructure &fourier); 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); 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 UInt_t LastSignificant(Double_t dval, UInt_t precLimit=6);
virtual void MakeDetectorGroupingString(TString str, PIntVector &group, TString &result, Bool_t includeDetector = true); virtual void MakeDetectorGroupingString(TString str, PIntVector &group, TString &result, Bool_t includeDetector = true);
virtual TString BeautifyFourierPhaseParameterString();
virtual void CheckLegacyLifetimecorrection(); virtual void CheckLegacyLifetimecorrection();
}; };

View File

@ -737,8 +737,8 @@ typedef struct {
Int_t fFourierPower; ///< i.e. zero padding up to 2^fFourierPower, default = 0 which means NO zero padding 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 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 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 PIntVector fPhaseParamNo; ///< parameter number(s) if used instead of a phase value
Double_t fPhase; ///< phase PDoubleVector fPhase; ///< phase(s)
Double_t fRangeForPhaseCorrection[2]; ///< field/frequency range for automatic phase correction Double_t fRangeForPhaseCorrection[2]; ///< field/frequency range for automatic phase correction
Double_t fPlotRange[2]; ///< field/frequency plot range Double_t fPlotRange[2]; ///< field/frequency plot range
Double_t fPhaseIncrement; ///< phase increment for manual phase optimization 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 Bool_t fXRangePresent, fYRangePresent; ///< flag indicating if x-/y-range is present
Double_t fXmin, fXmax, fYmin, fYmax; ///< data/theory frame range 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 TLatex *fCurrentFourierPhaseText; ///< used in Re/Im Fourier to show the current phase in the pad
TString *fRRFText; ///< RRF information TString *fRRFText; ///< RRF information
TLatex *fRRFLatexText; ///< used to display RRF info TLatex *fRRFLatexText; ///< used to display RRF info