25 useAlgorithm(
"MaskDetectors");
26 deprecatedDate(
"2020-07-16");
44 "Name of the output workspace (can be same as InputWorkspace)");
51 if (outputWS != inputWS) {
52 outputWS = inputWS->clone();
56 const std::vector<detid_t> detectorIds =
getProperty(
"DetectorIDs");
57 auto &detectorInfo = outputWS->mutableDetectorInfo();
58 for (
const auto &
id : detectorIds)
59 detectorInfo.setMasked(detectorInfo.indexOf(
id),
true);
61 const auto &spectrumInfo = outputWS->spectrumInfo();
62 for (
size_t i = 0; i < spectrumInfo.size(); ++i) {
63 if (spectrumInfo.hasDetectors(i) && spectrumInfo.isMasked(i))
64 outputWS->getSpectrum(i).clearData();
#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.
A property class for workspaces.
Mask specified detectors in an instrument.
const std::string category() const override
Algorithm's category for identification.
int version() const override
Algorithm's version for identification.
const std::string name() const override
Algorithms name 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.
This class is intended to fulfill the design specified in <https://github.com/mantidproject/documents...
Support for a property that holds an array of values.
IPropertyManager * setProperty(const std::string &name, const T &value)
Templated method to set the value of a PropertyWithValue.
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
@ Input
An input workspace.
@ Output
An output workspace.