Mantid
Loading...
Searching...
No Matches
IntegratePeaksMD2.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2018 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
16#include "MantidMDAlgorithms/DllConfig.h"
17
18namespace Mantid {
19namespace Geometry {
20class DetectorInfo;
21}
22namespace MDAlgorithms {
23
29class MANTID_MDALGORITHMS_DLL IntegratePeaksMD2 final : public API::Algorithm {
30public:
32 const std::string name() const override { return "IntegratePeaksMD"; };
34 const std::string summary() const override {
35 return "Integrate single-crystal peaks in reciprocal space, for "
36 "MDEventWorkspaces. \n\n"
37 "Sphere is the default shape: tick Ellipsoid or Cylinder "
38 "to change shape.";
39 }
40
42 int version() const override { return 2; };
43 const std::vector<std::string> seeAlso() const override {
44 return {"CentroidPeaksMD", "IntegratePeaksHybrid", "IntegratePeaksMDHKL", "IntegratePeaksUsingClusters",
45 "IntegratePeaksCWSD"};
46 }
48 const std::string category() const override { return "MDAlgorithms\\Peaks;Crystal\\Integration"; }
49
50private:
52 void init() override;
54 void exec() override;
55
56 std::map<std::string, std::string> validateInputs() override;
57
58 template <typename MDE, size_t nd> void integrate(typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws);
59
62
63 // find the eigenvectors and eigenvalues that diagonalise the covariance
64 // matrix that defines an ellipsoid.
65 template <typename MDE, size_t nd>
66 void findEllipsoid(const typename DataObjects::MDEventWorkspace<MDE, nd>::sptr ws,
67 const Mantid::API::CoordTransform &getRadiusSq, const Mantid::Kernel::V3D &pos,
68 const coord_t &radiusSquared, const bool &qAxisBool, const bool &useCentroid,
69 const double &bgDensity, std::vector<Mantid::Kernel::V3D> &eigenvects,
70 std::vector<double> &eigenvals, Mantid::Kernel::V3D &mean, const int maxIter = 1);
71
72 void calcCovar(const std::vector<std::pair<Mantid::Kernel::V3D, double>> &peak_events, const Mantid::Kernel::V3D &pos,
73 const coord_t &radiusSquared, const bool &qAxisIsFixed, const bool &useCentroid,
74 std::vector<Mantid::Kernel::V3D> &eigenvects, std::vector<double> &eigenvals,
75 Mantid::Kernel::V3D &mean, const int maxIter);
76
77 // get matrix to transform from Qlab to plane perp to Q
78 void getPinv(const Mantid::Kernel::V3D &q, Mantid::Kernel::Matrix<double> &Pinv);
79
81 void calculateE1(const Geometry::DetectorInfo &detectorInfo);
82 double calculateDistanceToEdge(const Mantid::Kernel::V3D &QLabFrame);
83 void runMaskDetectors(const Mantid::DataObjects::PeaksWorkspace_sptr &peakWS, const std::string &property,
84 const std::string &values);
85
87 std::vector<Kernel::V3D> E1Vec;
88
90 void checkOverlap(int i, const Mantid::API::IPeaksWorkspace_sptr &peakWS,
91 Mantid::Kernel::SpecialCoordinateSystem CoordinatesToUse, double radius);
92};
93
94} // namespace MDAlgorithms
95} // namespace Mantid
double radius
Definition: Rasterize.cpp:31
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
Unique SingleValueParameter Declaration for InputNDimensions.
std::shared_ptr< MDEventWorkspace< MDE, nd > > sptr
Typedef for a shared pointer of this kind of event workspace.
Geometry::DetectorInfo is an intermediate step towards a DetectorInfo that is part of Instrument-2....
Definition: DetectorInfo.h:49
Numerical Matrix class.
Definition: Matrix.h:42
Class for 3D vectors.
Definition: V3D.h:34
Integrate single-crystal peaks in reciprocal-space.
std::vector< Kernel::V3D > E1Vec
save for all detector pixels
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
int version() const override
Algorithm's version for identification.
const std::string summary() const override
Summary of algorithms purpose.
Mantid::API::IMDEventWorkspace_sptr inWS
Input MDEventWorkspace.
const std::string name() const override
Algorithm's name for identification.
const std::string category() const override
Algorithm's category for identification.
std::shared_ptr< IMDEventWorkspace > IMDEventWorkspace_sptr
Shared pointer to Mantid::API::IMDEventWorkspace.
std::shared_ptr< IPeaksWorkspace > IPeaksWorkspace_sptr
shared pointer to Mantid::API::IPeaksWorkspace
std::shared_ptr< PeaksWorkspace > PeaksWorkspace_sptr
Typedef for a shared pointer to a peaks workspace.
SpecialCoordinateSystem
Special coordinate systems for Q3D.
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,...
Definition: MDTypes.h:27