ApplyDeadTimeCorr v1

../_images/ApplyDeadTimeCorr-v1_dlg.png

ApplyDeadTimeCorr dialog.

Summary

Apply deadtime correction to each spectrum of a workspace.

Properties

Name Direction Type Default Description
InputWorkspace Input MatrixWorkspace Mandatory The name of the input workspace containing measured counts
DeadTimeTable Input TableWorkspace Mandatory Name of the Dead Time Table
OutputWorkspace Output MatrixWorkspace Mandatory The name of the output workspace containing corrected counts

Description

Assuming that the InputWorkspace contains measured counts as a function of TOF, the algorithm returns a workspace containing true counts as a function of the same TOF binning according to

N = \frac{M}{(1-M*(\frac{t_{\mathrm{dead}}}{t_{\mathrm{bin}}*F}))}

where

N = true count
M = measured count
t_{\mathrm{dead}} = dead-time
t_{\mathrm{bin}} = time bin width
F = number of good frames

DeadTimeTable is expected to have 2 columns:

  1. Integer type, containing spectrum number (not index)
  2. Double type, containing t_{\mathrm{dead}} value of the spectrum

It is assumed that all bins in the InputWorkspace are the same size (to within reasonable rounding error). If they are not, the algorithm will exit with an error.

The InputWorkspace must contain a sample log goodfrm (number of good frames) for the algorithm to run successfully.

Usage

Note

To run these usage examples please first download the usage data, and add these to your path. In MantidPlot this is done using Manage User Directories.

Example - Applying the correction using custom dead times:

# Load single period of a MUSR run
input = LoadMuonNexus('MUSR0015189.nxs', EntryNumber=1)

# Remove uninteresting bins
input = CropWorkspace('input', XMin=0.55, XMax=12)

# Create a table with some arbitrary dead times
dead_times = CreateEmptyTableWorkspace()
dead_times.addColumn('int', 'Spectrum no.')
dead_times.addColumn('double', 'Deadtime')

for i in range(1,65):
  dead_times.addRow([i, 0.1])

output = ApplyDeadTimeCorr('input','dead_times')

original = Integration('input')
corrected = Integration('output')

format_str = 'Spectrum: {0:d}; original: {1:.3f}; corrected: {2:.3f}'

for s in [0,32,63]:
   print(format_str.format(s, original.readY(s)[0], corrected.readY(s)[0]))

Output:

Spectrum: 0; original: 6643.000; corrected: 7100.833
Spectrum: 32; original: 10384.000; corrected: 11559.134
Spectrum: 63; original: 8875.000; corrected: 9724.937

Example - Applying the correction using dead times stored in the Nexus file:

# Load a MUSR run
input = LoadMuonNexus('MUSR0015189.nxs', DeadTimeTable='dead_times')

# Remove uninteresting bins
input = CropWorkspace('input', XMin=0.55, XMax=12)

# Apply the loaded dead times
output = ApplyDeadTimeCorr('input','dead_times')

original = Integration(input.getItem(0))
corrected = Integration(output.getItem(0))

format_str = 'Spectrum: {0:d}; original: {1:.3f}; corrected: {2:.3f}'

for s in [0,32,63]:
   print(format_str.format(s, original.readY(s)[0], corrected.readY(s)[0]))

Output:

Spectrum: 0; original: 6643.000; corrected: 6697.453
Spectrum: 32; original: 10384.000; corrected: 10520.529
Spectrum: 63; original: 8875.000; corrected: 8969.891

Categories: Algorithms | Muon | CorrectionFunctions\EfficiencyCorrections

Source

C++ source: ApplyDeadTimeCorr.cpp (last modified: 2017-09-12)

C++ header: ApplyDeadTimeCorr.h (last modified: 2016-06-14)