Mantid
Loading...
Searching...
No Matches
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | Private Member Functions | List of all members
Mantid::DataObjects::MDBoxBase Class Referenceabstract

Templated super-class of a multi-dimensional event "box". More...

#include <MDBoxBase.h>

Inheritance diagram for Mantid::DataObjects::MDBoxBase:
Mantid::API::IMDNode

Public Types

using sptr = std::shared_ptr< MDBoxBase< MDE, nd > >
 Convenience typedef for a shared pointer to a this type of class. More...
 

Public Member Functions

virtual size_t addEvent (const MDE &point)=0
 Add a single event. More...
 
virtual size_t addEvents (const std::vector< MDE > &events)
 
virtual size_t addEventsUnsafe (const std::vector< MDE > &events)
 
virtual size_t addEventUnsafe (const MDE &point)=0
 Add a single event, with no mutex locking. More...
 
virtual void calculateGridCaches ()
 
void calcVolume () override
 Compute the volume of the box by simply multiplying each dimension range. More...
 
virtual void centerpointBin (MDBin< MDE, nd > &bin, bool *fullyContained) const =0
 Perform centerpoint binning of events. More...
 
void centroidSphere (Mantid::API::CoordTransform &radiusTransform, const coord_t radiusSquared, coord_t *centroid, signal_t &signal) const override=0
 Find the centroid around a sphere. More...
 
virtual void generalBin (MDBin< MDE, nd > &bin, Mantid::Geometry::MDImplicitFunction &function) const =0
 General binning method for any shape. More...
 
const IMDNodegetBoxAtCoord (const coord_t *) override
 Returns the lowest-level box at the given coordinates. More...
 
Mantid::API::BoxControllergetBoxController () const override
 
Mantid::API::BoxControllergetBoxController () override
 
coord_t getBoxSize (size_t d)
 For testing: return the internal-stored size of each box in each dimension. More...
 
void getCenter (coord_t *const center) const override
 Get the center of the box. More...
 
unsigned int getCoordType () const override
 
uint32_t getDepth () const override
 For testing, mostly: return the recursion depth of this box. More...
 
signal_t getError () const override
 Returns the integrated error from all points within. More...
 
signal_t getErrorSquared () const override
 Returns the integrated error squared from all points within. More...
 
virtual signal_t getErrorSquaredNormalized () const
 Returns the integrated error squared from all points within, normalized for the cell volume. More...
 
virtual std::vector< MDE > * getEventsCopy ()=0
 Return a copy of contained events. More...
 
void getEventsData (std::vector< coord_t > &, size_t &nColumns) const override
 The method to convert events in a box into a table of coodrinates/signal/errors casted into coord_t type Used to conver events into plain data array. More...
 
std::string getEventType () const override
 
Mantid::Geometry::MDDimensionExtents< coord_t > & getExtents (size_t dim) override
 Get the extents for this box. More...
 
std::string getExtentsStr () const
 Returns the extents as a string, for convenience. More...
 
size_t getID () const override
 
coord_t getInverseVolume () const override
 Return the inverse of the volume of the cell. More...
 
const IMDNodegetParent () const override
 Return a pointer to the parent box (const) More...
 
IMDNodegetParent () override
 Return a pointer to the parent box. More...
 
signal_t getSignal () const override
 Returns the integrated signal from all points within. More...
 
signal_t getSignalNormalized () const override
 Returns the integrated signal from all points within, normalized for the cell volume. More...
 
virtual signal_t getTotalWeight () const
 Returns the total weight of all events within. More...
 
std::vector< Mantid::Kernel::VMDgetVertexes () const override
 
std::unique_ptr< coord_t[]> getVertexesArray (size_t &numVertices) const override
 
std::unique_ptr< coord_t[]> getVertexesArray (size_t &numVertices, const size_t outDimensions, const bool *maskDim) const override
 
coord_t getVolume () const
 Return the volume of the cell. More...
 
void integrateCylinder (Mantid::API::CoordTransform &radiusTransform, const coord_t radius, const coord_t length, signal_t &signal, signal_t &errorSquared, std::vector< signal_t > &signal_fit) const override=0
 Cylinder (peak) integration. More...
 
void integrateSphere (Mantid::API::CoordTransform &radiusTransform, const coord_t radiusSquared, signal_t &signal, signal_t &errorSquared, const coord_t innerRadiusSquared=0.0, const bool useOnePercentBackgroundCorrection=true) const override=0
 Sphere (peak) integration. More...
 
bool isLeaf () const override final
 Is this node a leaf: getNumChildren() == 0. More...
 
 MDBoxBase (const MDBoxBase< MDE, nd > &box, Mantid::API::BoxController *const otherBC)
 
 MDBoxBase (Mantid::API::BoxController *const boxController, const uint32_t depth, const size_t boxID, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector)
 
 MDBoxBase (Mantid::API::BoxController *const boxController=nullptr, const uint32_t depth=0, const size_t boxID=UNDEF_SIZET)
 
void setDepth (uint32_t depth)
 For testing, mostly: set the recursion depth of this box. More...
 
void setErrorSquared (const signal_t ErrorSquared) override
 Sets the integrated error squared from all points within (mostly used for testing) More...
 
void setEventsData (const std::vector< coord_t > &) override
 The method to convert the table of data into vector of events Used to convert from a vector of values (2D table in Fortran representation (by rows) into box events. More...
 
void setExtents (double min[nd], double max[nd])
 Set the extents of this box. More...
 
void setExtents (size_t dim, double min, double max)
 Set the extents of this box. More...
 
void setID (const size_t &newID) override
 sets the special id, which specify the position of this node in the chain linearly ordered nodes More...
 
void setInverseVolume (const coord_t invVolume) override
 Sets the inverse of the volume of the cell. More...
 
void setParent (IMDNode *parent) override
 Return a pointer to the parent box. More...
 
void setSignal (const signal_t signal) override
 Sets the integrated signal from all points within (mostly used for testing) More...
 
virtual void setTotalWeight (const signal_t total)
 Sets the total weight from all points within (mostly used for testing) More...
 
void transformDimensions (std::vector< double > &scaling, std::vector< double > &offset) override
 
- Public Member Functions inherited from Mantid::API::IMDNode
virtual void buildAndAddEvent (const signal_t Signal, const signal_t errorSq, const std::vector< coord_t > &point, uint16_t expInfoIndex, uint16_t goniometerIndex, uint32_t detectorId)=0
 Add a single event defined by its components. More...
 
virtual size_t buildAndAddEvents (const std::vector< signal_t > &sigErrSq, const std::vector< coord_t > &Coord, const std::vector< uint16_t > &expInfoIndex, const std::vector< uint16_t > &goniometerIndex, const std::vector< uint32_t > &detectorId)=0
 Add several events from the vector of event parameters. More...
 
virtual void buildAndAddEventUnsafe (const signal_t Signal, const signal_t errorSq, const std::vector< coord_t > &point, uint16_t expInfoIndex, uint16_t goniometerIndex, uint32_t detectorId)=0
 Add a single event, with no mutex locking. More...
 
virtual void calculateCentroid (coord_t *) const =0
 Calculate the centroid of this box and all sub-boxes. More...
 
virtual void calculateCentroid (coord_t *, const int) const =0
 Calculate the centroid of this box and all sub-boxes. More...
 
virtual void calcVolume ()=0
 
virtual void centroidSphere (Mantid::API::CoordTransform &radiusTransform, const coord_t radiusSquared, coord_t *centroid, signal_t &signal) const =0
 Find the centroid of all events contained within by doing a weighted average of their coordinates. More...
 
virtual void clear ()=0
 Clear all contained data including precalculated averages. More...
 
virtual void clearDataFromMemory ()=0
 drop event data from memory but keep averages More...
 
virtual void clearFileBacked (bool loadFileData)=0
 if node was fileBacked, the method clears file-backed information More...
 
virtual const IMDNodegetBoxAtCoord (const coord_t *)=0
 
virtual Mantid::API::BoxControllergetBoxController () const =0
 get box controller More...
 
virtual Mantid::API::BoxControllergetBoxController ()=0
 
virtual void getBoxes (std::vector< IMDNode * > &boxes, size_t maxDepth, bool leafOnly)=0
 Fill a vector with all the boxes who are the childred of this one up to a certain depth. More...
 
virtual void getBoxes (std::vector< IMDNode * > &boxes, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function)=0
 Fill a vector with all the boxes who are the childred of this one up to a certain depth and selected by the function. More...
 
virtual void getBoxes (std::vector< IMDNode * > &outBoxes, const std::function< bool(IMDNode *)> &cond)=0
 Fill a vector with all the boxes who are satisfying the condition. More...
 
virtual void getCenter (coord_t *const) const =0
 
virtual coord_tgetCentroid () const =0
 Get the centroid of this box and all sub-boxes. More...
 
virtual IMDNodegetChild (size_t index)=0
 Return the indexth child MDBoxBase. More...
 
virtual unsigned int getCoordType () const =0
 
virtual size_t getDataInMemorySize () const =0
 get size of the data located in memory, it is equivalent to getNPoints above for memory based workspace but may be different for file based one ; More...
 
virtual uint32_t getDepth () const =0
 
virtual signal_t getError () const =0
 
virtual signal_t getErrorSquared () const =0
 
virtual void getEventsData (std::vector< coord_t > &coordTable, size_t &nColumns) const =0
 The method to convert events in a box into a table of coodrinates/signal/errors casted into coord_t type Used to save events from plain binary file. More...
 
virtual std::string getEventType () const =0
 
virtual Mantid::Geometry::MDDimensionExtents< coord_t > & getExtents (size_t dim)=0
 
virtual size_t getID () const =0
 
virtual coord_t getInverseVolume () const =0
 
virtual Kernel::ISaveablegetISaveable () const =0
 Return the pointer to the sconst tructure responsible for saving the box on disk if the workspace occupies too much memory. More...
 
virtual Kernel::ISaveablegetISaveable ()=0
 Return the pointer to the structure responsible for saving the box on disk if the workspace occupies too much memory. More...
 
virtual bool getIsMasked () const =0
 Getter for the masking. More...
 
virtual uint64_t getNPoints () const =0
 Get total number of points both in memory and on file if present;. More...
 
virtual size_t getNumChildren () const =0
 Get the # of children MDBoxBase'es (non-recursive) More...
 
virtual size_t getNumDims () const =0
 Get number of dimensions, the box with this interface has. More...
 
virtual size_t getNumMDBoxes () const =0
 Get the total # of unsplit MDBoxes contained. More...
 
virtual const IMDNodegetParent () const =0
 Return a pointer to the parent box (const) More...
 
virtual IMDNodegetParent ()=0
 Return a pointer to the parent box. More...
 
virtual signal_t getSignal () const =0
 
virtual signal_t getSignalByNEvents () const
 
virtual signal_t getSignalNormalized () const =0
 
virtual uint64_t getTotalDataSize () const =0
 
virtual std::vector< Mantid::Kernel::VMDgetVertexes () const =0
 
virtual std::unique_ptr< coord_t[]> getVertexesArray (size_t &numVertices) const =0
 
virtual std::unique_ptr< coord_t[]> getVertexesArray (size_t &numVertices, const size_t outDimensions, const bool *maskDim) const =0
 
virtual void integrateCylinder (Mantid::API::CoordTransform &radiusTransform, const coord_t radius, const coord_t length, signal_t &signal, signal_t &errorSquared, std::vector< signal_t > &signal_fit) const =0
 Cylinder (peak) integration The CoordTransform object could be used for more cylinder reduces the dimensions to two values. More...
 
virtual void integrateSphere (Mantid::API::CoordTransform &radiusTransform, const coord_t radiusSquared, signal_t &signal, signal_t &errorSquared, const coord_t innerRadiusSquared=0.0, const bool useOnePercentBackgroundCorrection=true) const =0
 Sphere (peak) integration The CoordTransform object could be used for more complex shapes, e.g. More...
 
virtual bool isBox () const =0
 
virtual bool isLeaf () const =0
 Is this node a leaf: getNumChildren() == 0. More...
 
virtual void loadAndAddFrom (API::IBoxControllerIO *const, uint64_t, size_t)=0
 Load the additional box data of specified size from the disk location provided using the class, respoinsible for the file IO and append them to the box. More...
 
virtual void loadAndAddFrom (API::IBoxControllerIO *const, uint64_t, size_t, std::vector< coord_t > &)=0
 Load the additional box data of specified size from the disk location provided using the class, respoinsible for the file IO and append them to the box. More...
 
virtual void mask ()=0
 Setter for masking the box. More...
 
virtual void refreshCache (Kernel::ThreadScheduler *=nullptr)=0
 Recalculate signal etc. More...
 
virtual void reserveMemoryForLoad (uint64_t)=0
 
virtual void saveAt (API::IBoxControllerIO *const, uint64_t) const =0
 Save the box at specific disk position using the class, respoinsible for the file IO. More...
 
virtual void setChildren (const std::vector< IMDNode * > &boxes, const size_t indexStart, const size_t indexEnd)=0
 Sets the children from a vector of children. More...
 
virtual void setErrorSquared (const signal_t)=0
 
virtual void setEventsData (const std::vector< coord_t > &coordTable)=0
 The method to convert the table of data into vector of events Used to load events from plain binary file. More...
 
virtual void setFileBacked ()=0
 initiate the structure responsible for swapping the box on HDD if out of memory with default parameters (it does not know its place on HDD and was not saved). More...
 
virtual void setFileBacked (const uint64_t, const size_t, const bool)=0
 initiate the structure responsible for swapping the box on HDD if out of memory. More...
 
virtual void setID (const size_t &newID)=0
 sets the special id, which specify the position of this node in the chain linearly ordered nodes More...
 
virtual void setInverseVolume (const coord_t)=0
 
virtual void setParent (IMDNode *parent)=0
 Return a pointer to the parent box. More...
 
virtual void setSignal (const signal_t)=0
 
virtual void splitAllIfNeeded (Mantid::Kernel::ThreadScheduler *=nullptr)=0
 Split sub-boxes, if this is possible and neede for this box. More...
 
virtual void transformDimensions (std::vector< double > &scaling, std::vector< double > &offset)=0
 
virtual void unmask ()=0
 Setter for unmasking the box. More...
 
virtual ~IMDNode ()=default
 This is an interface to MDBox or MDGridBox of an MDWorkspace. More...
 

Protected Member Functions

template<typename EventIterator >
void calcCaches (const EventIterator &begin, const EventIterator &end)
 Calculates caches if the events are known. More...
 

Protected Attributes

Mantid::Geometry::MDDimensionExtents< coord_textents [nd]
 Array of MDDimensionStats giving the extents and other stats on the box dimensions. More...
 
Mantid::API::BoxController *const m_BoxController
 The box splitting controller, shared with all boxes in the hierarchy. More...
 
coord_t m_centroid [nd]
 
std::mutex m_dataMutex
 Mutex for modifying the event list or box averages. More...
 
uint32_t m_depth
 Recursion depth. More...
 
signal_t m_errorSquared
 Cached total error (squared) from all points within. More...
 
size_t m_fileID
 The id which specify location of this box in a linear chain of ordered boxes (e.g. More...
 
coord_t m_inverseVolume
 Inverse of the volume of the cell, to be used for normalized signal. More...
 
Mantid::API::IMDNodem_parent
 Pointer to the parent of this box. NULL if no parent. More...
 
signal_t m_signal
 Cached total signal from all points within. More...
 
signal_t m_totalWeight
 Cached total weight of all events Set when refreshCache() is called. More...
 

Private Member Functions

 MDBoxBase (const MDBoxBase< MDE, nd > &box)
 

Additional Inherited Members

- Static Public Member Functions inherited from Mantid::API::IMDNode
static bool CompareFilePosition (const IMDNode *const a, const IMDNode *const b)
 Helper method for sorting MDBoxBasees by file position. More...
 
static void sortObjByID (std::vector< IMDNode * > &boxes)
 Static method for sorting a list of MDBoxBase pointers by their file position, ascending. More...
 

Detailed Description

Templated super-class of a multi-dimensional event "box".

To be subclassed by MDBox<> and MDGridBox<>

A box is a container of MDEvents within a certain range of values within the nd dimensions. This range defines a n-dimensional "box" or rectangular prism.

Template Parameters
nd:: the number of dimensions that each MDLeanEvent will be tracking. an int > 0.
Author
Janik Zikovsky, SNS
Date
Dec 7, 2010

Definition at line 50 of file MDBoxBase.h.

Member Typedef Documentation

◆ sptr

using Mantid::DataObjects::MDBoxBase::sptr = std::shared_ptr<MDBoxBase<MDE, nd> >

Convenience typedef for a shared pointer to a this type of class.

Definition at line 358 of file MDBoxBase.h.

Constructor & Destructor Documentation

◆ MDBoxBase() [1/4]

Mantid::DataObjects::MDBoxBase::MDBoxBase ( Mantid::API::BoxController *const  boxController = nullptr,
const uint32_t  depth = 0,
const size_t  boxID = UNDEF_SIZET 
)

◆ MDBoxBase() [2/4]

Mantid::DataObjects::MDBoxBase::MDBoxBase ( Mantid::API::BoxController *const  boxController,
const uint32_t  depth,
const size_t  boxID,
const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &  extentsVector 
)

◆ MDBoxBase() [3/4]

Mantid::DataObjects::MDBoxBase::MDBoxBase ( const MDBoxBase< MDE, nd > &  box,
Mantid::API::BoxController *const  otherBC 
)

◆ MDBoxBase() [4/4]

Mantid::DataObjects::MDBoxBase::MDBoxBase ( const MDBoxBase< MDE, nd > &  box)
private

Member Function Documentation

◆ addEvent()

virtual size_t Mantid::DataObjects::MDBoxBase::addEvent ( const MDE &  point)
pure virtual

◆ addEvents()

virtual size_t Mantid::DataObjects::MDBoxBase::addEvents ( const std::vector< MDE > &  events)
virtual

◆ addEventsUnsafe()

virtual size_t Mantid::DataObjects::MDBoxBase::addEventsUnsafe ( const std::vector< MDE > &  events)
virtual

Reimplemented in Mantid::DataObjects::MDBox.

◆ addEventUnsafe()

virtual size_t Mantid::DataObjects::MDBoxBase::addEventUnsafe ( const MDE &  point)
pure virtual

Add a single event, with no mutex locking.

Implemented in Mantid::DataObjects::MDGridBox, and Mantid::DataObjects::MDBox.

◆ calcCaches()

template<typename EventIterator >
void Mantid::DataObjects::MDBoxBase::calcCaches ( const EventIterator &  begin,
const EventIterator &  end 
)
protected

Calculates caches if the events are known.

Template Parameters
EventIterator:: iterator which points to event in some collection
Parameters
begin:: iterator to start
end:: iterator before end (not included)

Weight processing

Definition at line 368 of file MDBoxBase.h.

References Mantid::Geometry::d.

◆ calculateGridCaches()

virtual void Mantid::DataObjects::MDBoxBase::calculateGridCaches ( )
inlinevirtual

Reimplemented in Mantid::DataObjects::MDGridBox.

Definition at line 307 of file MDBoxBase.h.

◆ calcVolume()

void Mantid::DataObjects::MDBoxBase::calcVolume ( )
inlineoverridevirtual

Compute the volume of the box by simply multiplying each dimension range.

Call this after setExtents() is set for all dimensions. This is saved for getSignalNormalized()

Floating point multiplication is much faster than division, so cache 1/volume.

Implements Mantid::API::IMDNode.

Definition at line 219 of file MDBoxBase.h.

References Mantid::Geometry::d.

◆ centerpointBin()

virtual void Mantid::DataObjects::MDBoxBase::centerpointBin ( MDBin< MDE, nd > &  bin,
bool *  fullyContained 
) const
pure virtual

Perform centerpoint binning of events.

Parameters
bin:: MDBin object giving the limits of events to accept.
fullyContained:: optional bool array sized [nd] of which dimensions are known to be fully contained (for MDSplitBox)

Implemented in Mantid::DataObjects::MDBox, and Mantid::DataObjects::MDGridBox.

◆ centroidSphere()

void Mantid::DataObjects::MDBoxBase::centroidSphere ( Mantid::API::CoordTransform radiusTransform,
const coord_t  radiusSquared,
coord_t centroid,
signal_t signal 
) const
overridepure virtual

◆ generalBin()

virtual void Mantid::DataObjects::MDBoxBase::generalBin ( MDBin< MDE, nd > &  bin,
Mantid::Geometry::MDImplicitFunction function 
) const
pure virtual

General binning method for any shape.

Implemented in Mantid::DataObjects::MDGridBox, and Mantid::DataObjects::MDBox.

◆ getBoxAtCoord()

const IMDNode * Mantid::DataObjects::MDBoxBase::getBoxAtCoord ( const coord_t )
inlineoverridevirtual

Returns the lowest-level box at the given coordinates.

Implements Mantid::API::IMDNode.

Definition at line 87 of file MDBoxBase.h.

◆ getBoxController() [1/2]

Mantid::API::BoxController * Mantid::DataObjects::MDBoxBase::getBoxController ( ) const
inlineoverridevirtual
Returns
the const box controller for this box.

Implements Mantid::API::IMDNode.

Definition at line 140 of file MDBoxBase.h.

Referenced by Mantid::MDAlgorithms::MinusMD::doMinus(), and Mantid::MDAlgorithms::PlusMD::doPlus().

◆ getBoxController() [2/2]

Mantid::API::BoxController * Mantid::DataObjects::MDBoxBase::getBoxController ( )
inlineoverridevirtual
Returns
the box controller for this box.

Implements Mantid::API::IMDNode.

Definition at line 142 of file MDBoxBase.h.

◆ getBoxSize()

coord_t Mantid::DataObjects::MDBoxBase::getBoxSize ( size_t  d)
inline

For testing: return the internal-stored size of each box in each dimension.

Definition at line 203 of file MDBoxBase.h.

References Mantid::Geometry::d.

Referenced by Mantid::MDAlgorithms::CompareMDWorkspaces::compare2Boxes().

◆ getCenter()

void Mantid::DataObjects::MDBoxBase::getCenter ( coord_t *const  center) const
inlineoverridevirtual

Get the center of the box.

Parameters
center:: bare array of size[nd] that will get set with the mid-point of each dimension.

Implements Mantid::API::IMDNode.

Definition at line 210 of file MDBoxBase.h.

References Mantid::Geometry::d.

Referenced by Mantid::MDAlgorithms::IntegratePeaksMD2::findEllipsoid().

◆ getCoordType()

unsigned int Mantid::DataObjects::MDBoxBase::getCoordType ( ) const
inlineoverridevirtual
Returns
the length of the coordinates (in bytes), the events in the box contain.

Implements Mantid::API::IMDNode.

Definition at line 65 of file MDBoxBase.h.

◆ getDepth()

uint32_t Mantid::DataObjects::MDBoxBase::getDepth ( ) const
inlineoverridevirtual

For testing, mostly: return the recursion depth of this box.

0 is the top-level box, 1 is one deeper, etc.

Returns
split recursion depth

Implements Mantid::API::IMDNode.

Definition at line 286 of file MDBoxBase.h.

◆ getError()

signal_t Mantid::DataObjects::MDBoxBase::getError ( ) const
inlineoverridevirtual

Returns the integrated error from all points within.

Implements Mantid::API::IMDNode.

Definition at line 237 of file MDBoxBase.h.

◆ getErrorSquared()

signal_t Mantid::DataObjects::MDBoxBase::getErrorSquared ( ) const
inlineoverridevirtual

Returns the integrated error squared from all points within.

Implements Mantid::API::IMDNode.

Definition at line 242 of file MDBoxBase.h.

Referenced by Mantid::MDAlgorithms::BinMD::binMDBox().

◆ getErrorSquaredNormalized()

virtual signal_t Mantid::DataObjects::MDBoxBase::getErrorSquaredNormalized ( ) const
inlinevirtual

Returns the integrated error squared from all points within, normalized for the cell volume.

Definition at line 280 of file MDBoxBase.h.

◆ getEventsCopy()

virtual std::vector< MDE > * Mantid::DataObjects::MDBoxBase::getEventsCopy ( )
pure virtual

Return a copy of contained events.

Implemented in Mantid::DataObjects::MDBox, and Mantid::DataObjects::MDGridBox.

◆ getEventsData()

void Mantid::DataObjects::MDBoxBase::getEventsData ( std::vector< coord_t > &  ,
size_t &  nColumns 
) const
inlineoverridevirtual

The method to convert events in a box into a table of coodrinates/signal/errors casted into coord_t type Used to conver events into plain data array.

Does nothing for GridBox

Implements Mantid::API::IMDNode.

Definition at line 94 of file MDBoxBase.h.

◆ getEventType()

std::string Mantid::DataObjects::MDBoxBase::getEventType ( ) const
inlineoverridevirtual
Returns
the type of the event this box contains

Implements Mantid::API::IMDNode.

Definition at line 62 of file MDBoxBase.h.

◆ getExtents()

Mantid::Geometry::MDDimensionExtents< coord_t > & Mantid::DataObjects::MDBoxBase::getExtents ( size_t  dim)
inlineoverridevirtual

Get the extents for this box.

Implements Mantid::API::IMDNode.

Definition at line 184 of file MDBoxBase.h.

◆ getExtentsStr()

std::string Mantid::DataObjects::MDBoxBase::getExtentsStr ( ) const
inline

Returns the extents as a string, for convenience.

Definition at line 188 of file MDBoxBase.h.

References Mantid::Geometry::d.

◆ getID()

size_t Mantid::DataObjects::MDBoxBase::getID ( ) const
inlineoverridevirtual
Returns
The special ID which specify location of this node in the chain of ordered boxes (e.g. on a file)

Implements Mantid::API::IMDNode.

Definition at line 71 of file MDBoxBase.h.

◆ getInverseVolume()

coord_t Mantid::DataObjects::MDBoxBase::getInverseVolume ( ) const
inlineoverridevirtual

Return the inverse of the volume of the cell.

Implements Mantid::API::IMDNode.

Definition at line 300 of file MDBoxBase.h.

◆ getParent() [1/2]

const IMDNode * Mantid::DataObjects::MDBoxBase::getParent ( ) const
inlineoverridevirtual

Return a pointer to the parent box (const)

Implements Mantid::API::IMDNode.

Definition at line 84 of file MDBoxBase.h.

◆ getParent() [2/2]

IMDNode * Mantid::DataObjects::MDBoxBase::getParent ( )
inlineoverridevirtual

Return a pointer to the parent box.

Implements Mantid::API::IMDNode.

Definition at line 81 of file MDBoxBase.h.

◆ getSignal()

signal_t Mantid::DataObjects::MDBoxBase::getSignal ( ) const
inlineoverridevirtual

Returns the integrated signal from all points within.

Implements Mantid::API::IMDNode.

Definition at line 232 of file MDBoxBase.h.

Referenced by Mantid::MDAlgorithms::BinMD::binMDBox().

◆ getSignalNormalized()

signal_t Mantid::DataObjects::MDBoxBase::getSignalNormalized ( ) const
inlineoverridevirtual

Returns the integrated signal from all points within, normalized for the cell volume.

Implements Mantid::API::IMDNode.

Definition at line 274 of file MDBoxBase.h.

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

◆ getTotalWeight()

virtual signal_t Mantid::DataObjects::MDBoxBase::getTotalWeight ( ) const
inlinevirtual

Returns the total weight of all events within.

Typically this is equal to the number of events (weight of 1 per event)

Definition at line 248 of file MDBoxBase.h.

◆ getVertexes()

std::vector< Mantid::Kernel::VMD > Mantid::DataObjects::MDBoxBase::getVertexes ( ) const
overridevirtual

Implements Mantid::API::IMDNode.

◆ getVertexesArray() [1/2]

std::unique_ptr< coord_t[]> Mantid::DataObjects::MDBoxBase::getVertexesArray ( size_t &  numVertices) const
overridevirtual

◆ getVertexesArray() [2/2]

std::unique_ptr< coord_t[]> Mantid::DataObjects::MDBoxBase::getVertexesArray ( size_t &  numVertices,
const size_t  outDimensions,
const bool *  maskDim 
) const
overridevirtual

Implements Mantid::API::IMDNode.

◆ getVolume()

coord_t Mantid::DataObjects::MDBoxBase::getVolume ( ) const
inline

Return the volume of the cell.

Definition at line 296 of file MDBoxBase.h.

◆ integrateCylinder()

void Mantid::DataObjects::MDBoxBase::integrateCylinder ( Mantid::API::CoordTransform radiusTransform,
const coord_t  radius,
const coord_t  length,
signal_t signal,
signal_t errorSquared,
std::vector< signal_t > &  signal_fit 
) const
overridepure virtual

◆ integrateSphere()

void Mantid::DataObjects::MDBoxBase::integrateSphere ( Mantid::API::CoordTransform radiusTransform,
const coord_t  radiusSquared,
signal_t signal,
signal_t errorSquared,
const coord_t  innerRadiusSquared = 0.0,
const bool  useOnePercentBackgroundCorrection = true 
) const
overridepure virtual

◆ isLeaf()

bool Mantid::DataObjects::MDBoxBase::isLeaf ( ) const
inlinefinaloverridevirtual

Is this node a leaf: getNumChildren() == 0.

Implements Mantid::API::IMDNode.

Definition at line 67 of file MDBoxBase.h.

◆ setDepth()

void Mantid::DataObjects::MDBoxBase::setDepth ( uint32_t  depth)
inline

For testing, mostly: set the recursion depth of this box.

SHOULD NOT BE CALLED OUTSIDE OF TESTS!

Parameters
depth:: split recursion depth

Definition at line 292 of file MDBoxBase.h.

◆ setErrorSquared()

void Mantid::DataObjects::MDBoxBase::setErrorSquared ( const signal_t  ErrorSquared)
inlineoverridevirtual

Sets the integrated error squared from all points within (mostly used for testing)

Parameters
ErrorSquared:: new squared error.

Implements Mantid::API::IMDNode.

Definition at line 262 of file MDBoxBase.h.

◆ setEventsData()

void Mantid::DataObjects::MDBoxBase::setEventsData ( const std::vector< coord_t > &  )
inlineoverridevirtual

The method to convert the table of data into vector of events Used to convert from a vector of values (2D table in Fortran representation (by rows) into box events.

Does nothing for GridBox (may be temporary) – can be combined with build and add events

Implements Mantid::API::IMDNode.

Definition at line 100 of file MDBoxBase.h.

◆ setExtents() [1/2]

void Mantid::DataObjects::MDBoxBase::setExtents ( double  min[nd],
double  max[nd] 
)
inline

Set the extents of this box.

Parameters
min:: min edge of the dimension
max:: max edge of the dimension

Definition at line 175 of file MDBoxBase.h.

◆ setExtents() [2/2]

void Mantid::DataObjects::MDBoxBase::setExtents ( size_t  dim,
double  min,
double  max 
)
inline

Set the extents of this box.

Parameters
dim:: index of dimension
min:: min edge of the dimension
max:: max edge of the dimension

Dangerous function with side effects as volume and possibly other box statistics has to be recalculated after this excecuted. has not done so because of productivity reasons;

Definition at line 163 of file MDBoxBase.h.

Referenced by Mantid::DataObjects::MDEventsTestHelper::makeMDBox1(), and Mantid::DataObjects::MDEventsTestHelper::makeMDBox3().

◆ setID()

void Mantid::DataObjects::MDBoxBase::setID ( const size_t &  newID)
inlineoverridevirtual

sets the special id, which specify the position of this node in the chain linearly ordered nodes

Implements Mantid::API::IMDNode.

Definition at line 74 of file MDBoxBase.h.

◆ setInverseVolume()

void Mantid::DataObjects::MDBoxBase::setInverseVolume ( const coord_t  invVolume)
inlineoverridevirtual

Sets the inverse of the volume of the cell.

Parameters
invVolume:: value to set.

Implements Mantid::API::IMDNode.

Definition at line 305 of file MDBoxBase.h.

◆ setParent()

void Mantid::DataObjects::MDBoxBase::setParent ( IMDNode parent)
inlineoverridevirtual

Return a pointer to the parent box.

Implements Mantid::API::IMDNode.

Definition at line 78 of file MDBoxBase.h.

◆ setSignal()

void Mantid::DataObjects::MDBoxBase::setSignal ( const signal_t  signal)
inlineoverridevirtual

Sets the integrated signal from all points within (mostly used for testing)

Parameters
signal:: new Signal amount.

Implements Mantid::API::IMDNode.

Definition at line 255 of file MDBoxBase.h.

◆ setTotalWeight()

virtual void Mantid::DataObjects::MDBoxBase::setTotalWeight ( const signal_t  total)
inlinevirtual

Sets the total weight from all points within (mostly used for testing)

Parameters
total:: new weight amount.

Definition at line 268 of file MDBoxBase.h.

◆ transformDimensions()

void Mantid::DataObjects::MDBoxBase::transformDimensions ( std::vector< double > &  scaling,
std::vector< double > &  offset 
)
overridevirtual

Member Data Documentation

◆ extents

Mantid::Geometry::MDDimensionExtents<coord_t> Mantid::DataObjects::MDBoxBase::extents[nd]
protected

Array of MDDimensionStats giving the extents and other stats on the box dimensions.

Definition at line 320 of file MDBoxBase.h.

◆ m_BoxController

Mantid::API::BoxController* const Mantid::DataObjects::MDBoxBase::m_BoxController
protected

The box splitting controller, shared with all boxes in the hierarchy.

Definition at line 336 of file MDBoxBase.h.

◆ m_centroid

coord_t Mantid::DataObjects::MDBoxBase::m_centroid[nd]
mutableprotected

Definition at line 322 of file MDBoxBase.h.

◆ m_dataMutex

std::mutex Mantid::DataObjects::MDBoxBase::m_dataMutex
protected

Mutex for modifying the event list or box averages.

Definition at line 351 of file MDBoxBase.h.

◆ m_depth

uint32_t Mantid::DataObjects::MDBoxBase::m_depth
protected

Recursion depth.

Definition at line 342 of file MDBoxBase.h.

◆ m_errorSquared

signal_t Mantid::DataObjects::MDBoxBase::m_errorSquared
mutableprotected

Cached total error (squared) from all points within.

Set when refreshCache() is called.

Definition at line 329 of file MDBoxBase.h.

◆ m_fileID

size_t Mantid::DataObjects::MDBoxBase::m_fileID
protected

The id which specify location of this box in a linear chain of ordered boxes (e.g.

on file). Calculated algorithmically

Definition at line 349 of file MDBoxBase.h.

◆ m_inverseVolume

coord_t Mantid::DataObjects::MDBoxBase::m_inverseVolume
protected

Inverse of the volume of the cell, to be used for normalized signal.

Definition at line 339 of file MDBoxBase.h.

◆ m_parent

Mantid::API::IMDNode* Mantid::DataObjects::MDBoxBase::m_parent
protected

Pointer to the parent of this box. NULL if no parent.

Definition at line 345 of file MDBoxBase.h.

◆ m_signal

signal_t Mantid::DataObjects::MDBoxBase::m_signal
mutableprotected

Cached total signal from all points within.

Set when refreshCache() is called.

Definition at line 325 of file MDBoxBase.h.

◆ m_totalWeight

signal_t Mantid::DataObjects::MDBoxBase::m_totalWeight
mutableprotected

Cached total weight of all events Set when refreshCache() is called.

Definition at line 333 of file MDBoxBase.h.


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