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

ConvertToEventWorkspace v1

../_images/ImageNotFound.png

Enable screenshots using DOCS_SCREENSHOTS in CMake

Summary

Converts a Workspace2D from histograms to events in an EventWorkspace by converting each bin to an equivalent weighted event.

See Also

ConvertToMatrixWorkspace

Properties

Name

Direction

Type

Default

Description

InputWorkspace

Input

Workspace2D

Mandatory

An input Workspace2D.

GenerateZeros

Input

boolean

False

Generate an event even for empty bins Warning! This may use significantly more memory.

GenerateMultipleEvents

Input

boolean

False

Generate a number of evenly spread events in each bin. See the help for details. Warning! This may use significantly more memory.

MaxEventsPerBin

Input

number

10

If GenerateMultipleEvents is true, specifies a maximum number of events to generate in a single bin. Use a value that matches your instrument’s TOF resolution. Default 10.

OutputWorkspace

Output

EventWorkspace

Mandatory

Name of the output EventWorkspace.

Description

This algorithm takes a Workspace2D with any binning or units as its input. An event is created for each bin of each histogram, except if the bin count is 0.0 (unless GenerateZeros is true). Infinity and NAN (not-a-number) values are always skipped.

Each event is created with an X position (typically time-of-flight) equal to the center of the bin. The weight and error of the event are taken from the histogram value.

If the GenerateMultipleEvents option is set, then instead of a single event per bin, a certain number of events evenly distributed along the X bin are generated. The number of events generated in each bin is calculated by N = (Y/E)^2. However, it is limited to a max of MaxEventsPerBin and a minimum of 1 event per bin.

Note that using GenerateZeros or GenerateMultipleEvents may use a lot of memory!

Categories: AlgorithmIndex | Events

Source

C++ header: ConvertToEventWorkspace.h

C++ source: ConvertToEventWorkspace.cpp