Mantid
Loading...
Searching...
No Matches
Public Member Functions | Protected Member Functions | Private Member Functions | Private Attributes | List of all members
Mantid::MDAlgorithms::MDWSTransform Class Reference

#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
 

Detailed Description

Definition at line 58 of file MDWSTransform.h.

Constructor & Destructor Documentation

◆ MDWSTransform()

Mantid::MDAlgorithms::MDWSTransform::MDWSTransform ( )

Member Function Documentation

◆ buildQTrahsf()

Kernel::DblMatrix Mantid::MDAlgorithms::MDWSTransform::buildQTrahsf ( MDAlgorithms::MDWSDescription TargWSDescription,
CnvrtToMD::CoordScaling  ScaleID,
bool  UnitUB = false 
) const
protected

◆ checkTargetFrame()

void Mantid::MDAlgorithms::MDWSTransform::checkTargetFrame ( const MDAlgorithms::MDWSDescription TargWSDescription,
const CnvrtToMD::TargetFrame  CoordFrameID 
) const
protected

Method verifies if the information available on the source workspace is sufficient to build appropriate frame.

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

◆ findTargetFrame()

CnvrtToMD::TargetFrame Mantid::MDAlgorithms::MDWSTransform::findTargetFrame ( MDAlgorithms::MDWSDescription TargWSDescription) const
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().

◆ getQScaling() [1/2]

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.

◆ getQScaling() [2/2]

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

◆ getQScalings()

std::vector< std::string > Mantid::MDAlgorithms::MDWSTransform::getQScalings ( ) const
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().

◆ getTargetFrame() [1/2]

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.

◆ getTargetFrame() [2/2]

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

◆ getTargetFrames()

std::vector< std::string > Mantid::MDAlgorithms::MDWSTransform::getTargetFrames ( ) const
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().

◆ getTransfMatrix() [1/2]

std::vector< double > Mantid::MDAlgorithms::MDWSTransform::getTransfMatrix ( MDAlgorithms::MDWSDescription TargWSDescription,
CnvrtToMD::TargetFrame  FrameID,
CnvrtToMD::CoordScaling ScaleID 
) const
protected

◆ getTransfMatrix() [2/2]

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.

Parameters
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
Returns
the linear representation for the transformation matrix, which translate momentums from laboratory to the requested coordinate system.

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

◆ setModQDimensionsNames()

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.

◆ setQ3DDimensionsNames()

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.

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

◆ setUVvectors()

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

◆ v3DIsDefault()

bool Mantid::MDAlgorithms::MDWSTransform::v3DIsDefault ( const std::vector< double > &  vect,
const std::string &  message 
) const
private

check if input vector is defined

Definition at line 383 of file MDWSTransform.cpp.

Referenced by setUVvectors().

Member Data Documentation

◆ m_isUVdefault

bool Mantid::MDAlgorithms::MDWSTransform::m_isUVdefault
private

Definition at line 90 of file MDWSTransform.h.

Referenced by buildQTrahsf(), and setUVvectors().

◆ m_QScalingID

std::vector<std::string> Mantid::MDAlgorithms::MDWSTransform::m_QScalingID
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().

◆ m_TargFramesID

std::vector<std::string> Mantid::MDAlgorithms::MDWSTransform::m_TargFramesID
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().

◆ m_UProj

Kernel::V3D Mantid::MDAlgorithms::MDWSTransform::m_UProj
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().

◆ m_VProj

Kernel::V3D Mantid::MDAlgorithms::MDWSTransform::m_VProj
private

Definition at line 96 of file MDWSTransform.h.

Referenced by buildQTrahsf(), MDWSTransform(), setQ3DDimensionsNames(), and setUVvectors().

◆ m_WProj

Kernel::V3D Mantid::MDAlgorithms::MDWSTransform::m_WProj
private

Definition at line 96 of file MDWSTransform.h.

Referenced by buildQTrahsf(), MDWSTransform(), setQ3DDimensionsNames(), and setUVvectors().


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