Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
Mantid::DataObjects::Peak Class Reference

Structure describing a single-crystal peak. More...

#include <Peak.h>

Inheritance diagram for Mantid::DataObjects::Peak:
Mantid::DataObjects::BasePeak Mantid::Geometry::IPeak

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::ReferenceFramegetReferenceFrame () 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...
 
Peakoperator= (const Peak &other)
 Assignment. More...
 
Peakoperator= (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::PeakShapegetPeakShape () 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...
 
BasePeakoperator= (BasePeak &&) noexcept=default
 
BasePeakoperator= (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::PeakShapegetPeakShape () const =0
 
virtual Mantid::Kernel::V3D getQLabFrame () const =0
 
virtual Mantid::Kernel::V3D getQSampleFrame () const =0
 
virtual std::shared_ptr< const Geometry::ReferenceFramegetReferenceFrame () 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...
 

Detailed Description

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)

Definition at line 34 of file Peak.h.

Constructor & Destructor Documentation

◆ Peak() [1/11]

Mantid::DataObjects::Peak::Peak ( )

Default constructor.

Definition at line 31 of file Peak.cpp.

◆ Peak() [2/11]

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.

Parameters
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().

◆ Peak() [3/11]

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.

Parameters
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().

◆ Peak() [4/11]

Mantid::DataObjects::Peak::Peak ( const Geometry::Instrument_const_sptr m_inst,
int  m_detectorID,
double  m_Wavelength 
)

Constructor.

Parameters
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
Returns

Definition at line 82 of file Peak.cpp.

References setDetectorID(), setInstrument(), and setWavelength().

◆ Peak() [5/11]

Mantid::DataObjects::Peak::Peak ( const Geometry::Instrument_const_sptr m_inst,
int  m_detectorID,
double  m_Wavelength,
const Mantid::Kernel::V3D HKL 
)

Constructor.

Parameters
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
Returns

Definition at line 100 of file Peak.cpp.

References setDetectorID(), Mantid::DataObjects::BasePeak::setHKL(), setInstrument(), and setWavelength().

◆ Peak() [6/11]

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.

Parameters
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
Returns

Definition at line 122 of file Peak.cpp.

References setDetectorID(), Mantid::DataObjects::BasePeak::setHKL(), setInstrument(), and setWavelength().

◆ Peak() [7/11]

Mantid::DataObjects::Peak::Peak ( const Geometry::Instrument_const_sptr m_inst,
double  scattering,
double  m_Wavelength 
)

Constructor.

Parameters
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
Returns

Definition at line 142 of file Peak.cpp.

References detPos, getVirtualDetectorPosition(), m_detectorID, setInstrument(), and setWavelength().

◆ Peak() [8/11]

Mantid::DataObjects::Peak::Peak ( const Peak other)
default

Copy constructor.

Parameters
other: Source
Returns

◆ Peak() [9/11]

Mantid::DataObjects::Peak::Peak ( Peak &&  )
defaultnoexcept

◆ Peak() [10/11]

Mantid::DataObjects::Peak::Peak ( const Geometry::IPeak ipeak)
explicit

Constructor making a Peak from IPeak interface.

Parameters
ipeak:: const reference to an IPeak object though actually referencing a Peak object.
Returns

Definition at line 168 of file Peak.cpp.

References m_detIDs, setDetectorID(), and setInstrument().

◆ Peak() [11/11]

Mantid::DataObjects::Peak::Peak ( const Mantid::DataObjects::LeanElasticPeak lpeak,
const Geometry::Instrument_const_sptr inst,
boost::optional< double >  detectorDistance = boost::none 
)

Member Function Documentation

◆ addContributingDetID()

void Mantid::DataObjects::Peak::addContributingDetID ( const int  id)

Add a detector ID that contributed to this peak.

Parameters
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().

◆ findDetector() [1/3]

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.

Returns
true if the detector ID was found.

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().

◆ findDetector() [2/3]

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.

Parameters
tracerA reference to an existing InstrumentRayTracer object.
Returns
true if the detector ID was found.

Definition at line 626 of file Peak.cpp.

References detPos, findDetector(), Mantid::DataObjects::BasePeak::m_samplePos, and Mantid::Kernel::normalize().

◆ findDetector() [3/3]

bool Mantid::DataObjects::Peak::findDetector ( const Mantid::Kernel::V3D beam,
const Geometry::InstrumentRayTracer tracer 
)
private

Peak::findDetector : Find the detector along the beam location.

sets the detector, and detector position if found

Parameters
beam: Detector direction from the sample as V3D
tracer: Ray tracer to use for detector finding
Returns
True if a detector has been found

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().

◆ getAzimuthal()

double Mantid::DataObjects::Peak::getAzimuthal ( ) const
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().

◆ getBankName()

std::string Mantid::DataObjects::Peak::getBankName ( ) const

◆ getCol()

int Mantid::DataObjects::Peak::getCol ( ) const
overridevirtual

◆ getContributingDetIDs()

const std::set< int > & Mantid::DataObjects::Peak::getContributingDetIDs ( ) const

Return the set of detector IDs that contribute to this peak.

Returns
A set of unique detector IDs that form this peak

Definition at line 292 of file Peak.cpp.

References m_detIDs.

Referenced by Mantid::DataObjects::PeaksWorkspace::createDetectorTable().

◆ getDetector()

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().

◆ getDetectorID()

int Mantid::DataObjects::Peak::getDetectorID ( ) const

◆ getDetectorPosition()

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().

◆ getDetectorPositionNoCheck()

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().

◆ getDetPos()

Mantid::Kernel::V3D Mantid::DataObjects::Peak::getDetPos ( ) const
virtual

◆ getDSpacing()

double Mantid::DataObjects::Peak::getDSpacing ( ) const
overridevirtual

◆ getEnergyTransfer()

double Mantid::DataObjects::Peak::getEnergyTransfer ( ) const
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().

◆ getFinalEnergy()

double Mantid::DataObjects::Peak::getFinalEnergy ( ) const
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().

◆ getInitialEnergy()

double Mantid::DataObjects::Peak::getInitialEnergy ( ) const
overridevirtual

◆ getInstrument()

Geometry::Instrument_const_sptr Mantid::DataObjects::Peak::getInstrument ( ) const

◆ getL1()

double Mantid::DataObjects::Peak::getL1 ( ) const
overridevirtual

◆ getL2()

double Mantid::DataObjects::Peak::getL2 ( ) const
overridevirtual

◆ getQLabFrame()

Mantid::Kernel::V3D Mantid::DataObjects::Peak::getQLabFrame ( ) const
overridevirtual

◆ getQSampleFrame()

Mantid::Kernel::V3D Mantid::DataObjects::Peak::getQSampleFrame ( ) const
overridevirtual

◆ getReferenceFrame()

std::shared_ptr< const Geometry::ReferenceFrame > Mantid::DataObjects::Peak::getReferenceFrame ( ) const
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.

◆ getRow()

int Mantid::DataObjects::Peak::getRow ( ) const
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().

◆ getScattering()

double Mantid::DataObjects::Peak::getScattering ( ) const
overridevirtual

◆ getTOF()

double Mantid::DataObjects::Peak::getTOF ( ) const
overridevirtual

◆ getValueByColName()

double Mantid::DataObjects::Peak::getValueByColName ( std::string  name) const
overridevirtual

Helper function for displaying/sorting peaks.

Parameters
name:: name of the column in the table workspace. The matching is case-insensitive.
Returns
a double representing that value (if that's possible)
Exceptions
std::runtime_errorif 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()().

◆ getVirtualDetectorPosition()

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().

◆ getWavelength()

double Mantid::DataObjects::Peak::getWavelength ( ) const
overridevirtual

◆ operator=() [1/2]

Peak & Mantid::DataObjects::Peak::operator= ( const Peak other)

Assignment.

Assignement operator overload.

Parameters
other: Other peak object to assign from
Returns
this

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.

◆ operator=() [2/2]

Peak & Mantid::DataObjects::Peak::operator= ( Peak &&  )
defaultnoexcept

◆ removeContributingDetector()

void Mantid::DataObjects::Peak::removeContributingDetector ( const int  id)

Removes an ID from the list of contributing detectors.

Parameters
id:: This ID is removed from the list.

Definition at line 285 of file Peak.cpp.

References m_detIDs.

◆ setBankName()

void Mantid::DataObjects::Peak::setBankName ( std::string  bankName)

Set the BankName of this peak.

Parameters
bankName:: index to set

Definition at line 358 of file Peak.cpp.

References m_bankName.

Referenced by Mantid::Crystal::LoadHKL::exec(), setDetectorID(), and setQLabFrame().

◆ setCol()

void Mantid::DataObjects::Peak::setCol ( int  col)

For RectangularDetectors only, sets the column (x) of the pixel of the detector.

Parameters
col:: col value

Definition at line 347 of file Peak.cpp.

References m_col.

Referenced by Mantid::Crystal::LoadHKL::exec(), and setDetectorID().

◆ 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.

Parameters
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().

◆ setFinalEnergy()

void Mantid::DataObjects::Peak::setFinalEnergy ( double  m_finalEnergy)
overridevirtual

Set the final energy.

Parameters
m_finalEnergy:: final energy in meV

Implements Mantid::Geometry::IPeak.

Definition at line 702 of file Peak.cpp.

References m_finalEnergy.

◆ setInitialEnergy()

void Mantid::DataObjects::Peak::setInitialEnergy ( double  m_initialEnergy)
overridevirtual

Set the initial energy.

Parameters
m_initialEnergy:: initial energy in meV

Implements Mantid::Geometry::IPeak.

Definition at line 706 of file Peak.cpp.

References m_initialEnergy.

◆ setInstrument()

void Mantid::DataObjects::Peak::setInstrument ( const Geometry::Instrument_const_sptr inst)

◆ setQLabFrame()

void Mantid::DataObjects::Peak::setQLabFrame ( const Mantid::Kernel::V3D qLab,
boost::optional< double >  detectorDistance = boost::none 
)
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

Parameters
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().

◆ setQSampleFrame()

void Mantid::DataObjects::Peak::setQSampleFrame ( const Mantid::Kernel::V3D QSampleFrame,
boost::optional< double >  detectorDistance = boost::none 
)
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.

Parameters
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().

◆ setRow()

void Mantid::DataObjects::Peak::setRow ( int  row)

For RectangularDetectors only, sets the row (y) of the pixel of the detector.

Parameters
row:: row value

Definition at line 338 of file Peak.cpp.

References m_row.

Referenced by Mantid::Crystal::LoadHKL::exec(), and setDetectorID().

◆ setWavelength()

void Mantid::DataObjects::Peak::setWavelength ( double  wavelength)
overridevirtual

Set the incident wavelength of the neutron.

Calculates the energy from this. Assumes elastic scattering.

Parameters
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().

Member Data Documentation

◆ detPos

Mantid::Kernel::V3D Mantid::DataObjects::Peak::detPos
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().

◆ g_log

Mantid::Kernel::Logger Mantid::DataObjects::Peak::g_log
staticprivate

Static logger.

Definition at line 167 of file Peak.h.

Referenced by setQLabFrame().

◆ m_bankName

std::string Mantid::DataObjects::Peak::m_bankName
private

Name of the parent bank.

Definition at line 140 of file Peak.h.

Referenced by getBankName(), operator=(), and setBankName().

◆ m_col

int Mantid::DataObjects::Peak::m_col
private

Cached column in the detector.

Definition at line 146 of file Peak.h.

Referenced by getCol(), getValueByColName(), operator=(), setCol(), and setQLabFrame().

◆ m_det

Geometry::IDetector_const_sptr Mantid::DataObjects::Peak::m_det
private

Detector pointed to.

Definition at line 137 of file Peak.h.

Referenced by getDetector(), operator=(), setDetectorID(), and setQLabFrame().

◆ m_detectorID

int Mantid::DataObjects::Peak::m_detectorID
private

ID of the detector.

Definition at line 149 of file Peak.h.

Referenced by getDetectorID(), getValueByColName(), operator=(), Peak(), setDetectorID(), and setQLabFrame().

◆ m_detIDs

std::set<int> Mantid::DataObjects::Peak::m_detIDs
private

List of contributing detectors IDs.

Definition at line 164 of file Peak.h.

Referenced by addContributingDetID(), getContributingDetIDs(), operator=(), Peak(), and removeContributingDetector().

◆ m_finalEnergy

double Mantid::DataObjects::Peak::m_finalEnergy
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().

◆ m_initialEnergy

double Mantid::DataObjects::Peak::m_initialEnergy
private

Initial energy of neutrons at the peak.

Definition at line 152 of file Peak.h.

Referenced by getInitialEnergy(), operator=(), setInitialEnergy(), and setWavelength().

◆ m_inst

Geometry::Instrument_const_sptr Mantid::DataObjects::Peak::m_inst
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().

◆ m_row

int Mantid::DataObjects::Peak::m_row
private

Cached row in the detector.

Definition at line 143 of file Peak.h.

Referenced by getRow(), getValueByColName(), operator=(), setQLabFrame(), and setRow().

◆ sourcePos

Mantid::Kernel::V3D Mantid::DataObjects::Peak::sourcePos
private

Cached source position.

Definition at line 158 of file Peak.h.

Referenced by getDSpacing(), getL1(), getQLabFrame(), getScattering(), operator=(), and setInstrument().


The documentation for this class was generated from the following files: