|
Mantid
|
Templated class for a GRIDDED multi-dimensional event "box". More...
#include <MDGridBox.h>
Public Types | |
| using | boxVector_t = std::vector< MDBoxBase< MDE, nd > * > |
| Typedef for a vector of MDBoxBase pointers. | |
| using | sptr = std::shared_ptr< MDGridBox< MDE, nd > > |
| Typedef for a shared pointer to a MDGridBox. | |
Public Types inherited from Mantid::DataObjects::MDBoxBase< MDE, nd > | |
| using | sptr = std::shared_ptr< MDBoxBase< MDE, nd > > |
| Convenience typedef for a shared pointer to a this type of class. | |
Public Member Functions | |
| size_t | addEvent (const MDE &event) override |
| Add a single MDLeanEvent to the grid box. | |
| size_t | addEventUnsafe (const MDE &event) override |
| Add a single MDLeanEvent to the grid box. | |
| 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) override |
| Create event from the input data and add it to the box. | |
| 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) override |
| Create and Add several (N) events into correspondent boxes; If the event is out/at of bounds it may be placed in very peculiar place! | |
| 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) override |
| Create MDEvent and add it to the box, in a NON-THREAD-SAFE manner. | |
| void | calculateCentroid (coord_t *) const override |
| The function used to satisfy IMDNode interface but the physical meaning is unclear. | |
| void | calculateCentroid (coord_t *, const int) const override |
| The function used to satisfy IMDNode interface but the physical meaning is unclear. | |
| void | calculateGridCaches () override final |
| Calculates caches for grid box recursively, assuming leafs have computed values. | |
| void | centerpointBin (MDBin< MDE, nd > &bin, bool *fullyContained) const override |
| Perform centerpoint binning of events, with bins defined in axes perpendicular to the axes of the workspace. | |
| void | centroidSphere (Mantid::API::CoordTransform &radiusTransform, const coord_t radiusSquared, coord_t *centroid, signal_t &signal) const override |
| Find the centroid of all events contained within by doing a weighted average of their coordinates. | |
| void | clear () override |
| Clear any points contained. | |
| void | clearDataFromMemory () override |
| void | clearFileBacked (bool loadDiskBackedData) override |
| Recursively clear the file-backed information stored in mdBoxes from the boxes if such information exists. | |
| void | generalBin (MDBin< MDE, nd > &, Mantid::Geometry::MDImplicitFunction &) const override |
| General binning method for any shape. | |
| const API::IMDNode * | getBoxAtCoord (const coord_t *coords) override |
| Returns the lowest-level box at the given coordinates. | |
| std::vector< MDBoxBase< MDE, nd > * > & | getBoxes () |
| For testing: get (a reference to) the vector of boxes. | |
| void | getBoxes (std::vector< API::IMDNode * > &outBoxes, const std::function< bool(API::IMDNode *)> &cond) final override |
| Return all boxes contained within. | |
| void | getBoxes (std::vector< API::IMDNode * > &outBoxes, size_t maxDepth, bool leafOnly) override |
| Return all boxes contained within. | |
| void | getBoxes (std::vector< API::IMDNode * > &outBoxes, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function) override |
| Return all boxes contained within, limited by an implicit function. | |
| coord_t * | getCentroid () const override |
| The function used to satisfy IMDNode interface but the physical meaning is unclear. | |
| API::IMDNode * | getChild (size_t index) override |
| Get a child box. | |
| size_t | getChildIndexFromID (size_t childId) const |
| Get the child index from its ID. | |
| size_t | getDataInMemorySize () const override |
| Recursiveluy calculates the amount of the data located in memory. Slow. | |
| std::vector< MDE > * | getEventsCopy () override |
| Allocate and return a vector with a copy of all events contained. | |
| Kernel::ISaveable * | getISaveable () const override |
| get const object responsible for saving the box to a file. | |
| Kernel::ISaveable * | getISaveable () override |
| get object responsible for saving the box to a file. | |
| bool | getIsMasked () const override |
| Getter for the masking status of the gridded box. | |
| uint64_t | getNPoints () const override |
| Uses the cached value of points stored in the grid box. | |
| size_t | getNumChildren () const override |
| size_t | getNumDims () const override |
| Returns the number of dimensions in this box. | |
| size_t | getNumMDBoxes () const override |
| Returns the number of un-split MDBoxes in this box (recursively including all children) | |
| uint64_t | getTotalDataSize () const override |
| 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 |
| Integrate the signal within a sphere; for example, to perform single-crystal peak integration. | |
| 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 |
| std::cout << "vertex at " << vertexCoord[0] << ", " << vertexCoord[1] << ", " << vertexCoord[2] << " is contained\n"; | |
| bool | isBox () const override |
| to avoid casting (which need also the number of dimensions) method say if Node is a box. | |
| void | loadAndAddFrom (API::IBoxControllerIO *const, uint64_t, size_t) override |
| Load the box data of specified size from the disk location provided using the class, respoinsible for the file IO. | |
| void | loadAndAddFrom (API::IBoxControllerIO *const, uint64_t, size_t, std::vector< coord_t > &) override |
| Load the box data of specified size from the disk location provided using the class, responsible for the file IO. | |
| void | mask () override |
| Setter for masking the box. | |
| MDGridBox (const MDGridBox< MDE, nd > &other, Mantid::API::BoxController *const otherBC) | |
| Copy constructor. | |
| MDGridBox (Mantid::API::BoxController *const bc, const uint32_t depth, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector) | |
| Constructor with a box controller. | |
| MDGridBox (MDBox< MDE, nd > *box) | |
| Constructor. | |
| MDGridBox (std::shared_ptr< API::BoxController > &bc, const uint32_t depth, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector) | |
| convenience Constructor, taking the shared pointer and extracting const pointer from it | |
| void | refreshCache (Kernel::ThreadScheduler *ts=nullptr) override |
| Refresh the cache of nPoints, signal and error, by adding up all boxes (recursively). | |
| void | reserveMemoryForLoad (uint64_t) override |
| void | saveAt (API::IBoxControllerIO *const, uint64_t) const override |
| Save the box at specific disk position using the class, respoinsible for the file IO. | |
| void | setChild (size_t index, MDGridBox< MDE, nd > *newChild) |
| Sets particular child MDgridBox at the index, specified by the input parameters. | |
| void | setChildren (const std::vector< API::IMDNode * > &otherBoxes, const size_t indexStart, const size_t indexEnd) override |
| Directly set the children of the MDGridBox. | |
| void | setFileBacked () override |
| Make the box file-backed without knowing its position on the HDD. | |
| void | setFileBacked (const uint64_t, const size_t, const bool) override |
| Recursively make all underlaying boxes file-backed. | |
| void | setNPoints (const uint64_t &n) |
| void | splitAllIfNeeded (Kernel::ThreadScheduler *ts=nullptr) override |
| Goes through all the sub-boxes and splits them if they contain enough events to be worth it. | |
| void | splitContents (size_t index, Kernel::ThreadScheduler *ts=nullptr) |
| Split a box that is contained in the GridBox, at the given index, into a MDGridBox. | |
| void | transformDimensions (std::vector< double > &scaling, std::vector< double > &offset) override |
| Transform the dimensions contained in this box x' = x*scaling + offset. | |
| void | unmask () override |
| Setter for unmasking the box. | |
| ~MDGridBox () override | |
| Destructor. | |
Public Member Functions inherited from Mantid::DataObjects::MDBoxBase< MDE, nd > | |
| virtual size_t | addEvents (const std::vector< MDE > &events) |
| Add several events, starting and stopping at particular point in a vector. | |
| virtual size_t | addEventsUnsafe (const std::vector< MDE > &events) |
| Add all of the events contained in a vector, with: | |
| void | calcVolume () override |
| Compute the volume of the box by simply multiplying each dimension range. | |
| const IMDNode * | getBoxAtCoord (const coord_t *) override |
| Returns the lowest-level box at the given coordinates. | |
| Mantid::API::BoxController * | getBoxController () const override |
| Mantid::API::BoxController * | getBoxController () override |
| coord_t | getBoxSize (size_t d) |
| For testing: return the internal-stored size of each box in each dimension. | |
| void | getCenter (coord_t *const center) const override |
| Get the center of the box. | |
| unsigned int | getCoordType () const override |
| uint32_t | getDepth () const override |
| For testing, mostly: return the recursion depth of this box. | |
| signal_t | getError () const override |
| Returns the integrated error from all points within. | |
| signal_t | getErrorSquared () const override |
| Returns the integrated error squared from all points within. | |
| virtual signal_t | getErrorSquaredNormalized () const |
| Returns the integrated error squared from all points within, normalized for the cell volume. | |
| 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. | |
| std::string | getEventType () const override |
| Mantid::Geometry::MDDimensionExtents< coord_t > & | getExtents (size_t dim) override |
| Get the extents for this box. | |
| std::string | getExtentsStr () const |
| Returns the extents as a string, for convenience. | |
| size_t | getID () const override |
| coord_t | getInverseVolume () const override |
| Return the inverse of the volume of the cell. | |
| const IMDNode * | getParent () const override |
| Return a pointer to the parent box (const) | |
| IMDNode * | getParent () override |
| Return a pointer to the parent box. | |
| signal_t | getSignal () const override |
| Returns the integrated signal from all points within. | |
| signal_t | getSignalNormalized () const override |
| Returns the integrated signal from all points within, normalized for the cell volume. | |
| virtual signal_t | getTotalWeight () const |
| Returns the total weight of all events within. | |
| std::vector< Mantid::Kernel::VMD > | getVertexes () const override |
| Return the vertices of corners of the box. | |
| std::unique_ptr< coord_t[]> | getVertexesArray (size_t &numVertices) const override |
| Return the vertices of every corner of the box, but as a bare array of length numVertices * nd. | |
| std::unique_ptr< coord_t[]> | getVertexesArray (size_t &numVertices, const size_t outDimensions, const bool *maskDim) const override |
| Return the vertices of every corner of the box, but to a reduced number of dimensions. | |
| coord_t | getVolume () const |
| Return the volume of the cell. | |
| bool | isLeaf () const override final |
| Is this node a leaf: getNumChildren() == 0. | |
| MDBoxBase (const MDBoxBase< MDE, nd > &box, Mantid::API::BoxController *const otherBC) | |
| Copy constructor. | |
| MDBoxBase (Mantid::API::BoxController *const boxController, const uint32_t depth, const size_t boxID, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector) | |
| Constructor with extents. | |
| MDBoxBase (Mantid::API::BoxController *const boxController=nullptr, const uint32_t depth=0, const size_t boxID=UNDEF_SIZET) | |
| Default constructor. | |
| void | setDepth (uint32_t depth) |
| For testing, mostly: set the recursion depth of this box. | |
| void | setErrorSquared (const signal_t ErrorSquared) override |
| Sets the integrated error squared from all points within (mostly used for testing) | |
| 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. | |
| void | setExtents (double min[nd], double max[nd]) |
| Set the extents of this box. | |
| void | setExtents (size_t dim, double min, double max) |
| Set the extents of this box. | |
| void | setID (const size_t &newID) override |
| sets the special id, which specify the position of this node in the chain linearly ordered nodes | |
| void | setInverseVolume (const coord_t invVolume) override |
| Sets the inverse of the volume of the cell. | |
| void | setParent (IMDNode *parent) override |
| Return a pointer to the parent box. | |
| void | setSignal (const signal_t signal) override |
| Sets the integrated signal from all points within (mostly used for testing) | |
| virtual void | setTotalWeight (const signal_t total) |
| Sets the total weight from all points within (mostly used for testing) | |
| void | transformDimensions (std::vector< double > &scaling, std::vector< double > &offset) override |
| Transform the dimensions contained in this box x' = x*scaling + offset. | |
Private Member Functions | |
| size_t | calculateChildIndex (const MDE &event) const |
| Compute the index of the child box for the given event. | |
| size_t | computeSizesFromSplit () |
| Compute some data from the split[] array and the extents. | |
| void | fillBoxShell (const size_t tot, const coord_t ChildInverseVolume) |
| Internal function to do main job of filling in a GridBox contents (part of the constructor) | |
| size_t | getLinearIndex (size_t *indices) const |
| Helper function to get the index into the linear array given an array of indices for each dimension (0 to nd) | |
| size_t | initGridBox () |
| common part of MDGridBox contstructor; | |
| MDGridBox ()=default | |
| Private constructor as it does not work without box controller. | |
| MDGridBox (const MDGridBox< MDE, nd > &box) | |
| private default copy constructor as the only correct constructor is the one with box controller | |
Private Attributes | |
| coord_t | diagonalSquared |
| Length (squared) of the diagonal through every dimension = sum(
boxSize[i]^2 ) Used in some calculations like peak integration. | |
| std::vector< MDBoxBase< MDE, nd > * > | m_Children |
| 1D array of boxes contained within. | |
| double | m_SubBoxSize [nd] |
| size of each sub-box (the one this GridBox can be split into) in correspondent direction | |
| size_t | nPoints |
| Cached number of points contained (including all sub-boxes) | |
| size_t | numBoxes |
| How many boxes in the boxes vector? This is just to avoid boxes.size() calls. | |
| size_t | split [nd] |
| Each dimension is split into this many equally-sized boxes. | |
| size_t | splitCumul [nd] |
| Cumulative dimension splitting: split[n] = 1*split[0]*split[..]*split[n-1]. | |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::DataObjects::MDBoxBase< MDE, nd > | |
| void | calcCaches (const EventIterator &begin, const EventIterator &end) |
| Calculates caches if the events are known. | |
Protected Attributes inherited from Mantid::DataObjects::MDBoxBase< MDE, nd > | |
| Mantid::Geometry::MDDimensionExtents< coord_t > | extents [nd] |
| Array of MDDimensionStats giving the extents and other stats on the box dimensions. | |
| Mantid::API::BoxController *const | m_BoxController |
| The box splitting controller, shared with all boxes in the hierarchy. | |
| coord_t | m_centroid [nd] |
| std::mutex | m_dataMutex |
| Mutex for modifying the event list or box averages. | |
| uint32_t | m_depth |
| Recursion depth. | |
| signal_t | m_errorSquared |
| Cached total error (squared) from all points within. | |
| size_t | m_fileID |
| The id which specify location of this box in a linear chain of ordered boxes (e.g. | |
| coord_t | m_inverseVolume |
| Inverse of the volume of the cell, to be used for normalized signal. | |
| Mantid::API::IMDNode * | m_parent |
| Pointer to the parent of this box. NULL if no parent. | |
| signal_t | m_signal |
| Cached total signal from all points within. | |
| signal_t | m_totalWeight |
| Cached total weight of all events Set when refreshCache() is called. | |
Templated class for a GRIDDED multi-dimensional event "box".
A MDGridBox contains a dense array with nd dimensions of MDBoxBase'es, each being either a regular MDBox or a MDGridBox itself.
This means that MDGridBoxes can be recursively gridded finer and finer.
| nd | :: the number of dimensions that each MDLeanEvent will be tracking. an int > 0. |
Definition at line 42 of file MDGridBox.h.
| using Mantid::DataObjects::MDGridBox::boxVector_t = std::vector<MDBoxBase<MDE, nd> *> |
Typedef for a vector of MDBoxBase pointers.
Definition at line 202 of file MDGridBox.h.
| using Mantid::DataObjects::MDGridBox::sptr = std::shared_ptr<MDGridBox<MDE, nd> > |
Typedef for a shared pointer to a MDGridBox.
Definition at line 199 of file MDGridBox.h.
| Mantid::DataObjects::MDGridBox::MDGridBox | ( | std::shared_ptr< API::BoxController > & | bc, |
| const uint32_t | depth, | ||
| const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > & | extentsVector | ||
| ) |
convenience Constructor, taking the shared pointer and extracting const pointer from it
| bc | :: shared pointer to the BoxController, owned by workspace |
| depth | :: recursive split depth |
| extentsVector | :: size of the box |
Definition at line 57 of file MDGridBox.hxx.
| Mantid::DataObjects::MDGridBox::MDGridBox | ( | Mantid::API::BoxController *const | bc, |
| const uint32_t | depth, | ||
| const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > & | extentsVector | ||
| ) |
Constructor with a box controller.
| bc | :: poineter to the BoxController, owned by workspace |
| depth | :: recursive split depth |
| extentsVector | :: size of the box |
Definition at line 44 of file MDGridBox.hxx.
| Mantid::DataObjects::MDGridBox::MDGridBox | ( | MDBox< MDE, nd > * | box | ) |
Constructor.
| box | :: MDBox containing the events to split |
Definition at line 92 of file MDGridBox.hxx.
References Mantid::Geometry::d, and Mantid::Geometry::split().
| Mantid::DataObjects::MDGridBox::MDGridBox | ( | const MDGridBox< MDE, nd > & | other, |
| Mantid::API::BoxController *const | otherBC | ||
| ) |
Copy constructor.
| other | :: MDGridBox to copy |
| otherBC | :: mandatory pointer to other box controller, which will split this box. if it the same BC, as the one for the copied box, it needs to be taken explicitly from the copied box. |
Definition at line 176 of file MDGridBox.hxx.
References Mantid::Geometry::d, and Mantid::Geometry::split().
|
override |
|
private |
private default copy constructor as the only correct constructor is the one with box controller
|
privatedefault |
Private constructor as it does not work without box controller.
|
inlineoverridevirtual |
Add a single MDLeanEvent to the grid box.
If the boxes contained within are also gridded, this will recursively push the event down to the deepest level. Warning! No bounds checking is done (for performance). It must be known that the event is within the bounds of the grid box before adding.
Note! nPoints, signal and error must be re-calculated using refreshCache() after all events have been added.
| event | :: reference to a MDLeanEvent to add. |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 1631 of file MDGridBox.hxx.
Referenced by Mantid::DataObjects::IF_EVENT< MDE, nd >::EXEC().
|
inlineoverridevirtual |
Add a single MDLeanEvent to the grid box.
If the boxes contained within are also gridded, this will recursively push the event down to the deepest level.
Warning! No bounds checking is done (for performance). It must be known that the event is within the bounds of the grid box before adding.
Warning! Call is NOT thread-safe. Only 1 thread should be writing to this box (or any child boxes) at a time
Note! nPoints, signal and error must be re-calculated using refreshCache() after all events have been added.
| event | :: reference to a MDEvent to add. |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 1662 of file MDGridBox.hxx.
|
override |
Create event from the input data and add it to the box.
| Signal | :: events signal |
| errorSq | :: events Error squared |
| point | :: reference to the vector of MDEvent coordinates |
| expInfoIndex | :: run index |
| goniometerIndex | :: goniometer index |
| detectorId | :: detector's ID |
Definition at line 1594 of file MDGridBox.hxx.
|
override |
Create and Add several (N) events into correspondent boxes; If the event is out/at of bounds it may be placed in very peculiar place!
| sigErrSq | :: vector of N-signals and errors where errror follows signal |
| Coord | :: vector of MD event coordinates, nd(number of dimensions) coordinates for each event |
| expInfoIndex | :: vector of experiment info indexes for N events. |
| goniometerIndex | :: vector of goniometer info indices for N events |
| detectorId | :: vector of detector's ID for N events. |
Definition at line 1575 of file MDGridBox.hxx.
|
override |
Create MDEvent and add it to the box, in a NON-THREAD-SAFE manner.
No lock is performed. This is only safe if no 2 threads will try to add to the same box at the same time.
| Signal | :: events signal |
| errorSq | :: events Error squared |
| point | :: reference to the MDEvent coordinates |
| expInfoIndex | :: run index |
| goniometerIndex | :: goniometer index |
| detectorId | :: detector's ID |
Definition at line 1612 of file MDGridBox.hxx.
|
inlineoverride |
The function used to satisfy IMDNode interface but the physical meaning is unclear.
Definition at line 178 of file MDGridBox.h.
|
inlineoverride |
The function used to satisfy IMDNode interface but the physical meaning is unclear.
Definition at line 185 of file MDGridBox.h.
|
private |
Compute the index of the child box for the given event.
| event | A reference to an event |
Definition at line 1726 of file MDGridBox.hxx.
References Mantid::Geometry::d.
|
finaloverridevirtual |
Calculates caches for grid box recursively, assuming leafs have computed values.
Calculates caches for MDGridBoxes based on children caches, does nothing with MDBoxes
Reimplemented from Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 376 of file MDGridBox.hxx.
|
overridevirtual |
Perform centerpoint binning of events, with bins defined in axes perpendicular to the axes of the workspace.
| 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) |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 771 of file MDGridBox.hxx.
References Mantid::Geometry::d, and Mantid::Geometry::split().
|
overridevirtual |
Find the centroid of all events contained within by doing a weighted average of their coordinates.
| radiusTransform | :: nd-to-1 coordinate transformation that converts from these dimensions to the distance (squared) from the center of the sphere. | |
| radiusSquared | :: radius^2 below which to integrate | |
| [out] | centroid | :: array of size [nd]; its centroid will be added |
| [out] | signal | :: set to the integrated signal |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 1281 of file MDGridBox.hxx.
References Mantid::API::IMDNode::centroidSphere(), and Mantid::API::IMDNode::getCenter().
|
override |
Clear any points contained.
Definition at line 253 of file MDGridBox.hxx.
Referenced by ~MDGridBox().
|
inlineoverride |
Definition at line 69 of file MDGridBox.h.
|
override |
Recursively clear the file-backed information stored in mdBoxes from the boxes if such information exists.
| loadDiskBackedData | – if true, load the data initially saved to HDD before breaking connection between the file and memory if false – just forget about the data on the HDD not entirely fool-proof, as if the data is actually loaded is controlled by isLoaded switch in ISaveable and this switch has to be set up correctly |
Definition at line 1715 of file MDGridBox.hxx.
|
private |
Compute some data from the split[] array and the extents.
Definition at line 222 of file MDGridBox.hxx.
References Mantid::Geometry::d, and Mantid::Geometry::split().
|
private |
Internal function to do main job of filling in a GridBox contents (part of the constructor)
Definition at line 121 of file MDGridBox.hxx.
References Mantid::Geometry::d, Mantid::Geometry::split(), and UNDEF_SIZET.
|
inlineoverridevirtual |
General binning method for any shape.
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 146 of file MDGridBox.h.
|
override |
Returns the lowest-level box at the given coordinates.
| coords | :: nd-sized array of the coordinate of the point to look at |
Definition at line 633 of file MDGridBox.hxx.
References Mantid::Geometry::d, index, and Mantid::Geometry::x.
|
inline |
For testing: get (a reference to) the vector of boxes.
Definition at line 173 of file MDGridBox.h.
|
finaloverride |
Return all boxes contained within.
| outBoxes | :: vector to fill |
| cond | :: condition to check (leaves on the tree) |
Definition at line 621 of file MDGridBox.hxx.
|
override |
Return all boxes contained within.
| outBoxes | :: vector to fill |
| maxDepth | :: max depth value of the returned boxes. |
| leafOnly | :: if true, only add the boxes that are no more subdivided (leaves on the tree) |
Definition at line 413 of file MDGridBox.hxx.
|
override |
Return all boxes contained within, limited by an implicit function.
This method evaluates each vertex to see how it is contained by the implicit function. For example, if there are 4x4 boxes, there are 5x5 vertices to evaluate.
All boxes that might be touching the implicit function are returned (including ones that overlap without any point actually in the function).
| outBoxes | :: vector to fill |
| maxDepth | :: max depth value of the returned boxes. |
| leafOnly | :: if true, only add the boxes that are no more subdivided (leaves on the tree) |
| function | :: implicitFunction pointer |
Definition at line 449 of file MDGridBox.hxx.
References Mantid::Geometry::d, Mantid::API::IMDNode::getBoxes(), and Mantid::Geometry::split().
|
inlineoverride |
The function used to satisfy IMDNode interface but the physical meaning is unclear.
Definition at line 192 of file MDGridBox.h.
|
override |
Get a child box.
| index | :: index into the array, within range 0..getNumChildren()-1 |
Definition at line 298 of file MDGridBox.hxx.
References index.
| size_t Mantid::DataObjects::MDGridBox::getChildIndexFromID | ( | size_t | childId | ) | const |
Get the child index from its ID.
| childId | :: ID of the child you want |
Definition at line 691 of file MDGridBox.hxx.
References index.
|
override |
Recursiveluy calculates the amount of the data located in memory. Slow.
Definition at line 268 of file MDGridBox.hxx.
|
overridevirtual |
Allocate and return a vector with a copy of all events contained.
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 398 of file MDGridBox.hxx.
|
inlineoverride |
get const object responsible for saving the box to a file.
Definition at line 63 of file MDGridBox.h.
|
inlineoverride |
get object responsible for saving the box to a file.
Definition at line 59 of file MDGridBox.h.
|
override |
Getter for the masking status of the gridded box.
Definition at line 1500 of file MDGridBox.hxx.
References Mantid::API::IMDNode::getIsMasked().
|
inlineprivate |
Helper function to get the index into the linear array given an array of indices for each dimension (0 to nd)
| indices | :: array of size[nd] |
Definition at line 329 of file MDGridBox.hxx.
References Mantid::Geometry::d.
|
inlineoverride |
Uses the cached value of points stored in the grid box.
Definition at line 93 of file MDGridBox.h.
|
override |
Definition at line 291 of file MDGridBox.hxx.
Referenced by Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setMinRecursionDepth().
|
override |
Returns the number of dimensions in this box.
Definition at line 264 of file MDGridBox.hxx.
|
override |
Returns the number of un-split MDBoxes in this box (recursively including all children)
Definition at line 279 of file MDGridBox.hxx.
|
inlineoverride |
Definition at line 96 of file MDGridBox.h.
|
private |
common part of MDGridBox contstructor;
Definition at line 65 of file MDGridBox.hxx.
References Mantid::Geometry::d, and Mantid::Geometry::split().
|
overridevirtual |
Integrate the signal within a sphere; for example, to perform single-crystal peak integration.
The CoordTransform object could be used for more complex shapes, e.g. "lentil" integration, as long as it reduces the dimensions to a single value.
| radiusTransform | :: nd-to-1 coordinate transformation that converts from these dimensions to the distance (squared) from the center of the sphere. | |
| radius | :: radius below which to integrate | |
| length | :: length below which to integrate | |
| signal | [out] :: set to the integrated signal | |
| errorSquared | [out] :: set to the integrated squared error. | |
| [out] | signal_fit | :: evaluation parameter on fit |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 1321 of file MDGridBox.hxx.
References Mantid::Geometry::d, Mantid::API::IMDNode::getCenter(), Mantid::API::IMDNode::getErrorSquared(), Mantid::API::IMDNode::getEventsData(), Mantid::API::IMDNode::getSignal(), Mantid::API::IMDNode::integrateCylinder(), and Mantid::Geometry::split().
|
overridevirtual |
std::cout << "vertex at " << vertexCoord[0] << ", " << vertexCoord[1] << ", " << vertexCoord[2] << " is contained\n";
std::cout << "... added 1 vertex to box " << boxes[linearIndex]->getExtentsStr() << "\n"; std::cout << "Depth " << this->getDepth() << " with " << numFullyContained << " fully contained; " << numPartiallyContained << " partial. Signal = " << signal <<"\n"; Integrate the signal within a sphere; for example, to perform single-crystal peak integration. The CoordTransform object could be used for more complex shapes, e.g. "lentil" integration, as long as it reduces the dimensions to a single value.
| radiusTransform | :: nd-to-1 coordinate transformation that converts from these dimensions to the distance (squared) from the center of the sphere. |
| radiusSquared | :: radius^2 below which to integrate |
| signal | [out] :: set to the integrated signal |
| errorSquared | [out] :: set to the integrated squared error. |
| innerRadiusSquared | :: radius^2 above which to integrate |
| useOnePercentBackgroundCorrection | :: use extra correction |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
Definition at line 1092 of file MDGridBox.hxx.
References Mantid::Geometry::d, and Mantid::Geometry::split().
|
inlineoverride |
to avoid casting (which need also the number of dimensions) method say if Node is a box.
if not, it is gridbox
Definition at line 107 of file MDGridBox.h.
|
inlineoverride |
Load the box data of specified size from the disk location provided using the class, respoinsible for the file IO.
Definition at line 83 of file MDGridBox.h.
|
inlineoverride |
Load the box data of specified size from the disk location provided using the class, responsible for the file IO.
Overload that allows passing temporary memory
Definition at line 78 of file MDGridBox.h.
|
override |
Setter for masking the box.
Definition at line 1514 of file MDGridBox.hxx.
References Mantid::API::IMDNode::mask().
|
override |
Refresh the cache of nPoints, signal and error, by adding up all boxes (recursively).
MDBoxes' totals are used directly.
| ts | :: ThreadScheduler pointer to perform the caching in parallel. If NULL, it will be performed in series. |
Definition at line 344 of file MDGridBox.hxx.
|
inlineoverride |
Definition at line 85 of file MDGridBox.h.
|
inlineoverride |
Save the box at specific disk position using the class, respoinsible for the file IO.
Definition at line 74 of file MDGridBox.h.
|
inline |
Sets particular child MDgridBox at the index, specified by the input parameters.
| index | – the position of the new child in the list of GridBox children |
| newChild | – the pointer to the new child grid box |
Definition at line 1682 of file MDGridBox.hxx.
References index.
|
override |
Directly set the children of the MDGridBox.
Used in file loading. Should not be called on a box with children; the existing children are NOT deleted.
| otherBoxes,: | reference to a vector of boxes containing the children |
| indexStart | :: start point in the vector |
| indexEnd | :: end point in the vector, not-inclusive |
Definition at line 309 of file MDGridBox.hxx.
|
override |
Make the box file-backed without knowing its position on the HDD.
Works recursively through all children
Definition at line 1698 of file MDGridBox.hxx.
|
override |
Recursively make all underlaying boxes file-backed.
Recursively make this and all underlaying boxes file-backed.
Not(yet?) implemented for gridboxes
Definition at line 1690 of file MDGridBox.hxx.
|
inline |
Definition at line 88 of file MDGridBox.h.
References n.
|
override |
Goes through all the sub-boxes and splits them if they contain enough events to be worth it.
| ts | :: optional ThreadScheduler * that will be used to parallelize recursive splitting. Set to NULL to do it serially. |
Definition at line 706 of file MDGridBox.hxx.
References Mantid::DataObjects::MDBox::getDataInMemorySize(), Mantid::DataObjects::MDBoxBase::getDepth(), Mantid::DataObjects::MDBox::getISaveable(), Mantid::DataObjects::MDBox::getNPoints(), splitAllIfNeeded(), and Mantid::DataObjects::MDBox::splitAllIfNeeded().
Referenced by splitAllIfNeeded().
| void Mantid::DataObjects::MDGridBox::splitContents | ( | size_t | index, |
| Kernel::ThreadScheduler * | ts = nullptr |
||
| ) |
Split a box that is contained in the GridBox, at the given index, into a MDGridBox.
Thread-safe as long as 'index' is different for all threads.
| index | :: index into the boxes vector. Warning: No bounds check is made, don't give stupid values! |
| ts | :: optional ThreadScheduler * that will be used to parallelize recursive splitting. Set to NULL for no recursive splitting. |
Definition at line 661 of file MDGridBox.hxx.
References Mantid::DataObjects::MDBoxBase::getDepth(), and index.
Referenced by Mantid::DataObjects::MDEventWorkspace< MDE, nd >::setMinRecursionDepth().
|
override |
Transform the dimensions contained in this box x' = x*scaling + offset.
NON-RECURSIVE!
| scaling | :: multiply each coordinate by this value. |
| offset | :: after multiplying, add this offset. |
Definition at line 213 of file MDGridBox.hxx.
References Mantid::DataObjects::MDBoxBase::transformDimensions().
|
override |
Setter for unmasking the box.
Definition at line 1523 of file MDGridBox.hxx.
References Mantid::API::IMDNode::unmask().
|
private |
Length (squared) of the diagonal through every dimension = sum( boxSize[i]^2 ) Used in some calculations like peak integration.
Definition at line 228 of file MDGridBox.h.
|
private |
1D array of boxes contained within.
These map to the nd-array.
Definition at line 223 of file MDGridBox.h.
|
private |
size of each sub-box (the one this GridBox can be split into) in correspondent direction
Definition at line 215 of file MDGridBox.h.
|
private |
Cached number of points contained (including all sub-boxes)
Definition at line 231 of file MDGridBox.h.
|
private |
How many boxes in the boxes vector? This is just to avoid boxes.size() calls.
Definition at line 219 of file MDGridBox.h.
|
private |
Each dimension is split into this many equally-sized boxes.
Definition at line 209 of file MDGridBox.h.
|
private |
Cumulative dimension splitting: split[n] = 1*split[0]*split[..]*split[n-1].
Definition at line 212 of file MDGridBox.h.