HeliumAnalyserEfficiency v1

Summary

Calculates the efficiency of a He3 analyser.

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

Input group workspace to use for polarization calculation

SpinStates

Input

string

11,10,01,00

Order of individual spin states 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 with four periods representing a run, combines this with the cell path length multiplied by the gas pressure (GasPressureTimesCellLength) to calculate the efficiency of the analyser.

If the transmission of the wanted spin state is Tpara, and the transmission of the unwanted spin state is Tanti, then the polarization of of an unpolarised incoming beam after the analyser cell, Pcell is given by [1]

Pcell=TparaTantiTpara+Tanti=tanh(0.0733pdλpHe)

The efficiency of the analyser cell is given by

ϵcell=1+Pcell2=TparaTpara+Tanti=1+tanh(0.0733pdλpHe)2

If our four periods are T00,T01,T10,T11, with the subscript denoting the spin configuration, then Tpara=T00+T11 and Tanti=T01+T10, and we can calculate ϵcell from the above equation. The value of pd is given by the input GasPressureTimesCellLength, and λ is the wavelength of each bin, so we fit 1+tanh(0.0733pdλpHe)2 to our calculated ϵcell to give us pHe and hence the theoretical efficiency curve.

To calculate the error, Δϵcell, we need the error on pHe, ΔpHe, and the error of pd, Δpd, given by GasPressureTimesCellLengthError. The covariance between pd and pHe is assumed to be zero. Then the error Δϵcell is given by

Δϵcelltcrit=(ϵcellpHeΔpHe)2+(ϵcellpdΔpd)2

If nb is the number of histogram bins used in the fit, then define n:=nb2, since we are fitting two parameters (pd and pHe). Then the factor tcrit follows a t distribution with n degrees of freedom, and probability density function ft(x,n). For a standard 68.3% (1-sigma) error the factor tcrit is given by the solution to

12(1+erf(12))=P(X<tcrit)=0tcritft(x;n)dx

As the number of histogram bins used in the fit increases, tcrit1.

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')
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')
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