Mantid
Loading...
Searching...
No Matches
LeanElasticPeak.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
12#include "MantidKernel/Logger.h"
13#include "MantidKernel/Matrix.h"
15#include "MantidKernel/V3D.h"
16#include <memory>
17#include <optional>
18
19namespace Mantid {
20
21namespace DataObjects {
22
30class MANTID_DATAOBJECTS_DLL LeanElasticPeak : public BasePeak {
31public:
33 LeanElasticPeak(const Mantid::Kernel::V3D &QSampleFrame);
34 LeanElasticPeak(const Mantid::Kernel::V3D &QSampleFrame, const Mantid::Kernel::Matrix<double> &goniometer,
35 std::optional<std::shared_ptr<const Geometry::ReferenceFrame>> refFrame = std::nullopt);
36 LeanElasticPeak(const Mantid::Kernel::V3D &QSampleFrame, double wavelength);
37
40
41 // MSVC 2015/17 can build with noexcept = default however
42 // intellisense still incorrectly reports this as an error despite compiling.
43 // https://connect.microsoft.com/VisualStudio/feedback/details/1795240/visual-c-2015-default-move-constructor-and-noexcept-keyword-bug
44 // For that reason we still use the supplied default which should be noexcept
45 // once the above is fixed we can remove this workaround
46#if defined(_MSC_VER) && _MSC_VER <= 1910
47 LeanElasticPeak(LeanElasticPeak &&) = default;
48 LeanElasticPeak &operator=(LeanElasticPeak &&) = default;
49#else
50 LeanElasticPeak(LeanElasticPeak &&) noexcept = default;
51 LeanElasticPeak &operator=(LeanElasticPeak &&) noexcept = default;
52#endif
53
54 // Construct a peak from a reference to the interface
55 explicit LeanElasticPeak(const Geometry::IPeak &ipeak);
56
57 std::shared_ptr<const Geometry::ReferenceFrame> getReferenceFrame() const override;
58
59 int getDetectorID() const override;
60
61 int getCol() const override;
62 int getRow() const override;
63
64 Mantid::Kernel::V3D getQLabFrame() const final; // Marked final since used in constructor
65 Mantid::Kernel::V3D getQSampleFrame() const override;
66
67 void setQSampleFrame(const Mantid::Kernel::V3D &QSampleFrame, std::optional<double> = std::nullopt) override;
68 void setQSampleFrame(const Mantid::Kernel::V3D &QSampleFrame, const Mantid::Kernel::Matrix<double> &goniometer);
69 void setQLabFrame(const Mantid::Kernel::V3D &qLab, std::optional<double> = std::nullopt) override;
70
71 void setWavelength(double wavelength) override;
72 double getWavelength() const override;
73 double getScattering() const override;
74 double getAzimuthal() const override;
75 double getDSpacing() const override;
76 double getTOF() const override;
77
78 double getInitialEnergy() const override;
79 double getFinalEnergy() const override;
80 double getEnergyTransfer() const override;
81 void setInitialEnergy(double m_initialEnergy) override;
82 void setFinalEnergy(double m_finalEnergy) override;
83
84 double getL1() const override;
85 double getL2() const override;
86
87 Mantid::Kernel::V3D getDetectorDirectionSampleFrame() const override;
88 Mantid::Kernel::V3D getSourceDirectionSampleFrame() const override;
89
91 LeanElasticPeak &operator=(const LeanElasticPeak &other);
92
93private:
94 void setReferenceFrame(std::shared_ptr<const Geometry::ReferenceFrame> frame);
95
97 Mantid::Kernel::V3D m_Qsample;
98
100 double m_wavelength;
101
102 std::shared_ptr<const Geometry::ReferenceFrame> m_refFrame;
103
105 static Mantid::Kernel::Logger g_log;
106};
107
108} // namespace DataObjects
109} // namespace Mantid
Structure describing a single-crystal peak.
Definition BasePeak.h:33
Structure describing a single-crystal peak.
LeanElasticPeak(const LeanElasticPeak &other)
Copy constructor.
LeanElasticPeak(LeanElasticPeak &&) noexcept=default
Structure describing a single-crystal peak.
Definition IPeak.h:26
ReferenceFrame : Holds reference frame information from the geometry description file.
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition Logger.h:51
Numerical Matrix class.
Definition Matrix.h:42
Class for 3D vectors.
Definition V3D.h:34
Helper class which provides the Collimation Length for SANS instruments.
STL namespace.