19namespace DataObjects {
21#ifndef __INTEL_COMPILER
44 MDGridBox(std::shared_ptr<API::BoxController> &bc,
const uint32_t depth,
65 void setFileBacked(
const uint64_t ,
const size_t ,
const bool )
override;
80 std::vector<coord_t> & )
override {
111 bool isBox()
const override {
return false; }
117 void setChildren(
const std::vector<API::IMDNode *> &otherBoxes,
const size_t indexStart,
118 const size_t indexEnd)
override;
120 void getBoxes(std::vector<API::IMDNode *> &outBoxes,
size_t maxDepth,
bool leafOnly)
override;
121 void getBoxes(std::vector<API::IMDNode *> &outBoxes,
size_t maxDepth,
bool leafOnly,
124 void getBoxes(std::vector<API::IMDNode *> &outBoxes,
const std::function<
bool(
API::IMDNode *)> &cond)
final override;
140 uint16_t expInfoIndex, uint16_t goniometerIndex, uint32_t detectorId)
override;
142 uint16_t expInfoIndex, uint16_t goniometerIndex, uint32_t detectorId)
override;
143 size_t buildAndAddEvents(
const std::vector<signal_t> &sigErrSq,
const std::vector<coord_t> &Coord,
144 const std::vector<uint16_t> &expInfoIndex,
const std::vector<uint16_t> &goniometerIndex,
145 const std::vector<uint32_t> &detectorId)
override;
154 const bool useOnePercentBackgroundCorrection =
true)
const override;
160 signal_t &signal,
signal_t &errorSquared, std::vector<signal_t> &signal_fit)
const override;
170 bool getIsMasked() const override;
172 void mask() override;
174 void unmask() override;
183 throw(std::runtime_error(
"This function should not be called on MDGridBox "
184 "(as its meaning for MDbox is dubious too)"));
190 throw(std::runtime_error(
"This function should not be called on MDGridBox "
191 "(as its meaning for MDbox is dubious too)"));
197 throw(std::runtime_error(
"This function should not be called on MDGridBox "
198 "(as its meaning for MDbox is dubious too)"));
203 using sptr = std::shared_ptr<MDGridBox<MDE, nd>>;
216 size_t splitCumul[nd];
219 double m_SubBoxSize[nd];
252#ifndef __INTEL_COMPILER
std::map< DeltaEMode::Type, std::string > index
#define TMDE_CLASS
Macro to make declaring template classes faster.
This class is used by MDBox and MDGridBox in order to intelligently determine optimal behavior.
The header describes interface to IO Operations perfomed by the box controller May be replaced by a b...
MDBin : Class describing a single bin in a dense, Multidimensional histogram.
Templated super-class of a multi-dimensional event "box".
Templated class for a multi-dimensional event "box".
Templated class for a GRIDDED multi-dimensional event "box".
size_t getDataInMemorySize() const override
size_t addEventUnsafe(const MDE &event) override
Add a single event, with no mutex locking.
void setChildren(const std::vector< API::IMDNode * > &otherBoxes, const size_t indexStart, const size_t indexEnd) override
std::vector< MDBoxBase< MDE, nd > * > m_Children
1D array of boxes contained within.
const API::IMDNode * getBoxAtCoord(const coord_t *coords) 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.
size_t computeSizesFromSplit()
void splitAllIfNeeded(Kernel::ThreadScheduler *ts=nullptr) override
void setFileBacked(const uint64_t, const size_t, const bool) override
Recursively make all underlaying boxes file-backed.
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,...
MDGridBox()=default
Private constructor as it does not work without box controller.
coord_t diagonalSquared
Length (squared) of the diagonal through every dimension = sum( boxSize[i]^2 ) Used in some calculati...
size_t calculateChildIndex(const MDE &event) const
Compute the index of the child box for the given event.
Kernel::ISaveable * getISaveable() override
get object responsible for saving the box to a file.
void centerpointBin(MDBin< MDE, nd > &bin, bool *fullyContained) const override
Perform centerpoint binning of events.
void setNPoints(const uint64_t &n)
std::shared_ptr< MDGridBox< MDE, nd > > sptr
Typedef for a shared pointer to a MDGridBox.
void generalBin(MDBin< MDE, nd > &, Mantid::Geometry::MDImplicitFunction &) const override
General binning method for any shape.
void calculateGridCaches() override final
std::vector< MDE > * getEventsCopy() override
Return a copy of contained events.
size_t addEvent(const MDE &event) override
Add a single event.
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
void setChild(size_t index, MDGridBox< MDE, nd > *newChild)
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,...
void setFileBacked() override
void getBoxes(std::vector< API::IMDNode * > &outBoxes, const std::function< bool(API::IMDNode *)> &cond) final override
size_t nPoints
Cached number of points contained (including all sub-boxes)
coord_t * getCentroid() const override
The function used to satisfy IMDNode interface but the physical meaning is unclear.
void transformDimensions(std::vector< double > &scaling, std::vector< double > &offset) override
MDGridBox(const MDGridBox< MDE, nd > &other, Mantid::API::BoxController *const otherBC)
void refreshCache(Kernel::ThreadScheduler *ts=nullptr) override
void centroidSphere(Mantid::API::CoordTransform &radiusTransform, const coord_t radiusSquared, coord_t *centroid, signal_t &signal) const override
Find the centroid around a sphere.
size_t getChildIndexFromID(size_t childId) const
bool isBox() const override
to avoid casting (which need also the number of dimensions) method say if Node is a box.
MDGridBox(std::shared_ptr< API::BoxController > &bc, const uint32_t depth, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector)
size_t getNumDims() const override
MDGridBox(Mantid::API::BoxController *const bc, const uint32_t depth, const std::vector< Mantid::Geometry::MDDimensionExtents< coord_t > > &extentsVector)
void clearFileBacked(bool loadDiskBackedData) override
size_t getNumChildren() const override
MDGridBox(MDBox< MDE, nd > *box)
void reserveMemoryForLoad(uint64_t) override
MDGridBox(const MDGridBox< MDE, nd > &box)
private default copy constructor as the only correct constructor is the one with box controller
void getBoxes(std::vector< API::IMDNode * > &outBoxes, size_t maxDepth, bool leafOnly) override
uint64_t getTotalDataSize() const override
void calculateCentroid(coord_t *, const int) const override
The function used to satisfy IMDNode interface but the physical meaning is unclear.
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
Kernel::ISaveable * getISaveable() const override
get const object responsible for saving the box to a file.
size_t numBoxes
How many boxes in the boxes vector? This is just to avoid boxes.size() calls.
void calculateCentroid(coord_t *) const override
The function used to satisfy IMDNode interface but the physical meaning is unclear.
std::vector< MDBoxBase< MDE, nd > * > boxVector_t
Typedef for a vector of MDBoxBase pointers.
size_t initGridBox()
common part of MDGridBox contstructor;
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
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
Cylinder (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
Sphere (peak) integration.
size_t getLinearIndex(size_t *indices) const
API::IMDNode * getChild(size_t index) override
void getBoxes(std::vector< API::IMDNode * > &outBoxes, size_t maxDepth, bool leafOnly, Mantid::Geometry::MDImplicitFunction *function) override
void clearDataFromMemory() override
void fillBoxShell(const size_t tot, const coord_t ChildInverseVolume)
size_t getNumMDBoxes() const override
void splitContents(size_t index, Kernel::ThreadScheduler *ts=nullptr)
uint64_t getNPoints() const override
Uses the cached value of points stored in the grid box.
Simple class that holds the extents (min/max) of a given dimension in a MD workspace or MDBox.
An "ImplicitFunction" defining a hyper-cuboid-shaped region in N dimensions.
An interface for objects that can be cached or saved to disk.
The ThreadScheduler object defines how tasks are allocated to threads and in what order.
void split(const int A, int &S, int &V)
Split a number into the sign and positive value.
Helper class which provides the Collimation Length for SANS instruments.
float coord_t
Typedef for the data type to use for coordinate axes in MD objects such as MDBox, MDEventWorkspace,...
double signal_t
Typedef for the signal recorded in a MDBox, etc.