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

HeliumAnalyserEfficiency v1

Summary

Calculates the efficiency of a He3 analyser.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

WorkspaceGroup

Mandatory

Input group workspace to use for polarization calculation

SpinStates

Input

string

11,10,01,00

Order of individual flipper configurations in the input group workspace, e.g. “01,11,00,10”

GasPressureTimesCellLength

Input

number

12

Gas pressure in bar multiplied by cell length in metres

GasPressureTimesCellLengthError

Input

number

0

Error in gas pressure multiplied by cell length

StartLambda

Input

number

1.75

Lower boundary of wavelength range to use for fitting

EndLambda

Input

number

8

Upper boundary of wavelength range to use for fitting

IgnoreFitQualityError

Input

boolean

False

Whether the algorithm should ignore a poor chi-squared (fit cost value) of greater than 1 and therefore not throw an error

OutputWorkspace

Output

MatrixWorkspace

Mandatory

Helium analyzer efficiency as a function of wavelength

OutputFitCurves

Output

MatrixWorkspace

The name of the matrix workspace containing the calculated fit curve, the original data, and the difference between the two.

OutputFitParameters

Output

TableWorkspace

The name of the table workspace containing the fit parameter results.

Description

Takes a normalised group workspace and combines this with the cell path length multiplied by the gas pressure (GasPressureTimesCellLength) to calculate the efficiency of the analyser. The input workspace must be a group of four single spectrum histogram workspaces, each representing the transmission of a known spin state as specified by the SpinStates parameter.

If the transmission of the wanted spin state is \(T_{para}\), and the transmission of the unwanted spin state is \(T_{anti}\), then the polarization of of an unpolarised incoming beam after the analyser cell, \(P_{cell}\) is given by [1]

\[P_{cell} = \frac{T_{para} - T_{anti}}{T_{para} + T_{anti}} = \tanh(0.0733 p d \lambda p_{He})\]

The efficiency of the analyser cell is given by

\[\epsilon_{cell} = \frac{1 + P_{cell}}{2} = \frac{T_{para}}{T_{para} + T_{anti}} = \frac{1 + \tanh(0.0733 p d \lambda p_{He})}{2}\]

If our four periods are \(T_{00}, T_{01}, T_{10}, T_{11}\), with the subscript denoting the spin configuration, then \(T_{para} = T_{00} + T_{11}\) and \(T_{anti} = T_{01} + T_{10}\), and we can calculate \(\epsilon_{cell}\) from the above equation. The value of \(pd\) is given by the input GasPressureTimesCellLength, and \(\lambda\) is the wavelength of each bin, so we fit \(\frac{1 + \tanh(0.0733 p d \lambda p_{He})}{2}\) to our calculated \(\epsilon_{cell}\) to give us \(p_{He}\) and hence the theoretical efficiency curve.

To calculate the error, \(\sigma_{\epsilon_{cell}}\), we need the error on \(p_{He}\), \(\sigma_{p_{He}}\), and the error of \(pd\), \(\sigma_{pd}\), given by GasPressureTimesCellLengthError. The covariance between \(pd\) and \(p_{He}\) is assumed to be zero. Then the error \(\sigma_{\epsilon_{cell}}\) is given by

\[\frac{\sigma_{\epsilon_{cell}}}{t_{crit}} = \sqrt{\left(\frac{\partial \epsilon_{cell}}{\partial p_{He}} \sigma_{p_{He}}\right)^2 + \left(\frac{\partial \epsilon_{cell}}{\partial mu}\sigma_{mu}\right)^2 + \left(\frac{\partial \epsilon_{cell}}{\partial \lambda}\sigma_{\lambda}\right)^2}\]

where \(mu = 0.0733 * pd\) and \(\sigma_{\lambda}\) is the width of the wavelength bin.

If \(n_b\) is the number of histogram bins used in the fit, then define \(n := n_b-1\), since we are fitting one parameter (\(p_{He}\)). Then the factor \(t_{crit}\) follows a \(t\) distribution with \(n\) degrees of freedom, and probability density function \(f_t(x,n)\). For a standard 68.3% (1-sigma) error the factor \(t_{crit}\) is given by the solution to

\[\frac{1}{2}\left(1 + \mathrm{erf}\left(\frac{1}{\sqrt{2}}\right)\right) = P(X < t_{crit} ) = \int_0^{t_{crit}} f_t(x; n) dx\]

As the number of histogram bins used in the fit increases, \(t_{crit} \rightarrow 1\).

Usage

Example - Calculate Analyser Efficiency

wsPara = CreateSampleWorkspace('Histogram', Function='User Defined', UserDefinedFunction='name=UserFunction,Formula=0.5*exp(-0.0733*12*x*(1-0.9))',XUnit='Wavelength', xMin='1',XMax='8', BinWidth='1', NumBanks='1', BankPixelWidth='1')
wsPara1 = CloneWorkspace(wsPara)
wsAnti = CreateSampleWorkspace('Histogram', Function='User Defined', UserDefinedFunction='name=UserFunction,Formula=0.5*exp(-0.0733*12*x*(1+0.9))',XUnit='Wavelength', xMin='1',XMax='8', BinWidth='1', NumBanks='1', BankPixelWidth='1')
wsAnti1 = CloneWorkspace(wsAnti)

grp = GroupWorkspaces([wsPara,wsAnti,wsPara1,wsAnti1])
eff = HeliumAnalyserEfficiency(grp, SpinStates='11,01,00,10')

print('Efficiency at ' + str(mtd['eff'].dataX(0)[0]) + ' Å = ' + str(mtd['eff'].dataY(0)[0]))
print('Error in efficiency at ' + str(mtd['eff'].dataX(0)[0]) + ' Å = ' + str(mtd['eff'].dataE(0)[0]))

Output:

Efficiency at 1.0 Å = ...
Error in efficiency at 1.0 Å = ...

References

Categories: AlgorithmIndex | SANS\PolarizationCorrections

Source

C++ header: HeliumAnalyserEfficiency.h

C++ source: HeliumAnalyserEfficiency.cpp