8#include "MantidAPI/Algorithm.tcc"
15using namespace Kernel;
31 return "Mask (zero) spectra and the underlying detectors in a workspace.";
35 declareWorkspaceInputProperties<MatrixWorkspace, static_cast<int>(IndexType::SpectrumNum) |
36 static_cast<int>(IndexType::WorkspaceIndex)>(
37 "InputWorkspace",
"The input workspace");
39 "Name of the output workspace");
43 std::shared_ptr<MatrixWorkspace> inputWS;
44 Indexing::SpectrumIndexSet indexSet;
45 std::tie(inputWS, indexSet) = getWorkspaceAndIndices<MatrixWorkspace>(
"InputWorkspace");
47 if (outputWS != inputWS) {
48 outputWS = inputWS->clone();
52 auto &spectrumInfo = outputWS->mutableSpectrumInfo();
53 Progress prog(
this, 0.0, 1.0, indexSet.size());
54 for (
const auto i : indexSet) {
55 outputWS->getSpectrum(i).clearData();
56 if (spectrumInfo.hasDetectors(i))
57 spectrumInfo.setMasked(i,
true);
#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.
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.
Mask specified spectra and the underlying detectors in a workspace.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
const std::string summary() const override
Algorithm's summary for use in the GUI and help.
void init() override
Virtual method - must be overridden by concrete algorithm.
void exec() override
Virtual method - must be overridden by concrete algorithm.
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< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
@ Output
An output workspace.