Table of Contents
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 |
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
where
DeadTimeTable is expected to have 2 columns:
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