14#include "boost/make_shared.hpp"
40 :
BasePeak(), m_Qsample(QSampleFrame), m_wavelength(0.) {}
52 boost::optional<std::shared_ptr<const Geometry::ReferenceFrame>> refFrame)
54 if (refFrame.is_initialized())
69 :
BasePeak(), m_Qsample(QSampleFrame), m_wavelength(wavelength) {}
83 :
BasePeak(ipeak), m_Qsample(ipeak.getQSampleFrame()), m_wavelength(ipeak.getWavelength()) {}
134 const double qSign = (
m_convention !=
"Crystallography") ? 1.0 : -1.0;
135 const V3D detectorDir = -qLab * qSign;
137 return atan2(detectorDir[refFrame->pointingUp()], detectorDir[refFrame->pointingHorizontal()]);
139 return atan2(detectorDir[1], detectorDir[0]);
181 }
catch (std::exception &e) {
182 g_log.
information() <<
"Unable to automatically determine wavelength from q-lab\n"
183 << e.what() <<
", goniometer is likely not correct\n";
246 if (&other !=
this) {
Structure describing a single-crystal peak.
Mantid::Kernel::Matrix< double > getInverseGoniometerMatrix() const
Get the goniometer rotation matrix at which this peak was measured.
BasePeak & operator=(BasePeak &&) noexcept=default
double calculateWavelengthFromQLab(const Mantid::Kernel::V3D &qLab)
Mantid::Kernel::Matrix< double > getGoniometerMatrix() const override
Get the goniometer rotation matrix at which this peak was measured.
void setGoniometerMatrix(const Mantid::Kernel::Matrix< double > &goniometerMatrix) override
Set the goniometer rotation matrix at which this peak was measured.
Structure describing a single-crystal peak.
int getCol() const override
returns the column (x) of the pixel of the detector, throws NotImplementedError for LeanElasticPeak
std::shared_ptr< const Geometry::ReferenceFrame > getReferenceFrame() const override
Return a shared ptr to the reference frame for this peak.
void setWavelength(double wavelength) override
Set the wavelength of the neutron.
void setFinalEnergy(double m_finalEnergy) override
Set the final energy.
void setQLabFrame(const Mantid::Kernel::V3D &qLab, boost::optional< double >=boost::none) override
Set the peak using the peak's position in reciprocal space, in the lab frame.
double getWavelength() const override
Return the neutron wavelength (in angstroms)
std::shared_ptr< const Geometry::ReferenceFrame > m_refFrame
double getAzimuthal() const override
Calculate the azimuthal angle of the peak
double getEnergyTransfer() const override
Get the difference between the initial and final neutron energy in meV, elastic so always 0.
double getL1() const override
Return the L1 flight path length (source to sample), in meters.
static Mantid::Kernel::Logger g_log
Static logger.
double m_wavelength
Wavelength of neutrons at the peak.
Mantid::Kernel::V3D getQSampleFrame() const override
Return the Q change (of the lattice, k_i - k_f) for this peak.
void setInitialEnergy(double m_initialEnergy) override
Set the initial energy.
Mantid::Kernel::V3D m_Qsample
Q_sample vector.
double getFinalEnergy() const override
Get the final neutron energy in meV.
Mantid::Kernel::V3D getQLabFrame() const override
Return the Q change (of the lattice, k_i - k_f) for this peak.
double getScattering() const override
Calculate the scattering angle of the peak
LeanElasticPeak()
Default constructor.
double getTOF() const override
Calculate the time of flight (in microseconds) of the neutrons for this peak, using the geometry of t...
double getDSpacing() const override
Calculate the d-spacing of the peak, in 1/Angstroms
int getRow() const override
returns the row (y) of the pixel of the detector, throws NotImplementedError for LeanElasticPeak
double getInitialEnergy() const override
Get the initial (incident) neutron energy in meV.
void setReferenceFrame(std::shared_ptr< const Geometry::ReferenceFrame > frame)
Setter for the reference frame.
void setQSampleFrame(const Mantid::Kernel::V3D &QSampleFrame, boost::optional< double >=boost::none) override
Set the peak using the peak's position in reciprocal space, in the sample frame.
double getL2() const override
Return the L2 flight path length (sample to detector), in meters.
LeanElasticPeak & operator=(LeanElasticPeak &&) noexcept=default
Structure describing a single-crystal peak.
Marks code as not implemented yet.
The Logger class is in charge of the publishing messages from the framework through various channels.
void information(const std::string &msg)
Logs at information level.
double norm() const noexcept
static constexpr double NeutronMass
Mass of the neutron in kg.
static constexpr double h
Planck constant in J*s.
static constexpr double meV
1 meV in Joules.
Helper class which provides the Collimation Length for SANS instruments.