Newer
Older
Russell Taylor
committed
//----------------------------------------------------------------------
// Includes
//----------------------------------------------------------------------
#include "MantidAlgorithms/ConvertFromDistribution.h"
#include "MantidAPI/HistogramValidator.h"
#include "MantidAPI/RawCountValidator.h"
#include "MantidAPI/WorkspaceOpOverloads.h"
#include "MantidKernel/CompositeValidator.h"
Russell Taylor
committed
namespace Mantid {
namespace Algorithms {
Russell Taylor
committed
// Register the algorithm into the AlgorithmFactory
DECLARE_ALGORITHM(ConvertFromDistribution)
using namespace API;
void ConvertFromDistribution::init() {
auto wsValidator = boost::make_shared<Kernel::CompositeValidator>();
wsValidator->add<HistogramValidator>();
wsValidator->add<RawCountValidator>(false);
declareProperty(Kernel::make_unique<WorkspaceProperty<>>(
"Workspace", "", Kernel::Direction::InOut, wsValidator),
"The name of the workspace to convert.");
Russell Taylor
committed
}
void ConvertFromDistribution::exec() {
Roman Tolchenov
committed
MatrixWorkspace_sptr workspace = getProperty("Workspace");
Russell Taylor
committed
WorkspaceHelpers::makeDistribution(workspace, false);
Russell Taylor
committed
}
} // namespace Algorithms
} // namespace Mantid