Mantid
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
Mantid::Geometry::DetectorInfo Class Reference

Geometry::DetectorInfo is an intermediate step towards a DetectorInfo that is part of Instrument-2.0. More...

#include <DetectorInfo.h>

Public Member Functions

std::vector< Kernel::V3D > allPositions () const
 Returns the absolute positions of all detectors in a vector ordered by index.
 
std::vector< Kernel::Quat > allRotations () const
 Returns the absolute rotations of all detectors in a vector ordered by index.
 
std::vector< Kernel::V3D > allScaleFactors () const
 Returns the scale factors of all detectors in a vector ordered by index.
 
double azimuthal (const size_t index) const
 
double azimuthal (const std::pair< size_t, size_t > &index) const
 
DetectorInfoIterator< DetectorInfo > begin ()
 
const DetectorInfoIterator< const DetectorInfo > cbegin () const
 
const DetectorInfoIterator< const DetectorInfo > cend () const
 
void clearMaskFlags ()
 Sets all mask flags to false (unmasked).
 
const Geometry::IDetector & detector (const size_t index) const
 Return a const reference to the detector with given index.
 
const std::vector< detid_t > & detectorIDs () const
 Returns a sorted vector of all detector IDs.
 
 DetectorInfo (const DetectorInfo &other)
 Copy constructor.
 
 DetectorInfo (std::unique_ptr< Beamline::DetectorInfo > detectorInfo, std::shared_ptr< const Geometry::Instrument > instrument, std::shared_ptr< const std::vector< detid_t > > detectorIds, std::shared_ptr< const std::unordered_map< detid_t, size_t > > detIdToIndexMap, std::shared_ptr< ParameterInfo > parameterInfo, std::shared_ptr< ReferenceFrame const > referenceFrame)
 Construct DetectorInfo based on an Instrument.
 
detid_t detid (const size_t index) const
 Returns the detector ID for the given logical detector index.
 
double difcUncalibrated (const size_t index) const
 
std::tuple< double, double, double > diffractometerConstants (const size_t index, std::vector< detid_t > &calibratedDets, std::vector< detid_t > &uncalibratedDets) const
 
DetectorInfoIterator< DetectorInfo > end ()
 
std::pair< double, double > geographicalAngles (const size_t index) const
 
std::pair< double, double > geographicalAngles (const std::pair< size_t, size_t > &index) const
 
size_t getMemorySize () const
 Return memory used by the detector info, in bytes.
 
bool hasMaskedDetectors () const
 Returns true if there are masked detectors.
 
size_t indexOf (const detid_t id) const
 Returns the index of the detector with the given detector ID.
 
bool isEquivalent (const DetectorInfo &other) const
 Returns true if the content of this is equivalent to the content of other.
 
bool isMasked (const size_t index) const
 Returns true if the detector is masked.
 
bool isMasked (const std::pair< size_t, size_t > &index) const
 Returns true if the detector is masked.
 
bool isMonitor (const size_t index) const
 Returns true if the detector is a monitor.
 
bool isMonitor (const std::pair< size_t, size_t > &index) const
 Returns true if the detector is a monitor.
 
bool isScanning () const
 Returns true if the beamline has scanning detectors.
 
double l1 () const
 Returns L1 (distance from source to sample).
 
double l2 (const size_t index) const
 Returns L2 (distance from sample to spectrum).
 
double l2 (const std::pair< size_t, size_t > &index) const
 Returns L2 (distance from sample to spectrum).
 
DetectorInfo & operator= (const DetectorInfo &rhs)
 Assigns the contents of the non-wrapping part of rhs to this.
 
double phi (const size_t index) const
 Returns the angle of the detector position about the lab-frame z axis, atan2(y, x), in radians.
 
double phi (const std::pair< size_t, size_t > &index) const
 Returns the angle of the detector position about the lab-frame z axis, atan2(y, x), in radians.
 
double phiOffset (const size_t index, const double offset) const
 Returns phi() reflected about offset (radians): offset - phi for phi >= 0 and -(offset + phi) otherwise.
 
double phiOffset (const std::pair< size_t, size_t > &index, const double offset) const
 Returns phi() reflected about offset (radians).
 
Kernel::V3D position (const size_t index) const
 Returns the position of the detector with given index.
 
Kernel::V3D position (const std::pair< size_t, size_t > &index) const
 Returns the position of the detector with given index.
 
Kernel::Quat rotation (const size_t index) const
 Returns the rotation of the detector with given index.
 
Kernel::Quat rotation (const std::pair< size_t, size_t > &index) const
 Returns the rotation of the detector with given index.
 
Kernel::V3D samplePosition () const
 Returns the sample position.
 
size_t scanCount () const
 Returns the scan count of the detector with given detector index.
 
const std::vector< std::pair< Types::Core::DateAndTime, Types::Core::DateAndTime > > scanIntervals () const
 Returns the scan interval of the detector with given index.
 
size_t scanSize () const
 
void setMasked (const size_t index, bool masked)
 Set the mask flag of the detector with given index. Not thread safe.
 
void setMasked (const std::pair< size_t, size_t > &index, bool masked)
 Set the mask flag of the detector with given index. Not thread safe.
 
void setPosition (const size_t index, const Kernel::V3D &position)
 Set the absolute position of the detector with given index. Not thread safe.
 
void setPosition (const std::pair< size_t, size_t > &index, const Kernel::V3D &position)
 Set the absolute position of the detector with given index. Not thread safe.
 
void setRotation (const size_t index, const Kernel::Quat &rotation)
 Set the absolute rotation of the detector with given index. Not thread safe.
 
void setRotation (const std::pair< size_t, size_t > &index, const Kernel::Quat &rotation)
 Set the absolute rotation of the detector with given index. Not thread safe.
 
double signedTwoTheta (const size_t index) const
 Returns signed 2 theta (signed scattering angle w.r.t. to beam direction).
 
double signedTwoTheta (const size_t index, const Kernel::V3D &observer, const Kernel::V3D &axis) const
 Returns the signed angle between the vector from observer to the detector and axis, signed using the instrument's theta-sign axis (ReferenceFrame::vecThetaSign).
 
double signedTwoTheta (const size_t index, const Kernel::V3D &observer, const Kernel::V3D &axis, const Kernel::V3D &instrumentUp) const
 Returns the angle between the vector from observer to the detector and axis, signed according to the rotation direction relative to axis and instrumentUp.
 
double signedTwoTheta (const std::pair< size_t, size_t > &index) const
 Returns signed 2 theta (signed scattering angle w.r.t. to beam direction).
 
double signedTwoTheta (const std::pair< size_t, size_t > &index, const Kernel::V3D &observer, const Kernel::V3D &axis) const
 Returns the signed angle between the vector from observer to the detector and axis, signed using the instrument's theta-sign axis (ReferenceFrame::vecThetaSign).
 
double signedTwoTheta (const std::pair< size_t, size_t > &index, const Kernel::V3D &observer, const Kernel::V3D &axis, const Kernel::V3D &instrumentUp) const
 Returns the signed angle between the vector from observer to the detector and axis.
 
size_t size () const
 Returns the size of the DetectorInfo, i.e., the number of detectors in the instrument.
 
Kernel::V3D sourcePosition () const
 Returns the source position.
 
double twoTheta (const size_t index) const
 Returns 2 theta (scattering angle w.r.t. to beam direction).
 
double twoTheta (const size_t index, const Kernel::V3D &observer, const Kernel::V3D &axis) const
 Returns the angle between the vector from observer to the detector and axis.
 
double twoTheta (const std::pair< size_t, size_t > &index) const
 Returns 2 theta (scattering angle w.r.t. to beam direction).
 
double twoTheta (const std::pair< size_t, size_t > &index, const Kernel::V3D &observer, const Kernel::V3D &axis) const
 Returns the angle between the vector from observer to the detector and axis.
 
 ~DetectorInfo ()
 

Private Member Functions

void clearPositionDependentParameters (const size_t index)
 
const Geometry::IDetector & getDetector (const size_t index) const
 
std::shared_ptr< const Geometry::IDetector > getDetectorPtr (const size_t index) const
 Helper used by SpectrumInfo.
 

Private Attributes

std::shared_ptr< std::vector< detid_t > const > m_detectorIDs
 
std::unique_ptr< Beamline::DetectorInfo > m_detectorInfo
 Pointer to the actual DetectorInfo object (non-wrapping part).
 
std::shared_ptr< std::unordered_map< detid_t, size_t > const > m_detIDToIndex
 
std::shared_ptr< Geometry::Instrument const > m_instrument
 
std::vector< std::shared_ptr< const Geometry::IDetector > > m_lastDetector
 
std::vector< size_t > m_lastIndex
 
std::shared_ptr< Geometry::ParameterInfo > m_parameterInfo
 
std::shared_ptr< Geometry::ReferenceFrame const > m_referenceFrame
 

Friends

class API::SpectrumInfo
 
class Instrument
 

Detailed Description

Geometry::DetectorInfo is an intermediate step towards a DetectorInfo that is part of Instrument-2.0.

The aim is to provide a nearly identical interface such that we can start refactoring existing code before the full-blown implementation of Instrument-2.0 is available.

DetectorInfo provides easy access to commonly used parameters of individual detectors, such as mask and monitor flags, L1, L2, and 2-theta.

This class is thread safe for read operations (const access) with OpenMP BUT NOT WITH ANY OTHER THREADING LIBRARY such as Poco threads or Intel TBB. There are no thread-safety guarantees for write operations (non-const access). Reads concurrent with writes or concurrent writes are not allowed.

Author
Simon Heybrock
Date
2016

Definition at line 51 of file DetectorInfo.h.

Constructor & Destructor Documentation

◆ DetectorInfo() [1/2]

Mantid::Geometry::DetectorInfo::DetectorInfo ( std::unique_ptr< Beamline::DetectorInfo >  detectorInfo,
std::shared_ptr< const Geometry::Instrument >  instrument,
std::shared_ptr< const std::vector< detid_t > >  detectorIds,
std::shared_ptr< const std::unordered_map< detid_t, size_t > >  detIdToIndexMap,
std::shared_ptr< ParameterInfo >  parameterInfo,
std::shared_ptr< ReferenceFrame const >  referenceFrame 
)

Construct DetectorInfo based on an Instrument.

The Instrument reference instrument must be the parameterized instrument obtained from a workspace. Detector ID -> index map provided as constructor argument. The ParameterInfo and ReferenceFrame must be the same objects held by the matching ComponentInfo.

Definition at line 53 of file DetectorInfo.cpp.

References m_detectorIDs, m_detIDToIndex, and m_instrument.

◆ DetectorInfo() [2/2]

Mantid::Geometry::DetectorInfo::DetectorInfo ( const DetectorInfo &  other)

Copy constructor.

Use with EXTREME CARE.

Public copy should not be used since proper links between DetectorInfo and ComponentInfo must be set up.

Definition at line 78 of file DetectorInfo.cpp.

◆ ~DetectorInfo()

Mantid::Geometry::DetectorInfo::~DetectorInfo ( )
default

Member Function Documentation

◆ allPositions()

std::vector< Kernel::V3D > Mantid::Geometry::DetectorInfo::allPositions ( ) const

Returns the absolute positions of all detectors in a vector ordered by index.

Definition at line 429 of file DetectorInfo.cpp.

References position, and size().

◆ allRotations()

std::vector< Kernel::Quat > Mantid::Geometry::DetectorInfo::allRotations ( ) const

Returns the absolute rotations of all detectors in a vector ordered by index.

Definition at line 449 of file DetectorInfo.cpp.

References rotation, and size().

◆ allScaleFactors()

std::vector< Kernel::V3D > Mantid::Geometry::DetectorInfo::allScaleFactors ( ) const

Returns the scale factors of all detectors in a vector ordered by index.

Definition at line 459 of file DetectorInfo.cpp.

References m_detectorInfo, size(), and Mantid::Kernel::toV3D().

◆ azimuthal() [1/2]

double Mantid::Geometry::DetectorInfo::azimuthal ( const size_t  index) const

◆ azimuthal() [2/2]

double Mantid::Geometry::DetectorInfo::azimuthal ( const std::pair< size_t, size_t > &  index) const

◆ begin()

DetectorInfoIt Mantid::Geometry::DetectorInfo::begin ( )

Definition at line 599 of file DetectorInfo.cpp.

References size().

◆ cbegin()

const DetectorInfoConstIt Mantid::Geometry::DetectorInfo::cbegin ( ) const

Definition at line 566 of file DetectorInfo.cpp.

References size().

◆ cend()

const DetectorInfoConstIt Mantid::Geometry::DetectorInfo::cend ( ) const

Definition at line 568 of file DetectorInfo.cpp.

References size().

◆ clearMaskFlags()

void Mantid::Geometry::DetectorInfo::clearMaskFlags ( )

Sets all mask flags to false (unmasked).

Not thread safe.

This method was introduced to help with refactoring and may be removed in the future.

Definition at line 481 of file DetectorInfo.cpp.

References m_detectorInfo, and size().

Referenced by Mantid::DataObjects::MaskWorkspace::clearMask(), and export_DetectorInfo().

◆ clearPositionDependentParameters()

void Mantid::Geometry::DetectorInfo::clearPositionDependentParameters ( const size_t  index)
private

Definition at line 501 of file DetectorInfo.cpp.

References index, and m_parameterInfo.

Referenced by setPosition(), and setPosition().

◆ detector()

const Geometry::IDetector & Mantid::Geometry::DetectorInfo::detector ( const size_t  index) const

Return a const reference to the detector with given index.

Definition at line 518 of file DetectorInfo.cpp.

References getDetector(), GNU_DIAG_OFF, GNU_DIAG_ON, index, MSVC_DIAG_OFF, and MSVC_DIAG_ON.

◆ detectorIDs()

const std::vector< detid_t > & Mantid::Geometry::DetectorInfo::detectorIDs ( ) const

◆ detid()

detid_t Mantid::Geometry::DetectorInfo::detid ( const size_t  index) const

Returns the detector ID for the given logical detector index.

Works without allocating the full ID vector.

Definition at line 550 of file DetectorInfo.cpp.

References index, and m_detectorInfo.

Referenced by Mantid::Crystal::SaveIsawPeaks::bankMasked(), diffractometerConstants(), export_DetectorInfo(), Mantid::API::SpectrumInfo::firstDetectorID(), getDetector(), and Mantid::API::TimeAtSampleStrategyIndirect::getEfixed().

◆ difcUncalibrated()

double Mantid::Geometry::DetectorInfo::difcUncalibrated ( const size_t  index) const

◆ diffractometerConstants()

std::tuple< double, double, double > Mantid::Geometry::DetectorInfo::diffractometerConstants ( const size_t  index,
std::vector< detid_t > &  calibratedDets,
std::vector< detid_t > &  uncalibratedDets 
) const

◆ end()

DetectorInfoIt Mantid::Geometry::DetectorInfo::end ( )

Definition at line 602 of file DetectorInfo.cpp.

References size().

◆ geographicalAngles() [1/2]

std::pair< double, double > Mantid::Geometry::DetectorInfo::geographicalAngles ( const size_t  index) const

◆ geographicalAngles() [2/2]

std::pair< double, double > Mantid::Geometry::DetectorInfo::geographicalAngles ( const std::pair< size_t, size_t > &  index) const

Definition at line 409 of file DetectorInfo.cpp.

References index, m_referenceFrame, position, and samplePosition().

◆ getDetector()

const Geometry::IDetector & Mantid::Geometry::DetectorInfo::getDetector ( const size_t  index) const
private

Definition at line 570 of file DetectorInfo.cpp.

References detid(), index, m_instrument, m_lastDetector, m_lastIndex, and PARALLEL_THREAD_NUMBER.

Referenced by detector(), and getDetectorPtr().

◆ getDetectorPtr()

std::shared_ptr< const Geometry::IDetector > Mantid::Geometry::DetectorInfo::getDetectorPtr ( const size_t  index) const
private

◆ getMemorySize()

size_t Mantid::Geometry::DetectorInfo::getMemorySize ( ) const

Return memory used by the detector info, in bytes.

Returns
bytes used.

Definition at line 607 of file DetectorInfo.cpp.

References m_detectorInfo, m_lastDetector, m_lastIndex, n, and size().

Referenced by export_DetectorInfo().

◆ hasMaskedDetectors()

bool Mantid::Geometry::DetectorInfo::hasMaskedDetectors ( ) const

Returns true if there are masked detectors.

Definition at line 132 of file DetectorInfo.cpp.

References m_detectorInfo.

Referenced by export_DetectorInfo().

◆ indexOf()

std::size_t Mantid::Geometry::DetectorInfo::indexOf ( const detid_t  id) const

◆ isEquivalent()

bool Mantid::Geometry::DetectorInfo::isEquivalent ( const DetectorInfo &  other) const

Returns true if the content of this is equivalent to the content of other.

Here "equivalent" implies equality of all member, except for positions and rotations, which are treated specially:

  • Positions that differ by less than 1 nm = 1e-9 m are considered equivalent.
  • Rotations that imply relative position changes of less than 1 nm = 1e-9 m with a rotation center that is 1000 m away are considered equivalent. Note that in both cases the actual limit may be lower, but it is guarenteed that any LARGER differences are NOT considered equivalent.

Definition at line 108 of file DetectorInfo.cpp.

References m_detectorInfo.

Referenced by export_DetectorInfo().

◆ isMasked() [1/2]

bool Mantid::Geometry::DetectorInfo::isMasked ( const size_t  index) const

◆ isMasked() [2/2]

bool Mantid::Geometry::DetectorInfo::isMasked ( const std::pair< size_t, size_t > &  index) const

Returns true if the detector is masked.

Definition at line 129 of file DetectorInfo.cpp.

References index, and m_detectorInfo.

◆ isMonitor() [1/2]

bool Mantid::Geometry::DetectorInfo::isMonitor ( const size_t  index) const

◆ isMonitor() [2/2]

bool Mantid::Geometry::DetectorInfo::isMonitor ( const std::pair< size_t, size_t > &  index) const

Returns true if the detector is a monitor.

Definition at line 123 of file DetectorInfo.cpp.

References index, and m_detectorInfo.

◆ isScanning()

bool Mantid::Geometry::DetectorInfo::isScanning ( ) const

Returns true if the beamline has scanning detectors.

Definition at line 117 of file DetectorInfo.cpp.

References m_detectorInfo.

Referenced by Mantid::API::SpectrumInfo::diffractometerConstants().

◆ l1()

double Mantid::Geometry::DetectorInfo::l1 ( ) const

◆ l2() [1/2]

double Mantid::Geometry::DetectorInfo::l2 ( const size_t  index) const

Returns L2 (distance from sample to spectrum).

For monitors this is defined such that L1+L2 = source-detector distance, i.e., for a monitor in the beamline between source and sample L2 is negative.

Definition at line 139 of file DetectorInfo.cpp.

References index, isMonitor(), l1(), position, samplePosition(), and sourcePosition().

Referenced by Mantid::Algorithms::CreateLogTimeCorrection::calculateCorrections(), export_DetectorInfo(), Mantid::Algorithms::CreateLogTimeCorrection::generateCorrectionTable(), Mantid::Algorithms::SolidAngleHelpers::Rectangle::solidAngle(), Mantid::Algorithms::SolidAngleHelpers::Tube::solidAngle(), and Mantid::Algorithms::SolidAngleHelpers::Wing::solidAngle().

◆ l2() [2/2]

double Mantid::Geometry::DetectorInfo::l2 ( const std::pair< size_t, size_t > &  index) const

Returns L2 (distance from sample to spectrum).

For monitors this is defined such that L1+L2 = source-detector distance, i.e., for a monitor in the beamline between source and sample L2 is negative.

Definition at line 151 of file DetectorInfo.cpp.

References index, isMonitor(), l1(), position, samplePosition(), and sourcePosition().

◆ operator=()

DetectorInfo & Mantid::Geometry::DetectorInfo::operator= ( const DetectorInfo &  rhs)

Assigns the contents of the non-wrapping part of rhs to this.

Definition at line 85 of file DetectorInfo.cpp.

References m_detectorIDs, m_detectorInfo, and rhs.

◆ phi() [1/2]

double Mantid::Geometry::DetectorInfo::phi ( const size_t  index) const

Returns the angle of the detector position about the lab-frame z axis, atan2(y, x), in radians.

This is the Instrument-2.0 replacement for IDetector::getPhi. It is measured from the lab origin and ignores the reference frame; see azimuthal() for the angle about the beam measured from the sample.

Definition at line 351 of file DetectorInfo.cpp.

References index, and position.

Referenced by Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::calculateE1(), Mantid::MDAlgorithms::IntegratePeaksMD2::calculateE1(), export_DetectorInfo(), Mantid::API::SpectrumInfo::phi(), phiOffset(), and phiOffset().

◆ phi() [2/2]

double Mantid::Geometry::DetectorInfo::phi ( const std::pair< size_t, size_t > &  index) const

Returns the angle of the detector position about the lab-frame z axis, atan2(y, x), in radians.

Definition at line 354 of file DetectorInfo.cpp.

References index, and position.

◆ phiOffset() [1/2]

double Mantid::Geometry::DetectorInfo::phiOffset ( const size_t  index,
const double  offset 
) const

Returns phi() reflected about offset (radians): offset - phi for phi >= 0 and -(offset + phi) otherwise.

This is the Instrument-2.0 replacement for IDetector::getPhiOffset.

Definition at line 360 of file DetectorInfo.cpp.

References index, and phi().

Referenced by export_DetectorInfo().

◆ phiOffset() [2/2]

double Mantid::Geometry::DetectorInfo::phiOffset ( const std::pair< size_t, size_t > &  index,
const double  offset 
) const

Returns phi() reflected about offset (radians).

Definition at line 365 of file DetectorInfo.cpp.

References index, and phi().

◆ position() [1/2]

Kernel::V3D Mantid::Geometry::DetectorInfo::position ( const size_t  index) const

◆ position() [2/2]

Kernel::V3D Mantid::Geometry::DetectorInfo::position ( const std::pair< size_t, size_t > &  index) const

Returns the position of the detector with given index.

Definition at line 424 of file DetectorInfo.cpp.

References index, m_detectorInfo, and Mantid::Kernel::toV3D().

◆ rotation() [1/2]

Kernel::Quat Mantid::Geometry::DetectorInfo::rotation ( const size_t  index) const

◆ rotation() [2/2]

Kernel::Quat Mantid::Geometry::DetectorInfo::rotation ( const std::pair< size_t, size_t > &  index) const

Returns the rotation of the detector with given index.

Definition at line 444 of file DetectorInfo.cpp.

References index, m_detectorInfo, and Mantid::Kernel::toQuat().

◆ samplePosition()

Kernel::V3D Mantid::Geometry::DetectorInfo::samplePosition ( ) const

◆ scanCount()

size_t Mantid::Geometry::DetectorInfo::scanCount ( ) const

Returns the scan count of the detector with given detector index.

Definition at line 555 of file DetectorInfo.cpp.

References m_detectorInfo.

Referenced by Mantid::DataObjects::ScanningWorkspaceBuilder::buildRelativeRotationsForScans(), and Mantid::Algorithms::MergeRuns::buildScanIntervals().

◆ scanIntervals()

const std::vector< std::pair< Types::Core::DateAndTime, Types::Core::DateAndTime > > Mantid::Geometry::DetectorInfo::scanIntervals ( ) const

Returns the scan interval of the detector with given index.

The interval start and end values would typically correspond to nanoseconds since 1990, as in Types::Core::DateAndTime.

Definition at line 561 of file DetectorInfo.cpp.

References m_detectorInfo.

Referenced by Mantid::Algorithms::MergeRuns::buildScanIntervals().

◆ scanSize()

size_t Mantid::Geometry::DetectorInfo::scanSize ( ) const

◆ setMasked() [1/2]

void Mantid::Geometry::DetectorInfo::setMasked ( const size_t  index,
bool  masked 
)

◆ setMasked() [2/2]

void Mantid::Geometry::DetectorInfo::setMasked ( const std::pair< size_t, size_t > &  index,
bool  masked 
)

Set the mask flag of the detector with given index. Not thread safe.

Definition at line 473 of file DetectorInfo.cpp.

References index, and m_detectorInfo.

◆ setPosition() [1/2]

void Mantid::Geometry::DetectorInfo::setPosition ( const size_t  index,
const Kernel::V3D &  position 
)

◆ setPosition() [2/2]

void Mantid::Geometry::DetectorInfo::setPosition ( const std::pair< size_t, size_t > &  index,
const Kernel::V3D &  position 
)

Set the absolute position of the detector with given index. Not thread safe.

Definition at line 494 of file DetectorInfo.cpp.

References clearPositionDependentParameters(), index, m_detectorInfo, position, and Mantid::Kernel::toVector3d().

◆ setRotation() [1/2]

void Mantid::Geometry::DetectorInfo::setRotation ( const size_t  index,
const Kernel::Quat &  rotation 
)

Set the absolute rotation of the detector with given index. Not thread safe.

Definition at line 508 of file DetectorInfo.cpp.

References index, m_detectorInfo, rotation, and Mantid::Kernel::toQuaterniond().

Referenced by Mantid::DataObjects::ScanningWorkspaceBuilder::buildRelativeRotationsForScans(), and Mantid::DataObjects::ScanningWorkspaceBuilder::buildRotations().

◆ setRotation() [2/2]

void Mantid::Geometry::DetectorInfo::setRotation ( const std::pair< size_t, size_t > &  index,
const Kernel::Quat &  rotation 
)

Set the absolute rotation of the detector with given index. Not thread safe.

Definition at line 513 of file DetectorInfo.cpp.

References index, m_detectorInfo, rotation, and Mantid::Kernel::toQuaterniond().

◆ signedTwoTheta() [1/6]

double Mantid::Geometry::DetectorInfo::signedTwoTheta ( const size_t  index) const

Returns signed 2 theta (signed scattering angle w.r.t. to beam direction).

Definition at line 191 of file DetectorInfo.cpp.

References index, isMonitor(), m_referenceFrame, position, samplePosition(), and sourcePosition().

Referenced by signedTwoTheta(), and signedTwoTheta().

◆ signedTwoTheta() [2/6]

double Mantid::Geometry::DetectorInfo::signedTwoTheta ( const size_t  index,
const Kernel::V3D &  observer,
const Kernel::V3D &  axis 
) const

Returns the signed angle between the vector from observer to the detector and axis, signed using the instrument's theta-sign axis (ReferenceFrame::vecThetaSign).

Definition at line 335 of file DetectorInfo.cpp.

References index, m_referenceFrame, and signedTwoTheta().

◆ signedTwoTheta() [3/6]

double Mantid::Geometry::DetectorInfo::signedTwoTheta ( const size_t  index,
const Kernel::V3D &  observer,
const Kernel::V3D &  axis,
const Kernel::V3D &  instrumentUp 
) const

Returns the angle between the vector from observer to the detector and axis, signed according to the rotation direction relative to axis and instrumentUp.

This is the Instrument-2.0 replacement for IDetector::getSignedTwoTheta. No monitor check is performed.

Definition at line 322 of file DetectorInfo.cpp.

References index, and position.

◆ signedTwoTheta() [4/6]

double Mantid::Geometry::DetectorInfo::signedTwoTheta ( const std::pair< size_t, size_t > &  index) const

Returns signed 2 theta (signed scattering angle w.r.t. to beam direction).

Definition at line 216 of file DetectorInfo.cpp.

References index, isMonitor(), m_referenceFrame, position, samplePosition(), and sourcePosition().

◆ signedTwoTheta() [5/6]

double Mantid::Geometry::DetectorInfo::signedTwoTheta ( const std::pair< size_t, size_t > &  index,
const Kernel::V3D &  observer,
const Kernel::V3D &  axis 
) const

Returns the signed angle between the vector from observer to the detector and axis, signed using the instrument's theta-sign axis (ReferenceFrame::vecThetaSign).

Definition at line 341 of file DetectorInfo.cpp.

References index, m_referenceFrame, and signedTwoTheta().

◆ signedTwoTheta() [6/6]

double Mantid::Geometry::DetectorInfo::signedTwoTheta ( const std::pair< size_t, size_t > &  index,
const Kernel::V3D &  observer,
const Kernel::V3D &  axis,
const Kernel::V3D &  instrumentUp 
) const

Returns the signed angle between the vector from observer to the detector and axis.

Definition at line 328 of file DetectorInfo.cpp.

References index, and position.

◆ size()

size_t Mantid::Geometry::DetectorInfo::size ( ) const

◆ sourcePosition()

Kernel::V3D Mantid::Geometry::DetectorInfo::sourcePosition ( ) const

◆ twoTheta() [1/4]

double Mantid::Geometry::DetectorInfo::twoTheta ( const size_t  index) const

◆ twoTheta() [2/4]

double Mantid::Geometry::DetectorInfo::twoTheta ( const size_t  index,
const Kernel::V3D &  observer,
const Kernel::V3D &  axis 
) const

Returns the angle between the vector from observer to the detector and axis.

This is the Instrument-2.0 replacement for IDetector::getTwoTheta. Unlike twoTheta(index), the observer and axis are supplied by the caller rather than taken from the sample and beam, and no monitor check is performed.

Definition at line 307 of file DetectorInfo.cpp.

References index, and position.

◆ twoTheta() [3/4]

double Mantid::Geometry::DetectorInfo::twoTheta ( const std::pair< size_t, size_t > &  index) const

Returns 2 theta (scattering angle w.r.t. to beam direction).

Definition at line 175 of file DetectorInfo.cpp.

References index, isMonitor(), position, samplePosition(), and sourcePosition().

◆ twoTheta() [4/4]

double Mantid::Geometry::DetectorInfo::twoTheta ( const std::pair< size_t, size_t > &  index,
const Kernel::V3D &  observer,
const Kernel::V3D &  axis 
) const

Returns the angle between the vector from observer to the detector and axis.

Definition at line 312 of file DetectorInfo.cpp.

References index, and position.

Friends And Related Symbol Documentation

◆ API::SpectrumInfo

friend class API::SpectrumInfo
friend

Definition at line 136 of file DetectorInfo.h.

◆ Instrument

friend class Instrument
friend

Definition at line 137 of file DetectorInfo.h.

Member Data Documentation

◆ m_detectorIDs

std::shared_ptr<std::vector<detid_t> const> Mantid::Geometry::DetectorInfo::m_detectorIDs
private

Definition at line 159 of file DetectorInfo.h.

Referenced by detectorIDs(), DetectorInfo(), and operator=().

◆ m_detectorInfo

std::unique_ptr<Beamline::DetectorInfo> Mantid::Geometry::DetectorInfo::m_detectorInfo
private

◆ m_detIDToIndex

std::shared_ptr<std::unordered_map<detid_t, size_t> const> Mantid::Geometry::DetectorInfo::m_detIDToIndex
private

Definition at line 160 of file DetectorInfo.h.

Referenced by DetectorInfo(), and indexOf().

◆ m_instrument

std::shared_ptr<Geometry::Instrument const> Mantid::Geometry::DetectorInfo::m_instrument
private

Definition at line 158 of file DetectorInfo.h.

Referenced by DetectorInfo(), and getDetector().

◆ m_lastDetector

std::vector<std::shared_ptr<const Geometry::IDetector> > Mantid::Geometry::DetectorInfo::m_lastDetector
mutableprivate

Definition at line 164 of file DetectorInfo.h.

Referenced by getDetector(), getDetectorPtr(), and getMemorySize().

◆ m_lastIndex

std::vector<size_t> Mantid::Geometry::DetectorInfo::m_lastIndex
mutableprivate

Definition at line 165 of file DetectorInfo.h.

Referenced by getDetector(), and getMemorySize().

◆ m_parameterInfo

std::shared_ptr<Geometry::ParameterInfo> Mantid::Geometry::DetectorInfo::m_parameterInfo
private

Definition at line 161 of file DetectorInfo.h.

Referenced by clearPositionDependentParameters(), and diffractometerConstants().

◆ m_referenceFrame

std::shared_ptr<Geometry::ReferenceFrame const> Mantid::Geometry::DetectorInfo::m_referenceFrame
private

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