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. More... | |
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. More... | |
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. More... | |
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 More... | |
std::vector< std::string > | getEmodes () const override |
energy conversion modes supported by this class; The class supports three standard energy conversion modes More... | |
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. More... | |
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. More... | |
void | initialize (const MDWSDescription &ConvParams) override |
function initializes all variables necessary for converting workspace variables into MD variables in ModQ (elastic/inelastic) cases More... | |
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. More... | |
MDTransfModQ () | |
constructor; More... | |
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. More... | |
void | setDisplayNormalization (Mantid::API::IMDWorkspace_sptr mdWorkspace, Mantid::API::MatrixWorkspace_sptr underlyingWorkspace) const override |
Set the display normalization for Q. More... | |
const std::string | transfID () const override |
the name, this ChildAlgorithm is known to users (will appear in selection list) More... | |
Public Member Functions inherited from Mantid::MDAlgorithms::MDTransfInterface | |
virtual bool | calcGenericVariables (std::vector< coord_t > &Coord, size_t n_ws_variabes)=0 |
Method deployed out of the loop and calculates all variables needed within the loop. More... | |
virtual bool | calcMatrixCoord (const double &X, std::vector< coord_t > &Coord, double &signal, double &errSq) const =0 |
The method to calculate all remaining coordinates, defined within the inner loop given that the input described by single value only. More... | |
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. More... | |
virtual bool | calcYDepCoordinates (std::vector< coord_t > &Coord, size_t i)=0 |
generalizes the code to calculate Y-variables within the detector's loop of the workspace More... | |
virtual MDTransfInterface * | clone () const =0 |
virtual std::vector< std::string > | getDefaultDimID (Kernel::DeltaEMode::Type dEmode, API::MatrixWorkspace_const_sptr inWS) const =0 |
when one builds MD workspace, he needs a dimension names/ID-s which can be different for different Q-transformations and in different E-mode The position of each dimID in the output vector should correspond the position of each coordinate in the Coord vector More... | |
virtual std::vector< std::string > | getEmodes () const |
MD transformation can often be used together with energy analysis mode; This function should be overloaded if the transformation indeed can do the energy analysis. More... | |
virtual std::vector< double > | getExtremumPoints (const double xMin, const double xMax, size_t det_num) const =0 |
method returns the vector of input coordinates values where the transformed coordinates reach its extreme values in any of its transformed directions. More... | |
virtual unsigned int | getNMatrixDimensions (Kernel::DeltaEMode::Type mode, API::MatrixWorkspace_const_sptr inWS) const =0 |
return the number of dimensions, calculated by the transformation from the workspace. More... | |
virtual void | initialize (const MDWSDescription &)=0 |
set up transformation from the class, which can provide all variables necessary for the conversion More... | |
virtual const std::string | inputUnitID (Kernel::DeltaEMode::Type dEmode, API::MatrixWorkspace_const_sptr inWS) const =0 |
returns the unit ID for the input units, the particular transformation expects. More... | |
virtual std::vector< std::string > | outputUnitID (Kernel::DeltaEMode::Type dEmode, API::MatrixWorkspace_const_sptr inWS) const =0 |
The transformation generates output MD events in particular units. More... | |
virtual void | setDisplayNormalization (Mantid::API::IMDWorkspace_sptr mdWorkspace, Mantid::API::MatrixWorkspace_sptr underlyingWorkspace) const =0 |
Sets the display normalization. More... | |
virtual const std::string | transfID () const =0 |
The method returns the name, under which the transformation would be known to a user. More... | |
virtual | ~MDTransfInterface ()=default |
Protected Attributes | |
std::vector< coord_t > | m_AddDimCoordinates |
the vector of the additional coordinates which define additional MD dimensions. More... | |
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 More... | |
bool | calcMatrixCoordInelastic (const double &deltaE, std::vector< coord_t > &Coord) const |
how to transform workspace data in inelastic case More... | |
Class responsible for conversion of input workspace data into proper number of output dimensions for ModQ case.
See http://www.mantidproject.org/Writing_custom_ConvertTo_MD_transformation for detailed description of this class place in the algorithms hierarchy.
Currently contains Elastic and Inelastic transformations
This particular file defines specializations of generic coordinate transformation to the ModQ case
Definition at line 30 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 46 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 100 of file MDTransfModQ.h.
Referenced by calcGenericVariables(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 89 of file MDTransfModQ.h.
Referenced by calcYDepCoordinates(), Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates(), getExtremumPoints(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 86 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 86 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 106 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 95 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 81 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 81 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 81 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 104 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 93 of file MDTransfModQ.h.
Referenced by calcGenericVariables(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 113 of file MDTransfModQ.h.
Referenced by calcYDepCoordinates(), Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 109 of file MDTransfModQ.h.
Referenced by calcYDepCoordinates(), Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates(), getExtremumPoints(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().
|
protected |
Definition at line 84 of file MDTransfModQ.h.
Referenced by Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DElastic(), Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic(), calcMatrixCoordElastic(), calcMatrixCoordInelastic(), initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().