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

Class responsible for conversion of input workspace data into proper number of output dimensions for Q3D case. More...

#include <MDTransfQ3D.h>

Inheritance diagram for Mantid::MDAlgorithms::MDTransfQ3D:
Mantid::MDAlgorithms::MDTransfModQ Mantid::MDAlgorithms::MDTransfInterface

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

Detailed Description

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.

Date
31-05-2012

Definition at line 31 of file MDTransfQ3D.h.

Constructor & Destructor Documentation

◆ MDTransfQ3D()

Mantid::MDAlgorithms::MDTransfQ3D::MDTransfQ3D ( )

constructor;

Definition at line 327 of file MDTransfQ3D.cpp.

Member Function Documentation

◆ calcMatrixCoord()

bool Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord ( const double &  deltaEOrK0,
std::vector< coord_t > &  Coord,
double &  s,
double &  err 
) const
overridevirtual

Calculates 3D transformation of the variable coordinates and (if applicable) signal and error depending on 3D coordinates (e.g.

Lorentz corrections)

Parameters
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
Returns
Coord – converted 3D coordinates corresponding to given detector and X-vale Optionally:
s – Lorentz corrected signal
err – Lorentz corrected 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().

◆ calcMatrixCoord3DElastic()

bool Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DElastic ( const double &  k0,
std::vector< coord_t > &  Coord,
double &  signal,
double &  errSq 
) const
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

Parameters
k0module of input momentum
&Coordvector of MD coordinates with filled in momentum and energy transfer
signalsignal
errSqerror squared
Returns
true if momentum is within the limits requested by the algorithm and false otherwise.

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

◆ calcMatrixCoord3DInelastic()

bool Mantid::MDAlgorithms::MDTransfQ3D::calcMatrixCoord3DInelastic ( const double &  deltaE,
std::vector< coord_t > &  Coord 
) const
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

Parameters
deltaEinput energy transfer
&Coordvector of MD coordinates with filled in momentum and energy transfer
Returns
true if all momentum and energy are within the limits requested by the algorithm and false otherwise.

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

◆ calcYDepCoordinates()

bool Mantid::MDAlgorithms::MDTransfQ3D::calcYDepCoordinates ( std::vector< coord_t > &  Coord,
size_t  i 
)
overridevirtual

◆ clone()

MDTransfInterface * Mantid::MDAlgorithms::MDTransfQ3D::clone ( ) const
inlineoverridevirtual

Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.

Definition at line 41 of file MDTransfQ3D.h.

◆ getDefaultDimID()

std::vector< std::string > Mantid::MDAlgorithms::MDTransfQ3D::getDefaultDimID ( Kernel::DeltaEMode::Type  dEmode,
API::MatrixWorkspace_const_sptr  inWS = API::MatrixWorkspace_const_sptr() 
) const
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.

Parameters
dEmode– energy conversion mode
inWS– Input workspace
Returns
– vector of default dimension ID-s for correspondent energy conversion mode. The position of each dimID in the vector corresponds to the position of each MD coordinate in the Coord vector

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

◆ getExtremumPoints()

std::vector< double > Mantid::MDAlgorithms::MDTransfQ3D::getExtremumPoints ( const double  eMin,
const double  eMax,
size_t  det_num 
) const
overridevirtual

method returns the vector of input coordinates values where the transformed coordinates reach its extremum values in Q or dE direction.

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

◆ getNMatrixDimensions()

unsigned int Mantid::MDAlgorithms::MDTransfQ3D::getNMatrixDimensions ( Kernel::DeltaEMode::Type  mode,
API::MatrixWorkspace_const_sptr  inWS = API::MatrixWorkspace_const_sptr() 
) const
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().

◆ initialize()

void Mantid::MDAlgorithms::MDTransfQ3D::initialize ( const MDWSDescription ConvParams)
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().

◆ outputUnitID()

std::vector< std::string > Mantid::MDAlgorithms::MDTransfQ3D::outputUnitID ( Kernel::DeltaEMode::Type  dEmode,
API::MatrixWorkspace_const_sptr  inWS = API::MatrixWorkspace_const_sptr() 
) const
overridevirtual

function returns units ID-s which this transformation prodiuces its ouptut.

It is Momentum and Momentum and DelteE in inelastic modes

Parameters
dEmode– energy conversion mode
inWS– input workspace
Returns
It is Momentum and DelteE in inelastic modes

Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.

Definition at line 308 of file MDTransfQ3D.cpp.

References Mantid::Kernel::DeltaEMode::Elastic, getDefaultDimID(), and UNUSED_ARG.

◆ transfID()

const std::string Mantid::MDAlgorithms::MDTransfQ3D::transfID ( ) const
overridevirtual

the name, this ChildAlgorithm is known to users (will appear in selection list)

Reimplemented from Mantid::MDAlgorithms::MDTransfModQ.

Member Data Documentation

◆ convention

std::string Mantid::MDAlgorithms::MDTransfQ3D::convention
protected

Definition at line 79 of file MDTransfQ3D.h.

Referenced by calcMatrixCoord3DElastic(), calcMatrixCoord3DInelastic(), and initialize().

◆ m_AbsMin

double Mantid::MDAlgorithms::MDTransfQ3D::m_AbsMin
protected

Definition at line 82 of file MDTransfQ3D.h.

Referenced by calcMatrixCoord3DElastic(), calcMatrixCoord3DInelastic(), and initialize().

◆ m_isLorentzCorrected

bool Mantid::MDAlgorithms::MDTransfQ3D::m_isLorentzCorrected
protected

Definition at line 69 of file MDTransfQ3D.h.

Referenced by calcMatrixCoord3DElastic(), calcYDepCoordinates(), and initialize().

◆ m_SinThetaSq

double Mantid::MDAlgorithms::MDTransfQ3D::m_SinThetaSq
protected

Definition at line 77 of file MDTransfQ3D.h.

Referenced by calcMatrixCoord3DElastic(), and calcYDepCoordinates().

◆ m_SinThetaSqArray

double const* Mantid::MDAlgorithms::MDTransfQ3D::m_SinThetaSqArray
protected

Definition at line 72 of file MDTransfQ3D.h.

Referenced by calcYDepCoordinates(), and initialize().

◆ SinThetaSq

std::vector<double> Mantid::MDAlgorithms::MDTransfQ3D::SinThetaSq
protected

Definition at line 74 of file MDTransfQ3D.h.

Referenced by initialize().


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