Table of Contents
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.
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:
where is the muon lifetime (2.1969811e-6 seconds), is the number of good frames and is a fitted normalisation constant. The normalisation is given by
where the summation only includes the data with times bewtween and and is the time step.
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
C++ source: EstimateMuonAsymmetryFromCounts.cpp
C++ header: EstimateMuonAsymmetryFromCounts.h