14#include "MantidMDAlgorithms/DllConfig.h"
18#include <unordered_map>
27namespace MDAlgorithms {
39 :
a(static_cast<int64_t>(q[0] / cellSize)),
b(static_cast<int64_t>(q[1] / cellSize)),
40 c(static_cast<int64_t>(q[2] / cellSize)) {}
46 int64_t
getHash() {
return 1000000000000 *
a + 100000000 *
b + 10000 *
c; }
51 std::vector<int64_t> neighbors;
52 for (int64_t ia =
a - 1; ia <=
a + 1; ia++)
53 for (int64_t ib =
b - 1; ib <=
b + 1; ib++)
54 for (int64_t ic =
c - 1; ic <=
c + 1; ic++) {
55 int64_t key = 1000000000000 * ia + 100000000 * ib + 10000 * ic;
56 neighbors.emplace_back(key);
99 const bool useOnePercentBackgroundCorrection =
true);
102 static bool isOrigin(
const V3D &q,
const double &cellSize);
105 void setRadius(
const double &radius);
147 PeakShape_const_sptr ellipseIntegrateEvents(
const std::vector<V3D> &E1Vec,
V3D const &peak_q,
bool specify_size,
148 double peak_radius,
double back_inner_radius,
double back_outer_radius,
150 std::pair<double, double> &backi);
158 void populateCellsWithPeaks();
172 static std::pair<double, double> numInEllipsoid(
SlimEvents const &events,
191 static std::pair<double, double> numInEllipsoidBkg(
SlimEvents const &events,
195 const bool useOnePercentBackgroundCorrection);
224 static void getEigenVectors(
Kernel::DblMatrix const &cov_matrix, std::array<V3D, 3> &eigen_vectors,
225 std::array<double, 3> &eigen_values);
263 ellipseIntegrateEvents(
const std::vector<V3D> &E1Vec,
V3D const &peak_q,
SlimEvents const &ev_list,
265 bool specify_size,
double peak_radius,
double back_inner_radius,
double back_outer_radius,
267 std::pair<double, double> &backi);
This is a low-level class to construct a map with lists of events near each peak Q-vector in the lab ...
std::unordered_map< size_t, SlimEvents > m_cellsWithEvents
list of cells occupied with events
double m_cellSize
size of the square cell unit, holding at most one single peak
const bool m_useOnePercentBackgroundCorrection
if one percent culling of the background should be performed.
std::unordered_map< size_t, OccupiedCell > m_cellsWithPeaks
list the occupied cells in an unordered map for fast searching
std::array< Kernel::V3D, PEAK_ELLIPSOID_DIMS > PeakEllipsoidFrame
std::array< double, PEAK_ELLIPSOID_DIMS > PeakEllipsoidExtent
std::shared_ptr< const PeakShapeEllipsoid > PeakShapeEllipsoid_const_sptr
std::shared_ptr< const PeakShape > PeakShape_const_sptr
std::vector< SlimEvent > SlimEvents
std::pair< std::pair< double, double >, V3D > SlimEvent
Helper class which provides the Collimation Length for SANS instruments.
Partition QLab space into a cubic lattice.
bool isOrigin()
Check if all cell coords are zero.
std::vector< int64_t > nearbyCellHashes()
Hashes for the 26 first neighbor coordinates plus the coordinates themselves.
CellCoords(const V3D &q, const double cellSize)
int64_t getHash()
cast coordinates to scalar, to be used as key in an unordered map