22namespace DataObjects {
42 using sptr = std::shared_ptr<MDEventWorkspace<MDE, nd>>;
53 std::unique_ptr<MDEventWorkspace>
clone()
const {
return std::unique_ptr<MDEventWorkspace>(doClone()); }
56 std::unique_ptr<MDEventWorkspace>
cloneEmpty()
const {
return std::unique_ptr<MDEventWorkspace>(doCloneEmpty()); }
61 const std::string
id()
const override;
71 uint64_t
getNEvents()
const override {
return getNPoints(); }
74 std::vector<std::unique_ptr<Mantid::API::IMDIterator>>
117 bool isFileBacked()
const override {
return m_BoxController->isFileBacked(); }
139 void getBoxes(std::vector<API::IMDNode *> &boxes,
size_t maxDepth,
bool leafOnly)
override {
140 this->getBox()->getBoxes(boxes, maxDepth, leafOnly);
147 std::vector<Mantid::Geometry::MDDimensionExtents<coord_t>>
getMinimumExtents(
size_t depth = 2)
const override;
166 void setMDMasking(std::unique_ptr<Mantid::Geometry::MDImplicitFunction> maskingRegion)
override;
197 const size_t num_boundaries,
const coord_t length,
const coord_t dir_current_dim,
198 const coord_t box_size, std::set<coord_t> &mid_points)
const;
204 std::unique_ptr<MDBoxBase<MDE, nd>>
data;
#define TMDE_CLASS
Macro to make declaring template classes faster.
Abstract base class for multi-dimension event workspaces (MDEventWorkspace).
Templated super-class of a multi-dimensional event "box".
Templated class for the multi-dimensional event workspace.
std::set< coord_t > getBoxBoundaryBisectsOnLine(const Kernel::VMD &start, const Kernel::VMD &end, const size_t num_d, const Kernel::VMD &dir, const coord_t length) const
void splitTrackedBoxes(Kernel::ThreadScheduler *ts)
size_t getMemorySize() const override
Mantid::API::MDNormalization displayNormalization() const override
void getBoxes(std::vector< API::IMDNode * > &boxes, size_t maxDepth, bool leafOnly) override
Mantid::API::BoxController_const_sptr getBoxController() const override
Returns the BoxController used in this workspace.
size_t addEvent(const MDE &event)
signal_t getSignalAtCoord(const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
Returns the (normalized) signal at a given coordinates.
MDEventWorkspace< MDE, nd > & operator=(const MDEventWorkspace< MDE, nd > &other)=delete
std::unique_ptr< MDBoxBase< MDE, nd > > data
MDBox containing all of the events in the workspace.
std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > getMinimumExtents(size_t depth=2) const override
Get the minimum extents that hold the data.
bool isGridBox()
Return true if the underlying box is a MDGridBox.
std::string getEventTypeName() const override
Return the type of event contained, as a string. MDEvent or MDLeanEvent.
Kernel::SpecialCoordinateSystem m_coordSystem
MDE MDEventType
Typedef to access the MDEventType.
uint64_t getNPoints() const override
void clearMDMasking() override
Clear masking.
const MDBoxBase< MDE, nd > * getBox() const
void setMDMasking(std::unique_ptr< Mantid::Geometry::MDImplicitFunction > maskingRegion) override
Apply masking.
void clearFileBacked(bool LoadFileBackedData) override
if workspace was file-backed, this should clear file-backed information and close back-up files.
MDEventWorkspace * doCloneEmpty() const override
Virtual cloneEmpty method.
void setDisplayNormalizationHisto(Mantid::API::MDNormalization preferredNormalizationHisto) override
Preferred visual normalizaiton method for any histo workspaces created from this.
void splitBox() override
Split the top-level MDBox into a MDGridBox.
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
MDBoxBase< MDE, nd > * getBox()
bool isInBounds(const coord_t *coords) const
void splitAllIfNeeded(Kernel::ThreadScheduler *ts) override
Split all boxes that exceed the split threshold.
signal_t getSignalWithMaskAtCoord(const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
Returns the (normalized) signal at a given coordinates.
std::unique_ptr< MDEventWorkspace > clone() const
Returns a clone of the workspace.
MDEventWorkspace(Mantid::API::MDNormalization preferredNormalization=Mantid::API::MDNormalization::VolumeNormalization, Mantid::API::MDNormalization preferredNormalizationHisto=Mantid::API::MDNormalization::VolumeNormalization)
void setCoordinateSystem(const Kernel::SpecialCoordinateSystem coordSystem) override
Set the coordinate system.
Mantid::API::MDNormalization displayNormalizationHisto() const override
Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem() const override
Get the coordinate system.
std::vector< coord_t > estimateResolution() const override
std::unique_ptr< MDEventWorkspace > cloneEmpty() const
Returns a default-initialized clone of the workspace.
void refreshCache() override
Refresh the cache (integrated signal of each box)
size_t sizeofEvent() const override
return the size (in bytes) of an event, this workspace contains
void setDisplayNormalization(Mantid::API::MDNormalization preferredNormalization) override
Preferred visual normalization method.
void initialize() override
Perform initialization after dimensions (and others) have been set.
virtual ~MDEventWorkspace() override=default
virtual void setFileBacked(const std::string &fileName)
make the workspace file backed if it has not been already file backed;
signal_t getNormalizedError(const API::IMDNode *box, const Mantid::API::MDNormalization &normalization) const
MDEventWorkspace(const MDEventWorkspace< MDE, nd > &other)
Protected copy constructor. May be used by childs for cloning.
void setMinRecursionDepth(size_t minDepth) override
Recurse down to a minimum depth.
signal_t getNormalizedSignal(const API::IMDNode *box, const Mantid::API::MDNormalization &normalization) const
void getBoundariesInDimension(const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &dir, const size_t num_boundaries, const coord_t length, const coord_t dir_current_dim, const coord_t box_size, std::set< coord_t > &mid_points) const
Insert box bisects in position-along-line coords in a single dimension.
Mantid::API::MDNormalization m_displayNormalizationHisto
Display normalization to pass onto generated histo workspaces.
std::vector< std::string > getBoxControllerStats() const override
Returns some information about the box controller, to be displayed in the GUI, for example.
LinePlot getLinePlot(const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, API::MDNormalization normalize) const override
Method to generate a line plot through a MD-workspace.
Mantid::API::BoxController_sptr getBoxController() override
Returns the BoxController used in this workspace.
size_t getNumDims() const override
void setFileBacked() override
set filebacked on the contained box
MDEventWorkspace * doClone() const override
Virtual clone method. Not implemented to force implementation in children.
API::BoxController_sptr m_BoxController
Box controller in use.
void setBox(API::IMDNode *box) override
Set the base-level box contained within.
std::vector< std::unique_ptr< Mantid::API::IMDIterator > > createIterators(size_t suggestedNumCores=1, Mantid::Geometry::MDImplicitFunction *function=nullptr) const override
Creates a new iterator pointing to the first cell (box) in the workspace.
const std::string id() const override
A string ID for the class.
Mantid::API::ITableWorkspace_sptr makeBoxTable(size_t start, size_t num) override
this is the method to build table workspace from any workspace.
Mantid::API::MDNormalization m_displayNormalization
Display normalization for the event workspace itself.
uint64_t getNEvents() const override
size_t addEvents(const std::vector< MDE > &events)
bool isFileBacked() const override
Templated class for a GRIDDED multi-dimensional event "box".
An "ImplicitFunction" defining a hyper-cuboid-shaped region in N dimensions.
The ThreadScheduler object defines how tasks are allocated to threads and in what order.
std::shared_ptr< ITableWorkspace > ITableWorkspace_sptr
shared pointer to Mantid::API::ITableWorkspace
std::shared_ptr< const BoxController > BoxController_const_sptr
Shared ptr to a const BoxController.
std::shared_ptr< BoxController > BoxController_sptr
Shared ptr to BoxController.
MDNormalization
Enum describing different ways to normalize the signal in a MDWorkspace.
@ VolumeNormalization
Divide the signal by the volume of the box/bin.
SpecialCoordinateSystem
Special coordinate systems for Q3D.
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
double signal_t
Typedef for the signal recorded in a MDBox, etc.
Holds X, Y, E for a line plot.