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 <boost/optional.hpp>
17#include <memory>
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 boost::optional<std::shared_ptr<const Geometry::ReferenceFrame>> refFrame = boost::none);
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 getCol() const override;
60 int getRow() const override;
61
62 Mantid::Kernel::V3D getQLabFrame() const override;
63 Mantid::Kernel::V3D getQSampleFrame() const override;
64
65 void setQSampleFrame(const Mantid::Kernel::V3D &QSampleFrame, boost::optional<double> = boost::none) override;
66 void setQSampleFrame(const Mantid::Kernel::V3D &QSampleFrame, const Mantid::Kernel::Matrix<double> &goniometer);
67 void setQLabFrame(const Mantid::Kernel::V3D &qLab, boost::optional<double> = boost::none) override;
68
69 void setWavelength(double wavelength) override;
70 double getWavelength() const override;
71 double getScattering() const override;
72 double getAzimuthal() const override;
73 double getDSpacing() const override;
74 double getTOF() const override;
75
76 double getInitialEnergy() const override;
77 double getFinalEnergy() const override;
78 double getEnergyTransfer() const override;
79 void setInitialEnergy(double m_initialEnergy) override;
80 void setFinalEnergy(double m_finalEnergy) override;
81
82 double getL1() const override;
83 double getL2() const override;
84
86 LeanElasticPeak &operator=(const LeanElasticPeak &other);
87
88private:
89 void setReferenceFrame(std::shared_ptr<const Geometry::ReferenceFrame> frame);
90
93
96
97 std::shared_ptr<const Geometry::ReferenceFrame> m_refFrame;
98
101};
102
103} // namespace DataObjects
104} // namespace Mantid
Structure describing a single-crystal peak.
Definition: BasePeak.h:33
Structure describing a single-crystal peak.
std::shared_ptr< const Geometry::ReferenceFrame > m_refFrame
static Mantid::Kernel::Logger g_log
Static logger.
double m_wavelength
Wavelength of neutrons at the peak.
LeanElasticPeak(const LeanElasticPeak &other)
Copy constructor.
Mantid::Kernel::V3D m_Qsample
Q_sample vector.
LeanElasticPeak(LeanElasticPeak &&) noexcept=default
Structure describing a single-crystal peak.
Definition: IPeak.h:26
The Logger class is in charge of the publishing messages from the framework through various channels.
Definition: Logger.h:52
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.