Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Mantid::DataObjects::MDEventWorkspace< MDE, nd > Class Template Reference

Templated class for the multi-dimensional event workspace. More...

#include <MDEventWorkspace.h>

Inheritance diagram for Mantid::DataObjects::MDEventWorkspace< MDE, nd >:
Mantid::API::IMDEventWorkspace Mantid::API::IMDWorkspace Mantid::API::MultipleExperimentInfos Mantid::API::Workspace Mantid::API::MDGeometry Mantid::Kernel::DataItem

Public Types

using MDEventType = MDE
 Typedef to access the MDEventType.
 
using sptr = std::shared_ptr< MDEventWorkspace< MDE, nd > >
 Typedef for a shared pointer of this kind of event workspace.
 

Public Member Functions

size_t addEvent (const MDE &event)
 Add a single event to this workspace.
 
size_t addEvents (const std::vector< MDE > &events)
 Add a vector of MDEvents to the workspace.
 
void clearFileBacked (bool LoadFileBackedData) override
 if workspace was file-backed, this should clear file-backed information and close back-up files.
 
void clearMDMasking () override
 Clear masking.
 
std::unique_ptr< MDEventWorkspaceclone () const
 Returns a clone of the workspace.
 
std::unique_ptr< MDEventWorkspacecloneEmpty () const
 Returns a default-initialized clone of the workspace.
 
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.
 
Mantid::API::MDNormalization displayNormalization () const override
 Return the preferred normalization to use for visualization.
 
Mantid::API::MDNormalization displayNormalizationHisto () const override
 Return the preferred normalization preference for subsequent histoworkspaces.
 
std::vector< coord_testimateResolution () const override
 
MDBoxBase< MDE, nd > * getBox ()
 
const MDBoxBase< MDE, nd > * getBox () const
 
std::set< coord_tgetBoxBoundaryBisectsOnLine (const Kernel::VMD &start, const Kernel::VMD &end, const size_t num_d, const Kernel::VMD &dir, const coord_t length) const
 Get ordered list of positions-along-the-line that lie halfway between points where the line crosses box boundaries.
 
Mantid::API::BoxController_const_sptr getBoxController () const override
 Returns the BoxController used in this workspace.
 
Mantid::API::BoxController_sptr getBoxController () override
 Returns the BoxController used in this workspace.
 
std::vector< std::string > getBoxControllerStats () const override
 Returns some information about the box controller, to be displayed in the GUI, for example.
 
void getBoxes (std::vector< API::IMDNode * > &boxes, size_t maxDepth, bool leafOnly) override
 
std::string getEventTypeName () const override
 Get the data type (id) of the events in the workspace.
 
LinePlot getLinePlot (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, API::MDNormalization normalize) const override
 Obtain coordinates for a line plot through a MDWorkspace.
 
size_t getMemorySize () const override
 
std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > getMinimumExtents (size_t depth=2) const override
 Get a vector of the minimum extents that still contain all the events in the workspace.
 
uint64_t getNEvents () const override
 
signal_t getNormalizedError (const API::IMDNode *box, const Mantid::API::MDNormalization &normalization) const
 
signal_t getNormalizedSignal (const API::IMDNode *box, const Mantid::API::MDNormalization &normalization) const
 
uint64_t getNPoints () const override
 Returns the total number of points (events) in this workspace.
 
size_t getNumDims () const override
 Returns the number of dimensions in this workspace.
 
signal_t getSignalAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
 Returns the (normalized) signal at a given coordinates.
 
signal_t getSignalWithMaskAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
 Returns the (normalized) signal at a given coordinates.
 
Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem () const override
 Get the coordinate system.
 
const std::string id () const override
 Get the data type (id) of the workspace.
 
void initialize () override
 Perform initialization after dimensions (and others) have been set.
 
bool isFileBacked () const override
 
bool isGridBox ()
 Return true if the underlying box is a MDGridBox.
 
bool isInBounds (const coord_t *coords) const
 
Mantid::API::ITableWorkspace_sptr makeBoxTable (size_t start, size_t num) override
 Create a table of data about the boxes contained.
 
 MDEventWorkspace (Mantid::API::MDNormalization preferredNormalization=Mantid::API::MDNormalization::VolumeNormalization, Mantid::API::MDNormalization preferredNormalizationHisto=Mantid::API::MDNormalization::VolumeNormalization)
 Constructor.
 
MDEventWorkspace< MDE, nd > & operator= (const MDEventWorkspace< MDE, nd > &other)=delete
 
void refreshCache () override
 Refresh the cache of # of points, signal, and error.
 
void setBox (API::IMDNode *box) override
 Set the base-level box contained within.
 
void setCoordinateSystem (const Kernel::SpecialCoordinateSystem coordSystem) override
 Set the coordinate system.
 
void setDisplayNormalization (Mantid::API::MDNormalization preferredNormalization) override
 Preferred visual normalization method.
 
void setDisplayNormalizationHisto (Mantid::API::MDNormalization preferredNormalizationHisto) override
 Preferred visual normalizaiton method for any histo workspaces created from this.
 
void setFileBacked () override
 set filebacked on the contained box
 
virtual void setFileBacked (const std::string &fileName)
 make the workspace file backed if it has not been already file backed;
 
void setMDMasking (std::unique_ptr< Mantid::Geometry::MDImplicitFunction > maskingRegion) override
 Apply masking.
 
void setMinRecursionDepth (size_t minDepth) override
 Recurse box structure down to a minimum depth.
 
size_t sizeofEvent () const override
 return the size (in bytes) of an event, this workspace contains
 
void splitAllIfNeeded (Kernel::ThreadScheduler *ts) override
 Goes through all the sub-boxes and splits them if they contain enough events to be worth it.
 
void splitBox () override
 Split the contained MDBox into a MDGridBox or MDSplitBox, if it is not that already.
 
void splitTrackedBoxes (Kernel::ThreadScheduler *ts)
 Goes through the MDBoxes that were tracked by the BoxController as being too large, and splits them.
 
virtual ~MDEventWorkspace () override=default
 
- Public Member Functions inherited from Mantid::API::IMDEventWorkspace
IMDEventWorkspace_uptr clone () const
 Returns a clone of the workspace.
 
IMDEventWorkspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace.
 
bool fileNeedsUpdating () const
 
virtual bool hasOrientedLattice () const override
 
 IMDEventWorkspace ()
 Empty constructor.
 
IMDEventWorkspaceoperator= (const IMDEventWorkspace &)=delete
 
void setFileNeedsUpdating (bool value)
 Sets the marker set to true when a file-backed workspace needs its back-end file updated (by calling SaveMD(UpdateFileBackEnd=1) )
 
bool threadSafe () const override
 Is the workspace thread-safe.
 
- Public Member Functions inherited from Mantid::API::IMDWorkspace
std::string changeQConvention ()
 
std::unique_ptr< IMDWorkspaceclone () const
 Returns a clone of the workspace.
 
std::unique_ptr< IMDWorkspacecloneEmpty () const
 Returns a default-initialized clone of the workspace.
 
std::unique_ptr< IMDIteratorcreateIterator (Mantid::Geometry::MDImplicitFunction *function=nullptr) const
 Creates a single iterator and returns it.
 
const std::string & getConvention () const
 
signal_t getSignalAtVMD (const Mantid::Kernel::VMD &coords, const Mantid::API::MDNormalization &normalization=Mantid::API::VolumeNormalization) const
 Returns the signal (normalized by volume) at a given coordinates.
 
signal_t getSignalWithMaskAtVMD (const Mantid::Kernel::VMD &coords, const Mantid::API::MDNormalization &normalization=Mantid::API::VolumeNormalization) const
 Returns the signal (normalized by volume) at a given coordinates or 0 if masked.
 
 IMDWorkspace ()
 Default constructor.
 
virtual bool isMDHistoWorkspace () const
 
IMDWorkspaceoperator= (const IMDWorkspace &other)=delete
 
void setConvention (std::string convention)
 Sets the convention of the workspace.
 
- Public Member Functions inherited from Mantid::API::Workspace
Workspace_uptr clone () const
 Returns a clone (copy) of the workspace with covariant return type in all derived classes.
 
Workspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace.
 
const std::string & getComment () const
 Get the workspace comment.
 
const WorkspaceHistorygetHistory () const
 Returns a reference to the WorkspaceHistory const.
 
std::string getMemorySizeAsStr () const
 Returns the memory footprint in sensible units.
 
const std::string & getName () const override
 Get the workspace name.
 
const std::string & getPythonVariableName () const
 
virtual const std::string getTitle () const
 Get the workspace title.
 
WorkspaceHistoryhistory ()
 Returns a reference to the WorkspaceHistory.
 
bool isDirty (const int n=1) const
 Check whether other algorithms have been applied to the workspace by checking the history length.
 
virtual bool isGroup () const
 
Workspaceoperator= (const Workspace &other)=delete
 
void setComment (const std::string &)
 Set the comment field of the workspace.
 
void setPythonVariableName (const std::string &)
 
virtual void setTitle (const std::string &)
 Set the title of the workspace.
 
bool threadSafe () const override
 Marks the workspace as safe for multiple threads to edit data simutaneously.
 
 Workspace ()
 
 ~Workspace ()
 
- Public Member Functions inherited from Mantid::Kernel::DataItem
 DataItem ()
 Default constructor.
 
 DataItem (const DataItem &other)
 Copy constructor Always makes a unique lock.
 
virtual ~DataItem ()
 Destructor.
 
void readLock ()
 Acquires a read lock.
 
void unlock ()
 
- Public Member Functions inherited from Mantid::API::MDGeometry
void addDimension (const std::shared_ptr< Mantid::Geometry::IMDDimension > &dim)
 Add a dimension.
 
void addDimension (Mantid::Geometry::IMDDimension *dim)
 Add a dimension.
 
bool allBasisNormalized () const
 
void clearOriginalWorkspaces ()
 Clear original workspaces.
 
void clearTransforms ()
 Clear transforms.
 
Mantid::Kernel::VMDgetBasisVector (size_t index)
 Get the basis vector (in the original workspace) for a dimension of this workspace.
 
const Mantid::Kernel::VMDgetBasisVector (size_t index) const
 Get the basis vector (in the original workspace) for a dimension of this workspace.
 
virtual std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimension (size_t index) const
 Get a dimension.
 
size_t getDimensionIndexById (const std::string &id) const
 Get the index of the dimension that matches the ID given.
 
size_t getDimensionIndexByName (const std::string &name) const
 Get the index of the dimension that matches the name given.
 
virtual std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimensionWithId (std::string id) const
 Get a dimension.
 
std::string getGeometryXML () const
 
std::vector< std::shared_ptr< const Geometry::IMDDimension > > getNonIntegratedDimensions () const
 Get non-collapsed dimensions.
 
size_t getNumberTransformsFromOriginal () const
 Get the number of transforms defined from the original coordinate system.
 
size_t getNumberTransformsToOriginal () const
 Get the number of transforms defined to the original coordinate system.
 
virtual size_t getNumNonIntegratedDims () const
 
Mantid::Kernel::VMDgetOrigin ()
 
const Mantid::Kernel::VMDgetOrigin () const
 
std::shared_ptr< WorkspacegetOriginalWorkspace (size_t index=0) const
 Get the "original" workspace (the workspace that was the source for a binned MDWorkspace).
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetTDimension () const
 Get the t-dimension mapping.
 
Mantid::API::CoordTransform const * getTransformFromOriginal (size_t index=0) const
 Get the Coordinate Transformation that goes from the original workspace to this workspace's coordinates.
 
Mantid::API::CoordTransform const * getTransformToOriginal (size_t index=0) const
 Get the Coordinate Transformation that goes from THIS workspace's coordinates to the ORIGINAL workspace's coordinates.
 
const Kernel::DblMatrixgetWTransf () const
 get the transformation from Qin crystal cartezian coordinate system to Q in orthogonal or real HKL coordiate system alined with arbitrary slicing plane
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetXDimension () const
 Get the x-dimension mapping.
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetYDimension () const
 Get the y-dimension mapping.
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetZDimension () const
 Get the z-dimension mapping.
 
bool hasOriginalWorkspace (size_t index=0) const
 
void initGeometry (const std::vector< std::shared_ptr< Geometry::IMDDimension > > &dimensions)
 Initialize the geometry.
 
 MDGeometry ()
 Constructor.
 
 MDGeometry (const MDGeometry &other)
 Copy Constructor.
 
size_t numOriginalWorkspaces () const
 
MDGeometryoperator= (const MDGeometry &other)
 
void setBasisVector (size_t index, const Mantid::Kernel::VMD &vec)
 Set the basis vector (in the original workspace) for a dimension of this workspace.
 
void setOrigin (const Mantid::Kernel::VMD &orig)
 Sets the origin of this geometry.
 
void setOriginalWorkspace (std::shared_ptr< Workspace > ws, size_t index=0)
 Set the "original" workspace (the workspace that was the source for a binned MDWorkspace).
 
void setTransformFromOriginal (Mantid::API::CoordTransform *transform, size_t index=0)
 Sets the Coordinate Transformation that goes from the original workspace to this workspace's coordinates.
 
void setTransformToOriginal (Mantid::API::CoordTransform *transform, size_t index=0)
 Sets the Coordinate Transformation that goes from THIS workspace's coordinates to the ORIGINAL workspace's coordinates.
 
void setWTransf (const Kernel::DblMatrix &WTransf)
 set the transformation from Q in crystal cartezian coordinate system to Q in orthogonal or real HKL coordiate system alined with arbitrary slicing plane
 
void transformDimensions (std::vector< double > const &scaling, std::vector< double > const &offset)
 Transform the dimensions contained in this geometry x' = x*scaling + offset.
 
virtual ~MDGeometry ()
 Destructor.
 
- Public Member Functions inherited from Mantid::API::MultipleExperimentInfos
uint16_t addExperimentInfo (const ExperimentInfo_sptr &ei)
 Add a new ExperimentInfo to this MDEventWorkspace.
 
void copyExperimentInfos (const MultipleExperimentInfos &other)
 Copy the experiment infos from another.
 
ExperimentInfo_sptr getExperimentInfo (const uint16_t expInfoIndex)
 Get the ExperimentInfo for the given Experiment-Info Index.
 
ExperimentInfo_const_sptr getExperimentInfo (const uint16_t expInfoIndex) const
 Get the ExperimentInfo for the given Experiment-Info Index.
 
uint16_t getNumExperimentInfo () const
 
bool hasOrientedLattice () const
 
 MultipleExperimentInfos ()=default
 
 MultipleExperimentInfos (const MultipleExperimentInfos &other)
 Copy constructor.
 
MultipleExperimentInfosoperator= (const MultipleExperimentInfos &other)
 
void setExperimentInfo (const uint16_t expInfoIndex, ExperimentInfo_sptr ei)
 Replace the ExperimentInfo entry at a given place.
 
virtual ~MultipleExperimentInfos ()=default
 

Protected Member Functions

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.
 
 MDEventWorkspace (const MDEventWorkspace< MDE, nd > &other)
 Protected copy constructor. May be used by childs for cloning.
 
- Protected Member Functions inherited from Mantid::API::IMDEventWorkspace
 IMDEventWorkspace (const IMDEventWorkspace &)=default
 Protected copy constructor. May be used by childs for cloning.
 
const std::string toString () const override
 Serializes the object to a string.
 
- Protected Member Functions inherited from Mantid::API::IMDWorkspace
 IMDWorkspace (const IMDWorkspace &)=default
 Protected copy constructor. May be used by childs for cloning.
 
void makeSinglePointWithNaN (std::vector< coord_t > &x, std::vector< signal_t > &y, std::vector< signal_t > &e) const
 Make a single point with NaN as the signal and error This can be returned when there would otherwise be nothing to plot.
 
const std::string toString () const override
 Serializes the object to a string.
 
- Protected Member Functions inherited from Mantid::API::Workspace
 Workspace (const Workspace &)
 Protected copy constructor. May be used by childs for cloning.
 
- Protected Member Functions inherited from Mantid::Kernel::DataItem
Poco::RWLock * getLock () const
 Private method to access the RWLock object.
 
- Protected Member Functions inherited from Mantid::API::MDGeometry
void deleteNotificationReceived (const std::shared_ptr< const Workspace > &replaced)
 Function called when observer objects recieves a notification.
 
void replaceNotificationReceived (const std::shared_ptr< const Workspace > &deleted)
 Function called when observer detects a workspace is replaced.
 
- Protected Member Functions inherited from Mantid::API::MultipleExperimentInfos
const std::string toString () const
 Returns a string description of the object.
 

Protected Attributes

std::unique_ptr< MDBoxBase< MDE, nd > > data
 MDBox containing all of the events in the workspace.
 
API::BoxController_sptr m_BoxController
 Box controller in use.
 
Mantid::API::MDNormalization m_displayNormalization
 Display normalization for the event workspace itself.
 
Mantid::API::MDNormalization m_displayNormalizationHisto
 Display normalization to pass onto generated histo workspaces.
 
- Protected Attributes inherited from Mantid::API::IMDEventWorkspace
bool m_fileNeedsUpdating
 Marker set to true when a file-backed workspace needs its back-end file updated (by calling SaveMD(UpdateFileBackEnd=1) )
 
- Protected Attributes inherited from Mantid::API::MDGeometry
std::vector< Mantid::Kernel::VMDm_basisVectors
 Vector of the basis vector (in the original workspace) for each dimension of this workspace.
 
std::vector< std::shared_ptr< Geometry::IMDDimension > > m_dimensions
 Vector of the dimensions used, in the order X Y Z t, etc.
 
std::unique_ptr< MDGeometryNotificationHelperm_notificationHelper
 Helper that deals with notifications and observing the ADS.
 
Mantid::Kernel::VMD m_origin
 Vector of the origin (in the original workspace) that corresponds to 0,0,0... in this workspace.
 
std::vector< std::shared_ptr< Workspace > > m_originalWorkspaces
 Pointer to the original workspace(s), if this workspace is a coordinate transformation from an original workspace.
 
std::vector< std::shared_ptr< const Mantid::API::CoordTransform > > m_transforms_FromOriginal
 Coordinate Transformation that goes from the original workspace to this workspace's coordinates.
 
std::vector< std::shared_ptr< const Mantid::API::CoordTransform > > m_transforms_ToOriginal
 Coordinate Transformation that goes from this workspace's coordinates to the original workspace coordinates.
 
Kernel::DblMatrix m_Wtransf
 the matrix which transforms momentums from orthogonal Q-system to Orthogonal HKL or non-orthogonal HKL system alighned WRT to arbitrary coordinate system requested See the UB matrix formalizm, pg 7 for further details on implementation.
 

Private Member Functions

MDEventWorkspacedoClone () const override
 Virtual clone method. Not implemented to force implementation in children.
 
MDEventWorkspacedoCloneEmpty () const override
 Virtual cloneEmpty method.
 

Private Attributes

Kernel::SpecialCoordinateSystem m_coordSystem
 

Detailed Description

template<typename MDE, size_t nd>
class Mantid::DataObjects::MDEventWorkspace< MDE, nd >

Templated class for the multi-dimensional event workspace.

Template Parameters
MDE:: the type of MDEvent in the workspace. This can be, e.g. MDLeanEvent<nd> or MDEvent<nd>
nd:: the number of dimensions that each MDEvent will be tracking. an usigned int > 0. nd must match the number of dimensions in the MDE type!
Author
Janik Zikovsky, SNS
Date
Dec 3, 2010

Definition at line 37 of file MDEventWorkspace.h.

Member Typedef Documentation

◆ MDEventType

template<typename MDE , size_t nd>
using Mantid::DataObjects::MDEventWorkspace< MDE, nd >::MDEventType = MDE

Typedef to access the MDEventType.

Definition at line 43 of file MDEventWorkspace.h.

◆ sptr

template<typename MDE , size_t nd>
using Mantid::DataObjects::MDEventWorkspace< MDE, nd >::sptr = std::shared_ptr<MDEventWorkspace<MDE, nd> >

Typedef for a shared pointer of this kind of event workspace.

Definition at line 41 of file MDEventWorkspace.h.

Constructor & Destructor Documentation

◆ MDEventWorkspace() [1/2]

template<typename MDE , size_t nd>
Mantid::DataObjects::MDEventWorkspace< MDE, nd >::MDEventWorkspace ( Mantid::API::MDNormalization  preferredNormalization = Mantid::API::MDNormalization::VolumeNormalization,
Mantid::API::MDNormalization  preferredNormalizationHisto = Mantid::API::MDNormalization::VolumeNormalization 
)

Constructor.

Definition at line 52 of file MDEventWorkspace.hxx.

◆ ~MDEventWorkspace()

template<typename MDE , size_t nd>
virtual Mantid::DataObjects::MDEventWorkspace< MDE, nd >::~MDEventWorkspace ( )
overridevirtualdefault

◆ MDEventWorkspace() [2/2]

template<typename MDE , size_t nd>
Mantid::DataObjects::MDEventWorkspace< MDE, nd >::MDEventWorkspace ( const MDEventWorkspace< MDE, nd > &  other)
protected

Protected copy constructor. May be used by childs for cloning.

Copy constructor.

Definition at line 64 of file MDEventWorkspace.hxx.

Member Function Documentation

◆ addEvent()

template<typename MDE , size_t nd>
size_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::addEvent ( const MDE &  event)

Add a single event to this workspace.

Automatic splitting is not performed after adding (call splitAllIfNeeded).

Parameters
event:: event to add.

Definition at line 537 of file MDEventWorkspace.hxx.

Referenced by Mantid::MDAlgorithms::MDEventWSWrapper::addMDDataND().

◆ addEvents()

template<typename MDE , size_t nd>
size_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::addEvents ( const std::vector< MDE > &  events)

Add a vector of MDEvents to the workspace.

Parameters
events:: const ref. to a vector of events; they will be copied into the MDBox'es contained within.

Definition at line 546 of file MDEventWorkspace.hxx.

◆ clearFileBacked()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::clearFileBacked ( bool  LoadFileBackedData)
overridevirtual

if workspace was file-backed, this should clear file-backed information and close back-up files.

If the workspace was filebacked, this would clear file-backed information from the workspace nodes and close the files responsible for file backing.

Parameters
LoadFileBackedData– if true, load all data initially backed to hdd when breaking connection between the file and the workspace. if false, data on hdd are lost if not previously loaded in memory and the workspace is generally corrupted (used in destructor)

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 100 of file MDEventWorkspace.hxx.

◆ clearMDMasking()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::clearMDMasking ( )
overridevirtual

Clear masking.

Clears ALL existing masks off the workspace.

Implements Mantid::API::IMDWorkspace.

Definition at line 802 of file MDEventWorkspace.hxx.

References Mantid::API::IMDNode::unmask().

◆ clone()

template<typename MDE , size_t nd>
std::unique_ptr< MDEventWorkspace > Mantid::DataObjects::MDEventWorkspace< MDE, nd >::clone ( ) const
inline

Returns a clone of the workspace.

Definition at line 52 of file MDEventWorkspace.h.

Referenced by Mantid::MDAlgorithms::CloneMDWorkspace::doClone().

◆ cloneEmpty()

template<typename MDE , size_t nd>
std::unique_ptr< MDEventWorkspace > Mantid::DataObjects::MDEventWorkspace< MDE, nd >::cloneEmpty ( ) const
inline

Returns a default-initialized clone of the workspace.

Definition at line 55 of file MDEventWorkspace.h.

◆ createIterators()

template<typename MDE , size_t nd>
std::vector< std::unique_ptr< Mantid::API::IMDIterator > > Mantid::DataObjects::MDEventWorkspace< MDE, nd >::createIterators ( size_t  suggestedNumCores = 1,
Mantid::Geometry::MDImplicitFunction function = nullptr 
) const
overridevirtual

Creates a new iterator pointing to the first cell (box) in the workspace.

Parameters
suggestedNumCores:: split iterator over this many cores.
function:: Optional MDImplicitFunction limiting the iterator

Implements Mantid::API::IMDWorkspace.

Definition at line 228 of file MDEventWorkspace.hxx.

References Mantid::Kernel::threadSafe().

◆ displayNormalization()

template<typename MDE , size_t nd>
API::MDNormalization Mantid::DataObjects::MDEventWorkspace< MDE, nd >::displayNormalization ( ) const
overridevirtual

Return the preferred normalization to use for visualization.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 859 of file MDEventWorkspace.hxx.

Referenced by Mantid::MDAlgorithms::SliceMD::slice().

◆ displayNormalizationHisto()

template<typename MDE , size_t nd>
API::MDNormalization Mantid::DataObjects::MDEventWorkspace< MDE, nd >::displayNormalizationHisto ( ) const
overridevirtual

Return the preferred normalization preference for subsequent histoworkspaces.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 846 of file MDEventWorkspace.hxx.

Referenced by Mantid::MDAlgorithms::SliceMD::slice().

◆ doClone()

template<typename MDE , size_t nd>
MDEventWorkspace * Mantid::DataObjects::MDEventWorkspace< MDE, nd >::doClone ( ) const
inlineoverrideprivatevirtual

Virtual clone method. Not implemented to force implementation in children.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 212 of file MDEventWorkspace.h.

◆ doCloneEmpty()

template<typename MDE , size_t nd>
MDEventWorkspace * Mantid::DataObjects::MDEventWorkspace< MDE, nd >::doCloneEmpty ( ) const
inlineoverrideprivatevirtual

Virtual cloneEmpty method.

Not implemented to force implementation in children.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 214 of file MDEventWorkspace.h.

◆ estimateResolution()

template<typename MDE , size_t nd>
std::vector< coord_t > Mantid::DataObjects::MDEventWorkspace< MDE, nd >::estimateResolution ( ) const
overridevirtual
Returns
a vector with the size of the smallest bin in each dimension

Reimplemented from Mantid::API::MDGeometry.

Definition at line 197 of file MDEventWorkspace.hxx.

References Mantid::Geometry::d.

◆ getBoundariesInDimension()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::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
protected

Insert box bisects in position-along-line coords in a single dimension.

Insert positions-along-the-line that lie halfway between points where the line crosses box boundaries in a single dimension of the workspace into ordered set.

Parameters
start:: coords of the start of the line
dir:: vector of the direction of the line
num_boundaries:: maximum number of boundary crossings possible if all boxes are the size of the smallest box
length:: the length of the line
dir_current_dim:: component of the line direction in this dimension
box_size:: the minimum box size in this dimension
mid_points:: ordered set of halfway points between box crossings

Definition at line 672 of file MDEventWorkspace.hxx.

◆ getBox() [1/2]

template<typename MDE , size_t nd>
MDBoxBase< MDE, nd > * Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getBox ( )
inline

◆ getBox() [2/2]

template<typename MDE , size_t nd>
const MDBoxBase< MDE, nd > * Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getBox ( ) const
inline
Returns
a pointer to the box (MDBox or MDGridBox) contained within, const version.

Definition at line 156 of file MDEventWorkspace.h.

◆ getBoxBoundaryBisectsOnLine()

template<typename MDE , size_t nd>
std::set< coord_t > Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getBoxBoundaryBisectsOnLine ( const Kernel::VMD start,
const Kernel::VMD end,
const size_t  num_d,
const Kernel::VMD dir,
const coord_t  length 
) const

Get ordered list of positions-along-the-line that lie halfway between points where the line crosses box boundaries.

Parameters
start:: coords of the start of the line
end:: coords of the end of the line
num_d:: number of dimensions
dir:: vector of the direction of the line
length:: the length of the line
Returns
:: ordered set of halfway points between box crossings

Definition at line 626 of file MDEventWorkspace.hxx.

References Mantid::Geometry::d.

◆ getBoxController() [1/2]

template<typename MDE , size_t nd>
Mantid::API::BoxController_const_sptr Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getBoxController ( ) const
inlineoverridevirtual

Returns the BoxController used in this workspace.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 111 of file MDEventWorkspace.h.

◆ getBoxController() [2/2]

template<typename MDE , size_t nd>
Mantid::API::BoxController_sptr Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getBoxController ( )
inlineoverridevirtual

◆ getBoxControllerStats()

template<typename MDE , size_t nd>
std::vector< std::string > Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getBoxControllerStats ( ) const
overridevirtual

Returns some information about the box controller, to be displayed in the GUI, for example.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 386 of file MDEventWorkspace.hxx.

◆ getBoxes()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getBoxes ( std::vector< API::IMDNode * > &  boxes,
size_t  maxDepth,
bool  leafOnly 
)
inlineoverridevirtual

Implements Mantid::API::IMDEventWorkspace.

Definition at line 138 of file MDEventWorkspace.h.

◆ getEventTypeName()

template<typename MDE , size_t nd>
std::string Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getEventTypeName ( ) const
overridevirtual

Get the data type (id) of the events in the workspace.

Returns
a string, either "MDEvent" or "MDLeanEvent"

Implements Mantid::API::IMDEventWorkspace.

Definition at line 141 of file MDEventWorkspace.hxx.

◆ getLinePlot()

template<typename MDE , size_t nd>
API::IMDWorkspace::LinePlot Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getLinePlot ( const Mantid::Kernel::VMD start,
const Mantid::Kernel::VMD end,
API::MDNormalization  normalize 
) const
overridevirtual

Obtain coordinates for a line plot through a MDWorkspace.

Cross the workspace from start to end points, recording the signal along the line halfway between each bin boundary that the line crosses

Parameters
start:: coordinates of the start point of the line
end:: coordinates of the end point of the line
normalize:: how to normalize the signal

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 729 of file MDEventWorkspace.hxx.

References Mantid::Kernel::normalize().

◆ getMemorySize()

template<typename MDE , size_t nd>
size_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getMemorySize ( ) const
overridevirtual
Returns
the number of bytes of memory used by the workspace.

Implements Mantid::API::Workspace.

Definition at line 514 of file MDEventWorkspace.hxx.

◆ getMinimumExtents()

template<typename MDE , size_t nd>
std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getMinimumExtents ( size_t  depth = 2) const
overridevirtual

Get a vector of the minimum extents that still contain all the events in the workspace.

Parameters
depth:: recursion depth to which to search. This will determine the resolution to which the extents will be found.
Returns
a vector of the minimum extents that still contain all the events in the workspace. If the workspace is empty, then this will be the size of the overall workspace

Implements Mantid::API::IMDEventWorkspace.

Definition at line 359 of file MDEventWorkspace.hxx.

References Mantid::Geometry::d, Mantid::Geometry::MDDimensionExtents< T >::expand(), Mantid::API::IMDNode::getExtents(), and Mantid::API::IMDNode::getNPoints().

◆ getNEvents()

template<typename MDE , size_t nd>
uint64_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getNEvents ( ) const
inlineoverridevirtual

Implements Mantid::API::IMDWorkspace.

Definition at line 70 of file MDEventWorkspace.h.

Referenced by Mantid::MDAlgorithms::SliceMD::slice().

◆ getNormalizedError()

template<typename MDE , size_t nd>
signal_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getNormalizedError ( const API::IMDNode box,
const Mantid::API::MDNormalization normalization 
) const

◆ getNormalizedSignal()

template<typename MDE , size_t nd>
signal_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getNormalizedSignal ( const API::IMDNode box,
const Mantid::API::MDNormalization normalization 
) const

◆ getNPoints()

template<typename MDE , size_t nd>
uint64_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getNPoints ( ) const
overridevirtual

Returns the total number of points (events) in this workspace.

Returns
the total number of points (events) in this workspace

Implements Mantid::API::IMDWorkspace.

Definition at line 149 of file MDEventWorkspace.hxx.

Referenced by Mantid::MDAlgorithms::LoadMD::doLoad(), Mantid::MDAlgorithms::MinusMD::doMinus(), and Mantid::MDAlgorithms::MergeMD::doPlus().

◆ getNumDims()

template<typename MDE , size_t nd>
size_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getNumDims ( ) const
overridevirtual

Returns the number of dimensions in this workspace.

Returns
the number of dimensions in this workspace

Reimplemented from Mantid::API::MDGeometry.

Definition at line 145 of file MDEventWorkspace.hxx.

Referenced by Mantid::MDAlgorithms::DgsScatteredTransmissionCorrectionMD::correctForTransmission().

◆ getSignalAtCoord()

template<typename MDE , size_t nd>
signal_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getSignalAtCoord ( const coord_t coords,
const Mantid::API::MDNormalization normalization 
) const
overridevirtual

Returns the (normalized) signal at a given coordinates.

Parameters
coords:: nd-sized array of coordinates
normalization:: how to normalize the signal.
Returns
the normalized signal of the box at the given coordinates. NaN if out of bounds

Implements Mantid::API::IMDWorkspace.

Definition at line 268 of file MDEventWorkspace.hxx.

◆ getSignalWithMaskAtCoord()

template<typename MDE , size_t nd>
signal_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getSignalWithMaskAtCoord ( const coord_t coords,
const Mantid::API::MDNormalization normalization 
) const
overridevirtual

Returns the (normalized) signal at a given coordinates.

Get the signal at a particular coordinate in the workspace or return 0 if masked.

Parameters
coords:: numDimensions-sized array of the coordinates to look at
normalization: Normalisation to use.
Returns
the (normalized) signal at a given coordinates. NaN if outside the range of this workspace

Implements Mantid::API::IMDWorkspace.

Definition at line 332 of file MDEventWorkspace.hxx.

◆ getSpecialCoordinateSystem()

template<typename MDE , size_t nd>
Kernel::SpecialCoordinateSystem Mantid::DataObjects::MDEventWorkspace< MDE, nd >::getSpecialCoordinateSystem ( ) const
overridevirtual

Get the coordinate system.

Get the coordinate system (if any) to use.

Returns
An enumeration specifying the coordinate system if any.

Implements Mantid::API::IMDWorkspace.

Definition at line 815 of file MDEventWorkspace.hxx.

Referenced by Mantid::MDAlgorithms::CentroidPeaksMD2::integrate(), Mantid::MDAlgorithms::IntegratePeaksMD::integrate(), Mantid::MDAlgorithms::IntegratePeaksMD2::integrate(), and Mantid::MDAlgorithms::SliceMD::slice().

◆ id()

template<typename MDE , size_t nd>
const std::string Mantid::DataObjects::MDEventWorkspace< MDE, nd >::id ( ) const
overridevirtual

Get the data type (id) of the workspace.

Implements Mantid::Kernel::DataItem.

Definition at line 131 of file MDEventWorkspace.hxx.

Referenced by Mantid::MDAlgorithms::FindPeaksMD::findPeaks().

◆ initialize()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::initialize ( )
overridevirtual

Perform initialization after dimensions (and others) have been set.

Perform initialization after m_dimensions (and others) have been set.

This sets the size of the box.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 110 of file MDEventWorkspace.hxx.

References Mantid::Geometry::d.

Referenced by Mantid::MDAlgorithms::SliceMD::slice().

◆ isFileBacked()

template<typename MDE , size_t nd>
bool Mantid::DataObjects::MDEventWorkspace< MDE, nd >::isFileBacked ( ) const
inlineoverridevirtual

◆ isGridBox()

template<typename MDE , size_t nd>
bool Mantid::DataObjects::MDEventWorkspace< MDE, nd >::isGridBox ( )
inline

Return true if the underlying box is a MDGridBox.

Definition at line 149 of file MDEventWorkspace.h.

◆ isInBounds()

template<typename MDE , size_t nd>
bool Mantid::DataObjects::MDEventWorkspace< MDE, nd >::isInBounds ( const coord_t coords) const

Definition at line 314 of file MDEventWorkspace.hxx.

References Mantid::Geometry::d, and Mantid::Geometry::x.

◆ makeBoxTable()

template<typename MDE , size_t nd>
Mantid::API::ITableWorkspace_sptr Mantid::DataObjects::MDEventWorkspace< MDE, nd >::makeBoxTable ( size_t  start,
size_t  num 
)
overridevirtual

◆ operator=()

template<typename MDE , size_t nd>
MDEventWorkspace< MDE, nd > & Mantid::DataObjects::MDEventWorkspace< MDE, nd >::operator= ( const MDEventWorkspace< MDE, nd > &  other)
delete

◆ refreshCache()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::refreshCache ( )
overridevirtual

◆ setBox()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setBox ( API::IMDNode box)
inlineoverridevirtual

Set the base-level box contained within.

Used in file loading

Implements Mantid::API::IMDEventWorkspace.

Definition at line 160 of file MDEventWorkspace.h.

Referenced by Mantid::MDAlgorithms::LoadMD::doLoad().

◆ setCoordinateSystem()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setCoordinateSystem ( const Kernel::SpecialCoordinateSystem  coordSystem)
overridevirtual

Set the coordinate system.

Set the coordinate system (if any) to use.

Parameters
coordSystem: Coordinate system to use.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 830 of file MDEventWorkspace.hxx.

Referenced by Mantid::MDAlgorithms::LoadMD::doLoad(), and Mantid::MDAlgorithms::SliceMD::slice().

◆ setDisplayNormalization()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setDisplayNormalization ( Mantid::API::MDNormalization  preferredNormalization)
overridevirtual

Preferred visual normalization method.

Set the display normalization.

Parameters
preferredNormalization: Display normalization preference.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 852 of file MDEventWorkspace.hxx.

◆ setDisplayNormalizationHisto()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setDisplayNormalizationHisto ( Mantid::API::MDNormalization  preferredNormalizationHisto)
overridevirtual

Preferred visual normalizaiton method for any histo workspaces created from this.

Set the display normalization for any subsequently generated histoworkspaces.

Parameters
preferredNormalizationHisto: Display normalization preference to pass on to generated histo workspaces.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 838 of file MDEventWorkspace.hxx.

◆ setFileBacked() [1/2]

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setFileBacked ( )
overridevirtual

set filebacked on the contained box

Implements Mantid::API::IMDEventWorkspace.

Definition at line 90 of file MDEventWorkspace.hxx.

◆ setFileBacked() [2/2]

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setFileBacked ( const std::string &  fileName)
virtual

make the workspace file backed if it has not been already file backed;

Make workspace file backed if it has not been already file backed.

Parameters
fileName– short or full file name of the file, which should be used as the file back end

Definition at line 84 of file MDEventWorkspace.hxx.

◆ setMDMasking()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setMDMasking ( std::unique_ptr< Mantid::Geometry::MDImplicitFunction maskingRegion)
overridevirtual

Apply masking.

Setter for the masking region.

Parameters
maskingRegion: Implicit function defining mask region.

Implements Mantid::API::IMDWorkspace.

Definition at line 785 of file MDEventWorkspace.hxx.

References Mantid::API::IMDNode::clear(), Mantid::API::IMDNode::clearFileBacked(), and Mantid::API::IMDNode::mask().

◆ setMinRecursionDepth()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setMinRecursionDepth ( size_t  minDepth)
overridevirtual

Recurse box structure down to a minimum depth.

This will split all boxes so that all MDBoxes are at the depth indicated. 0 = no splitting, 1 = one level of splitting, etc.

WARNING! This should ONLY be called before adding any events to a workspace.

WARNING! Be careful using this since it can quickly create a huge number of boxes = (SplitInto ^ (MinRercursionDepth * NumDimensions))

Parameters
minDepth:: minimum recursion depth.
Exceptions
std::runtime_errorif there is not enough memory for the boxes.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 165 of file MDEventWorkspace.hxx.

References Mantid::Kernel::MemoryStats::availMem(), Mantid::DataObjects::MDGridBox::getNumChildren(), and Mantid::DataObjects::MDGridBox::splitContents().

Referenced by Mantid::MDAlgorithms::CreateMDWorkspace::finish().

◆ sizeofEvent()

template<typename MDE , size_t nd>
size_t Mantid::DataObjects::MDEventWorkspace< MDE, nd >::sizeofEvent ( ) const
inlineoverridevirtual

return the size (in bytes) of an event, this workspace contains

Implements Mantid::API::IMDEventWorkspace.

Definition at line 130 of file MDEventWorkspace.h.

◆ splitAllIfNeeded()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::splitAllIfNeeded ( Kernel::ThreadScheduler ts)
overridevirtual

Goes through all the sub-boxes and splits them if they contain enough events to be worth it.

Parameters
ts:: optional ThreadScheduler * that will be used to parallelize recursive splitting. Set to NULL to do it serially.

Implements Mantid::API::IMDEventWorkspace.

Definition at line 575 of file MDEventWorkspace.hxx.

Referenced by Mantid::DataObjects::FakeMD::addFakeEllipsoid(), Mantid::DataObjects::FakeMD::addFakePeak(), Mantid::DataObjects::FakeMD::addFakeUniformData(), Mantid::MDAlgorithms::MinusMD::doMinus(), Mantid::MDAlgorithms::MergeMD::doPlus(), and Mantid::MDAlgorithms::SliceMD::slice().

◆ splitBox()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::splitBox ( )
overridevirtual

◆ splitTrackedBoxes()

template<typename MDE , size_t nd>
void Mantid::DataObjects::MDEventWorkspace< MDE, nd >::splitTrackedBoxes ( Kernel::ThreadScheduler ts)

Goes through the MDBoxes that were tracked by the BoxController as being too large, and splits them.

Parameters
ts:: optional ThreadScheduler * that will be used to parallelize recursive splitting.

Definition at line 583 of file MDEventWorkspace.hxx.

References UNUSED_ARG.

Member Data Documentation

◆ data

template<typename MDE , size_t nd>
std::unique_ptr<MDBoxBase<MDE, nd> > Mantid::DataObjects::MDEventWorkspace< MDE, nd >::data
protected

MDBox containing all of the events in the workspace.

Definition at line 203 of file MDEventWorkspace.h.

◆ m_BoxController

template<typename MDE , size_t nd>
API::BoxController_sptr Mantid::DataObjects::MDEventWorkspace< MDE, nd >::m_BoxController
protected

Box controller in use.

Definition at line 200 of file MDEventWorkspace.h.

◆ m_coordSystem

template<typename MDE , size_t nd>
Kernel::SpecialCoordinateSystem Mantid::DataObjects::MDEventWorkspace< MDE, nd >::m_coordSystem
private

Definition at line 216 of file MDEventWorkspace.h.

◆ m_displayNormalization

template<typename MDE , size_t nd>
Mantid::API::MDNormalization Mantid::DataObjects::MDEventWorkspace< MDE, nd >::m_displayNormalization
protected

Display normalization for the event workspace itself.

Definition at line 207 of file MDEventWorkspace.h.

◆ m_displayNormalizationHisto

template<typename MDE , size_t nd>
Mantid::API::MDNormalization Mantid::DataObjects::MDEventWorkspace< MDE, nd >::m_displayNormalizationHisto
protected

Display normalization to pass onto generated histo workspaces.

Definition at line 209 of file MDEventWorkspace.h.


The documentation for this class was generated from the following files: