Mantid
Loading...
Searching...
No Matches
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | Private Attributes | List of all members
Mantid::DataObjects::MDHistoWorkspace Class Reference

MDHistoWorkspace: More...

#include <MDHistoWorkspace.h>

Inheritance diagram for Mantid::DataObjects::MDHistoWorkspace:
Mantid::API::IMDHistoWorkspace Mantid::API::IMDWorkspace Mantid::API::MultipleExperimentInfos Mantid::API::Workspace Mantid::API::MDGeometry Mantid::Kernel::DataItem

Public Member Functions

void add (const MDHistoWorkspace &b)
 Perform the += operation, element-by-element, for two MDHistoWorkspace's. More...
 
void add (const signal_t signal, const signal_t error)
 Perform the += operation with a scalar as the RHS argument. More...
 
void applyImplicitFunction (Mantid::Geometry::MDImplicitFunction *function, signal_t signal, signal_t errorSquared)
 Apply an implicit function to each point; if false, set to the given value. More...
 
void cacheValues ()
 When all dimensions have been initialized, this caches all the necessary values for later use. More...
 
void checkWorkspaceSize (const MDHistoWorkspace &other, const std::string &operation)
 Check if the two workspace's sizes match (for comparison or element-by-element operation. More...
 
void clearMDMasking () override
 Clear masking. More...
 
std::unique_ptr< MDHistoWorkspaceclone () const
 Returns a clone of the workspace. More...
 
std::unique_ptr< MDHistoWorkspacecloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
std::vector< std::unique_ptr< Mantid::API::IMDIterator > > createIterators (size_t suggestedNumCores=1, Mantid::Geometry::MDImplicitFunction *function=nullptr) const override
 Create IMDIterators from this MDHistoWorkspace. More...
 
Mantid::API::MDNormalization displayNormalization () const override
 Preferred visual normalization method. More...
 
Mantid::API::MDNormalization displayNormalizationHisto () const override
 Preferred visual normalization method. More...
 
void divide (const MDHistoWorkspace &b_ws)
 Perform the /= operation, element-by-element, for two MDHistoWorkspace's. More...
 
void divide (const signal_t signal, const signal_t error)
 Perform the /= operation with a scalar as the RHS argument. More...
 
void equalTo (const MDHistoWorkspace &b, const signal_t tolerance=1e-5)
 Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is == b[i]. More...
 
void equalTo (const signal_t signal, const signal_t tolerance=1e-5)
 Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is == signal. More...
 
signal_terrorSquaredAt (size_t index) override
 
void exp ()
 Perform the exp() function on each signal in the workspace. More...
 
const coord_tgetBinWidths () const
 Return the aray of bin withs (the linear length of a box) for each dimension. More...
 
Kernel::VMD getCenter (size_t linearIndex) const override
 Return the position of the center of a bin at a given position. More...
 
signal_t getErrorAt (size_t index) const override
 Get the error of the signal at the specified index. More...
 
signal_t getErrorAt (size_t index1, size_t index2) const override
 Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t) More...
 
signal_t getErrorAt (size_t index1, size_t index2, size_t index3) const override
 Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t) More...
 
signal_t getErrorAt (size_t index1, size_t index2, size_t index3, size_t index4) const override
 Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t) More...
 
virtual std::vector< signal_tgetErrorDataVector () const
 
signal_t getErrorNormalizedAt (size_t index) const override
 Get the error of the signal at the specified index, normalized by cell volume. More...
 
signal_t getErrorNormalizedAt (size_t index1, size_t index2) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume. More...
 
signal_t getErrorNormalizedAt (size_t index1, size_t index2, size_t index3) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume. More...
 
signal_t getErrorNormalizedAt (size_t index1, size_t index2, size_t index3, size_t index4) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume. More...
 
const signal_tgetErrorSquaredArray () const override
 
const size_t * getIndexMultiplier () const
 
coord_t getInverseVolume () const override
 
bool getIsMaskedAt (size_t index) const
 Getter for the masking at a specified linear index. More...
 
size_t getLinearIndex (size_t *index) const
 Get the linear index into the array. More...
 
size_t getLinearIndex (size_t index1, size_t index2) const override
 
size_t getLinearIndex (size_t index1, size_t index2, size_t index3) const override
 
size_t getLinearIndex (size_t index1, size_t index2, size_t index3, size_t index4) const override
 
size_t getLinearIndexAtCoord (const coord_t *coords) const
 Get the linear index into the histo array at these coordinates. More...
 
LinePlot getLineData (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const override
 Obtain coordinates for a line plot through a MDWorkspace. More...
 
LinePlot getLinePlot (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const override
 Obtain coordinates for a line plot through a MDWorkspace. More...
 
const bool * getMaskArray () const
 
size_t getMemorySize () const override
 Return the memory used, in bytes. More...
 
uint64_t getNEvents () const override
 get number of contributed events More...
 
uint64_t getNPoints () const override
 Get the number of points (bins in this case) associated with the workspace;. More...
 
const signal_tgetNumEventsArray () const override
 
signal_t getNumEventsAt (size_t index) const
 Returns the number of contributing events from the bin at the specified index. More...
 
const signal_tgetSignalArray () const override
 
signal_t getSignalAt (size_t index) const override
 Get the signal at the specified index. More...
 
signal_t getSignalAt (size_t index1, size_t index2) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) More...
 
signal_t getSignalAt (size_t index1, size_t index2, size_t index3) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) More...
 
signal_t getSignalAt (size_t index1, size_t index2, size_t index3, size_t index4) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t) More...
 
signal_t getSignalAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
 Returns the (normalized) signal at a given coordinates. More...
 
virtual std::vector< signal_tgetSignalDataVector () const
 Return a vector containing a copy of the signal data in the workspace. More...
 
signal_t getSignalNormalizedAt (size_t index) const override
 Get the signal at the specified index, normalized by cell volume. More...
 
signal_t getSignalNormalizedAt (size_t index1, size_t index2) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume. More...
 
signal_t getSignalNormalizedAt (size_t index1, size_t index2, size_t index3) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume. More...
 
signal_t getSignalNormalizedAt (size_t index1, size_t index2, size_t index3, size_t index4) const override
 Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume. More...
 
signal_t getSignalWithMaskAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const override
 Returns the (normalized) signal at a given coordinates. More...
 
Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem () const override
 Get the special coordinate system. More...
 
std::unique_ptr< coord_t[]> getVertexesArray (size_t linearIndex, size_t &numVertices) const
 For the volume at the given linear index, Return the vertices of every corner of the box, as a bare array of length numVertices * nd. More...
 
void greaterThan (const MDHistoWorkspace &b)
 Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is > b[i]. More...
 
void greaterThan (const signal_t signal)
 Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is > signal. More...
 
const std::string id () const override
 A string ID for the class. More...
 
void init (std::vector< Mantid::Geometry::IMDDimension_sptr > &dimensions)
 Constructor helper method. More...
 
void init (std::vector< Mantid::Geometry::MDHistoDimension_sptr > &dimensions)
 Constructor helper method. More...
 
bool isMDHistoWorkspace () const override
 Return if this workspace is a MDHistoWorkspace. Will always return true. More...
 
void lessThan (const MDHistoWorkspace &b)
 Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is < b[i]. More...
 
void lessThan (const signal_t signal)
 Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is < signal. More...
 
void log (double filler=0.0)
 Perform the natural logarithm on each signal in the workspace. More...
 
void log10 (double filler=0.0)
 Perform the base-10 logarithm on each signal in the workspace. More...
 
 MDHistoWorkspace (Mantid::Geometry::MDHistoDimension_sptr dimX, Mantid::Geometry::MDHistoDimension_sptr dimY=Mantid::Geometry::MDHistoDimension_sptr(), Mantid::Geometry::MDHistoDimension_sptr dimZ=Mantid::Geometry::MDHistoDimension_sptr(), Mantid::Geometry::MDHistoDimension_sptr dimT=Mantid::Geometry::MDHistoDimension_sptr(), Mantid::API::MDNormalization displayNormalization=Mantid::API::NoNormalization)
 Constructor given the 4 dimensions. More...
 
 MDHistoWorkspace (std::vector< Mantid::Geometry::IMDDimension_sptr > &dimensions, Mantid::API::MDNormalization displayNormalization=Mantid::API::NoNormalization)
 Constructor given a vector of dimensions. More...
 
 MDHistoWorkspace (std::vector< Mantid::Geometry::MDHistoDimension_sptr > &dimensions, Mantid::API::MDNormalization displayNormalization=Mantid::API::NoNormalization)
 Constructor given a vector of dimensions. More...
 
void multiply (const MDHistoWorkspace &b_ws)
 Perform the *= operation, element-by-element, for two MDHistoWorkspace's. More...
 
void multiply (const signal_t signal, const signal_t error)
 Perform the *= operation with a scalar as the RHS argument. More...
 
signal_tmutableErrorSquaredArray () override
 
bool * mutableMaskArray ()
 
signal_tmutableNumEventsArray () override
 
signal_tmutableSignalArray () override
 
MDHistoWorkspaceoperator&= (const MDHistoWorkspace &b)
 
MDHistoWorkspaceoperator*= (const MDHistoWorkspace &b_ws)
 Perform the *= operation, element-by-element, for two MDHistoWorkspace's. More...
 
MDHistoWorkspaceoperator+= (const MDHistoWorkspace &b)
 Perform the += operation, element-by-element, for two MDHistoWorkspace's. More...
 
MDHistoWorkspaceoperator-= (const MDHistoWorkspace &b)
 Perform the -= operation, element-by-element, for two MDHistoWorkspace's. More...
 
MDHistoWorkspaceoperator/= (const MDHistoWorkspace &b_ws)
 Perform the /= operation, element-by-element, for two MDHistoWorkspace's. More...
 
MDHistoWorkspaceoperator= (const MDHistoWorkspace &other)=delete
 
signal_toperator[] (const size_t &index) override
 Array subscript operator. More...
 
MDHistoWorkspaceoperator^= (const MDHistoWorkspace &b)
 A boolean ^= (xor) operation, element-by-element, for two MDHistoWorkspace's. More...
 
void operatorNot ()
 A boolean not operation, performed in-place. More...
 
MDHistoWorkspaceoperator|= (const MDHistoWorkspace &b)
 A boolean |= (or) operation, element-by-element, for two MDHistoWorkspace's. More...
 
void power (double exponent)
 Perform the power function (signal^exponent) on each signal S in the workspace. More...
 
void setCoordinateSystem (const Kernel::SpecialCoordinateSystem coordinateSystem) override
 Set the special coordinate system. More...
 
void setDisplayNormalization (const Mantid::API::MDNormalization &preferredNormalization) override
 
void setErrorSquaredAt (size_t index, signal_t value) override
 Sets the error (squared) at the specified index. More...
 
void setMDMaskAt (const size_t &index, bool mask)
 Apply masking. More...
 
void setMDMasking (std::unique_ptr< Mantid::Geometry::MDImplicitFunction > maskingRegion) override
 Apply masking. More...
 
void setNumEventsAt (size_t index, signal_t value)
 Sets the number of contributing events in the bin at the specified index. More...
 
void setSignalAt (size_t index, signal_t value) override
 Sets the signal at the specified index. More...
 
void setTo (signal_t signal, signal_t errorSquared, signal_t numEvents) override
 Sets all signals/errors in the workspace to the given values. More...
 
void setUsingMask (const MDHistoWorkspace &mask, const MDHistoWorkspace &values)
 Copy the values from another workspace onto this workspace, but only where a mask is true (non-zero) More...
 
void setUsingMask (const MDHistoWorkspace &mask, const signal_t signal, const signal_t error)
 Copy the values from another workspace onto this workspace, but only where a mask is true (non-zero) More...
 
signal_tsignalAt (size_t index) override
 
void subtract (const MDHistoWorkspace &b)
 Perform the -= operation, element-by-element, for two MDHistoWorkspace's. More...
 
void subtract (const signal_t signal, const signal_t error)
 Perform the -= operation with a scalar as the RHS argument. More...
 
uint64_t sumNContribEvents () const
 sum the array of contributing events m_numEvents array More...
 
void updateSum ()
 
- Public Member Functions inherited from Mantid::API::IMDHistoWorkspace
IMDHistoWorkspace_uptr clone () const
 Returns a clone of the workspace. More...
 
IMDHistoWorkspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
virtual signal_terrorSquaredAt (size_t index)=0
 
virtual Mantid::Kernel::VMD getCenter (size_t linearIndex) const =0
 
virtual signal_t getErrorAt (size_t index) const =0
 
virtual signal_t getErrorAt (size_t index1, size_t index2) const =0
 
virtual signal_t getErrorAt (size_t index1, size_t index2, size_t index3) const =0
 
virtual signal_t getErrorAt (size_t index1, size_t index2, size_t index3, size_t index4) const =0
 
virtual signal_t getErrorNormalizedAt (size_t index) const =0
 
virtual signal_t getErrorNormalizedAt (size_t index1, size_t index2) const =0
 
virtual signal_t getErrorNormalizedAt (size_t index1, size_t index2, size_t index3) const =0
 
virtual signal_t getErrorNormalizedAt (size_t index1, size_t index2, size_t index3, size_t index4) const =0
 
virtual const signal_tgetErrorSquaredArray () const =0
 
virtual coord_t getInverseVolume () const =0
 See the MDHistoWorkspace definition for descriptions of these. More...
 
virtual size_t getLinearIndex (size_t index1, size_t index2) const =0
 
virtual size_t getLinearIndex (size_t index1, size_t index2, size_t index3) const =0
 
virtual size_t getLinearIndex (size_t index1, size_t index2, size_t index3, size_t index4) const =0
 
virtual LinePlot getLineData (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const =0
 
virtual const signal_tgetNumEventsArray () const =0
 
virtual const signal_tgetSignalArray () const =0
 
virtual signal_t getSignalAt (size_t index) const =0
 
virtual signal_t getSignalAt (size_t index1, size_t index2) const =0
 
virtual signal_t getSignalAt (size_t index1, size_t index2, size_t index3) const =0
 
virtual signal_t getSignalAt (size_t index1, size_t index2, size_t index3, size_t index4) const =0
 
virtual signal_t getSignalNormalizedAt (size_t index) const =0
 
virtual signal_t getSignalNormalizedAt (size_t index1, size_t index2) const =0
 
virtual signal_t getSignalNormalizedAt (size_t index1, size_t index2, size_t index3) const =0
 
virtual signal_t getSignalNormalizedAt (size_t index1, size_t index2, size_t index3, size_t index4) const =0
 
virtual bool hasOrientedLattice () const override
 
 IMDHistoWorkspace ()=default
 
virtual signal_tmutableErrorSquaredArray ()=0
 
virtual signal_tmutableNumEventsArray ()=0
 
virtual signal_tmutableSignalArray ()=0
 
IMDHistoWorkspaceoperator= (const IMDHistoWorkspace &)=delete
 
virtual double & operator[] (const size_t &index)=0
 
virtual void setCoordinateSystem (const Kernel::SpecialCoordinateSystem coordinateSystem)=0
 
virtual void setDisplayNormalization (const Mantid::API::MDNormalization &preferredNormalization)=0
 
virtual void setErrorSquaredAt (size_t index, signal_t value)=0
 
virtual void setSignalAt (size_t index, signal_t value)=0
 
virtual void setTo (signal_t signal, signal_t errorSquared, signal_t numEvents)=0
 
virtual signal_tsignalAt (size_t index)=0
 
- Public Member Functions inherited from Mantid::API::IMDWorkspace
std::string changeQConvention ()
 
virtual void clearFileBacked (bool)
 if a workspace was filebacked, this should clear file-based status, delete file-based information and close related files. More...
 
virtual void clearMDMasking ()=0
 Clear existing masks. More...
 
std::unique_ptr< IMDWorkspaceclone () const
 Returns a clone of the workspace. More...
 
std::unique_ptr< IMDWorkspacecloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
std::unique_ptr< IMDIteratorcreateIterator (Mantid::Geometry::MDImplicitFunction *function=nullptr) const
 Creates a single iterator and returns it. More...
 
virtual std::vector< std::unique_ptr< IMDIterator > > createIterators (size_t suggestedNumCores=1, Mantid::Geometry::MDImplicitFunction *function=nullptr) const =0
 Creates a new iterator pointing to the first cell in the workspace. More...
 
virtual MDNormalization displayNormalization () const
 
virtual MDNormalization displayNormalizationHisto () const
 
std::string getConvention () const
 
virtual LinePlot getLinePlot (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize) const
 Method to generate a line plot through a MD-workspace. More...
 
virtual uint64_t getNEvents () const =0
 
virtual uint64_t getNPoints () const =0
 Get the number of points associated with the workspace. More...
 
virtual signal_t getSignalAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const =0
 Returns the (normalized) signal at a given coordinates. More...
 
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. More...
 
virtual signal_t getSignalWithMaskAtCoord (const coord_t *coords, const Mantid::API::MDNormalization &normalization) const =0
 Returns the (normalized) signal at a given coordinates or 0 if the value. More...
 
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. More...
 
virtual Kernel::SpecialCoordinateSystem getSpecialCoordinateSystem () const =0
 
virtual bool hasOrientedLattice () const =0
 
 IMDWorkspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 Default constructor. More...
 
virtual bool isMDHistoWorkspace () const
 
virtual ITableWorkspace_sptr makeBoxTable (size_t, size_t)
 this is the method to build table workspace from any workspace. More...
 
IMDWorkspaceoperator= (const IMDWorkspace &other)=delete
 
void setConvention (std::string convention)
 
virtual void setMDMasking (std::unique_ptr< Mantid::Geometry::MDImplicitFunction > maskingRegion)=0
 Setter for the masking region. More...
 
- 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. More...
 
Workspace_uptr cloneEmpty () const
 Returns a default-initialized clone of the workspace. More...
 
const std::string & getComment () const
 Get the workspace comment. More...
 
const WorkspaceHistorygetHistory () const
 Returns a reference to the WorkspaceHistory const. More...
 
virtual size_t getMemorySize () const =0
 Get the footprint in memory in bytes. More...
 
std::string getMemorySizeAsStr () const
 Returns the memory footprint in sensible units. More...
 
const std::string & getName () const override
 Get the workspace name. More...
 
virtual const std::string getTitle () const
 Get the workspace title. More...
 
WorkspaceHistoryhistory ()
 Returns a reference to the WorkspaceHistory. More...
 
bool isDirty (const int n=1) const
 Check whether other algorithms have been applied to the workspace by checking the history length. More...
 
virtual bool isGroup () const
 
Workspaceoperator= (const Workspace &other)=delete
 
void setComment (const std::string &)
 Set the comment field of the workspace. More...
 
virtual void setTitle (const std::string &)
 Set the title of the workspace. More...
 
Parallel::StorageMode storageMode () const
 Returns the storage mode (used for MPI runs) More...
 
bool threadSafe () const override
 Marks the workspace as safe for multiple threads to edit data simutaneously. More...
 
 Workspace (const Parallel::StorageMode storageMode=Parallel::StorageMode::Cloned)
 
 ~Workspace ()
 
- Public Member Functions inherited from Mantid::Kernel::DataItem
 DataItem ()
 Default constructor. More...
 
 DataItem (const DataItem &other)
 Copy constructor Always makes a unique lock. More...
 
virtual ~DataItem ()
 Destructor. More...
 
void readLock ()
 Acquires a read lock. More...
 
void unlock ()
 
- Public Member Functions inherited from Mantid::API::MDGeometry
void addDimension (const std::shared_ptr< Mantid::Geometry::IMDDimension > &dim)
 Add a dimension. More...
 
void addDimension (Mantid::Geometry::IMDDimension *dim)
 Add a dimension. More...
 
bool allBasisNormalized () const
 
void clearOriginalWorkspaces ()
 Clear original workspaces. More...
 
void clearTransforms ()
 Clear transforms. More...
 
virtual std::vector< coord_testimateResolution () const
 
Mantid::Kernel::VMDgetBasisVector (size_t index)
 Get the basis vector (in the original workspace) for a dimension of this workspace. More...
 
const Mantid::Kernel::VMDgetBasisVector (size_t index) const
 Get the basis vector (in the original workspace) for a dimension of this workspace. More...
 
virtual std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimension (size_t index) const
 Get a dimension. More...
 
size_t getDimensionIndexById (const std::string &id) const
 Get the index of the dimension that matches the ID given. More...
 
size_t getDimensionIndexByName (const std::string &name) const
 Get the index of the dimension that matches the name given. More...
 
virtual std::shared_ptr< const Mantid::Geometry::IMDDimensiongetDimensionWithId (std::string id) const
 Get a dimension. More...
 
std::string getGeometryXML () const
 
std::vector< std::shared_ptr< const Geometry::IMDDimension > > getNonIntegratedDimensions () const
 Get non-collapsed dimensions. More...
 
size_t getNumberTransformsFromOriginal () const
 Get the number of transforms defined from the original coordinate system. More...
 
size_t getNumberTransformsToOriginal () const
 Get the number of transforms defined to the original coordinate system. More...
 
virtual size_t getNumDims () const
 
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). More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetTDimension () const
 Get the t-dimension mapping. More...
 
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. More...
 
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. More...
 
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 More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetXDimension () const
 Get the x-dimension mapping. More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetYDimension () const
 Get the y-dimension mapping. More...
 
std::shared_ptr< const Mantid::Geometry::IMDDimensiongetZDimension () const
 Get the z-dimension mapping. More...
 
bool hasOriginalWorkspace (size_t index=0) const
 
void initGeometry (const std::vector< std::shared_ptr< Geometry::IMDDimension > > &dimensions)
 Initialize the geometry. More...
 
 MDGeometry ()
 Constructor. More...
 
 MDGeometry (const MDGeometry &other)
 Copy Constructor. More...
 
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. More...
 
void setOrigin (const Mantid::Kernel::VMD &orig)
 Sets the origin of this geometry. More...
 
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). More...
 
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. More...
 
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. More...
 
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 More...
 
void transformDimensions (std::vector< double > &scaling, std::vector< double > &offset)
 Transform the dimensions contained in this geometry x' = x*scaling + offset. More...
 
virtual ~MDGeometry ()
 Destructor. More...
 
- Public Member Functions inherited from Mantid::API::MultipleExperimentInfos
uint16_t addExperimentInfo (const ExperimentInfo_sptr &ei)
 Add a new ExperimentInfo to this MDEventWorkspace. More...
 
void copyExperimentInfos (const MultipleExperimentInfos &other)
 Copy the experiment infos from another. More...
 
ExperimentInfo_sptr getExperimentInfo (const uint16_t expInfoIndex)
 Get the ExperimentInfo for the given Experiment-Info Index. More...
 
ExperimentInfo_const_sptr getExperimentInfo (const uint16_t expInfoIndex) const
 Get the ExperimentInfo for the given Experiment-Info Index. More...
 
uint16_t getNumExperimentInfo () const
 
bool hasOrientedLattice () const
 
 MultipleExperimentInfos ()=default
 
 MultipleExperimentInfos (const MultipleExperimentInfos &other)
 Copy constructor. More...
 
MultipleExperimentInfosoperator= (const MultipleExperimentInfos &other)
 
void setExperimentInfo (const uint16_t expInfoIndex, ExperimentInfo_sptr ei)
 Replace the ExperimentInfo entry at a given place. More...
 
virtual ~MultipleExperimentInfos ()=default
 

Static Public Member Functions

static size_t sizeOfElement ()
 Get the size of an element in the HistoWorkspace. More...
 

Protected Member Functions

LinePlot getLinePoints (const Mantid::Kernel::VMD &start, const Mantid::Kernel::VMD &end, Mantid::API::MDNormalization normalize, const bool bin_centres) const
 Obtain coordinates for a line plot through a MDWorkspace. More...
 
 MDHistoWorkspace (const MDHistoWorkspace &other)
 Protected copy constructor. May be used by childs for cloning. More...
 
- Protected Member Functions inherited from Mantid::API::IMDHistoWorkspace
 IMDHistoWorkspace (const IMDHistoWorkspace &)=default
 Protected copy constructor. May be used by childs for cloning. More...
 
const std::string toString () const override
 Serializes the object to a string. More...
 
- Protected Member Functions inherited from Mantid::API::IMDWorkspace
 IMDWorkspace (const IMDWorkspace &)=default
 Protected copy constructor. May be used by childs for cloning. More...
 
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. More...
 
const std::string toString () const override
 Serializes the object to a string. More...
 
- Protected Member Functions inherited from Mantid::API::Workspace
void setStorageMode (Parallel::StorageMode mode)
 Sets the storage mode (used for MPI runs) More...
 
 Workspace (const Workspace &)
 Protected copy constructor. May be used by childs for cloning. More...
 
- Protected Member Functions inherited from Mantid::Kernel::DataItem
Poco::RWLock * getLock () const
 Private method to access the RWLock object. More...
 
- Protected Member Functions inherited from Mantid::API::MDGeometry
void deleteNotificationReceived (const std::shared_ptr< const Workspace > &deleted)
 Function called when observer objects recieves a notification. More...
 
- Protected Member Functions inherited from Mantid::API::MultipleExperimentInfos
const std::string toString () const
 Returns a string description of the object. More...
 

Protected Attributes

std::unique_ptr< bool[]> m_masks
 Linear array of masks for each bin. More...
 
- 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. More...
 
std::vector< std::shared_ptr< Geometry::IMDDimension > > m_dimensions
 Vector of the dimensions used, in the order X Y Z t, etc. More...
 
std::unique_ptr< MDGeometryNotificationHelperm_notificationHelper
 Helper that deals with notifications and observing the ADS. More...
 
Mantid::Kernel::VMD m_origin
 Vector of the origin (in the original workspace) that corresponds to 0,0,0... in this workspace. More...
 
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. More...
 
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. More...
 
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. More...
 
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. More...
 

Private Member Functions

MDHistoWorkspacedoClone () const override
 Virtual clone method. Not implemented to force implementation in children. More...
 
MDHistoWorkspacedoCloneEmpty () const override
 Virtual cloneEmpty method. More...
 
std::set< coord_tgetBinBoundariesOnLine (const Kernel::VMD &start, const Kernel::VMD &end, size_t nd, const Kernel::VMD &dir, coord_t length) const
 Get ordered list of boundaries in position-along-the-line coordinates. More...
 
signal_t getNormalizationFactor (const API::MDNormalization &normalize, size_t linearIndex) const
 Find the normalization factor. More...
 
void initVertexesArray ()
 After initialization, call this to initialize the vertexes array to the vertexes of the 0th box. More...
 
void makeSingleBinWithNaN (std::vector< coord_t > &x, std::vector< signal_t > &y, std::vector< signal_t > &e) const
 

Private Attributes

std::vector< size_t > indexMultiplier
 To find the index into the linear array, dim0 + indexMultiplier[0]*dim1 + ... More...
 
std::vector< coord_tm_boxLength
 Vector of the length of the box in each dimension. More...
 
Kernel::SpecialCoordinateSystem m_coordSystem
 
Mantid::API::MDNormalization m_displayNormalization
 Display normalization to use. More...
 
std::vector< signal_tm_errorsSquared
 Linear array of errors for each bin. More...
 
std::vector< size_t > m_indexMaker
 For converting to/from linear index to tdimensions. More...
 
std::vector< size_t > m_indexMax
 Max index into each dimension. More...
 
coord_t m_inverseVolume
 Inverse of the volume of EACH cell. More...
 
size_t m_length
 Length of the m_signals / m_errorsSquared arrays. More...
 
uint64_t m_nEventsContributed
 the number of events, contributed into the workspace; More...
 
std::vector< signal_tm_numEvents
 Number of contributing events for each bin. More...
 
std::vector< coord_tm_origin
 Vector of the origin in each dimension. More...
 
std::vector< signal_tm_signals
 Linear array of signals for each bin. More...
 
std::vector< coord_tm_vertexesArray
 Pre-calculated vertexes array for the 0th box. More...
 
size_t numDimensions
 Number of dimensions in this workspace. More...
 

Detailed Description

MDHistoWorkspace:

An implementation of IMDWorkspace that contains a (normally dense) histogram representation in multiple dimensions.

This will be the result of a slice or rebin of another workspace, e.g. a MDEventWorkspace. Typically it has 3 or 4 dimensions, but there is no real limit to it.

This will be used by Sliceviewer e.g. for visualization.

Author
Janik Zikovsky
Date
2011-03-24 11:21:06.280523

Definition at line 37 of file MDHistoWorkspace.h.

Constructor & Destructor Documentation

◆ MDHistoWorkspace() [1/4]

Constructor given the 4 dimensions.

Parameters
dimX:: X dimension binning parameters
dimY:: Y dimension binning parameters
dimZ:: Z dimension binning parameters
dimT:: T (time) dimension binning parameters
displayNormalization:: optional display normalization to use as the default.

Definition at line 40 of file MDHistoWorkspace.cpp.

References init().

◆ MDHistoWorkspace() [2/4]

Mantid::DataObjects::MDHistoWorkspace::MDHistoWorkspace ( std::vector< Mantid::Geometry::MDHistoDimension_sptr > &  dimensions,
Mantid::API::MDNormalization  displayNormalization = Mantid::API::NoNormalization 
)

Constructor given a vector of dimensions.

Parameters
dimensions:: vector of MDHistoDimension; no limit to how many.
displayNormalization:: optional display normalization to use as the default.

Definition at line 65 of file MDHistoWorkspace.cpp.

References init().

◆ MDHistoWorkspace() [3/4]

Mantid::DataObjects::MDHistoWorkspace::MDHistoWorkspace ( std::vector< Mantid::Geometry::IMDDimension_sptr > &  dimensions,
Mantid::API::MDNormalization  displayNormalization = Mantid::API::NoNormalization 
)

Constructor given a vector of dimensions.

Parameters
dimensions:: vector of MDHistoDimension; no limit to how many.
displayNormalization:: optional display normalization to use as the default.

Definition at line 78 of file MDHistoWorkspace.cpp.

References init().

◆ MDHistoWorkspace() [4/4]

Mantid::DataObjects::MDHistoWorkspace::MDHistoWorkspace ( const MDHistoWorkspace other)
protected

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

Copy constructor.

Parameters
other:: MDHistoWorkspace to copy from.

Definition at line 90 of file MDHistoWorkspace.cpp.

References cacheValues(), m_errorsSquared, m_length, m_masks, m_numEvents, and m_signals.

Member Function Documentation

◆ add() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::add ( const MDHistoWorkspace b)

Perform the += operation, element-by-element, for two MDHistoWorkspace's.

Parameters
b:: workspace on the RHS of the operation

Definition at line 702 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, m_nEventsContributed, m_numEvents, and m_signals.

Referenced by operator+=().

◆ add() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::add ( const signal_t  signal,
const signal_t  error 
)

Perform the += operation with a scalar as the RHS argument.

Parameters
signal:: signal to apply
error:: error (not squared) to apply

Definition at line 718 of file MDHistoWorkspace.cpp.

References error, m_errorsSquared, m_length, and m_signals.

◆ applyImplicitFunction()

void Mantid::DataObjects::MDHistoWorkspace::applyImplicitFunction ( Mantid::Geometry::MDImplicitFunction function,
signal_t  signal,
signal_t  errorSquared 
)

Apply an implicit function to each point; if false, set to the given value.

Parameters
function:: the implicit function to apply
signal:: signal value to set when function evaluates to false
errorSquared:: error value to set when function evaluates to false

Definition at line 249 of file MDHistoWorkspace.cpp.

References indexMultiplier, Mantid::Geometry::MDImplicitFunction::isPointContained(), Mantid::API::MDGeometry::m_dimensions, m_errorsSquared, m_signals, numDimensions, Mantid::Geometry::x, Mantid::Geometry::y, and Mantid::Geometry::z.

◆ cacheValues()

void Mantid::DataObjects::MDHistoWorkspace::cacheValues ( )

When all dimensions have been initialized, this caches all the necessary values for later use.

Definition at line 143 of file MDHistoWorkspace.cpp.

References Mantid::Geometry::d, indexMultiplier, initVertexesArray(), Mantid::API::MDGeometry::m_dimensions, m_inverseVolume, m_length, m_nEventsContributed, and numDimensions.

Referenced by init(), and MDHistoWorkspace().

◆ checkWorkspaceSize()

void Mantid::DataObjects::MDHistoWorkspace::checkWorkspaceSize ( const MDHistoWorkspace other,
const std::string &  operation 
)

Check if the two workspace's sizes match (for comparison or element-by-element operation.

Parameters
other:: the workspace to compare to
operation:: descriptive string (for the error message)
Exceptions
anerror if they don't match

Definition at line 676 of file MDHistoWorkspace.cpp.

Referenced by add(), divide(), equalTo(), greaterThan(), lessThan(), multiply(), operator^=(), operator|=(), setUsingMask(), and subtract().

◆ clearMDMasking()

void Mantid::DataObjects::MDHistoWorkspace::clearMDMasking ( )
overridevirtual

Clear masking.

Clear any existing masking.

Note that this clears the mask flag but does not restore the data which was set to NaN when it was masked.

Implements Mantid::API::IMDWorkspace.

Definition at line 1234 of file MDHistoWorkspace.cpp.

References getNPoints(), and m_masks.

◆ clone()

std::unique_ptr< MDHistoWorkspace > Mantid::DataObjects::MDHistoWorkspace::clone ( ) const
inline

◆ cloneEmpty()

std::unique_ptr< MDHistoWorkspace > Mantid::DataObjects::MDHistoWorkspace::cloneEmpty ( ) const
inline

Returns a default-initialized clone of the workspace.

Definition at line 55 of file MDHistoWorkspace.h.

◆ createIterators()

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

Create IMDIterators from this MDHistoWorkspace.

Parameters
suggestedNumCores:: split the iterators into this many cores (if threadsafe)
function:: implicit function to limit range. NOT owned by this method call.
Returns
MDHistoWorkspaceIterator vector

Implements Mantid::API::IMDWorkspace.

Definition at line 392 of file MDHistoWorkspace.cpp.

References getNPoints(), and Mantid::API::Workspace::threadSafe().

◆ displayNormalization()

MDNormalization Mantid::DataObjects::MDHistoWorkspace::displayNormalization ( ) const
overridevirtual

Preferred visual normalization method.

Preferred normalization to use for visual purposes.

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 1290 of file MDHistoWorkspace.cpp.

References m_displayNormalization.

Referenced by displayNormalizationHisto().

◆ displayNormalizationHisto()

MDNormalization Mantid::DataObjects::MDHistoWorkspace::displayNormalizationHisto ( ) const
overridevirtual

Preferred visual normalization method.

Preferred normalization to use for visual purposes.

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 1297 of file MDHistoWorkspace.cpp.

References displayNormalization().

◆ divide() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::divide ( const MDHistoWorkspace b_ws)

Perform the /= operation, element-by-element, for two MDHistoWorkspace's.

Error propagation of \( f = a / b \) is given by: \( df^2 = f^2 * (da^2 / a^2 + db^2 / b^2) \) Rewritten as: \( df^2 = da^2 / b^2 + db^2 *f^2 / b^2 \) to avoid problems when a or b are 0

Parameters
b_ws:: workspace on the RHS of the operation

Definition at line 858 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, and m_signals.

Referenced by operator/=().

◆ divide() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::divide ( const signal_t  signal,
const signal_t  error 
)

Perform the /= operation with a scalar as the RHS argument.

Error propagation of \( f = a / b \) is given by: \( df^2 = f^2 * (da^2 / a^2 + db^2 / b^2) \) Rewritten as: \( df^2 = da^2 / b^2 + db^2 *f^2 / b^2 \) to avoid problems when a or b are 0

Parameters
signal:: signal to apply
error:: error (not squared) to apply

Definition at line 887 of file MDHistoWorkspace.cpp.

References error, m_errorsSquared, m_length, and m_signals.

◆ doClone()

MDHistoWorkspace * Mantid::DataObjects::MDHistoWorkspace::doClone ( ) const
inlineoverrideprivatevirtual

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

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 390 of file MDHistoWorkspace.h.

◆ doCloneEmpty()

MDHistoWorkspace * Mantid::DataObjects::MDHistoWorkspace::doCloneEmpty ( ) const
inlineoverrideprivatevirtual

Virtual cloneEmpty method.

Not implemented to force implementation in children.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 392 of file MDHistoWorkspace.h.

◆ equalTo() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::equalTo ( const MDHistoWorkspace b,
const signal_t  tolerance = 1e-5 
)

Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is == b[i].

signal[i] -> becomes false (0.0) otherwise Errors are set to 0.

Parameters
b:: workspace on the RHS of the comparison.
tolerance:: accept this deviation from a perfect equality

Definition at line 1117 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), fabs, m_errorsSquared, m_length, m_signals, and tolerance.

◆ equalTo() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::equalTo ( const signal_t  signal,
const signal_t  tolerance = 1e-5 
)

Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is == signal.

signal[i] -> becomes false (0.0) otherwise Errors are set to 0.

Parameters
signal:: signal value on the RHS of the comparison.
tolerance:: accept this deviation from a perfect equality

Definition at line 1135 of file MDHistoWorkspace.cpp.

References fabs, m_errorsSquared, m_length, m_signals, and tolerance.

◆ errorSquaredAt()

signal_t & Mantid::DataObjects::MDHistoWorkspace::errorSquaredAt ( size_t  index)
inlineoverridevirtual
Returns
a reference to the error (squared) at the linear index
Parameters
index:: linear index (see getLinearIndex).

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 299 of file MDHistoWorkspace.h.

References index.

◆ exp()

void Mantid::DataObjects::MDHistoWorkspace::exp ( )

Perform the exp() function on each signal in the workspace.

Error propagation of \( f = exp(a) \) is given by: \( df^2 = f^2 * da^2 \)

Definition at line 949 of file MDHistoWorkspace.cpp.

References m_errorsSquared, m_length, and m_signals.

◆ getBinBoundariesOnLine()

std::set< coord_t > Mantid::DataObjects::MDHistoWorkspace::getBinBoundariesOnLine ( const Kernel::VMD start,
const Kernel::VMD end,
size_t  nd,
const Kernel::VMD dir,
coord_t  length 
) const
private

Get ordered list of boundaries in position-along-the-line coordinates.

Parameters
start:: start of the line
end:: end of the line
nd:: number of dimensions
dir:: vector of the direction
length:: unit-vector of the direction
Returns
:: ordered list of boundaries

Definition at line 627 of file MDHistoWorkspace.cpp.

References Mantid::Geometry::d, Mantid::API::MDGeometry::getDimension(), and Mantid::DataObjects::pointInWorkspace().

Referenced by getLinePoints().

◆ getBinWidths()

const coord_t * Mantid::DataObjects::MDHistoWorkspace::getBinWidths ( ) const
inline

Return the aray of bin withs (the linear length of a box) for each dimension.

Definition at line 149 of file MDHistoWorkspace.h.

◆ getCenter()

Mantid::Kernel::VMD Mantid::DataObjects::MDHistoWorkspace::getCenter ( size_t  linearIndex) const
overridevirtual

Return the position of the center of a bin at a given position.

Parameters
linearIndex:: linear index into the workspace
Returns
VMD vector of the center position

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 312 of file MDHistoWorkspace.cpp.

References Mantid::Geometry::d, Mantid::Kernel::Utils::NestedForLoop::GetIndicesFromLinearIndex(), m_boxLength, m_indexMaker, m_indexMax, m_vertexesArray, and numDimensions.

Referenced by Mantid::DataObjects::MDHistoWorkspaceIterator::getInnerPosition().

◆ getErrorAt() [1/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getErrorAt ( size_t  index) const
inlineoverridevirtual

◆ getErrorAt() [2/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getErrorAt ( size_t  index1,
size_t  index2 
) const
inlineoverridevirtual

Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t)

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 207 of file MDHistoWorkspace.h.

◆ getErrorAt() [3/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getErrorAt ( size_t  index1,
size_t  index2,
size_t  index3 
) const
inlineoverridevirtual

Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t)

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 213 of file MDHistoWorkspace.h.

◆ getErrorAt() [4/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getErrorAt ( size_t  index1,
size_t  index2,
size_t  index3,
size_t  index4 
) const
inlineoverridevirtual

Get the error at the specified index given in 4 dimensions (typically X,Y,Z,t)

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 219 of file MDHistoWorkspace.h.

◆ getErrorDataVector()

std::vector< signal_t > Mantid::DataObjects::MDHistoWorkspace::getErrorDataVector ( ) const
virtual
Returns
a vector containing a copy of the error data in the workspace.

Definition at line 436 of file MDHistoWorkspace.cpp.

References m_errorsSquared, and m_length.

◆ getErrorNormalizedAt() [1/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getErrorNormalizedAt ( size_t  index) const
inlineoverridevirtual

Get the error of the signal at the specified index, normalized by cell volume.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 274 of file MDHistoWorkspace.h.

References index.

◆ getErrorNormalizedAt() [2/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getErrorNormalizedAt ( size_t  index1,
size_t  index2 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 280 of file MDHistoWorkspace.h.

◆ getErrorNormalizedAt() [3/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getErrorNormalizedAt ( size_t  index1,
size_t  index2,
size_t  index3 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 286 of file MDHistoWorkspace.h.

◆ getErrorNormalizedAt() [4/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getErrorNormalizedAt ( size_t  index1,
size_t  index2,
size_t  index3,
size_t  index4 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 292 of file MDHistoWorkspace.h.

◆ getErrorSquaredArray()

const signal_t * Mantid::DataObjects::MDHistoWorkspace::getErrorSquaredArray ( ) const
inlineoverridevirtual
Returns
the direct pointer to the error squared array. For speed

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 137 of file MDHistoWorkspace.h.

◆ getIndexMultiplier()

const size_t * Mantid::DataObjects::MDHistoWorkspace::getIndexMultiplier ( ) const
inline
Returns
a const reference to the indexMultiplier array. To find the index into the linear array, dim0 + indexMultiplier[0]*dim1 + ...

Definition at line 127 of file MDHistoWorkspace.h.

◆ getInverseVolume()

coord_t Mantid::DataObjects::MDHistoWorkspace::getInverseVolume ( ) const
inlineoverridevirtual
Returns
the inverse of volume of EACH cell in the workspace. For normalizing.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 134 of file MDHistoWorkspace.h.

Referenced by Mantid::DataObjects::MDHistoWorkspaceIterator::getNormalizedError(), and Mantid::DataObjects::MDHistoWorkspaceIterator::getNormalizedSignal().

◆ getIsMaskedAt()

bool Mantid::DataObjects::MDHistoWorkspace::getIsMaskedAt ( size_t  index) const
inline

Getter for the masking at a specified linear index.

Definition at line 227 of file MDHistoWorkspace.h.

References index.

Referenced by Mantid::DataObjects::MDHistoWorkspaceIterator::getIsMasked(), getLinePoints(), and getSignalWithMaskAtCoord().

◆ getLinearIndex() [1/4]

size_t Mantid::DataObjects::MDHistoWorkspace::getLinearIndex ( size_t *  index) const
inline

Get the linear index into the array.

Parameters
index:: array of indexes, length = number of dimensions
Returns
linear index into m_signals

Definition at line 338 of file MDHistoWorkspace.h.

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

◆ getLinearIndex() [2/4]

size_t Mantid::DataObjects::MDHistoWorkspace::getLinearIndex ( size_t  index1,
size_t  index2 
) const
inlineoverridevirtual

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 316 of file MDHistoWorkspace.h.

◆ getLinearIndex() [3/4]

size_t Mantid::DataObjects::MDHistoWorkspace::getLinearIndex ( size_t  index1,
size_t  index2,
size_t  index3 
) const
inlineoverridevirtual

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 322 of file MDHistoWorkspace.h.

◆ getLinearIndex() [4/4]

size_t Mantid::DataObjects::MDHistoWorkspace::getLinearIndex ( size_t  index1,
size_t  index2,
size_t  index3,
size_t  index4 
) const
inlineoverridevirtual

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 328 of file MDHistoWorkspace.h.

◆ getLinearIndexAtCoord()

size_t Mantid::DataObjects::MDHistoWorkspace::getLinearIndexAtCoord ( const coord_t coords) const

Get the linear index into the histo array at these coordinates.

Parameters
coords:: ND-sized array of coordinates
Returns
the linear index, or size_t(-1) if out of range.

Definition at line 369 of file MDHistoWorkspace.cpp.

References Mantid::Geometry::d, m_boxLength, m_indexMaker, m_indexMax, m_origin, numDimensions, and Mantid::Geometry::x.

Referenced by getLinePoints(), getSignalAtCoord(), and getSignalWithMaskAtCoord().

◆ getLineData()

IMDWorkspace::LinePlot Mantid::DataObjects::MDHistoWorkspace::getLineData ( const Mantid::Kernel::VMD start,
const Mantid::Kernel::VMD end,
Mantid::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. Sets the x,y vectors to the histogram bin boundaries and counts

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
Returns
:: LinePlot with points at bin boundaries

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 591 of file MDHistoWorkspace.cpp.

References getLinePoints(), and Mantid::Kernel::normalize().

◆ getLinePlot()

IMDWorkspace::LinePlot Mantid::DataObjects::MDHistoWorkspace::getLinePlot ( const Mantid::Kernel::VMD start,
const Mantid::Kernel::VMD end,
Mantid::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 at bin centres of unmasked bins.

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
Returns
:: LinePlot with x as linearly spaced points along the line between start and end, y set to the normalized signal for each bin with Length = length(x) - 1 and e as the error vector for each bin.

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 468 of file MDHistoWorkspace.cpp.

References getLinePoints(), and Mantid::Kernel::normalize().

◆ getLinePoints()

IMDWorkspace::LinePlot Mantid::DataObjects::MDHistoWorkspace::getLinePoints ( const Mantid::Kernel::VMD start,
const Mantid::Kernel::VMD end,
Mantid::API::MDNormalization  normalize,
const bool  bin_centres 
) const
protected

Obtain coordinates for a line plot through a MDWorkspace.

Cross the workspace from start to end points, recording the signal along the lin at either bin boundaries, or halfway between bin boundaries (which is bin centres if the line is dimension aligned). If recording halfway values then omit points in masked bins.

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
Returns
:: LinePlot with x as the boundaries of the bins, relative to start of the line, y set to the normalized signal for each bin with Length = length(x) - 1 and e as the error vector for each bin.
Parameters
bin_centres:: if true then record points halfway between bin boundaries, otherwise record on bin boundaries

Definition at line 490 of file MDHistoWorkspace.cpp.

References Mantid::API::IMDWorkspace::LinePlot::e, getBinBoundariesOnLine(), getErrorAt(), getIsMaskedAt(), getLinearIndexAtCoord(), getNormalizationFactor(), Mantid::API::MDGeometry::getNumDims(), Mantid::Kernel::VMDBase< TYPE >::getNumDims(), getSignalAt(), m_length, Mantid::API::IMDWorkspace::makeSinglePointWithNaN(), Mantid::Kernel::VMDBase< TYPE >::normalize(), Mantid::Kernel::normalize(), Mantid::API::IMDWorkspace::LinePlot::x, and Mantid::API::IMDWorkspace::LinePlot::y.

Referenced by getLineData(), and getLinePlot().

◆ getMaskArray()

const bool * Mantid::DataObjects::MDHistoWorkspace::getMaskArray ( ) const
inline
Returns
the direct pointer to the array of mask bits (bool). For speed/testing

Definition at line 145 of file MDHistoWorkspace.h.

◆ getMemorySize()

size_t Mantid::DataObjects::MDHistoWorkspace::getMemorySize ( ) const
overridevirtual

Return the memory used, in bytes.

Implements Mantid::API::Workspace.

Definition at line 422 of file MDHistoWorkspace.cpp.

References m_length, and sizeOfElement().

◆ getNEvents()

uint64_t Mantid::DataObjects::MDHistoWorkspace::getNEvents ( ) const
overridevirtual

get number of contributed events

Implements Mantid::API::IMDWorkspace.

Definition at line 1240 of file MDHistoWorkspace.cpp.

References m_nEventsContributed, m_numEvents, and sumNContribEvents().

◆ getNormalizationFactor()

signal_t Mantid::DataObjects::MDHistoWorkspace::getNormalizationFactor ( const API::MDNormalization normalize,
size_t  linearIndex 
) const
private

Find the normalization factor.

Parameters
normalize:: how to normalize the signal
linearIndex:: the position in the workspace of the signal value to be normalized
Returns
:: the normalization factor

Definition at line 604 of file MDHistoWorkspace.cpp.

References m_inverseVolume, m_numEvents, Mantid::API::NoNormalization, Mantid::Kernel::normalize(), Mantid::API::NumEventsNormalization, and Mantid::API::VolumeNormalization.

Referenced by getLinePoints(), and getSignalAtCoord().

◆ getNPoints()

uint64_t Mantid::DataObjects::MDHistoWorkspace::getNPoints ( ) const
inlineoverridevirtual

Get the number of points (bins in this case) associated with the workspace;.

Implements Mantid::API::IMDWorkspace.

Definition at line 68 of file MDHistoWorkspace.h.

Referenced by clearMDMasking(), createIterators(), Mantid::DataObjects::MDHistoWorkspaceIterator::init(), and setMDMasking().

◆ getNumEventsArray()

const signal_t * Mantid::DataObjects::MDHistoWorkspace::getNumEventsArray ( ) const
inlineoverridevirtual
Returns
the direct pointer to the array of the number of events. For speed

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 141 of file MDHistoWorkspace.h.

◆ getNumEventsAt()

signal_t Mantid::DataObjects::MDHistoWorkspace::getNumEventsAt ( size_t  index) const
inline

◆ getSignalArray()

const signal_t * Mantid::DataObjects::MDHistoWorkspace::getSignalArray ( ) const
inlineoverridevirtual
Returns
the direct pointer to the signal array. For speed

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 130 of file MDHistoWorkspace.h.

◆ getSignalAt() [1/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalAt ( size_t  index) const
inlineoverridevirtual

◆ getSignalAt() [2/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalAt ( size_t  index1,
size_t  index2 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t)

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 234 of file MDHistoWorkspace.h.

◆ getSignalAt() [3/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalAt ( size_t  index1,
size_t  index2,
size_t  index3 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t)

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 240 of file MDHistoWorkspace.h.

◆ getSignalAt() [4/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalAt ( size_t  index1,
size_t  index2,
size_t  index3,
size_t  index4 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t)

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 246 of file MDHistoWorkspace.h.

◆ getSignalAtCoord()

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalAtCoord ( 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.

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 335 of file MDHistoWorkspace.cpp.

References getLinearIndexAtCoord(), getNormalizationFactor(), m_length, and m_signals.

Referenced by getSignalWithMaskAtCoord().

◆ getSignalDataVector()

std::vector< signal_t > Mantid::DataObjects::MDHistoWorkspace::getSignalDataVector ( ) const
virtual

Return a vector containing a copy of the signal data in the workspace.

TODO: Make this more efficient if needed.

Returns
a vector containing a copy of the signal data in the workspace.

Definition at line 426 of file MDHistoWorkspace.cpp.

References m_length, and m_signals.

◆ getSignalNormalizedAt() [1/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalNormalizedAt ( size_t  index) const
inlineoverridevirtual

Get the signal at the specified index, normalized by cell volume.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 251 of file MDHistoWorkspace.h.

References index.

◆ getSignalNormalizedAt() [2/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalNormalizedAt ( size_t  index1,
size_t  index2 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 255 of file MDHistoWorkspace.h.

◆ getSignalNormalizedAt() [3/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalNormalizedAt ( size_t  index1,
size_t  index2,
size_t  index3 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 261 of file MDHistoWorkspace.h.

◆ getSignalNormalizedAt() [4/4]

signal_t Mantid::DataObjects::MDHistoWorkspace::getSignalNormalizedAt ( size_t  index1,
size_t  index2,
size_t  index3,
size_t  index4 
) const
inlineoverridevirtual

Get the signal at the specified index given in 4 dimensions (typically X,Y,Z,t), normalized by cell volume.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 267 of file MDHistoWorkspace.h.

◆ getSignalWithMaskAtCoord()

signal_t Mantid::DataObjects::MDHistoWorkspace::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 354 of file MDHistoWorkspace.cpp.

References getIsMaskedAt(), getLinearIndexAtCoord(), getSignalAtCoord(), and Mantid::API::MDMaskValue.

◆ getSpecialCoordinateSystem()

Kernel::SpecialCoordinateSystem Mantid::DataObjects::MDHistoWorkspace::getSpecialCoordinateSystem ( ) const
overridevirtual

Get the special coordinate system.

Get the Q frame system (if any) to use.

Implements Mantid::API::IMDWorkspace.

Definition at line 1263 of file MDHistoWorkspace.cpp.

◆ getVertexesArray()

std::unique_ptr< coord_t[]> Mantid::DataObjects::MDHistoWorkspace::getVertexesArray ( size_t  linearIndex,
size_t &  numVertices 
) const

For the volume at the given linear index, Return the vertices of every corner of the box, as a bare array of length numVertices * nd.

Parameters
linearIndex:: index into the workspace. Same as for getSignalAt(index)
[out]numVertices:: returns the number of vertices in the array.
Returns
the bare array. This should be deleted by the caller!

Definition at line 280 of file MDHistoWorkspace.cpp.

References Mantid::Geometry::d, Mantid::Kernel::Utils::NestedForLoop::GetIndicesFromLinearIndex(), m_boxLength, m_indexMaker, m_indexMax, m_vertexesArray, and numDimensions.

Referenced by Mantid::DataObjects::MDHistoWorkspaceIterator::getVertexesArray().

◆ greaterThan() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::greaterThan ( const MDHistoWorkspace b)

Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is > b[i].

signal[i] -> becomes false (0.0) otherwise Errors are set to 0.

Parameters
b:: workspace on the RHS of the comparison.

Definition at line 1085 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, and m_signals.

◆ greaterThan() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::greaterThan ( const signal_t  signal)

Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is > signal.

signal[i] -> becomes false (0.0) otherwise Errors are set to 0.

Parameters
signal:: signal value on the RHS of the comparison.

Definition at line 1101 of file MDHistoWorkspace.cpp.

References m_errorsSquared, m_length, and m_signals.

◆ id()

const std::string Mantid::DataObjects::MDHistoWorkspace::id ( ) const
inlineoverridevirtual

A string ID for the class.

Implements Mantid::Kernel::DataItem.

Definition at line 62 of file MDHistoWorkspace.h.

◆ init() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::init ( std::vector< Mantid::Geometry::IMDDimension_sptr > &  dimensions)

Constructor helper method.

Parameters
dimensions:: vector of IMDDimension; no limit to how many.

Definition at line 124 of file MDHistoWorkspace.cpp.

References cacheValues(), Mantid::API::MDGeometry::initGeometry(), m_errorsSquared, m_length, m_masks, m_nEventsContributed, m_numEvents, m_signals, and setTo().

◆ init() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::init ( std::vector< Mantid::Geometry::MDHistoDimension_sptr > &  dimensions)

Constructor helper method.

Parameters
dimensions:: vector of MDHistoDimension; no limit to how many.

Definition at line 111 of file MDHistoWorkspace.cpp.

References init(), and m_nEventsContributed.

Referenced by init(), and MDHistoWorkspace().

◆ initVertexesArray()

void Mantid::DataObjects::MDHistoWorkspace::initVertexesArray ( )
private

After initialization, call this to initialize the vertexes array to the vertexes of the 0th box.

Will be used by getVertexesArray()

Definition at line 182 of file MDHistoWorkspace.cpp.

References Mantid::Geometry::d, m_boxLength, Mantid::API::MDGeometry::m_dimensions, m_indexMaker, m_indexMax, m_origin, m_vertexesArray, numDimensions, and Mantid::Kernel::Utils::NestedForLoop::SetUpIndexMaker().

Referenced by cacheValues().

◆ isMDHistoWorkspace()

bool Mantid::DataObjects::MDHistoWorkspace::isMDHistoWorkspace ( ) const
inlineoverridevirtual

Return if this workspace is a MDHistoWorkspace. Will always return true.

Reimplemented from Mantid::API::IMDWorkspace.

Definition at line 387 of file MDHistoWorkspace.h.

◆ lessThan() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::lessThan ( const MDHistoWorkspace b)

Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is < b[i].

signal[i] -> becomes false (0.0) otherwise Errors are set to 0.

Parameters
b:: workspace on the RHS of the comparison.

Definition at line 1054 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, and m_signals.

◆ lessThan() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::lessThan ( const signal_t  signal)

Turn this workspace into a boolean workspace, where signal[i] -> becomes true (1.0) if it is < signal.

signal[i] -> becomes false (0.0) otherwise Errors are set to 0.

Parameters
signal:: signal value on the RHS of the comparison.

Definition at line 1070 of file MDHistoWorkspace.cpp.

References m_errorsSquared, m_length, and m_signals.

◆ log()

void Mantid::DataObjects::MDHistoWorkspace::log ( double  filler = 0.0)

Perform the natural logarithm on each signal in the workspace.

Error propagation of \( f = ln(a) \) is given by: \( df^2 = a^2 / da^2 \)

Definition at line 909 of file MDHistoWorkspace.cpp.

References m_errorsSquared, m_length, and m_signals.

◆ log10()

void Mantid::DataObjects::MDHistoWorkspace::log10 ( double  filler = 0.0)

Perform the base-10 logarithm on each signal in the workspace.

Error propagation of \( f = ln(a) \) is given by: \( df^2 = (ln(10)^-2) * a^2 / da^2 \)

Definition at line 929 of file MDHistoWorkspace.cpp.

References m_errorsSquared, m_length, and m_signals.

◆ makeSingleBinWithNaN()

void Mantid::DataObjects::MDHistoWorkspace::makeSingleBinWithNaN ( std::vector< coord_t > &  x,
std::vector< signal_t > &  y,
std::vector< signal_t > &  e 
) const
private

◆ multiply() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::multiply ( const MDHistoWorkspace b_ws)

Perform the *= operation, element-by-element, for two MDHistoWorkspace's.

Error propagation of \( f = a * b \) is given by: \( df^2 = f^2 * (da^2 / a^2 + db^2 / b^2) \) Rewritten as: \( df^2 = b^2 da^2 + a^2 * db^2 \) to avoid problems when a or b are 0

Parameters
b_ws:: workspace on the RHS of the operation

Definition at line 789 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, and m_signals.

Referenced by operator*=().

◆ multiply() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::multiply ( const signal_t  signal,
const signal_t  error 
)

Perform the *= operation with a scalar as the RHS argument.

Error propagation of \( f = a * b \) is given by: \( df^2 = f^2 * (da^2 / a^2 + db^2 / b^2) \) Rewritten as: \( df^2 = b^2 da^2 + a^2 * db^2 \) to avoid problems when a or b are 0

Parameters
signal:: signal to apply
error:: error (not squared) to apply
Returns
*this after operation

Definition at line 818 of file MDHistoWorkspace.cpp.

References error, m_errorsSquared, m_length, and m_signals.

◆ mutableErrorSquaredArray()

signal_t * Mantid::DataObjects::MDHistoWorkspace::mutableErrorSquaredArray ( )
inlineoverridevirtual
Returns
the direct pointer to the errors array. For speed. non-const version

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 157 of file MDHistoWorkspace.h.

◆ mutableMaskArray()

bool * Mantid::DataObjects::MDHistoWorkspace::mutableMaskArray ( )
inline
Returns
the direct pointer to the array of mask bits (bool). For speed/testing

Definition at line 165 of file MDHistoWorkspace.h.

◆ mutableNumEventsArray()

signal_t * Mantid::DataObjects::MDHistoWorkspace::mutableNumEventsArray ( )
inlineoverridevirtual
Returns
the direct pointer to the errors array. For speed. non-const version

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 161 of file MDHistoWorkspace.h.

◆ mutableSignalArray()

signal_t * Mantid::DataObjects::MDHistoWorkspace::mutableSignalArray ( )
inlineoverridevirtual
Returns
the direct pointer to the signal array. For speed. non-const version

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 153 of file MDHistoWorkspace.h.

◆ operator&=()

MDHistoWorkspace & Mantid::DataObjects::MDHistoWorkspace::operator&= ( const MDHistoWorkspace b)

◆ operator*=()

MDHistoWorkspace & Mantid::DataObjects::MDHistoWorkspace::operator*= ( const MDHistoWorkspace b_ws)

Perform the *= operation, element-by-element, for two MDHistoWorkspace's.

Error propagation of \( f = a * b \) is given by: \( df^2 = f^2 * (da^2 / a^2 + db^2 / b^2) \)

Parameters
b_ws:: workspace on the RHS of the operation
Returns
*this after operation

Definition at line 773 of file MDHistoWorkspace.cpp.

References multiply().

◆ operator+=()

MDHistoWorkspace & Mantid::DataObjects::MDHistoWorkspace::operator+= ( const MDHistoWorkspace b)

Perform the += operation, element-by-element, for two MDHistoWorkspace's.

Parameters
b:: workspace on the RHS of the operation
Returns
*this after operation

Definition at line 692 of file MDHistoWorkspace.cpp.

References add().

◆ operator-=()

MDHistoWorkspace & Mantid::DataObjects::MDHistoWorkspace::operator-= ( const MDHistoWorkspace b)

Perform the -= operation, element-by-element, for two MDHistoWorkspace's.

Parameters
b:: workspace on the RHS of the operation
Returns
*this after operation

Definition at line 731 of file MDHistoWorkspace.cpp.

References subtract().

◆ operator/=()

MDHistoWorkspace & Mantid::DataObjects::MDHistoWorkspace::operator/= ( const MDHistoWorkspace b_ws)

Perform the /= operation, element-by-element, for two MDHistoWorkspace's.

Error propagation of \( f = a / b \) is given by: \( df^2 = f^2 * (da^2 / a^2 + db^2 / b^2) \)

Parameters
b_ws:: workspace on the RHS of the operation
Returns
*this after operation

Definition at line 842 of file MDHistoWorkspace.cpp.

References divide().

◆ operator=()

MDHistoWorkspace & Mantid::DataObjects::MDHistoWorkspace::operator= ( const MDHistoWorkspace other)
delete

◆ operator[]()

signal_t & Mantid::DataObjects::MDHistoWorkspace::operator[] ( const size_t &  index)
inlineoverridevirtual

Array subscript operator.

Parameters
index:: linear index into array
Returns
the signal (not normalized) at that index.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 352 of file MDHistoWorkspace.h.

References index.

◆ operator^=()

MDHistoWorkspace & Mantid::DataObjects::MDHistoWorkspace::operator^= ( const MDHistoWorkspace b)

A boolean ^= (xor) operation, element-by-element, for two MDHistoWorkspace's.

0.0 is "false", all other values are "true". All errors are set to 0.

Parameters
b:: workspace on the RHS of the operation
Returns
*this after operation

Definition at line 1024 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, m_masks, and m_signals.

◆ operatorNot()

void Mantid::DataObjects::MDHistoWorkspace::operatorNot ( )

A boolean not operation, performed in-place.

All errors are set to 0.

0.0 is "false", all other values are "true". All errors are set to 0.

Definition at line 1039 of file MDHistoWorkspace.cpp.

References m_errorsSquared, m_length, m_masks, and m_signals.

◆ operator|=()

DOXYGEN_BUG MDHistoWorkspace & Mantid::DataObjects::MDHistoWorkspace::operator|= ( const MDHistoWorkspace b)

A boolean |= (or) operation, element-by-element, for two MDHistoWorkspace's.

0.0 is "false", all other values are "true". All errors are set to 0.

Parameters
b:: workspace on the RHS of the operation
Returns
*this after operation

Definition at line 1007 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, m_masks, and m_signals.

◆ power()

void Mantid::DataObjects::MDHistoWorkspace::power ( double  exponent)

Perform the power function (signal^exponent) on each signal S in the workspace.

Error propagation of \( f = a^b \) is given by: \( df^2 = f^2 * b^2 * (da^2 / a^2) \)

Definition at line 965 of file MDHistoWorkspace.cpp.

References m_errorsSquared, m_length, and m_signals.

◆ setCoordinateSystem()

void Mantid::DataObjects::MDHistoWorkspace::setCoordinateSystem ( const Kernel::SpecialCoordinateSystem  coordinateSystem)
overridevirtual

Set the special coordinate system.

Set the special coordinate system (if any) to use.

Parameters
coordinateSystem: Special coordinate system to use.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 1277 of file MDHistoWorkspace.cpp.

References m_coordSystem.

◆ setDisplayNormalization()

void Mantid::DataObjects::MDHistoWorkspace::setDisplayNormalization ( const Mantid::API::MDNormalization preferredNormalization)
overridevirtual

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 1301 of file MDHistoWorkspace.cpp.

References m_displayNormalization.

◆ setErrorSquaredAt()

void Mantid::DataObjects::MDHistoWorkspace::setErrorSquaredAt ( size_t  index,
signal_t  value 
)
inlineoverridevirtual

Sets the error (squared) at the specified index.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 193 of file MDHistoWorkspace.h.

References index, and value.

Referenced by setMDMaskAt().

◆ setMDMaskAt()

void Mantid::DataObjects::MDHistoWorkspace::setMDMaskAt ( const size_t &  index,
bool  mask 
)

Apply masking.

Set the masking.

Parameters
index: linear index to mask
mask: True to mask. False to clear.

Definition at line 1220 of file MDHistoWorkspace.cpp.

References index, m_masks, Mantid::API::MDMaskValue, setErrorSquaredAt(), and setSignalAt().

Referenced by setMDMasking().

◆ setMDMasking()

void Mantid::DataObjects::MDHistoWorkspace::setMDMasking ( std::unique_ptr< Mantid::Geometry::MDImplicitFunction maskingRegion)
overridevirtual

Apply masking.

Setter for the masking region.

Does not perform any clearing. Multiple calls are compounded.

Parameters
maskingRegion: Implicit function defining mask region.

Implements Mantid::API::IMDWorkspace.

Definition at line 1203 of file MDHistoWorkspace.cpp.

References getNPoints(), and setMDMaskAt().

◆ setNumEventsAt()

void Mantid::DataObjects::MDHistoWorkspace::setNumEventsAt ( size_t  index,
signal_t  value 
)
inline

Sets the number of contributing events in the bin at the specified index.

Definition at line 196 of file MDHistoWorkspace.h.

References index, and value.

◆ setSignalAt()

void Mantid::DataObjects::MDHistoWorkspace::setSignalAt ( size_t  index,
signal_t  value 
)
inlineoverridevirtual

Sets the signal at the specified index.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 190 of file MDHistoWorkspace.h.

References index, and value.

Referenced by setMDMaskAt().

◆ setTo()

void Mantid::DataObjects::MDHistoWorkspace::setTo ( signal_t  signal,
signal_t  errorSquared,
signal_t  numEvents 
)
overridevirtual

Sets all signals/errors in the workspace to the given values.

Parameters
signal:: signal value to set
errorSquared:: error (squared) value to set
numEvents:: the number of events in each bin.

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 234 of file MDHistoWorkspace.cpp.

References m_errorsSquared, m_length, m_masks, m_nEventsContributed, m_numEvents, m_signals, and Mantid::DataHandling::numEvents().

Referenced by init().

◆ setUsingMask() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::setUsingMask ( const MDHistoWorkspace mask,
const MDHistoWorkspace values 
)

Copy the values from another workspace onto this workspace, but only where a mask is true (non-zero)

For example, in matlab or numpy python, you might write something like: "mask = (array < 5.0); array[mask] = other[mask];"

The equivalent here is: mask = array; mask.lessThan(5.0); array.setUsingMask(mask, other);

Parameters
mask:: MDHistoWorkspace where (signal == 0.0) means false, and (signal != 0.0) means true.
values:: MDHistoWorkspace of values to copy.

Definition at line 1159 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, and m_signals.

◆ setUsingMask() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::setUsingMask ( const MDHistoWorkspace mask,
const signal_t  signal,
const signal_t  error 
)

Copy the values from another workspace onto this workspace, but only where a mask is true (non-zero)

For example, in matlab or numpy python, you might write something like: "mask = (array < 5.0); array[mask] = other[mask];"

The equivalent here is: mask = array; mask.lessThan(5.0); array.setUsingMask(mask, other);

Parameters
mask:: MDHistoWorkspace where (signal == 0.0) means false, and (signal != 0.0) means true.
signal:: signal to set everywhere mask is true
error:: error (not squared) to set everywhere mask is true

Definition at line 1187 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), error, m_errorsSquared, m_length, and m_signals.

◆ signalAt()

signal_t & Mantid::DataObjects::MDHistoWorkspace::signalAt ( size_t  index)
inlineoverridevirtual
Returns
a reference to the signal at the linear index
Parameters
index:: linear index (see getLinearIndex).

Implements Mantid::API::IMDHistoWorkspace.

Definition at line 308 of file MDHistoWorkspace.h.

References index.

◆ sizeOfElement()

size_t Mantid::DataObjects::MDHistoWorkspace::sizeOfElement ( )
static

Get the size of an element in the HistoWorkspace.

Static helper method.

Returns
The size of an element in the MDEventWorkspace.

Definition at line 1285 of file MDHistoWorkspace.cpp.

Referenced by getMemorySize().

◆ subtract() [1/2]

void Mantid::DataObjects::MDHistoWorkspace::subtract ( const MDHistoWorkspace b)

Perform the -= operation, element-by-element, for two MDHistoWorkspace's.

Parameters
b:: workspace on the RHS of the operation

Definition at line 741 of file MDHistoWorkspace.cpp.

References checkWorkspaceSize(), m_errorsSquared, m_length, m_nEventsContributed, m_numEvents, and m_signals.

Referenced by operator-=().

◆ subtract() [2/2]

void Mantid::DataObjects::MDHistoWorkspace::subtract ( const signal_t  signal,
const signal_t  error 
)

Perform the -= operation with a scalar as the RHS argument.

Parameters
signal:: signal to apply
error:: error (not squared) to apply

Definition at line 757 of file MDHistoWorkspace.cpp.

References error, m_errorsSquared, m_length, and m_signals.

◆ sumNContribEvents()

uint64_t Mantid::DataObjects::MDHistoWorkspace::sumNContribEvents ( ) const

sum the array of contributing events m_numEvents array

Definition at line 1251 of file MDHistoWorkspace.cpp.

References m_length, and m_numEvents.

Referenced by getNEvents().

◆ updateSum()

void Mantid::DataObjects::MDHistoWorkspace::updateSum ( )
inline

Definition at line 373 of file MDHistoWorkspace.h.

Member Data Documentation

◆ indexMultiplier

std::vector<size_t> Mantid::DataObjects::MDHistoWorkspace::indexMultiplier
private

To find the index into the linear array, dim0 + indexMultiplier[0]*dim1 + ...

Definition at line 415 of file MDHistoWorkspace.h.

Referenced by applyImplicitFunction(), and cacheValues().

◆ m_boxLength

std::vector<coord_t> Mantid::DataObjects::MDHistoWorkspace::m_boxLength
private

Vector of the length of the box in each dimension.

Definition at line 428 of file MDHistoWorkspace.h.

Referenced by getCenter(), getLinearIndexAtCoord(), getVertexesArray(), and initVertexesArray().

◆ m_coordSystem

Kernel::SpecialCoordinateSystem Mantid::DataObjects::MDHistoWorkspace::m_coordSystem
private

Definition at line 435 of file MDHistoWorkspace.h.

Referenced by setCoordinateSystem().

◆ m_displayNormalization

Mantid::API::MDNormalization Mantid::DataObjects::MDHistoWorkspace::m_displayNormalization
private

Display normalization to use.

Definition at line 438 of file MDHistoWorkspace.h.

Referenced by displayNormalization(), and setDisplayNormalization().

◆ m_errorsSquared

std::vector<signal_t> Mantid::DataObjects::MDHistoWorkspace::m_errorsSquared
private

◆ m_indexMaker

std::vector<size_t> Mantid::DataObjects::MDHistoWorkspace::m_indexMaker
private

For converting to/from linear index to tdimensions.

Definition at line 417 of file MDHistoWorkspace.h.

Referenced by getCenter(), getLinearIndexAtCoord(), getVertexesArray(), and initVertexesArray().

◆ m_indexMax

std::vector<size_t> Mantid::DataObjects::MDHistoWorkspace::m_indexMax
private

Max index into each dimension.

Definition at line 419 of file MDHistoWorkspace.h.

Referenced by getCenter(), getLinearIndexAtCoord(), getVertexesArray(), and initVertexesArray().

◆ m_inverseVolume

coord_t Mantid::DataObjects::MDHistoWorkspace::m_inverseVolume
private

Inverse of the volume of EACH cell.

Definition at line 422 of file MDHistoWorkspace.h.

Referenced by cacheValues(), and getNormalizationFactor().

◆ m_length

size_t Mantid::DataObjects::MDHistoWorkspace::m_length
private

◆ m_masks

std::unique_ptr<bool[]> Mantid::DataObjects::MDHistoWorkspace::m_masks
protected

Linear array of masks for each bin.

Avoids using vector<bool> due to performance concerns.

Definition at line 455 of file MDHistoWorkspace.h.

Referenced by clearMDMasking(), init(), MDHistoWorkspace(), operator^=(), operatorNot(), operator|=(), setMDMaskAt(), and setTo().

◆ m_nEventsContributed

uint64_t Mantid::DataObjects::MDHistoWorkspace::m_nEventsContributed
mutableprivate

the number of events, contributed into the workspace;

Definition at line 433 of file MDHistoWorkspace.h.

Referenced by add(), cacheValues(), getNEvents(), init(), setTo(), and subtract().

◆ m_numEvents

std::vector<signal_t> Mantid::DataObjects::MDHistoWorkspace::m_numEvents
private

Number of contributing events for each bin.

Definition at line 408 of file MDHistoWorkspace.h.

Referenced by add(), getNEvents(), getNormalizationFactor(), init(), MDHistoWorkspace(), setTo(), subtract(), and sumNContribEvents().

◆ m_origin

std::vector<coord_t> Mantid::DataObjects::MDHistoWorkspace::m_origin
private

Vector of the origin in each dimension.

Definition at line 431 of file MDHistoWorkspace.h.

Referenced by getLinearIndexAtCoord(), and initVertexesArray().

◆ m_signals

std::vector<signal_t> Mantid::DataObjects::MDHistoWorkspace::m_signals
private

◆ m_vertexesArray

std::vector<coord_t> Mantid::DataObjects::MDHistoWorkspace::m_vertexesArray
private

Pre-calculated vertexes array for the 0th box.

Definition at line 425 of file MDHistoWorkspace.h.

Referenced by getCenter(), getVertexesArray(), and initVertexesArray().

◆ numDimensions

size_t Mantid::DataObjects::MDHistoWorkspace::numDimensions
private

Number of dimensions in this workspace.

Definition at line 399 of file MDHistoWorkspace.h.

Referenced by applyImplicitFunction(), cacheValues(), getCenter(), getLinearIndexAtCoord(), getVertexesArray(), and initVertexesArray().


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