11#include "MantidDataHandling/DllConfig.h"
15#include <Poco/AutoPtr.h>
16#include <Poco/DOM/Document.h>
26namespace DataHandling {
37 const std::string
name()
const override {
return "LoadMask"; };
39 const std::string
summary()
const override {
40 return "Load file containing masking information to a SpecialWorkspace2D "
41 "(masking workspace).";
45 int version()
const override {
return 1; };
46 const std::vector<std::string>
seeAlso()
const override {
return {
"ExportSpectraMask",
"LoadMask"}; }
48 const std::string
category()
const override {
return "DataHandling\\Masking;Transforms\\Masking"; }
56 void initializeXMLParser(
const std::string &filename);
60 void intializeMaskWorkspace();
62 void componentToDetectors(
const std::vector<std::string> &componentnames, std::vector<detid_t> &detectors);
64 void bankToDetectors(
const std::vector<std::string> &singlebanks, std::vector<detid_t> &detectors);
66 void processMaskOnDetectors(
const detid2index_map &indexmap,
bool tomask,
const std::vector<detid_t> &singledetids);
68 void processMaskOnWorkspaceIndex(
bool mask, std::vector<specnum_t> &maskedSpecID, std::vector<detid_t> &singleDetIds);
72 std::map<std::string, std::string> validateInputs()
override;
74 void convertSpMasksToDetIDs(
const API::MatrixWorkspace &sourceWS,
const std::vector<specnum_t> &maskedSpecID,
75 std::vector<detid_t> &singleDetIds);
86 Poco::AutoPtr<Poco::XML::Document>
m_pDoc;
88 Poco::XML::Element *m_pRootElem{
nullptr};
91 bool m_defaultToUse{
true};
Base MatrixWorkspace Abstract Class.
Base class for algorithms that can run in parallel on all MPI ranks but not in a distributed fashion.
LoadMask : Load masking file to generate a SpecialWorkspace2D object (masking workspace).
DataObjects::MaskWorkspace_sptr m_maskWS
Mask Workspace.
std::vector< std::string > m_uMaskCompIdSingle
std::string m_instrumentPropValue
Instrument name.
std::vector< std::string > m_maskCompIdSingle
std::vector< detid_t > m_maskDetID
const std::string summary() const override
Summary of algorithms purpose.
const std::string category() const override
Algorithm's category for identification.
Poco::AutoPtr< Poco::XML::Document > m_pDoc
XML document loaded.
std::vector< specnum_t > m_maskSpecID
int version() const override
Algorithm's version for identification.
const std::string name() const override
Algorithm's name for identification.
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
std::vector< detid_t > m_unMaskDetID
API::MatrixWorkspace_sptr m_sourceMapWS
optional source workspace, containing spectra-detector mapping
std::shared_ptr< MatrixWorkspace > MatrixWorkspace_sptr
shared pointer to the matrix workspace base class
std::shared_ptr< MaskWorkspace > MaskWorkspace_sptr
shared pointer to the MaskWorkspace class
Helper class which provides the Collimation Length for SANS instruments.
std::unordered_map< detid_t, size_t > detid2index_map
Map with key = detector ID, value = workspace index.