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

helper class describes the properties of target MD workspace, which should be obtained as the result of conversion algorithm. More...

#include <MDWSDescription.h>

Inheritance diagram for Mantid::MDAlgorithms::MDWSDescription:
Mantid::API::LogManager

Public Member Functions

double absMin () const
 
void buildFromMatrixWS (const API::MatrixWorkspace_sptr &pWS, const std::string &QMode, const std::string &dEMode, const std::vector< std::string > &dimPropertyNames=std::vector< std::string >())
 method builds MD Event ws description from a matrix workspace and the transformations, requested to be performed on the workspace
 
void buildFromMDWS (const API::IMDEventWorkspace_const_sptr &pWS)
 method builds MD Event description from existing MD event workspace
 
void checkWSCorresponsMDWorkspace (const MDWSDescription &NewMDWorkspaceD)
 compare two descriptions and select the complimentary result.
 
std::vector< coord_tgetAddCoord () const
 
Mantid::Kernel::SpecialCoordinateSystem getCoordinateSystem () const
 
std::vector< std::string > getDimIDs () const
 
std::vector< double > getDimMax () const
 
std::vector< double > getDimMin () const
 
std::vector< std::string > getDimNames () const
 
std::vector< std::string > getDimUnits () const
 
Kernel::DeltaEMode::Type getEMode () const
 
std::string getEModeStr () const
 Returns symbolic representation of current Emode.
 
Geometry::MDFrame_uptr getFrame (size_t d) const
 Retrieve the md frame.
 
Kernel::Matrix< double > getGoniometerMatr () const
 method returns goniometer matrix if one is defined on the workspace or unit matrix if there are no such matrix
 
API::MatrixWorkspace_const_sptr getInWS () const
 
std::shared_ptr< Geometry::OrientedLatticegetLattice () const
 
void getMinMax (std::vector< double > &min, std::vector< double > &max) const
 get vector of minimal and maximal values from the class
 
std::vector< size_t > getNBins () const
 
std::string getQMode () const
 
std::vector< double > getTransfMatrix () const
 
const std::string & getWSName () const
 
bool hasGoniometer () const
 Method checks if input workspace has defined goniometer.
 
bool hasLattice () const
 
bool isLorentsCorrections () const
 check if one needs to perform Lorentz corrections
 
bool isPowder () const
 Method checks if the workspace is expected to be processed in powder mode.
 
bool isQ3DMode () const
 Is the algorithm running in Q3D mode?
 
 MDWSDescription (unsigned int nDimensions=0)
 constructor
 
unsigned int nDimensions () const
 
void setAbsMin (double absMin)
 
void setCoordinateSystem (const Mantid::Kernel::SpecialCoordinateSystem system)
 Set the special coordinate system if any.
 
void setDimName (unsigned int nDim, const std::string &Name)
 set specific (non-default) dimension name
 
void setDimUnit (unsigned int nDim, const std::string &Unit)
 this is rather misleading function, as MD workspace does not currently have dimension units.
 
void setFrame (const std::string &frameKey)
 Set the md frame.
 
void setLorentsCorr (bool On=false)
 do we need to perform Lorentz corrections
 
void setMinMax (const std::vector< double > &minVal, const std::vector< double > &maxVal)
 function sets up min-max values to the dimensions, described by the class
 
void setNumBins (const std::vector< int > &nBins_toSplit)
 sets number of bins each dimension is split
 
void setUpMissingParameters (const MDWSDescription &SourceMatrWS)
 copy some parameters from the input workspace, as target md WS do not have all information about the algorithm.
 
void setWS (API::MatrixWorkspace_sptr otherMatrixWS)
 
- Public Member Functions inherited from Mantid::API::LogManager
void addLogData (Kernel::Property *p)
 Add a log entry.
 
void addLogData (std::unique_ptr< Kernel::Property > p, bool overwrite=false)
 Add a log entry.
 
template<class TYPE >
void addProperty (const std::string &name, const TYPE &value, bool overwrite=false)
 Add a property of given type.
 
template<class TYPE >
void addProperty (const std::string &name, const TYPE &value, const std::string &units, bool overwrite=false)
 Add a property of a specified type (Simply creates a Kernel::Property of that type) and set its units.
 
void addProperty (Kernel::Property *prop, bool overwrite=false)
 Add data to the object in the form of a property.
 
void addProperty (std::unique_ptr< Kernel::Property > prop, bool overwrite=false)
 Add data to the object in the form of a property.
 
void clearLogs ()
 Clear the logs.
 
void clearOutdatedTimeSeriesLogValues ()
 Empty all but the last value out of all TimeSeriesProperty logs.
 
void clearSingleValueCache ()
 Clear the cache of calculated statistics.
 
void clearTimeSeriesLogs ()
 Empty the values out of all TimeSeriesProperty logs.
 
LogManagercloneInTimeROI (const Kernel::TimeROI &timeROI)
 Create a new LogManager with a partial copy of its time series properties according to TimeROI.
 
void copyAndFilterProperties (const LogManager &other, const Kernel::TimeROI &timeROI)
 Copy properties from another LogManager; filter copied time series properties according to TimeROI.
 
const Types::Core::DateAndTime endTime () const
 Return the run end time.
 
void filterByLog (Mantid::Kernel::LogFilter *filter, const std::vector< std::string > &excludedFromFiltering=std::vector< std::string >())
 Filter the run by the given log filter.
 
virtual void filterByTime (const Types::Core::DateAndTime start, const Types::Core::DateAndTime stop)
 Filter the logs by time.
 
const Types::Core::DateAndTime getFirstPulseTime () const
 Return the first pulse time from sample logs.
 
Kernel::TimeSeriesProperty< bool > * getInvalidValuesFilter (const std::string &logName) const
 returns the invalid values log if the log has a matching invalid values log filter
 
const Types::Core::DateAndTime getLastPulseTime () const
 Return the last pulse time from sample logs.
 
double getLogAsSingleValue (const std::string &name, Kernel::Math::StatisticType statistic=Kernel::Math::Mean) const
 
const std::vector< Kernel::Property * > & getLogData () const
 Access all log entries.
 
Kernel::PropertygetLogData (const std::string &name) const
 Access a single log entry.
 
virtual size_t getMemorySize () const
 Return an approximate memory size for the object in bytes.
 
const std::vector< Kernel::Property * > & getProperties () const
 Return all of the current properties.
 
Kernel::PropertygetProperty (const std::string &name) const
 Returns the named property as a pointer.
 
int getPropertyAsIntegerValue (const std::string &name) const
 Returns a property as an integer value.
 
double getPropertyAsSingleValue (const std::string &name, Kernel::Math::StatisticType statistic=Kernel::Math::Mean) const
 Returns a property as a single double value from its name.
 
template<typename HeldType >
HeldType getPropertyValueAsType (const std::string &name) const
 Get the value of a property as the given TYPE.
 
const std::string & getProtonChargeLogName () const
 
const std::string & getProtonChargeUnfilteredName () const
 
Kernel::TimeSeriesPropertyStatistics getStatistics (const std::string &name) const
 Returns various statistics computations for a given property.
 
double getTimeAveragedStd (const std::string &name) const
 Get the time averaged standard deviation for a log.
 
double getTimeAveragedValue (const std::string &name) const
 Get the time averaged value for a log.
 
const Kernel::TimeROIgetTimeROI () const
 
template<typename T >
Kernel::TimeSeriesProperty< T > * getTimeSeriesProperty (const std::string &name) const
 Returns a property as a time series property.
 
bool hasInvalidValuesFilter (const std::string &logName) const
 returns true if the log has a matching invalid values log filter
 
bool hasProperty (const std::string &name) const
 Does the property exist on the object.
 
virtual void loadNexus (Nexus::File *file, const std::string &group, bool keepOpen=false)
 Load the run from a NeXus file with a given group name.
 
virtual void loadNexus (Nexus::File *file, const std::string &group, const Mantid::Nexus::NexusDescriptor &fileInfo, const std::string &prefix, bool keepOpen=false)
 Load the run from a NeXus file with a given group name. Overload that uses NexusDescriptor for faster.
 
 LogManager ()
 
 LogManager (const LogManager &other)
 
bool operator!= (const LogManager &other) const
 
LogManageroperator= (const LogManager &other)
 
bool operator== (const LogManager &other) const
 
virtual void removeDataOutsideTimeROI ()
 For the time series properties, remove values according to TimeROI.
 
void removeLogData (const std::string &name, const bool delproperty=true)
 Remove a named log entry.
 
void removeProperty (const std::string &name, bool delProperty=true)
 Remove a named property.
 
virtual void saveNexus (Nexus::File *file, const std::string &group, bool keepOpen=false) const
 Save the run to a NeXus file with a given group name.
 
void setStartAndEndTime (const Types::Core::DateAndTime &start, const Types::Core::DateAndTime &end)
 Set the run start and end.
 
virtual void setTimeROI (const Kernel::TimeROI &timeroi)
 
const Types::Core::DateAndTime startTime () const
 Return the run start time.
 
virtual ~LogManager ()
 Destructor.
 

Static Public Member Functions

static void checkMinMaxNdimConsistent (const std::vector< double > &minVal, const std::vector< double > &maxVal)
 helper function checks if min values are less them max values and are consistent between each other
 
static void fillAddProperties (const Mantid::API::MatrixWorkspace_const_sptr &inWS2D, const std::vector< std::string > &dimPropertyNames, std::vector< coord_t > &AddCoord)
 function extracts the coordinates from additional workspace properties and places them to AddCoord vector for further usage
 
static std::shared_ptr< Geometry::OrientedLatticegetOrientedLattice (const Mantid::API::MatrixWorkspace_const_sptr &inWS2D)
 function retrieves copy of the oriented lattice from the workspace
 
- Static Public Member Functions inherited from Mantid::API::LogManager
static std::string getInvalidValuesFilterLogName (const std::string &logName)
 Gets the correct log name for the matching invalid values log for a given log name.
 

Public Attributes

std::string AlgID
 the string which describes ChildAlgorithm, used to convert source ws to target MD ws.
 
bool m_buildingNewWorkspace
 
DataObjects::TableWorkspace_const_sptr m_PreprDetTable
 
std::vector< double > m_RotMatrix
 
Kernel::DblMatrix m_Wtransf
 

Protected Member Functions

void resizeDimDescriptions (unsigned int nDimensions, size_t nBins=10)
 helper function to resize all vectors, responsible for MD dimensions in one go
 
- Protected Member Functions inherited from Mantid::API::LogManager
bool hasEndTime () const
 
bool hasStartTime () const
 
bool hasValidProtonChargeLog (std::string &error) const
 Check if the proton_charge log exists, is of valid type, and is not empty.
 
void loadNexus (Nexus::File *file, const Mantid::Nexus::NexusDescriptor &fileInfo, const std::string &prefix)
 
void loadNexus (Nexus::File *file, const std::map< std::string, std::string > &entries)
 Load the run from a NeXus file with a given group name.
 

Protected Attributes

double m_AbsMin
 hole near origin of Q
 
std::vector< coord_tm_AddCoord
 the vector of MD coordinates, which are obtained from workspace properties.
 
std::vector< std::string > m_DimIDs
 the ID-s for the target workspace, which allow to identify the dimensions according to their ID
 
std::vector< double > m_DimMax
 
std::vector< double > m_DimMin
 minimal and maximal values for the workspace dimensions.
 
std::vector< std::string > m_DimNames
 the names for the target workspace dimensions and properties of input MD workspace
 
std::vector< std::string > m_DimUnits
 the units of target workspace dimensions and properties of input MD workspace dimensions
 
Kernel::DeltaEMode::Type m_Emode
 energy transfer analysis mode
 
API::MatrixWorkspace_sptr m_InWS
 
bool m_LorentzCorr
 if one needs to calculate Lorentz corrections
 
std::vector< size_t > m_NBins
 if defined, specifies number of bins split in each dimension
 
unsigned int m_NDims
 the variable which describes the number of the dimensions, in the target workspace.
 
- Protected Attributes inherited from Mantid::API::LogManager
std::unique_ptr< Kernel::PropertyManagerm_manager
 A pointer to a property manager.
 
std::unique_ptr< Kernel::TimeROIm_timeroi
 

Private Attributes

Mantid::Kernel::SpecialCoordinateSystem m_coordinateSystem
 Coordinate system.
 
std::string m_frameKey
 Frame key. For frame to use.
 

Additional Inherited Members

- Static Protected Attributes inherited from Mantid::API::LogManager
static const std::string PROTON_CHARGE_LOG_NAME = "gd_prtn_chrg"
 Name of the log entry containing the proton charge when retrieved using getProtonCharge.
 
static const std::string PROTON_CHARGE_UNFILTERED_LOG_NAME = LogManager::PROTON_CHARGE_LOG_NAME + "_unfiltered"
 Flag to signify if a filter has been applied to the proton charge log.
 

Detailed Description

helper class describes the properties of target MD workspace, which should be obtained as the result of conversion algorithm.

Definition at line 45 of file MDWSDescription.h.

Constructor & Destructor Documentation

◆ MDWSDescription()

Mantid::MDAlgorithms::MDWSDescription::MDWSDescription ( unsigned int  nDimensions = 0)

constructor

empty constructor

Definition at line 231 of file MDWSDescription.cpp.

References m_DimMax, m_DimMin, m_NDims, m_RotMatrix, and resizeDimDescriptions().

Member Function Documentation

◆ absMin()

double Mantid::MDAlgorithms::MDWSDescription::absMin ( ) const
inline

Definition at line 78 of file MDWSDescription.h.

Referenced by Mantid::MDAlgorithms::MDTransfQ3D::initialize().

◆ buildFromMatrixWS()

void Mantid::MDAlgorithms::MDWSDescription::buildFromMatrixWS ( const API::MatrixWorkspace_sptr pWS,
const std::string &  QMode,
const std::string &  dEMode,
const std::vector< std::string > &  dimPropertyNames = std::vector<std::string>() 
)

method builds MD Event ws description from a matrix workspace and the transformations, requested to be performed on the workspace

the method builds the MD ws description from existing matrix workspace and the requested transformation parameters.

Parameters
pWS– input matrix workspace to be converted into MD workspace
QMode– momentum conversion mode. Any mode supported by Q conversion factory. Class just carries up the name of Q-mode, to the place where factory call to the solver is made , so no code modification is needed when new modes are added to the factory
dEMode– energy analysis mode (string representation). Should correspond to energy analysis modes, supported by selected Q-mode
dimPropertyNames– the vector of names for additional ws properties, which will be used as dimensions.

Definition at line 66 of file MDWSDescription.cpp.

References AlgID, fillAddProperties(), Mantid::Kernel::DeltaEMode::fromString(), Mantid::MDAlgorithms::MDTransfInterface::getDefaultDimID(), Mantid::MDAlgorithms::MDTransfInterface::getNMatrixDimensions(), m_AddCoord, m_buildingNewWorkspace, m_DimIDs, m_DimMin, m_DimNames, m_DimUnits, m_Emode, m_InWS, m_NDims, Mantid::MDAlgorithms::MDTransfInterface::outputUnitID(), and resizeDimDescriptions().

Referenced by Mantid::MDAlgorithms::ConvertToMD::buildTargetWSDescription(), Mantid::MDAlgorithms::ConvertToMDMinMaxLocal::exec(), Mantid::MDAlgorithms::IntegrateEllipsoidsV1::initTargetWSDescr(), Mantid::MDAlgorithms::IntegrateEllipsoidsV2::initTargetWSDescr(), Mantid::MDAlgorithms::SaveIsawQvector::initTargetWSDescr(), Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromEventWS(), and Mantid::MDAlgorithms::IntegrateEllipsoidsTwoStep::qListFromHistoWS().

◆ buildFromMDWS()

void Mantid::MDAlgorithms::MDWSDescription::buildFromMDWS ( const API::IMDEventWorkspace_const_sptr pWS)

method builds MD Event description from existing MD event workspace

the function builds MD event WS description from existing workspace.

Primary used to obtain existing ws parameters

Parameters
pWS– shared pointer to existing MD workspace

Definition at line 142 of file MDWSDescription.cpp.

References Mantid::Geometry::IMDDimension::getDimensionId(), Mantid::Geometry::IMDDimension::getMaximum(), Mantid::Geometry::IMDDimension::getMinimum(), Mantid::Geometry::IMDDimension::getName(), Mantid::Geometry::IMDDimension::getNBins(), Mantid::Geometry::IMDDimension::getUnits(), m_DimIDs, m_DimMax, m_DimMin, m_DimNames, m_DimUnits, m_NBins, m_NDims, and m_Wtransf.

Referenced by Mantid::MDAlgorithms::ConvertToMD::buildTargetWSDescription().

◆ checkMinMaxNdimConsistent()

void Mantid::MDAlgorithms::MDWSDescription::checkMinMaxNdimConsistent ( const std::vector< double > &  minVal,
const std::vector< double > &  maxVal 
)
static

helper function checks if min values are less them max values and are consistent between each other

function verifies the consistency of the min and max dimensions values checking if all necessary values were defined and min values are smaller then max values

Definition at line 346 of file MDWSDescription.cpp.

References std::to_string().

Referenced by setMinMax().

◆ checkWSCorresponsMDWorkspace()

void Mantid::MDAlgorithms::MDWSDescription::checkWSCorresponsMDWorkspace ( const MDWSDescription NewMDWorkspaceD)

compare two descriptions and select the complimentary result.

function compares old workspace description with the new workspace description, defined by the algorithm properties and selects/changes the properties which can be changed through input parameters given that target MD workspace exist

This situation occurs if the base description has been obtained from MD workspace, and one is building a description from other matrix workspace to add new data to the existing workspace. The workspaces have to be comparable.

Parameters
NewMDWorkspaceD– MD workspace description, obtained from algorithm parameters

Definition at line 200 of file MDWSDescription.cpp.

References m_Emode, m_NDims, std::to_string(), and Mantid::Kernel::DeltaEMode::Undefined.

Referenced by Mantid::MDAlgorithms::ConvertToMD::buildTargetWSDescription().

◆ fillAddProperties()

void Mantid::MDAlgorithms::MDWSDescription::fillAddProperties ( const Mantid::API::MatrixWorkspace_const_sptr inWS2D,
const std::vector< std::string > &  dimPropertyNames,
std::vector< coord_t > &  AddCoord 
)
static

function extracts the coordinates from additional workspace properties and places them to AddCoord vector for further usage

function extracts the coordinates from additional workspace properties and places them to proper position within the vector of MD coordinates for the particular workspace.

Parameters
inWS2D– input workspace
dimPropertyNames– names of properties which should be treated as dimensions
AddCoord– vector of additional coordinates (derived from WS properties) for current multidimensional event

Definition at line 323 of file MDWSDescription.cpp.

References Mantid::Kernel::Math::TimeAveragedMean, and value.

Referenced by buildFromMatrixWS().

◆ getAddCoord()

std::vector< coord_t > Mantid::MDAlgorithms::MDWSDescription::getAddCoord ( ) const
inline

◆ getCoordinateSystem()

Mantid::Kernel::SpecialCoordinateSystem Mantid::MDAlgorithms::MDWSDescription::getCoordinateSystem ( ) const
Returns
the special coordinate system if any.

Definition at line 398 of file MDWSDescription.cpp.

References m_coordinateSystem.

Referenced by Mantid::MDAlgorithms::ConvToMDBase::initialize(), and Mantid::MDAlgorithms::ConvToMDEventsWS::initialize().

◆ getDimIDs()

std::vector< std::string > Mantid::MDAlgorithms::MDWSDescription::getDimIDs ( ) const
inline

◆ getDimMax()

std::vector< double > Mantid::MDAlgorithms::MDWSDescription::getDimMax ( ) const
inline

◆ getDimMin()

std::vector< double > Mantid::MDAlgorithms::MDWSDescription::getDimMin ( ) const
inline

◆ getDimNames()

std::vector< std::string > Mantid::MDAlgorithms::MDWSDescription::getDimNames ( ) const
inline

◆ getDimUnits()

std::vector< std::string > Mantid::MDAlgorithms::MDWSDescription::getDimUnits ( ) const
inline

◆ getEMode()

Kernel::DeltaEMode::Type Mantid::MDAlgorithms::MDWSDescription::getEMode ( ) const
inline

◆ getEModeStr()

std::string Mantid::MDAlgorithms::MDWSDescription::getEModeStr ( ) const

Returns symbolic representation of current Emode.

Definition at line 311 of file MDWSDescription.cpp.

References Mantid::Kernel::DeltaEMode::asString(), and m_Emode.

◆ getFrame()

Geometry::MDFrame_uptr Mantid::MDAlgorithms::MDWSDescription::getFrame ( size_t  d) const

Retrieve the md frame.

create the frame

Parameters
d: dimension index to get the frame for.
Returns
MDFrame

Definition at line 386 of file MDWSDescription.cpp.

References Mantid::Geometry::d, m_DimUnits, m_frameKey, and Mantid::Geometry::makeMDFrameFactoryChain().

Referenced by Mantid::MDAlgorithms::MDEventWSWrapper::createEmptyEventWS().

◆ getGoniometerMatr()

Kernel::Matrix< double > Mantid::MDAlgorithms::MDWSDescription::getGoniometerMatr ( ) const

method returns goniometer matrix if one is defined on the workspace or unit matrix if there are no such matrix

Definition at line 131 of file MDWSDescription.cpp.

References m_InWS.

Referenced by Mantid::MDAlgorithms::MDWSTransform::getTransfMatrix().

◆ getInWS()

API::MatrixWorkspace_const_sptr Mantid::MDAlgorithms::MDWSDescription::getInWS ( ) const
inline

◆ getLattice()

std::shared_ptr< Geometry::OrientedLattice > Mantid::MDAlgorithms::MDWSDescription::getLattice ( ) const
inline

◆ getMinMax()

void Mantid::MDAlgorithms::MDWSDescription::getMinMax ( std::vector< double > &  min,
std::vector< double > &  max 
) const

get vector of minimal and maximal values from the class

Definition at line 298 of file MDWSDescription.cpp.

References m_DimMax, and m_DimMin.

Referenced by Mantid::MDAlgorithms::MDTransfModQ::initialize(), Mantid::MDAlgorithms::MDTransfNoQ::initialize(), and Mantid::MDAlgorithms::MDTransfQ3D::initialize().

◆ getNBins()

std::vector< size_t > Mantid::MDAlgorithms::MDWSDescription::getNBins ( ) const
inline

◆ getOrientedLattice()

std::shared_ptr< Geometry::OrientedLattice > Mantid::MDAlgorithms::MDWSDescription::getOrientedLattice ( const Mantid::API::MatrixWorkspace_const_sptr inWS2D)
static

function retrieves copy of the oriented lattice from the workspace

Definition at line 364 of file MDWSDescription.cpp.

◆ getQMode()

std::string Mantid::MDAlgorithms::MDWSDescription::getQMode ( ) const
inline

Definition at line 74 of file MDWSDescription.h.

◆ getTransfMatrix()

std::vector< double > Mantid::MDAlgorithms::MDWSDescription::getTransfMatrix ( ) const
inline

◆ getWSName()

const std::string & Mantid::MDAlgorithms::MDWSDescription::getWSName ( ) const
inline

◆ hasGoniometer()

bool Mantid::MDAlgorithms::MDWSDescription::hasGoniometer ( ) const

◆ hasLattice()

bool Mantid::MDAlgorithms::MDWSDescription::hasLattice ( ) const

◆ isLorentsCorrections()

bool Mantid::MDAlgorithms::MDWSDescription::isLorentsCorrections ( ) const
inline

check if one needs to perform Lorentz corrections

Definition at line 77 of file MDWSDescription.h.

Referenced by Mantid::MDAlgorithms::MDTransfQ3D::initialize().

◆ isPowder()

bool Mantid::MDAlgorithms::MDWSDescription::isPowder ( ) const

Method checks if the workspace is expected to be processed in powder mode.

Definition at line 306 of file MDWSDescription.cpp.

References AlgID, and m_InWS.

Referenced by Mantid::MDAlgorithms::MDWSTransform::getTransfMatrix().

◆ isQ3DMode()

bool Mantid::MDAlgorithms::MDWSDescription::isQ3DMode ( ) const

Is the algorithm running in Q3D mode?

Returns
True only if in Q3D mode

Definition at line 404 of file MDWSDescription.cpp.

References AlgID.

Referenced by Mantid::MDAlgorithms::MDEventWSWrapper::createEmptyEventWS(), and Mantid::MDAlgorithms::MDWSTransform::getTransfMatrix().

◆ nDimensions()

unsigned int Mantid::MDAlgorithms::MDWSDescription::nDimensions ( ) const
inline

◆ resizeDimDescriptions()

void Mantid::MDAlgorithms::MDWSDescription::resizeDimDescriptions ( unsigned int  nDimensions,
size_t  nBins = 10 
)
protected

helper function to resize all vectors, responsible for MD dimensions in one go

Definition at line 244 of file MDWSDescription.cpp.

References m_DimIDs, m_DimNames, m_DimUnits, m_NBins, m_NDims, nDimensions(), and std::to_string().

Referenced by buildFromMatrixWS(), and MDWSDescription().

◆ setAbsMin()

void Mantid::MDAlgorithms::MDWSDescription::setAbsMin ( double  absMin)
inline

◆ setCoordinateSystem()

void Mantid::MDAlgorithms::MDWSDescription::setCoordinateSystem ( const Mantid::Kernel::SpecialCoordinateSystem  system)

Set the special coordinate system if any.

Parameters
system: coordinate system.

Definition at line 377 of file MDWSDescription.cpp.

References m_coordinateSystem.

Referenced by Mantid::MDAlgorithms::MDWSTransform::setQ3DDimensionsNames().

◆ setDimName()

void Mantid::MDAlgorithms::MDWSDescription::setDimName ( unsigned int  nDim,
const std::string &  Name 
)

set specific (non-default) dimension name

Parameters
nDim– number of dimension;
Name– the name to assign into dimension names vector;

Definition at line 31 of file MDWSDescription.cpp.

References m_DimNames, m_NDims, and std::to_string().

Referenced by Mantid::MDAlgorithms::MDWSTransform::setQ3DDimensionsNames().

◆ setDimUnit()

void Mantid::MDAlgorithms::MDWSDescription::setDimUnit ( unsigned int  nDim,
const std::string &  Unit 
)

this is rather misleading function, as MD workspace does not currently have dimension units.

It actually sets the units for the dimension names, which will be displayed along axis and have nothing in common with units, defined by unit factory

Definition at line 43 of file MDWSDescription.cpp.

References m_DimUnits, m_NDims, and std::to_string().

Referenced by Mantid::MDAlgorithms::MDWSTransform::setQ3DDimensionsNames().

◆ setFrame()

void Mantid::MDAlgorithms::MDWSDescription::setFrame ( const std::string &  frameKey)

Set the md frame.

Sets the frame.

Parameters
frameKey: Frame key desired.

Definition at line 395 of file MDWSDescription.cpp.

References m_frameKey.

Referenced by Mantid::MDAlgorithms::MDWSTransform::setQ3DDimensionsNames().

◆ setLorentsCorr()

void Mantid::MDAlgorithms::MDWSDescription::setLorentsCorr ( bool  On = false)
inline

◆ setMinMax()

void Mantid::MDAlgorithms::MDWSDescription::setMinMax ( const std::vector< double > &  minVal,
const std::vector< double > &  maxVal 
)

◆ setNumBins()

void Mantid::MDAlgorithms::MDWSDescription::setNumBins ( const std::vector< int > &  nBins_toSplit)

sets number of bins each dimension is split

function sets number of bins each dimension become split

Parameters
nBins_toSplitvector, containing number of bins each dimension is split into. If the vector contains only one element, each dimension is split according to this element values.

Definition at line 263 of file MDWSDescription.cpp.

References m_NBins, m_NDims, and std::to_string().

Referenced by Mantid::MDAlgorithms::ConvertToMD::buildTargetWSDescription().

◆ setUpMissingParameters()

void Mantid::MDAlgorithms::MDWSDescription::setUpMissingParameters ( const MDWSDescription SourceMatrWS)

copy some parameters from the input workspace, as target md WS do not have all information about the algorithm.

When the workspace has been build from existing MDWrokspace, some target workspace parameters can not be defined, as these parameters are defined by the algorithm and input matrix workspace.

examples are emode or input energy, which is actually source workspace parameters, or some other parameters defined by the transformation algorithm

This method used to define such parameters from MDWS description, build from workspace and the transformation algorithm parameters

Parameters
SourceMatrWS– the MDWS description obtained from input matrix workspace and the algorithm parameters

Definition at line 177 of file MDWSDescription.cpp.

References AlgID, m_AbsMin, m_AddCoord, m_Emode, m_InWS, and m_LorentzCorr.

Referenced by Mantid::MDAlgorithms::ConvertToMD::buildTargetWSDescription().

◆ setWS()

void Mantid::MDAlgorithms::MDWSDescription::setWS ( API::MatrixWorkspace_sptr  otherMatrixWS)

Definition at line 121 of file MDWSDescription.cpp.

References m_InWS.

Member Data Documentation

◆ AlgID

std::string Mantid::MDAlgorithms::MDWSDescription::AlgID

the string which describes ChildAlgorithm, used to convert source ws to target MD ws.

At the moment, it coincides with Q-mode

Definition at line 49 of file MDWSDescription.h.

Referenced by buildFromMatrixWS(), Mantid::MDAlgorithms::SaveIsawQvector::exec(), Mantid::MDAlgorithms::ConvToMDBase::initialize(), isPowder(), isQ3DMode(), and setUpMissingParameters().

◆ m_AbsMin

double Mantid::MDAlgorithms::MDWSDescription::m_AbsMin
protected

hole near origin of Q

Definition at line 157 of file MDWSDescription.h.

Referenced by setUpMissingParameters().

◆ m_AddCoord

std::vector<coord_t> Mantid::MDAlgorithms::MDWSDescription::m_AddCoord
protected

the vector of MD coordinates, which are obtained from workspace properties.

Definition at line 160 of file MDWSDescription.h.

Referenced by buildFromMatrixWS(), and setUpMissingParameters().

◆ m_buildingNewWorkspace

bool Mantid::MDAlgorithms::MDWSDescription::m_buildingNewWorkspace

◆ m_coordinateSystem

Mantid::Kernel::SpecialCoordinateSystem Mantid::MDAlgorithms::MDWSDescription::m_coordinateSystem
private

Coordinate system.

Definition at line 182 of file MDWSDescription.h.

Referenced by getCoordinateSystem(), and setCoordinateSystem().

◆ m_DimIDs

std::vector<std::string> Mantid::MDAlgorithms::MDWSDescription::m_DimIDs
protected

the ID-s for the target workspace, which allow to identify the dimensions according to their ID

Definition at line 166 of file MDWSDescription.h.

Referenced by buildFromMatrixWS(), buildFromMDWS(), and resizeDimDescriptions().

◆ m_DimMax

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

Definition at line 174 of file MDWSDescription.h.

Referenced by buildFromMDWS(), getMinMax(), MDWSDescription(), and setMinMax().

◆ m_DimMin

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

minimal and maximal values for the workspace dimensions.

Usually obtained from WS parameters;

Definition at line 174 of file MDWSDescription.h.

Referenced by buildFromMatrixWS(), buildFromMDWS(), getMinMax(), MDWSDescription(), and setMinMax().

◆ m_DimNames

std::vector<std::string> Mantid::MDAlgorithms::MDWSDescription::m_DimNames
protected

the names for the target workspace dimensions and properties of input MD workspace

Definition at line 163 of file MDWSDescription.h.

Referenced by buildFromMatrixWS(), buildFromMDWS(), resizeDimDescriptions(), and setDimName().

◆ m_DimUnits

std::vector<std::string> Mantid::MDAlgorithms::MDWSDescription::m_DimUnits
protected

the units of target workspace dimensions and properties of input MD workspace dimensions

Definition at line 169 of file MDWSDescription.h.

Referenced by buildFromMatrixWS(), buildFromMDWS(), getFrame(), resizeDimDescriptions(), and setDimUnit().

◆ m_Emode

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

energy transfer analysis mode

Definition at line 153 of file MDWSDescription.h.

Referenced by buildFromMatrixWS(), checkWSCorresponsMDWorkspace(), getEModeStr(), and setUpMissingParameters().

◆ m_frameKey

std::string Mantid::MDAlgorithms::MDWSDescription::m_frameKey
private

Frame key. For frame to use.

Definition at line 184 of file MDWSDescription.h.

Referenced by getFrame(), and setFrame().

◆ m_InWS

API::MatrixWorkspace_sptr Mantid::MDAlgorithms::MDWSDescription::m_InWS
protected

◆ m_LorentzCorr

bool Mantid::MDAlgorithms::MDWSDescription::m_LorentzCorr
protected

if one needs to calculate Lorentz corrections

Definition at line 155 of file MDWSDescription.h.

Referenced by setUpMissingParameters().

◆ m_NBins

std::vector<size_t> Mantid::MDAlgorithms::MDWSDescription::m_NBins
protected

if defined, specifies number of bins split in each dimension

Definition at line 171 of file MDWSDescription.h.

Referenced by buildFromMDWS(), resizeDimDescriptions(), and setNumBins().

◆ m_NDims

unsigned int Mantid::MDAlgorithms::MDWSDescription::m_NDims
protected

the variable which describes the number of the dimensions, in the target workspace.

Calculated from number of input properties and the operations, performed on input workspace;

Definition at line 149 of file MDWSDescription.h.

Referenced by buildFromMatrixWS(), buildFromMDWS(), checkWSCorresponsMDWorkspace(), MDWSDescription(), resizeDimDescriptions(), setDimName(), setDimUnit(), and setNumBins().

◆ m_PreprDetTable

DataObjects::TableWorkspace_const_sptr Mantid::MDAlgorithms::MDWSDescription::m_PreprDetTable

◆ m_RotMatrix

std::vector<double> Mantid::MDAlgorithms::MDWSDescription::m_RotMatrix

◆ m_Wtransf

Kernel::DblMatrix Mantid::MDAlgorithms::MDWSDescription::m_Wtransf

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