28 "An input Workspace2D.");
29 declareProperty(
"GenerateZeros",
false,
30 "Generate an event even for empty bins\n"
31 "Warning! This may use significantly more memory.");
32 declareProperty(
"GenerateMultipleEvents",
false,
33 "Generate a number of evenly spread events in each bin. See "
34 "the help for details.\n"
35 "Warning! This may use significantly more memory.");
36 declareProperty(
"MaxEventsPerBin", 10,
37 "If GenerateMultipleEvents is true, specifies a maximum number of events "
38 "to generate in a single bin.\n"
39 "Use a value that matches your instrument's TOF resolution. Default 10.");
41 "Name of the output EventWorkspace.");
49 bool GenerateMultipleEvents =
getProperty(
"GenerateMultipleEvents");
51 int MaxEventsPerBin =
getProperty(
"MaxEventsPerBin");
53 auto outWS = create<EventWorkspace>(*inWS);
55 Progress prog(
this, 0.0, 1.0, inWS->getNumberHistograms());
57 for (
int iwi = 0; iwi < int(inWS->getNumberHistograms()); iwi++) {
59 auto wi = size_t(iwi);
62 const auto &inSpec = inWS->getSpectrum(wi);
#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.
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.
Perform a conversion for a Workspace2D to an equivalent EventWorkspace.
void exec() override
Run the algorithm.
void createFromHistogram(const ISpectrum *inSpec, bool GenerateZeros, bool GenerateMultipleEvents, int MaxEventsPerBin)
Create an EventList from a histogram.
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 Workspace2D > Workspace2D_const_sptr
shared pointer to Mantid::DataObjects::Workspace2D (const version)
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.
@ Input
An input workspace.
@ Output
An output workspace.