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#include "MantidKernel/System.h"
17
18namespace Mantid {
19namespace Crystal {
28class MANTID_CRYSTAL_DLL PredictSatellitePeaks final : public API::Algorithm {
29public:
32 const std::string name() const override { return "PredictSatellitePeaks"; };
34 const std::string summary() const override {
35 return "The offsets can be from hkl values in a range of hkl values or "
36 "from peaks in the input PeaksWorkspace";
37 }
38
40 int version() const override { return 1; };
41 const std::vector<std::string> seeAlso() const override { return {"PredictPeaks"}; }
42
44 const std::string category() const override { return "Crystal\\Peaks"; }
45
46 /* Determine which type of workspace we're dealing with */
47 enum class workspace_type_enum { regular_peaks, lean_elastic_peaks, invalid };
48
49private:
50 workspace_type_enum determineWorkspaceType(const API::IPeaksWorkspace_sptr &iPeaksWorkspace) const;
51
52 std::shared_ptr<Geometry::IPeak> createPeakForOutputWorkspace(const Kernel::Matrix<double> &peakGoniometerMatrix,
53 const Kernel::V3D &satelliteHKL);
54
55 void addPeakToOutputWorkspace(const std::shared_ptr<Geometry::IPeak> &iPeak,
56 const Kernel::Matrix<double> &peak_goniometer_matrix, const Kernel::V3D &hkl,
57 const Kernel::V3D &satelliteHKL, const int runNumber,
58 std::vector<std::vector<int>> &alreadyDonePeaks, const Kernel::V3D &mnp);
59
60 const size_t MAX_NUMBER_HKLS = 10000000000;
65 void init() override;
66
68 void exec() override;
69 void exec_peaks();
70 Kernel::V3D getOffsetVector(const std::string &label);
71
72 void predictOffsets(const int indexModulatedVector, const Kernel::V3D &offsets, const int maxOrder,
73 const int runNumber, const Kernel::Matrix<double> &goniometer, const Kernel::V3D &hkl,
74 const Geometry::HKLFilterWavelength &lambdaFilter, const bool includePeaksInRange,
75 const bool includeOrderZero, std::vector<std::vector<int>> &alreadyDonePeaks);
76
77 void predictOffsetsWithCrossTerms(Kernel::V3D offsets1, Kernel::V3D offsets2, Kernel::V3D offsets3,
78 const int maxOrder, const int RunNumber,
79 Kernel::Matrix<double> const &peakGoniometerMatrix, Kernel::V3D &hkl,
80 const Geometry::HKLFilterWavelength &lambdaFilter, const bool includePeaksInRange,
81 const bool includeOrderZero, std::vector<std::vector<int>> &alreadyDonePeaks);
82};
83
84} // namespace Crystal
85} // namespace Mantid
const int maxOrder
Definition: IndexPeaks.cpp:55
Base class from which all concrete algorithm classes should be derived.
Definition: Algorithm.h:85
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.