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

Class responsible for conversion of input workspace data into proper number of output dimensions in NoQ case, when the data from a ws are just copied to MD WS. More...

#include <MDTransfNoQ.h>

Inheritance diagram for Mantid::MDAlgorithms::MDTransfNoQ:
Mantid::MDAlgorithms::MDTransfInterface

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 itselt. More...
 
bool calcMatrixCoord (const double &X, std::vector< coord_t > &Coord, double &s, double &err) const override
 The method to calculate all remaining coordinates, defined within the inner loop given that the input described by single value only. 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 mode, API::MatrixWorkspace_const_sptr inWS) const override
 the default dimID-s in noQ mode equal to input WS dim-id-s More...
 
std::vector< double > getExtremumPoints (const double xMin, const double xMax, size_t det_num) const override
 This transformation dos nothing with the workspace ranges, so extremum points for this transformation coordinates are the coordinates themselves. More...
 
unsigned int getNMatrixDimensions (Kernel::DeltaEMode::Type mode, API::MatrixWorkspace_const_sptr inWS) const override
 return the number of dimensions, calculated by the transformation from the workspace. More...
 
void initialize (const MDWSDescription &ConvParams) override
 set up transformation from the class, which can provide all variables necessary for the conversion More...
 
const std::string inputUnitID (Kernel::DeltaEMode::Type mode, API::MatrixWorkspace_const_sptr inWS) const override
 returns the units, the input ws is actually in as they coinside with input units for this class More...
 
 MDTransfNoQ ()
 
std::vector< std::string > outputUnitID (Kernel::DeltaEMode::Type mode, API::MatrixWorkspace_const_sptr inWS) 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 no 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
 

Static Private Member Functions

static void getAxes (const API::MatrixWorkspace_const_sptr &inWS, API::NumericAxis *&pXAxis, API::NumericAxis *&pYAxis)
 

Private Attributes

std::vector< coord_tm_AddDimCoordinates
 the vector of the additional coordinates which define additional MD dimensions. More...
 
Kernel::V3D const * m_Det
 
std::vector< double > m_DimMax
 
std::vector< double > m_DimMin
 
unsigned int m_NMatrixDim
 
API::NumericAxism_YAxis
 

Detailed Description

Class responsible for conversion of input workspace data into proper number of output dimensions in NoQ case, when the data from a ws are just copied to MD WS.

See http://www.mantidproject.org/Writing_custom_ConvertTo_MD_transformation for detailed description of this class place in the algorithms hierarchy.

Date
16-05-2012

Definition at line 28 of file MDTransfNoQ.h.

Constructor & Destructor Documentation

◆ MDTransfNoQ()

Mantid::MDAlgorithms::MDTransfNoQ::MDTransfNoQ ( )

Definition at line 170 of file MDTransfNoQ.cpp.

Member Function Documentation

◆ calcGenericVariables()

bool Mantid::MDAlgorithms::MDTransfNoQ::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 itselt.

it fills in [nd - (1 or 2 – depending on input ws)] values into the 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 input ws) values of MD coordinates

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 27 of file MDTransfNoQ.cpp.

References std::to_string().

◆ calcMatrixCoord()

bool Mantid::MDAlgorithms::MDTransfNoQ::calcMatrixCoord ( const double &  X,
std::vector< coord_t > &  Coord,
double &  signal,
double &  errSq 
) const
overridevirtual

The method to calculate all remaining coordinates, defined within the inner loop given that the input described by single value only.

Parameters
X– X workspace value
Coord– ChildAlgorithm specific number of coordinates, placed in the proper position of the Coordinate vector
signal– signal value which can change or remain unchanged depending on MD coordinates or can affect MD coordinates
errSq– squared error value which can change or remain unchanged depending on MD coordinates or can affect MD coordinates
Returns
true – if all Coord are within the range requested by algorithm. false otherwise

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 76 of file MDTransfNoQ.cpp.

References m_DimMax, m_DimMin, and Mantid::Geometry::X.

◆ calcYDepCoordinates()

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

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

Parameters
Coord: input-output vector of MD Coordinates
i– index of the detector, which corresponds to the spectra to process.

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 69 of file MDTransfNoQ.cpp.

References m_DimMax, m_DimMin, and m_YAxis.

◆ clone()

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

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 40 of file MDTransfNoQ.h.

◆ getAxes()

void Mantid::MDAlgorithms::MDTransfNoQ::getAxes ( const API::MatrixWorkspace_const_sptr inWS,
API::NumericAxis *&  pXAxis,
API::NumericAxis *&  pYAxis 
)
staticprivate

Definition at line 113 of file MDTransfNoQ.cpp.

Referenced by getNMatrixDimensions(), initialize(), and outputUnitID().

◆ getDefaultDimID()

std::vector< std::string > Mantid::MDAlgorithms::MDTransfNoQ::getDefaultDimID ( Kernel::DeltaEMode::Type  mode,
API::MatrixWorkspace_const_sptr  inWS 
) const
overridevirtual

the default dimID-s in noQ mode equal to input WS dim-id-s

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 151 of file MDTransfNoQ.cpp.

References outputUnitID().

◆ getExtremumPoints()

std::vector< double > Mantid::MDAlgorithms::MDTransfNoQ::getExtremumPoints ( const double  xMin,
const double  xMax,
size_t  det_num 
) const
overridevirtual

This transformation dos nothing with the workspace ranges, so extremum points for this transformation coordinates are the coordinates themselves.

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 85 of file MDTransfNoQ.cpp.

References UNUSED_ARG.

◆ getNMatrixDimensions()

unsigned int Mantid::MDAlgorithms::MDTransfNoQ::getNMatrixDimensions ( Kernel::DeltaEMode::Type  mode,
API::MatrixWorkspace_const_sptr  inWS 
) const
overridevirtual

return the number of dimensions, calculated by the transformation from the workspace.

Depending on ws axis units, the numebr here is either 1 or 2* and is independent on emode

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 99 of file MDTransfNoQ.cpp.

References getAxes(), and UNUSED_ARG.

Referenced by initialize().

◆ initialize()

void Mantid::MDAlgorithms::MDTransfNoQ::initialize ( const MDWSDescription )
overridevirtual

◆ inputUnitID()

const std::string Mantid::MDAlgorithms::MDTransfNoQ::inputUnitID ( Kernel::DeltaEMode::Type  mode,
API::MatrixWorkspace_const_sptr  inWS 
) const
overridevirtual

returns the units, the input ws is actually in as they coinside with input units for this class

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 157 of file MDTransfNoQ.cpp.

References Mantid::API::Axis::unit(), and UNUSED_ARG.

◆ outputUnitID()

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

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

here it is usually input ws units, which are independent on emode

here it is usually input ws units, which are independent on emode

Parameters
mode– current energy analysis mode (not used in NoQ mode)
inWS– input matrix workspace shared pointer

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 132 of file MDTransfNoQ.cpp.

References getAxes(), Mantid::API::Axis::unit(), and UNUSED_ARG.

Referenced by getDefaultDimID().

◆ setDisplayNormalization()

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

Set the display normalization for no Q.

Parameters
mdWorkspacethe md workspace
underlyingWorkspacethe underlying workspace

Implements Mantid::MDAlgorithms::MDTransfInterface.

Definition at line 177 of file MDTransfNoQ.cpp.

◆ transfID()

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

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

Implements Mantid::MDAlgorithms::MDTransfInterface.

Member Data Documentation

◆ m_AddDimCoordinates

std::vector<coord_t> Mantid::MDAlgorithms::MDTransfNoQ::m_AddDimCoordinates
private

the vector of the additional coordinates which define additional MD dimensions.

For implemented NoQ case, these dimensions do not depend on matrix coordinates and are determined by the WS properties

Definition at line 85 of file MDTransfNoQ.h.

Referenced by initialize().

◆ m_Det

Kernel::V3D const* Mantid::MDAlgorithms::MDTransfNoQ::m_Det
private

Definition at line 78 of file MDTransfNoQ.h.

Referenced by initialize().

◆ m_DimMax

std::vector<double> Mantid::MDAlgorithms::MDTransfNoQ::m_DimMax
private

Definition at line 80 of file MDTransfNoQ.h.

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

◆ m_DimMin

std::vector<double> Mantid::MDAlgorithms::MDTransfNoQ::m_DimMin
private

Definition at line 80 of file MDTransfNoQ.h.

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

◆ m_NMatrixDim

unsigned int Mantid::MDAlgorithms::MDTransfNoQ::m_NMatrixDim
private

Definition at line 70 of file MDTransfNoQ.h.

Referenced by initialize().

◆ m_YAxis

API::NumericAxis* Mantid::MDAlgorithms::MDTransfNoQ::m_YAxis
private

Definition at line 74 of file MDTransfNoQ.h.

Referenced by calcYDepCoordinates(), and initialize().


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