Mantid
Loading...
Searching...
No Matches
BasePeak.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
9#include "MantidDataObjects/DllConfig.h"
13#include "MantidKernel/Logger.h"
14#include "MantidKernel/Matrix.h"
16#include "MantidKernel/V3D.h"
17#include <boost/optional.hpp>
18#include <memory>
19
20namespace Mantid {
21
22namespace Geometry {
23class InstrumentRayTracer;
24}
25
26namespace DataObjects {
27
33class MANTID_DATAOBJECTS_DLL BasePeak : public Geometry::IPeak {
34public:
35 BasePeak();
38 BasePeak(const BasePeak &other);
39
40 // MSVC 2015/17 can build with noexcept = default however
41 // intellisense still incorrectly reports this as an error despite compiling.
42 // https://connect.microsoft.com/VisualStudio/feedback/details/1795240/visual-c-2015-default-move-constructor-and-noexcept-keyw
43 // ord-bug For that reason we still use the supplied default which should be
44 // noexcept once the above is fixed we can remove this workaround
45#if defined(_MSC_VER) && _MSC_VER <= 1910
46 BasePeak(BasePeak &&) = default;
47 BasePeak &operator=(BasePeak &&) = default;
48#else
49 BasePeak(BasePeak &&) noexcept = default;
50 BasePeak &operator=(BasePeak &&) noexcept = default;
51#endif
52
53 // Construct a peak from a reference to the interface
54 explicit BasePeak(const Geometry::IPeak &ipeak);
55
56 int getRunNumber() const override;
57 void setRunNumber(int m_runNumber) override;
58
59 double getMonitorCount() const override;
60 void setMonitorCount(double m_monitorCount) override;
61
62 double getH() const override;
63 double getK() const override;
64 double getL() const override;
65 Mantid::Kernel::V3D getHKL() const override;
66 bool isIndexed() const override;
67 Mantid::Kernel::V3D getIntHKL() const override;
68 Mantid::Kernel::V3D getIntMNP() const override;
69 void setH(double m_H) override;
70 void setK(double m_K) override;
71 void setL(double m_L) override;
72 void setHKL(double H, double K, double L) override;
73 void setHKL(const Mantid::Kernel::V3D &HKL) override;
74 void setIntHKL(const Kernel::V3D &HKL) override;
75 void setIntMNP(const Mantid::Kernel::V3D &MNP) override;
76
77 Mantid::Kernel::V3D getSamplePos() const override;
78 void setSamplePos(double samX, double samY, double samZ) override;
79 void setSamplePos(const Mantid::Kernel::V3D &XYZ) override;
80
81 double getIntensity() const override;
82 double getSigmaIntensity() const override;
83 double getIntensityOverSigma() const override;
84
85 void setIntensity(double m_intensity) override;
86 void setSigmaIntensity(double m_sigmaIntensity) override;
87
88 double getBinCount() const override;
89 void setBinCount(double m_binCount) override;
90
91 Mantid::Kernel::Matrix<double> getGoniometerMatrix() const override;
92 Mantid::Kernel::Matrix<double> getInverseGoniometerMatrix() const;
93 void setGoniometerMatrix(const Mantid::Kernel::Matrix<double> &goniometerMatrix) override;
94
95 void setPeakNumber(int m_peakNumber) override;
96 int getPeakNumber() const override;
97
98 virtual double getValueByColName(std::string colName) const;
99
101 const Mantid::Geometry::PeakShape &getPeakShape() const override;
102
104 void setPeakShape(Mantid::Geometry::PeakShape *shape) override;
105
107 void setPeakShape(Mantid::Geometry::PeakShape_const_sptr shape) override;
108
110 BasePeak &operator=(const BasePeak &other);
111
112 void setAbsorptionWeightedPathLength(double pathLength) override;
113 double getAbsorptionWeightedPathLength() const override;
114
115protected:
116 double calculateWavelengthFromQLab(const Mantid::Kernel::V3D &qLab);
117
118 // ki-kf for Inelastic convention; kf-ki for Crystallography convention
119 std::string m_convention;
120
123
124private:
126 double m_H;
127
129 double m_K;
130
132 double m_L;
133
136
139
142
145
148
152
155
158
162
165
168};
169
170} // namespace DataObjects
171} // namespace Mantid
Structure describing a single-crystal peak.
Definition: BasePeak.h:33
BasePeak(BasePeak &&) noexcept=default
int m_runNumber
Originating run number for this peak.
Definition: BasePeak.h:154
Mantid::Kernel::Matrix< double > m_GoniometerMatrix
Orientation matrix of the goniometer angles.
Definition: BasePeak.h:147
double m_absorptionWeightedPathLength
absorption weighted path length (aka t bar)
Definition: BasePeak.h:144
double m_intensity
Integrated peak intensity.
Definition: BasePeak.h:135
static Mantid::Kernel::Logger g_log
Static logger.
Definition: BasePeak.h:167
double m_sigmaIntensity
Error (sigma) on peak intensity.
Definition: BasePeak.h:138
Mantid::Kernel::V3D m_samplePos
Cached sample position.
Definition: BasePeak.h:122
double m_K
K of the peak.
Definition: BasePeak.h:129
double m_H
H of the peak.
Definition: BasePeak.h:126
double m_binCount
Count in the bin at the peak.
Definition: BasePeak.h:141
Mantid::Kernel::Matrix< double > m_InverseGoniometerMatrix
Inverse of the goniometer rotation matrix; used to go from Q in lab frame to Q in sample frame.
Definition: BasePeak.h:151
Mantid::Kernel::V3D m_intHKL
Definition: BasePeak.h:160
double m_L
L of the peak.
Definition: BasePeak.h:132
Mantid::Geometry::PeakShape_const_sptr m_peakShape
Peak shape.
Definition: BasePeak.h:164
Mantid::Kernel::V3D m_intMNP
Definition: BasePeak.h:161
double m_monitorCount
Integrated monitor count over TOF range for this run.
Definition: BasePeak.h:157
HKL : HKL MDFrame.
Definition: HKL.h:21
Structure describing a single-crystal peak.
Definition: IPeak.h:26
PeakShape : Abstract type to describes the shape of a peak.
Definition: PeakShape.h:20
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
std::shared_ptr< const PeakShape > PeakShape_const_sptr
Definition: PeakShape.h:43
Helper class which provides the Collimation Length for SANS instruments.