20#include <boost/math/special_functions/round.hpp>
26#if (defined(__INTEL_COMPILER))
27#pragma warning disable 186
28#elif defined(__GNUC__)
29#pragma GCC diagnostic ignored "-Wtype-limits"
33namespace DataObjects {
46 :
MDBoxBase<MDE, nd>(bc, depth,
UNDEF_SIZET, extentsVector), numBoxes(0), m_Children(), diagonalSquared(0.f),
59 :
MDBoxBase<MDE, nd>(bc.get(), depth,
UNDEF_SIZET, extentsVector), numBoxes(0), m_Children(), diagonalSquared(0.f),
66 if (!this->m_BoxController)
67 throw std::runtime_error(
"MDGridBox::ctor(): No BoxController specified in box.");
72 std::optional<std::vector<size_t>> splitTopInto = this->m_BoxController->getSplitTopInto();
73 if (this->getDepth() == 0 && splitTopInto) {
74 for (
size_t d = 0;
d < nd;
d++)
75 split[
d] = splitTopInto.value()[
d];
77 for (
size_t d = 0;
d < nd;
d++)
78 split[
d] = this->m_BoxController->getSplitInto(
d);
82 size_t tot = computeSizesFromSplit();
84 throw std::runtime_error(
"MDGridBox::ctor(): Invalid splitting criterion (one was zero).");
93 :
MDBoxBase<MDE, nd>(*box, box->getBoxController()),
split(), splitCumul(), m_SubBoxSize(), numBoxes(0),
94 m_Children(), diagonalSquared(0.f), nPoints(0) {
95 size_t totalSize = initGridBox();
98 for (
size_t d = 0;
d < nd;
d++)
99 ChildVol *= m_SubBoxSize[
d];
102 fillBoxShell(totalSize,
coord_t(1. / ChildVol));
106 const std::vector<MDE> &events = box->getConstEvents();
108 for (
const auto &evnt : events)
113 this->nPoints = box->getNPoints();
120template <
typename MDE,
size_t nd>
123 this->m_Children.clear();
124 this->m_Children.reserve(tot);
125 this->numBoxes = tot;
128 for (
size_t d = 0;
d < nd;
d++)
136 size_t ID0 = this->m_BoxController->claimIDRange(tot);
138 for (
size_t i = 0; i < tot; i++) {
143 splitBox->setParent(
this);
146 for (
size_t d = 0;
d < nd;
d++) {
147 double min = double(this->extents[
d].getMin()) + double(indices[
d]) * m_SubBoxSize[
d];
148 double max = min + m_SubBoxSize[
d];
149 splitBox->setExtents(
d, min, max);
151 splitBox->setInverseVolume(ChildInverseVolume);
152 m_Children.emplace_back(splitBox);
156 for (
size_t d = 0;
d < nd - 1;
d++)
177 :
MDBoxBase<MDE, nd>(other, otherBC), numBoxes(other.numBoxes), m_Children(),
178 diagonalSquared(other.diagonalSquared), nPoints(other.nPoints) {
179 for (
size_t d = 0;
d < nd;
d++) {
181 splitCumul[
d] = other.splitCumul[
d];
182 m_SubBoxSize[
d] = other.m_SubBoxSize[
d];
186 m_Children.reserve(numBoxes);
187 for (
size_t i = 0; i < other.m_Children.size(); i++) {
193 newBox->setParent(
this);
194 m_Children.emplace_back(newBox);
195 }
else if (otherMDGridBox) {
197 newBox->setParent(
this);
198 m_Children.emplace_back(newBox);
200 throw std::runtime_error(
"MDGridBox::copy_ctor(): an unexpected child box type was found.");
215 this->computeSizesFromSplit();
226 for (
size_t d = 0;
d < nd;
d++) {
231 m_SubBoxSize[
d] =
static_cast<double>(this->extents[
d].getSize()) /
static_cast<double>(
split[
d]);
233 diagSum += m_SubBoxSize[
d] * m_SubBoxSize[
d];
235 diagonalSquared =
static_cast<coord_t>(diagSum);
245 auto it = m_Children.begin();
246 for (; it != m_Children.end(); ++it)
254 this->m_signal = 0.0;
255 this->m_errorSquared = 0.0;
256 auto it = m_Children.begin();
257 for (; it != m_Children.end(); ++it) {
270 for (
size_t i = 0; i < numBoxes; i++)
271 nPoints += m_Children[i]->getDataInMemorySize();
281 auto it = m_Children.begin();
282 for (; it != m_Children.end(); ++it) {
283 total += (*it)->getNumMDBoxes();
310 const size_t indexEnd) {
312 m_Children.reserve(indexEnd - indexStart + 1);
313 auto it = otherBoxes.begin() + indexStart;
314 auto it_end = otherBoxes.begin() + indexEnd;
316 for (; it != it_end; it++) {
318 m_Children.back()->setParent(
this);
320 numBoxes = m_Children.size();
330 size_t out_linear_index = 0;
331 for (
size_t d = 0;
d < nd;
d++)
332 out_linear_index += (indices[d] * splitCumul[d]);
333 return out_linear_index;
348 this->m_errorSquared = 0;
349 this->m_totalWeight = 0;
356 ibox->refreshCache();
359 nPoints += ibox->getNPoints();
360 this->m_signal += ibox->getSignal();
361 this->m_errorSquared += ibox->getErrorSquared();
362 this->m_totalWeight += ibox->getTotalWeight();
366 throw std::runtime_error(
"Not implemented");
380 this->m_errorSquared = 0;
381 this->m_totalWeight = 0;
386 ibox->calculateGridCaches();
389 nPoints += ibox->getNPoints();
390 this->m_signal += ibox->getSignal();
391 this->m_errorSquared += ibox->getErrorSquared();
392 this->m_totalWeight += ibox->getTotalWeight();
399 auto out =
new std::vector<MDE>();
416 outBoxes.emplace_back(
this);
418 if (this->getDepth() < maxDepth) {
421 child->getBoxes(outBoxes, maxDepth, leafOnly);
427 outBoxes.emplace_back(
this);
453 outBoxes.emplace_back(
this);
455 if (this->getDepth() < maxDepth) {
460 size_t vertices_max[nd];
461 Kernel::Utils::NestedForLoop::SetUp(nd, vertices_max, 0);
464 size_t numVertices = 1;
465 for (
size_t d = 0;
d < nd; ++
d) {
466 vertices_max[
d] =
split[
d] + 1;
467 numVertices *= vertices_max[
d];
471 size_t numPlanes = function->getNumPlanes();
474 auto vertexContained =
new bool[numVertices * numPlanes];
477 size_t vertexIndex[nd];
478 Kernel::Utils::NestedForLoop::SetUp(nd, vertexIndex, 0);
480 size_t vertexIndexMaker[nd];
481 Kernel::Utils::NestedForLoop::SetUpIndexMaker(nd, vertexIndexMaker, vertices_max);
483 size_t boxIndexMaker[nd];
484 Kernel::Utils::NestedForLoop::SetUpIndexMaker(nd, boxIndexMaker,
split);
486 size_t linearVertexIndex = 0;
487 for (linearVertexIndex = 0; linearVertexIndex < numVertices; linearVertexIndex++) {
489 Kernel::Utils::NestedForLoop::GetIndicesFromLinearIndex(nd, linearVertexIndex, vertexIndexMaker, vertices_max,
494 for (
size_t d = 0;
d < nd; ++
d)
495 vertexCoord[
d] = this->extents[
d].getMin() +
coord_t(
double(vertexIndex[
d]) * m_SubBoxSize[
d]);
498 for (
size_t p = 0; p < numPlanes; p++) {
500 vertexContained[p * numVertices + linearVertexIndex] = function->getPlane(p).isPointInside(vertexCoord);
507 size_t verticesPerBox = 1 << nd;
511 auto vertexNeighborsOffsets =
new size_t[verticesPerBox];
513 for (
size_t i = 0; i < verticesPerBox; i++) {
515 size_t vertIndex[nd];
516 for (
size_t d = 0;
d < nd;
d++) {
519 size_t mask =
size_t{1} <<
d;
523 size_t linIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, vertIndex, vertexIndexMaker);
524 vertexNeighborsOffsets[i] = linIndex;
529 Kernel::Utils::NestedForLoop::SetUp(nd, boxIndex, 0);
531 bool allDone =
false;
534 size_t boxLinearIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, boxIndex, boxIndexMaker);
544 size_t vertLinearIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, boxIndex, vertexIndexMaker);
553 size_t numPlanesWithAllVertexes = 0;
555 bool boxIsNotTouching =
false;
558 for (
size_t p = 0; p < numPlanes; p++) {
559 size_t numVertexesInThisPlane = 0;
561 for (
size_t i = 0; i < verticesPerBox; i++) {
564 if (vertexContained[p * numVertices + vertLinearIndex + vertexNeighborsOffsets[i]])
565 numVertexesInThisPlane++;
569 if (numVertexesInThisPlane == 0) {
570 boxIsNotTouching =
true;
575 if (numVertexesInThisPlane == verticesPerBox)
576 numPlanesWithAllVertexes++;
580 if (!boxIsNotTouching) {
582 if (numPlanesWithAllVertexes == numPlanes) {
587 box->
getBoxes(outBoxes, maxDepth, leafOnly);
591 box->
getBoxes(outBoxes, maxDepth, leafOnly, function);
598 allDone = Kernel::Utils::NestedForLoop::Increment(nd, boxIndex,
split);
602 delete[] vertexContained;
603 delete[] vertexNeighborsOffsets;
610 outBoxes.emplace_back(
this);
623 outBoxes.emplace_back(
this);
625 child->getBoxes(outBoxes, cond);
635 for (
size_t d = 0;
d < nd;
d++) {
637 int i = int((
x - this->extents[
d].getMin()) / m_SubBoxSize[
d]);
640 index += (i * splitCumul[
d]);
644 if (
index < numBoxes)
645 return m_Children[
index]->getBoxAtCoord(coords);
667 this->m_BoxController->trackNumBoxes(box->
getDepth());
672 delete m_Children[
index];
674 m_Children[
index] = gridbox;
680 gridbox->splitAllIfNeeded(
nullptr);
693 if (m_Children[
index]->getID() == childId)
707 for (
size_t i = 0; i < numBoxes; ++i) {
717 this->m_BoxController->trackNumBoxes(box->
getDepth());
719 m_Children[i] = gridBox;
740 this->m_BoxController->getFileIO()->toWrite(pSaver);
749 if (!ts || (this->nPoints < this->m_BoxController->getAddingEvents_eventsPerTask()))
781 size_t counters_min[nd];
782 size_t counters_max[nd];
784 for (
size_t d = 0;
d < nd;
d++) {
788 if (bin.m_min[
d] >= this->extents[
d].getMin()) {
789 min = int((bin.m_min[
d] - this->extents[
d].getMin()) / m_SubBoxSize[
d]);
790 counters_min[
d] = min;
799 if (min >=
static_cast<int>(
split[
d]))
805 if (bin.m_max[
d] < this->extents[
d].getMax()) {
806 max = int(ceil((bin.m_max[
d] - this->extents[
d].getMin()) / m_SubBoxSize[
d])) - 1;
807 counters_max[
d] = max + 1;
810 counters_max[
d] = max;
815 if ((max < min) || (max < 0))
825 for (
size_t d = 0;
d < nd;
d++)
826 counters[d] = counters_min[d];
828 bool allDone =
false;
830 size_t index = getLinearIndex(counters);
835 bool completelyWithin =
true;
836 for (
size_t dim = 0; dim < nd; dim++)
837 if ((
static_cast<int>(counters[dim]) <= index_min[dim]) || (
static_cast<int>(counters[dim]) >= index_max[dim])) {
841 completelyWithin =
false;
845 if (completelyWithin) {
850 bin.m_signal += m_Children[
index]->getSignal();
851 bin.m_errorSquared += m_Children[
index]->getErrorSquared();
854 m_Children[
index]->centerpointBin(bin, fullyContained);
858 allDone = Kernel::Utils::NestedForLoop::Increment(nd, counters, counters_max, counters_min);
1094 const bool useOnePercentBackgroundCorrection) const {
1099 std::vector<size_t> verticesContained(numBoxes, 0);
1103 std::vector<bool> boxMightTouch(numBoxes, 0);
1107 size_t maxVertices = 1 << nd;
1114 size_t vertices_max[nd];
1115 Kernel::Utils::NestedForLoop::SetUp(nd, vertices_max, 0);
1116 for (
size_t d = 0;
d < nd; ++
d) {
1117 vertices_max[
d] =
split[
d] + 1;
1119 boxSize[
d] =
static_cast<coord_t>(m_SubBoxSize[
d]);
1120 minBoxVal[
d] =
static_cast<coord_t>(this->extents[
d].getMin());
1124 size_t vertexIndex[nd];
1125 Kernel::Utils::NestedForLoop::SetUp(nd, vertexIndex, 0);
1126 size_t boxIndex[nd];
1127 Kernel::Utils::NestedForLoop::SetUp(nd, boxIndex, 0);
1128 size_t indexMaker[nd];
1129 Kernel::Utils::NestedForLoop::SetUpIndexMaker(nd, indexMaker, split);
1131 bool allDone =
false;
1135 for (
size_t d = 0;
d < nd; ++
d)
1136 vertexCoord[d] =
static_cast<coord_t>(vertexIndex[d]) * boxSize[
d] + minBoxVal[
d];
1141 radiusTransform.apply(vertexCoord, out);
1142 if (out[0] < radiusSquared && out[0] > innerRadiusSquared) {
1149 for (
size_t neighb = 0; neighb < maxVertices; ++neighb) {
1152 bool badIndex =
false;
1154 for (
size_t d = 0;
d < nd;
d++) {
1155 boxIndex[
d] = vertexIndex[
d] - ((neighb & ((size_t)1 << d)) >> d);
1160 if (boxIndex[d] >= split[d]) {
1167 size_t linearIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, boxIndex, indexMaker);
1170 verticesContained[linearIndex]++;
1178 allDone = Kernel::Utils::NestedForLoop::Increment(nd, vertexIndex, vertices_max);
1185 auto tmpRadiusTransform =
dynamic_cast<CoordTransformDistance *
>(&radiusTransform);
1186 if (tmpRadiusTransform ==
nullptr) {
1187 throw std::runtime_error(
"radiusTransform has to be CoordTransformDistance");
1189 auto peakCenter = tmpRadiusTransform->getCenter();
1190 double peakRadius = std::sqrt(radiusSquared);
1191 double peakInnerRadius = std::sqrt(innerRadiusSquared);
1195 for (
size_t bIndex = 0; bIndex < numBoxes; ++bIndex) {
1196 API::IMDNode *box = m_Children[bIndex];
1200 if (verticesContained[bIndex] >= maxVertices) {
1202 signal += box->getSignal();
1203 errorSquared += box->getErrorSquared();
1209 if (verticesContained[bIndex] > 0) {
1210 box->integrateSphere(radiusTransform, radiusSquared, signal, errorSquared, innerRadiusSquared,
1211 useOnePercentBackgroundCorrection);
1226 box->getCenter(boxCenter);
1227 double distPeakCenterToBoxCenter = 0.0;
1228 for (
size_t i = 0; i < nd; ++i) {
1229 distPeakCenterToBoxCenter += (boxCenter[i] - peakCenter[i]) * (boxCenter[i] - peakCenter[i]);
1231 distPeakCenterToBoxCenter = std::sqrt(distPeakCenterToBoxCenter);
1232 double boxRadius = std::sqrt(diagonalSquared);
1237 if (distPeakCenterToBoxCenter - peakRadius > boxRadius) {
1260 if (peakInnerRadius > 0 && distPeakCenterToBoxCenter + boxRadius < peakInnerRadius) {
1265 box->integrateSphere(radiusTransform, radiusSquared, signal, errorSquared, innerRadiusSquared,
1266 useOnePercentBackgroundCorrection);
1283 for (size_t i = 0; i < numBoxes; ++i) {
1291 radiusTransform.apply(boxCenter, out);
1293 if (out[0] < diagonalSquared * 0.72 + radiusSquared) {
1300 box->
centroidSphere(radiusTransform, radiusSquared, centroid, signal);
1328 auto verticesContained =
new size_t[numBoxes];
1329 memset(verticesContained, 0, numBoxes *
sizeof(
size_t));
1333 auto boxMightTouch =
new bool[numBoxes];
1334 memset(boxMightTouch, 0, numBoxes *
sizeof(
bool));
1338 size_t maxVertices = 1 << nd;
1345 size_t vertices_max[nd];
1346 Kernel::Utils::NestedForLoop::SetUp(nd, vertices_max, 0);
1347 for (
size_t d = 0;
d < nd; ++
d) {
1348 vertices_max[
d] =
split[
d] + 1;
1350 boxSize[
d] =
static_cast<coord_t>(m_SubBoxSize[
d]);
1351 minBoxVal[
d] =
static_cast<coord_t>(this->extents[
d].getMin());
1355 size_t vertexIndex[nd];
1356 Kernel::Utils::NestedForLoop::SetUp(nd, vertexIndex, 0);
1357 size_t boxIndex[nd];
1358 Kernel::Utils::NestedForLoop::SetUp(nd, boxIndex, 0);
1359 size_t indexMaker[nd];
1360 Kernel::Utils::NestedForLoop::SetUpIndexMaker(nd, indexMaker,
split);
1362 size_t numSteps = signal_fit.size();
1363 double deltaQ = length /
static_cast<double>(numSteps - 1);
1364 bool allDone =
false;
1368 for (
size_t d = 0;
d < nd; ++
d)
1369 vertexCoord[
d] =
static_cast<coord_t>(vertexIndex[
d]) * boxSize[
d] + minBoxVal[
d];
1374 radiusTransform.apply(vertexCoord, out);
1375 if (out[0] < radius && std::fabs(out[1]) < 0.5 * length) {
1382 for (
size_t neighb = 0; neighb < maxVertices; ++neighb) {
1385 bool badIndex =
false;
1387 for (
size_t d = 0;
d < nd;
d++) {
1388 boxIndex[
d] = vertexIndex[
d] - ((neighb & ((size_t)1 <<
d)) >>
d);
1393 if (boxIndex[
d] >=
split[
d]) {
1400 size_t linearIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, boxIndex, indexMaker);
1403 verticesContained[linearIndex]++;
1411 allDone = Kernel::Utils::NestedForLoop::Increment(nd, vertexIndex, vertices_max);
1415 for (
size_t i = 0; i < numBoxes; ++i) {
1418 bool partialBox =
false;
1421 if (verticesContained[i] >= maxVertices) {
1422 std::vector<coord_t> coordTable;
1425 if (nColumns > 0 && nd > 1) {
1426 size_t nEvents = coordTable.size() / nColumns;
1430 for (
size_t k = 0; k < nEvents; k++) {
1432 for (
size_t l = 0; l < nd; l++)
1433 eventCenter[l] = coordTable[k * nColumns + skipCol + l];
1435 radiusTransform.apply(eventCenter, out);
1437 size_t xchannel =
static_cast<size_t>(std::floor(out[1] / deltaQ)) + numSteps / 2;
1439 if (xchannel < numSteps)
1440 signal_fit[xchannel] += coordTable[k * nColumns];
1455 if (verticesContained[i] == 0) {
1464 radiusTransform.apply(boxCenter, out);
1465 if ((nd >= 1) && out[0] < std::sqrt(diagonalSquared * 0.72 + radius * radius) &&
1466 (nd >= 2 && std::fabs(out[1]) < std::sqrt(diagonalSquared * 0.72 + 0.25 * length * length))) {
1482 box->
integrateCylinder(radiusTransform, radius, length, signal, errorSquared, signal_fit);
1491 delete[] verticesContained;
1492 delete[] boxMightTouch;
1501 bool isMasked =
false;
1502 for (
size_t i = 0; i < numBoxes; ++i) {
1515 for (
size_t i = 0; i < numBoxes; ++i) {
1524 for (
size_t i = 0; i < numBoxes; ++i) {
1541 const std::vector<coord_t> &Coord,
const std::vector<uint16_t> &expInfoIndex,
1542 const std::vector<uint16_t> &goniometerIndex,
const std::vector<uint32_t> &detectorId,
1544 for (
size_t i = 0; i < nEvents; i++)
1545 pBox->
addEvent(
MDEvent<nd>(sigErrSq[2 * i], sigErrSq[2 * i + 1], expInfoIndex[i], goniometerIndex[i],
1546 detectorId[i], &Coord[i * nd]));
1554 const std::vector<coord_t> &Coord,
const std::vector<uint16_t> & ,
1555 const std::vector<uint16_t> & ,
1556 const std::vector<uint32_t> & ,
size_t nEvents) {
1557 for (
size_t i = 0; i < nEvents; i++)
1558 pBox->addEvent(
MDLeanEvent<nd>(sigErrSq[2 * i], sigErrSq[2 * i + 1], &Coord[i * nd]));
1576 const
std::vector<uint16_t> &expInfoIndex,
1577 const
std::vector<uint16_t> &goniometerIndex,
1578 const
std::vector<uint32_t> &detectorId) {
1580 size_t nEvents = sigErrSq.size() / 2;
1595 uint16_t expInfoIndex, uint16_t goniometerIndex, uint32_t detectorId) {
1613 const
std::vector<
coord_t> &point, uint16_t expInfoIndex,
1614 uint16_t goniometerIndex, uint32_t detectorId) {
1615 this->addEventUnsafe(
IF<MDE, nd>::BUILD_EVENT(Signal, errorSq, &point[0], expInfoIndex, goniometerIndex, detectorId));
1632 size_t cindex = calculateChildIndex(event);
1636 if (cindex == numBoxes)
1637 cindex = numBoxes - 1;
1639 if (cindex < numBoxes)
1640 return m_Children[cindex]->addEvent(event);
1663 size_t cindex = calculateChildIndex(event);
1667 if (cindex == numBoxes)
1668 cindex = numBoxes - 1;
1670 if (cindex < numBoxes)
1671 return m_Children[cindex]->addEventUnsafe(event);
1684 delete this->m_Children[
index];
1686 this->m_Children[
index] = newChild;
1693 "yet implemented (unclear how "
1694 "to set file location etc)"));
1699 for (
size_t i = 0; i < this->numBoxes; i++) {
1700 m_Children[i]->setFileBacked();
1716 auto it = m_Children.begin();
1717 auto it_end = m_Children.end();
1718 for (; it != it_end; it++) {
1719 (*it)->clearFileBacked(loadDiskBackedData);
1728 for (
size_t d = 0;
d < nd;
d++) {
1730 auto offset =
event.getCenter(
d) - this->extents[
d].getMin();
1731 cindex +=
static_cast<int>(offset / (m_SubBoxSize[
d])) * splitCumul[
d];
std::map< DeltaEMode::Type, std::string > index
#define TMDE(decl)
Macro TMDE to make declaring template functions faster.
#define GNU_DIAG_OFF(x)
This is a collection of macros for turning compiler warnings off in a controlled manner.
This class is used by MDBox and MDGridBox in order to intelligently determine optimal behavior.
virtual void mask()=0
Setter for masking the box.
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 dim...
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.
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.
virtual bool getIsMasked() const =0
Getter for the masking.
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 t...
virtual void getCenter(coord_t *const) const =0
virtual void unmask()=0
Setter for unmasking the box.
virtual signal_t getSignal() const =0
MDBin : Class describing a single bin in a dense, Multidimensional histogram.
Templated super-class of a multi-dimensional event "box".
uint32_t getDepth() const override
For testing, mostly: return the recursion depth of this box.
void transformDimensions(std::vector< double > &scaling, std::vector< double > &offset) override
Transform the dimensions contained in this box x' = x*scaling + offset.
Templated class for a multi-dimensional event "box".
Kernel::ISaveable * getISaveable() override
void splitAllIfNeeded(Mantid::Kernel::ThreadScheduler *=nullptr) override
uint64_t getNPoints() const override
Returns the total number of points (events) in this box either they are all in memory,...
size_t getDataInMemorySize() const override
Templated class holding data about a neutron detection event in N-dimensions (for example,...
Templated class for a GRIDDED multi-dimensional event "box".
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.
size_t addEvent(const MDE &event) override
Add a single MDLeanEvent to the grid box.
void clear() override
Clear any points contained.
size_t initGridBox()
common part of MDGridBox contstructor;
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)
Templated class holding data about a neutron detection event in N-dimensions (for example,...
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.
Marks code as not implemented yet.
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.
static void EXEC(MDGridBox< MDLeanEvent< nd >, nd > *pBox, const std::vector< signal_t > &sigErrSq, const std::vector< coord_t > &Coord, const std::vector< uint16_t > &, const std::vector< uint16_t > &, const std::vector< uint32_t > &, size_t nEvents)
static void EXEC(MDGridBox< MDE, nd > *pBox, 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, size_t nEvents)