Mantid
Loading...
Searching...
No Matches
MDWSTransform.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2011 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
11
12namespace Mantid {
13namespace MDAlgorithms {
14/*** The class responsible for building Momentums Transformation Matrix for
15 CnvrtToMD algorithm
16 * from the input parameters of the algorithm and parameters, retrieved from
17 input and
18 * (if availible) output MD workspace
19 *
20 * The parameters are mainly related to MDTransfQ3D though are partially
21 applicable to MDTransfModQ (scaling)
22 * They are fully igonred for MDTransfNoQ which copies its data to
23 MDworkspace and completely ignores
24 * the transformation matrix, defined by this class
25
26 @date 2012-03-20
27*/
28namespace CnvrtToMD {
31 NoScaling, //< momentums in A^-1
32 SingleScale, //< momentuns divided by 2*Pi/Lattice -- equivalend to d-spacing
33 // in some sence
34 OrthogonalHKLScale, //< each momentum component divided by appropriate lattice
35 // parameter; equivalent to hkl for reclenear lattice
36 HKLScale, //< non-orthogonal system for non-reclenear lattice
38};
41 LabFrame, //< * '''Q (lab frame)''': this calculates the momentum transfer
42 //(ki-kf) for each event is calculated in the experimental lab
43 // frame.
44 SampleFrame, //< * '''Q (sample frame)''': the goniometer rotation of the
45 // sample is taken out, to give Q in the frame of the sample. See
46 //[[SetGoniometer]] to specify the goniometer used in the
47 // experiment.
48 HKLFrame, //<* '''HKL''': uses the UB matrix (see [[SetUB]],
49 //[[FindUBUsingFFT]] and others) to calculate the HKL Miller indices
50 // of each event.
51 AutoSelect, //<* This tries to select one of above by analyzing the
52 // goniometer and UB matrix parameters on the workspace and tries
53 // to establish what coordinate system is actually defined/needed.
55};
56} // namespace CnvrtToMD
57
58class MANTID_MDALGORITHMS_DLL MDWSTransform {
59public:
61
66 void setUVvectors(const std::vector<double> &ut, const std::vector<double> &vt, const std::vector<double> &wt);
67
68 std::vector<double> getTransfMatrix(MDAlgorithms::MDWSDescription &TargWSDescription,
69 const std::string &FrameRequested, const std::string &QScaleRequested) const;
70
73 void setQ3DDimensionsNames(MDAlgorithms::MDWSDescription &TargWSDescription, CnvrtToMD::TargetFrame FrameID,
74 CnvrtToMD::CoordScaling ScaleID) const;
77 void setModQDimensionsNames(MDAlgorithms::MDWSDescription &TargWSDescription,
78 const std::string &QScaleRequested) const;
80 std::vector<std::string> getQScalings() const { return m_QScalingID; }
81 CnvrtToMD::CoordScaling getQScaling(const std::string &ScID) const;
82 std::string getQScaling(const CnvrtToMD::CoordScaling ScaleID) const;
84 std::vector<std::string> getTargetFrames() const { return m_TargFramesID; }
86 CnvrtToMD::TargetFrame getTargetFrame(const std::string &FrameID) const;
87 std::string getTargetFrame(const CnvrtToMD::TargetFrame FrameID) const;
88
89private:
96 mutable Kernel::V3D m_UProj, m_VProj, m_WProj;
97
99 std::vector<std::string> m_QScalingID;
101 std::vector<std::string> m_TargFramesID;
102 bool v3DIsDefault(const std::vector<double> &vect, const std::string &message) const;
103
104protected: // for testing
107 Kernel::DblMatrix buildQTrahsf(MDAlgorithms::MDWSDescription &TargWSDescription, CnvrtToMD::CoordScaling ScaleID,
108 bool UnitUB = false) const;
111 // std::vector<Kernel::V3D> buildOrtho3D(const Kernel::DblMatrix &BM,const
112 // Kernel::V3D &u, const Kernel::V3D &v)const;
113
114 std::vector<double> getTransfMatrix(MDAlgorithms::MDWSDescription &TargWSDescription, CnvrtToMD::TargetFrame FrameID,
115 CnvrtToMD::CoordScaling &ScaleID) const;
116
117 CnvrtToMD::TargetFrame findTargetFrame(MDAlgorithms::MDWSDescription &TargWSDescription) const;
118 // helper function which verifies, if the input information availble on the
119 // workspace consistent with the frame requiested
120 void checkTargetFrame(const MDAlgorithms::MDWSDescription &TargWSDescription,
121 const CnvrtToMD::TargetFrame CoordFrameID) const;
122};
123} // namespace MDAlgorithms
124} // namespace Mantid
Class for 3D vectors.
Definition: V3D.h:34
helper class describes the properties of target MD workspace, which should be obtained as the result ...
std::vector< std::string > getTargetFrames() const
returns the list of possible target frames to convert to
Definition: MDWSTransform.h:84
Kernel::V3D m_UProj
vectors, which describe the projection plain the target ws is based on (notional or cryst cartezian c...
Definition: MDWSTransform.h:96
std::vector< std::string > getQScalings() const
return the list of possible scalings for momentums
Definition: MDWSTransform.h:80
std::vector< std::string > m_QScalingID
string representation of QScaling ID, which would be known to user
Definition: MDWSTransform.h:99
std::vector< std::string > m_TargFramesID
string representation of Target frames, which would be exposed to user;
TargetFrame
enum describes availible target coordinate systems for Q3D mode
Definition: MDWSTransform.h:40
CoordScaling
enum descrines availble momentum scalings, interpreted by this class
Definition: MDWSTransform.h:30
Helper class which provides the Collimation Length for SANS instruments.