|
Mantid
|
Templated class for a multi-dimensional event "box". More...
#include <MDBox.h>
Public Types | |
| using | EventIterator = typename std::vector< MDE >::const_iterator |
| using | sptr = std::shared_ptr< MDBox< MDE, nd > > |
| Typedef for a shared pointer to a MDBox. | |
| using | vec_t = std::vector< MDE > |
| Typedef for a vector of the conatined events. | |
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 &Evnt) override |
| Add a MDLeanEvent to the box. | |
| size_t | addEvents (const std::vector< MDE > &events) override |
| Add Add all events . | |
| size_t | addEventsUnsafe (const std::vector< MDE > &events) override |
| Add all of the events contained in a vector, with: | |
| size_t | addEventUnsafe (const MDE &Evnt) override |
| Add a MDLeanEvent to the box, in a NON-THREAD-SAFE manner. | |
| 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 > &goniometernIndex, const std::vector< uint32_t > &detectorId) override |
| Create and Add several events. | |
| void | buildAndAddEventUnsafe (const signal_t Signal, const signal_t errorSq, const std::vector< coord_t > &point, uint16_t expInfoIndex, uint16_t goniometernIndex, uint32_t detectorId) override |
| Create MDEvent and add it to the box, in a NON-THREAD-SAFE manner. | |
| void | calculateCentroid (coord_t *centroid) const override |
| Calculate the centroid of this box. | |
| void | calculateCentroid (coord_t *centroid, const int expInfoIndex) const override |
| Calculate the centroid of this box. | |
| void | calculateDimensionStats (MDDimensionStats *stats) const |
| Calculate the statistics for each dimension of this MDBox, using all the contained events. | |
| void | centerpointBin (MDBin< MDE, nd > &bin, bool *fullyContained) const override |
| Perform centerpoint binning of events. | |
| 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 |
| drop events data from memory but keep averages (and file-backed info) | |
| void | clearFileBacked (bool loadDiskBackedData) override |
| clear file-backed information from the box if such information exists | |
| void | generalBin (MDBin< MDE, nd > &bin, Mantid::Geometry::MDImplicitFunction &function) const override |
| General (non-axis-aligned) centerpoint binning method. | |
| void | getBoxes (std::vector< API::IMDNode * > &boxes, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function) override |
| void | getBoxes (std::vector< API::IMDNode * > &boxes, size_t, bool) override |
| 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< MDBoxBase< MDE, nd > * > &boxes, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function) |
| Fill a vector with all the boxes up to a certain depth. | |
| void | getBoxes (std::vector< MDBoxBase< MDE, nd > * > &boxes, size_t, bool) |
| Fill a vector with all the boxes up to a certain depth. | |
| coord_t * | getCentroid () const override |
| Return the centroid of this box. | |
| API::IMDNode * | getChild (size_t) override |
| Return the indexth child MDBoxBase. | |
| const std::vector< MDE > & | getConstEvents () const |
| Get vector of constant events to use. | |
| size_t | getDataInMemorySize () const override |
| std::vector< MDE > & | getEvents () |
| Get vector of events to change. | |
| const std::vector< MDE > & | getEvents () const |
| std::vector< MDE > * | getEventsCopy () override |
| Allocate and return a vector with a copy of all events contained. | |
| void | getEventsData (std::vector< coord_t > &coordTable, size_t &nColumns) const override |
| The method to convert events in a box into a table of coordinates/signal/errors casted into coord_t type Used to save events from plain binary file. | |
| Kernel::ISaveable * | getISaveable () const override |
| Kernel::ISaveable * | getISaveable () override |
| bool | getIsMasked () const override |
| uint64_t | getNPoints () const override |
| Returns the total number of points (events) in this box either they are all in memory, or on disk or partially on memory and partially on disk for partially loaded object substantially relies on correct settings of wasSaved and isLoaded switches of iSaveable object. | |
| size_t | getNumChildren () const override |
| Get the # of children MDBoxBase'es (non-recursive) | |
| 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 (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 |
| Integrate the signal within a sphere; for example, to perform single-crystal peak integration. | |
| bool | isBox () const override |
| bool | isDataAdded () const |
| 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 and append them to exisiting events Clear events vector first if overwriting the exisitng events is necessary. | |
| 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, respoinsible for the file IO and append them to exisiting events Clear events vector first if overwriting the exisitng events is necessary. | |
| void | mask () override |
| Setter for masking the box. | |
| MDBox (const MDBox< MDE, nd > &other, Mantid::API::BoxController *const otherBC) | |
| Copy constructor. | |
| MDBox (Mantid::API::BoxController *const bc, const uint32_t depth, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector, EventIterator begin, EventIterator end) | |
| contructor for explicit creation of MDGridBox with known events in it | |
| MDBox (Mantid::API::BoxController *const splitter, const uint32_t depth, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector, const size_t nBoxEvents=UNDEF_SIZET, const size_t boxID=UNDEF_SIZET) | |
| Constructor. | |
| MDBox (Mantid::API::BoxController *const splitter, const uint32_t depth=0, const size_t nBoxEvents=UNDEF_SIZET, const size_t boxID=UNDEF_SIZET) | |
| Constructor/default constructor. | |
| MDBox (Mantid::API::BoxController_sptr &splitter, const uint32_t depth, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector, const size_t nBoxEvents=UNDEF_SIZET, const size_t boxID=UNDEF_SIZET) | |
| Constructor. | |
| MDBox (Mantid::API::BoxController_sptr &splitter, const uint32_t depth=0, const size_t nBoxEvents=UNDEF_SIZET, const size_t boxID=UNDEF_SIZET) | |
| Convenience Constructor/default constructor for accepting shared pointer. | |
| void | refreshCache (Kernel::ThreadScheduler *=nullptr) override |
| Recalculate signal and various averages dependent on signal and the signal coordinates. | |
| void | releaseEvents () |
| For file-backed MDBoxes, this marks that the data vector is no longer "busy", and so it is safe for the MRU to cache it back to disk if needed. | |
| void | reserveMemoryForLoad (uint64_t) override |
| Reserve all the memory required for loading in one step. | |
| void | saveAt (API::IBoxControllerIO *const, uint64_t) const override |
| Save the box data to specific disk position using the class, responsible for the file IO. | |
| void | setChildren (const std::vector< API::IMDNode * > &, const size_t, const size_t) override |
| Sets the children from a vector of children. | |
| void | setEventsData (const std::vector< coord_t > &coordTable) override |
| The method to convert the table of data into vector of events Used to load events from plain binary file. | |
| void | setFileBacked () override |
| Make this box file-backed but its place on the file is not identified yet. | |
| void | setFileBacked (const uint64_t, const size_t, const bool) override |
| Make this box file-backed. | |
| void | splitAllIfNeeded (Mantid::Kernel::ThreadScheduler *=nullptr) override |
| 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. | |
| ~MDBox () override | |
| Destructor. | |
Public Member Functions inherited from Mantid::DataObjects::MDBoxBase< MDE, nd > | |
| virtual void | calculateGridCaches () |
| 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. | |
Protected Attributes | |
| std::vector< MDE > | data |
| Vector of MDEvent's, in no particular order. | |
| bool | m_bIsMasked |
| Flag indicating that masking has been applied. | |
| std::unique_ptr< Kernel::ISaveable > | m_Saveable |
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. | |
Private Member Functions | |
| void | initMDBox (const size_t nBoxEvents) |
| common part of mdBox constructor | |
| MDBox (const MDBox &) | |
| private default copy constructor as the only correct constructor is the one with the boxController; | |
Private Attributes | |
| std::vector< coord_t > | m_tableData |
| member to avoid reallocation | |
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. | |
Templated class for a multi-dimensional event "box".
A box is a container of MDLeanEvent's within a certain range of values within the nd dimensions. This range defines a n-dimensional "box" or rectangular prism.
This class is a simple list of points with no more internal structure.
| nd | :: the number of dimensions that each MDLeanEvent will be tracking. an int > 0. |
| using Mantid::DataObjects::MDBox::EventIterator = typename std::vector<MDE>::const_iterator |
| using Mantid::DataObjects::MDBox::sptr = std::shared_ptr<MDBox<MDE, nd> > |
| using Mantid::DataObjects::MDBox::vec_t = std::vector<MDE> |
| Mantid::DataObjects::MDBox::MDBox | ( | Mantid::API::BoxController_sptr & | splitter, |
| const uint32_t | depth = 0, |
||
| const size_t | nBoxEvents = UNDEF_SIZET, |
||
| const size_t | boxID = UNDEF_SIZET |
||
| ) |
Convenience Constructor/default constructor for accepting shared pointer.
| splitter | :: shared pointer to BoxController that controls how boxes split |
| depth | :: splitting depth of the new box. |
| nBoxEvents | :: number of events to reserve memory for. |
| boxID | :: id for the given box |
| Mantid::DataObjects::MDBox::MDBox | ( | Mantid::API::BoxController *const | splitter, |
| const uint32_t | depth = 0, |
||
| const size_t | nBoxEvents = UNDEF_SIZET, |
||
| const size_t | boxID = UNDEF_SIZET |
||
| ) |
| Mantid::DataObjects::MDBox::MDBox | ( | Mantid::API::BoxController_sptr & | splitter, |
| const uint32_t | depth, | ||
| const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > & | extentsVector, | ||
| const size_t | nBoxEvents = UNDEF_SIZET, |
||
| const size_t | boxID = UNDEF_SIZET |
||
| ) |
Constructor.
| splitter | :: BoxController that controls how boxes split |
| depth | :: splitting depth of the new box. |
| extentsVector | :: vector defining the extents of the box in all n-dimensions |
| nBoxEvents | :: number of events to reserve memory for. |
| boxID | :: id for the given box |
| Mantid::DataObjects::MDBox::MDBox | ( | Mantid::API::BoxController *const | splitter, |
| const uint32_t | depth, | ||
| const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > & | extentsVector, | ||
| const size_t | nBoxEvents = UNDEF_SIZET, |
||
| const size_t | boxID = UNDEF_SIZET |
||
| ) |
Constructor.
| splitter | :: BoxController that controls how boxes split |
| depth | :: splitting depth of the new box. |
| extentsVector | :: vector defining the extents |
| nBoxEvents | :: Initial number of events to reserve memory for. If left undefined, the memory will be allocated on request. |
| boxID | :: id for the given box |
| Mantid::DataObjects::MDBox::MDBox | ( | Mantid::API::BoxController *const | bc, |
| const uint32_t | depth, | ||
| const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > & | extentsVector, | ||
| EventIterator | begin, | ||
| EventIterator | end | ||
| ) |
contructor for explicit creation of MDGridBox with known events in it
| bc | :: shared pointer to the BoxController, owned by workspace |
| depth | :: recursive split depth |
| extentsVector | :: size of the box |
| begin | :: iterator to start |
| end | :: iterator before ened (not included) |
Definition at line 103 of file MDBox.hxx.
References Mantid::DataObjects::MDBoxBase::calcCaches(), data, Mantid::API::BoxController::isFileBacked(), and Mantid::DataObjects::MDBoxBase< MDE, nd >::m_BoxController.
| Mantid::DataObjects::MDBox::MDBox | ( | const MDBox< MDE, nd > & | other, |
| Mantid::API::BoxController *const | otherBC | ||
| ) |
|
override |
|
private |
private default copy constructor as the only correct constructor is the one with the boxController;
|
overridevirtual |
Add a MDLeanEvent to the box.
| Evnt | :: reference to a MDEvent to add. |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
|
overridevirtual |
Add Add all events .
No bounds checking is made!
| events | :: vector of events to be copied. |
Reimplemented from Mantid::DataObjects::MDBoxBase< MDE, nd >.
|
overridevirtual |
Add all of the events contained in a vector, with:
| events | :: Vector of MDEvent |
Reimplemented from Mantid::DataObjects::MDBoxBase< MDE, nd >.
|
overridevirtual |
Add a MDLeanEvent 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.
| Evnt | :: reference to a MDEvent to add. |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
|
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 of the experiment the event come from |
| goniometerIndex | :: 0-based index determines the goniometer settings when this event occurred |
| detectorId | :: the ID of the detector recoded the event |
|
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 vector of MDEvent coordinates |
| expInfoIndex | :: run index of the experiment the event come from |
| goniometerIndex | :: 0-based index determines the goniometer settings when this event occurred |
| detectorId | :: the ID of the detector recoded the event |
|
override |
Calculate the centroid of this box.
| centroid | [out] :: nd-sized array that will be set to the centroid. |
Definition at line 405 of file MDBox.hxx.
References Mantid::Geometry::d.
|
override |
Calculate the centroid of this box.
| centroid | [out] :: nd-sized array that will be set to the centroid. |
| expInfoIndex | [in] :: associated experiment-info index used to filter the events. |
Definition at line 433 of file MDBox.hxx.
References Mantid::Geometry::d.
| void Mantid::DataObjects::MDBox::calculateDimensionStats | ( | MDDimensionStats * | stats | ) | const |
Calculate the statistics for each dimension of this MDBox, using all the contained events.
| stats | :: nd-sized fixed array of MDDimensionStats, reset to 0.0 before! |
Definition at line 465 of file MDBox.hxx.
References Mantid::Geometry::d.
|
overridevirtual |
Perform centerpoint binning of events.
| 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 479 of file MDBox.hxx.
References Mantid::Geometry::d.
|
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 674 of file MDBox.hxx.
References Mantid::Geometry::d.
|
override |
|
override |
|
override |
clear file-backed information from the box 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 |
|
overridevirtual |
General (non-axis-aligned) centerpoint binning method.
TODO: TEST THIS!
| bin | :: a MDBin object giving the limits, aligned with the axes of the workspace, of where the non-aligned bin MIGHT be present. |
| function | :: a ImplicitFunction that will evaluate true for any coordinate that is contained within the (non-axis-aligned) bin. |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
|
override |
|
override |
|
finaloverride |
| void Mantid::DataObjects::MDBox::getBoxes | ( | std::vector< MDBoxBase< MDE, nd > * > & | boxes, |
| size_t | maxDepth, | ||
| bool | leafOnly, | ||
| Mantid::Geometry::MDImplicitFunction * | function | ||
| ) |
| void Mantid::DataObjects::MDBox::getBoxes | ( | std::vector< MDBoxBase< MDE, nd > * > & | boxes, |
| size_t | , | ||
| bool | |||
| ) |
|
override |
|
inlineoverride |
| const std::vector< MDE > & Mantid::DataObjects::MDBox::getConstEvents | ( | ) | const |
Get vector of constant events to use.
Returns a const reference to the events vector contained within.
Beware, that calling this funtion for file-based workspace sets dataBusy flag This flag prevents DB from clearing object from memory untill the events are released. One HAS TO call releaseEvents when finished using data on file-based WS to allow DB clearing them
VERY IMPORTANT: call MDBox::releaseEvents() when you are done accessing that data.
Definition at line 269 of file MDBox.hxx.
Referenced by Mantid::MDAlgorithms::BinMD::binMDBox(), Mantid::MDAlgorithms::CompareMDWorkspaces::compare2Boxes(), Mantid::MDAlgorithms::MinusMD::doMinus(), Mantid::MDAlgorithms::MergeMD::doPlus(), Mantid::MDAlgorithms::PlusMD::doPlus(), Mantid::DataObjects::MDBoxIterator::getEvents(), and Mantid::MDAlgorithms::SliceMD::slice().
|
inlineoverride |
Definition at line 87 of file MDBox.h.
Referenced by Mantid::DataObjects::MDGridBox::splitAllIfNeeded().
| std::vector< MDE > & Mantid::DataObjects::MDBox::getEvents | ( | ) |
Get vector of events to change.
Returns a reference to the events vector contained within.
Beware, that calling this funtion for file-based workspace sets both dataChanged and dataBusy flags first forces disk buffer to write the object contents to HDD when disk buffer is full and the second one prevents DB from clearing object from memory untill the events are released. One HAS TO call releaseEvents when finished using data on file-based WS
VERY IMPORTANT: call MDBox::releaseEvents() when you are done accessing that data.
Definition at line 243 of file MDBox.hxx.
Referenced by Mantid::MDAlgorithms::QTransform::applyCorrection(), Mantid::MDAlgorithms::ApplyDetailedBalanceMD::applyDetailedBalance(), Mantid::MDAlgorithms::SpectralMomentMD::applyScaling(), Mantid::MDAlgorithms::DgsScatteredTransmissionCorrectionMD::correctForTransmission(), Mantid::MDAlgorithms::MultiplyMD::execEventScalar(), Mantid::MDAlgorithms::FlippingRatioCorrectionMD::executeTemplatedMDE(), and Mantid::MDAlgorithms::FindPeaksMD::findPeaks().
| const std::vector< MDE > & Mantid::DataObjects::MDBox::getEvents | ( | ) | const |
|
overridevirtual |
Allocate and return a vector with a copy of all events contained.
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
|
override |
The method to convert events in a box into a table of coordinates/signal/errors casted into coord_t type Used to save events from plain binary file.
| coordTable | – vector of events parameters in the form signal, error, [detID,rinId], eventsCoordinates.... |
| nColumns | – number of parameters for each event |
|
override |
|
override |
Definition at line 160 of file MDBox.hxx.
Referenced by Mantid::DataObjects::MDGridBox::splitAllIfNeeded().
|
inlineoverride |
|
override |
Returns the total number of points (events) in this box either they are all in memory, or on disk or partially on memory and partially on disk for partially loaded object substantially relies on correct settings of wasSaved and isLoaded switches of iSaveable object.
Definition at line 225 of file MDBox.hxx.
Referenced by Mantid::MDAlgorithms::BinMD::binMDBox(), and Mantid::DataObjects::MDGridBox::splitAllIfNeeded().
|
inlineoverride |
|
override |
|
override |
|
inlineoverride |
|
private |
|
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 | |
| [out] | signal | :: set to the integrated signal |
| [out] | errorSquared | :: set to the integrated squared error. |
| [out] | signal_fit | :: evaluation parameter on fit |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
|
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. | |
| radiusSquared | :: radius^2 below which to integrate | |
| [out] | integratedSignal | :: set to the integrated signal |
| [out] | errorSquared | :: set to the integrated squared error. |
| innerRadiusSquared | :: radius^2 above which to integrate | |
| useOnePercentBackgroundCorrection | :: some bonus correction |
Implements Mantid::DataObjects::MDBoxBase< MDE, nd >.
|
inlineoverride |
| bool Mantid::DataObjects::MDBox::isDataAdded | ( | ) | const |
|
override |
Load the box data of specified size from the disk location provided using the class, respoinsible for the file IO and append them to exisiting events Clear events vector first if overwriting the exisitng events is necessary.
| FileSaver | – the pointer to the class, responsible for file IO |
| filePosition | – the place in the direct access file, where necessary data are located |
| nEvents | – number of events reqested to load |
|
override |
Load the box data of specified size from the disk location provided using the class, respoinsible for the file IO and append them to exisiting events Clear events vector first if overwriting the exisitng events is necessary.
| FileSaver | – the pointer to the class, responsible for file IO |
| filePosition | – the place in the direct access file, where necessary data are located |
| nEvents | – number of events reqested to load |
| tableDataTemp | – overload allows for passing previously allocated temporary memory |
|
override |
|
override |
Recalculate signal and various averages dependent on signal and the signal coordinates.
Refresh the cache.
For MDBox, if MDBOX_TRACK_SIGNAL_WHEN_ADDING is defined, then the signal/error is tracked on adding, so this does nothing.
beware, that it wrongly accumulates signal and error when part of the data is on file and and some recent data were not saved to the HDD before adding new data This actually means that refreshCache has to be called only once in events adding process
TODO #4734: sum the individual weights of each event?
| void Mantid::DataObjects::MDBox::releaseEvents | ( | ) |
For file-backed MDBoxes, this marks that the data vector is no longer "busy", and so it is safe for the MRU to cache it back to disk if needed.
Definition at line 294 of file MDBox.hxx.
Referenced by Mantid::MDAlgorithms::BinMD::binMDBox(), and Mantid::MDAlgorithms::CompareMDWorkspaces::compare2Boxes().
|
override |
Reserve all the memory required for loading in one step.
| size | – number of events to reserve for |
Definition at line 876 of file MDBox.hxx.
Referenced by Mantid::MDAlgorithms::LoadMD::doLoad().
|
override |
|
inlineoverride |
|
override |
|
override |
Make this box file-backed but its place on the file is not identified yet.
It will be identified by the disk buffer
Definition at line 835 of file MDBox.hxx.
References UNDEF_UINT64.
|
override |
Make this box file-backed.
| fileLocation | – the starting position of this box data are/should be located in the direct access file |
| fileSize | – the size this box data occupy in the file (in the units of the number of events) |
| markSaved | – set to true if the data indeed are physically there and one can indeed read then from there |
|
inlineoverride |
Definition at line 157 of file MDBox.h.
Referenced by Mantid::DataObjects::MDGridBox::splitAllIfNeeded().
|
override |
Transform the dimensions contained in this box x' = x*scaling + offset.
| scaling | :: multiply each coordinate by this value. |
| offset | :: after multiplying, add this offset. |
Definition at line 703 of file MDBox.hxx.
References Mantid::Geometry::d.
|
override |
|
mutableprotected |
|
protected |
|
mutableprotected |
|
private |