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];
183 m_SubBoxSizeInv[
d] = other.m_SubBoxSizeInv[
d];
187 m_Children.reserve(numBoxes);
188 for (
size_t i = 0; i < other.m_Children.size(); i++) {
194 newBox->setParent(
this);
195 m_Children.emplace_back(newBox);
196 }
else if (otherMDGridBox) {
198 newBox->setParent(
this);
199 m_Children.emplace_back(newBox);
201 throw std::runtime_error(
"MDGridBox::copy_ctor(): an unexpected child box type was found.");
216 this->computeSizesFromSplit();
227 for (
size_t d = 0;
d < nd;
d++) {
232 m_SubBoxSize[
d] =
static_cast<double>(this->extents[
d].getSize()) /
static_cast<double>(
split[
d]);
233 m_SubBoxSizeInv[
d] = 1.0 / m_SubBoxSize[
d];
235 diagSum += m_SubBoxSize[
d] * m_SubBoxSize[
d];
237 diagonalSquared =
static_cast<coord_t>(diagSum);
247 auto it = m_Children.begin();
248 for (; it != m_Children.end(); ++it)
256 this->m_signal = 0.0;
257 this->m_errorSquared = 0.0;
258 auto it = m_Children.begin();
259 for (; it != m_Children.end(); ++it) {
272 for (
size_t i = 0; i < numBoxes; i++)
273 nPoints += m_Children[i]->getDataInMemorySize();
283 auto it = m_Children.begin();
284 for (; it != m_Children.end(); ++it) {
285 total += (*it)->getNumMDBoxes();
312 const size_t indexEnd) {
314 m_Children.reserve(indexEnd - indexStart + 1);
315 auto it = otherBoxes.begin() + indexStart;
316 auto it_end = otherBoxes.begin() + indexEnd;
318 for (; it != it_end; it++) {
320 m_Children.back()->setParent(
this);
322 numBoxes = m_Children.size();
332 size_t out_linear_index = 0;
333 for (
size_t d = 0;
d < nd;
d++)
334 out_linear_index += (indices[d] * splitCumul[d]);
335 return out_linear_index;
350 this->m_errorSquared = 0;
351 this->m_totalWeight = 0;
358 ibox->refreshCache();
361 nPoints += ibox->getNPoints();
362 this->m_signal += ibox->getSignal();
363 this->m_errorSquared += ibox->getErrorSquared();
364 this->m_totalWeight += ibox->getTotalWeight();
368 throw std::runtime_error(
"Not implemented");
382 this->m_errorSquared = 0;
383 this->m_totalWeight = 0;
388 ibox->calculateGridCaches();
391 nPoints += ibox->getNPoints();
392 this->m_signal += ibox->getSignal();
393 this->m_errorSquared += ibox->getErrorSquared();
394 this->m_totalWeight += ibox->getTotalWeight();
401 auto out =
new std::vector<MDE>();
418 outBoxes.emplace_back(
this);
420 if (this->getDepth() < maxDepth) {
423 child->getBoxes(outBoxes, maxDepth, leafOnly);
429 outBoxes.emplace_back(
this);
455 outBoxes.emplace_back(
this);
457 if (this->getDepth() < maxDepth) {
462 size_t vertices_max[nd];
463 Kernel::Utils::NestedForLoop::SetUp(nd, vertices_max, 0);
466 size_t numVertices = 1;
467 for (
size_t d = 0;
d < nd; ++
d) {
468 vertices_max[
d] =
split[
d] + 1;
469 numVertices *= vertices_max[
d];
473 size_t numPlanes = function->getNumPlanes();
476 auto vertexContained =
new bool[numVertices * numPlanes];
479 size_t vertexIndex[nd];
480 Kernel::Utils::NestedForLoop::SetUp(nd, vertexIndex, 0);
482 size_t vertexIndexMaker[nd];
483 Kernel::Utils::NestedForLoop::SetUpIndexMaker(nd, vertexIndexMaker, vertices_max);
485 size_t boxIndexMaker[nd];
486 Kernel::Utils::NestedForLoop::SetUpIndexMaker(nd, boxIndexMaker,
split);
488 size_t linearVertexIndex = 0;
489 for (linearVertexIndex = 0; linearVertexIndex < numVertices; linearVertexIndex++) {
491 Kernel::Utils::NestedForLoop::GetIndicesFromLinearIndex(nd, linearVertexIndex, vertexIndexMaker, vertices_max,
496 for (
size_t d = 0;
d < nd; ++
d)
497 vertexCoord[
d] = this->extents[
d].getMin() +
coord_t(
double(vertexIndex[
d]) * m_SubBoxSize[
d]);
500 for (
size_t p = 0; p < numPlanes; p++) {
502 vertexContained[p * numVertices + linearVertexIndex] = function->getPlane(p).isPointInside(vertexCoord);
509 size_t verticesPerBox = 1 << nd;
513 auto vertexNeighborsOffsets =
new size_t[verticesPerBox];
515 for (
size_t i = 0; i < verticesPerBox; i++) {
517 size_t vertIndex[nd];
518 for (
size_t d = 0;
d < nd;
d++) {
521 size_t mask =
size_t{1} <<
d;
525 size_t linIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, vertIndex, vertexIndexMaker);
526 vertexNeighborsOffsets[i] = linIndex;
531 Kernel::Utils::NestedForLoop::SetUp(nd, boxIndex, 0);
533 bool allDone =
false;
536 size_t boxLinearIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, boxIndex, boxIndexMaker);
546 size_t vertLinearIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, boxIndex, vertexIndexMaker);
555 size_t numPlanesWithAllVertexes = 0;
557 bool boxIsNotTouching =
false;
560 for (
size_t p = 0; p < numPlanes; p++) {
561 size_t numVertexesInThisPlane = 0;
563 for (
size_t i = 0; i < verticesPerBox; i++) {
566 if (vertexContained[p * numVertices + vertLinearIndex + vertexNeighborsOffsets[i]])
567 numVertexesInThisPlane++;
571 if (numVertexesInThisPlane == 0) {
572 boxIsNotTouching =
true;
577 if (numVertexesInThisPlane == verticesPerBox)
578 numPlanesWithAllVertexes++;
582 if (!boxIsNotTouching) {
584 if (numPlanesWithAllVertexes == numPlanes) {
589 box->
getBoxes(outBoxes, maxDepth, leafOnly);
593 box->
getBoxes(outBoxes, maxDepth, leafOnly, function);
600 allDone = Kernel::Utils::NestedForLoop::Increment(nd, boxIndex,
split);
604 delete[] vertexContained;
605 delete[] vertexNeighborsOffsets;
612 outBoxes.emplace_back(
this);
625 outBoxes.emplace_back(
this);
627 child->getBoxes(outBoxes, cond);
637 for (
size_t d = 0;
d < nd;
d++) {
639 int i = int((
x - this->extents[
d].getMin()) / m_SubBoxSize[
d]);
642 index += (i * splitCumul[
d]);
646 if (
index < numBoxes)
647 return m_Children[
index]->getBoxAtCoord(coords);
669 this->m_BoxController->trackNumBoxes(box->
getDepth());
674 delete m_Children[
index];
676 m_Children[
index] = gridbox;
682 gridbox->splitAllIfNeeded(
nullptr);
695 if (m_Children[
index]->getID() == childId)
709 for (
size_t i = 0; i < numBoxes; ++i) {
719 this->m_BoxController->trackNumBoxes(box->
getDepth());
721 m_Children[i] = gridBox;
742 this->m_BoxController->getFileIO()->toWrite(pSaver);
751 if (!ts || (this->nPoints < this->m_BoxController->getAddingEvents_eventsPerTask()))
783 size_t counters_min[nd];
784 size_t counters_max[nd];
786 for (
size_t d = 0;
d < nd;
d++) {
790 if (bin.m_min[
d] >= this->extents[
d].getMin()) {
791 min = int((bin.m_min[
d] - this->extents[
d].getMin()) / m_SubBoxSize[
d]);
792 counters_min[
d] = min;
801 if (min >=
static_cast<int>(
split[
d]))
807 if (bin.m_max[
d] < this->extents[
d].getMax()) {
808 max = int(ceil((bin.m_max[
d] - this->extents[
d].getMin()) / m_SubBoxSize[
d])) - 1;
809 counters_max[
d] = max + 1;
812 counters_max[
d] = max;
817 if ((max < min) || (max < 0))
827 for (
size_t d = 0;
d < nd;
d++)
828 counters[d] = counters_min[d];
830 bool allDone =
false;
832 size_t index = getLinearIndex(counters);
837 bool completelyWithin =
true;
838 for (
size_t dim = 0; dim < nd; dim++)
839 if ((
static_cast<int>(counters[dim]) <= index_min[dim]) || (
static_cast<int>(counters[dim]) >= index_max[dim])) {
843 completelyWithin =
false;
847 if (completelyWithin) {
852 bin.m_signal += m_Children[
index]->getSignal();
853 bin.m_errorSquared += m_Children[
index]->getErrorSquared();
856 m_Children[
index]->centerpointBin(bin, fullyContained);
860 allDone = Kernel::Utils::NestedForLoop::Increment(nd, counters, counters_max, counters_min);
1096 const bool useOnePercentBackgroundCorrection) const {
1101 std::vector<size_t> verticesContained(numBoxes, 0);
1105 std::vector<bool> boxMightTouch(numBoxes, 0);
1109 size_t maxVertices = 1 << nd;
1116 size_t vertices_max[nd];
1117 Kernel::Utils::NestedForLoop::SetUp(nd, vertices_max, 0);
1118 for (
size_t d = 0;
d < nd; ++
d) {
1119 vertices_max[
d] =
split[
d] + 1;
1121 boxSize[
d] =
static_cast<coord_t>(m_SubBoxSize[
d]);
1122 minBoxVal[
d] =
static_cast<coord_t>(this->extents[
d].getMin());
1126 size_t vertexIndex[nd];
1127 Kernel::Utils::NestedForLoop::SetUp(nd, vertexIndex, 0);
1128 size_t boxIndex[nd];
1129 Kernel::Utils::NestedForLoop::SetUp(nd, boxIndex, 0);
1130 size_t indexMaker[nd];
1131 Kernel::Utils::NestedForLoop::SetUpIndexMaker(nd, indexMaker, split);
1133 bool allDone =
false;
1137 for (
size_t d = 0;
d < nd; ++
d)
1138 vertexCoord[d] =
static_cast<coord_t>(vertexIndex[d]) * boxSize[
d] + minBoxVal[
d];
1143 radiusTransform.apply(vertexCoord, out);
1144 if (out[0] < radiusSquared && out[0] > innerRadiusSquared) {
1151 for (
size_t neighb = 0; neighb < maxVertices; ++neighb) {
1154 bool badIndex =
false;
1156 for (
size_t d = 0;
d < nd;
d++) {
1157 boxIndex[
d] = vertexIndex[
d] - ((neighb & ((size_t)1 << d)) >> d);
1162 if (boxIndex[d] >= split[d]) {
1169 size_t linearIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, boxIndex, indexMaker);
1172 verticesContained[linearIndex]++;
1180 allDone = Kernel::Utils::NestedForLoop::Increment(nd, vertexIndex, vertices_max);
1187 auto tmpRadiusTransform =
dynamic_cast<CoordTransformDistance *
>(&radiusTransform);
1188 if (tmpRadiusTransform ==
nullptr) {
1189 throw std::runtime_error(
"radiusTransform has to be CoordTransformDistance");
1191 auto peakCenter = tmpRadiusTransform->getCenter();
1192 double peakRadius = std::sqrt(radiusSquared);
1193 double peakInnerRadius = std::sqrt(innerRadiusSquared);
1197 for (
size_t bIndex = 0; bIndex < numBoxes; ++bIndex) {
1198 API::IMDNode *box = m_Children[bIndex];
1202 if (verticesContained[bIndex] >= maxVertices) {
1204 signal += box->getSignal();
1205 errorSquared += box->getErrorSquared();
1211 if (verticesContained[bIndex] > 0) {
1212 box->integrateSphere(radiusTransform, radiusSquared, signal, errorSquared, innerRadiusSquared,
1213 useOnePercentBackgroundCorrection);
1228 box->getCenter(boxCenter);
1229 double distPeakCenterToBoxCenter = 0.0;
1230 for (
size_t i = 0; i < nd; ++i) {
1231 distPeakCenterToBoxCenter += (boxCenter[i] - peakCenter[i]) * (boxCenter[i] - peakCenter[i]);
1233 distPeakCenterToBoxCenter = std::sqrt(distPeakCenterToBoxCenter);
1234 double boxRadius = std::sqrt(diagonalSquared);
1239 if (distPeakCenterToBoxCenter - peakRadius > boxRadius) {
1262 if (peakInnerRadius > 0 && distPeakCenterToBoxCenter + boxRadius < peakInnerRadius) {
1267 box->integrateSphere(radiusTransform, radiusSquared, signal, errorSquared, innerRadiusSquared,
1268 useOnePercentBackgroundCorrection);
1285 for (size_t i = 0; i < numBoxes; ++i) {
1293 radiusTransform.apply(boxCenter, out);
1295 if (out[0] < diagonalSquared * 0.72 + radiusSquared) {
1302 box->
centroidSphere(radiusTransform, radiusSquared, centroid, signal);
1330 auto verticesContained =
new size_t[numBoxes];
1331 memset(verticesContained, 0, numBoxes *
sizeof(
size_t));
1335 auto boxMightTouch =
new bool[numBoxes];
1336 memset(boxMightTouch, 0, numBoxes *
sizeof(
bool));
1340 size_t maxVertices = 1 << nd;
1347 size_t vertices_max[nd];
1348 Kernel::Utils::NestedForLoop::SetUp(nd, vertices_max, 0);
1349 for (
size_t d = 0;
d < nd; ++
d) {
1350 vertices_max[
d] =
split[
d] + 1;
1352 boxSize[
d] =
static_cast<coord_t>(m_SubBoxSize[
d]);
1353 minBoxVal[
d] =
static_cast<coord_t>(this->extents[
d].getMin());
1357 size_t vertexIndex[nd];
1358 Kernel::Utils::NestedForLoop::SetUp(nd, vertexIndex, 0);
1359 size_t boxIndex[nd];
1360 Kernel::Utils::NestedForLoop::SetUp(nd, boxIndex, 0);
1361 size_t indexMaker[nd];
1362 Kernel::Utils::NestedForLoop::SetUpIndexMaker(nd, indexMaker,
split);
1364 size_t numSteps = signal_fit.size();
1365 double deltaQ = length /
static_cast<double>(numSteps - 1);
1366 bool allDone =
false;
1370 for (
size_t d = 0;
d < nd; ++
d)
1371 vertexCoord[
d] =
static_cast<coord_t>(vertexIndex[
d]) * boxSize[
d] + minBoxVal[
d];
1376 radiusTransform.apply(vertexCoord, out);
1377 if (out[0] < radius && std::fabs(out[1]) < 0.5 * length) {
1384 for (
size_t neighb = 0; neighb < maxVertices; ++neighb) {
1387 bool badIndex =
false;
1389 for (
size_t d = 0;
d < nd;
d++) {
1390 boxIndex[
d] = vertexIndex[
d] - ((neighb & ((size_t)1 <<
d)) >>
d);
1395 if (boxIndex[
d] >=
split[
d]) {
1402 size_t linearIndex = Kernel::Utils::NestedForLoop::GetLinearIndex(nd, boxIndex, indexMaker);
1405 verticesContained[linearIndex]++;
1413 allDone = Kernel::Utils::NestedForLoop::Increment(nd, vertexIndex, vertices_max);
1417 for (
size_t i = 0; i < numBoxes; ++i) {
1420 bool partialBox =
false;
1423 if (verticesContained[i] >= maxVertices) {
1424 std::vector<coord_t> coordTable;
1427 if (nColumns > 0 && nd > 1) {
1428 size_t nEvents = coordTable.size() / nColumns;
1432 for (
size_t k = 0; k < nEvents; k++) {
1434 for (
size_t l = 0; l < nd; l++)
1435 eventCenter[l] = coordTable[k * nColumns + skipCol + l];
1437 radiusTransform.apply(eventCenter, out);
1439 size_t xchannel =
static_cast<size_t>(std::floor(out[1] / deltaQ)) + numSteps / 2;
1441 if (xchannel < numSteps)
1442 signal_fit[xchannel] += coordTable[k * nColumns];
1457 if (verticesContained[i] == 0) {
1466 radiusTransform.apply(boxCenter, out);
1467 if ((nd >= 1) && out[0] < std::sqrt(diagonalSquared * 0.72 + radius * radius) &&
1468 (nd >= 2 && std::fabs(out[1]) < std::sqrt(diagonalSquared * 0.72 + 0.25 * length * length))) {
1484 box->
integrateCylinder(radiusTransform, radius, length, signal, errorSquared, signal_fit);
1493 delete[] verticesContained;
1494 delete[] boxMightTouch;
1503 bool isMasked =
false;
1504 for (
size_t i = 0; i < numBoxes; ++i) {
1517 for (
size_t i = 0; i < numBoxes; ++i) {
1526 for (
size_t i = 0; i < numBoxes; ++i) {
1543 const std::vector<coord_t> &Coord,
const std::vector<uint16_t> &expInfoIndex,
1544 const std::vector<uint16_t> &goniometerIndex,
const std::vector<uint32_t> &detectorId,
1546 for (
size_t i = 0; i < nEvents; i++)
1547 pBox->
addEvent(
MDEvent<nd>(sigErrSq[2 * i], sigErrSq[2 * i + 1], expInfoIndex[i], goniometerIndex[i],
1548 detectorId[i], &Coord[i * nd]));
1556 const std::vector<coord_t> &Coord,
const std::vector<uint16_t> & ,
1557 const std::vector<uint16_t> & ,
1558 const std::vector<uint32_t> & ,
size_t nEvents) {
1559 for (
size_t i = 0; i < nEvents; i++)
1560 pBox->addEvent(
MDLeanEvent<nd>(sigErrSq[2 * i], sigErrSq[2 * i + 1], &Coord[i * nd]));
1578 const
std::vector<uint16_t> &expInfoIndex,
1579 const
std::vector<uint16_t> &goniometerIndex,
1580 const
std::vector<uint32_t> &detectorId) {
1582 size_t nEvents = sigErrSq.size() / 2;
1597 uint16_t expInfoIndex, uint16_t goniometerIndex, uint32_t detectorId) {
1615 const
std::vector<
coord_t> &point, uint16_t expInfoIndex,
1616 uint16_t goniometerIndex, uint32_t detectorId) {
1617 this->addEventUnsafe(
IF<MDE, nd>::BUILD_EVENT(Signal, errorSq, &point[0], expInfoIndex, goniometerIndex, detectorId));
1634 size_t cindex = calculateChildIndex(event);
1638 if (cindex == numBoxes)
1639 cindex = numBoxes - 1;
1641 if (cindex < numBoxes)
1642 return m_Children[cindex]->addEvent(event);
1665 size_t cindex = calculateChildIndex(event);
1669 if (cindex == numBoxes)
1670 cindex = numBoxes - 1;
1672 if (cindex < numBoxes)
1673 return m_Children[cindex]->addEventUnsafe(event);
1686 delete this->m_Children[
index];
1688 this->m_Children[
index] = newChild;
1695 "yet implemented (unclear how "
1696 "to set file location etc)"));
1701 for (
size_t i = 0; i < this->numBoxes; i++) {
1702 m_Children[i]->setFileBacked();
1718 auto it = m_Children.begin();
1719 auto it_end = m_Children.end();
1720 for (; it != it_end; it++) {
1721 (*it)->clearFileBacked(loadDiskBackedData);
1730 for (
size_t d = 0;
d < nd;
d++) {
1732 const auto coordinate =
event.getCenter(
d);
1733 const auto offset = coordinate - this->extents[
d].getMin();
1734 const int splitD =
static_cast<int>(
split[
d]);
1736 auto childIndex =
static_cast<int>(offset * m_SubBoxSizeInv[
d]);
1737 if (childIndex == splitD && coordinate <= this->extents[
d].getMax())
1738 childIndex = splitD - 1;
1739 cindex += childIndex * 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)