|
Mantid
|
Class responsible for conversion of input workspace data into proper number of output dimensions for ModQ case. More...
#include <MDTransfModQ.h>
Public Member Functions | |
| bool | calcGenericVariables (std::vector< coord_t > &Coord, size_t nd) override |
| Method fills-in all additional properties requested by user and not defined by matrix workspace itself. | |
| bool | calcMatrixCoord (const double &deltaEOrK0, std::vector< coord_t > &Coord, double &signal, double &ErrSq) const override |
| Convert single point of matrix workspace into reciprocal space and (optionally) modify signal and error as function of reciprocal space (e.g. | |
| bool | calcYDepCoordinates (std::vector< coord_t > &Coord, size_t i) override |
| Method updates the value of pre-processed detector coordinates in Q-space, used by other functions. | |
| MDTransfInterface * | clone () const override |
| std::vector< std::string > | getDefaultDimID (Kernel::DeltaEMode::Type dEmode, API::MatrixWorkspace_const_sptr inWS=API::MatrixWorkspace_const_sptr()) const override |
| the default dimID-s in ModQ mode are |Q| and dE if necessary | |
| std::vector< std::string > | getEmodes () const override |
| energy conversion modes supported by this class; The class supports three standard energy conversion modes | |
| std::vector< double > | getExtremumPoints (const double eMin, const double eMax, size_t det_num) const override |
| method returns the vector of input coordinates values where the transformed coordinates reach its extremum values in Q or dE direction. | |
| unsigned int | getNMatrixDimensions (Kernel::DeltaEMode::Type mode, API::MatrixWorkspace_const_sptr inWS=API::MatrixWorkspace_const_sptr()) const override |
| return the number of dimensions, calculated by the transformation from the workspace. | |
| void | initialize (const MDWSDescription &ConvParams) override |
| function initializes all variables necessary for converting workspace variables into MD variables in ModQ (elastic/inelastic) cases | |
| const std::string | inputUnitID (Kernel::DeltaEMode::Type dEmode, API::MatrixWorkspace_const_sptr inWS=API::MatrixWorkspace_const_sptr()) const override |
| returns the units, the transformation expects for input workspace to be expressed in. | |
| MDTransfModQ () | |
| constructor; | |
| std::vector< std::string > | outputUnitID (Kernel::DeltaEMode::Type dEmode, API::MatrixWorkspace_const_sptr inWS=API::MatrixWorkspace_const_sptr()) const override |
| function returns units ID-s which this transformation prodiuces its ouptut. | |
| void | setDisplayNormalization (Mantid::API::IMDWorkspace_sptr mdWorkspace, Mantid::API::MatrixWorkspace_sptr underlyingWorkspace) const override |
| Set the display normalization for Q. | |
| const std::string | transfID () const override |
| the name, this ChildAlgorithm is known to users (will appear in selection list) | |
Public Member Functions inherited from Mantid::MDAlgorithms::MDTransfInterface | |
| virtual bool | calcMatrixCoordinates (const MantidVec &X, size_t i, size_t j, std::vector< coord_t > &Coord, double &s, double &err) const |
| Calculate all remaining coordinates, defined within the inner loop. | |
| virtual | ~MDTransfInterface ()=default |
Protected Attributes | |
| std::vector< coord_t > | m_AddDimCoordinates |
| the vector of the additional coordinates which define additional MD dimensions. | |
| Kernel::V3D const * | m_DetDirecton |
| std::vector< double > | m_DimMax |
| std::vector< double > | m_DimMin |
| double | m_eFixed |
| Kernel::DeltaEMode::Type | m_Emode |
| double | m_ex |
| double | m_ey |
| double | m_ez |
| double | m_kFixed |
| unsigned int | m_NMatrixDim |
| int * | m_pDetMasks |
| float * | m_pEfixedArray |
| std::vector< double > | m_RotMat |
Private Member Functions | |
| bool | calcMatrixCoordElastic (const double &k0, std::vector< coord_t > &Coord) const |
| how to transform workspace data in elastic case | |
| bool | calcMatrixCoordInelastic (const double &deltaE, std::vector< coord_t > &Coord) const |
| how to transform workspace data in inelastic case | |
Class responsible for conversion of input workspace data into proper number of output dimensions for ModQ case.
The detailed description of the algorithm is provided at dev-docs/source/WritingCustomConvertToMDTransformation.rst.
Currently contains Elastic and Inelastic transformations
This particular file defines specializations of generic coordinate transformation to the ModQ case
Definition at line 27 of file MDTransfModQ.h.
| Mantid::MDAlgorithms::MDTransfModQ::MDTransfModQ | ( | ) |
constructor;
Definition at line 385 of file MDTransfModQ.cpp.
|
overridevirtual |
Method fills-in all additional properties requested by user and not defined by matrix workspace itself.
it fills in [nd - (1 or 2 – depending on emode)] values into Coord vector;
| Coord | – input-output vector of MD-coordinates |
| nd | – number of current dimensions |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Definition at line 97 of file MDTransfModQ.cpp.
References m_AddDimCoordinates, m_DimMax, m_DimMin, m_NMatrixDim, and std::to_string().
|
overridevirtual |
Convert single point of matrix workspace into reciprocal space and (optionally) modify signal and error as function of reciprocal space (e.g.
Lorents corrections)
| deltaEOrK0 | – In elastic the modulus of K0, in inelastic the energy transfer |
| Coord | – converted MD coordinates of the point x calculated for particular workspace position (detector) |
| signal | – the signal in the point |
| ErrSq | – the signal in the point No signal or error transformation is performed by this particular method. |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
Definition at line 76 of file MDTransfModQ.cpp.
References calcMatrixCoordElastic(), calcMatrixCoordInelastic(), Mantid::Kernel::DeltaEMode::Elastic, m_Emode, and UNUSED_ARG.
|
inlineprivate |
how to transform workspace data in elastic case
function calculates workspace-dependent coordinates in elastic case.
Namely, it calculates module of Momentum transfer put it into specified (0) position in the Coord vector
| k0 | module of input momentum |
| &Coord | vector of MD coordinates with filled in momentum and energy transfer |
it uses preprocessed detectors positions, which are calculated by PreprocessDetectors algorithm and set up by calcYDepCoordinates(std::vector<coord_t> &Coord,size_t i) method.
Definition at line 207 of file MDTransfModQ.cpp.
References m_DimMax, m_DimMin, m_ex, m_ey, m_ez, and m_RotMat.
Referenced by calcMatrixCoord().
|
inlineprivate |
how to transform workspace data in inelastic case
function calculates workspace-dependent coordinates in inelastic case.
Namely, it calculates module of Momentum transfer and the Energy transfer and put them into initial positions (0 and 1) in the Coord vector
| deltaE | input energy transfer |
| &Coord | vector of MD coordinates with filled in momentum and energy transfer |
it also uses preprocessed detectors positions, which are calculated by PreprocessDetectors algorithm and set up by calcYDepCoordinates(std::vector<coord_t> &Coord,size_t i) method.
Definition at line 161 of file MDTransfModQ.cpp.
References Mantid::Kernel::DeltaEMode::Direct, Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, m_DimMax, m_DimMin, m_eFixed, m_Emode, m_ex, m_ey, m_ez, m_kFixed, and m_RotMat.
Referenced by calcMatrixCoord().
|
overridevirtual |
Method updates the value of pre-processed detector coordinates in Q-space, used by other functions.
| Coord | |
| i | – index of the detector, which corresponds to the spectra to process. |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
Definition at line 128 of file MDTransfModQ.cpp.
References Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, m_DetDirecton, m_eFixed, m_ex, m_ey, m_ez, m_kFixed, m_pDetMasks, m_pEfixedArray, UNUSED_ARG, Mantid::Geometry::X, Mantid::Geometry::Y, and Mantid::Geometry::Z.
|
inlineoverridevirtual |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
Definition at line 43 of file MDTransfModQ.h.
|
overridevirtual |
the default dimID-s in ModQ mode are |Q| and dE if necessary
method returns default ID-s for ModQ elastic and inelastic modes.
The ID-s are related to the units, this class produces its output in.
| dEmode | – energy conversion mode |
| inWS | – Input Matrix workspace |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
Definition at line 341 of file MDTransfModQ.cpp.
References Mantid::Kernel::DeltaEMode::Direct, Mantid::Kernel::DeltaEMode::Elastic, Mantid::Kernel::DeltaEMode::Indirect, and UNUSED_ARG.
Referenced by outputUnitID().
|
overridevirtual |
energy conversion modes supported by this class; The class supports three standard energy conversion modes
Reimplemented from Mantid::MDAlgorithms::MDTransfInterface.
Definition at line 391 of file MDTransfModQ.cpp.
References Mantid::Kernel::DeltaEMode::availableTypes().
|
overridevirtual |
method returns the vector of input coordinates values where the transformed coordinates reach its extremum values in Q or dE direction.
| eMin | – minimal momentum (in elastic mode) or energy transfer (in inelastic) for the transformation |
| eMax | – maximal momentum (in elastic mode) or energy transfer (in inelastic) for the transformation |
| det_num | – number of the instrument detector for the transformation |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
Definition at line 234 of file MDTransfModQ.cpp.
References Mantid::Kernel::DeltaEMode::Direct, Mantid::Kernel::DeltaEMode::Elastic, Mantid::Kernel::DeltaEMode::Indirect, m_DetDirecton, m_eFixed, m_Emode, m_pEfixedArray, and Mantid::Geometry::Z.
|
overridevirtual |
return the number of dimensions, calculated by the transformation from the workspace.
method returns number of matrix dimensions calculated by this class as function of the energy analysis (conversion) mode
Depending on EMode, this numebr here is either 1 or 2 and do not depend on input workspace
| mode | – energy conversion mode requested by the user for the transformation |
| inWS | – input matrix workspace, the subject of transformation. |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
Definition at line 46 of file MDTransfModQ.cpp.
References Mantid::Kernel::DeltaEMode::Direct, Mantid::Kernel::DeltaEMode::Elastic, Mantid::Kernel::DeltaEMode::Indirect, and UNUSED_ARG.
Referenced by initialize().
|
overridevirtual |
function initializes all variables necessary for converting workspace variables into MD variables in ModQ (elastic/inelastic) cases
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
Definition at line 270 of file MDTransfModQ.cpp.
References Mantid::Kernel::DeltaEMode::Direct, Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, Mantid::Kernel::DeltaEMode::Elastic, Mantid::MDAlgorithms::MDWSDescription::getAddCoord(), Mantid::MDAlgorithms::MDWSDescription::getEMode(), Mantid::MDAlgorithms::MDWSDescription::getMinMax(), getNMatrixDimensions(), Mantid::MDAlgorithms::MDWSDescription::getTransfMatrix(), Mantid::Kernel::DeltaEMode::Indirect, m_AddDimCoordinates, m_DetDirecton, m_DimMax, m_DimMin, m_eFixed, m_Emode, m_kFixed, m_NMatrixDim, m_pDetMasks, m_pEfixedArray, Mantid::MDAlgorithms::MDWSDescription::m_PreprDetTable, and m_RotMat.
|
overridevirtual |
returns the units, the transformation expects for input workspace to be expressed in.
method calculates the units, the transformation expects the input ws to be in.
If the input ws is in different units, the WS data will be converted into the requested units on the fly.
| dEmode | – energy conversion mode requested by the user for the transformation |
| inWS | – input matrix workspace, the subject of transformation. |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Definition at line 23 of file MDTransfModQ.cpp.
References Mantid::Kernel::DeltaEMode::Direct, Mantid::Kernel::DeltaEMode::Elastic, Mantid::Kernel::DeltaEMode::Indirect, and UNUSED_ARG.
|
overridevirtual |
function returns units ID-s which this transformation prodiuces its ouptut.
function returns units ID-s which this transformation produces its output.
It is Momentum and Momentum and DelteE in inelastic modes
| dEmode | – energy conversion mode |
| inWS | – Input Matrix workspace |
It is Momentum and DelteE in inelastic modes
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
Definition at line 369 of file MDTransfModQ.cpp.
References Mantid::Kernel::DeltaEMode::Elastic, getDefaultDimID(), and UNUSED_ARG.
|
overridevirtual |
Set the display normalization for Q.
| mdWorkspace | the md workspace |
| underlyingWorkspace | the underlying workspace |
Implements Mantid::MDAlgorithms::MDTransfInterface.
Definition at line 398 of file MDTransfModQ.cpp.
References m_Emode.
|
overridevirtual |
the name, this ChildAlgorithm is known to users (will appear in selection list)
Implements Mantid::MDAlgorithms::MDTransfInterface.
Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.
|
protected |
the vector of the additional coordinates which define additional MD dimensions.
For implemented ModQ case, these dimensions do not depend on matrix coordinates and are determined by WS properties
Definition at line 97 of file MDTransfModQ.h.
Referenced by calcGenericVariables(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 86 of file MDTransfModQ.h.
Referenced by calcYDepCoordinates(), Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates(), getExtremumPoints(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 83 of file MDTransfModQ.h.
Referenced by calcGenericVariables(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DElastic(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordElastic(), calcMatrixCoordInelastic(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 83 of file MDTransfModQ.h.
Referenced by calcGenericVariables(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DElastic(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordElastic(), calcMatrixCoordInelastic(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 103 of file MDTransfModQ.h.
Referenced by Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordInelastic(), calcYDepCoordinates(), Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates(), getExtremumPoints(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 92 of file MDTransfModQ.h.
Referenced by Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord(), calcMatrixCoord(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordInelastic(), getExtremumPoints(), initialize(), Mantid::MDAlgorithms::MDTransfQ3D::initialize(), and setDisplayNormalization().
|
protected |
Definition at line 78 of file MDTransfModQ.h.
Referenced by Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DElastic(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordElastic(), calcMatrixCoordInelastic(), calcYDepCoordinates(), and Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates().
|
protected |
Definition at line 78 of file MDTransfModQ.h.
Referenced by Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DElastic(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordElastic(), calcMatrixCoordInelastic(), calcYDepCoordinates(), and Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates().
|
protected |
Definition at line 78 of file MDTransfModQ.h.
Referenced by Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DElastic(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordElastic(), calcMatrixCoordInelastic(), calcYDepCoordinates(), and Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates().
|
protected |
Definition at line 101 of file MDTransfModQ.h.
Referenced by Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordInelastic(), calcYDepCoordinates(), Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 90 of file MDTransfModQ.h.
Referenced by calcGenericVariables(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 110 of file MDTransfModQ.h.
Referenced by calcYDepCoordinates(), Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 106 of file MDTransfModQ.h.
Referenced by calcYDepCoordinates(), Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates(), getExtremumPoints(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 81 of file MDTransfModQ.h.
Referenced by Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DElastic(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordElastic(), calcMatrixCoordInelastic(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().