28 auto it = params->find(param);
29 if (it != params->end()) {
91 std::transform(destUnitName.begin(), destUnitName.end(), destUnitName.begin(), toupper);
92 auto iter = it->second.find(destUnitName);
94 if (iter == it->second.end())
98 factor = iter->second.first;
99 power = iter->second.second;
114 std::transform(to.begin(), to.end(), to.begin(), toupper);
147void Unit::toTOF(std::vector<double> &xdata, std::vector<double> &ydata,
const double &_l1,
const int &_emode,
148 std::initializer_list<std::pair<const UnitParams, double>> params) {
150 toTOF(xdata, ydata, _l1, _emode, paramsMap);
153void Unit::toTOF(std::vector<double> &xdata, std::vector<double> &ydata,
const double &_l1,
const int &_emode,
157 size_t numX = xdata.size();
158 for (
size_t i = 0; i < numX; i++)
177void Unit::fromTOF(std::vector<double> &xdata, std::vector<double> &ydata,
const double &_l1,
const int &_emode,
178 std::initializer_list<std::pair<const UnitParams, double>> params) {
180 fromTOF(xdata, ydata, _l1, _emode, paramsMap);
183void Unit::fromTOF(std::vector<double> &xdata, std::vector<double> &ydata,
const double &_l1,
const int &_emode,
187 size_t numX = xdata.size();
188 for (
size_t i = 0; i < numX; i++)
208 return std::pair<double, double>(std::min(u1, u2), std::max(u1, u2));
308 :
Unit(),
efixed(0.), sfpTo(DBL_MIN), factorTo(DBL_MIN), sfpFrom(DBL_MIN), factorFrom(DBL_MIN), do_sfpFrom(false) {
309 const double AngstromsSquared = 1e20;
312 addConversion(
"Energy", factor, -2.0);
314 addConversion(
"Momentum", 2 * M_PI, -1.0);
321 throw std::runtime_error(
"An l2 value must be supplied in the extra "
322 "parameters when initialising " +
323 this->
unitID() +
" for conversion via TOF");
326 throw std::runtime_error(
"An efixed value must be supplied in the extra "
327 "parameters when initialising " +
328 this->
unitID() +
" for conversion via TOF");
336 double TOFisinMicroseconds = 1e6;
337 double toAngstroms = 1e10;
347 }
else if (
emode == 2) {
356 factorTo *= TOFisinMicroseconds / toAngstroms;
367 }
else if (
emode == 2)
383 factorFrom *= toAngstroms / TOFisinMicroseconds;
435 const double toAngstroms = 1e10;
436 const double factor =
444 throw std::runtime_error(
"An l2 value must be supplied in the extra "
445 "parameters when initialising " +
446 this->
unitID() +
" for conversion via TOF");
454 const double TOFinMicroseconds = 1e6;
458 const double TOFisinMicroseconds = 1e-12;
459 const double ltot =
l1 +
l2;
497 const double toAngstroms = 1e10;
498 const double factor =
508 throw std::runtime_error(
"An l2 value must be supplied in the extra "
509 "parameters when initialising " +
510 this->
unitID() +
" for conversion via TOF");
518 const double TOFinMicroseconds = 1e6;
521 (
l1 +
l2) * TOFinMicroseconds;
524 const double TOFisinMicroseconds = 1e-12;
525 const double ltot =
l1 +
l2;
571 std::stringstream msg;
572 msg <<
"Encountered offset of " << offset <<
" which converts data to negative d-spacing\n";
573 throw std::logic_error(msg.str());
576 auto sinTheta = std::sin(
twoTheta / 2);
578 const double numerator = (1.0 + offset);
579 sinTheta *= (l1 +
l2);
581 return (numerator *
CONSTANT) / sinTheta;
587 const double factor = 2.0 * M_PI;
588 addConversion(
"MomentumTransfer", factor, -1.0);
589 addConversion(
"QSquared", (factor * factor), -2.0);
604 toDSpacingError =
"Cannot convert to d spacing with DIFA=0 and DIFC=0";
608 toDSpacingError =
"A positive difc value must be supplied in the extra parameters when "
610 this->
unitID() +
" for conversion via TOF";
614 throw std::runtime_error(
"A difc value or L2/two theta must be supplied "
615 "in the extra parameters when initialising " +
616 this->
unitID() +
" for conversion via TOF");
651 throw std::runtime_error(
"dSpacingBase::singleToTOF called before object "
652 "has been initialized.");
678 throw std::runtime_error(
"dSpacingBase::singleFromTOF called before object "
679 "has been initialized.");
685 const double negativeConstantTerm = tof -
tzero;
691 return negativeConstantTerm /
difc;
696 throw std::runtime_error(
"Cannot convert to d spacing because tzero > time-of-flight and difa is positive. "
697 "Quadratic doesn't have a positive root");
711 const double sqrtTerm = 1 + 4 *
difa * negativeConstantTerm / (
difc *
difc);
713 throw std::runtime_error(
"Cannot convert to d spacing. Quadratic doesn't have real roots");
717 if (negativeConstantTerm < 0)
719 return negativeConstantTerm / (0.5 *
difc * (1 - sqrt(sqrtTerm)));
722 return negativeConstantTerm / (0.5 *
difc * (1 + sqrt(sqrtTerm)));
733 if (TOFmin < std::numeric_limits<double>::min()) {
747 if (std::isinf(TOFmax)) {
782 throw std::runtime_error(
"A l2 value must be supplied in the extra parameters when "
784 this->
unitID() +
" for conversion via TOF");
787 throw std::runtime_error(
"A two theta value must be supplied in the extra parameters when "
789 this->
unitID() +
" for conversion via TOF");
800 const double TOFisinMicroseconds = 1e6;
801 const double toAngstroms = 1e10;
802 factorTo *= TOFisinMicroseconds / toAngstroms;
806 double cos_theta = cos(
twoTheta / 2.0);
809 sfpTo = 2.0 * log(cos_theta);
814 double sqrtarg =
x *
x +
sfpTo;
816 if (sqrtarg < 1.0e-17)
822 return sqrt(temp * temp -
sfpFrom);
841 const double factor = 2.0 * M_PI;
849 throw std::runtime_error(
"A difc value or L2/two theta must be supplied "
850 "in the extra parameters when initialising " +
851 this->
unitID() +
" for conversion via TOF");
890 const double factor = 2.0 * M_PI;
899 double tofmax = 2 * M_PI *
difc / sqrt(DBL_MIN);
900 if (std::isinf(tofmax))
916 :
Unit(), factorTo(DBL_MIN), factorFrom(DBL_MIN), t_other(DBL_MIN), t_otherFrom(DBL_MIN), unitScaling(DBL_MIN) {
923 throw std::invalid_argument(
"emode must be equal to 1 or 2 for energy transfer calculation");
929 throw std::invalid_argument(
"efixed must be set for energy transfer calculation");
931 throw std::runtime_error(
"efixed must be set for energy transfer calculation");
935 throw std::runtime_error(
"efixed must be greater than zero");
938 throw std::runtime_error(
"A l2 value must be supplied in the extra parameters when "
940 this->
unitID() +
" for conversion via TOF");
948 const double TOFinMicroseconds = 1e6;
954 }
else if (
emode == 2) {
967 }
else if (
emode == 2) {
984 const double this_t =
factorTo / sqrt(e2);
987 }
else if (
emode == 2) {
993 const double this_t =
factorTo / sqrt(e1);
1008 const double e2 =
factorFrom / (this_t * this_t);
1011 }
else if (
emode == 2) {
1017 const double e1 =
factorFrom / (this_t * this_t);
1025 double time(DBL_MAX);
1105 :
Unit(),
efixed(0.), sfpTo(DBL_MIN), factorTo(DBL_MIN), sfpFrom(DBL_MIN), factorFrom(DBL_MIN), do_sfpFrom(false) {
1107 const double AngstromsSquared = 1e20;
1119 throw std::runtime_error(
"An l2 value must be supplied in the extra parameters when "
1120 "initialising momentum for conversion via TOF");
1123 throw std::runtime_error(
"An efixed value must be supplied in the extra parameters when "
1124 "initialising momentum for conversion via TOF");
1132 double TOFisinMicroseconds = 1e6;
1133 double toAngstroms = 1e10;
1143 }
else if (
emode == 2) {
1152 factorTo *= TOFisinMicroseconds / toAngstroms;
1163 }
else if (
emode == 2)
1178 factorFrom *= toAngstroms / TOFisinMicroseconds;
1231 throw std::invalid_argument(
"efixed must be set for spin echo length calculation");
1233 throw std::invalid_argument(
"emode must be equal to 0 for spin echo length calculation");
1239 double wavelength = sqrt(
x /
efixed);
1249 double sel = sqrt(DBL_MAX);
1259 double x =
efixed * wavelength * wavelength;
1281 throw std::invalid_argument(
"efixed must be set for spin echo time calculation");
1283 throw std::invalid_argument(
"emode must be equal to 0 for spin echo time calculation");
1289 double wavelength = pow(
x /
efixed, 1.0 / 3.0);
1295 double tm = std::pow(DBL_MAX, 1. / 3.);
1303 double x =
efixed * wavelength * wavelength * wavelength;
1325 throw std::runtime_error(
"Time is not allowed to be convert to TOF. ");
1330 throw std::runtime_error(
"Time is not allowed to be converted from TOF. ");
1355 throw std::runtime_error(
"Degrees is not allowed to be converted to TOF. ");
1360 throw std::runtime_error(
"Degrees is not allowed to be converted from TOF. ");
1389 throw std::runtime_error(
"Temperature is not allowed to be converted to TOF. ");
1394 throw std::runtime_error(
"Temperature is not allowed to be converted from TOF. ");
1421 throw std::runtime_error(
"Atomic Distance is not allowed to be converted to TOF. ");
1426 throw std::runtime_error(
"Atomic Distance is not allowed to be converted from TOF. ");
1436 std::map<std::string, double> timesList;
1437 double seconds = 1.0e9;
1438 double milliseconds = 1.0e-3 * seconds;
1439 double microseconds = 1.0e-3 * milliseconds;
1440 double nanoseconds = 1.0e-3 * microseconds;
1442 timesList[
"seconds"] = seconds;
1443 timesList[
"second"] = seconds;
1444 timesList[
"s"] = seconds;
1445 timesList[
"milliseconds"] = milliseconds;
1446 timesList[
"millisecond"] = milliseconds;
1447 timesList[
"ms"] = milliseconds;
1448 timesList[
"microseconds"] = microseconds;
1449 timesList[
"microsecond"] = microseconds;
1450 timesList[
"us"] = microseconds;
1451 timesList[
"nanoseconds"] = nanoseconds;
1452 timesList[
"nanosecond"] = nanoseconds;
1453 timesList[
"ns"] = nanoseconds;
1455 double input_float = timesList[input_unit];
1456 double output_float = timesList[output_unit];
1457 if (input_float == 0)
1458 throw std::runtime_error(
"timeConversionValue: input unit " + input_unit +
" not known.");
1459 if (output_float == 0)
1460 throw std::runtime_error(
"timeConversionValue: output unit " + input_unit +
" not known.");
1461 return input_float / output_float;
#define UNUSED_ARG(x)
Function arguments are sometimes unused in certain implmentations but are required for documentation ...
#define DECLARE_UNIT(classname)
Marks code as not implemented yet.
void warning(const std::string &msg)
Logs at warning level.
A base-class for the a class that is able to return unit labels in different representations.
The base units (abstract) class.
const UnitParametersMap * m_params
additional parameters l2 :: distance from sample to detector (in metres) twoTheta :: scattering angle...
bool operator!=(const Unit &u) const
virtual void init()=0
Finalize the initialization.
virtual std::pair< double, double > conversionRange() const
The range where conversion to TOF from given units is monotonic and reversible.
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.
virtual double conversionTOFMin() const =0
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
virtual double conversionTOFMax() const =0
This function returns maximal TOF value still reversibly convertible into the unit.
virtual double singleToTOF(const double x) const =0
Convert a single X value to TOF.
bool initialized
The unit values have been initialized.
void initialize(const double &_l1, const int &_emode, const UnitParametersMap ¶ms)
Initialize the unit to perform conversion using singleToTof() and singleFromTof()
Unit()
(Empty) Constructor
tbb::concurrent_unordered_map< std::string, UnitConversions > ConversionsMap
The possible 'quick conversions' are held in a map with the starting unit as the key.
double convertSingleToTOF(const double xvalue, const double &l1, const int &emode, const UnitParametersMap ¶ms)
Convert from the concrete unit to time-of-flight.
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.
virtual const std::string unitID() const =0
The name of the unit.
double convertSingleFromTOF(const double xvalue, const double &l1, const int &emode, const UnitParametersMap ¶ms)
Convert from the time-of-flight to the concrete unit.
virtual double singleFromTOF(const double tof) const =0
Convert a single tof value to this unit.
bool quickConversion(const Unit &destination, double &factor, double &power) const
Is conversion by constant multiplication possible?
double l1
l1 :: The source-sample distance (in metres)
bool operator==(const Unit &u) const
static ConversionsMap s_conversionFactors
The table of possible 'quick conversions'.
int emode
emode :: The energy mode (0=elastic, 1=direct geometry, 2=indirect geometry)
bool isInitialized() const
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 ¶ms)
Atomic Distance in Angstroms.
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
void init() override
Finalize the initialization.
double conversionTOFMax() const override
double singleToTOF(const double x) const override
Convert a single X value to TOF.
double conversionTOFMin() const override
const UnitLabel label() const override
A label for the unit to be printed on axes,.
Unit * clone() const override
Degrees that has degrees as unit and "Scattering angle" as title.
Unit * clone() const override
double conversionTOFMax() const override
void init() override
Finalize the initialization.
const UnitLabel label() const override
A label for the unit to be printed on axes,.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
double conversionTOFMin() const override
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
Energy transfer in units of frequency (MHz)
DeltaE_inFrequency()
Constructor.
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
void init() override
Finalize the initialization.
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
Unit * clone() const override
Energy transfer in units of wavenumber (cm^-1)
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
Unit * clone() const override
DeltaE_inWavenumber()
Constructor.
void init() override
Finalize the initialization.
Energy transfer in milli-electronvolts.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
const std::string unitID() const override
"DeltaE"
Unit * clone() const override
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
void validateUnitParams(const int emode, const UnitParametersMap ¶ms) override
void init() override
Finalize the initialization.
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
double factorFrom
Constant factor for from conversion.
double factorTo
Constant factor for to conversion.
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
double t_otherFrom
Energy mode dependent factor in from conversion.
double unitScaling
Apply unit scaling to energy value.
double t_other
Energy mode dependent factor in to conversion.
double conversionTOFMin() const override
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.
void init() override
Finalize the initialization.
Unit * clone() const override
double conversionTOFMax() const override
const std::string unitID() const override
"Empty"
Absolute energy in units of wavenumber (cm^-1)
const std::string unitID() const override
"Energy_inWavenumber"
double factorFrom
Constant factor for from conversion.
Unit * clone() const override
void validateUnitParams(const int emode, const UnitParametersMap ¶ms) override
double factorTo
Constant factor for to conversion.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
void init() override
Finalize the initialization.
Energy_inWavenumber()
Constructor.
double conversionTOFMin() const override
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
Energy in milli-electronvolts.
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
void validateUnitParams(const int emode, const UnitParametersMap ¶ms) override
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
const std::string unitID() const override
"Energy"
void init() override
Finalize the initialization.
double conversionTOFMin() const override
Unit * clone() const override
double factorTo
Constant factor for to conversion.
double factorFrom
Constant factor for from conversion.
const std::string caption() const override
The full name of the unit.
std::string m_caption
Caption.
const UnitLabel label() const override
A label for the unit to be printed on axes,.
Unit * clone() const override
void setLabel(const std::string &cpt, const UnitLabel &lbl=UnitLabel(""))
Set a caption and a label.
Momentum Transfer in Angstrom^-1.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
Unit * clone() const override
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
const std::string unitID() const override
"MomentumTransfer"
MomentumTransfer()
Constructor.
void validateUnitParams(const int emode, const UnitParametersMap ¶ms) override
void init() override
Finalize the initialization.
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
double sfpTo
Extra correction factor in to conversion.
void validateUnitParams(const int emode, const UnitParametersMap ¶ms) override
double sfpFrom
Extra correction factor in from conversion.
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
void init() override
Finalize the initialization.
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
bool do_sfpFrom
Apply the sfpFrom value.
double singleToTOF(const double ki) const override
Convert a single X value to TOF.
Unit * clone() const override
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
double factorTo
Constant factor for to conversion.
double factorFrom
Constant factor for from conversion.
Phi that has degrees as unit and "Phi" as title.
Momentum transfer squared in Angstrom^-2.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
Unit * clone() const override
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
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.
SpinEchoLength()
Constructor.
double conversionTOFMax() const override
double conversionTOFMin() const override
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
Unit * clone() const override
void init() override
Finalize the initialization.
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.
double conversionTOFMax() const override
double conversionTOFMin() const override
SpinEchoTime()
Constructor.
void init() override
Finalize the initialization.
Unit * clone() const override
A simple class containing common symbol types.
static const UnitLabel InverseAngstrom
InverseAngstrom.
static const UnitLabel InverseAngstromSq
InverseAngstromSq.
static const UnitLabel Microsecond
Microsecond.
static const UnitLabel Angstrom
Angstrom.
static const UnitLabel Second
Second.
static const UnitLabel Nanometre
Nanometre.
static const UnitLabel MilliElectronVolts
MilliElectronVolts.
static const UnitLabel Nanosecond
Nanosecond.
static const UnitLabel GHz
GHz.
static const UnitLabel InverseCM
Inverse centimeters.
static const UnitLabel EmptyLabel
Empty label.
Time of flight in microseconds.
void init() override
Finalize the initialization.
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
Unit * clone() const override
double conversionTOFMax() const override
double singleToTOF(const double x) const override
Convert a single X value to TOF.
double conversionTOFMin() const override
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.
double conversionTOFMin() const override
double conversionTOFMax() const override
Unit * clone() const override
void init() override
Finalize the initialization.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
void init() override
Finalize the initialization.
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
Unit * clone() const override
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
const UnitLabel label() const override
A label for the unit to be printed on axes,.
const std::string unitID() const override
"Wavelength"
bool do_sfpFrom
Apply the sfpFrom value.
double sfpFrom
Extra correction factor in from conversion.
void init() override
Finalize the initialization.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
double factorTo
Constant factor for to conversion.
double sfpTo
Extra correction factor in to conversion.
double conversionTOFMin() const override
void validateUnitParams(const int emode, const UnitParametersMap ¶ms) override
double conversionTOFMax() const override
double factorFrom
Constant factor for from conversion.
Unit * clone() const override
d-SpacingPerpendicular in Angstrom
Unit * clone() const override
dSpacingPerpendicular()
Constructor.
double sfpFrom
Extra correction factor in to conversion.
double factorFrom
Constant factor for from conversion.
void validateUnitParams(const int emode, const UnitParametersMap ¶ms) override
double factorTo
Constant factor for to conversion.
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
double singleFromTOF(const double tof) const override
Convert a single tof value to this unit.
const std::string unitID() const override
"dSpacingPerpendicular"
void init() override
Finalize the initialization.
double sfpTo
Extra correction factor in to conversion.
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
std::string toDSpacingError
double conversionTOFMax() const override
This function returns maximal TOF value still reversibly convertible into the unit.
const UnitLabel label() const override
A label for the unit to be printed on axes,.
const std::string unitID() const override
"dSpacing"
void validateUnitParams(const int emode, const UnitParametersMap ¶ms) override
double conversionTOFMin() const override
some units can be converted from TOF only in the range of TOF ; This function returns minimal TOF val...
Unit * clone() const override
double calcTofMax(const double difc, const double difa, const double tzero, const double tofmax=0.)
void init() override
Finalize the initialization.
double calcTofMin(const double difc, const double difa, const double tzero, const double tofmin=0.)
double singleFromTOF(const double tof) const override
DIFA * d^2 + DIFC * d + T0 - TOF = 0.
double singleToTOF(const double x) const override
Convert a single X value to TOF.
Logger g_log("DateAndTime")
MANTID_KERNEL_DLL double tofToDSpacingFactor(const double l1, const double l2, const double twoTheta, const double offset)
Calculate and return conversion factor from tof to d-spacing.
MANTID_KERNEL_DLL double timeConversionValue(const std::string &input_unit, const std::string &output_unit)
std::unordered_map< UnitParams, double > UnitParametersMap
static constexpr double meVtoFrequency
1 meV in frequency (GHz).
static constexpr double NeutronMass
Mass of the neutron in kg.
static constexpr double h
Planck constant in J*s.
static constexpr double meVtoWavenumber
1 meV in wavenumber (cm-1).
static constexpr double meV
1 meV in Joules.