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
M = measured count
tdead = dead-time
tbin = time bin width
F = number of good frames
DeadTimeTable is expected to have 2 columns:
- Integer type, containing spectrum number (not index)
- Double type, containing tdead value of the spectrum
Example - Applying the correction using custom dead times:
ExCustomDeadTimes
# 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:
ExCustomDeadTimes
Spectrum: 0; original: 6643.000; corrected: 6861.714 Spectrum: 32; original: 10384.000; corrected: 10928.727 Spectrum: 63; original: 8875.000; corrected: 9273.499
Example - Applying the correction using dead times stored in the Nexus file:
ExLoadedDeadTimes
# 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:
ExLoadedDeadTimes
Spectrum: 0; original: 6643.000; corrected: 6670.079 Spectrum: 32; original: 10384.000; corrected: 10451.664 Spectrum: 63; original: 8875.000; corrected: 8922.105