36 "A MDEventWorkspace or MDHistoWorkspace on which to apply "
39 "Name of the output MDEventWorkspace or MDHistoWorkspace.");
56 if (std::dynamic_pointer_cast<MatrixWorkspace>(
m_in)) {
58 std::string matrixAlg = this->
name();
59 matrixAlg = matrixAlg.substr(0, matrixAlg.size() - 2);
63 for (
auto prop : props) {
64 alg->setPropertyValue(prop->name(), prop->value());
82 clone->setProperty(
"InputWorkspace",
m_in);
83 clone->executeAsChildAlg();
84 m_out = clone->getProperty(
"OutputWorkspace");
90 throw std::runtime_error(
"Error creating the output workspace");
101 throw std::runtime_error(
"Unexpected output workspace type. Expected MDEventWorkspace or "
102 "MDHistoWorkspace, got " +
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.
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.
const std::vector< Kernel::Property * > & getProperties() const override
Get the list of managed properties.
A property class for workspaces.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
Mantid::API::IMDWorkspace_sptr m_out
Output workspace.
const std::string category() const override
Algorithm's category for identification.
virtual void execHisto(Mantid::DataObjects::MDHistoWorkspace_sptr out)=0
Run the algorithm with a MDHistoWorkspace.
virtual const std::string outputPropName() const
The name of the output workspace property.
virtual void execEvent(Mantid::API::IMDEventWorkspace_sptr out)=0
Run the algorithm on a MDEventWorkspace.
virtual void initExtraProperties()
Optional method to be subclassed to add properties.
int version() const override
Algorithm's version for identification.
virtual void checkInputs()=0
Check the inputs and throw if the algorithm cannot be run.
Mantid::API::IMDEventWorkspace_sptr m_in_event
Input workspace (MDEvent)
virtual const std::string inputPropName() const
The name of the input workspace property.
const std::string name() const override
Algorithm's name for identification.
void init() override
Initialize the algorithm's properties.
void exec() override
Execute the algorithm.
Mantid::DataObjects::MDHistoWorkspace_sptr m_in_histo
Input workspace (MDHisto)
Mantid::API::IMDWorkspace_sptr m_in
Input workspace.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< IMDWorkspace > IMDWorkspace_sptr
Shared pointer to the IMDWorkspace base class.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< MDHistoWorkspace > MDHistoWorkspace_sptr
A shared pointer to a MDHistoWorkspace.
@ Input
An input workspace.
@ Output
An output workspace.