Mantid
|
Class responsible for conversion of input workspace data into proper number of output dimensions for Q3D case. More...
#include <MDTransfQ3D.h>
Public Member Functions | |
bool | calcMatrixCoord (const double &deltaEOrK0, std::vector< coord_t > &Coord, double &s, double &err) const override |
Calculates 3D transformation of the variable coordinates and (if applicable) signal and error depending on 3D coordinates (e.g. More... | |
bool | calcYDepCoordinates (std::vector< coord_t > &Coord, size_t i) override |
Method updates the value of preprocessed 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 Q3D mode are Q1,Q2,Q3 and dE if necessary More... | |
std::vector< double > | getExtremumPoints (const double xMin, const double xMax, 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 initalizes all variables necessary for converting workspace variables into MD variables in ModQ (elastic/inelastic) cases More... | |
MDTransfQ3D () | |
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... | |
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::MDTransfModQ | |
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::string | convention |
double | m_AbsMin |
bool | m_isLorentzCorrected |
double | m_SinThetaSq |
double const * | m_SinThetaSqArray |
std::vector< double > | SinThetaSq |
Protected Attributes inherited from Mantid::MDAlgorithms::MDTransfModQ | |
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 | calcMatrixCoord3DElastic (const double &k0, std::vector< coord_t > &Coord, double &signal, double &errSq) const |
how to transform workspace data in elastic case More... | |
bool | calcMatrixCoord3DInelastic (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 Q3D 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
Some methods here are the same as in ModQ case, so the class difectly inherigs from ModQ to utilize this.
Definition at line 31 of file MDTransfQ3D.h.
Mantid::MDAlgorithms::MDTransfQ3D::MDTransfQ3D | ( | ) |
constructor;
Definition at line 327 of file MDTransfQ3D.cpp.
|
overridevirtual |
Calculates 3D transformation of the variable coordinates and (if applicable) signal and error depending on 3D coordinates (e.g.
Lorentz corrections)
deltaEOrK0 | – In elastic the modulus of K0, in inelastic the energy transfer |
Coord | – 3 or 4D coordinate of the resulting event |
s | – the signal |
err | –the error |
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
Definition at line 47 of file MDTransfQ3D.cpp.
References calcMatrixCoord3DElastic(), calcMatrixCoord3DInelastic(), Mantid::Kernel::DeltaEMode::Elastic, and Mantid::MDAlgorithms::MDTransfModQ::m_Emode.
Referenced by Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromHistoWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromHistoWS(), and Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromHistoWS().
|
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 |
signal | signal |
errSq | error squared |
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 127 of file MDTransfQ3D.cpp.
References convention, m_AbsMin, Mantid::MDAlgorithms::MDTransfModQ::m_DimMax, Mantid::MDAlgorithms::MDTransfModQ::m_DimMin, Mantid::MDAlgorithms::MDTransfModQ::m_ex, Mantid::MDAlgorithms::MDTransfModQ::m_ey, Mantid::MDAlgorithms::MDTransfModQ::m_ez, m_isLorentzCorrected, Mantid::MDAlgorithms::MDTransfModQ::m_RotMat, and m_SinThetaSq.
Referenced by calcMatrixCoord().
|
inlineprivate |
how to transform workspace data in inelastic case
method 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 69 of file MDTransfQ3D.cpp.
References convention, Mantid::Kernel::DeltaEMode::Direct, Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, m_AbsMin, Mantid::MDAlgorithms::MDTransfModQ::m_DimMax, Mantid::MDAlgorithms::MDTransfModQ::m_DimMin, Mantid::MDAlgorithms::MDTransfModQ::m_eFixed, Mantid::MDAlgorithms::MDTransfModQ::m_Emode, Mantid::MDAlgorithms::MDTransfModQ::m_ex, Mantid::MDAlgorithms::MDTransfModQ::m_ey, Mantid::MDAlgorithms::MDTransfModQ::m_ez, Mantid::MDAlgorithms::MDTransfModQ::m_kFixed, and Mantid::MDAlgorithms::MDTransfModQ::m_RotMat.
Referenced by calcMatrixCoord().
|
overridevirtual |
Method updates the value of preprocessed detector coordinates in Q-space, used by other functions.
Coord | – vector of MD coordinates with filled in momentum and energy transfer |
i | – index of the detector, which corresponds to the spectra to process. |
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
Definition at line 185 of file MDTransfQ3D.cpp.
References Mantid::PhysicalConstants::E_mev_toNeutronWavenumberSq, Mantid::MDAlgorithms::MDTransfModQ::m_DetDirecton, Mantid::MDAlgorithms::MDTransfModQ::m_eFixed, Mantid::MDAlgorithms::MDTransfModQ::m_ex, Mantid::MDAlgorithms::MDTransfModQ::m_ey, Mantid::MDAlgorithms::MDTransfModQ::m_ez, m_isLorentzCorrected, Mantid::MDAlgorithms::MDTransfModQ::m_kFixed, Mantid::MDAlgorithms::MDTransfModQ::m_pDetMasks, Mantid::MDAlgorithms::MDTransfModQ::m_pEfixedArray, m_SinThetaSq, m_SinThetaSqArray, UNUSED_ARG, Mantid::Geometry::X, Mantid::Geometry::Y, and Mantid::Geometry::Z.
Referenced by Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromHistoWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromHistoWS(), and Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromHistoWS().
|
inlineoverridevirtual |
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
Definition at line 41 of file MDTransfQ3D.h.
|
overridevirtual |
the default dimID-s in Q3D mode are Q1,Q2,Q3 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 ouptut in.
dEmode | – energy conversion mode |
inWS | – Input workspace |
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
Definition at line 278 of file MDTransfQ3D.cpp.
References Mantid::Kernel::DeltaEMode::Direct, Mantid::Kernel::DeltaEMode::Elastic, Mantid::Kernel::DeltaEMode::Indirect, and UNUSED_ARG.
Referenced by outputUnitID().
|
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 |
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
Definition at line 167 of file MDTransfQ3D.cpp.
References UNUSED_ARG.
|
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 energy analysis mode
Depending on EMode, this numebr here is either 3 or 4 and do not depend on input workspace
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
Definition at line 17 of file MDTransfQ3D.cpp.
References Mantid::Kernel::DeltaEMode::Direct, Mantid::Kernel::DeltaEMode::Elastic, Mantid::Kernel::DeltaEMode::Indirect, and UNUSED_ARG.
Referenced by initialize().
|
overridevirtual |
function initalizes all variables necessary for converting workspace variables into MD variables in ModQ (elastic/inelastic) cases
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
Definition at line 210 of file MDTransfQ3D.cpp.
References Mantid::MDAlgorithms::MDWSDescription::absMin(), convention, 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, Mantid::Kernel::SingletonHolder< T >::Instance(), Mantid::MDAlgorithms::MDWSDescription::isLorentsCorrections(), m_AbsMin, Mantid::MDAlgorithms::MDTransfModQ::m_AddDimCoordinates, Mantid::MDAlgorithms::MDTransfModQ::m_DetDirecton, Mantid::MDAlgorithms::MDTransfModQ::m_DimMax, Mantid::MDAlgorithms::MDTransfModQ::m_DimMin, Mantid::MDAlgorithms::MDTransfModQ::m_eFixed, Mantid::MDAlgorithms::MDTransfModQ::m_Emode, m_isLorentzCorrected, Mantid::MDAlgorithms::MDTransfModQ::m_kFixed, Mantid::MDAlgorithms::MDTransfModQ::m_NMatrixDim, Mantid::MDAlgorithms::MDTransfModQ::m_pDetMasks, Mantid::MDAlgorithms::MDTransfModQ::m_pEfixedArray, Mantid::MDAlgorithms::MDWSDescription::m_PreprDetTable, Mantid::MDAlgorithms::MDTransfModQ::m_RotMat, m_SinThetaSqArray, and SinThetaSq.
Referenced by Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromEventWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromHistoWS(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::qListFromHistoWS(), and Mantid::MDAlgorithms::IntegrateEllipsoidsV2::qListFromHistoWS().
|
overridevirtual |
function returns units ID-s which this transformation prodiuces its ouptut.
It is Momentum and Momentum and DelteE in inelastic modes
dEmode | – energy conversion mode |
inWS | – input workspace |
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
Definition at line 308 of file MDTransfQ3D.cpp.
References Mantid::Kernel::DeltaEMode::Elastic, getDefaultDimID(), and UNUSED_ARG.
|
overridevirtual |
the name, this ChildAlgorithm is known to users (will appear in selection list)
Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.
|
protected |
Definition at line 79 of file MDTransfQ3D.h.
Referenced by calcMatrixCoord3DElastic(), calcMatrixCoord3DInelastic(), and initialize().
|
protected |
Definition at line 82 of file MDTransfQ3D.h.
Referenced by calcMatrixCoord3DElastic(), calcMatrixCoord3DInelastic(), and initialize().
|
protected |
Definition at line 69 of file MDTransfQ3D.h.
Referenced by calcMatrixCoord3DElastic(), calcYDepCoordinates(), and initialize().
|
protected |
Definition at line 77 of file MDTransfQ3D.h.
Referenced by calcMatrixCoord3DElastic(), and calcYDepCoordinates().
|
protected |
Definition at line 72 of file MDTransfQ3D.h.
Referenced by calcYDepCoordinates(), and initialize().
|
protected |
Definition at line 74 of file MDTransfQ3D.h.
Referenced by initialize().