14using namespace Kernel;
16using namespace DataObjects;
27 "The input workspace.");
29 "The output workspace.");
31 "The minimum X value (in the units of "
32 "the input workspace) for which events "
34 "(default: event list min)");
36 "The maximum X value (in the units of "
37 "the input workspace) for which events "
38 "will be retained. Must be greater than "
40 "(default: event list max)");
44 std::map<std::string, std::string> errors;
50 errors[
"XMin"] =
"At least one of XMin/XMax must be specified.";
51 errors[
"XMax"] =
"At least one of XMin/XMax must be specified.";
56 errors[
"XMin"] =
"XMin must be less than XMax.";
57 errors[
"XMax"] =
"XMin must be less than XMax.";
74 const auto numSpec =
static_cast<int>(inputWS->getNumberHistograms());
77 if (inputWS != outputWS) {
84 outputWS = inputWS->clone();
88 Progress prog(
this, 0.0, 1.0, numSpec);
91 for (
int spec = 0; spec < numSpec; ++spec) {
94 EventList &events = outputWS->getSpectrum(spec);
99 const double list_xmin = events.getTofMin();
100 if (xmin > list_xmin)
101 events.maskTof(list_xmin, xmin);
106 const double list_xmax = events.getTofMax();
109 if (xmax < list_xmax)
110 events.maskTof(xmax, list_xmax * 1.000000001);
#define DECLARE_ALGORITHM(classname)
#define PARALLEL_START_INTERRUPT_REGION
Begins a block to skip processing is the algorithm has been interupted Note the end of the block if n...
#define PARALLEL_END_INTERRUPT_REGION
Ends a block to skip processing is the algorithm has been interupted Note the start of the block if n...
#define PARALLEL_FOR_IF(condition)
Empty definitions - to enable set your complier to enable openMP.
#define PARALLEL_CHECK_INTERRUPT_REGION
Adds a check after a Parallel region to see if it was interupted.
void declareProperty(std::unique_ptr< Kernel::Property > p, const std::string &doc="") override
Add a property to the list of managed properties.
TypedValue getProperty(const std::string &name) const override
Get the value of a property.
static bool isEmpty(const NumT toCheck)
checks that the value was not set by users, uses the value in empty double/int.
Helper class for reporting progress from algorithms.
A property class for workspaces.
void exec() override
Virtual method - must be overridden by concrete algorithm.
const std::string name() const override
Algorithm's name for identification.
const std::string category() const override
Algorithm's category for identification.
void init() override
Virtual method - must be overridden by concrete algorithm.
std::map< std::string, std::string > validateInputs() override
Method checking errors on ALL the inputs, before execution.
int version() const override
Algorithm's version for identification.
void sortTof() const
Sort events by TOF in one thread.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
std::shared_ptr< const EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
std::shared_ptr< EventWorkspace > EventWorkspace_sptr
shared pointer to the EventWorkspace class
std::enable_if< std::is_pointer< Arg >::value, bool >::type threadSafe(Arg workspace)
Thread-safety check Checks the workspace to ensure it is suitable for multithreaded access.
constexpr double EMPTY_DBL() noexcept
Returns what we consider an "empty" double within a property.
@ Input
An input workspace.
@ Output
An output workspace.