Mantid
|
#include <MDWSTransform.h>
Public Member Functions | |
std::string | getQScaling (const CnvrtToMD::CoordScaling ScaleID) const |
Method to convert enum describing target scaling to its string representation. More... | |
CnvrtToMD::CoordScaling | getQScaling (const std::string &ScID) const |
function which convert input string representing coordinate scaling to correspondent enum More... | |
std::vector< std::string > | getQScalings () const |
return the list of possible scalings for momentums More... | |
std::string | getTargetFrame (const CnvrtToMD::TargetFrame FrameID) const |
Method to convert enum describing target coordinate frame to its string representation. More... | |
CnvrtToMD::TargetFrame | getTargetFrame (const std::string &FrameID) const |
converts the target frame string representation into the frame ID More... | |
std::vector< std::string > | getTargetFrames () const |
returns the list of possible target frames to convert to More... | |
std::vector< double > | getTransfMatrix (MDAlgorithms::MDWSDescription &TargWSDescription, const std::string &FrameRequested, const std::string &QScaleRequested) const |
method to build the Q-coordinates transformation. More... | |
MDWSTransform () | |
void | setModQDimensionsNames (MDAlgorithms::MDWSDescription &TargWSDescription, const std::string &QScaleRequested) const |
construct meaningful dimension names for ModQ case and different transformation types defined by the class; More... | |
void | setQ3DDimensionsNames (MDAlgorithms::MDWSDescription &TargWSDescription, CnvrtToMD::TargetFrame FrameID, CnvrtToMD::CoordScaling ScaleID) const |
construct meaningful dimension names for Q3D case and different transformation types defined by the class More... | |
void | setUVvectors (const std::vector< double > &ut, const std::vector< double > &vt, const std::vector< double > &wt) |
helper function which verifies if projection vectors are specified and if their values are correct when present. More... | |
Protected Member Functions | |
Kernel::DblMatrix | buildQTrahsf (MDAlgorithms::MDWSDescription &TargWSDescription, CnvrtToMD::CoordScaling ScaleID, bool UnitUB=false) const |
function generates "Kind of" W transformation matrix for different Q-conversion modes; More... | |
void | checkTargetFrame (const MDAlgorithms::MDWSDescription &TargWSDescription, const CnvrtToMD::TargetFrame CoordFrameID) const |
Method verifies if the information available on the source workspace is sufficient to build appropriate frame. More... | |
CnvrtToMD::TargetFrame | findTargetFrame (MDAlgorithms::MDWSDescription &TargWSDescription) const |
Method analyzes the state of UB matrix and goniometer attached to the workspace and decides, which target coordinate system these variables identify. More... | |
std::vector< double > | getTransfMatrix (MDAlgorithms::MDWSDescription &TargWSDescription, CnvrtToMD::TargetFrame FrameID, CnvrtToMD::CoordScaling &ScaleID) const |
build orthogonal coordinate around two input vecotors u and v expressed in rlu; More... | |
Private Member Functions | |
bool | v3DIsDefault (const std::vector< double > &vect, const std::string &message) const |
check if input vector is defined More... | |
Private Attributes | |
bool | m_isUVdefault |
std::vector< std::string > | m_QScalingID |
string representation of QScaling ID, which would be known to user More... | |
std::vector< std::string > | m_TargFramesID |
string representation of Target frames, which would be exposed to user; More... | |
Kernel::V3D | m_UProj |
vectors, which describe the projection plain the target ws is based on (notional or cryst cartezian coordinate system). More... | |
Kernel::V3D | m_VProj |
Kernel::V3D | m_WProj |
Definition at line 58 of file MDWSTransform.h.
Mantid::MDAlgorithms::MDWSTransform::MDWSTransform | ( | ) |
Definition at line 468 of file MDWSTransform.cpp.
References Mantid::MDAlgorithms::CnvrtToMD::AutoSelect, Mantid::MDAlgorithms::CnvrtToMD::HKLFrame, Mantid::MDAlgorithms::CnvrtToMD::HKLScale, Mantid::MDAlgorithms::CnvrtToMD::LabFrame, m_QScalingID, m_TargFramesID, m_UProj, m_VProj, m_WProj, Mantid::MDAlgorithms::CnvrtToMD::NoScaling, Mantid::MDAlgorithms::CnvrtToMD::OrthogonalHKLScale, Mantid::MDAlgorithms::CnvrtToMD::SampleFrame, and Mantid::MDAlgorithms::CnvrtToMD::SingleScale.
|
protected |
function generates "Kind of" W transformation matrix for different Q-conversion modes;
Method builds transformation Q=R*U*B*W*h where W-transf is W or WB or W*Unit*Lattice_param depending on inputs.
Definition at line 185 of file MDWSTransform.cpp.
References Mantid::API::LogManager::addProperty(), Mantid::MDAlgorithms::MDWSDescription::getLattice(), Mantid::Kernel::Matrix< T >::getVector(), Mantid::MDAlgorithms::MDWSDescription::hasLattice(), Mantid::MDAlgorithms::CnvrtToMD::HKLScale, m_isUVdefault, m_UProj, m_VProj, m_WProj, Mantid::Kernel::V3D::makeVectorsOrthogonal(), Mantid::MDAlgorithms::CnvrtToMD::NoScaling, Mantid::MDAlgorithms::CnvrtToMD::OrthogonalHKLScale, and Mantid::MDAlgorithms::CnvrtToMD::SingleScale.
Referenced by getTransfMatrix().
|
protected |
Method verifies if the information available on the source workspace is sufficient to build appropriate frame.
TargWSDescription | – the class which contains the information about the target workspace |
CoordFrameID | – the ID of the target frame requested |
method throws invalid argument if the information on the workspace is insufficient to define the frame requested
Definition at line 95 of file MDWSTransform.cpp.
References Mantid::MDAlgorithms::MDWSDescription::hasGoniometer(), Mantid::MDAlgorithms::MDWSDescription::hasLattice(), Mantid::MDAlgorithms::CnvrtToMD::HKLFrame, Mantid::MDAlgorithms::CnvrtToMD::LabFrame, and Mantid::MDAlgorithms::CnvrtToMD::SampleFrame.
Referenced by getTransfMatrix().
|
protected |
Method analyzes the state of UB matrix and goniometer attached to the workspace and decides, which target coordinate system these variables identify.
Crystal Frame decided in case if there is UB matrix is present and is not unit matrix Lab frame – if goniometer is Unit and UB is unit matrix or not present Sample frame – otherwise
Definition at line 72 of file MDWSTransform.cpp.
References Mantid::MDAlgorithms::MDWSDescription::hasGoniometer(), Mantid::MDAlgorithms::MDWSDescription::hasLattice(), Mantid::MDAlgorithms::CnvrtToMD::HKLFrame, Mantid::MDAlgorithms::CnvrtToMD::LabFrame, and Mantid::MDAlgorithms::CnvrtToMD::SampleFrame.
Referenced by getTransfMatrix(), and setQ3DDimensionsNames().
std::string Mantid::MDAlgorithms::MDWSTransform::getQScaling | ( | const CnvrtToMD::CoordScaling | ScaleID | ) | const |
Method to convert enum describing target scaling to its string representation.
Definition at line 449 of file MDWSTransform.cpp.
References m_QScalingID.
CoordScaling Mantid::MDAlgorithms::MDWSTransform::getQScaling | ( | const std::string & | ScID | ) | const |
function which convert input string representing coordinate scaling to correspondent enum
Definition at line 439 of file MDWSTransform.cpp.
References Mantid::Kernel::Strings::isMember(), and m_QScalingID.
Referenced by Mantid::MDAlgorithms::BaseConvertToDiffractionMDWorkspace::convertFramePropertyNames(), and getTransfMatrix().
|
inline |
return the list of possible scalings for momentums
Definition at line 80 of file MDWSTransform.h.
Referenced by Mantid::MDAlgorithms::ConvertToMD::exec(), and Mantid::MDAlgorithms::ConvertToMDParent::init().
std::string Mantid::MDAlgorithms::MDWSTransform::getTargetFrame | ( | const CnvrtToMD::TargetFrame | FrameID | ) | const |
Method to convert enum describing target coordinate frame to its string representation.
Definition at line 463 of file MDWSTransform.cpp.
References m_TargFramesID.
TargetFrame Mantid::MDAlgorithms::MDWSTransform::getTargetFrame | ( | const std::string & | FrameID | ) | const |
converts the target frame string representation into the frame ID
function which convert input string representing Target coordinate frame to correspondent enum
Definition at line 453 of file MDWSTransform.cpp.
References Mantid::Kernel::Strings::isMember(), and m_TargFramesID.
Referenced by Mantid::MDAlgorithms::BaseConvertToDiffractionMDWorkspace::convertFramePropertyNames(), and getTransfMatrix().
|
inline |
returns the list of possible target frames to convert to
Definition at line 84 of file MDWSTransform.h.
Referenced by Mantid::MDAlgorithms::ConvertToMD::exec(), and Mantid::MDAlgorithms::ConvertToMDParent::init().
|
protected |
build orthogonal coordinate around two input vecotors u and v expressed in rlu;
The matrix to convert neutron momentums into the target coordinate system.
Definition at line 117 of file MDWSTransform.cpp.
References Mantid::MDAlgorithms::CnvrtToMD::AutoSelect, buildQTrahsf(), checkTargetFrame(), findTargetFrame(), Mantid::MDAlgorithms::MDWSDescription::getGoniometerMatr(), Mantid::Kernel::Matrix< T >::getVector(), Mantid::MDAlgorithms::MDWSDescription::getWSName(), Mantid::MDAlgorithms::MDWSDescription::hasGoniometer(), Mantid::MDAlgorithms::MDWSDescription::hasLattice(), Mantid::MDAlgorithms::CnvrtToMD::HKLFrame, Mantid::Kernel::Matrix< T >::Invert(), Mantid::MDAlgorithms::MDWSDescription::isPowder(), Mantid::MDAlgorithms::CnvrtToMD::LabFrame, Mantid::MDAlgorithms::MDWSDescription::m_Wtransf, Mantid::MDAlgorithms::CnvrtToMD::NoScaling, and Mantid::MDAlgorithms::CnvrtToMD::SampleFrame.
std::vector< double > Mantid::MDAlgorithms::MDWSTransform::getTransfMatrix | ( | MDAlgorithms::MDWSDescription & | TargWSDescription, |
const std::string & | FrameRequested, | ||
const std::string & | QScaleRequested | ||
) | const |
method to build the Q-coordinates transformation.
TargWSDescription | – the class which describes target MD workspace. In Q3D case this description is modified by the method with default Q-axis labels and Q-axis units |
FrameRequested | – the string which describes the target transformation frame in Q3D case. If the string value is '''Auto''' the frame is selected depending on the presence of UB matrix and goniometer settings, namely it can be: a) the laboratory – (no UB matrix, goniometer angles set to 0) b) Q (sample frame)''': the goniometer rotation of the sample is taken out, to give Q in the frame of the sample. See [[SetGoniometer]] to specify the goniometer used in the experiment. c) Crystal or crystal Cartesian (C)- Busing, Levi 1967 coordinate system – depending on Q-scale requested one of the target frames above can be requested explicitly. In this case the method throws invalid argument if necessary parameters (UB matrix) is not attached to the workspace |
QScaleRequested | – Q-transformation needed |
Definition at line 51 of file MDWSTransform.cpp.
References getQScaling(), getTargetFrame(), getTransfMatrix(), Mantid::MDAlgorithms::MDWSDescription::isQ3DMode(), and setQ3DDimensionsNames().
Referenced by Mantid::MDAlgorithms::ConvertToMD::buildTargetWSDescription(), Mantid::MDAlgorithms::ConvertToMDMinMaxLocal::exec(), and getTransfMatrix().
void Mantid::MDAlgorithms::MDWSTransform::setModQDimensionsNames | ( | MDAlgorithms::MDWSDescription & | TargWSDescription, |
const std::string & | QScaleRequested | ||
) | const |
construct meaningful dimension names for ModQ case and different transformation types defined by the class;
Definition at line 373 of file MDWSTransform.cpp.
References UNUSED_ARG.
void Mantid::MDAlgorithms::MDWSTransform::setQ3DDimensionsNames | ( | MDAlgorithms::MDWSDescription & | TargWSDescription, |
CnvrtToMD::TargetFrame | FrameID, | ||
CnvrtToMD::CoordScaling | ScaleID | ||
) | const |
construct meaningful dimension names for Q3D case and different transformation types defined by the class
Build meaningful dimension names for different conversion modes.
TargWSDescription | the class-container to keep the dimension names and dimension unints |
FrameID | – the ID describing the target transformation frame (lab, sample, hkl) |
ScaleID | – the scale ID which define how the dimensions are scaled |
Definition at line 277 of file MDWSTransform.cpp.
References Mantid::MDAlgorithms::CnvrtToMD::AutoSelect, findTargetFrame(), Mantid::MDAlgorithms::MDWSDescription::getDimNames(), Mantid::MDAlgorithms::MDWSDescription::getLattice(), Mantid::MDAlgorithms::MDWSDescription::hasLattice(), Mantid::Kernel::HKL, Mantid::MDAlgorithms::CnvrtToMD::HKLFrame, Mantid::Geometry::HKL::HKLName, Mantid::MDAlgorithms::CnvrtToMD::HKLScale, Mantid::MDAlgorithms::CnvrtToMD::LabFrame, m_UProj, m_VProj, m_WProj, Mantid::MDAlgorithms::makeAxisName(), Mantid::Kernel::V3D::makeVectorsOrthogonal(), Mantid::MDAlgorithms::CnvrtToMD::NoScaling, Mantid::MDAlgorithms::CnvrtToMD::OrthogonalHKLScale, Mantid::Kernel::QLab, Mantid::Geometry::QLab::QLabName, Mantid::Kernel::QSample, Mantid::Geometry::QSample::QSampleName, Mantid::MDAlgorithms::CnvrtToMD::SampleFrame, Mantid::MDAlgorithms::MDWSDescription::setCoordinateSystem(), Mantid::MDAlgorithms::MDWSDescription::setDimName(), Mantid::MDAlgorithms::MDWSDescription::setDimUnit(), Mantid::MDAlgorithms::MDWSDescription::setFrame(), Mantid::MDAlgorithms::CnvrtToMD::SingleScale, Mantid::MDAlgorithms::sprintfd(), and Mantid::Geometry::x.
Referenced by getTransfMatrix().
void Mantid::MDAlgorithms::MDWSTransform::setUVvectors | ( | const std::vector< double > & | ut, |
const std::vector< double > & | vt, | ||
const std::vector< double > & | wt | ||
) |
helper function which verifies if projection vectors are specified and if their values are correct when present.
sets default values u and v to [1,0,0] and [0,1,0] if not present or any error.
Definition at line 396 of file MDWSTransform.cpp.
References Mantid::Kernel::V3D::cross_prod(), fabs, m_isUVdefault, m_UProj, m_VProj, m_WProj, Mantid::Kernel::Tolerance, and v3DIsDefault().
Referenced by Mantid::MDAlgorithms::ConvertToMD::buildTargetWSDescription(), and Mantid::MDAlgorithms::ConvertToMDMinMaxLocal::exec().
|
private |
check if input vector is defined
Definition at line 383 of file MDWSTransform.cpp.
Referenced by setUVvectors().
|
private |
Definition at line 90 of file MDWSTransform.h.
Referenced by buildQTrahsf(), and setUVvectors().
|
private |
string representation of QScaling ID, which would be known to user
Definition at line 99 of file MDWSTransform.h.
Referenced by getQScaling(), and MDWSTransform().
|
private |
string representation of Target frames, which would be exposed to user;
Definition at line 101 of file MDWSTransform.h.
Referenced by getTargetFrame(), and MDWSTransform().
|
mutableprivate |
vectors, which describe the projection plain the target ws is based on (notional or cryst cartezian coordinate system).
The transformation matrix below should bring the momentums from lab coordinate system into orthogonal, related to u,v vectors, coordinate system
Definition at line 96 of file MDWSTransform.h.
Referenced by buildQTrahsf(), MDWSTransform(), setQ3DDimensionsNames(), and setUVvectors().
|
private |
Definition at line 96 of file MDWSTransform.h.
Referenced by buildQTrahsf(), MDWSTransform(), setQ3DDimensionsNames(), and setUVvectors().
|
private |
Definition at line 96 of file MDWSTransform.h.
Referenced by buildQTrahsf(), MDWSTransform(), setQ3DDimensionsNames(), and setUVvectors().