|
Mantid
|
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 |
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.
Definition at line 51 of file DetectorInfo.h.
| 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.
| 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.
|
default |
| 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.
| 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.
| 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().
| double Mantid::Geometry::DetectorInfo::azimuthal | ( | const size_t | index | ) | const |
Definition at line 240 of file DetectorInfo.cpp.
References index, isMonitor(), m_referenceFrame, Mantid::Kernel::normalize(), position, samplePosition(), and sourcePosition().
Referenced by export_DetectorInfo().
| double Mantid::Geometry::DetectorInfo::azimuthal | ( | const std::pair< size_t, size_t > & | index | ) | const |
Definition at line 271 of file DetectorInfo.cpp.
References index, isMonitor(), m_referenceFrame, Mantid::Kernel::normalize(), position, samplePosition(), and sourcePosition().
| DetectorInfoIt Mantid::Geometry::DetectorInfo::begin | ( | ) |
Definition at line 599 of file DetectorInfo.cpp.
References size().
| const DetectorInfoConstIt Mantid::Geometry::DetectorInfo::cbegin | ( | ) | const |
Definition at line 566 of file DetectorInfo.cpp.
References size().
| const DetectorInfoConstIt Mantid::Geometry::DetectorInfo::cend | ( | ) | const |
Definition at line 568 of file DetectorInfo.cpp.
References size().
| 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().
|
private |
Definition at line 501 of file DetectorInfo.cpp.
References index, and m_parameterInfo.
Referenced by setPosition(), and setPosition().
| 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.
| const std::vector< detid_t > & Mantid::Geometry::DetectorInfo::detectorIDs | ( | ) | const |
Returns a sorted vector of all detector IDs.
Definition at line 536 of file DetectorInfo.cpp.
References m_detectorIDs.
Referenced by Mantid::Geometry::ParameterMap::asString(), export_DetectorInfo(), Mantid::Algorithms::CreateLogTimeCorrection::generateCorrectionTable(), Mantid::Algorithms::CreateDetectorTable::populateTableByDetID(), Mantid::Algorithms::SparseWorkspace::SparseWorkspace(), and Mantid::Algorithms::CreateLogTimeCorrection::writeCorrectionToFile().
| 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().
| double Mantid::Geometry::DetectorInfo::difcUncalibrated | ( | const size_t | index | ) | const |
Definition at line 394 of file DetectorInfo.cpp.
References index, l1(), Mantid::Kernel::l2, Mantid::Kernel::Units::tofToDSpacingFactor(), and Mantid::Kernel::twoTheta.
Referenced by 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 |
Definition at line 369 of file DetectorInfo.cpp.
References detid(), Mantid::Kernel::difa, Mantid::Kernel::difc, difcUncalibrated(), index, m_parameterInfo, and Mantid::Kernel::tzero.
Referenced by Mantid::API::SpectrumInfo::diffractometerConstants().
| DetectorInfoIt Mantid::Geometry::DetectorInfo::end | ( | ) |
Definition at line 602 of file DetectorInfo.cpp.
References size().
| std::pair< double, double > Mantid::Geometry::DetectorInfo::geographicalAngles | ( | const size_t | index | ) | const |
Definition at line 398 of file DetectorInfo.cpp.
References index, m_referenceFrame, position, and samplePosition().
Referenced by Mantid::API::SpectrumInfo::geographicalAngles().
| 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().
|
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().
|
private |
Helper used by SpectrumInfo.
Definition at line 588 of file DetectorInfo.cpp.
References getDetector(), GNU_DIAG_OFF, GNU_DIAG_ON, index, m_lastDetector, MSVC_DIAG_OFF, MSVC_DIAG_ON, and PARALLEL_THREAD_NUMBER.
Referenced by Mantid::API::SpectrumInfo::getDetector().
| size_t Mantid::Geometry::DetectorInfo::getMemorySize | ( | ) | const |
Return memory used by the detector info, in bytes.
Definition at line 607 of file DetectorInfo.cpp.
References m_detectorInfo, m_lastDetector, m_lastIndex, n, and size().
Referenced by export_DetectorInfo().
| 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().
| std::size_t Mantid::Geometry::DetectorInfo::indexOf | ( | const detid_t | id | ) | const |
Returns the index of the detector with the given detector ID.
This will throw an out of range exception if the detector does not exist.
Definition at line 538 of file DetectorInfo.cpp.
References m_detIDToIndex.
Referenced by Mantid::Crystal::SaveIsawPeaks::bankMasked(), Mantid::API::ExperimentInfo::cacheDefaultDetectorGrouping(), Mantid::DataObjects::MaskWorkspace::combineFromDetectorMasks(), Mantid::DataObjects::MaskWorkspace::combineToDetectorMasks(), Mantid::Algorithms::ConvertDiffCal::exec(), export_DetectorInfo(), Mantid::Geometry::InstrumentRayTracer::getDetectorResult(), Mantid::DataObjects::MaskWorkspace::isConsistentWithDetectorMasks(), Mantid::DataObjects::MaskWorkspace::isMasked(), Mantid::Algorithms::Q1D2::pixelWeight(), Mantid::API::ExperimentInfo::readParameterMap(), Mantid::Algorithms::AppendSpectra::rewriteSpectraMap(), Mantid::API::ExperimentInfo::setDetectorGrouping(), and Mantid::API::ExperimentInfo::setEFixed().
| 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:
Definition at line 108 of file DetectorInfo.cpp.
References m_detectorInfo.
Referenced by export_DetectorInfo().
| bool Mantid::Geometry::DetectorInfo::isMasked | ( | const size_t | index | ) | const |
Returns true if the detector is masked.
Definition at line 126 of file DetectorInfo.cpp.
References index, and m_detectorInfo.
Referenced by Mantid::Crystal::SaveIsawPeaks::bankMasked(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::calculateE1(), Mantid::MDAlgorithms::IntegratePeaksMD2::calculateE1(), Mantid::DataObjects::MaskWorkspace::combineFromDetectorMasks(), Mantid::API::DetectorSearcher::createDetectorCache(), Mantid::Algorithms::ConvertDiffCal::exec(), export_DetectorInfo(), Mantid::DataObjects::MaskWorkspace::isConsistentWithDetectorMasks(), Mantid::DataObjects::MaskWorkspace::isMasked(), Mantid::Algorithms::Q1D2::pixelWeight(), and Mantid::API::DetectorSearcher::searchUsingInstrumentRayTracing().
| 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.
| bool Mantid::Geometry::DetectorInfo::isMonitor | ( | const size_t | index | ) | const |
Returns true if the detector is a monitor.
Definition at line 120 of file DetectorInfo.cpp.
References index, and m_detectorInfo.
Referenced by azimuthal(), azimuthal(), Mantid::DataObjects::ScanningWorkspaceBuilder::buildRelativeRotationsForScans(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::calculateE1(), Mantid::MDAlgorithms::IntegratePeaksMD2::calculateE1(), Mantid::API::DetectorSearcher::createDetectorCache(), export_DetectorInfo(), Mantid::Algorithms::CreateLogTimeCorrection::generateCorrectionTable(), l2(), l2(), Mantid::DataHandling::UpdateInstrumentFromFile::setDetectorPosition(), signedTwoTheta(), signedTwoTheta(), twoTheta(), twoTheta(), and Mantid::Algorithms::CreateLogTimeCorrection::writeCorrectionToFile().
| 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.
| 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().
| double Mantid::Geometry::DetectorInfo::l1 | ( | ) | const |
Returns L1 (distance from source to sample).
Definition at line 533 of file DetectorInfo.cpp.
References m_detectorInfo.
Referenced by Mantid::Algorithms::CreateLogTimeCorrection::calculateCorrections(), difcUncalibrated(), export_DetectorInfo(), Mantid::API::SpectrumInfo::l1(), l2(), l2(), and Mantid::Algorithms::CreateLogTimeCorrection::logGeometryInformation().
| 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().
| 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().
| 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.
| 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().
| 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.
| 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.
Referenced by export_DetectorInfo().
| 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.
| Kernel::V3D Mantid::Geometry::DetectorInfo::position | ( | const size_t | index | ) | const |
Returns the position of the detector with given index.
Definition at line 421 of file DetectorInfo.cpp.
References index, m_detectorInfo, and Mantid::Kernel::toV3D().
Referenced by Mantid::DataObjects::ScanningWorkspaceBuilder::buildRelativeRotationsForScans(), Mantid::API::DetectorSearcher::checkInteceptWithNeighbours(), Mantid::API::DetectorSearcher::createDetectorCache(), export_DetectorInfo(), Mantid::Algorithms::SolidAngleHelpers::AlphaAngleCalculator::getAlpha(), Mantid::Algorithms::SolidAngleHelpers::Rectangle::solidAngle(), and Mantid::Algorithms::SolidAngleHelpers::Wing::solidAngle().
| 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().
| Kernel::Quat Mantid::Geometry::DetectorInfo::rotation | ( | const size_t | index | ) | const |
Returns the rotation of the detector with given index.
Definition at line 439 of file DetectorInfo.cpp.
References index, m_detectorInfo, and Mantid::Kernel::toQuat().
Referenced by Mantid::DataObjects::ScanningWorkspaceBuilder::buildRelativeRotationsForScans(), Mantid::API::DetectorSearcher::checkInteceptWithNeighbours(), and export_DetectorInfo().
| 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().
| Kernel::V3D Mantid::Geometry::DetectorInfo::samplePosition | ( | ) | const |
Returns the sample position.
Definition at line 530 of file DetectorInfo.cpp.
References m_detectorInfo, and Mantid::Kernel::toV3D().
Referenced by azimuthal(), azimuthal(), Mantid::API::DetectorSearcher::checkInteceptWithNeighbours(), geographicalAngles(), geographicalAngles(), l2(), l2(), Mantid::Algorithms::CreateLogTimeCorrection::logGeometryInformation(), Mantid::API::SpectrumInfo::samplePosition(), signedTwoTheta(), signedTwoTheta(), twoTheta(), and twoTheta().
| 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().
| 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().
| size_t Mantid::Geometry::DetectorInfo::scanSize | ( | ) | const |
References Mantid::Kernel::l2, and Mantid::Kernel::twoTheta.
| void Mantid::Geometry::DetectorInfo::setMasked | ( | const size_t | index, |
| bool | masked | ||
| ) |
Set the mask flag of the detector with given index. Not thread safe.
Definition at line 470 of file DetectorInfo.cpp.
References index, and m_detectorInfo.
Referenced by Mantid::DataObjects::MaskWorkspace::combineToDetectorMasks(), export_DetectorInfo(), Mantid::API::ExperimentInfo::populateWithParameter(), Mantid::API::ExperimentInfo::readParameterMap(), and Mantid::API::SpectrumInfo::setMasked().
| 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.
| void Mantid::Geometry::DetectorInfo::setPosition | ( | const size_t | index, |
| const Kernel::V3D & | position | ||
| ) |
Set the absolute position of the detector with given index. Not thread safe.
Definition at line 487 of file DetectorInfo.cpp.
References clearPositionDependentParameters(), index, m_detectorInfo, position, and Mantid::Kernel::toVector3d().
Referenced by Mantid::DataObjects::ScanningWorkspaceBuilder::buildPositions(), Mantid::DataObjects::ScanningWorkspaceBuilder::buildRelativeRotationsForScans(), Mantid::DataHandling::UpdateInstrumentFromFile::setDetectorPosition(), and Mantid::DataHandling::LoadDetectorInfo::updateParameterMap().
| 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().
| 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().
| 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().
| 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().
| 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().
| 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.
| 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().
| 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().
| 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.
| size_t Mantid::Geometry::DetectorInfo::size | ( | ) | const |
Returns the size of the DetectorInfo, i.e., the number of detectors in the instrument.
Definition at line 114 of file DetectorInfo.cpp.
References m_detectorInfo.
Referenced by allPositions(), allRotations(), allScaleFactors(), begin(), Mantid::DataObjects::ScanningWorkspaceBuilder::buildRelativeRotationsForScans(), Mantid::Algorithms::CreateLogTimeCorrection::calculateCorrections(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::calculateE1(), Mantid::MDAlgorithms::IntegratePeaksMD2::calculateE1(), cbegin(), cend(), clearMaskFlags(), Mantid::DataObjects::MaskWorkspace::combineFromDetectorMasks(), Mantid::DataObjects::MaskWorkspace::combineToDetectorMasks(), Mantid::API::DetectorSearcher::createDetectorCache(), end(), export_DetectorInfo(), Mantid::Algorithms::CreateLogTimeCorrection::generateCorrectionTable(), getMemorySize(), Mantid::DataObjects::MaskWorkspace::isConsistentWithDetectorMasks(), and Mantid::Algorithms::CreateLogTimeCorrection::logGeometryInformation().
| Kernel::V3D Mantid::Geometry::DetectorInfo::sourcePosition | ( | ) | const |
Returns the source position.
Definition at line 527 of file DetectorInfo.cpp.
References m_detectorInfo, and Mantid::Kernel::toV3D().
Referenced by azimuthal(), azimuthal(), l2(), l2(), Mantid::Algorithms::CreateLogTimeCorrection::logGeometryInformation(), signedTwoTheta(), signedTwoTheta(), Mantid::API::SpectrumInfo::sourcePosition(), twoTheta(), and twoTheta().
| double Mantid::Geometry::DetectorInfo::twoTheta | ( | const size_t | index | ) | const |
Returns 2 theta (scattering angle w.r.t. to beam direction).
Definition at line 159 of file DetectorInfo.cpp.
References index, isMonitor(), position, samplePosition(), and sourcePosition().
Referenced by Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::calculateE1(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::calculateE1(), and Mantid::MDAlgorithms::IntegratePeaksMD2::calculateE1().
| 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.
| 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().
| 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.
|
friend |
Definition at line 136 of file DetectorInfo.h.
|
friend |
Definition at line 137 of file DetectorInfo.h.
|
private |
Definition at line 159 of file DetectorInfo.h.
Referenced by detectorIDs(), DetectorInfo(), and operator=().
|
private |
Pointer to the actual DetectorInfo object (non-wrapping part).
Definition at line 156 of file DetectorInfo.h.
Referenced by allScaleFactors(), clearMaskFlags(), detid(), getMemorySize(), hasMaskedDetectors(), isEquivalent(), isMasked(), isMasked(), isMonitor(), isMonitor(), isScanning(), l1(), operator=(), position(), position(), rotation(), rotation(), samplePosition(), scanCount(), scanIntervals(), setMasked(), setMasked(), setPosition(), setPosition(), setRotation(), setRotation(), size(), and sourcePosition().
|
private |
Definition at line 160 of file DetectorInfo.h.
Referenced by DetectorInfo(), and indexOf().
|
private |
Definition at line 158 of file DetectorInfo.h.
Referenced by DetectorInfo(), and getDetector().
|
mutableprivate |
Definition at line 164 of file DetectorInfo.h.
Referenced by getDetector(), getDetectorPtr(), and getMemorySize().
|
mutableprivate |
Definition at line 165 of file DetectorInfo.h.
Referenced by getDetector(), and getMemorySize().
|
private |
Definition at line 161 of file DetectorInfo.h.
Referenced by clearPositionDependentParameters(), and diffractometerConstants().
|
private |
Definition at line 162 of file DetectorInfo.h.
Referenced by azimuthal(), azimuthal(), geographicalAngles(), geographicalAngles(), signedTwoTheta(), signedTwoTheta(), signedTwoTheta(), and signedTwoTheta().