Mantid
|
Structure describing a single-crystal peak. More...
#include <Peak.h>
Public Member Functions | |
void | addContributingDetID (const int id) |
Add a detector ID that contributed to this peak. More... | |
bool | findDetector () |
After creating a peak using the Q in the lab frame, the detPos is set to the direction of the detector (but the detector is unknown) More... | |
bool | findDetector (const Geometry::InstrumentRayTracer &tracer) |
Performs the same algorithm as findDetector() but uses a pre-existing InstrumentRayTracer object to be able to take adavtange of its caches. More... | |
double | getAzimuthal () const override |
Calculate the azimuthal angle of the peak More... | |
std::string | getBankName () const |
Find the name of the bank that is the parent of the detector. More... | |
int | getCol () const override |
For RectangularDetectors only, returns the column (x) of the pixel of the detector or -1 if not found. More... | |
const std::set< int > & | getContributingDetIDs () const |
Return the set of detector IDs that contribute to this peak. More... | |
Geometry::IDetector_const_sptr | getDetector () const |
Return a shared ptr to the detector at center of peak. More... | |
int | getDetectorID () const |
Get the ID of the detector at the center of the peak More... | |
Mantid::Kernel::V3D | getDetectorPosition () const |
Forwarding function. More... | |
Mantid::Kernel::V3D | getDetectorPositionNoCheck () const |
Forwarding function. More... | |
virtual Mantid::Kernel::V3D | getDetPos () const |
Return the detector position vector. 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. 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... | |
Geometry::Instrument_const_sptr | getInstrument () const |
Return a shared ptr to the instrument for this peak. 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 from the instrument for this peak. More... | |
int | getRow () const override |
For RectangularDetectors only, returns the row (y) of the pixel of the detector or -1 if not found. 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 | getValueByColName (std::string colName) const override |
Helper function for displaying/sorting peaks. More... | |
Kernel::V3D | getVirtualDetectorPosition (const Kernel::V3D &detectorDir) const |
Get the approximate position of a peak that falls off the detectors. More... | |
double | getWavelength () const override |
Calculate the neutron wavelength (in angstroms) at the peak (Note for inelastic scattering - it is the wavelength corresponding to the final energy) More... | |
Peak & | operator= (const Peak &other) |
Assignment. More... | |
Peak & | operator= (Peak &&) noexcept=default |
Peak () | |
Default constructor. More... | |
Peak (const Geometry::Instrument_const_sptr &m_inst, const Mantid::Kernel::V3D &QLabFrame, boost::optional< double > detectorDistance=boost::none) | |
Constructor that uses the Q position of the peak (in the lab frame). More... | |
Peak (const Geometry::Instrument_const_sptr &m_inst, const Mantid::Kernel::V3D &QSampleFrame, const Mantid::Kernel::Matrix< double > &goniometer, boost::optional< double > detectorDistance=boost::none) | |
Constructor that uses the Q position of the peak (in the sample frame) and a goniometer rotation matrix. More... | |
Peak (const Geometry::Instrument_const_sptr &m_inst, double scattering, double m_Wavelength) | |
Constructor. More... | |
Peak (const Geometry::Instrument_const_sptr &m_inst, int m_detectorID, double m_Wavelength) | |
Constructor. More... | |
Peak (const Geometry::Instrument_const_sptr &m_inst, int m_detectorID, double m_Wavelength, const Mantid::Kernel::V3D &HKL) | |
Constructor. More... | |
Peak (const Geometry::Instrument_const_sptr &m_inst, int m_detectorID, double m_Wavelength, const Mantid::Kernel::V3D &HKL, const Mantid::Kernel::Matrix< double > &goniometer) | |
Constructor. More... | |
Peak (const Geometry::IPeak &ipeak) | |
Constructor making a Peak from IPeak interface. More... | |
Peak (const Mantid::DataObjects::LeanElasticPeak &lpeak, const Geometry::Instrument_const_sptr &inst, boost::optional< double > detectorDistance=boost::none) | |
Peak (const Peak &other) | |
Copy constructor. More... | |
Peak (Peak &&) noexcept=default | |
void | removeContributingDetector (const int id) |
Removes an ID from the list of contributing detectors. More... | |
void | setBankName (std::string bankName) |
Set the BankName of this peak. More... | |
void | setCol (int col) |
For RectangularDetectors only, sets the column (x) of the pixel of the detector. More... | |
void | setDetectorID (int id) |
Set the detector ID of the pixel at the centre of the peak and look up and cache values related to it. More... | |
void | setFinalEnergy (double m_finalEnergy) override |
Set the final energy. More... | |
void | setInitialEnergy (double m_initialEnergy) override |
Set the initial energy. More... | |
void | setInstrument (const Geometry::Instrument_const_sptr &inst) |
Set the instrument (and save the source/sample pos). More... | |
void | setQLabFrame (const Mantid::Kernel::V3D &qLab, boost::optional< double > detectorDistance=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 > detectorDistance=boost::none) override |
Set the peak using the peak's position in reciprocal space, in the sample frame. More... | |
void | setRow (int row) |
For RectangularDetectors only, sets the row (y) of the pixel of the detector. More... | |
void | setWavelength (double wavelength) override |
Set the incident 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 | |
bool | findDetector (const Mantid::Kernel::V3D &beam, const Geometry::InstrumentRayTracer &tracer) |
Peak::findDetector : Find the detector along the beam location. More... | |
Private Attributes | |
Mantid::Kernel::V3D | detPos |
Cached detector position. More... | |
std::string | m_bankName |
Name of the parent bank. More... | |
int | m_col |
Cached column in the detector. More... | |
Geometry::IDetector_const_sptr | m_det |
Detector pointed to. More... | |
int | m_detectorID |
ID of the detector. More... | |
std::set< int > | m_detIDs |
List of contributing detectors IDs. More... | |
double | m_finalEnergy |
Final energy of the neutrons at peak (normally same as m_InitialEnergy) More... | |
double | m_initialEnergy |
Initial energy of neutrons at the peak. More... | |
Geometry::Instrument_const_sptr | m_inst |
Shared pointer to the instrument (for calculating some values ) More... | |
int | m_row |
Cached row in the detector. More... | |
Mantid::Kernel::V3D | sourcePos |
Cached source position. 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.
The peak is described by the physical detector position (determined either from detector information or calculated from Q-lab) and initial/final energy (calculated from Q-lab or provided wavelength)
Mantid::DataObjects::Peak::Peak | ( | const Geometry::Instrument_const_sptr & | m_inst, |
const Mantid::Kernel::V3D & | QLabFrame, | ||
boost::optional< double > | detectorDistance = boost::none |
||
) |
Constructor that uses the Q position of the peak (in the lab frame).
No detector ID is set.
m_inst | :: Shared pointer to the instrument for this peak detection |
QLabFrame | :: Q of the center of the peak, in reciprocal space |
detectorDistance | :: Optional distance between the sample and the detector. Calculated if not explicitly provided. Used to give a valid TOF. Default 1.0 meters. |
Definition at line 43 of file Peak.cpp.
References m_inst, setInstrument(), and setQLabFrame().
Mantid::DataObjects::Peak::Peak | ( | const Geometry::Instrument_const_sptr & | m_inst, |
const Mantid::Kernel::V3D & | QSampleFrame, | ||
const Mantid::Kernel::Matrix< double > & | goniometer, | ||
boost::optional< double > | detectorDistance = boost::none |
||
) |
Constructor that uses the Q position of the peak (in the sample frame) and a goniometer rotation matrix.
No detector ID is set.
m_inst | :: Shared pointer to the instrument for this peak detection |
QSampleFrame | :: Q of the center of the peak, in reciprocal space, in the sample frame (goniometer rotation accounted for). |
goniometer | :: a 3x3 rotation matrix |
detectorDistance | :: Optional distance between the sample and the detector. Calculated if not explicitly provided. Used to give a valid TOF. Default 1.0 meters. |
Definition at line 65 of file Peak.cpp.
References setInstrument(), and setQSampleFrame().
Mantid::DataObjects::Peak::Peak | ( | const Geometry::Instrument_const_sptr & | m_inst, |
int | m_detectorID, | ||
double | m_Wavelength | ||
) |
Constructor.
m_inst | :: Shared pointer to the instrument for this peak detection |
m_detectorID | :: ID to the detector of the center of the peak |
m_Wavelength | :: incident neutron wavelength, in Angstroms |
Definition at line 82 of file Peak.cpp.
References setDetectorID(), setInstrument(), and setWavelength().
Mantid::DataObjects::Peak::Peak | ( | const Geometry::Instrument_const_sptr & | m_inst, |
int | m_detectorID, | ||
double | m_Wavelength, | ||
const Mantid::Kernel::V3D & | HKL | ||
) |
Constructor.
m_inst | :: Shared pointer to the instrument for this peak detection |
m_detectorID | :: ID to the detector of the center of the peak |
m_Wavelength | :: incident neutron wavelength, in Angstroms |
HKL | :: vector with H,K,L position of the peak |
Definition at line 100 of file Peak.cpp.
References setDetectorID(), Mantid::DataObjects::BasePeak::setHKL(), setInstrument(), and setWavelength().
Mantid::DataObjects::Peak::Peak | ( | const Geometry::Instrument_const_sptr & | m_inst, |
int | m_detectorID, | ||
double | m_Wavelength, | ||
const Mantid::Kernel::V3D & | HKL, | ||
const Mantid::Kernel::Matrix< double > & | goniometer | ||
) |
Constructor.
m_inst | :: Shared pointer to the instrument for this peak detection |
m_detectorID | :: ID to the detector of the center of the peak |
m_Wavelength | :: incident neutron wavelength, in Angstroms |
HKL | :: vector with H,K,L position of the peak |
goniometer | :: a 3x3 rotation matrix |
Definition at line 122 of file Peak.cpp.
References setDetectorID(), Mantid::DataObjects::BasePeak::setHKL(), setInstrument(), and setWavelength().
Mantid::DataObjects::Peak::Peak | ( | const Geometry::Instrument_const_sptr & | m_inst, |
double | scattering, | ||
double | m_Wavelength | ||
) |
Constructor.
m_inst | :: Shared pointer to the instrument for this peak detection |
scattering | :: fake detector position using scattering angle |
m_Wavelength | :: incident neutron wavelength, in Angstroms |
Definition at line 142 of file Peak.cpp.
References detPos, getVirtualDetectorPosition(), m_detectorID, setInstrument(), and setWavelength().
|
default |
Copy constructor.
other | : Source |
|
defaultnoexcept |
|
explicit |
Constructor making a Peak from IPeak interface.
ipeak | :: const reference to an IPeak object though actually referencing a Peak object. |
Definition at line 168 of file Peak.cpp.
References m_detIDs, setDetectorID(), and setInstrument().
Mantid::DataObjects::Peak::Peak | ( | const Mantid::DataObjects::LeanElasticPeak & | lpeak, |
const Geometry::Instrument_const_sptr & | inst, | ||
boost::optional< double > | detectorDistance = boost::none |
||
) |
Definition at line 181 of file Peak.cpp.
References Mantid::DataObjects::LeanElasticPeak::getQLabFrame(), setInstrument(), and setQLabFrame().
void Mantid::DataObjects::Peak::addContributingDetID | ( | const int | id | ) |
Add a detector ID that contributed to this peak.
id | :: The ID of a detector that contributed to this peak |
Definition at line 278 of file Peak.cpp.
References m_detIDs.
Referenced by setDetectorID().
bool Mantid::DataObjects::Peak::findDetector | ( | ) |
After creating a peak using the Q in the lab frame, the detPos is set to the direction of the detector (but the detector is unknown)
Using the instrument set in the peak, perform ray tracing to find the exact detector.
Definition at line 613 of file Peak.cpp.
References findDetector(), and m_inst.
Referenced by Mantid::MDAlgorithms::IntegratePeaksMD::detectorQ(), findDetector(), Mantid::MDAlgorithms::CentroidPeaksMD::integrate(), Mantid::MDAlgorithms::CentroidPeaksMD2::integrate(), and setQLabFrame().
bool Mantid::DataObjects::Peak::findDetector | ( | const Geometry::InstrumentRayTracer & | tracer | ) |
Performs the same algorithm as findDetector() but uses a pre-existing InstrumentRayTracer object to be able to take adavtange of its caches.
This method should be preferred if findDetector is to be called many times over the same instrument.
tracer | A reference to an existing InstrumentRayTracer object. |
Definition at line 626 of file Peak.cpp.
References detPos, findDetector(), Mantid::DataObjects::BasePeak::m_samplePos, and Mantid::Kernel::normalize().
|
private |
Peak::findDetector : Find the detector along the beam location.
sets the detector, and detector position if found
beam | : Detector direction from the sample as V3D |
tracer | : Ray tracer to use for detector finding |
Definition at line 640 of file Peak.cpp.
References Mantid::Kernel::V3D::cosAngle(), detPos, Mantid::Geometry::InstrumentRayTracer::getDetectorResult(), m_inst, Mantid::Kernel::normalize(), setDetectorID(), and Mantid::Geometry::InstrumentRayTracer::traceFromSample().
|
overridevirtual |
Calculate the azimuthal angle of the peak
Implements Mantid::Geometry::IPeak.
Definition at line 407 of file Peak.cpp.
References detPos, Mantid::DataObjects::BasePeak::m_samplePos, Mantid::Kernel::V3D::X(), and Mantid::Kernel::V3D::Y().
std::string Mantid::DataObjects::Peak::getBankName | ( | ) | const |
Find the name of the bank that is the parent of the detector.
This works best for RectangularDetector instruments (goes up two levels)
Definition at line 353 of file Peak.cpp.
References m_bankName.
Referenced by Mantid::Crystal::IntegratePeakTimeSlices::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveIsawPeaks::exec(), Mantid::Crystal::SaveLauenorm::exec(), Mantid::Crystal::SCDCalibratePanels::exec(), Mantid::Crystal::ShowPeakHKLOffsets::exec(), Mantid::Crystal::StatisticsOfPeaksWorkspace::exec(), Mantid::Crystal::IntegratePeakTimeSlices::FindPlane(), Mantid::DataObjects::PeakComparator::operator()(), and setDetectorID().
|
overridevirtual |
For RectangularDetectors only, returns the column (x) of the pixel of the detector or -1 if not found.
Implements Mantid::Geometry::IPeak.
Definition at line 341 of file Peak.cpp.
References m_col.
Referenced by Mantid::Algorithms::CompareWorkspaces::doPeaksComparison(), Mantid::Crystal::MaskPeaksWorkspace::exec(), Mantid::Crystal::PeakIntegration::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveLauenorm::exec(), Mantid::Crystal::SCDCalibratePanels::exec(), Mantid::Crystal::IntegratePeakTimeSlices::FindPlane(), and Mantid::Crystal::CentroidPeaks::removeEdgePeaks().
const std::set< int > & Mantid::DataObjects::Peak::getContributingDetIDs | ( | ) | const |
Return the set of detector IDs that contribute to this peak.
Definition at line 292 of file Peak.cpp.
References m_detIDs.
Referenced by Mantid::DataObjects::PeaksWorkspace::createDetectorTable().
Geometry::IDetector_const_sptr Mantid::DataObjects::Peak::getDetector | ( | ) | const |
Return a shared ptr to the detector at center of peak.
Definition at line 323 of file Peak.cpp.
References m_det.
Referenced by Mantid::Crystal::IntegratePeakTimeSlices::exec(), Mantid::Crystal::IntegratePeakTimeSlices::FindPlane(), getDetectorPosition(), and getDetectorPositionNoCheck().
int Mantid::DataObjects::Peak::getDetectorID | ( | ) | const |
Get the ID of the detector at the center of the peak
Definition at line 271 of file Peak.cpp.
References m_detectorID.
Referenced by Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Algorithms::CompareWorkspaces::doPeaksComparison(), Mantid::Crystal::SCDPanelErrors::eval(), Mantid::Algorithms::ApplyInstrumentToPeaks::exec(), Mantid::Crystal::IntegratePeakTimeSlices::exec(), Mantid::Crystal::PeakIntegration::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveLauenorm::exec(), Mantid::Crystal::PeakIntegration::fitneighbours(), Mantid::Crystal::SCDCalibratePanels2ObjFunc::function1D(), Mantid::Crystal::CentroidPeaks::integrate(), and Mantid::DataObjects::PeaksWorkspace::saveNexus().
Mantid::Kernel::V3D Mantid::DataObjects::Peak::getDetectorPosition | ( | ) | const |
Forwarding function.
Exposes the detector position directly, but checks that the detector is not null before accessing its position. Throws if null.
Definition at line 753 of file Peak.cpp.
References getDetector().
Referenced by Mantid::Crystal::PeaksIntersection::executePeaksIntersection().
Mantid::Kernel::V3D Mantid::DataObjects::Peak::getDetectorPositionNoCheck | ( | ) | const |
Forwarding function.
Exposes the detector position directly.
Definition at line 747 of file Peak.cpp.
References getDetector().
|
virtual |
Return the detector position vector.
Definition at line 710 of file Peak.cpp.
References detPos.
Referenced by Mantid::Crystal::IntegratePeakTimeSlices::CalculatePositionSpan(), Mantid::Crystal::IntegratePeakTimeSlices::exec(), Mantid::Crystal::SaveHKL::exec(), and Mantid::Crystal::PeakHKLErrors::functionDeriv1D().
|
overridevirtual |
Calculate the d-spacing of the peak, in 1/Angstroms
Implements Mantid::Geometry::IPeak.
Definition at line 416 of file Peak.cpp.
References Mantid::Kernel::V3D::angle(), detPos, getFinalEnergy(), getInitialEnergy(), Mantid::PhysicalConstants::h, Mantid::DataObjects::BasePeak::m_samplePos, Mantid::PhysicalConstants::meV, Mantid::PhysicalConstants::NeutronMass, and sourcePos.
Referenced by Mantid::Algorithms::CompareWorkspaces::doPeaksComparison(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveLauenorm::exec(), Mantid::Crystal::StatisticsOfPeaksWorkspace::exec(), and Mantid::DataObjects::PeaksWorkspace::saveNexus().
|
overridevirtual |
Get the difference between the initial and final neutron energy in meV.
Implements Mantid::Geometry::IPeak.
Definition at line 698 of file Peak.cpp.
References getFinalEnergy(), and getInitialEnergy().
|
overridevirtual |
Get the final neutron energy in meV.
Implements Mantid::Geometry::IPeak.
Definition at line 692 of file Peak.cpp.
References m_finalEnergy.
Referenced by getDSpacing(), getEnergyTransfer(), getTOF(), and Mantid::DataObjects::PeaksWorkspace::saveNexus().
|
overridevirtual |
Get the initial (incident) neutron energy in meV.
Implements Mantid::Geometry::IPeak.
Definition at line 695 of file Peak.cpp.
References m_initialEnergy.
Referenced by Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Algorithms::CompareWorkspaces::doPeaksComparison(), getDSpacing(), getEnergyTransfer(), getQLabFrame(), getTOF(), and Mantid::DataObjects::PeaksWorkspace::saveNexus().
Geometry::Instrument_const_sptr Mantid::DataObjects::Peak::getInstrument | ( | ) | const |
Return a shared ptr to the instrument for this peak.
Definition at line 326 of file Peak.cpp.
References m_inst.
Referenced by Mantid::Crystal::IntegratePeakTimeSlices::CalculatePositionSpan(), Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::MDAlgorithms::IntegratePeaksCWSD::createPeakworkspace(), Mantid::Crystal::IntegratePeakTimeSlices::exec(), Mantid::Crystal::SCDCalibratePanels::exec(), Mantid::Crystal::IntegratePeakTimeSlices::FindPlane(), and getVirtualDetectorPosition().
|
overridevirtual |
Return the L1 flight path length (source to sample), in meters.
Implements Mantid::Geometry::IPeak.
Definition at line 714 of file Peak.cpp.
References Mantid::DataObjects::BasePeak::m_samplePos, and sourcePos.
Referenced by Mantid::Crystal::LoadIsawPeaks::appendFile(), Mantid::Crystal::SCDPanelErrors::eval(), Mantid::Algorithms::ApplyInstrumentToPeaks::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SCDCalibratePanels::findT0(), Mantid::Crystal::PeakHKLErrors::function1D(), Mantid::Crystal::SCDCalibratePanels2ObjFunc::function1D(), Mantid::Crystal::PeakHKLErrors::functionDeriv1D(), and getTOF().
|
overridevirtual |
Return the L2 flight path length (sample to detector), in meters.
Implements Mantid::Geometry::IPeak.
Definition at line 718 of file Peak.cpp.
References detPos, and Mantid::DataObjects::BasePeak::m_samplePos.
Referenced by Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SCDCalibratePanels::findT0(), getTOF(), and Mantid::MDAlgorithms::CentroidPeaksMD::integrate().
|
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 441 of file Peak.cpp.
References detPos, getInitialEnergy(), getWavelength(), Mantid::PhysicalConstants::h_bar, Mantid::DataObjects::BasePeak::m_convention, Mantid::DataObjects::BasePeak::m_samplePos, Mantid::PhysicalConstants::meV, Mantid::PhysicalConstants::NeutronMass, Mantid::Kernel::V3D::norm(), and sourcePos.
Referenced by Mantid::Crystal::IntegratePeakTimeSlices::CalculatePositionSpan(), Mantid::Crystal::PeaksIntersection::executePeaksIntersection(), Mantid::Crystal::PeakHKLErrors::functionDeriv1D(), getQSampleFrame(), Mantid::MDAlgorithms::CentroidPeaksMD::integrate(), Mantid::DataObjects::PeaksWorkspace::peakInfo(), and Mantid::DataObjects::PeaksWorkspace::peakInfoNumber().
|
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 472 of file Peak.cpp.
References Mantid::DataObjects::BasePeak::getInverseGoniometerMatrix(), and getQLabFrame().
Referenced by Mantid::Crystal::ShowPeakHKLOffsets::exec(), Mantid::Crystal::PeaksIntersection::executePeaksIntersection(), Mantid::Crystal::PeakHKLErrors::function1D(), Mantid::MDAlgorithms::IntegratePeaksCWSD::getPeakInformation(), Mantid::MDAlgorithms::CentroidPeaksMD::integrate(), Mantid::DataObjects::PeaksWorkspace::peakInfo(), and Mantid::DataObjects::PeaksWorkspace::peakInfoNumber().
|
overridevirtual |
Return a shared ptr to the reference frame from the instrument for this peak.
Implements Mantid::Geometry::IPeak.
Definition at line 329 of file Peak.cpp.
References m_inst.
|
overridevirtual |
For RectangularDetectors only, returns the row (y) of the pixel of the detector or -1 if not found.
Implements Mantid::Geometry::IPeak.
Definition at line 332 of file Peak.cpp.
References m_row.
Referenced by Mantid::Algorithms::CompareWorkspaces::doPeaksComparison(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveLauenorm::exec(), Mantid::Crystal::SCDCalibratePanels::exec(), and Mantid::Crystal::IntegratePeakTimeSlices::FindPlane().
|
overridevirtual |
Calculate the scattering angle of the peak
Implements Mantid::Geometry::IPeak.
Definition at line 397 of file Peak.cpp.
References Mantid::Kernel::V3D::angle(), detPos, Mantid::DataObjects::BasePeak::m_samplePos, and sourcePos.
Referenced by Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveLauenorm::exec(), Mantid::Crystal::SCDCalibratePanels::findT0(), and Mantid::DataObjects::PeaksWorkspace::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 379 of file Peak.cpp.
References getFinalEnergy(), getInitialEnergy(), getL1(), getL2(), Mantid::PhysicalConstants::meV, and Mantid::PhysicalConstants::NeutronMass.
Referenced by Mantid::Crystal::LoadIsawPeaks::appendFile(), Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Algorithms::CompareWorkspaces::doPeaksComparison(), Mantid::Crystal::SCDPanelErrors::eval(), Mantid::Algorithms::ApplyInstrumentToPeaks::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SCDCalibratePanels::exec(), Mantid::Crystal::SCDCalibratePanels::findT0(), Mantid::Crystal::PeakHKLErrors::functionDeriv1D(), and Mantid::DataObjects::PeaksWorkspace::saveNexus().
|
overridevirtual |
Helper function for displaying/sorting peaks.
name | :: name of the column in the table workspace. The matching is case-insensitive. |
std::runtime_error | if you asked for a column that can't convert to double. |
Reimplemented from Mantid::DataObjects::BasePeak.
Definition at line 593 of file Peak.cpp.
References Mantid::DataObjects::BasePeak::getValueByColName(), m_col, m_detectorID, and m_row.
Referenced by Mantid::DataObjects::PeakComparator::operator()().
V3D Mantid::DataObjects::Peak::getVirtualDetectorPosition | ( | const Kernel::V3D & | detectorDir | ) | const |
Get the approximate position of a peak that falls off the detectors.
Definition at line 583 of file Peak.cpp.
References getInstrument(), and Mantid::DataObjects::BasePeak::m_samplePos.
Referenced by Peak(), and setQLabFrame().
|
overridevirtual |
Calculate the neutron wavelength (in angstroms) at the peak (Note for inelastic scattering - it is the wavelength corresponding to the final energy)
Implements Mantid::Geometry::IPeak.
Definition at line 364 of file Peak.cpp.
References energy, Mantid::PhysicalConstants::h, m_finalEnergy, Mantid::PhysicalConstants::meV, and Mantid::PhysicalConstants::NeutronMass.
Referenced by Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Algorithms::CompareWorkspaces::doPeaksComparison(), Mantid::Crystal::SCDPanelErrors::eval(), Mantid::Algorithms::AddAbsorptionWeightedPathLengths::exec(), Mantid::Crystal::SaveHKL::exec(), Mantid::Crystal::SaveLauenorm::exec(), getQLabFrame(), and Mantid::DataObjects::PeaksWorkspace::saveNexus().
Assignment.
Assignement operator overload.
other | : Other peak object to assign from |
Definition at line 725 of file Peak.cpp.
References detPos, m_bankName, m_col, m_det, m_detectorID, m_detIDs, m_finalEnergy, m_initialEnergy, m_inst, m_row, Mantid::DataObjects::BasePeak::m_samplePos, Mantid::DataObjects::BasePeak::operator=(), and sourcePos.
void Mantid::DataObjects::Peak::removeContributingDetector | ( | const int | id | ) |
void Mantid::DataObjects::Peak::setBankName | ( | std::string | bankName | ) |
Set the BankName of this peak.
bankName | :: index to set |
Definition at line 358 of file Peak.cpp.
References m_bankName.
Referenced by Mantid::Crystal::LoadHKL::exec(), setDetectorID(), and setQLabFrame().
void Mantid::DataObjects::Peak::setCol | ( | int | col | ) |
For RectangularDetectors only, sets the column (x) of the pixel of the detector.
col | :: col value |
Definition at line 347 of file Peak.cpp.
References m_col.
Referenced by Mantid::Crystal::LoadHKL::exec(), and setDetectorID().
void Mantid::DataObjects::Peak::setDetectorID | ( | int | id | ) |
Set the detector ID of the pixel at the centre of the peak and look up and cache values related to it.
It also adds it to the list of contributing detectors for this peak but does NOT remove the old centre.
id | :: ID of detector at the centre of the peak. |
Definition at line 212 of file Peak.cpp.
References addContributingDetID(), detPos, Mantid::Kernel::Strings::endsWithInt(), getBankName(), m_det, m_detectorID, m_inst, setBankName(), setCol(), and setRow().
Referenced by Mantid::Algorithms::ApplyInstrumentToPeaks::exec(), findDetector(), Mantid::Crystal::SCDCalibratePanels2ObjFunc::function1D(), and Peak().
|
overridevirtual |
Set the final energy.
m_finalEnergy | :: final energy in meV |
Implements Mantid::Geometry::IPeak.
Definition at line 702 of file Peak.cpp.
References m_finalEnergy.
|
overridevirtual |
Set the initial energy.
m_initialEnergy | :: initial energy in meV |
Implements Mantid::Geometry::IPeak.
Definition at line 706 of file Peak.cpp.
References m_initialEnergy.
void Mantid::DataObjects::Peak::setInstrument | ( | const Geometry::Instrument_const_sptr & | inst | ) |
Set the instrument (and save the source/sample pos).
Call setDetectorID AFTER this call.
inst | :: Instrument sptr to use |
Definition at line 300 of file Peak.cpp.
References m_inst, Mantid::DataObjects::BasePeak::m_samplePos, and sourcePos.
Referenced by Mantid::MDAlgorithms::IntegratePeaksCWSD::createPeakworkspace(), Mantid::Algorithms::ApplyInstrumentToPeaks::exec(), Mantid::Crystal::SCDCalibratePanels::exec(), Mantid::Crystal::SCDCalibratePanels2ObjFunc::function1D(), Mantid::DataHandling::LoadNexusProcessed::loadPeaksEntry(), and Peak().
|
overridevirtual |
Set the peak using the peak's position in reciprocal space, in the lab frame.
The detector position will be determined. DetectorID, row and column will be set to -1 since they are not (necessarily) found. You can call findDetector to look for the detector ID
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). |
detectorDistance | :: distance between the sample and the detector. If this is provided. Then we do not ray trace to find the intersecing detector. |
Implements Mantid::Geometry::IPeak.
Definition at line 513 of file Peak.cpp.
References Mantid::Kernel::Logger::debug(), detPos, findDetector(), g_log, getVirtualDetectorPosition(), m_col, Mantid::DataObjects::BasePeak::m_convention, m_det, m_detectorID, m_inst, m_row, Mantid::DataObjects::BasePeak::m_samplePos, Mantid::Kernel::V3D::norm(), Mantid::Kernel::V3D::normalize(), Mantid::Kernel::V3D::scalar_prod(), setBankName(), setWavelength(), and Mantid::Kernel::V3D::toString().
Referenced by Mantid::MDAlgorithms::CentroidPeaksMD::integrate(), Peak(), and setQSampleFrame().
|
overridevirtual |
Set the peak using the peak's position in reciprocal space, in the sample frame.
The GoniometerMatrix will be used to find the Q in the lab frame, so it should be set beforehand.
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. |
detectorDistance | :: distance between the sample and the detector. Used to give a valid TOF. You do NOT need to explicitly set this. |
Implements Mantid::Geometry::IPeak.
Definition at line 492 of file Peak.cpp.
References Mantid::DataObjects::BasePeak::getGoniometerMatrix(), and setQLabFrame().
Referenced by Mantid::MDAlgorithms::IntegratePeaksCWSD::createPeakworkspace(), Mantid::MDAlgorithms::CentroidPeaksMD::integrate(), and Peak().
void Mantid::DataObjects::Peak::setRow | ( | int | row | ) |
For RectangularDetectors only, sets the row (y) of the pixel of the detector.
row | :: row value |
Definition at line 338 of file Peak.cpp.
References m_row.
Referenced by Mantid::Crystal::LoadHKL::exec(), and setDetectorID().
|
overridevirtual |
Set the incident wavelength of the neutron.
Calculates the energy from this. Assumes elastic scattering.
wavelength | :: wavelength in Angstroms. |
Implements Mantid::Geometry::IPeak.
Definition at line 194 of file Peak.cpp.
References energy, Mantid::PhysicalConstants::h, m_finalEnergy, m_initialEnergy, Mantid::PhysicalConstants::meV, and Mantid::PhysicalConstants::NeutronMass.
Referenced by Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Crystal::SCDCalibratePanels::findT0(), Peak(), and setQLabFrame().
|
private |
Cached detector position.
Definition at line 161 of file Peak.h.
Referenced by findDetector(), getAzimuthal(), getDetPos(), getDSpacing(), getL2(), getQLabFrame(), getScattering(), operator=(), Peak(), setDetectorID(), and setQLabFrame().
|
staticprivate |
|
private |
Name of the parent bank.
Definition at line 140 of file Peak.h.
Referenced by getBankName(), operator=(), and setBankName().
|
private |
Cached column in the detector.
Definition at line 146 of file Peak.h.
Referenced by getCol(), getValueByColName(), operator=(), setCol(), and setQLabFrame().
|
private |
Detector pointed to.
Definition at line 137 of file Peak.h.
Referenced by getDetector(), operator=(), setDetectorID(), and setQLabFrame().
|
private |
ID of the detector.
Definition at line 149 of file Peak.h.
Referenced by getDetectorID(), getValueByColName(), operator=(), Peak(), setDetectorID(), and setQLabFrame().
|
private |
List of contributing detectors IDs.
Definition at line 164 of file Peak.h.
Referenced by addContributingDetID(), getContributingDetIDs(), operator=(), Peak(), and removeContributingDetector().
|
private |
Final energy of the neutrons at peak (normally same as m_InitialEnergy)
Definition at line 155 of file Peak.h.
Referenced by getFinalEnergy(), getWavelength(), operator=(), setFinalEnergy(), and setWavelength().
|
private |
Initial energy of neutrons at the peak.
Definition at line 152 of file Peak.h.
Referenced by getInitialEnergy(), operator=(), setInitialEnergy(), and setWavelength().
|
private |
Shared pointer to the instrument (for calculating some values )
Definition at line 134 of file Peak.h.
Referenced by findDetector(), getInstrument(), getReferenceFrame(), operator=(), Peak(), setDetectorID(), setInstrument(), and setQLabFrame().
|
private |
Cached row in the detector.
Definition at line 143 of file Peak.h.
Referenced by getRow(), getValueByColName(), operator=(), setQLabFrame(), and setRow().
|
private |
Cached source position.
Definition at line 158 of file Peak.h.
Referenced by getDSpacing(), getL1(), getQLabFrame(), getScattering(), operator=(), and setInstrument().