Dead time reduction implementation notes

Dead time reduction implementation notes#

A dead time correction is implemented on both reflectometers. Both instruments implement the same correction, with options to tune the dead time value, the TOF binning used during the calculation, and whether we want to use paralyzing dead time or not.

    # Compute the dead time correction for each TOF bin
    if paralyzing:
        true_rate = -scipy.special.lambertw(-rate * dead_time / tof_step).real / dead_time
        corr = true_rate / (rate / tof_step)
        # If we have no events, set the correction to 1 otherwise we will get a nan
        # from the equation above.
        corr[rate==0] = 1
    else:
        corr = 1/(1-rate * dead_time / tof_step)

Both instruments leverage Mantid’s concept of weighted events to apply the dead time correction. The dead time correction proceeds as follows:

1- A data file is loaded using LoadEventNexus. We will can this workspace ws_good_events.

2- The error events for this same run are loaded using LoadErrorEventsNexus. We will call this workspace ws_error_events.

3- Using the sum of all events ws_good_events + ws_error_events a dead time correction is computed as a function of time of flight \(C_{TOF}(t)\).

4- The event workspace ws_good_events is then modified so that each event in it is weighted by \(C_{TOF}(t)\) according to their individual value of \(t\).

5- From this point on, the ws_good_events workspace can be used in any calculation and is considered corrected for dead time.

For the Magnetism Reflectometer, every calculation is done in predetermined TOF bins. For the Liquids Reflectometer, the Q value of every single event is computed and binned in Q directly. The approach outlined above is compatible with both ways of working.