|
Mantid
|
Wavelength in Angstrom. More...
#include <Unit.h>
Public Member Functions | |
| const std::string | caption () const override |
| The full name of the unit. More... | |
| Unit * | clone () const override |
| double | conversionTOFMax () const override |
| double | conversionTOFMin () const override |
| void | init () override |
| Finalize the initialization. More... | |
| const UnitLabel | label () const override |
| A label for the unit to be printed on axes,. More... | |
| double | singleFromTOF (const double tof) const override |
| Convert a single tof value to this unit. More... | |
| double | singleToTOF (const double x) const override |
| Convert a single X value to TOF. More... | |
| const std::string | unitID () const override |
| "Wavelength" More... | |
| Wavelength () | |
| Constructor. More... | |
Public Member Functions inherited from Mantid::Kernel::Unit | |
| virtual const std::string | caption () const =0 |
| The full name of the unit. More... | |
| virtual Unit * | clone () const =0 |
| virtual std::pair< double, double > | conversionRange () const |
| The range where conversion to TOF from given units is monotonic and reversible. More... | |
| virtual double | conversionTOFMax () const =0 |
| This function returns maximal TOF value still reversibly convertible into the unit. More... | |
| virtual double | conversionTOFMin () const =0 |
| some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF value still reversibly convertible into the unit. More... | |
| double | convertSingleFromTOF (const double xvalue, const double &l1, const int &emode, const UnitParametersMap ¶ms) |
| Convert from the time-of-flight to the concrete unit. More... | |
| double | convertSingleToTOF (const double xvalue, const double &l1, const int &emode, const UnitParametersMap ¶ms) |
| Convert from the concrete unit to time-of-flight. More... | |
| void | fromTOF (std::vector< double > &xdata, std::vector< double > &ydata, const double &_l1, const int &_emode, const UnitParametersMap ¶ms) |
| void | fromTOF (std::vector< double > &xdata, std::vector< double > &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. More... | |
| virtual void | init ()=0 |
| Finalize the initialization. More... | |
| void | initialize (const double &_l1, const int &_emode, const UnitParametersMap ¶ms) |
| Initialize the unit to perform conversion using singleToTof() and singleFromTof() More... | |
| virtual bool | isConvertible () const |
| Returns if the unit can be used in conversions. More... | |
| bool | isInitialized () const |
| virtual const UnitLabel | label () const =0 |
| A label for the unit to be printed on axes,. More... | |
| 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? More... | |
| bool | quickConversion (std::string destUnitName, double &factor, double &power) const |
| Is conversion by constant multiplication possible? More... | |
| virtual double | singleFromTOF (const double tof) const =0 |
| Convert a single tof value to this unit. More... | |
| virtual double | singleToTOF (const double x) const =0 |
| Convert a single X value to TOF. More... | |
| void | toTOF (std::vector< double > &xdata, std::vector< double > &ydata, const double &_l1, const int &_emode, const UnitParametersMap ¶ms) |
| void | toTOF (std::vector< double > &xdata, std::vector< double > &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. More... | |
| Unit () | |
| (Empty) Constructor More... | |
| virtual const std::string | unitID () const =0 |
| The name of the unit. More... | |
| virtual | ~Unit ()=default |
| Virtual destructor. More... | |
Protected Member Functions | |
| void | validateUnitParams (const int emode, const UnitParametersMap ¶ms) override |
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. More... | |
| virtual void | validateUnitParams (const int emode, const UnitParametersMap ¶ms) |
Protected Attributes | |
| bool | do_sfpFrom |
| Apply the sfpFrom value. More... | |
| double | efixed |
| double | factorFrom |
| Constant factor for from conversion. More... | |
| double | factorTo |
| Constant factor for to conversion. More... | |
| double | sfpFrom |
| Extra correction factor in from conversion. More... | |
| double | sfpTo |
| Extra correction factor in to conversion. More... | |
Protected Attributes inherited from Mantid::Kernel::Unit | |
| int | emode |
| emode :: The energy mode (0=elastic, 1=direct geometry, 2=indirect geometry) More... | |
| bool | initialized |
| The unit values have been initialized. More... | |
| double | l1 |
| l1 :: The source-sample distance (in metres) More... | |
| const UnitParametersMap * | m_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 More... | |
Wavelength in Angstrom.
| Mantid::Kernel::Units::Wavelength::Wavelength | ( | ) |
Constructor.
Definition at line 307 of file Unit.cpp.
References Mantid::PhysicalConstants::h, Mantid::PhysicalConstants::meV, Mantid::PhysicalConstants::meVtoWavenumber, and Mantid::PhysicalConstants::NeutronMass.
Referenced by clone().
|
inlineoverridevirtual |
The full name of the unit.
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
|
overridevirtual |
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
Definition at line 420 of file Unit.cpp.
References Wavelength().
|
overridevirtual |
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
|
overridevirtual |
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
Definition at line 402 of file Unit.cpp.
References Mantid::Kernel::Unit::emode, and sfpTo.
Referenced by Mantid::Kernel::Units::SpinEchoLength::conversionTOFMin().
|
overridevirtual |
Finalize the initialization.
This will be overridden by subclasses as needed.
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
Definition at line 332 of file Unit.cpp.
References do_sfpFrom, Mantid::Kernel::efixed, efixed, Mantid::Kernel::Unit::emode, factorFrom, factorTo, Mantid::PhysicalConstants::h, Mantid::Kernel::Unit::l1, Mantid::Kernel::l2, Mantid::Kernel::Unit::m_params, Mantid::PhysicalConstants::meV, Mantid::PhysicalConstants::NeutronMass, sfpFrom, and sfpTo.
Referenced by Mantid::Kernel::Units::SpinEchoLength::init(), and Mantid::Kernel::Units::SpinEchoTime::init().
|
overridevirtual |
A label for the unit to be printed on axes,.
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
Definition at line 317 of file Unit.cpp.
References Mantid::Kernel::Units::Symbol::Angstrom.
|
overridevirtual |
Convert a single tof value to this unit.
| tof | value to convert |
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
Definition at line 393 of file Unit.cpp.
References do_sfpFrom, factorFrom, sfpFrom, and Mantid::Geometry::x.
Referenced by Mantid::Crystal::PeakHKLErrors::createNewPeak(), Mantid::Crystal::SCDCalibratePanels::findT0(), Mantid::Kernel::Units::SpinEchoLength::singleFromTOF(), and Mantid::Kernel::Units::SpinEchoTime::singleFromTOF().
|
overridevirtual |
Convert a single X value to TOF.
| x | value to convert |
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
Definition at line 386 of file Unit.cpp.
References Mantid::Kernel::Unit::emode, factorTo, sfpTo, and Mantid::Geometry::x.
Referenced by Mantid::Kernel::Units::SpinEchoLength::singleToTOF(), and Mantid::Kernel::Units::SpinEchoTime::singleToTOF().
|
overridevirtual |
"Wavelength"
Implements Mantid::Kernel::Unit.
Reimplemented in Mantid::Kernel::Units::SpinEchoLength, and Mantid::Kernel::Units::SpinEchoTime.
Referenced by validateUnitParams().
|
overrideprotectedvirtual |
Reimplemented from Mantid::Kernel::Unit.
Definition at line 319 of file Unit.cpp.
References Mantid::Kernel::efixed, Mantid::Kernel::l2, and unitID().
|
protected |
Apply the sfpFrom value.
Definition at line 326 of file Unit.h.
Referenced by init(), and singleFromTOF().
|
protected |
|
protected |
Constant factor for from conversion.
Definition at line 325 of file Unit.h.
Referenced by init(), and singleFromTOF().
|
protected |
Constant factor for to conversion.
Definition at line 323 of file Unit.h.
Referenced by conversionTOFMax(), init(), and singleToTOF().
|
protected |
Extra correction factor in from conversion.
Definition at line 324 of file Unit.h.
Referenced by init(), and singleFromTOF().
|
protected |
Extra correction factor in to conversion.
Definition at line 322 of file Unit.h.
Referenced by conversionTOFMax(), conversionTOFMin(), init(), and singleToTOF().