|
Mantid
|
API::SpectrumInfo is an intermediate step towards a SpectrumInfo that is part of Instrument-2.0. More...
#include <SpectrumInfo.h>
Public Member Functions | |
| double | azimuthal (const size_t index) const |
| Returns the out-of-plane angle in radians (angle w.r.t. | |
| SpectrumInfoIterator< SpectrumInfo > | begin () |
| Geometry::BoundingBox | boundingBox (const size_t index) const |
| Returns the bounding box of the detector(s) of the spectrum with given index. | |
| const SpectrumInfoIterator< const SpectrumInfo > | cbegin () const |
| const SpectrumInfoIterator< const SpectrumInfo > | cend () const |
| void | createDetectorIdLogMessages (const std::vector< detid_t > &detids, int64_t wsIndex) const |
| const Geometry::IDetector & | detector (const size_t index) const |
| Return a const reference to the detector or detector group of the spectrum with given index. | |
| size_t | detectorCount () const |
| double | difcUncalibrated (const size_t index) const |
| Calculate average uncalibrated DIFC value of detectors associated with this spectrum. | |
| Kernel::UnitParametersMap | diffractometerConstants (const size_t index) const |
| Calculate average diffractometer constants (DIFA, DIFC, TZERO) of detectors associated with this spectrum. | |
| Kernel::UnitParametersMap | diffractometerConstants (const size_t index, std::vector< detid_t > &uncalibratedDets) const |
| Calculate average diffractometer constants (DIFA, DIFC, TZERO) of detectors associated with this spectrum. | |
| SpectrumInfoIterator< SpectrumInfo > | end () |
| detid_t | firstDetectorID (const size_t index) const |
| Returns the detector ID of the first detector of the spectrum with given index. | |
| size_t | firstDetectorIndex (const size_t index) const |
| Returns the detector index of the first detector of the spectrum with given index. | |
| std::pair< double, double > | geographicalAngles (const size_t index) const |
| Calculate latitude and longitude for given spectrum index. | |
| void | getDetectorValues (const Kernel::Unit &inputUnit, const Kernel::Unit &outputUnit, const Kernel::DeltaEMode::Type emode, const bool signedTheta, int64_t wsIndex, Kernel::UnitParametersMap &pmap) const |
| Get the detector values relevant to unit conversion for a workspace index. | |
| bool | hasDetectors (const size_t index) const |
| Returns true if the spectrum is associated with detectors in the instrument. | |
| bool | hasUniqueDetector (const size_t index) const |
| Returns true if the spectrum is associated with exactly one detector. | |
| bool | isMasked (const size_t index) const |
| Returns true if the detector(s) associated with the spectrum are masked. | |
| bool | isMonitor (const size_t index) const |
| Returns true if the detector(s) associated with the spectrum are monitors. | |
| 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 | phi (const size_t index) const |
| Returns the angle of the spectrum 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. | |
| Kernel::V3D | position (const size_t index) const |
| Returns the position of the spectrum with given index. | |
| Kernel::V3D | samplePosition () const |
| Returns the sample position. | |
| void | setMasked (const size_t index, bool masked) |
| Set the mask flag of the spectrum with given index. | |
| const Kernel::cow_ptr< std::vector< SpectrumDefinition > > & | sharedSpectrumDefinitions () const |
| double | signedTwoTheta (const size_t index) const |
| Returns the signed scattering angle 2 theta in radians (angle w.r.t. | |
| double | signedTwoTheta (const size_t index, const Kernel::V3D &observer, const Kernel::V3D &axis) const |
Returns the average signed angle between the vectors from observer to each detector of the spectrum 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 average signed angle between the vectors from observer to each detector of the spectrum and axis, signed according to the rotation direction relative to axis and instrumentUp. | |
| size_t | size () const |
| Returns the size of the SpectrumInfo, i.e., the number of spectra. | |
| Kernel::V3D | sourcePosition () const |
| Returns the source position. | |
| const SpectrumDefinition & | spectrumDefinition (const size_t index) const |
| Returns a const reference to the SpectrumDefinition of the spectrum. | |
| SpectrumInfo (const Beamline::SpectrumInfo &spectrumInfo, const ExperimentInfo &experimentInfo, Geometry::DetectorInfo &detectorInfo) | |
| double | twoTheta (const size_t index) const |
| Returns the scattering angle 2 theta in radians (angle w.r.t. | |
| double | twoTheta (const size_t index, const Kernel::V3D &observer, const Kernel::V3D &axis) const |
Returns the average angle between the vectors from observer to each detector of the spectrum and axis. | |
| ~SpectrumInfo () | |
Private Member Functions | |
| const SpectrumDefinition & | checkAndGetSpectrumDefinition (const size_t index) const |
| const Geometry::IDetector & | getDetector (const size_t index) const |
Private Attributes | |
| Geometry::DetectorInfo & | m_detectorInfo |
| const ExperimentInfo & | m_experimentInfo |
| std::vector< std::shared_ptr< const Geometry::IDetector > > | m_lastDetector |
| std::vector< size_t > | m_lastIndex |
| const Beamline::SpectrumInfo & | m_spectrumInfo |
Friends | |
| class | ExperimentInfo |
API::SpectrumInfo is an intermediate step towards a SpectrumInfo 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.
SpectrumInfo provides easy access to commonly used parameters of individual spectra (which may correspond to one or more 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 54 of file SpectrumInfo.h.
| Mantid::API::SpectrumInfo::SpectrumInfo | ( | const Beamline::SpectrumInfo & | spectrumInfo, |
| const ExperimentInfo & | experimentInfo, | ||
| Geometry::DetectorInfo & | detectorInfo | ||
| ) |
Definition at line 34 of file SpectrumInfo.cpp.
|
default |
References Mantid::Kernel::l2, and Mantid::Kernel::twoTheta.
| double Mantid::API::SpectrumInfo::azimuthal | ( | const size_t | index | ) | const |
Returns the out-of-plane angle in radians (angle w.r.t.
to vecPointingHorizontal direction).
Throws an exception if the spectrum is a monitor.
Definition at line 118 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, and Mantid::Geometry::x.
Referenced by export_SpectrumInfo(), and MantidQt::MantidWidgets::ImageInfoModelMatrixWS::info().
| SpectrumInfoIt Mantid::API::SpectrumInfo::begin | ( | ) |
Definition at line 492 of file SpectrumInfo.cpp.
| Geometry::BoundingBox Mantid::API::SpectrumInfo::boundingBox | ( | const size_t | index | ) | const |
Returns the bounding box of the detector(s) of the spectrum with given index.
For spectra with more than one detector this is the union of the bounding boxes of the detectors. Throws Kernel::Exception::NotFoundError if the spectrum has no detectors.
Definition at line 476 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), Mantid::API::ExperimentInfo::componentInfo(), Mantid::Geometry::BoundingBox::grow(), index, and m_experimentInfo.
| const SpectrumInfoConstIt Mantid::API::SpectrumInfo::cbegin | ( | ) | const |
Definition at line 497 of file SpectrumInfo.cpp.
| const SpectrumInfoConstIt Mantid::API::SpectrumInfo::cend | ( | ) | const |
Definition at line 500 of file SpectrumInfo.cpp.
References size().
|
private |
Definition at line 484 of file SpectrumInfo.cpp.
References index, size(), spectrumDefinition(), and std::to_string().
Referenced by azimuthal(), boundingBox(), diffractometerConstants(), firstDetectorID(), firstDetectorIndex(), geographicalAngles(), isMasked(), isMonitor(), l2(), phi(), position(), setMasked(), signedTwoTheta(), signedTwoTheta(), signedTwoTheta(), twoTheta(), and twoTheta().
| void Mantid::API::SpectrumInfo::createDetectorIdLogMessages | ( | const std::vector< detid_t > & | detids, |
| int64_t | wsIndex | ||
| ) | const |
Definition at line 355 of file SpectrumInfo.cpp.
References Mantid::API::g_log, std::to_string(), and Mantid::Kernel::Logger::warning().
Referenced by getDetectorValues().
| const Geometry::IDetector & Mantid::API::SpectrumInfo::detector | ( | const size_t | index | ) | const |
Return a const reference to the detector or detector group of the spectrum with given index.
Definition at line 396 of file SpectrumInfo.cpp.
References getDetector(), GNU_DIAG_OFF, GNU_DIAG_ON, index, MSVC_DIAG_OFF, and MSVC_DIAG_ON.
Referenced by Mantid::API::WorkspaceNearestNeighbours::build(), Mantid::Algorithms::ModeratorTzeroLinear::calculateTfLi(), Mantid::Algorithms::He3TubeEfficiency::correctForEfficiency(), Mantid::DataHandling::GenerateGroupingPowder::createGroups(), getDetectorValues(), Mantid::Algorithms::GetEi2::getDistanceFromSource(), Mantid::Algorithms::CreateDetectorTable::retrieveSignedThetaParameter(), Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR(), and Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak().
| size_t Mantid::API::SpectrumInfo::detectorCount | ( | ) | const |
Definition at line 45 of file SpectrumInfo.cpp.
References m_spectrumInfo.
Referenced by export_SpectrumInfo().
| double Mantid::API::SpectrumInfo::difcUncalibrated | ( | const size_t | index | ) | const |
Calculate average uncalibrated DIFC value of detectors associated with this spectrum.
| index | Index of the spectrum that DIFC is required for |
Definition at line 282 of file SpectrumInfo.cpp.
References index, l1(), Mantid::Kernel::l2, Mantid::Kernel::Units::tofToDSpacingFactor(), and Mantid::Kernel::twoTheta.
Referenced by Mantid::Algorithms::RemoveLowResTOF::calcTofMin(), diffractometerConstants(), export_SpectrumInfo(), getDetectorValues(), and Mantid::Algorithms::CreateDetectorTable::getDiffConst().
| UnitParametersMap Mantid::API::SpectrumInfo::diffractometerConstants | ( | const size_t | index | ) | const |
Calculate average diffractometer constants (DIFA, DIFC, TZERO) of detectors associated with this spectrum.
Use calibrated values where possible, filling in with uncalibrated values where they're missing
| index | Index of the spectrum that constants are required for |
Definition at line 272 of file SpectrumInfo.cpp.
References diffractometerConstants(), and index.
| UnitParametersMap Mantid::API::SpectrumInfo::diffractometerConstants | ( | const size_t | index, |
| std::vector< detid_t > & | warningDets | ||
| ) | const |
Calculate average diffractometer constants (DIFA, DIFC, TZERO) of detectors associated with this spectrum.
Use calibrated values where possible, filling in with uncalibrated values where they're missing
| index | Index of the spectrum that constants are required for |
| warningDets | A vector containing the det ids where an uncalibrated value was used in the situation where some dets have calibrated values and some don't |
Definition at line 233 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), Mantid::Kernel::difa, Mantid::Kernel::difc, difcUncalibrated(), Mantid::Geometry::DetectorInfo::diffractometerConstants(), index, Mantid::Geometry::DetectorInfo::isScanning(), m_detectorInfo, spectrumDefinition(), and Mantid::Kernel::tzero.
Referenced by diffractometerConstants(), export_SpectrumInfo(), Mantid::DataHandling::SaveGSS::generateBankHeader(), getDetectorValues(), and Mantid::Algorithms::CreateDetectorTable::getDiffConst().
| SpectrumInfoIt Mantid::API::SpectrumInfo::end | ( | ) |
Definition at line 495 of file SpectrumInfo.cpp.
References size().
| detid_t Mantid::API::SpectrumInfo::firstDetectorID | ( | const size_t | index | ) | const |
Returns the detector ID of the first detector of the spectrum with given index.
For spectra with more than one detector this is the ID of the first entry in the spectrum definition. Throws Kernel::Exception::NotFoundError if the spectrum has no detectors.
Definition at line 458 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), Mantid::Geometry::DetectorInfo::detid(), index, and m_detectorInfo.
Referenced by Mantid::MDAlgorithms::MDNormBase::calculateNormInner(), Mantid::DataHandling::GenerateGroupingPowder::createGroups(), Mantid::Algorithms::CreateDetectorTable::getQ(), Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR(), and Mantid::Algorithms::CreateDetectorTable::setup().
| size_t Mantid::API::SpectrumInfo::firstDetectorIndex | ( | const size_t | index | ) | const |
Returns the detector index of the first detector of the spectrum with given index.
For spectra with more than one detector this is the first entry in the spectrum definition. The index is valid for both DetectorInfo and ComponentInfo. Throws Kernel::Exception::NotFoundError if the spectrum has no detectors.
Definition at line 467 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), and index.
| std::pair< double, double > Mantid::API::SpectrumInfo::geographicalAngles | ( | const size_t | index | ) | const |
Calculate latitude and longitude for given spectrum index.
| index | Index of the spectrum that lat/long are required for |
Definition at line 203 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), Mantid::Geometry::DetectorInfo::geographicalAngles(), index, m_detectorInfo, size(), and spectrumDefinition().
Referenced by Mantid::Algorithms::SparseWorkspace::bilinearInterpolateFromDetectorGrid(), Mantid::Algorithms::SparseWorkspace::extremeAngles(), geographicalAngles(), and Mantid::Algorithms::SparseWorkspace::interpolateFromDetectorGrid().
|
private |
Definition at line 413 of file SpectrumInfo.cpp.
References Mantid::Geometry::DetectorInfo::getDetectorPtr(), GNU_DIAG_OFF, GNU_DIAG_ON, index, m_detectorInfo, m_lastDetector, m_lastIndex, MSVC_DIAG_OFF, MSVC_DIAG_ON, PARALLEL_THREAD_NUMBER, spectrumDefinition(), and std::to_string().
Referenced by detector().
| void Mantid::API::SpectrumInfo::getDetectorValues | ( | const Kernel::Unit & | inputUnit, |
| const Kernel::Unit & | outputUnit, | ||
| const Kernel::DeltaEMode::Type | emode, | ||
| const bool | signedTheta, | ||
| int64_t | wsIndex, | ||
| Kernel::UnitParametersMap & | pmap | ||
| ) | const |
Get the detector values relevant to unit conversion for a workspace index.
| inputUnit | :: The input unit (Empty implies "all") |
| outputUnit | :: The output unit (Empty implies "all") |
| emode | :: The energy mode |
| signedTheta | :: Return twotheta with sign or without |
| wsIndex | :: The workspace index |
| pmap | :: a map containing values for conversion parameters that are required by unit classes to perform their conversions eg efixed. It can contain values on the way in if a look up isn't desired here eg if value supplied in parameters to the calling algorithm |
Definition at line 301 of file SpectrumInfo.cpp.
References createDetectorIdLogMessages(), Mantid::Kernel::Logger::debug(), detector(), difcUncalibrated(), diffractometerConstants(), Mantid::Kernel::DeltaEMode::Elastic, Mantid::API::g_log, Mantid::API::ExperimentInfo::getEFixedGivenEMode(), hasDetectors(), isMonitor(), Mantid::Kernel::l2, m_experimentInfo, signedTwoTheta(), Mantid::Kernel::twoTheta, Mantid::Kernel::Unit::unitID(), and Mantid::Kernel::Logger::warning().
Referenced by Mantid::Crystal::FindSXPeaksHelper::PeakFindingStrategy::convertToTOF(), Mantid::Algorithms::CalculatePlaczek::exec(), Mantid::Algorithms::BackgroundHelper::removeBackground(), MantidQt::MantidWidgets::ImageInfoModelMatrixWS::setUnitsInfo(), Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak(), and Mantid::Algorithms::RemoveBins::transformRangeUnit().
| bool Mantid::API::SpectrumInfo::hasDetectors | ( | const size_t | index | ) | const |
Returns true if the spectrum is associated with detectors in the instrument.
Definition at line 373 of file SpectrumInfo.cpp.
References index, and spectrumDefinition().
Referenced by Mantid::MDAlgorithms::MDNormBase::calculateNormInner(), Mantid::Algorithms::ModeratorTzeroLinear::calculateTfLi(), Mantid::Algorithms::CreateDetectorTable::calculateWsIdxData(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertEventList(), Mantid::Algorithms::DetectorEfficiencyCor::correctForEfficiency(), Mantid::DataHandling::GenerateGroupingPowder::createGroups(), export_SpectrumInfo(), Mantid::Algorithms::SparseWorkspace::extremeAngles(), getDetectorValues(), Mantid::Algorithms::GetEi2::getDistanceFromSource(), Mantid::API::TimeAtSampleStrategyIndirect::getEfixed(), Mantid::API::MatrixWorkspaceMDIterator::getIsMasked(), Mantid::Algorithms::ScaleX::getScaleFactor(), Mantid::API::WorkspaceNearestNeighbours::getSpectraDetectors(), MantidQt::MantidWidgets::ImageInfoModelMatrixWS::info(), Mantid::Algorithms::WorkspaceBoundingBox::isValidIndex(), Mantid::Algorithms::DetectorDiagnostic::makeMap(), Mantid::Algorithms::LorentzCorrection::processTOF_PD(), Mantid::Algorithms::LorentzCorrection::processTOF_SCD(), Mantid::Algorithms::BinaryOperation::propagateSpectraMask(), Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR(), Mantid::Algorithms::CreateDetectorTable::setup(), and Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak().
| bool Mantid::API::SpectrumInfo::hasUniqueDetector | ( | const size_t | index | ) | const |
Returns true if the spectrum is associated with exactly one detector.
Definition at line 380 of file SpectrumInfo.cpp.
References index, and spectrumDefinition().
Referenced by Mantid::DataHandling::GenerateGroupingPowder::createGroups(), export_SpectrumInfo(), Mantid::API::TimeAtSampleStrategyIndirect::getEfixed(), Mantid::Algorithms::CorrectKiKf::getEfixedFromParameterMap(), and Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR().
| bool Mantid::API::SpectrumInfo::isMasked | ( | const size_t | index | ) | const |
Returns true if the detector(s) associated with the spectrum are masked.
Definition at line 67 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), and index.
Referenced by Mantid::Algorithms::CorrectTOFAxis::averageL2(), Mantid::Algorithms::CorrectTOFAxis::averageL2AndEPP(), Mantid::MDAlgorithms::MDNormBase::calculateNormInner(), Mantid::Algorithms::DetectorEfficiencyCor::correctForEfficiency(), Mantid::Algorithms::He3TubeEfficiency::correctForEfficiency(), Mantid::DataHandling::GenerateGroupingPowder::createGroups(), export_SpectrumInfo(), Mantid::API::MatrixWorkspaceMDIterator::getIsMasked(), Mantid::API::WorkspaceNearestNeighbours::getSpectraDetectors(), Mantid::Algorithms::BinaryOperation::propagateSpectraMask(), and Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR().
| bool Mantid::API::SpectrumInfo::isMonitor | ( | const size_t | index | ) | const |
Returns true if the detector(s) associated with the spectrum are monitors.
Definition at line 60 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), and index.
Referenced by Mantid::API::TimeAtSampleStrategyElastic::calculate(), Mantid::API::TimeAtSampleStrategyIndirect::calculate(), Mantid::MDAlgorithms::MDNormBase::calculateNormInner(), Mantid::Algorithms::ModeratorTzeroLinear::calculateTfLi(), Mantid::Algorithms::CreateDetectorTable::calculateWsIdxData(), Mantid::Algorithms::DetectorEfficiencyCor::correctForEfficiency(), Mantid::Algorithms::He3TubeEfficiency::correctForEfficiency(), Mantid::DataHandling::GenerateGroupingPowder::createGroups(), Mantid::Algorithms::CalculatePlaczek::exec(), export_SpectrumInfo(), getDetectorValues(), Mantid::Algorithms::CreateDetectorTable::getDiffConst(), Mantid::Algorithms::CorrectKiKf::getEfixedFromParameterMap(), Mantid::Algorithms::CreateDetectorTable::getQ(), Mantid::API::WorkspaceNearestNeighbours::getSpectraDetectors(), Mantid::Algorithms::CreateDetectorTable::getSphericalCoordinates(), Mantid::Algorithms::WorkspaceBoundingBox::isValidIndex(), and Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR().
| double Mantid::API::SpectrumInfo::l1 | ( | ) | const |
Returns L1 (distance from source to sample).
Definition at line 411 of file SpectrumInfo.cpp.
References Mantid::Geometry::DetectorInfo::l1(), and m_detectorInfo.
Referenced by Mantid::Algorithms::RemoveLowResTOF::calcTofMin(), Mantid::Algorithms::ModeratorTzeroLinear::calculateTfLi(), Mantid::Crystal::FindSXPeaksHelper::PeakFindingStrategy::convertToTOF(), difcUncalibrated(), Mantid::Algorithms::CalculatePlaczek::exec(), export_SpectrumInfo(), Mantid::DataHandling::SaveGSS::generateBankHeader(), Mantid::Algorithms::BackgroundHelper::removeBackground(), Mantid::Algorithms::ConvertAxisByFormula::setGeometryValues(), MantidQt::MantidWidgets::ImageInfoModelMatrixWS::setUnitsInfo(), Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak(), and Mantid::Algorithms::RemoveBins::transformRangeUnit().
| double Mantid::API::SpectrumInfo::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 78 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, Mantid::Kernel::l2, and Mantid::Geometry::x.
Referenced by Mantid::Algorithms::CorrectTOFAxis::averageL2(), Mantid::Algorithms::CorrectTOFAxis::averageL2AndEPP(), Mantid::Algorithms::RemoveLowResTOF::calcTofMin(), Mantid::API::TimeAtSampleStrategyElastic::calculate(), Mantid::API::TimeAtSampleStrategyIndirect::calculate(), Mantid::Algorithms::ModeratorTzeroLinear::calculateTfLi(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertEventList(), Mantid::Algorithms::CalculatePlaczek::exec(), export_SpectrumInfo(), Mantid::DataHandling::SaveGSS::generateBankHeader(), Mantid::Algorithms::CreateDetectorTable::getSphericalCoordinates(), Mantid::Algorithms::GravitySANSHelper::GravitySANSHelper(), MantidQt::MantidWidgets::ImageInfoModelMatrixWS::info(), Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR(), Mantid::Algorithms::ConvertAxisByFormula::setGeometryValues(), and Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak().
| double Mantid::API::SpectrumInfo::phi | ( | const size_t | index | ) | const |
Returns the angle of the spectrum position about the lab-frame z axis, atan2(y, x), in radians.
This is the Instrument-2.0 replacement for IDetector::getPhi. For a spectrum with several detectors the angle of the average position is returned, not the average of the angles. 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 173 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, m_detectorInfo, Mantid::Geometry::DetectorInfo::phi(), Mantid::Kernel::Tolerance, and Mantid::Geometry::x.
Referenced by Mantid::Algorithms::AbsorptionCorrection::calculateDistances(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::calculateDistances(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::MDAlgorithms::MDNormBase::calculateNormInner(), Mantid::Crystal::FindSXPeaksHelper::PeakFindingStrategy::calculatePhi(), export_SpectrumInfo(), and phiOffset().
| double Mantid::API::SpectrumInfo::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 194 of file SpectrumInfo.cpp.
Referenced by export_SpectrumInfo().
| Kernel::V3D Mantid::API::SpectrumInfo::position | ( | const size_t | index | ) | const |
Returns the position of the spectrum with given index.
Definition at line 215 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, and Mantid::Geometry::x.
Referenced by Mantid::API::WorkspaceNearestNeighbours::build(), Mantid::API::TimeAtSampleStrategyElastic::calculate(), Mantid::API::TimeAtSampleStrategyIndirect::calculate(), Mantid::Algorithms::AbsorptionCorrection::calculateDistances(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::calculateDistances(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::Algorithms::ModeratorTzeroLinear::calculateTfLi(), Mantid::Algorithms::CreateDetectorTable::calculateWsIdxData(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertEventList(), export_SpectrumInfo(), Mantid::Algorithms::GetEi2::getDistanceFromSource(), Mantid::Algorithms::CreateDetectorTable::getSphericalCoordinates(), Mantid::Algorithms::GravitySANSHelper::GravitySANSHelper(), Mantid::Algorithms::WorkspaceBoundingBox::position(), Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak(), and Mantid::Algorithms::Qhelper::waveLengthCutOff().
| Kernel::V3D Mantid::API::SpectrumInfo::samplePosition | ( | ) | const |
Returns the sample position.
Definition at line 408 of file SpectrumInfo.cpp.
References m_detectorInfo, and Mantid::Geometry::DetectorInfo::samplePosition().
Referenced by export_SpectrumInfo(), and Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak().
| void Mantid::API::SpectrumInfo::setMasked | ( | const size_t | index, |
| bool | masked | ||
| ) |
Set the mask flag of the spectrum with given index.
Not thread safe.
Currently this simply sets the mask flags for the underlying detectors.
Definition at line 389 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, m_detectorInfo, and Mantid::Geometry::DetectorInfo::setMasked().
Referenced by export_SpectrumInfo(), and Mantid::Algorithms::BinaryOperation::propagateSpectraMask().
| const Kernel::cow_ptr< std::vector< SpectrumDefinition > > & Mantid::API::SpectrumInfo::sharedSpectrumDefinitions | ( | ) | const |
Definition at line 53 of file SpectrumInfo.cpp.
References m_experimentInfo, m_spectrumInfo, size(), and Mantid::API::ExperimentInfo::updateSpectrumDefinitionIfNecessary().
Referenced by Mantid::API::ExperimentInfo::operator=().
| double Mantid::API::SpectrumInfo::signedTwoTheta | ( | const size_t | index | ) | const |
Returns the signed scattering angle 2 theta in radians (angle w.r.t.
to beam direction).
Throws an exception if the spectrum is a monitor.
Definition at line 104 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, signedTwoTheta(), and Mantid::Geometry::x.
Referenced by getDetectorValues(), Mantid::Algorithms::CreateDetectorTable::getSphericalCoordinates(), MantidQt::MantidWidgets::ImageInfoModelMatrixWS::info(), Mantid::Algorithms::ConvertAxisByFormula::setGeometryValues(), signedTwoTheta(), signedTwoTheta(), and signedTwoTheta().
| double Mantid::API::SpectrumInfo::signedTwoTheta | ( | const size_t | index, |
| const Kernel::V3D & | observer, | ||
| const Kernel::V3D & | axis | ||
| ) | const |
Returns the average signed angle between the vectors from observer to each detector of the spectrum and axis, signed using the instrument's theta-sign axis (ReferenceFrame::vecThetaSign).
Definition at line 158 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, signedTwoTheta(), and Mantid::Geometry::x.
| double Mantid::API::SpectrumInfo::signedTwoTheta | ( | const size_t | index, |
| const Kernel::V3D & | observer, | ||
| const Kernel::V3D & | axis, | ||
| const Kernel::V3D & | instrumentUp | ||
| ) | const |
Returns the average signed angle between the vectors from observer to each detector of the spectrum 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 145 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, signedTwoTheta(), and Mantid::Geometry::x.
| size_t Mantid::API::SpectrumInfo::size | ( | ) | const |
Returns the size of the SpectrumInfo, i.e., the number of spectra.
Definition at line 43 of file SpectrumInfo.cpp.
References m_spectrumInfo.
Referenced by Mantid::MDAlgorithms::MDNormBase::calculateNormInner(), cend(), checkAndGetSpectrumDefinition(), Mantid::DataHandling::GenerateGroupingPowder::createGroups(), end(), Mantid::Algorithms::CalculatePlaczek::exec(), export_SpectrumInfo(), geographicalAngles(), Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR(), sharedSpectrumDefinitions(), Mantid::Algorithms::CalculatePlaczek::validateInputs(), and Mantid::Algorithms::CalculatePlaczekSelfScattering::validateInputs().
| Kernel::V3D Mantid::API::SpectrumInfo::sourcePosition | ( | ) | const |
Returns the source position.
Definition at line 405 of file SpectrumInfo.cpp.
References m_detectorInfo, and Mantid::Geometry::DetectorInfo::sourcePosition().
Referenced by Mantid::API::TimeAtSampleStrategyElastic::calculate(), Mantid::API::TimeAtSampleStrategyIndirect::calculate(), Mantid::Algorithms::ModeratorTzeroLinear::calculateTfLi(), export_SpectrumInfo(), and Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak().
| const SpectrumDefinition & Mantid::API::SpectrumInfo::spectrumDefinition | ( | const size_t | index | ) | const |
Returns a const reference to the SpectrumDefinition of the spectrum.
Definition at line 48 of file SpectrumInfo.cpp.
References index, m_experimentInfo, m_spectrumInfo, and Mantid::API::ExperimentInfo::updateSpectrumDefinitionIfNecessary().
Referenced by Mantid::Algorithms::AbsorptionCorrection::calculateDistances(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::calculateDistances(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), checkAndGetSpectrumDefinition(), Mantid::DataObjects::MaskWorkspace::combineFromDetectorMasks(), Mantid::DataObjects::MaskWorkspace::combineToDetectorMasks(), Mantid::Algorithms::DetectorEfficiencyCor::correctForEfficiency(), diffractometerConstants(), export_SpectrumInfo(), geographicalAngles(), getDetector(), Mantid::API::TimeAtSampleStrategyIndirect::getEfixed(), Mantid::Algorithms::CorrectKiKf::getEfixedFromParameterMap(), Mantid::Algorithms::ScaleX::getScaleFactor(), Mantid::Algorithms::CreateDetectorTable::getTimeIndexes(), hasDetectors(), hasUniqueDetector(), Mantid::DataObjects::MaskWorkspace::isConsistentWithDetectorMasks(), and Mantid::Algorithms::DetectorDiagnostic::makeMap().
| double Mantid::API::SpectrumInfo::twoTheta | ( | const size_t | index | ) | const |
Returns the scattering angle 2 theta in radians (angle w.r.t.
to beam direction).
Throws an exception if the spectrum is a monitor.
Definition at line 91 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, Mantid::Kernel::twoTheta, and Mantid::Geometry::x.
Referenced by Mantid::Algorithms::AbsorptionCorrection::calculateDistances(), Mantid::Algorithms::PaalmanPingsAbsorptionCorrection::calculateDistances(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::Algorithms::MultipleScatteringCorrection::calculateL2Ds(), Mantid::MDAlgorithms::MDNormBase::calculateNormInner(), Mantid::MDAlgorithms::ConvertToDiffractionMDWorkspace::convertEventList(), Mantid::Algorithms::Q1D2::convertWavetoQ(), Mantid::DataHandling::SaveGSS::generateBankHeader(), Mantid::Algorithms::CreateDetectorTable::getQ(), Mantid::Algorithms::CreateDetectorTable::getSphericalCoordinates(), Mantid::Algorithms::SofQCommon::qBinHintsDirect(), Mantid::DataHandling::GenerateGroupingPowder::saveAsPAR(), Mantid::Algorithms::ConvertAxisByFormula::setGeometryValues(), and Mantid::Crystal::FindSXPeaksHelper::SXPeak::SXPeak().
| double Mantid::API::SpectrumInfo::twoTheta | ( | const size_t | index, |
| const Kernel::V3D & | observer, | ||
| const Kernel::V3D & | axis | ||
| ) | const |
Returns the average angle between the vectors from observer to each detector of the spectrum 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 131 of file SpectrumInfo.cpp.
References checkAndGetSpectrumDefinition(), index, Mantid::Kernel::twoTheta, and Mantid::Geometry::x.
|
friend |
Definition at line 112 of file SpectrumInfo.h.
|
private |
Definition at line 122 of file SpectrumInfo.h.
Referenced by diffractometerConstants(), firstDetectorID(), geographicalAngles(), getDetector(), l1(), phi(), samplePosition(), setMasked(), and sourcePosition().
|
private |
Definition at line 121 of file SpectrumInfo.h.
Referenced by boundingBox(), getDetectorValues(), sharedSpectrumDefinitions(), and spectrumDefinition().
|
mutableprivate |
Definition at line 124 of file SpectrumInfo.h.
Referenced by getDetector().
|
mutableprivate |
Definition at line 125 of file SpectrumInfo.h.
Referenced by getDetector().
|
private |
Definition at line 123 of file SpectrumInfo.h.
Referenced by detectorCount(), sharedSpectrumDefinitions(), size(), and spectrumDefinition().