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 {
16//-------------------------------------------------------------------------
17// Forward declarations
18//-------------------------------------------------------------------------
19class Unit;
20
24class MANTID_KERNEL_DLL UnitConversion {
25public:
27 static double run(const std::string &src, const std::string &dest, const double srcValue, const double l1,
28 const double l2, const double theta, const DeltaEMode::Type emode, const double efixed);
29 static double run(const std::string &src, const std::string &dest, const double srcValue, const double l1,
30 const DeltaEMode::Type emode, const UnitParametersMap &params = {});
32 static double run(Unit &srcUnit, Unit &destUnit, const double srcValue, const double l1, const DeltaEMode::Type emode,
33 const UnitParametersMap &params = {});
34
36 static double convertToElasticQ(const double theta, const double efixed);
37
38private:
40 static double convertQuickly(const double srcValue, const double factor, const double power);
42 static double convertViaTOF(Unit &srcUnit, Unit &destUnit, const double srcValue, const double l1,
43 const DeltaEMode::Type emode, const UnitParametersMap &params);
44};
45
46} // namespace Kernel
47} // namespace Mantid
A set of static helper methods to perform conversions between units.
The base units (abstract) class.
Definition: Unit.h:41
std::unordered_map< UnitParams, double > UnitParametersMap
Definition: Unit.h:30
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