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

MonitorEfficiencyCorUser v1

../_images/MonitorEfficiencyCorUser-v1_dlg.png

MonitorEfficiencyCorUser dialog.

Summary

This algorithm normalises the counts by the monitor counts with additional efficiency correction according to the formula set in the instrument parameters file.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory The workspace to correct for monitor efficiency
OutputWorkspace Output MatrixWorkspace Mandatory The name of the workspace in which to store the result.

Description

This algorithm normalises the neutron counts by monitor counts with an additional efficiency correction.

The monitor counts is the total count and it is stored in the SampleLogs of the input workspace.

This count is corrected taking into account the monitor efficiency. The formula used for the correction is stored in the Parameters file and requires the incident energy (\(E_i\)), which is stored in the SampleLogs of the input workspace.

The corrected value of the monitor counts is used to normalise the input workspace.

Restrictions

  • A formula named “formula_eff” must be defined in the instrument parameters file. For TOFTOF and DNS instruments it is defined as \(M\cdot\sqrt{\frac{E_i}{25.3}}\). The incident energy \(E_i\) and the monitor counts \(M\) are read in the sample logs of the input workspace.
  • Either sample log “monitor_counts” must be present in the InputWorkspace or the name of the sample log containing monitor counts must be defined under “monitor_counts_log” parameter in the instrument parameters file.
  • Input workspace must have “Ei” sample log.

Usage

Example

import numpy as np
wsSample = LoadMLZ(Filename='TOFTOFTestdata.nxs')
wsNorm = MonitorEfficiencyCorUser(wsSample )
# Input and output workspaces have the same structure
print('Number of histograms of the input and output workspaces:')
print('{} {}'.format(wsSample.getNumberHistograms(), wsNorm.getNumberHistograms()))
print('Number of time channels of the input an output workspaces:')
print('{} {}'.format( wsSample.blocksize(), wsNorm.blocksize()))
# Check calculation of normalisation coefficient between input and output workspaces
wsCheck = Divide(wsSample,wsNorm)
print("Coefficient of proportionality between Input and Output of MonitorEfficiencyCorUser algorithm: {:.3f}".format(wsCheck.readY(102)[1]))
# Read the values of the incident energy and of the monitor counts from the SampleLogs of wsSample
monitor_counts = float(mtd['wsSample'].getRun().getLogData('monitor_counts').value)
Ei = float(mtd['wsSample'].getRun().getLogData('Ei').value)
print("Coefficient from theoretical formula = monitor_counts * sqrt(Ei/25.3): {:.3f}".format(monitor_counts*np.sqrt(Ei/25.3)))

Output:

Number of histograms of the input and output workspaces:
1006 1006
Number of time channels of the input an output workspaces:
1024 1024
Coefficient of proportionality between Input and Output of MonitorEfficiencyCorUser algorithm: 41038.432
Coefficient from theoretical formula = monitor_counts * sqrt(Ei/25.3): 41038.432

Categories: AlgorithmIndex | CorrectionFunctions\NormalisationCorrections

Source

C++ header: MonitorEfficiencyCorUser.h (last modified: 2021-03-31)

C++ source: MonitorEfficiencyCorUser.cpp (last modified: 2021-03-31)