Mantid
Loading...
Searching...
No Matches
Public Member Functions | List of all members
Mantid::Kernel::Units::Empty Class Reference

Empty unit. More...

Inheritance diagram for Mantid::Kernel::Units::Empty:
Mantid::Kernel::Unit Mantid::Kernel::Units::AtomicDistance Mantid::Kernel::Units::Degrees Mantid::Kernel::Units::Label Mantid::Kernel::Units::Temperature Mantid::Kernel::Units::Phi

Public Member Functions

const std::string caption () const override
 The full name of the unit.
 
Unitclone () const override
 
double conversionTOFMax () const override
 
double conversionTOFMin () const override
 
 Empty ()
 Constructor.
 
void init () override
 Finalize the initialization.
 
bool isConvertible () const override
 Returns if the unit can be used in conversions.
 
const UnitLabel label () const override
 A label for the unit to be printed on axes,.
 
double singleFromTOF (const double tof) const override
 Convert a single tof value to this unit.
 
double singleToTOF (const double x) const override
 Convert a single X value to TOF.
 
const std::string unitID () const override
 "Empty"
 
- Public Member Functions inherited from Mantid::Kernel::Unit
virtual std::pair< double, double > conversionRange () const
 The range where conversion to TOF from given units is monotonic and reversible.
 
double convertSingleFromTOF (const double xvalue, const double &l1, const int &emode, const UnitParametersMap &params)
 Convert from the time-of-flight to the concrete unit. TOF is in microseconds.
 
double convertSingleToTOF (const double xvalue, const double &l1, const int &emode, const UnitParametersMap &params)
 Convert from the concrete unit to time-of-flight. TOF is in microseconds.
 
void fromTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, const UnitParametersMap &params)
 
void fromTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, std::initializer_list< std::pair< const UnitParams, double > > params)
 Convert from time-of-flight to the concrete unit.
 
void initialize (const double &_l1, const int &_emode, const UnitParametersMap &params)
 Initialize the unit to perform conversion using singleToTof() and singleFromTof()
 
bool isInitialized () const
 
bool operator!= (const Unit &u) const
 
bool operator== (const Unit &u) const
 
bool quickConversion (const Unit &destination, double &factor, double &power) const
 Is conversion by constant multiplication possible?
 
bool quickConversion (std::string destUnitName, double &factor, double &power) const
 Is conversion by constant multiplication possible?
 
void toTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, const UnitParametersMap &params)
 
void toTOF (std::vector< double > &xdata, std::vector< double > const &ydata, const double &_l1, const int &_emode, std::initializer_list< std::pair< const UnitParams, double > > params)
 Convert from the concrete unit to time-of-flight.
 
 Unit ()
 (Empty) Constructor
 
virtual ~Unit ()=default
 Virtual destructor.
 

Additional Inherited Members

- Protected Member Functions inherited from Mantid::Kernel::Unit
void addConversion (std::string to, const double &factor, const double &power=1.0) const
 Add a 'quick conversion' from the unit class on which this method is called.
 
virtual void validateUnitParams (const int emode, const UnitParametersMap &params)
 
- Protected Attributes inherited from Mantid::Kernel::Unit
int emode
 emode :: The energy mode (0=elastic, 1=direct geometry, 2=indirect geometry)
 
bool initialized
 The unit values have been initialized.
 
double l1
 l1 :: The source-sample distance (in metres)
 
const UnitParametersMapm_params
 additional parameters l2 :: distance from sample to detector (in metres) twoTheta :: scattering angle in radians efixed :: Value of fixed energy: EI (emode=1) or EF (emode=2) (in meV) difc :: diffractometer constant DIFC
 

Detailed Description

Empty unit.

Definition at line 207 of file Unit.h.

Constructor & Destructor Documentation

◆ Empty()

Mantid::Kernel::Units::Empty::Empty ( )
inline

Constructor.

Definition at line 223 of file Unit.h.

Referenced by clone().

Member Function Documentation

◆ caption()

const std::string Mantid::Kernel::Units::Empty::caption ( ) const
inlineoverridevirtual

The full name of the unit.

Returns
The unit caption

Implements Mantid::Kernel::Unit.

Reimplemented in Mantid::Kernel::Units::Label, Mantid::Kernel::Units::Phi, and Mantid::Kernel::Units::Temperature.

Definition at line 210 of file Unit.h.

◆ clone()

Unit * Mantid::Kernel::Units::Empty::clone ( ) const
overridevirtual
Returns
a cloned instance of the other

Implements Mantid::Kernel::Unit.

Reimplemented in Mantid::Kernel::Units::Label, Mantid::Kernel::Units::Phi, and Mantid::Kernel::Units::Temperature.

Definition at line 234 of file Unit.cpp.

References Empty().

◆ conversionTOFMax()

double Mantid::Kernel::Units::Empty::conversionTOFMax ( ) const
overridevirtual
Returns
NaN as Label can not be obtained from TOF in any reasonable manner

Implements Mantid::Kernel::Unit.

Definition at line 244 of file Unit.cpp.

◆ conversionTOFMin()

double Mantid::Kernel::Units::Empty::conversionTOFMin ( ) const
overridevirtual
Returns
NaN as Label can not be obtained from TOF in any reasonable manner

Implements Mantid::Kernel::Unit.

Definition at line 239 of file Unit.cpp.

◆ init()

void Mantid::Kernel::Units::Empty::init ( )
overridevirtual

Finalize the initialization.

This will be overridden by subclasses as needed.

Implements Mantid::Kernel::Unit.

Definition at line 222 of file Unit.cpp.

◆ isConvertible()

bool Mantid::Kernel::Units::Empty::isConvertible ( ) const
inlineoverridevirtual

Returns if the unit can be used in conversions.

Returns
true if the unit can be used in unit conversions

Reimplemented from Mantid::Kernel::Unit.

Definition at line 213 of file Unit.h.

◆ label()

const UnitLabel Mantid::Kernel::Units::Empty::label ( ) const
overridevirtual

A label for the unit to be printed on axes,.

See also
UnitLabel
Returns
The unit label

Implements Mantid::Kernel::Unit.

Reimplemented in Mantid::Kernel::Units::Label, and Mantid::Kernel::Units::Temperature.

Definition at line 220 of file Unit.cpp.

References Mantid::Kernel::Units::Symbol::EmptyLabel.

◆ singleFromTOF()

double Mantid::Kernel::Units::Empty::singleFromTOF ( const double  tof) const
overridevirtual

Convert a single tof value to this unit.

Parameters
tofvalue to convert
Returns
the value in this unit as converted.

Implements Mantid::Kernel::Unit.

Reimplemented in Mantid::Kernel::Units::Temperature.

Definition at line 229 of file Unit.cpp.

References unitID(), and UNUSED_ARG.

◆ singleToTOF()

double Mantid::Kernel::Units::Empty::singleToTOF ( const double  x) const
overridevirtual

Convert a single X value to TOF.

Parameters
xvalue to convert
Returns
the TOF as converted.

Implements Mantid::Kernel::Unit.

Reimplemented in Mantid::Kernel::Units::Temperature.

Definition at line 224 of file Unit.cpp.

References unitID(), UNUSED_ARG, and Mantid::Geometry::x.

◆ unitID()

const std::string Mantid::Kernel::Units::Empty::unitID ( ) const
overridevirtual

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