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

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

#include <MDTransfModQ.h>

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

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

Detailed Description

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

Date
16-05-2012

Definition at line 30 of file MDTransfModQ.h.

Constructor & Destructor Documentation

◆ MDTransfModQ()

Mantid::MDAlgorithms::MDTransfModQ::MDTransfModQ ( )

constructor;

Definition at line 385 of file MDTransfModQ.cpp.

Member Function Documentation

◆ calcGenericVariables()

bool Mantid::MDAlgorithms::MDTransfModQ::calcGenericVariables ( std::vector< coord_t > &  Coord,
size_t  nd 
)
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;

Parameters
Coord– input-output vector of MD-coordinates
nd– number of current dimensions
Returns
– Coord vector with nd-(1 or 2, depending on emode) values of MD coordinates

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

◆ calcMatrixCoord()

bool Mantid::MDAlgorithms::MDTransfModQ::calcMatrixCoord ( const double &  deltaEOrK0,
std::vector< coord_t > &  Coord,
double &  signal,
double &  ErrSq 
) const
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)

Parameters
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.
Returns
Coord – the calculated coordinate of the point in the reciprocal space.

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.

◆ calcMatrixCoordElastic()

bool Mantid::MDAlgorithms::MDTransfModQ::calcMatrixCoordElastic ( const double &  k0,
std::vector< coord_t > &  Coord 
) 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
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 207 of file MDTransfModQ.cpp.

References m_DimMax, m_DimMin, m_ex, m_ey, m_ez, and m_RotMat.

Referenced by calcMatrixCoord().

◆ calcMatrixCoordInelastic()

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

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

◆ calcYDepCoordinates()

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

Method updates the value of pre-processed detector coordinates in Q-space, used by other functions.

Parameters
Coord
i– index of the detector, which corresponds to the spectra to process.
Returns
FALSE if spectra should be excluded (if masked)

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.

◆ clone()

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

Implements Mantid::MDAlgorithms::MDTransfInterface.

Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.

Definition at line 46 of file MDTransfModQ.h.

◆ getDefaultDimID()

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

Parameters
dEmode– energy conversion mode
inWS– Input Matrix 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

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

◆ getEmodes()

std::vector< std::string > Mantid::MDAlgorithms::MDTransfModQ::getEmodes ( ) const
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().

◆ getExtremumPoints()

std::vector< double > Mantid::MDAlgorithms::MDTransfModQ::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

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.

◆ getNMatrixDimensions()

unsigned int Mantid::MDAlgorithms::MDTransfModQ::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 the energy analysis (conversion) mode

Depending on EMode, this numebr here is either 1 or 2 and do not depend on input workspace

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

◆ initialize()

void Mantid::MDAlgorithms::MDTransfModQ::initialize ( const MDWSDescription ConvParams)
overridevirtual

◆ inputUnitID()

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

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

◆ outputUnitID()

std::vector< std::string > Mantid::MDAlgorithms::MDTransfModQ::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.

function returns units ID-s which this transformation produces its output.

It is Momentum and Momentum and DelteE in inelastic modes

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

◆ setDisplayNormalization()

void Mantid::MDAlgorithms::MDTransfModQ::setDisplayNormalization ( Mantid::API::IMDWorkspace_sptr  mdWorkspace,
Mantid::API::MatrixWorkspace_sptr  underlyingWorkspace 
) const
overridevirtual

Set the display normalization for Q.

Parameters
mdWorkspacethe md workspace
underlyingWorkspacethe underlying workspace

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 398 of file MDTransfModQ.cpp.

References m_Emode.

◆ transfID()

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

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

Implements Mantid::MDAlgorithms::MDTransfInterface.

Reimplemented in Mantid::MDAlgorithms::MDTransfQ3D.

Member Data Documentation

◆ m_AddDimCoordinates

std::vector<coord_t> Mantid::MDAlgorithms::MDTransfModQ::m_AddDimCoordinates
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().

◆ m_DetDirecton

Kernel::V3D const* Mantid::MDAlgorithms::MDTransfModQ::m_DetDirecton
protected

◆ m_DimMax

std::vector<double> Mantid::MDAlgorithms::MDTransfModQ::m_DimMax
protected

◆ m_DimMin

std::vector<double> Mantid::MDAlgorithms::MDTransfModQ::m_DimMin
protected

◆ m_eFixed

double Mantid::MDAlgorithms::MDTransfModQ::m_eFixed
protected

◆ m_Emode

Kernel::DeltaEMode::Type Mantid::MDAlgorithms::MDTransfModQ::m_Emode
protected

◆ m_ex

double Mantid::MDAlgorithms::MDTransfModQ::m_ex
protected

◆ m_ey

double Mantid::MDAlgorithms::MDTransfModQ::m_ey
protected

◆ m_ez

double Mantid::MDAlgorithms::MDTransfModQ::m_ez
protected

◆ m_kFixed

double Mantid::MDAlgorithms::MDTransfModQ::m_kFixed
protected

◆ m_NMatrixDim

unsigned int Mantid::MDAlgorithms::MDTransfModQ::m_NMatrixDim
protected

◆ m_pDetMasks

int* Mantid::MDAlgorithms::MDTransfModQ::m_pDetMasks
protected

◆ m_pEfixedArray

float* Mantid::MDAlgorithms::MDTransfModQ::m_pEfixedArray
protected

◆ m_RotMat

std::vector<double> Mantid::MDAlgorithms::MDTransfModQ::m_RotMat
protected

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