20using namespace Kernel;
22using DataObjects::EventWorkspace;
31 "EventWorkspace to be sorted.");
33 std::vector<std::string> propOptions{
"X Value",
"Pulse Time",
"Pulse Time + TOF"};
34 declareProperty(
"SortBy",
"X Value", std::make_shared<StringListValidator>(propOptions),
35 "How to sort the events:\n"
36 " X Value: the x-position of the event in each pixel "
37 "(typically Time of Flight).\n"
38 " Pulse Time: the wall-clock time of the pulse that "
39 "produced the event.");
54 const size_t histnumber = eventW->getNumberHistograms();
57 Progress prog(
this, 0.0, 1.0, histnumber);
60 if (sortoption ==
"Pulse Time")
62 else if (sortoption ==
"Pulse Time + TOF")
66 eventW->sortAll(sortType, &prog);
#define DECLARE_ALGORITHM(classname)
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
std::string getPropertyValue(const std::string &name) const override
Get the value of a property as a string.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
Helper class for reporting progress from algorithms.
A property class for workspaces.
void exec() override
Executes the rebin algorithm.
void init() override
Initialisation method.
std::shared_ptr< const EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
EventSortType
How the event list is sorted.
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
@ InOut
Both an input & output workspace.