14namespace DataObjects {
38 std::unique_ptr<SpecialWorkspace2D>
clone()
const {
return std::unique_ptr<SpecialWorkspace2D>(doClone()); }
41 auto workspace = std::unique_ptr<SpecialWorkspace2D>(doCloneEmpty());
42 workspace->detID_to_WI = this->detID_to_WI;
48 const std::string
id()
const override {
return "SpecialWorkspace2D"; }
50 double getValue(
const detid_t detectorID)
const;
51 double getValue(
const detid_t detectorID,
const double defaultValue)
const;
53 void setValue(
const detid_t detectorID,
const double value,
const double error = 0.);
54 void setValue(
const std::set<detid_t> &detectorIDs,
const double value,
const double error = 0.);
56 std::set<detid_t> getDetectorIDs(
const std::size_t workspaceIndex)
const;
58 void binaryOperation(
const std::shared_ptr<const SpecialWorkspace2D> &ws,
const unsigned int operatortype);
59 void binaryOperation(
const unsigned int operatortype);
61 virtual void copyFrom(std::shared_ptr<const SpecialWorkspace2D> sourcews);
66 bool isCompatible(
const std::shared_ptr<const SpecialWorkspace2D> &ws);
72 void init(
const size_t &NVectors,
const size_t &XLength,
const size_t &YLength)
override;
73 void init(
const HistogramData::Histogram &histogram)
override;
76 const std::string toString()
const override;
78 void binaryAND(
const std::shared_ptr<const SpecialWorkspace2D> &ws);
79 void binaryOR(
const std::shared_ptr<const SpecialWorkspace2D> &ws);
80 void binaryXOR(
const std::shared_ptr<const SpecialWorkspace2D> &ws);
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.
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.
Helper class which provides the Collimation Length for SANS instruments.