14namespace DataObjects {
39 std::unique_ptr<SpecialWorkspace2D>
clone()
const {
return std::unique_ptr<SpecialWorkspace2D>(doClone()); }
42 auto workspace = std::unique_ptr<SpecialWorkspace2D>(doCloneEmpty());
43 workspace->detID_to_WI = this->detID_to_WI;
49 const std::string
id()
const override {
return "SpecialWorkspace2D"; }
52 void buildDetectorIDMapping();
53 bool contains(
const detid_t detectorID)
const;
54 double getValue(
const detid_t detectorID)
const;
55 double getValue(
const detid_t detectorID,
const double defaultValue)
const;
57 void setValue(
const detid_t detectorID,
const double value,
const double error = 0.);
58 void setValue(
const std::set<detid_t> &detectorIDs,
const double value,
const double error = 0.);
60 std::set<detid_t> getDetectorIDs(
const std::size_t workspaceIndex)
const;
62 void binaryOperation(
const std::shared_ptr<const SpecialWorkspace2D> &ws,
const unsigned int operatortype);
63 void binaryOperation(
const unsigned int operatortype);
65 virtual void copyFrom(std::shared_ptr<const SpecialWorkspace2D> sourcews);
70 bool isCompatible(
const std::shared_ptr<const SpecialWorkspace2D> &ws);
76 void init(
const size_t &NVectors,
const size_t &XLength,
const size_t &YLength)
override;
77 void init(
const HistogramData::Histogram &histogram)
override;
80 const std::string
toString()
const override;
82 void binaryAND(
const std::shared_ptr<const SpecialWorkspace2D> &ws);
83 void binaryOR(
const std::shared_ptr<const SpecialWorkspace2D> &ws);
84 void binaryXOR(
const std::shared_ptr<const SpecialWorkspace2D> &ws);
100#ifndef DataObjects_EXPORTS
104extern template class MANTID_DATAOBJECTS_DLL WorkspaceProperty<DataObjects::SpecialWorkspace2D>;
double value
The value of the point.
IPeaksWorkspace_sptr workspace
An SpecialWorkspace2D is a specialized Workspace2D where the Y value at each pixel will be used for a...
SpecialWorkspace2D * doClone() const override
Virtual clone method. Not implemented to force implementation in children.
SpecialWorkspace2D * doCloneEmpty() const override
Virtual cloneEmpty method.
SpecialWorkspace2D(const SpecialWorkspace2D &)=default
Protected copy constructor. May be used by childs for cloning.
std::unique_ptr< SpecialWorkspace2D > clone() const
Returns a clone of the workspace.
std::map< detid_t, std::size_t > detID_to_WI
Map with key = detector ID, and value = workspace index.
bool isDetectorIDMappingEmpty() const
const std::string id() const override
Gets the name of the workspace type.
std::unique_ptr< SpecialWorkspace2D > cloneEmpty() const
Returns a default-initialized clone of the workspace.
SpecialWorkspace2D()=default
SpecialWorkspace2D & operator=(const SpecialWorkspace2D &)=delete
Concrete workspace implementation.
std::shared_ptr< const MatrixWorkspace > MatrixWorkspace_const_sptr
shared pointer to the matrix workspace base class (const version)
std::shared_ptr< const SpecialWorkspace2D > SpecialWorkspace2D_const_sptr
shared pointer to a const SpecialWorkspace2D
std::shared_ptr< SpecialWorkspace2D > SpecialWorkspace2D_sptr
shared pointer to the SpecialWorkspace2D class
std::shared_ptr< const Instrument > Instrument_const_sptr
Shared pointer to an const instrument object.
std::string toString(const T &value)
Convert values to strings.
Helper class which provides the Collimation Length for SANS instruments.