Mantid
|
#include <FindSXPeaksHelper.h>
Public Member Functions | |
bool | compare (const SXPeak &rhs, const double xTolerance, const double phiTolerance, const double thetaTolerance, const XAxisUnit tofUnits=XAxisUnit::TOF) const |
Object comparison. More... | |
bool | compare (const SXPeak &rhs, double tolerance) const |
Object comparison. More... | |
detid_t | getDetectorId () const |
Getter for the detector Id. More... | |
const double & | getIntensity () const |
Getter for the intensity. More... | |
Mantid::Kernel::V3D | getQ () const |
Getter for LabQ. More... | |
SXPeak & | operator+= (const SXPeak &rhs) |
Operator addition overload. More... | |
void | reduce () |
Normalise by number of pixels. More... | |
SXPeak (double t, double phi, double intensity, const std::vector< int > &spectral, const size_t wsIndex, const Mantid::API::SpectrumInfo &spectrumInfo) | |
Constructor. More... | |
Private Attributes | |
detid_t | m_detId |
Detector ID. More... | |
double | m_dSpacing |
d-spacing at the peak centre More... | |
double | m_intensity |
Measured intensity of centre of the peak. More... | |
double | m_LTotal |
Detector-sample distance. More... | |
int | m_nPixels |
Number of contributing pixels. More... | |
double | m_phi |
Phi angle for the centre detector of the peak. More... | |
std::string | m_qConvention |
Q Convention. More... | |
std::vector< int > | m_spectra |
Contributing spectra to this peak. More... | |
double | m_tof |
TOF for the peak centre. More... | |
double | m_twoTheta |
2 * theta angle for then centre detector of the peak More... | |
Kernel::V3D | m_unitWaveVector |
Unit vector in the direction of the wavevector. More... | |
size_t | m_wsIndex |
Detector workspace index. More... | |
Friends | |
std::ostream & | operator<< (std::ostream &os, const SXPeak &rhs) |
Definition at line 38 of file FindSXPeaksHelper.h.
Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak | ( | double | t, |
double | phi, | ||
double | intensity, | ||
const std::vector< int > & | spectral, | ||
const size_t | wsIndex, | ||
const Mantid::API::SpectrumInfo & | spectrumInfo | ||
) |
Constructor.
t | : tof |
phi | : psi angle |
intensity | : peak intensity |
spectral | : contributing spectra |
wsIndex | : ws index of the contributing spectrum |
spectrumInfo | spectrum info of the original ws. |
Definition at line 68 of file FindSXPeaksHelper.cpp.
References Mantid::API::SpectrumInfo::detector(), Mantid::Kernel::DeltaEMode::Elastic, Mantid::API::SpectrumInfo::getDetectorValues(), Mantid::Geometry::IDetector::getID(), Mantid::API::SpectrumInfo::hasDetectors(), Mantid::Kernel::SingletonHolder< T >::Instance(), Mantid::API::SpectrumInfo::l1(), Mantid::API::SpectrumInfo::l2(), Mantid::Kernel::l2, m_detId, m_dSpacing, m_LTotal, m_nPixels, m_qConvention, m_tof, m_twoTheta, m_unitWaveVector, m_wsIndex, Mantid::Kernel::normalize(), Mantid::API::SpectrumInfo::position(), Mantid::API::SpectrumInfo::samplePosition(), Mantid::API::SpectrumInfo::sourcePosition(), std::to_string(), and Mantid::API::SpectrumInfo::twoTheta().
bool Mantid::Crystal::FindSXPeaksHelper::SXPeak::compare | ( | const SXPeak & | rhs, |
const double | xTolerance, | ||
const double | phiTolerance, | ||
const double | thetaTolerance, | ||
const XAxisUnit | tofUnits = XAxisUnit::TOF |
||
) | const |
Object comparison.
Note that the tolerances are absolute and there is one per trait.
Definition at line 130 of file FindSXPeaksHelper.cpp.
References m_dSpacing, m_phi, m_tof, m_twoTheta, rhs, and Mantid::Crystal::FindSXPeaksHelper::TOF.
bool Mantid::Crystal::FindSXPeaksHelper::SXPeak::compare | ( | const SXPeak & | rhs, |
double | tolerance | ||
) | const |
Object comparison.
Object comparision.
Note that the tolerance is relative and used for all three traits.
rhs | : other SXPeak |
tolerance | : tolerance |
Definition at line 120 of file FindSXPeaksHelper.cpp.
References m_nPixels, m_phi, m_tof, m_twoTheta, rhs, and tolerance.
Referenced by Mantid::Crystal::FindSXPeaksHelper::RelativeCompareStrategy::compare(), and Mantid::Crystal::FindSXPeaksHelper::AbsoluteCompareStrategy::compare().
detid_t Mantid::Crystal::FindSXPeaksHelper::SXPeak::getDetectorId | ( | ) | const |
Getter for the detector Id.
Definition at line 202 of file FindSXPeaksHelper.cpp.
References m_detId.
const double & Mantid::Crystal::FindSXPeaksHelper::SXPeak::getIntensity | ( | ) | const |
Getter for the intensity.
Definition at line 197 of file FindSXPeaksHelper.cpp.
References m_intensity.
Mantid::Kernel::V3D Mantid::Crystal::FindSXPeaksHelper::SXPeak::getQ | ( | ) | const |
Getter for LabQ.
Definition at line 153 of file FindSXPeaksHelper.cpp.
References Mantid::PhysicalConstants::h_bar, m_LTotal, m_qConvention, m_tof, m_unitWaveVector, and Mantid::PhysicalConstants::NeutronMass.
Operator addition overload.
rhs | : Right hand slide peak for addition. |
Definition at line 173 of file FindSXPeaksHelper.cpp.
References m_intensity, m_LTotal, m_nPixels, m_phi, m_spectra, m_tof, m_twoTheta, and rhs.
void Mantid::Crystal::FindSXPeaksHelper::SXPeak::reduce | ( | ) |
Normalise by number of pixels.
Definition at line 185 of file FindSXPeaksHelper.cpp.
References m_intensity, m_LTotal, m_nPixels, m_phi, m_tof, and m_twoTheta.
|
friend |
Definition at line 61 of file FindSXPeaksHelper.h.
|
private |
Detector ID.
Definition at line 90 of file FindSXPeaksHelper.h.
Referenced by getDetectorId(), and SXPeak().
|
private |
d-spacing at the peak centre
Definition at line 76 of file FindSXPeaksHelper.h.
|
private |
Measured intensity of centre of the peak.
Definition at line 82 of file FindSXPeaksHelper.h.
Referenced by getIntensity(), operator+=(), and reduce().
|
private |
Detector-sample distance.
Definition at line 86 of file FindSXPeaksHelper.h.
Referenced by getQ(), operator+=(), reduce(), and SXPeak().
|
private |
Number of contributing pixels.
Definition at line 92 of file FindSXPeaksHelper.h.
Referenced by compare(), operator+=(), reduce(), and SXPeak().
|
private |
Phi angle for the centre detector of the peak.
Definition at line 80 of file FindSXPeaksHelper.h.
Referenced by compare(), operator+=(), and reduce().
|
private |
Q Convention.
Definition at line 96 of file FindSXPeaksHelper.h.
|
private |
Contributing spectra to this peak.
Definition at line 84 of file FindSXPeaksHelper.h.
Referenced by operator+=().
|
private |
TOF for the peak centre.
Definition at line 74 of file FindSXPeaksHelper.h.
Referenced by compare(), getQ(), operator+=(), reduce(), and SXPeak().
|
private |
2 * theta angle for then centre detector of the peak
Definition at line 78 of file FindSXPeaksHelper.h.
Referenced by compare(), operator+=(), reduce(), and SXPeak().
|
private |
Unit vector in the direction of the wavevector.
Definition at line 94 of file FindSXPeaksHelper.h.
|
private |
Detector workspace index.
Definition at line 88 of file FindSXPeaksHelper.h.
Referenced by SXPeak().