\(\renewcommand\AA{\unicode{x212B}}\)

AsymmetryCalc v1

../_images/AsymmetryCalc-v1_dlg.png

AsymmetryCalc dialog.

Summary

Calculates the asymmetry between two groups of detectors for a muon workspace.

See Also

CalculateMuonAsymmetry

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Name of the input workspace

OutputWorkspace

Output

MatrixWorkspace

Mandatory

The name of the workspace to be created as the output of the algorithm

ForwardSpectra

Input

int list

The spectra numbers of the forward group

BackwardSpectra

Input

int list

The spectra numbers of the backward group

Alpha

Input

number

1

The balance parameter (default 1)

Description

This algorithm is used to calculate the asymmetry for a Muon workspace. It first groups the input workspace according to the spectra numbers provided as ForwardSpectra and BackwardSpectra. If these properties are not supplied, the algorithm assumes that the first spectrum in the workspace is the forward group and the second one is the backward group. It then calculates the asymmetry, \(A\), as:

\[A = \frac{F-\alpha B}{F+\alpha B},\]

where \(F\) is the front spectra, \(B\) is the back spectra and \(\alpha\) is the balance parameter [1].

The error in \(A\), \(\sigma_A\) is calculated using standard error propagation. First the errors in \(F-\alpha B\) and \(F+\alpha B\) are calculated by adding the errors in \(F\) and \(B\) in quadrature (\(\alpha\) is assumed to have no error);

\[\sigma_{F + \alpha B} = \sigma_{F - \alpha B} = \sqrt{ \sigma_F^2 + \alpha^2 \sigma_B^2 },\]

Then the error in the asymmetry is given by;

\[\sigma_A = A \sqrt{ \left( \frac{\sigma_{F + \alpha B} }{F + \alpha B} \right)^2 + \left( \frac{\sigma_{F- \alpha B}}{ F - \alpha B} \right)^2 },\]

using the fact that the errors on counts \(F,B\) can be taken to be Poisson errors (\(\sigma_{F} = \sqrt{F}\), \(\sigma_{B} = \sqrt{B}\)), this can be simplified to

\[\sigma_A = \frac{\sqrt{ F + \alpha^2 B} \sqrt{1 + A^2} }{F + \alpha B}.\]

If any bins have \(F=B=0\), then the result is \(A=0.0, \sigma_A =1.0\).

The output workspace contains one set of data for the time of flight: the asymmetry and the asymmetry errors.

Usage

Example - Calculating asymmetry:

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

asymmetry = AsymmetryCalc(input, Alpha=0.5)

print('Asymmetry: {}'.format(asymmetry.readY(0)))
print('Errors: {}'.format(asymmetry.readE(0)))

Output:

Asymmetry: [-0.2         0.6        -0.33333333]
Errors: [ 0.5396295   0.69971423  0.28688766]

Categories: AlgorithmIndex | Muon

Source

C++ header: AsymmetryCalc.h

C++ source: AsymmetryCalc.cpp