Mantid
Loading...
Searching...
No Matches
UnitConversion.h
Go to the documentation of this file.
1// Mantid Repository : https://github.com/mantidproject/mantid
2//
3// Copyright © 2012 ISIS Rutherford Appleton Laboratory UKRI,
4// NScD Oak Ridge National Laboratory, European Spallation Source,
5// Institut Laue - Langevin & CSNS, Institute of High Energy Physics, CAS
6// SPDX - License - Identifier: GPL - 3.0 +
7#pragma once
8
10#include "MantidKernel/DllConfig.h"
11#include "MantidKernel/Unit.h"
12#include <string>
13
14namespace Mantid {
15namespace Kernel {
19class MANTID_KERNEL_DLL UnitConversion {
20public:
22 static double run(const std::string &src, const std::string &dest, const double srcValue, const double l1,
23 const double l2, const double theta, const DeltaEMode::Type emode, const double efixed);
24 static double run(const std::string &src, const std::string &dest, const double srcValue, const double l1,
25 const DeltaEMode::Type emode, const UnitParametersMap &params = {});
27 static double run(Unit &srcUnit, Unit &destUnit, const double srcValue, const double l1, const DeltaEMode::Type emode,
28 const UnitParametersMap &params = {});
29
31 static double convertToElasticQ(const double theta, const double efixed);
32
33private:
35 static double convertQuickly(const double srcValue, const double factor, const double power);
37 static double convertViaTOF(Unit &srcUnit, Unit &destUnit, const double srcValue, const double l1,
38 const DeltaEMode::Type emode, const UnitParametersMap &params);
39};
40
41} // namespace Kernel
42} // namespace Mantid
A set of static helper methods to perform conversions between units.
The base units (abstract) class.
Definition Unit.h:40
std::unordered_map< UnitParams, double > UnitParametersMap
Definition Unit.h:29
Helper class which provides the Collimation Length for SANS instruments.
Type
Define the available energy transfer modes It is important to assign enums proper numbers,...
Definition DeltaEMode.h:29