19using namespace Kernel;
21using namespace DataObjects;
25 "Name of the input workspace. Must be a MatrixWorkspace (2D or "
26 "EventWorkspace), a PeaksWorkspace or a MDEventWorkspace.");
28 "Name of the newly created cloned workspace.");
34 if (inputWorkspace == outputWorkspace) {
40 IMDWorkspace_sptr inputMD = std::dynamic_pointer_cast<IMDWorkspace>(inputWorkspace);
43 if (inputMatrix || iTableWS) {
50 alg->setProperty(
"InputWorkspace", inputMD);
51 alg->setPropertyValue(
"OutputWorkspace",
getPropertyValue(
"OutputWorkspace"));
52 alg->executeAsChildAlg();
54 setProperty(
"OutputWorkspace", std::dynamic_pointer_cast<Workspace>(outputWS));
56 throw std::runtime_error(
"Expected a MatrixWorkspace, PeaksWorkspace, "
57 "MDEventWorkspace, or a MDHistoWorkspace. Cannot "
58 "clone this type of workspace.");
#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.
virtual std::shared_ptr< Algorithm > createChildAlgorithm(const std::string &name, const double startProgress=-1., const double endProgress=-1., const bool enableLogging=true, const int &version=-1)
Create a Child Algorithm.
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.
std::shared_ptr< Workspace > Workspace_sptr
shared pointer to Mantid::API::Workspace
std::shared_ptr< const ITableWorkspace > ITableWorkspace_const_sptr
shared pointer to Mantid::API::ITableWorkspace (const version)
std::shared_ptr< const Workspace > Workspace_const_sptr
shared pointer to Mantid::API::Workspace (const version)
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< IMDWorkspace > IMDWorkspace_sptr
Shared pointer to the IMDWorkspace base class.
@ Input
An input workspace.
@ Output
An output workspace.