13#include "MantidMDAlgorithms/DllConfig.h"
18#include <unordered_map>
25namespace DataObjects {
26class PeakShapeEllipsoid;
28namespace MDAlgorithms {
55 std::unordered_map<int64_t, std::vector<std::pair<std::pair<double, double>,
Mantid::Kernel::V3D>>>;
56using PeakQMap = std::unordered_map<int64_t, Mantid::Kernel::V3D>;
65 std::vector<Mantid::Kernel::V3D>
const &hkl_list, std::vector<Mantid::Kernel::V3D>
const &mnp_list,
67 const bool CrossT,
const bool useOnePercentBackgroundCorrection =
true);
70 void addEvents(std::vector<std::pair<std::pair<double, double>,
Mantid::Kernel::V3D>>
const &event_qs,
74 std::shared_ptr<const Mantid::Geometry::PeakShape>
75 ellipseIntegrateEvents(
const std::vector<Kernel::V3D> &E1Vec,
Mantid::Kernel::V3D const &peak_q,
bool specify_size,
76 double peak_radius,
double back_inner_radius,
double back_outer_radius,
77 std::vector<double> &axes_radii,
double &inti,
double &sigi);
81 std::shared_ptr<const Mantid::Geometry::PeakShape>
82 ellipseIntegrateModEvents(
const std::vector<Kernel::V3D> &E1Vec,
Mantid::Kernel::V3D const &peak_q,
84 double peak_radius,
double back_inner_radius,
double back_outer_radius,
85 std::vector<double> &axes_radii,
double &inti,
double &sigi);
88 std::pair<std::shared_ptr<const Mantid::Geometry::PeakShape>, std::tuple<double, double, double>>
93 const std::tuple<double, double, double> &libPeak,
98 bool forceSpherical =
false,
double sphericityTol = 0.02);
105 bool correctForDetectorEdges(std::tuple<double, double, double> &radii,
107 const std::vector<double> &axesRadii,
const std::vector<double> &bkgInnerRadii,
108 const std::vector<double> &bkgOuterRadii);
111 static std::pair<double, double>
112 numInEllipsoid(std::vector<std::pair<std::pair<double, double>,
Mantid::Kernel::V3D>>
const &events,
113 std::vector<Mantid::Kernel::V3D>
const &directions, std::vector<double>
const &sizes);
116 static std::pair<double, double>
117 numInEllipsoidBkg(std::vector<std::pair<std::pair<double, double>,
Mantid::Kernel::V3D>>
const &events,
118 std::vector<Mantid::Kernel::V3D>
const &directions, std::vector<double>
const &sizes,
119 std::vector<double>
const &sizesIn,
const bool useOnePercentBackgroundCorrection);
122 static void makeCovarianceMatrix(std::vector<std::pair<std::pair<double, double>,
Mantid::Kernel::V3D>>
const &events,
126 static void getEigenVectors(
Kernel::DblMatrix const &cov_matrix, std::vector<Mantid::Kernel::V3D> &eigen_vectors,
127 std::vector<double> &eigen_values);
130 static int64_t getHklKey(
int h,
int k,
int l);
132 static int64_t getHklMnpKey(
int h,
int k,
int l,
int m,
int n,
int p);
141 void addEvent(std::pair<std::pair<double, double>,
Mantid::Kernel::V3D> event_Q,
bool hkl_integ);
142 void addModEvent(std::pair<std::pair<double, double>,
Mantid::Kernel::V3D> event_Q,
bool hkl_integ);
145 std::shared_ptr<const Mantid::DataObjects::PeakShapeEllipsoid>
146 ellipseIntegrateEvents(
const std::vector<Kernel::V3D> &E1Vec,
Kernel::V3D const &peak_q,
148 std::vector<Mantid::Kernel::V3D>
const &directions, std::vector<double>
const &sigmas,
149 bool specify_size,
double peak_radius,
double back_inner_radius,
double back_outer_radius,
150 std::vector<double> &axes_radii,
double &inti,
double &sigi);
153 double detectorQ(
const std::vector<Kernel::V3D> &E1Vec,
const Mantid::Kernel::V3D &QLabFrame,
154 const std::vector<double> &r);
157 double max_sigma)
const;
169 const bool m_useOnePercentBackgroundCorrection =
This is a low-level class to construct a map with lists of events near each peak Q-vector,...
Kernel::DblMatrix m_ModHKL
Kernel::DblMatrix m_UBinv
EventListMap m_event_lists
std::shared_ptr< const PeakShapeEllipsoid > PeakShapeEllipsoid_const_sptr
std::unordered_map< int64_t, Mantid::Kernel::V3D > PeakQMap
std::unordered_map< int64_t, std::vector< std::pair< std::pair< double, double >, Mantid::Kernel::V3D > > > EventListMap
Helper class which provides the Collimation Length for SANS instruments.
double backgroundOuterRadius
double backgroundInnerRadius
std::vector< Kernel::V3D > E1Vectors