Mantid
Loading...
Searching...
No Matches
PredictSatellitePeaks.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 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
11#include "MantidCrystal/DllConfig.h"
16
17namespace Mantid {
18namespace Crystal {
27class MANTID_CRYSTAL_DLL PredictSatellitePeaks final : public API::Algorithm {
28public:
31 const std::string name() const override { return "PredictSatellitePeaks"; };
33 const std::string summary() const override {
34 return "The offsets can be from hkl values in a range of hkl values or "
35 "from peaks in the input PeaksWorkspace";
36 }
37
39 int version() const override { return 1; };
40 const std::vector<std::string> seeAlso() const override { return {"PredictPeaks"}; }
41
43 const std::string category() const override { return "Crystal\\Peaks"; }
44
45 /* Determine which type of workspace we're dealing with */
46 enum class workspace_type_enum { regular_peaks, lean_elastic_peaks, invalid };
47
48private:
49 workspace_type_enum determineWorkspaceType(const API::IPeaksWorkspace_sptr &iPeaksWorkspace) const;
50
51 std::shared_ptr<Geometry::IPeak> createPeakForOutputWorkspace(const Kernel::Matrix<double> &peakGoniometerMatrix,
52 const Kernel::V3D &satelliteHKL);
53
54 void addPeakToOutputWorkspace(const std::shared_ptr<Geometry::IPeak> &iPeak,
55 const Kernel::Matrix<double> &peak_goniometer_matrix, const Kernel::V3D &hkl,
56 const Kernel::V3D &satelliteHKL, const int runNumber,
57 std::vector<std::vector<int>> &alreadyDonePeaks, const Kernel::V3D &mnp);
58
59 const size_t MAX_NUMBER_HKLS = 10000000000;
64 void init() override;
65
67 void exec() override;
68 void exec_peaks();
69 Kernel::V3D getOffsetVector(const std::string &label);
70
71 void predictOffsets(const int indexModulatedVector, const Kernel::V3D &offsets, const int maxOrder,
72 const int runNumber, const Kernel::Matrix<double> &goniometer, const Kernel::V3D &hkl,
73 const Geometry::HKLFilterWavelength &lambdaFilter, const bool includePeaksInRange,
74 const bool includeOrderZero, std::vector<std::vector<int>> &alreadyDonePeaks);
75
76 void predictOffsetsWithCrossTerms(Kernel::V3D offsets1, Kernel::V3D offsets2, Kernel::V3D offsets3,
77 const int maxOrder, const int RunNumber,
78 Kernel::Matrix<double> const &peakGoniometerMatrix, Kernel::V3D &hkl,
79 const Geometry::HKLFilterWavelength &lambdaFilter, const bool includePeaksInRange,
80 const bool includeOrderZero, std::vector<std::vector<int>> &alreadyDonePeaks);
81};
82
83} // namespace Crystal
84} // namespace Mantid
const int maxOrder
Base class from which all concrete algorithm classes should be derived.
Definition Algorithm.h:76
PredictSatellitePeaks : Algorithm to create a PeaksWorkspace with peaks corresponding to fractional h...
const std::vector< std::string > seeAlso() const override
Function to return all of the seeAlso (these are not validated) algorithms related to this algorithm....
const std::string summary() const override
Summary of algorithms purpose.
const std::string name() const override
Algorithm's name for identification.
int version() const override
Algorithm's version for identification.
const std::string category() const override
Algorithm's category for identification.
Numerical Matrix class.
Definition Matrix.h:42
Class for 3D vectors.
Definition V3D.h:34
std::shared_ptr< IPeaksWorkspace > IPeaksWorkspace_sptr
shared pointer to Mantid::API::IPeaksWorkspace
Helper class which provides the Collimation Length for SANS instruments.