EstimateMuonAsymmetryFromCounts v1

../_images/EstimateMuonAsymmetryFromCounts-v1_dlg.png

EstimateMuonAsymmetryFromCounts dialog.

Summary

This algorithm gives an estimate for the asymmetry.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory The name of the input 2D workspace.
OutputWorkspace Output MatrixWorkspace Mandatory The name of the output 2D workspace.
Spectra Input int list   The workspace indices to remove the exponential decay from.
StartX Input number 0.1 The lower limit for calculating the asymmetry (an X value).
EndX Input number 15 The upper limit for calculating the asymmetry (an X value).
NormalizationIn Input number 0 If this value is non-zero then this is used for the normalization, instead of being estimated.
NormalizationConstant Output dbl list    

If the NormalizationIn property is greater than zero, the algorithm will apply the user defined normalization to the data instead of calculating an estimate.

Description

This algorithm estimates the asymmetry from the specified muon spectra. By default, all of the spectra in a workspace will be corrected.

The formula for estimating the asymmetry is given by:

\textrm{NewData} = (\textrm{OldData}\times e^\frac{t}{\tau})/(F N_0) - 1.0,

where \tau is the muon lifetime (2.1969811e-6 seconds), F is the number of good frames and N_0 is a fitted normalisation constant. The normalisation is given by

N_0= \frac{\Delta t\sum_j(\textrm{OldData}_j)}{\tau F \left( \exp(-\frac{t_0}{\tau})-\exp(-\frac{t_N}{\tau})\right)  },

where the summation only includes the data with times bewtween t_0 and t_N and \Delta t is the time step.

Usage

Example - Removing exponential decay:

import math
import numpy as np
y = [100, 150, 50, 10, 5]
x = [1,2,3,4,5,6]
input = CreateWorkspace(x,y)
run = input.getRun()
run.addProperty("goodfrm","10","None",True)
output,norm=EstimateMuonAsymmetryFromCounts(InputWorkspace=input,spectra=0,StartX=1,EndX=5)
print  "Asymmetry: ",['{0:.2f}'.format(value)  for value in output.readY(0)]
print "Normalization constant: {0:.2f}".format(norm[0])

Output:

Asymmetry:  ['-0.38', '0.45', '-0.24', '-0.76', '-0.81']
Normalization constant: 25.62

Example - Setting the normalization:

import math
import numpy as np
y = [100, 150, 50, 10, 5]
x = [1,2,3,4,5,6]
input = CreateWorkspace(x,y)
run = input.getRun()
run.addProperty("goodfrm","10","None",True)
output,norm=EstimateMuonAsymmetryFromCounts(InputWorkspace=input,spectra=0,StartX=1,EndX=5,NormalizationIn=20.0)
print  "Asymmetry: ",['{0:.2f}'.format(value)  for value in output.readY(0)]
print "Normalization constant: {0:.2f}".format(norm[0])

Output:

Asymmetry:  ['-0.21', '0.86', '-0.02', '-0.69', '-0.76']
Normalization constant: 20.00

Categories: Algorithms | Muon