Mantid
|
Structure describing a single-crystal peak. More...
#include <LeanElasticPeak.h>
Public Member Functions | |
double | getAzimuthal () const override |
Calculate the azimuthal angle of the peak More... | |
int | getCol () const override |
returns the column (x) of the pixel of the detector, throws NotImplementedError for LeanElasticPeak More... | |
double | getDSpacing () const override |
Calculate the d-spacing of the peak, in 1/Angstroms More... | |
double | getEnergyTransfer () const override |
Get the difference between the initial and final neutron energy in meV, elastic so always 0. More... | |
double | getFinalEnergy () const override |
Get the final neutron energy in meV. More... | |
double | getInitialEnergy () const override |
Get the initial (incident) neutron energy in meV. More... | |
double | getL1 () const override |
Return the L1 flight path length (source to sample), in meters. More... | |
double | getL2 () const override |
Return the L2 flight path length (sample to detector), in meters. More... | |
Mantid::Kernel::V3D | getQLabFrame () const override |
Return the Q change (of the lattice, k_i - k_f) for this peak. More... | |
Mantid::Kernel::V3D | getQSampleFrame () const override |
Return the Q change (of the lattice, k_i - k_f) for this peak. More... | |
std::shared_ptr< const Geometry::ReferenceFrame > | getReferenceFrame () const override |
Return a shared ptr to the reference frame for this peak. More... | |
int | getRow () const override |
returns the row (y) of the pixel of the detector, throws NotImplementedError for LeanElasticPeak More... | |
double | getScattering () const override |
Calculate the scattering angle of the peak More... | |
double | getTOF () const override |
Calculate the time of flight (in microseconds) of the neutrons for this peak, using the geometry of the detector More... | |
double | getWavelength () const override |
Return the neutron wavelength (in angstroms) More... | |
LeanElasticPeak () | |
Default constructor. More... | |
LeanElasticPeak (const Geometry::IPeak &ipeak) | |
Constructor making a LeanElasticPeak from IPeak interface. More... | |
LeanElasticPeak (const LeanElasticPeak &other) | |
Copy constructor. More... | |
LeanElasticPeak (const Mantid::Kernel::V3D &QSampleFrame) | |
Constructor that uses the Q position of the peak (in the sample frame) and a goniometer rotation matrix. More... | |
LeanElasticPeak (const Mantid::Kernel::V3D &QSampleFrame, const Mantid::Kernel::Matrix< double > &goniometer, boost::optional< std::shared_ptr< const Geometry::ReferenceFrame > > refFrame=boost::none) | |
Constructor that uses the Q position of the peak (in the lab frame). More... | |
LeanElasticPeak (const Mantid::Kernel::V3D &QSampleFrame, double wavelength) | |
Constructor that uses the Q position of the peak (in the sample frame) and a goniometer rotation matrix. More... | |
LeanElasticPeak (LeanElasticPeak &&) noexcept=default | |
LeanElasticPeak & | operator= (const LeanElasticPeak &other) |
Assignment. More... | |
LeanElasticPeak & | operator= (LeanElasticPeak &&) noexcept=default |
void | setFinalEnergy (double m_finalEnergy) override |
Set the final energy. More... | |
void | setInitialEnergy (double m_initialEnergy) override |
Set the initial energy. More... | |
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. More... | |
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. More... | |
void | setQSampleFrame (const Mantid::Kernel::V3D &QSampleFrame, const Mantid::Kernel::Matrix< double > &goniometer) |
void | setWavelength (double wavelength) override |
Set the wavelength of the neutron. More... | |
Public Member Functions inherited from Mantid::DataObjects::BasePeak | |
BasePeak () | |
Default constructor. More... | |
BasePeak (BasePeak &&) noexcept=default | |
BasePeak (const BasePeak &other) | |
Copy constructor. More... | |
BasePeak (const Geometry::IPeak &ipeak) | |
Constructor making a LeanPeak from IPeak interface. More... | |
BasePeak (const Mantid::Kernel::Matrix< double > &goniometer) | |
Constructor including goniometer. More... | |
double | getAbsorptionWeightedPathLength () const override |
Gets the absorption weighted path length. More... | |
double | getBinCount () const override |
Return the # of counts in the bin at its peak. More... | |
Mantid::Kernel::Matrix< double > | getGoniometerMatrix () const override |
Get the goniometer rotation matrix at which this peak was measured. More... | |
double | getH () const override |
Get the H index of the peak. More... | |
Mantid::Kernel::V3D | getHKL () const override |
Return the HKL vector. More... | |
double | getIntensity () const override |
Return the integrated peak intensity. More... | |
double | getIntensityOverSigma () const override |
Return the peak intensity divided by the error in the intensity. More... | |
Mantid::Kernel::V3D | getIntHKL () const override |
Return the int HKL vector. More... | |
Mantid::Kernel::V3D | getIntMNP () const override |
Return the int MNP vector. More... | |
Mantid::Kernel::Matrix< double > | getInverseGoniometerMatrix () const |
Get the goniometer rotation matrix at which this peak was measured. More... | |
double | getK () const override |
Get the K index of the peak. More... | |
double | getL () const override |
Get the L index of the peak. More... | |
double | getMonitorCount () const override |
Return the monitor count stored in this peak. More... | |
int | getPeakNumber () const override |
Returns the unique peak number Returns -1 if it could not find it. More... | |
const Mantid::Geometry::PeakShape & | getPeakShape () const override |
Get the peak shape. More... | |
int | getRunNumber () const override |
Return the run number this peak was measured at. More... | |
Mantid::Kernel::V3D | getSamplePos () const override |
Return the sample position vector. More... | |
double | getSigmaIntensity () const override |
Return the error on the integrated peak intensity. More... | |
virtual double | getValueByColName (std::string colName) const |
Helper function for displaying/sorting peaks. More... | |
bool | isIndexed () const override |
Return True if the peak has been indexed. More... | |
BasePeak & | operator= (BasePeak &&) noexcept=default |
BasePeak & | operator= (const BasePeak &other) |
Assignment. More... | |
void | setAbsorptionWeightedPathLength (double pathLength) override |
Set the absorption weighted path length. More... | |
void | setBinCount (double m_binCount) override |
Set the # of counts in the bin at its peak. More... | |
void | setGoniometerMatrix (const Mantid::Kernel::Matrix< double > &goniometerMatrix) override |
Set the goniometer rotation matrix at which this peak was measured. More... | |
void | setH (double m_H) override |
Set the H index of this peak. More... | |
void | setHKL (const Mantid::Kernel::V3D &HKL) override |
Set all HKL. More... | |
void | setHKL (double H, double K, double L) override |
Set all three H,K,L indices of the peak. More... | |
void | setIntensity (double m_intensity) override |
Set the integrated peak intensity. More... | |
void | setIntHKL (const Kernel::V3D &HKL) override |
Set int HKL. More... | |
void | setIntMNP (const Mantid::Kernel::V3D &MNP) override |
Sets the modulated peak structure number. More... | |
void | setK (double m_K) override |
Set the K index of this peak. More... | |
void | setL (double m_L) override |
Set the L index of this peak. More... | |
void | setMonitorCount (double m_monitorCount) override |
Set the monitor count for this peak. More... | |
void | setPeakNumber (int m_peakNumber) override |
Sets the unique peak number. More... | |
void | setPeakShape (Mantid::Geometry::PeakShape *shape) override |
Set the PeakShape. More... | |
void | setPeakShape (Mantid::Geometry::PeakShape_const_sptr shape) override |
Set the PeakShape. More... | |
void | setRunNumber (int m_runNumber) override |
Set the run number that measured this peak. More... | |
void | setSamplePos (const Mantid::Kernel::V3D &XYZ) override |
Set sample position. More... | |
void | setSamplePos (double samX, double samY, double samZ) override |
Set sample position. More... | |
void | setSigmaIntensity (double m_sigmaIntensity) override |
Set the error on the integrated peak intensity. More... | |
Public Member Functions inherited from Mantid::Geometry::IPeak | |
virtual double | getAbsorptionWeightedPathLength () const =0 |
virtual double | getAzimuthal () const =0 |
virtual double | getBinCount () const =0 |
virtual int | getCol () const =0 |
virtual double | getDSpacing () const =0 |
virtual double | getEnergyTransfer () const =0 |
virtual double | getFinalEnergy () const =0 |
virtual Mantid::Kernel::Matrix< double > | getGoniometerMatrix () const =0 |
virtual double | getH () const =0 |
virtual Mantid::Kernel::V3D | getHKL () const =0 |
virtual double | getInitialEnergy () const =0 |
virtual double | getIntensity () const =0 |
virtual double | getIntensityOverSigma () const =0 |
virtual Mantid::Kernel::V3D | getIntHKL () const =0 |
virtual Mantid::Kernel::V3D | getIntMNP () const =0 |
virtual double | getK () const =0 |
virtual double | getL () const =0 |
virtual double | getL1 () const =0 |
virtual double | getL2 () const =0 |
virtual double | getMonitorCount () const =0 |
virtual int | getPeakNumber () const =0 |
virtual const Mantid::Geometry::PeakShape & | getPeakShape () const =0 |
virtual Mantid::Kernel::V3D | getQLabFrame () const =0 |
virtual Mantid::Kernel::V3D | getQSampleFrame () const =0 |
virtual std::shared_ptr< const Geometry::ReferenceFrame > | getReferenceFrame () const =0 |
virtual int | getRow () const =0 |
virtual int | getRunNumber () const =0 |
virtual Mantid::Kernel::V3D | getSamplePos () const =0 |
virtual double | getScattering () const =0 |
virtual double | getSigmaIntensity () const =0 |
virtual double | getTOF () const =0 |
virtual double | getWavelength () const =0 |
virtual bool | isIndexed () const =0 |
virtual void | setAbsorptionWeightedPathLength (double pathLength)=0 |
virtual void | setBinCount (double m_BinCount)=0 |
virtual void | setFinalEnergy (double m_FinalEnergy)=0 |
virtual void | setGoniometerMatrix (const Mantid::Kernel::Matrix< double > &m_GoniometerMatrix)=0 |
virtual void | setH (double m_H)=0 |
virtual void | setHKL (const Mantid::Kernel::V3D &HKL)=0 |
virtual void | setHKL (double H, double K, double L)=0 |
virtual void | setInitialEnergy (double m_InitialEnergy)=0 |
virtual void | setIntensity (double m_Intensity)=0 |
virtual void | setIntHKL (const Mantid::Kernel::V3D &HKL)=0 |
virtual void | setIntMNP (const Mantid::Kernel::V3D &MNP)=0 |
virtual void | setK (double m_K)=0 |
virtual void | setL (double m_L)=0 |
virtual void | setMonitorCount (double m_MonitorCount)=0 |
virtual void | setPeakNumber (int m_PeakNumber)=0 |
virtual void | setPeakShape (Mantid::Geometry::PeakShape *shape)=0 |
virtual void | setPeakShape (Mantid::Geometry::PeakShape_const_sptr shape)=0 |
virtual void | setQLabFrame (const Mantid::Kernel::V3D &QLabFrame, boost::optional< double > detectorDistance)=0 |
virtual void | setQSampleFrame (const Mantid::Kernel::V3D &QSampleFrame, boost::optional< double > detectorDistance)=0 |
virtual void | setRunNumber (int m_RunNumber)=0 |
virtual void | setSamplePos (const Mantid::Kernel::V3D &XYZ)=0 |
virtual void | setSamplePos (double samX, double samY, double samZ)=0 |
virtual void | setSigmaIntensity (double m_SigmaIntensity)=0 |
virtual void | setWavelength (double wavelength)=0 |
virtual | ~IPeak ()=default |
Private Member Functions | |
void | setReferenceFrame (std::shared_ptr< const Geometry::ReferenceFrame > frame) |
Setter for the reference frame. More... | |
Private Attributes | |
Mantid::Kernel::V3D | m_Qsample |
Q_sample vector. More... | |
std::shared_ptr< const Geometry::ReferenceFrame > | m_refFrame |
double | m_wavelength |
Wavelength of neutrons at the peak. More... | |
Static Private Attributes | |
static Mantid::Kernel::Logger | g_log |
Static logger. More... | |
Additional Inherited Members | |
Protected Member Functions inherited from Mantid::DataObjects::BasePeak | |
double | calculateWavelengthFromQLab (const Mantid::Kernel::V3D &qLab) |
Protected Attributes inherited from Mantid::DataObjects::BasePeak | |
std::string | m_convention |
Mantid::Kernel::V3D | m_samplePos |
Cached sample position. More... | |
Structure describing a single-crystal peak.
This is a version of Peak that doesn't require the instrument and also assuming elastic scattering. The peak is described only by the Q-sample position. Optionally if the wavelength and goniometer is provided other properties can be calculated.
Definition at line 30 of file LeanElasticPeak.h.
Mantid::DataObjects::LeanElasticPeak::LeanElasticPeak | ( | ) |
Default constructor.
Definition at line 29 of file LeanElasticPeak.cpp.
Mantid::DataObjects::LeanElasticPeak::LeanElasticPeak | ( | const Mantid::Kernel::V3D & | QSampleFrame | ) |
Constructor that uses the Q position of the peak (in the sample frame) and a goniometer rotation matrix.
No detector ID is set.
QSampleFrame | :: Q of the center of the peak, in reciprocal space, in the sample frame (goniometer rotation accounted for). |
Definition at line 39 of file LeanElasticPeak.cpp.
Mantid::DataObjects::LeanElasticPeak::LeanElasticPeak | ( | const Mantid::Kernel::V3D & | QSampleFrame, |
const Mantid::Kernel::Matrix< double > & | goniometer, | ||
boost::optional< std::shared_ptr< const Geometry::ReferenceFrame > > | refFrame = boost::none |
||
) |
Constructor that uses the Q position of the peak (in the lab frame).
No detector ID is set.
QSampleFrame | :: Q of the center of the peak, in reciprocal space |
goniometer | :: a 3x3 rotation matrix |
refFrame | :: optional reference frame, will default to beam along +Z |
Definition at line 50 of file LeanElasticPeak.cpp.
References setQSampleFrame(), and setReferenceFrame().
Mantid::DataObjects::LeanElasticPeak::LeanElasticPeak | ( | const Mantid::Kernel::V3D & | QSampleFrame, |
double | wavelength | ||
) |
Constructor that uses the Q position of the peak (in the sample frame) and a goniometer rotation matrix.
No detector ID is set.
QSampleFrame | :: Q of the center of the peak, in reciprocal space, in the sample frame (goniometer rotation accounted for). |
wavelength | :: wavelength in Angstroms. |
Definition at line 68 of file LeanElasticPeak.cpp.
|
default |
Copy constructor.
other | : Source |
|
defaultnoexcept |
|
explicit |
Constructor making a LeanElasticPeak from IPeak interface.
ipeak | :: const reference to an IPeak object |
Definition at line 82 of file LeanElasticPeak.cpp.
|
overridevirtual |
Calculate the azimuthal angle of the peak
Implements Mantid::Geometry::IPeak.
Definition at line 131 of file LeanElasticPeak.cpp.
References getQLabFrame(), getReferenceFrame(), and Mantid::DataObjects::BasePeak::m_convention.
|
overridevirtual |
returns the column (x) of the pixel of the detector, throws NotImplementedError for LeanElasticPeak
Implements Mantid::Geometry::IPeak.
Definition at line 121 of file LeanElasticPeak.cpp.
|
overridevirtual |
Calculate the d-spacing of the peak, in 1/Angstroms
Implements Mantid::Geometry::IPeak.
Definition at line 144 of file LeanElasticPeak.cpp.
References m_Qsample, and Mantid::Kernel::V3D::norm().
Referenced by getScattering(), and Mantid::DataObjects::LeanElasticPeaksWorkspace::saveNexus().
|
overridevirtual |
Get the difference between the initial and final neutron energy in meV, elastic so always 0.
Implements Mantid::Geometry::IPeak.
Definition at line 216 of file LeanElasticPeak.cpp.
|
overridevirtual |
Get the final neutron energy in meV.
Implements Mantid::Geometry::IPeak.
Definition at line 202 of file LeanElasticPeak.cpp.
References energy, Mantid::PhysicalConstants::h, m_wavelength, Mantid::PhysicalConstants::meV, and Mantid::PhysicalConstants::NeutronMass.
Referenced by getInitialEnergy().
|
overridevirtual |
Get the initial (incident) neutron energy in meV.
Implements Mantid::Geometry::IPeak.
Definition at line 212 of file LeanElasticPeak.cpp.
References getFinalEnergy().
|
overridevirtual |
Return the L1 flight path length (source to sample), in meters.
Implements Mantid::Geometry::IPeak.
Definition at line 230 of file LeanElasticPeak.cpp.
|
overridevirtual |
Return the L2 flight path length (sample to detector), in meters.
Implements Mantid::Geometry::IPeak.
Definition at line 236 of file LeanElasticPeak.cpp.
|
overridevirtual |
Return the Q change (of the lattice, k_i - k_f) for this peak.
The Q is in the Lab frame: the goniometer rotation was NOT taken out.
Note: There is a 2*pi factor used, so |Q| = 2*pi/wavelength.
Implements Mantid::Geometry::IPeak.
Definition at line 152 of file LeanElasticPeak.cpp.
References Mantid::DataObjects::BasePeak::getGoniometerMatrix(), and m_Qsample.
Referenced by getAzimuthal(), Mantid::DataObjects::Peak::Peak(), Mantid::DataObjects::LeanElasticPeaksWorkspace::saveNexus(), and setQSampleFrame().
|
overridevirtual |
Return the Q change (of the lattice, k_i - k_f) for this peak.
The Q is in the Sample frame: the goniometer rotation WAS taken out.
Implements Mantid::Geometry::IPeak.
Definition at line 157 of file LeanElasticPeak.cpp.
References m_Qsample.
|
overridevirtual |
Return a shared ptr to the reference frame for this peak.
Implements Mantid::Geometry::IPeak.
Definition at line 93 of file LeanElasticPeak.cpp.
References m_refFrame.
Referenced by getAzimuthal().
|
overridevirtual |
returns the row (y) of the pixel of the detector, throws NotImplementedError for LeanElasticPeak
Implements Mantid::Geometry::IPeak.
Definition at line 116 of file LeanElasticPeak.cpp.
|
overridevirtual |
Calculate the scattering angle of the peak
Implements Mantid::Geometry::IPeak.
Definition at line 127 of file LeanElasticPeak.cpp.
References getDSpacing(), and getWavelength().
Referenced by Mantid::DataObjects::LeanElasticPeaksWorkspace::saveNexus().
|
overridevirtual |
Calculate the time of flight (in microseconds) of the neutrons for this peak, using the geometry of the detector
Implements Mantid::Geometry::IPeak.
Definition at line 111 of file LeanElasticPeak.cpp.
|
overridevirtual |
Return the neutron wavelength (in angstroms)
Implements Mantid::Geometry::IPeak.
Definition at line 105 of file LeanElasticPeak.cpp.
References m_wavelength.
Referenced by getScattering(), and Mantid::DataObjects::LeanElasticPeaksWorkspace::saveNexus().
LeanElasticPeak & Mantid::DataObjects::LeanElasticPeak::operator= | ( | const LeanElasticPeak & | other | ) |
Assignment.
Assignement operator overload.
other | : Other peak object to assign from |
Definition at line 245 of file LeanElasticPeak.cpp.
References m_Qsample, m_wavelength, and Mantid::DataObjects::BasePeak::operator=().
|
defaultnoexcept |
|
overridevirtual |
Set the final energy.
Implements Mantid::Geometry::IPeak.
Definition at line 219 of file LeanElasticPeak.cpp.
|
overridevirtual |
Set the initial energy.
Implements Mantid::Geometry::IPeak.
Definition at line 224 of file LeanElasticPeak.cpp.
|
overridevirtual |
Set the peak using the peak's position in reciprocal space, in the lab frame.
qLab | :: Q of the center of the peak, in reciprocal space. This is in inelastic convention: momentum transfer of the LATTICE! Also, q does have a 2pi factor = it is equal to 2pi/wavelength (in Angstroms). |
Implements Mantid::Geometry::IPeak.
Definition at line 196 of file LeanElasticPeak.cpp.
References Mantid::DataObjects::BasePeak::getInverseGoniometerMatrix(), and setQSampleFrame().
|
overridevirtual |
Set the peak using the peak's position in reciprocal space, in the sample frame.
QSampleFrame | :: Q of the center of the peak, in reciprocal space This is in inelastic convention: momentum transfer of the LATTICE! Also, q does NOT have a 2pi factor = it is equal to 1/wavelength. |
Implements Mantid::Geometry::IPeak.
Definition at line 167 of file LeanElasticPeak.cpp.
References m_Qsample.
Referenced by LeanElasticPeak(), and setQLabFrame().
void Mantid::DataObjects::LeanElasticPeak::setQSampleFrame | ( | const Mantid::Kernel::V3D & | QSampleFrame, |
const Mantid::Kernel::Matrix< double > & | goniometer | ||
) |
Definition at line 171 of file LeanElasticPeak.cpp.
References Mantid::DataObjects::BasePeak::calculateWavelengthFromQLab(), g_log, getQLabFrame(), Mantid::Kernel::Logger::information(), m_Qsample, Mantid::DataObjects::BasePeak::setGoniometerMatrix(), and setWavelength().
|
private |
Setter for the reference frame.
frame | : reference frame object to use. |
Definition at line 101 of file LeanElasticPeak.cpp.
References m_refFrame.
Referenced by LeanElasticPeak().
|
overridevirtual |
Set the wavelength of the neutron.
Assumes elastic scattering.
wavelength | :: wavelength in Angstroms. |
Implements Mantid::Geometry::IPeak.
Definition at line 90 of file LeanElasticPeak.cpp.
References m_wavelength.
Referenced by setQSampleFrame().
|
staticprivate |
|
private |
Q_sample vector.
Definition at line 92 of file LeanElasticPeak.h.
Referenced by getDSpacing(), getQLabFrame(), getQSampleFrame(), operator=(), and setQSampleFrame().
|
private |
Definition at line 97 of file LeanElasticPeak.h.
Referenced by getReferenceFrame(), and setReferenceFrame().
|
private |
Wavelength of neutrons at the peak.
Definition at line 95 of file LeanElasticPeak.h.
Referenced by getFinalEnergy(), getWavelength(), operator=(), and setWavelength().