Skip to content
Snippets Groups Projects
AlphaCalc-v1.rst 1.11 KiB
Newer Older
.. algorithm::

.. summary::

.. alias::

.. properties::

Description
-----------

Returns the relative efficiency of the forward detector group compared
Arturs Bekasovs's avatar
Arturs Bekasovs committed
to the backward detector group. If ``Alpha`` is larger than 1 more counts
has been collected in the forward group.

This algorithm leave the input workspace unchanged. To group detectors
Arturs Bekasovs's avatar
Arturs Bekasovs committed
in a workspace use :ref:`algm-MuonGroupDetectors`.

Usage
-----

**Example - Calculating Alpha:**
   y = [1,1,1,1,1] + [2,2,2,2,2]
   x = [1,2,3,4,5,6] * 2
   input = CreateWorkspace(x,y, NSpec=2)
   alpha = AlphaCalc(input)
   print 'Alpha value: {:.3f}'.format(alpha)
Output:

.. testoutput:: ExSimple

   Alpha value: 0.500

**Example - Calculating Alpha, reversing forward and backward spectra:**

.. testcode:: ExReversed

   y = [1,1,1,1,1] + [2,2,2,2,2]
   x = [1,2,3,4,5,6] * 2
   input = CreateWorkspace(x,y, NSpec=2)

   alpha = AlphaCalc(input,
                     ForwardSpectra=[2],
                     BackwardSpectra=[1])
   print 'Alpha value: {:.3f}'.format(alpha)
.. testoutput:: ExReversed