20using namespace Kernel;
22using namespace DataObjects;
27 "An input EventWorkspace.");
29 "An output Workspace2D.");
37 std::dynamic_pointer_cast<const DataObjects::EventWorkspace>(inputWorkspace);
42 const size_t numHists = inputWorkspace->getNumberHistograms();
43 Progress prog(
this, 0.0, 1.0, numHists * 2);
51 outputWorkspace = create<Workspace2D>(*inputWorkspace);
55 for (int64_t i = 0; i < static_cast<int64_t>(numHists); ++i) {
57 const auto &inSpec = inputWorkspace->getSpectrum(i);
58 auto &outSpec = outputWorkspace->getSpectrum(i);
60 outSpec.copyInfoFrom(inSpec);
61 outSpec.setHistogram(inSpec.histogram());
70 if (inputWorkspace == outputWorkspace) {
72 "OutputWorkspace property to input.");
73 outputWorkspace = std::const_pointer_cast<MatrixWorkspace>(inputWorkspace);
75 g_log.
information(
"InputWorkspace does not need converting. Cloning InputWorkspace.");
76 outputWorkspace = inputWorkspace->clone();
#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.
Helper class for reporting progress from algorithms.
A property class for workspaces.
void init() override
Initialisation code.
void exec() override
Execution code.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
void information(const std::string &msg)
Logs at information level.
void report()
Increments the loop counter by 1, then sends the progress notification on behalf of its algorithm.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< const EventWorkspace > EventWorkspace_const_sptr
shared pointer to a const Workspace2D
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.