$$\renewcommand\AA{\unicode{x212B}}$$

# DetectorEfficiencyCorUser v1¶

## Summary¶

Corrects for detector efficiency. The correction factor is calculated using an instrument specific formula as a function of the final neutron energy E_f=E_i-E. Note that the formula is implemented only for a limited number of TOF instruments.

DetectorEfficiencyCor

## Properties¶

Name

Direction

Type

Default

Description

InputWorkspace

Input

MatrixWorkspace

Mandatory

The workspace to correct for detector efficiency

OutputWorkspace

Output

MatrixWorkspace

Mandatory

The name of the workspace in which to store the result.

IncidentEnergy

Input

number

Optional

The energy of neutrons leaving the source.

## Description¶

This algorithm will correct detector efficiency according to the ILL INX program for time-of-flight data reduction.

A formula named “formula_eff” must be defined in the instrument parameters file and linked to all detectors in the input workspace. Different components can have different formulas. The formula for each detector is searched recursively. Thus, there can be, for example, a global formula for the entire instrument and a specific formula for a bank or tube overriding the global one.

The input workspace must be in DeltaE units.

The output data will be corrected as:

$$y = \frac{y}{eff}$$

where $$eff$$ is

$$eff = \frac{f(E_{i} - \Delta E)}{f(E_i)}$$

The function $$f$$ is defined as “formula_eff” in the IDF. To date this has been implemented at the ILL for ILL IN4, IN5 and IN6, and at the MLZ for TOFTOF.

Unlike DetectorEfficiencyCor v1 algorithm, which uses tabulated formula accounting for neutron adsorption efficiency dependence on neutron energy, the formula used by this algorithm is provided by instrument scientist and is adjusted for the instrument, accounting for a number of additional instrument specific factors.

As example, for TOFTOF instrument, the energy-dependent intensity loss factor accounts also for absorption of neutrons by the Ar gas in the flight chamber, Al windows of sample environment etc. The formula used by DetectorEfficiencyCorUser algorithm is derived for TOFTOF in Ref. [1], and is set up in the TOFTOF instrument parameters file.

## Usage¶

Example - A sample correction

# a sample workspace with a sample instrument
ws = CreateSampleWorkspace()
# convert to Wavelength
ws = ConvertUnits(ws,"DeltaE",EMode="Direct",EFixed=3.27)

correction_formula = "exp(-0.0565/sqrt(e))*(1.0-exp(-3.284/sqrt(e)))"
SetInstrumentParameter(ws,ParameterName="formula_eff",Value=correction_formula)

# Now we are ready to run the correction
wsCorrected = DetectorEfficiencyCorUser(ws)

print("The correction for the data by the user defined function.")
print("In this case: " + correction_formula)
for i in range(0,wsCorrected.blocksize(),10):


Output:

The correction for the data by the user defined function.
In this case: exp(-0.0565/sqrt(e))*(1.0-exp(-3.284/sqrt(e)))
The correct value in bin 0 is 4.30 compared to 0.30
The correct value in bin 10 is 0.52 compared to 0.30
The correct value in bin 20 is 0.35 compared to 0.30
The correct value in bin 30 is 0.30 compared to 0.30