@ -774,8 +774,9 @@ A THEORY block including a user function may then look like ::
The FUNCTIONS Block
The FUNCTIONS Block
+++++++++++++++++++
+++++++++++++++++++
Here some auxiliary functions can be defined. These functions can currently *only* operate on the defined parameters. They can be used in the
Here some auxiliary functions can be defined. These functions can currently *only* operate on the defined parameters, and some meta information from the data files.
:ref:`THEORY block <msr-theory-block>` and for three specific cases in the :ref:`RUN block <msr-run-block>` (`norm`, `alpha`, and `beta`). Supported is the use of basic arithmetic:
They can be used in the :ref:`THEORY block <msr-theory-block>` and for three specific cases in the :ref:`RUN block <msr-run-block>` (`norm`, `alpha`, and `beta`).
Supported is the use of basic arithmetic:
:math:`+`
:math:`+`
Addition
Addition
@ -799,6 +800,21 @@ Furthermore, some constants are predefined and might also be used:
The fit parameters are accessed either directly through parX, where 'X' is the number of the parameter in the :ref:`FITPARAMETER block <msr-fitparameter-block>`,
The fit parameters are accessed either directly through parX, where 'X' is the number of the parameter in the :ref:`FITPARAMETER block <msr-fitparameter-block>`,
*e.g.* *par5* or through a mapping with mapY, where 'Y' specifies the mapping number in the :ref:`RUN block <msr-run-block>` as explained below.
*e.g.* *par5* or through a mapping with mapY, where 'Y' specifies the mapping number in the :ref:`RUN block <msr-run-block>` as explained below.
.. index:: meta-information
The available meta information form the data files are:
@ -896,8 +896,9 @@ instead of specifying the parameters directly.</p>
</div>
</div>
<divclass="section"id="the-functions-block">
<divclass="section"id="the-functions-block">
<spanid="msr-functions-block"></span><spanid="index-15"></span><h3>The FUNCTIONS Block<aclass="headerlink"href="#the-functions-block"title="Permalink to this headline">¶</a></h3>
<spanid="msr-functions-block"></span><spanid="index-15"></span><h3>The FUNCTIONS Block<aclass="headerlink"href="#the-functions-block"title="Permalink to this headline">¶</a></h3>
<p>Here some auxiliary functions can be defined. These functions can currently <em>only</em> operate on the defined parameters. They can be used in the
<p>Here some auxiliary functions can be defined. These functions can currently <em>only</em> operate on the defined parameters, and some meta information from the data files.
<aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY block</span></a> and for three specific cases in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a> (<cite>norm</cite>, <cite>alpha</cite>, and <cite>beta</cite>). Supported is the use of basic arithmetic:</p>
They can be used in the <aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY block</span></a> and for three specific cases in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a> (<cite>norm</cite>, <cite>alpha</cite>, and <cite>beta</cite>).
<p>The fit parameters are accessed either directly through parX, where ‘X’ is the number of the parameter in the <aclass="reference internal"href="#msr-fitparameter-block"><spanclass="std std-ref">FITPARAMETER block</span></a>,
<p>The fit parameters are accessed either directly through parX, where ‘X’ is the number of the parameter in the <aclass="reference internal"href="#msr-fitparameter-block"><spanclass="std std-ref">FITPARAMETER block</span></a>,
<em>e.g.</em><em>par5</em> or through a mapping with mapY, where ‘Y’ specifies the mapping number in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a> as explained below.</p>
<em>e.g.</em><em>par5</em> or through a mapping with mapY, where ‘Y’ specifies the mapping number in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a> as explained below.</p>
<pid="index-16">The available meta information form the data files are:</p>
<p>The defined functions are denoted as funX, where ‘X’ is the function number, <em>i.e.</em> fun1, fun2, etc. and have to be placed separately on one
<p>The defined functions are denoted as funX, where ‘X’ is the function number, <em>i.e.</em> fun1, fun2, etc. and have to be placed separately on one
line each. Afterwards they can be used in the <aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY block</span></a>.</p>
line each. Afterwards they can be used in the <aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY block</span></a>.</p>
<p>It follows an example to illustrate the usage of functions in the <aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY block</span></a>. The total asymmetry of a signal
<p>It follows an example to illustrate the usage of functions in the <aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY block</span></a>. The total asymmetry of a signal
@ -948,7 +980,7 @@ consisting of two parts should be a fit parameter. The fraction of each of the p
</div>
</div>
</div>
</div>
<divclass="section"id="the-global-block">
<divclass="section"id="the-global-block">
<spanid="msr-global-block"></span><spanid="index-16"></span><h3>The GLOBAL Block<aclass="headerlink"href="#the-global-block"title="Permalink to this headline">¶</a></h3>
<spanid="msr-global-block"></span><spanid="index-17"></span><h3>The GLOBAL Block<aclass="headerlink"href="#the-global-block"title="Permalink to this headline">¶</a></h3>
<p>The GLOBAL block is used to collect data which otherwise need to be specified in every single run entry of the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>.
<p>The GLOBAL block is used to collect data which otherwise need to be specified in every single run entry of the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>.
Therefore, this block is only present to potentially shorten the msr file and to ease the handling for the user. The logic will by like that:</p>
Therefore, this block is only present to potentially shorten the msr file and to ease the handling for the user. The logic will by like that:</p>
<olclass="arabic simple">
<olclass="arabic simple">
@ -1052,7 +1084,7 @@ Syntax: rrf_phase <phase>, where the value <phase> is given in degre
</div>
</div>
</div>
</div>
<divclass="section"id="the-run-block">
<divclass="section"id="the-run-block">
<spanid="msr-run-block"></span><spanid="index-17"></span><h3>The RUN Block<aclass="headerlink"href="#the-run-block"title="Permalink to this headline">¶</a></h3>
<spanid="msr-run-block"></span><spanid="index-18"></span><h3>The RUN Block<aclass="headerlink"href="#the-run-block"title="Permalink to this headline">¶</a></h3>
<p>The RUN block is used to collect the data needed for a particular run to be fitted. This includes the run name, fit type, data format, etc.
<p>The RUN block is used to collect the data needed for a particular run to be fitted. This includes the run name, fit type, data format, etc.
The RUN block is slightly differently organized than the other blocks. The information is collected via labels followed by the information.
The RUN block is slightly differently organized than the other blocks. The information is collected via labels followed by the information.
Each run to be fitted has its <em>own</em> RUN block. A RUN block starts with a run-file line which has the structure</p>
Each run to be fitted has its <em>own</em> RUN block. A RUN block starts with a run-file line which has the structure</p>
@ -1126,7 +1158,7 @@ a short digression is needed.</p>
</div>
</div>
<p>After this short digression back to the RUN-block description.</p>
<p>After this short digression back to the RUN-block description.</p>
<p>In order to describe the operations needed for fitting and plotting, quite some information are needed. These information are following the RUN statement and are listed below. Depending on the fit type these information vary and hence it is indicated for which fit/plot type the information is applicable</p>
<p>In order to describe the operations needed for fitting and plotting, quite some information are needed. These information are following the RUN statement and are listed below. Depending on the fit type these information vary and hence it is indicated for which fit/plot type the information is applicable</p>
<spanid="index-18"></span><dlid="msr-addrun">
<spanid="index-19"></span><dlid="msr-addrun">
<dt><strong>ADDRUN <run_file_name><beamline><facility><file_format></strong> (optional)</dt><dd><p>If an ADDRUN is just following after a RUN statement, these runs will be added. More than one ADDRUN statements are possible, <em>i.e.</em> adding up as many runs as wished. It is also possible to add runs with different file formats. If the t0’s are given in the data files, the ADDRUN statement is all what is needed, otherwise just add the t0’s with the addt0 statement.</p>
<dt><strong>ADDRUN <run_file_name><beamline><facility><file_format></strong> (optional)</dt><dd><p>If an ADDRUN is just following after a RUN statement, these runs will be added. More than one ADDRUN statements are possible, <em>i.e.</em> adding up as many runs as wished. It is also possible to add runs with different file formats. If the t0’s are given in the data files, the ADDRUN statement is all what is needed, otherwise just add the t0’s with the addt0 statement.</p>
<p>For a <aclass="reference internal"href="#single-histogram-fit"><spanclass="std std-ref">Single Histogram Fit</span></a> or a <aclass="reference internal"href="#negative-muon-musr-fit"><spanclass="std std-ref">MuMinus Fit</span></a> it will be</p>
<p>For a <aclass="reference internal"href="#single-histogram-fit"><spanclass="std std-ref">Single Histogram Fit</span></a> or a <aclass="reference internal"href="#negative-muon-musr-fit"><spanclass="std std-ref">MuMinus Fit</span></a> it will be</p>
@ -1144,7 +1176,7 @@ a short digression is needed.</p>
<p>ADDRUN is <em>not</em> available for the fit type <aclass="reference internal"href="#non-musr-fit"><spanclass="std std-ref">Non-muSR Fit</span></a>.</p>
<p>ADDRUN is <em>not</em> available for the fit type <aclass="reference internal"href="#non-musr-fit"><spanclass="std std-ref">Non-muSR Fit</span></a>.</p>
</dd>
</dd>
</dl>
</dl>
<spanid="index-19"></span><dlid="msr-fittype">
<spanid="index-20"></span><dlid="msr-fittype">
<dt><strong>fittype</strong> (required if not already defined in the GLOBAL block)</dt><dd><p>This tag is used to indicate which type of fit is wished. The supported fit types are:</p>
<dt><strong>fittype</strong> (required if not already defined in the GLOBAL block)</dt><dd><p>This tag is used to indicate which type of fit is wished. The supported fit types are:</p>
@ -1168,7 +1200,7 @@ a short digression is needed.</p>
</div>
</div>
</dd>
</dd>
</dl>
</dl>
<spanid="index-20"></span><dlid="msr-alpha-beta">
<spanid="index-21"></span><dlid="msr-alpha-beta">
<dt><strong>alpha, beta</strong> (fit type 2, 3, 5)</dt><dd><p>These parameters are used to correct the asymmetry for different detector efficiencies, solid angles and initial asymmetries. They are defined as <spanclass="math notranslate nohighlight">\(\alpha = N_{0,b}/N_{0,f}\)</span> and <spanclass="math notranslate nohighlight">\(\beta = A_{0,b}/A_{0,f}\)</span>. If the parameters are not specified in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>, for each one the value of 1 is assumed (for fittype 5, alpha is estimated from the ratio of <spanclass="math notranslate nohighlight">\(\sum_i \left( N_{\mathrm{bp}}(i)+N_{\mathrm{bm}}(i) \right)\)</span> and <spanclass="math notranslate nohighlight">\(\sum_i \left( N_{\mathrm{fp}}(i)+N_{\mathrm{fm}}(i) \right)\)</span>). Both, <cite>alpha</cite> as well as <cite>beta</cite> can be expressed through a function. Example for alpha with fit parameter number 1:</p>
<dt><strong>alpha, beta</strong> (fit type 2, 3, 5)</dt><dd><p>These parameters are used to correct the asymmetry for different detector efficiencies, solid angles and initial asymmetries. They are defined as <spanclass="math notranslate nohighlight">\(\alpha = N_{0,b}/N_{0,f}\)</span> and <spanclass="math notranslate nohighlight">\(\beta = A_{0,b}/A_{0,f}\)</span>. If the parameters are not specified in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>, for each one the value of 1 is assumed (for fittype 5, alpha is estimated from the ratio of <spanclass="math notranslate nohighlight">\(\sum_i \left( N_{\mathrm{bp}}(i)+N_{\mathrm{bm}}(i) \right)\)</span> and <spanclass="math notranslate nohighlight">\(\sum_i \left( N_{\mathrm{fp}}(i)+N_{\mathrm{fm}}(i) \right)\)</span>). Both, <cite>alpha</cite> as well as <cite>beta</cite> can be expressed through a function. Example for alpha with fit parameter number 1:</p>
@ -1179,7 +1211,7 @@ a short digression is needed.</p>
</div>
</div>
</dd>
</dd>
</dl>
</dl>
<spanid="index-21"></span><dlid="msr-norm">
<spanid="index-22"></span><dlid="msr-norm">
<dt><strong>norm</strong> (fit type 0)</dt><dd><p>Number of the fit parameter that represents the normalization constant <spanclass="math notranslate nohighlight">\(N_0\)</span> of the histogram; the value of this parameter is given either per nanosecond or per bin (see <aclass="reference internal"href="#msr-commands-block"><spanclass="std std-ref">below</span></a>).
<dt><strong>norm</strong> (fit type 0)</dt><dd><p>Number of the fit parameter that represents the normalization constant <spanclass="math notranslate nohighlight">\(N_0\)</span> of the histogram; the value of this parameter is given either per nanosecond or per bin (see <aclass="reference internal"href="#msr-commands-block"><spanclass="std std-ref">below</span></a>).
It is possible to substitute the parameter number by a function, for instance to relate <spanclass="math notranslate nohighlight">\(N_0\)</span>’s of different histograms through an <spanclass="math notranslate nohighlight">\(\alpha\)</span>
It is possible to substitute the parameter number by a function, for instance to relate <spanclass="math notranslate nohighlight">\(N_0\)</span>’s of different histograms through an <spanclass="math notranslate nohighlight">\(\alpha\)</span>
parameter. Example for a <codeclass="docutils literal notranslate"><spanclass="pre">norm</span></code> defined by fit parameter number 12:</p>
parameter. Example for a <codeclass="docutils literal notranslate"><spanclass="pre">norm</span></code> defined by fit parameter number 12:</p>
@ -1192,25 +1224,25 @@ parameter. Example for a <code class="docutils literal notranslate"><span class=
<dt><strong>backgr.fit</strong> (fit type 0)</dt><dd><p>Parameter number specifying the constant background in a histogram. Its value is given either per nanosecond or per bin (see <aclass="reference internal"href="#msr-commands-block"><spanclass="std std-ref">below</span></a>). If this keyword is present,
<dt><strong>backgr.fit</strong> (fit type 0)</dt><dd><p>Parameter number specifying the constant background in a histogram. Its value is given either per nanosecond or per bin (see <aclass="reference internal"href="#msr-commands-block"><spanclass="std std-ref">below</span></a>). If this keyword is present,
any information on a background line are ignored.</p>
any information on a background line are ignored.</p>
<dt><strong>lifetime</strong> (fit type 0)</dt><dd><p>Fit parameter representing the lifetime of the muon. If it is not specified the value <spanclass="math notranslate nohighlight">\(\tau_\mu=2.197019~ \mu\mathrm{s}\)</span> is used in the calculations.</p>
<dt><strong>lifetime</strong> (fit type 0)</dt><dd><p>Fit parameter representing the lifetime of the muon. If it is not specified the value <spanclass="math notranslate nohighlight">\(\tau_\mu=2.197019~ \mu\mathrm{s}\)</span> is used in the calculations.</p>
</dd>
</dd>
<dt><strong>lifetimecorrection</strong> (fit type 0) <em>obsolete</em></dt><dd><p>Does not accept any arguments. If present, the output in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code> is corrected for the exponential decay of the muon. This item is <em>obsolete</em> in the RUN block
<dt><strong>lifetimecorrection</strong> (fit type 0) <em>obsolete</em></dt><dd><p>Does not accept any arguments. If present, the output in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code> is corrected for the exponential decay of the muon. This item is <em>obsolete</em> in the RUN block
and will be transferred to the <aclass="reference internal"href="#msr-plot-block"><spanclass="std std-ref">PLOT block</span></a>, which allows switching between histogram view and asymmetry view much quicker.</p>
and will be transferred to the <aclass="reference internal"href="#msr-plot-block"><spanclass="std std-ref">PLOT block</span></a>, which allows switching between histogram view and asymmetry view much quicker.</p>
<dt><strong>map</strong></dt><dd><p>On this line the mapping of run-dependent parameters is done. Parameter numbers given here may be accessed through map1, map2, etc. in the
<dt><strong>map</strong></dt><dd><p>On this line the mapping of run-dependent parameters is done. Parameter numbers given here may be accessed through map1, map2, etc. in the
<aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY</span></a> and <aclass="reference internal"href="#msr-functions-block"><spanclass="std std-ref">FUNCTIONS</span></a> blocks (see also <aclass="reference internal"href="#msr-map-intro"><spanclass="std std-ref">maps</span></a>). The first ten maps
<aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY</span></a> and <aclass="reference internal"href="#msr-functions-block"><spanclass="std std-ref">FUNCTIONS</span></a> blocks (see also <aclass="reference internal"href="#msr-map-intro"><spanclass="std std-ref">maps</span></a>). The first ten maps
are always present and have the value 0 if not used; however, the total number of maps is not restricted!</p>
are always present and have the value 0 if not used; however, the total number of maps is not restricted!</p>
</dd>
</dd>
</dl>
</dl>
<spanid="index-25"></span><dlid="msr-forward">
<spanid="index-26"></span><dlid="msr-forward">
<dt><strong>forward</strong> (fit type 0, 1, 4)</dt><dd><p>Number of the histogram in the data file to be processed. If histograms shall be grouped, all the numbers which shall be grouped. Examples:</p>
<dt><strong>forward</strong> (fit type 0, 1, 4)</dt><dd><p>Number of the histogram in the data file to be processed. If histograms shall be grouped, all the numbers which shall be grouped. Examples:</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="n">forward</span><spanclass="mi">3</span><spanclass="c1"># no grouping, take histogram number 3</span>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="n">forward</span><spanclass="mi">3</span><spanclass="c1"># no grouping, take histogram number 3</span>
<spanclass="n">forward</span><spanclass="mi">1</span><spanclass="mi">2</span><spanclass="c1"># group histogram number 1 and 2</span>
<spanclass="n">forward</span><spanclass="mi">1</span><spanclass="mi">2</span><spanclass="c1"># group histogram number 1 and 2</span>
@ -1219,7 +1251,7 @@ are always present and have the value 0 if not used; however, the total number o
<dt><strong>forward, backward</strong> (fit types 2, 3)</dt><dd><p>Numbers of the histograms in the data file that should be taken to calculate the asymmetry. If histograms shall be grouped, all the numbers which shall be grouped. Examples:</p>
<dt><strong>forward, backward</strong> (fit types 2, 3)</dt><dd><p>Numbers of the histograms in the data file that should be taken to calculate the asymmetry. If histograms shall be grouped, all the numbers which shall be grouped. Examples:</p>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># build forward/backward asymmetry with histogram 1 and 3</span>
<divclass="highlight-default notranslate"><divclass="highlight"><pre><span></span><spanclass="c1"># build forward/backward asymmetry with histogram 1 and 3</span>
<dt><strong>backgr.fix</strong> (fit types 0, 1, 2, 3, 5)</dt><dd><p>A fixed constant background in counts per nanosecond or per bin (see <aclass="reference internal"href="#msr-commands-block"><spanclass="std std-ref">below</span></a>) may be given at this point.
<dt><strong>backgr.fix</strong> (fit types 0, 1, 2, 3, 5)</dt><dd><p>A fixed constant background in counts per nanosecond or per bin (see <aclass="reference internal"href="#msr-commands-block"><spanclass="std std-ref">below</span></a>) may be given at this point.
The background is specified for all histograms in the order <spanclass="math notranslate nohighlight">\(B_f B_b [B_r B_l]\)</span>. If this keyword is present, <em>any</em> information on a <codeclass="docutils literal notranslate"><spanclass="pre">background</span></code> line is ignored.</p>
The background is specified for all histograms in the order <spanclass="math notranslate nohighlight">\(B_f B_b [B_r B_l]\)</span>. If this keyword is present, <em>any</em> information on a <codeclass="docutils literal notranslate"><spanclass="pre">background</span></code> line is ignored.</p>
<dt><strong>background</strong> (fit type 0, 1)</dt><dd><p>The numbers of the first and the last channel of an interval from which the constant background should be calculated are specified here.
<dt><strong>background</strong> (fit type 0, 1)</dt><dd><p>The numbers of the first and the last channel of an interval from which the constant background should be calculated are specified here.
In case histograms are being grouped, the specified channels are interpreted with respect to the first histogram. Example:</p>
In case histograms are being grouped, the specified channels are interpreted with respect to the first histogram. Example:</p>
<dt><strong>background</strong> (fit types 2, 3, 5)</dt><dd><p>The numbers of the first and the last channel of an interval from which the constant background should be calculated are specified here.
<dt><strong>background</strong> (fit types 2, 3, 5)</dt><dd><p>The numbers of the first and the last channel of an interval from which the constant background should be calculated are specified here.
For all the histograms this is done together in the following order: <spanclass="math notranslate nohighlight">\(k_{f,\rm first} k_{f,\rm last} k_{b,\rm first} k_{b, \rm last} [k_{r,\rm first} k_{r,\rm last} k_{l,\rm first} k_{l,\rm last}]\)</span>.
For all the histograms this is done together in the following order: <spanclass="math notranslate nohighlight">\(k_{f,\rm first} k_{f,\rm last} k_{b,\rm first} k_{b, \rm last} [k_{r,\rm first} k_{r,\rm last} k_{l,\rm first} k_{l,\rm last}]\)</span>.
In case histograms are being grouped, the specified channels are interpreted with respect to the first histograms. Example:</p>
In case histograms are being grouped, the specified channels are interpreted with respect to the first histograms. Example:</p>
@ -1263,7 +1295,7 @@ In case histograms are being grouped, the specified channels are interpreted wit
<dt><strong>data</strong> (fit type 0, 1, 4)</dt><dd><p>The numbers of the first and the last channel of an interval from which the data is taken are specified here.
<dt><strong>data</strong> (fit type 0, 1, 4)</dt><dd><p>The numbers of the first and the last channel of an interval from which the data is taken are specified here.
In case histograms are being grouped, the specified channels are interpreted with respect to the first histogram.
In case histograms are being grouped, the specified channels are interpreted with respect to the first histogram.
Typically these channels are referred to as <codeclass="docutils literal notranslate"><spanclass="pre">first</span><spanclass="pre">good</span><spanclass="pre">bin</span></code> / <codeclass="docutils literal notranslate"><spanclass="pre">last</span><spanclass="pre">good</span><spanclass="pre">bin</span></code> (fgb/lgb). Example:</p>
Typically these channels are referred to as <codeclass="docutils literal notranslate"><spanclass="pre">first</span><spanclass="pre">good</span><spanclass="pre">bin</span></code> / <codeclass="docutils literal notranslate"><spanclass="pre">last</span><spanclass="pre">good</span><spanclass="pre">bin</span></code> (fgb/lgb). Example:</p>
@ -1272,7 +1304,7 @@ Typically these channels are referred to as <code class="docutils literal notran
<dt><strong>data</strong> (fit type 2, 3, 5)</dt><dd><p>The numbers of the first and the last channel of an interval from which the data is taken are specified here.
<dt><strong>data</strong> (fit type 2, 3, 5)</dt><dd><p>The numbers of the first and the last channel of an interval from which the data is taken are specified here.
Typically these channels are referred to as first good bin / last good bin (fgb/lgb). For all the histograms this is
Typically these channels are referred to as first good bin / last good bin (fgb/lgb). For all the histograms this is
done together in the following order: <spanclass="math notranslate nohighlight">\(k_{f,\rm first} k_{f,\rm last} k_{b,\rm first} k_{b, \rm last} [k_{r,\rm first} k_{r,\rm last} k_{l,\rm first} k_{l,\rm last}]\)</span>.
done together in the following order: <spanclass="math notranslate nohighlight">\(k_{f,\rm first} k_{f,\rm last} k_{b,\rm first} k_{b, \rm last} [k_{r,\rm first} k_{r,\rm last} k_{l,\rm first} k_{l,\rm last}]\)</span>.
@ -1282,7 +1314,7 @@ In case histograms are being grouped, the specified channels are interpreted wit
<spanclass="n">t0</span><spanclass="mi">3419</span><spanclass="mi">3434</span><spanclass="c1"># t0 channels for groupings: forward f1 f2. 3419 t0 for f1, 3434 t0 for f2.</span>
<spanclass="n">t0</span><spanclass="mi">3419</span><spanclass="mi">3434</span><spanclass="c1"># t0 channels for groupings: forward f1 f2. 3419 t0 for f1, 3434 t0 for f2.</span>
@ -1290,7 +1322,7 @@ In case histograms are being grouped, the specified channels are interpreted wit
<dt><strong>t0</strong> (fit type 2, 3, 5)</dt><dd><p>The numbers of time-zero channels of the histograms in the order <spanclass="math notranslate nohighlight">\(t_{0,f} t_{0,b}\)</span>. For fit type 5, the time-zero is the channel of the start of beam pulse. Example:</p>
<dt><strong>t0</strong> (fit type 2, 3, 5)</dt><dd><p>The numbers of time-zero channels of the histograms in the order <spanclass="math notranslate nohighlight">\(t_{0,f} t_{0,b}\)</span>. For fit type 5, the time-zero is the channel of the start of beam pulse. Example:</p>
<dt><strong>addt0</strong> (fit type 0, 1, 4)</dt><dd><p>The number of the time-zero channel of the histogram. If grouping of histograms is present (see <aclass="reference internal"href="#msr-forward"><spanclass="std std-ref">forward</span></a>) the
<dt><strong>addt0</strong> (fit type 0, 1, 4)</dt><dd><p>The number of the time-zero channel of the histogram. If grouping of histograms is present (see <aclass="reference internal"href="#msr-forward"><spanclass="std std-ref">forward</span></a>) the
same syntax as for <aclass="reference internal"href="#msr-t0-single-histo"><spanclass="std std-ref">t0</span></a> applies. If one addt0 is given, the total number of addt0’s needs to be equal to
same syntax as for <aclass="reference internal"href="#msr-t0-single-histo"><spanclass="std std-ref">t0</span></a> applies. If one addt0 is given, the total number of addt0’s needs to be equal to
the total number of <aclass="reference internal"href="#msr-addrun"><spanclass="std std-ref">ADDRUN</span></a>’s!</p>
the total number of <aclass="reference internal"href="#msr-addrun"><spanclass="std std-ref">ADDRUN</span></a>’s!</p>
<dt><strong>addt0</strong> (fit type 2, 3, 5)</dt><dd><p>The numbers of time-zero channels of the histograms in the order <spanclass="math notranslate nohighlight">\(t_{0,f} t_{0,b} [t_{0,r} t_{0,l}]\)</span>.
<dt><strong>addt0</strong> (fit type 2, 3, 5)</dt><dd><p>The numbers of time-zero channels of the histograms in the order <spanclass="math notranslate nohighlight">\(t_{0,f} t_{0,b} [t_{0,r} t_{0,l}]\)</span>.
If grouping of histograms is present (see <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">forward</span></a>) the same syntax as for <aclass="reference internal"href="#msr-t0-asymmetry"><spanclass="std std-ref">t0</span></a> applies.
If grouping of histograms is present (see <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">forward</span></a>) the same syntax as for <aclass="reference internal"href="#msr-t0-asymmetry"><spanclass="std std-ref">t0</span></a> applies.
If one addt0 is given, the total number of addt0’s needs to be equal to the total number of <aclass="reference internal"href="#msr-addrun"><spanclass="std std-ref">ADDRUN</span></a>’s!</p>
If one addt0 is given, the total number of addt0’s needs to be equal to the total number of <aclass="reference internal"href="#msr-addrun"><spanclass="std std-ref">ADDRUN</span></a>’s!</p>
<dt><strong>xy-data</strong> (fit type 8)</dt><dd><p>Specification of the data from an ASCII or DB file which should be used as <em>x</em> and <em>y</em> data (in this order).
<dt><strong>xy-data</strong> (fit type 8)</dt><dd><p>Specification of the data from an ASCII or DB file which should be used as <em>x</em> and <em>y</em> data (in this order).
For a simple ASCII file the column numbers are used, in the case of a DB file one can either specify the variable
For a simple ASCII file the column numbers are used, in the case of a DB file one can either specify the variable
numbers or the name of the variables as given in the DB header.</p>
numbers or the name of the variables as given in the DB header.</p>
</dd>
</dd>
</dl>
</dl>
<spanid="index-37"></span><dlid="msr-fit">
<spanid="index-38"></span><dlid="msr-fit">
<dt><strong>fit</strong></dt><dd><p>The range of data that should be considered when the fitting is done. For the μSR fit types 0, 1, 2, 3, and 4 the
<dt><strong>fit</strong></dt><dd><p>The range of data that should be considered when the fitting is done. For the μSR fit types 0, 1, 2, 3, and 4 the
starting and end times are given in micro-seconds. For the non-μSR fit type 8 the starting and end points of the
starting and end times are given in micro-seconds. For the non-μSR fit type 8 the starting and end points of the
fitting range are given in the units of the <em>x</em> data.</p>
fitting range are given in the units of the <em>x</em> data.</p>
<dt><strong>packing</strong></dt><dd><p>Number of data channels to be binned together. For the non-μSR fit type 8 the binning is supposed to be 1.
<dt><strong>packing</strong></dt><dd><p>Number of data channels to be binned together. For the non-μSR fit type 8 the binning is supposed to be 1.
For the single histogram RRF fit (fittype 1) and asymmetry RRF fit (fittype 3) this parameter is meaningless.</p>
For the single histogram RRF fit (fittype 1) and asymmetry RRF fit (fittype 3) this parameter is meaningless.</p>
</dd>
</dd>
</dl>
</dl>
</div>
</div>
<divclass="section"id="the-commands-block">
<divclass="section"id="the-commands-block">
<spanid="msr-commands-block"></span><spanid="index-39"></span><h3>The COMMANDS Block<aclass="headerlink"href="#the-commands-block"title="Permalink to this headline">¶</a></h3>
<spanid="msr-commands-block"></span><spanid="index-40"></span><h3>The COMMANDS Block<aclass="headerlink"href="#the-commands-block"title="Permalink to this headline">¶</a></h3>
<p>The COMMANDS block is used to specify the commands which are passed from <codeclass="docutils literal notranslate"><spanclass="pre">musrfit</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">MINUIT2</span></code>. The supported commands
<p>The COMMANDS block is used to specify the commands which are passed from <codeclass="docutils literal notranslate"><spanclass="pre">musrfit</span></code> to <codeclass="docutils literal notranslate"><spanclass="pre">MINUIT2</span></code>. The supported commands
after the <codeclass="docutils literal notranslate"><spanclass="pre">COMMANDS</span></code> keyword are listed in the two tables below (<aclass="reference internal"href="#minuit2-command-overview"><spanclass="std std-ref">Minuit2 Command Overview</span></a> and <aclass="reference internal"href="#dks-command-overview"><spanclass="std std-ref">DKS Command Overview</span></a>)
after the <codeclass="docutils literal notranslate"><spanclass="pre">COMMANDS</span></code> keyword are listed in the two tables below (<aclass="reference internal"href="#minuit2-command-overview"><spanclass="std std-ref">Minuit2 Command Overview</span></a> and <aclass="reference internal"href="#dks-command-overview"><spanclass="std std-ref">DKS Command Overview</span></a>)
and further described in <aclass="reference internal"href="#musrfit-command-block-details"><spanclass="std std-ref">musrfit Command Block Details</span></a>.</p>
and further described in <aclass="reference internal"href="#musrfit-command-block-details"><spanclass="std std-ref">musrfit Command Block Details</span></a>.</p>
<divclass="section"id="minuit2-command-overview">
<divclass="section"id="minuit2-command-overview">
<spanid="index-40"></span><spanid="id21"></span><h4>Minuit2 Command Overview<aclass="headerlink"href="#minuit2-command-overview"title="Permalink to this headline">¶</a></h4>
<spanid="index-41"></span><spanid="id21"></span><h4>Minuit2 Command Overview<aclass="headerlink"href="#minuit2-command-overview"title="Permalink to this headline">¶</a></h4>
<tableclass="docutils align-default">
<tableclass="docutils align-default">
<colgroup>
<colgroup>
<colstyle="width: 20%"/>
<colstyle="width: 20%"/>
@ -1499,7 +1531,7 @@ Used for statistical analysis only.</p></td>
</dl>
</dl>
</div>
</div>
<divclass="section"id="dks-command-overview">
<divclass="section"id="dks-command-overview">
<spanid="index-41"></span><spanid="id31"></span><h4>DKS Command Overview<aclass="headerlink"href="#dks-command-overview"title="Permalink to this headline">¶</a></h4>
<spanid="index-42"></span><spanid="id31"></span><h4>DKS Command Overview<aclass="headerlink"href="#dks-command-overview"title="Permalink to this headline">¶</a></h4>
<tableclass="docutils align-default">
<tableclass="docutils align-default">
<colgroup>
<colgroup>
<colstyle="width: 28%"/>
<colstyle="width: 28%"/>
@ -1560,7 +1592,7 @@ It allows to use all your threads of your CPU(s) during the minimization.</p>
<spanid="index-42"></span><spanid="id36"></span><h4><codeclass="docutils literal notranslate"><spanclass="pre">musrfit</span></code> Command Block Details<aclass="headerlink"href="#musrfit-command-block-details"title="Permalink to this headline">¶</a></h4>
<spanid="index-43"></span><spanid="id36"></span><h4><codeclass="docutils literal notranslate"><spanclass="pre">musrfit</span></code> Command Block Details<aclass="headerlink"href="#musrfit-command-block-details"title="Permalink to this headline">¶</a></h4>
<p>A standard COMMANDS block then looks like this:</p>
<p>A standard COMMANDS block then looks like this:</p>
<spanid="msr-commands-block-dks"></span><spanid="index-43"></span><h4>DKS extensions of the COMMANDS block enabling GPU and general OpenCL support<aclass="headerlink"href="#dks-extensions-of-the-commands-block-enabling-gpu-and-general-opencl-support"title="Permalink to this headline">¶</a></h4>
<spanid="msr-commands-block-dks"></span><spanid="index-44"></span><h4>DKS extensions of the COMMANDS block enabling GPU and general OpenCL support<aclass="headerlink"href="#dks-extensions-of-the-commands-block-enabling-gpu-and-general-opencl-support"title="Permalink to this headline">¶</a></h4>
<p>In case you are running the musrfit / DKS version, there are a couple commands which allow you to control the way how the fit shall be performed. These commands are:</p>
<p>In case you are running the musrfit / DKS version, there are a couple commands which allow you to control the way how the fit shall be performed. These commands are:</p>
<tableclass="docutils align-default">
<tableclass="docutils align-default">
<colgroup>
<colgroup>
@ -1690,27 +1722,27 @@ In the <a class="reference internal" href="#msr-theory-block"><span class="std s
</div>
</div>
</div>
</div>
<divclass="section"id="the-fourier-block">
<divclass="section"id="the-fourier-block">
<spanid="msr-fourier-block"></span><spanid="index-44"></span><h3>The FOURIER Block<aclass="headerlink"href="#the-fourier-block"title="Permalink to this headline">¶</a></h3>
<spanid="msr-fourier-block"></span><spanid="index-45"></span><h3>The FOURIER Block<aclass="headerlink"href="#the-fourier-block"title="Permalink to this headline">¶</a></h3>
<p>If a Fourier transform is carried out the results are plotted within <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code>. As input data the actual data <em>shown</em> in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code> is used,
<p>If a Fourier transform is carried out the results are plotted within <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code>. As input data the actual data <em>shown</em> in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code> is used,
<em>i.e.</em> the currently time range shown in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code>! In the FOURIER block of the msr file all necessary parameters for calculating and presenting
<em>i.e.</em> the currently time range shown in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code>! In the FOURIER block of the msr file all necessary parameters for calculating and presenting
the Fourier transform of the data specified in the <aclass="reference internal"href="#msr-plot-block"><spanclass="std std-ref">PLOT block</span></a> is given. If the FOURIER block is not present in the msr file,
the Fourier transform of the data specified in the <aclass="reference internal"href="#msr-plot-block"><spanclass="std std-ref">PLOT block</span></a> is given. If the FOURIER block is not present in the msr file,
either the parameters set in the <aclass="reference internal"href="#musrfit-startup"><spanclass="std std-ref">XML startup</span></a> file or the system defaults are taken when the Fourier transform is performed.
either the parameters set in the <aclass="reference internal"href="#musrfit-startup"><spanclass="std std-ref">XML startup</span></a> file or the system defaults are taken when the Fourier transform is performed.
The block starts with the <em>FOURIER</em> keyword and may contain the following entries on the successive lines:</p>
The block starts with the <em>FOURIER</em> keyword and may contain the following entries on the successive lines:</p>
<dt><strong>units</strong></dt><dd><p>Here is specified in which domain the Fourier-transformed data is presented. One may choose between the fields (<em>Gauss</em>) or (<em>Tesla</em>), the frequency (<em>MHz</em>), and the angular-frequency domain (<em>Mc/s</em>).</p>
<dt><strong>units</strong></dt><dd><p>Here is specified in which domain the Fourier-transformed data is presented. One may choose between the fields (<em>Gauss</em>) or (<em>Tesla</em>), the frequency (<em>MHz</em>), and the angular-frequency domain (<em>Mc/s</em>).</p>
<dt><strong>fourier_power</strong></dt><dd><p>It is possible (but not necessary) to set the number of data points used for the Fourier transform here. As argument the exponent <em>n<21</em> of a power of 2 is accepted.
<dt><strong>fourier_power</strong></dt><dd><p>It is possible (but not necessary) to set the number of data points used for the Fourier transform here. As argument the exponent <em>n<21</em> of a power of 2 is accepted.
The number of data points is then 2<sup>n</sup>. <strong>Attention:</strong> If the number of points given here is bigger than the actual number of available data points,
The number of data points is then 2<sup>n</sup>. <strong>Attention:</strong> If the number of points given here is bigger than the actual number of available data points,
the input data vector is filled with zeros until the number of requested points is reached (<em>zero padding</em>)!</p>
the input data vector is filled with zeros until the number of requested points is reached (<em>zero padding</em>)!</p>
<dt><strong>dc-corrected</strong></dt><dd><p>a flag to remove a potential DC-offset of the signal. Allowed entries are <codeclass="docutils literal notranslate"><spanclass="pre">dc-corrected</span><spanclass="pre">true</span><spanclass="pre">|</span><spanclass="pre">1</span><spanclass="pre">|</span><spanclass="pre">false</span><spanclass="pre">|</span><spanclass="pre">0</span></code>.</p>
<dt><strong>dc-corrected</strong></dt><dd><p>a flag to remove a potential DC-offset of the signal. Allowed entries are <codeclass="docutils literal notranslate"><spanclass="pre">dc-corrected</span><spanclass="pre">true</span><spanclass="pre">|</span><spanclass="pre">1</span><spanclass="pre">|</span><spanclass="pre">false</span><spanclass="pre">|</span><spanclass="pre">0</span></code>.</p>
<dt><strong>apodization</strong></dt><dd><p>Here is decided if the data should be apodized before the Fourier transform is performed and if yes, which apodization should be used (for further details about apodization of
<dt><strong>apodization</strong></dt><dd><p>Here is decided if the data should be apodized before the Fourier transform is performed and if yes, which apodization should be used (for further details about apodization of
μSR data refer to the <aclass="reference external"href="https://open.library.ubc.ca/cIRcle/collections/ubctheses/831/items/1.0085550">PhD thesis of T.M. Riseman (UBC)</a>). The argument to be put after the
μSR data refer to the <aclass="reference external"href="https://open.library.ubc.ca/cIRcle/collections/ubctheses/831/items/1.0085550">PhD thesis of T.M. Riseman (UBC)</a>). The argument to be put after the
keyword is therefore one of the following: <strong>NONE, WEAK, MEDIUM</strong> or <strong>STRONG</strong>. If the data should be apodized, they are manipulated as follows: each data value is multiplied by the function</p>
keyword is therefore one of the following: <strong>NONE, WEAK, MEDIUM</strong> or <strong>STRONG</strong>. If the data should be apodized, they are manipulated as follows: each data value is multiplied by the function</p>
@ -1727,7 +1759,7 @@ keyword is therefore one of the following: <strong>NONE, WEAK, MEDIUM</strong> o
<dt><strong>plot</strong></dt><dd><p>At this point it is possible to set the part of the Fourier-transformed data which should be plotted by default if the Fourier transform is done by pressing the <em>f</em>-key in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code>.
<dt><strong>plot</strong></dt><dd><p>At this point it is possible to set the part of the Fourier-transformed data which should be plotted by default if the Fourier transform is done by pressing the <em>f</em>-key in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code>.
The argument may be one of the following:</p>
The argument may be one of the following:</p>
<dlclass="simple">
<dlclass="simple">
@ -1744,7 +1776,7 @@ The argument may be one of the following:</p>
<dt><strong>phase</strong></dt><dd><p>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,
<dt><strong>phase</strong></dt><dd><p>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>
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>
<p>Currently there are three options:</p>
@ -1796,12 +1828,12 @@ list example, the first parameter number will be the reference phase. The compac
<dt><strong>range_for_phase_correction</strong></dt><dd><p>An interval in Fourier space given in units as define with the ‘units’ tag, or the tag ‘all’ in which case the range given under ‘range’ will be used.
<dt><strong>range_for_phase_correction</strong></dt><dd><p>An interval in Fourier space given in units as define with the ‘units’ tag, or the tag ‘all’ in which case the range given under ‘range’ will be used.
The given interval will be used for an automatic phasing of the real Fourier transform. This will allow to add real Fourier spectra coherently.</p>
The given interval will be used for an automatic phasing of the real Fourier transform. This will allow to add real Fourier spectra coherently.</p>
<dt><strong>range</strong></dt><dd><p>The plotting range is set here. The interval is specified through its start and end points given in the <em>units</em> set after the <strong>units</strong> tag.</p>
<dt><strong>range</strong></dt><dd><p>The plotting range is set here. The interval is specified through its start and end points given in the <em>units</em> set after the <strong>units</strong> tag.</p>
</dd>
</dd>
</dl>
</dl>
@ -1817,20 +1849,20 @@ The given interval will be used for an automatic phasing of the real Fourier tra
</div>
</div>
</div>
</div>
<divclass="section"id="the-plot-block">
<divclass="section"id="the-plot-block">
<spanid="msr-plot-block"></span><spanid="index-53"></span><h3>The PLOT Block<aclass="headerlink"href="#the-plot-block"title="Permalink to this headline">¶</a></h3>
<spanid="msr-plot-block"></span><spanid="index-54"></span><h3>The PLOT Block<aclass="headerlink"href="#the-plot-block"title="Permalink to this headline">¶</a></h3>
<p>The PLOT block is intended to collect all the information needed for the graphical presentation of the data and fits using <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code>.
<p>The PLOT block is intended to collect all the information needed for the graphical presentation of the data and fits using <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code>.
The PLOT keyword at the beginning of the block is followed by a number which indicates the plot type. The plot types have to match the <aclass="reference internal"href="#fit-types"><spanclass="std std-ref">fit types</span></a>.
The PLOT keyword at the beginning of the block is followed by a number which indicates the plot type. The plot types have to match the <aclass="reference internal"href="#fit-types"><spanclass="std std-ref">fit types</span></a>.
Additionally, it is possible to provide information using the following keywords:</p>
Additionally, it is possible to provide information using the following keywords:</p>
<dt><strong>lifetimecorrection</strong></dt><dd><p>Does not accept any arguments. If present, the output in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code> is corrected for the exponential decay of the muon. Only relevant for (type 0).</p>
<dt><strong>lifetimecorrection</strong></dt><dd><p>Does not accept any arguments. If present, the output in <codeclass="docutils literal notranslate"><spanclass="pre">musrview</span></code> is corrected for the exponential decay of the muon. Only relevant for (type 0).</p>
<dt><strong>runs</strong></dt><dd><p>The numbers of the runs to be plotted have to be put here. The runs are numbered according to their appearance in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>.
<dt><strong>runs</strong></dt><dd><p>The numbers of the runs to be plotted have to be put here. The runs are numbered according to their appearance in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>.
The numbers is either a space separated list of numbers, an interval <em>e.g.</em> 1-16, or a combination of both.</p>
The numbers is either a space separated list of numbers, an interval <em>e.g.</em> 1-16, or a combination of both.</p>
<dt><strong>range</strong></dt><dd><p>Here it is possible to define the plotting range explicitly. Depending on the plot type the following settings are allowed where the times are given in
<dt><strong>range</strong></dt><dd><p>Here it is possible to define the plotting range explicitly. Depending on the plot type the following settings are allowed where the times are given in
micro-seconds and the <em>N</em> in counts (types 0-4) or in counts/nsec (type 0, 1):</p>
micro-seconds and the <em>N</em> in counts (types 0-4) or in counts/nsec (type 0, 1):</p>
<dlclass="simple">
<dlclass="simple">
@ -1843,7 +1875,7 @@ micro-seconds and the <em>N</em> in counts (types 0-4) or in counts/nsec (type 0
<dt><strong>sub_ranges</strong></dt><dd><p>Here it is possible to define the plotting range for each run individually. For the different plot types the command has the structure:</p>
<dt><strong>sub_ranges</strong></dt><dd><p>Here it is possible to define the plotting range for each run individually. For the different plot types the command has the structure:</p>
<dlclass="simple">
<dlclass="simple">
<dt>fit type 0-4 <em>without</em> lifetimecorrection:</dt><dd><p><em>t</em><sup>1</sup><sub>min</sub><em>t</em><sup>1</sup><sub>max</sub><em>t</em><sup>2</sup><sub>min</sub><em>t</em><sup>2</sup><sub>max</sub> … <em>t</em><sup>n</sup><sub>min</sub><em>t</em><sup>n</sup><sub>max</sub> [ <em>N</em><sub>min</sub><em>N</em><sub>max</sub> ] (n = the number of runs to be plotted)</p>
<dt>fit type 0-4 <em>without</em> lifetimecorrection:</dt><dd><p><em>t</em><sup>1</sup><sub>min</sub><em>t</em><sup>1</sup><sub>max</sub><em>t</em><sup>2</sup><sub>min</sub><em>t</em><sup>2</sup><sub>max</sub> … <em>t</em><sup>n</sup><sub>min</sub><em>t</em><sup>n</sup><sub>max</sub> [ <em>N</em><sub>min</sub><em>N</em><sub>max</sub> ] (n = the number of runs to be plotted)</p>
@ -1855,31 +1887,31 @@ micro-seconds and the <em>N</em> in counts (types 0-4) or in counts/nsec (type 0
<dt><strong>use_fit_ranges</strong> [ <em>y</em><sub>min</sub><em>y</em><sub>max</sub> ]</dt><dd><p>The fit ranges of the individual runs are used to present the data. Optionally, an ordinate range can be provided.</p>
<dt><strong>use_fit_ranges</strong> [ <em>y</em><sub>min</sub><em>y</em><sub>max</sub> ]</dt><dd><p>The fit ranges of the individual runs are used to present the data. Optionally, an ordinate range can be provided.</p>
<dt><strong>view_packing</strong></dt><dd><p>The data are presented in the packing given here rather than the binning used for the fit. <strong>WARNING:</strong> This is a global option and applies to all PLOT-blocks.</p>
<dt><strong>view_packing</strong></dt><dd><p>The data are presented in the packing given here rather than the binning used for the fit. <strong>WARNING:</strong> This is a global option and applies to all PLOT-blocks.</p>
<dt><strong>logx</strong></dt><dd><p>Will present the time axis in a logarithmic scale. <em>So far no checking of negative and zero-valued data is performed, hence expect interesting output!</em></p>
<dt><strong>logx</strong></dt><dd><p>Will present the time axis in a logarithmic scale. <em>So far no checking of negative and zero-valued data is performed, hence expect interesting output!</em></p>
<dt><strong>logy</strong></dt><dd><p>Will present the axis of ordinates in a logarithmic scale. <em>So far no checking of negative and zero-valued data is performed, hence expect interesting output!</em></p>
<dt><strong>logy</strong></dt><dd><p>Will present the axis of ordinates in a logarithmic scale. <em>So far no checking of negative and zero-valued data is performed, hence expect interesting output!</em></p>
<dt><strong>rrf_packing</strong> value</dt><dd><p>In the rotating-reference-frame (RRF) representation, this will be the value for the packing. <strong>WARNING:</strong> For the time being, this is a global option and applies to all PLOT blocks.</p>
<dt><strong>rrf_packing</strong> value</dt><dd><p>In the rotating-reference-frame (RRF) representation, this will be the value for the packing. <strong>WARNING:</strong> For the time being, this is a global option and applies to all PLOT blocks.</p>
<dt><strong>rrf_freq</strong> value unit</dt><dd><p>This entry provides the RRF “frequency” given by the value and the unit which can be: <em>kHz</em>, <em>MHz</em>, <em>Mc/s</em>, <em>G</em>, or <em>T</em>.</p>
<dt><strong>rrf_freq</strong> value unit</dt><dd><p>This entry provides the RRF “frequency” given by the value and the unit which can be: <em>kHz</em>, <em>MHz</em>, <em>Mc/s</em>, <em>G</em>, or <em>T</em>.</p>
<dt><strong>rrf_phase</strong> value</dt><dd><p>A phase of the RRF can be provided, either as a value in degrees, or as a parX, <em>e.g.</em> par4, where ‘X’ is supposed to be the phase parameter number in the <aclass="reference internal"href="#msr-fitparameter-block"><spanclass="std std-ref">FITPARAMETER block</span></a>.</p>
<dt><strong>rrf_phase</strong> value</dt><dd><p>A phase of the RRF can be provided, either as a value in degrees, or as a parX, <em>e.g.</em> par4, where ‘X’ is supposed to be the phase parameter number in the <aclass="reference internal"href="#msr-fitparameter-block"><spanclass="std std-ref">FITPARAMETER block</span></a>.</p>
@ -1913,7 +1945,7 @@ The theory, however, is filtered via <a class="reference external" href="https:/
</div>
</div>
</div>
</div>
<divclass="section"id="the-statistic-block">
<divclass="section"id="the-statistic-block">
<spanid="msr-statistic-block"></span><spanid="index-65"></span><h3>The STATISTIC Block<aclass="headerlink"href="#the-statistic-block"title="Permalink to this headline">¶</a></h3>
<spanid="msr-statistic-block"></span><spanid="index-66"></span><h3>The STATISTIC Block<aclass="headerlink"href="#the-statistic-block"title="Permalink to this headline">¶</a></h3>
<p>The STATISTIC block is the last block of a msr file. It contains some information on the fit: the date and time as well as
<p>The STATISTIC block is the last block of a msr file. It contains some information on the fit: the date and time as well as
the absolute and normalized values of <spanclass="math notranslate nohighlight">\(\chi^2\)</span> and the number of degrees of freedom in the fit.
the absolute and normalized values of <spanclass="math notranslate nohighlight">\(\chi^2\)</span> and the number of degrees of freedom in the fit.
If enabled in the <aclass="reference internal"href="#musrfit-startup"><spanclass="std std-ref">XML file</span></a> for <spanclass="math notranslate nohighlight">\(\chi^2\)</span>-single-histogram fits also <aclass="reference external"href="http://en.wikipedia.org/wiki/Pearson's_chi-square_test">Pearson’s</a>
If enabled in the <aclass="reference internal"href="#musrfit-startup"><spanclass="std std-ref">XML file</span></a> for <spanclass="math notranslate nohighlight">\(\chi^2\)</span>-single-histogram fits also <aclass="reference external"href="http://en.wikipedia.org/wiki/Pearson's_chi-square_test">Pearson’s</a>
@ -1922,9 +1954,9 @@ If enabled in the <a class="reference internal" href="#musrfit-startup"><span cl
</div>
</div>
</div>
</div>
<divclass="section"id="fit-types">
<divclass="section"id="fit-types">
<spanid="index-66"></span><spanid="id37"></span><h2>Fit Types<aclass="headerlink"href="#fit-types"title="Permalink to this headline">¶</a></h2>
<spanid="index-67"></span><spanid="id37"></span><h2>Fit Types<aclass="headerlink"href="#fit-types"title="Permalink to this headline">¶</a></h2>
<spanid="single-histogram-fit"></span><spanid="index-67"></span><h3>Single Histogram Fit (fit type 0)<aclass="headerlink"href="#single-histogram-fit-fit-type-0"title="Permalink to this headline">¶</a></h3>
<spanid="single-histogram-fit"></span><spanid="index-68"></span><h3>Single Histogram Fit (fit type 0)<aclass="headerlink"href="#single-histogram-fit-fit-type-0"title="Permalink to this headline">¶</a></h3>
<p>The single-histogram fit (fit type 0) is used to fit a function directly to the raw data using</p>
<p>The single-histogram fit (fit type 0) is used to fit a function directly to the raw data using</p>
<spanid="single-histogram-rrf-fit"></span><spanid="index-68"></span><h3>Single Histogram RRF Fit (fit type 1)<aclass="headerlink"href="#single-histogram-rrf-fit-fit-type-1"title="Permalink to this headline">¶</a></h3>
<spanid="single-histogram-rrf-fit"></span><spanid="index-69"></span><h3>Single Histogram RRF Fit (fit type 1)<aclass="headerlink"href="#single-histogram-rrf-fit-fit-type-1"title="Permalink to this headline">¶</a></h3>
<p>The single-histogram RRF fit (fit type 1) is used to fit the rotating reference frame asymmetry <spanclass="math notranslate nohighlight">\(A_{\rm rrf}(t)\)</span> extracted from the raw data.
<p>The single-histogram RRF fit (fit type 1) is used to fit the rotating reference frame asymmetry <spanclass="math notranslate nohighlight">\(A_{\rm rrf}(t)\)</span> extracted from the raw data.
The currently implemented version will fail at low fields/frequencies (for about < 1 Tesla). The same is true, if multiple frequencies with large
The currently implemented version will fail at low fields/frequencies (for about < 1 Tesla). The same is true, if multiple frequencies with large
enough separation are present, <em>e.g.</em> when dealing with muonium. <spanclass="math notranslate nohighlight">\(A_{\rm rrf}(t)\)</span> is estimated the following way (for more details see the
enough separation are present, <em>e.g.</em> when dealing with muonium. <spanclass="math notranslate nohighlight">\(A_{\rm rrf}(t)\)</span> is estimated the following way (for more details see the
@ -1968,7 +2000,7 @@ of the <span class="math notranslate nohighlight">\(N_0\)</span> estimate, line
For more details see the rrf-memo found in the source code under <musrfit>/doc/memo/rrf/rrf-notes.pdf or <aclass="reference external"href="http://dx.doi.org/10.7566/JPSCP.21.011051">Musrfit–Real Time Parameter Fitting Using GPUs</a></p>
For more details see the rrf-memo found in the source code under <musrfit>/doc/memo/rrf/rrf-notes.pdf or <aclass="reference external"href="http://dx.doi.org/10.7566/JPSCP.21.011051">Musrfit–Real Time Parameter Fitting Using GPUs</a></p>
</div>
</div>
<divclass="section"id="asymmetry-fit-fit-type-2">
<divclass="section"id="asymmetry-fit-fit-type-2">
<spanid="asymmetry-fit"></span><spanid="index-69"></span><h3>Asymmetry Fit (fit type 2)<aclass="headerlink"href="#asymmetry-fit-fit-type-2"title="Permalink to this headline">¶</a></h3>
<spanid="asymmetry-fit"></span><spanid="index-70"></span><h3>Asymmetry Fit (fit type 2)<aclass="headerlink"href="#asymmetry-fit-fit-type-2"title="Permalink to this headline">¶</a></h3>
<p>For an asymmetry fit (fit type 2) two histograms are needed. These are given by the <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">forward</span></a> and <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">backward</span></a> keywords
<p>For an asymmetry fit (fit type 2) two histograms are needed. These are given by the <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">forward</span></a> and <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">backward</span></a> keywords
in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>. Additionally, the parameters <aclass="reference internal"href="#msr-alpha-beta"><spanclass="std std-ref">alpha</span></a> and <aclass="reference internal"href="#msr-alpha-beta"><spanclass="std std-ref">beta</span></a> which relate the detector
in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>. Additionally, the parameters <aclass="reference internal"href="#msr-alpha-beta"><spanclass="std std-ref">alpha</span></a> and <aclass="reference internal"href="#msr-alpha-beta"><spanclass="std std-ref">beta</span></a> which relate the detector
efficiencies, solid angles and initial asymmetries of the two detectors can be supplied. The constant background for the two histograms is either given by
efficiencies, solid angles and initial asymmetries of the two detectors can be supplied. The constant background for the two histograms is either given by
@ -2002,13 +2034,13 @@ efficiencies, solid angles and initial asymmetries of the two detectors can be s
<p>and plotted together with the function given in the THEORY block.</p>
<p>and plotted together with the function given in the THEORY block.</p>
<spanid="asymmetry-rrf-fit"></span><spanid="index-70"></span><h3>Asymmetry RRF Fit (fit type 3)<aclass="headerlink"href="#asymmetry-rrf-fit-fit-type-3"title="Permalink to this headline">¶</a></h3>
<spanid="asymmetry-rrf-fit"></span><spanid="index-71"></span><h3>Asymmetry RRF Fit (fit type 3)<aclass="headerlink"href="#asymmetry-rrf-fit-fit-type-3"title="Permalink to this headline">¶</a></h3>
<p>For asymmetry RRF Fit (fit type 3) two histograms are needed. In a first step, the unbinned asymmetry is formed as described for the asymmetry fit.
<p>For asymmetry RRF Fit (fit type 3) two histograms are needed. In a first step, the unbinned asymmetry is formed as described for the asymmetry fit.
Afterwards the RRF transformation is carried out, <em>i.e.</em> point 4. and 5. as sketched in the single histogramm RRF fit. The same reservations as for
Afterwards the RRF transformation is carried out, <em>i.e.</em> point 4. and 5. as sketched in the single histogramm RRF fit. The same reservations as for
the single histogram RRF fit apply: <strong>if you not urgently need it: do not use it! There are better ways to deal with the analysis of high frequency data!</strong></p>
the single histogram RRF fit apply: <strong>if you not urgently need it: do not use it! There are better ways to deal with the analysis of high frequency data!</strong></p>
<spanid="negative-muon-musr-fit"></span><spanid="index-71"></span><h3>Negative Muon μSR Fit (fit type 4)<aclass="headerlink"href="#negative-muon-mgrsr-fit-fit-type-4"title="Permalink to this headline">¶</a></h3>
<spanid="negative-muon-musr-fit"></span><spanid="index-72"></span><h3>Negative Muon μSR Fit (fit type 4)<aclass="headerlink"href="#negative-muon-mgrsr-fit-fit-type-4"title="Permalink to this headline">¶</a></h3>
<p>The negative muon μSR fit (fit type 4) is used for single histogram fits of MuMinus, <em>i.e.</em></p>
<p>The negative muon μSR fit (fit type 4) is used for single histogram fits of MuMinus, <em>i.e.</em></p>
@ -2024,7 +2056,7 @@ the single histogram RRF fit apply: <strong>if you not urgently need it: do not
<p>Since MuMinus is quite generic, the full functional depends has to be written in the <aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY Block</span></a>.</p>
<p>Since MuMinus is quite generic, the full functional depends has to be written in the <aclass="reference internal"href="#msr-theory-block"><spanclass="std std-ref">THEORY Block</span></a>.</p>
<spanid="bnmr-asymmetry-fit"></span><spanid="index-72"></span><h3>beta-NMR Asymmetry Fit (fit type 5)<aclass="headerlink"href="#beta-nmr-asymmetry-fit-fit-type-5"title="Permalink to this headline">¶</a></h3>
<spanid="bnmr-asymmetry-fit"></span><spanid="index-73"></span><h3>beta-NMR Asymmetry Fit (fit type 5)<aclass="headerlink"href="#beta-nmr-asymmetry-fit-fit-type-5"title="Permalink to this headline">¶</a></h3>
<p>Four histograms are needed for a beta-NMR asymmetry fit (fit type 5), two for positive helecity and two for negative. These are given by the <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">forward</span></a> and <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">backward</span></a> keywords
<p>Four histograms are needed for a beta-NMR asymmetry fit (fit type 5), two for positive helecity and two for negative. These are given by the <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">forward</span></a> and <aclass="reference internal"href="#msr-forward-backward"><spanclass="std std-ref">backward</span></a> keywords
in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>. Additionally, the parameters <aclass="reference internal"href="#msr-alpha-beta"><spanclass="std std-ref">alpha</span></a> and <aclass="reference internal"href="#msr-alpha-beta"><spanclass="std std-ref">beta</span></a> which relate the detector
in the <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a>. Additionally, the parameters <aclass="reference internal"href="#msr-alpha-beta"><spanclass="std std-ref">alpha</span></a> and <aclass="reference internal"href="#msr-alpha-beta"><spanclass="std std-ref">beta</span></a> which relate the detector
efficiencies, solid angles and initial asymmetries of the two detectors can be supplied. The constant background for the two histograms is either given by
efficiencies, solid angles and initial asymmetries of the two detectors can be supplied. The constant background for the two histograms is either given by
@ -2064,7 +2096,7 @@ efficiencies, solid angles and initial asymmetries of the two detectors can be s
<p>and plotted together with the function given in the THEORY block.</p>
<p>and plotted together with the function given in the THEORY block.</p>
</div>
</div>
<divclass="section"id="non-mgrsr-fit-fit-type-8">
<divclass="section"id="non-mgrsr-fit-fit-type-8">
<spanid="non-musr-fit"></span><spanid="index-73"></span><h3>Non-μSR Fit (fit type 8)<aclass="headerlink"href="#non-mgrsr-fit-fit-type-8"title="Permalink to this headline">¶</a></h3>
<spanid="non-musr-fit"></span><spanid="index-74"></span><h3>Non-μSR Fit (fit type 8)<aclass="headerlink"href="#non-mgrsr-fit-fit-type-8"title="Permalink to this headline">¶</a></h3>
<p>In the case of a non-μSR fit (fit type 8) the fitting function is</p>
<p>In the case of a non-μSR fit (fit type 8) the fitting function is</p>
<divclass="math notranslate nohighlight">
<divclass="math notranslate nohighlight">
\[y = f(x),\]</div>
\[y = f(x),\]</div>
@ -2073,7 +2105,7 @@ efficiencies, solid angles and initial asymmetries of the two detectors can be s
</div>
</div>
</div>
</div>
<divclass="section"id="id38">
<divclass="section"id="id38">
<spanid="index-74"></span><spanid="id39"></span><h2>User Functions<aclass="headerlink"href="#id38"title="Permalink to this headline">¶</a></h2>
<spanid="index-75"></span><spanid="id39"></span><h2>User Functions<aclass="headerlink"href="#id38"title="Permalink to this headline">¶</a></h2>
<p><codeclass="docutils literal notranslate"><spanclass="pre">musrfit</span></code> offers the possibility to plug-in user-defined functions implemented in <codeclass="docutils literal notranslate"><spanclass="pre">C++</span></code> classes to the fitting and plotting routines.
<p><codeclass="docutils literal notranslate"><spanclass="pre">musrfit</span></code> offers the possibility to plug-in user-defined functions implemented in <codeclass="docutils literal notranslate"><spanclass="pre">C++</span></code> classes to the fitting and plotting routines.
In order to do so, basically two things are needed:</p>
In order to do so, basically two things are needed:</p>
<blockquote>
<blockquote>
@ -2091,7 +2123,7 @@ In order to do so, basically two things are needed:</p>
</div></blockquote>
</div></blockquote>
<p>Since the first is simpler this will be explained using an explicit example, before it is discussed why the second option is needed and how it can be used.</p>
<p>Since the first is simpler this will be explained using an explicit example, before it is discussed why the second option is needed and how it can be used.</p>
<spanid="user-functions-without-global-part"></span><spanid="index-75"></span><h3>User Function without global user-function-object access<aclass="headerlink"href="#user-function-without-global-user-function-object-access"title="Permalink to this headline">¶</a></h3>
<spanid="user-functions-without-global-part"></span><spanid="index-76"></span><h3>User Function without global user-function-object access<aclass="headerlink"href="#user-function-without-global-user-function-object-access"title="Permalink to this headline">¶</a></h3>
<p>In the following it is explained in detail how the implementation of a user function is done using the simple example of <spanclass="math notranslate nohighlight">\(f_a(x) = \sin(a x)/(a x)\)</span>,
<p>In the following it is explained in detail how the implementation of a user function is done using the simple example of <spanclass="math notranslate nohighlight">\(f_a(x) = \sin(a x)/(a x)\)</span>,
where the parameter <spanclass="math notranslate nohighlight">\(a\)</span> should be determined by the fit. Although not necessary for this simple example, the source code is split into two parts,
where the parameter <spanclass="math notranslate nohighlight">\(a\)</span> should be determined by the fit. Although not necessary for this simple example, the source code is split into two parts,
namely a header file <codeclass="docutils literal notranslate"><spanclass="pre">TMyFunction.h</span></code> containing the class declaration and a second file <codeclass="docutils literal notranslate"><spanclass="pre">TMyFunction.cpp</span></code> including the function implementation
namely a header file <codeclass="docutils literal notranslate"><spanclass="pre">TMyFunction.h</span></code> containing the class declaration and a second file <codeclass="docutils literal notranslate"><spanclass="pre">TMyFunction.cpp</span></code> including the function implementation
@ -2194,7 +2226,7 @@ refer to the <a class="reference external" href="https://root.cern.ch/interactin
<p>Finally, please be aware of the <aclass="reference internal"href="#user-function-important"><spanclass="std std-ref">remark</span></a> at the end of this section.</p>
<p>Finally, please be aware of the <aclass="reference internal"href="#user-function-important"><spanclass="std std-ref">remark</span></a> at the end of this section.</p>
<spanid="user-functions-with-global-part"></span><spanid="index-76"></span><h3>User Function with global user-function-object access<aclass="headerlink"href="#user-function-with-global-user-function-object-access"title="Permalink to this headline">¶</a></h3>
<spanid="user-functions-with-global-part"></span><spanid="index-77"></span><h3>User Function with global user-function-object access<aclass="headerlink"href="#user-function-with-global-user-function-object-access"title="Permalink to this headline">¶</a></h3>
<p>Before explaining how to use global objects within user functions, it will be shortly explained where is the problem and why this might be a sensible approach.
<p>Before explaining how to use global objects within user functions, it will be shortly explained where is the problem and why this might be a sensible approach.
In <codeclass="docutils literal notranslate"><spanclass="pre">musrfit</span></code> each <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a> (histogram, asymmetry, …) is owning its own theory-function tree. An example is shown in the figure below.
In <codeclass="docutils literal notranslate"><spanclass="pre">musrfit</span></code> each <aclass="reference internal"href="#msr-run-block"><spanclass="std std-ref">RUN block</span></a> (histogram, asymmetry, …) is owning its own theory-function tree. An example is shown in the figure below.
The bluish nodes are default musrfit functions, whereas the red nodes represent user functions (here labeled by <codeclass="docutils literal notranslate"><spanclass="pre">uF1</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">uF2</span></code>). Without global user-function
The bluish nodes are default musrfit functions, whereas the red nodes represent user functions (here labeled by <codeclass="docutils literal notranslate"><spanclass="pre">uF1</span></code> and <codeclass="docutils literal notranslate"><spanclass="pre">uF2</span></code>). Without global user-function
@ -2334,7 +2366,7 @@ In case this cannot be ensured, the parallelization can be disabled by <em>–di
<spanid="technical-musrfit"></span><spanid="index-77"></span><h2>Technical Description of the musrfit framework<aclass="headerlink"href="#technical-description-of-the-musrfit-framework"title="Permalink to this headline">¶</a></h2>
<spanid="technical-musrfit"></span><spanid="index-78"></span><h2>Technical Description of the musrfit framework<aclass="headerlink"href="#technical-description-of-the-musrfit-framework"title="Permalink to this headline">¶</a></h2>
<p>A technical description of the musrfit framework can be found on its own <aclass="reference external"href="http://lmu.web.psi.ch/musrfit/technical/index.html">docu</a>.</p>
<p>A technical description of the musrfit framework can be found on its own <aclass="reference external"href="http://lmu.web.psi.ch/musrfit/technical/index.html">docu</a>.</p>
</div>
</div>
</div>
</div>
@ -2433,12 +2465,12 @@ In case this cannot be ensured, the parallelization can be disabled by <em>–di
<liclass="right">
<liclass="right">
<ahref="tutorial.html"title="Tutorial for musrfit"
<ahref="tutorial.html"title="Tutorial for musrfit"
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.