![]() |
GGEMS
1.1
GPU GEant4-based Monte Carlo Simulations
|
Namespace storing all the usefull physical units. More...
#include <algorithm>#include <sstream>#include <cfloat>#include <iostream>#include "GGEMS/tools/GGEMSTools.hh"

Go to the source code of this file.
Namespaces | |
| anonymous_namespace{GGEMSSystemOfUnits.hh} | |
| empty namespace storing prefix unit | |
Macros | |
| #define | __constant inline static constexpr |
| __constant is known for OpenCL, but for C++ we define __constant as a constexpr More... | |
Functions | |
| template<typename T > | |
| std::string | BestDistanceUnit (T const &value) |
| Choose best distance unit. More... | |
| template<typename T > | |
| T | DistanceUnit (T const &value, std::string const &unit) |
| Choose best distance unit. More... | |
| template<typename T > | |
| std::string | BestEnergyUnit (T const &value) |
| Choose best energy unit, mega is the reference. More... | |
| template<typename T > | |
| T | EnergyUnit (T const &value, std::string const &unit) |
| Choose best energy unit. More... | |
| template<typename T > | |
| T | AngleUnit (T const &value, std::string const &unit) |
| Choose best angle unit. More... | |
| template<typename T > | |
| T | DensityUnit (T const &value, std::string const &unit) |
| Choose best density unit. More... | |
| std::string | BestDigitalUnit (GGulong const &value) |
| Choose best digital unit. More... | |
Namespace storing all the usefull physical units.
Definition in file GGEMSSystemOfUnits.hh.
| #define __constant inline static constexpr |
__constant is known for OpenCL, but for C++ we define __constant as a constexpr
Definition at line 43 of file GGEMSSystemOfUnits.hh.
Choose best angle unit.
| T | - type of the value to convert unit |
| value | - value to check |
| unit | - angle unit |
Definition at line 360 of file GGEMSSystemOfUnits.hh.
|
inline |
Choose best digital unit.
| value | - value to convert to best unit |
Definition at line 425 of file GGEMSSystemOfUnits.hh.
|
inline |
Choose best distance unit.
| T | - type of the value |
| value | - value to convert to best unit |
Definition at line 217 of file GGEMSSystemOfUnits.hh.
|
inline |
Choose best energy unit, mega is the reference.
| T | - type of the value |
| value | - value to convert to best unit |
Definition at line 290 of file GGEMSSystemOfUnits.hh.
Choose best density unit.
| T | - type of the value to convert unit |
| value | - value to check |
| unit | - density unit |
Definition at line 396 of file GGEMSSystemOfUnits.hh.
Choose best distance unit.
| T | - type of the value to convert unit |
| value | - value to check |
| unit | - distance unit |
Definition at line 243 of file GGEMSSystemOfUnits.hh.
Choose best energy unit.
| T | - type of the value to convert unit |
| value | - value to check |
| unit | - energy unit |
Definition at line 316 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat A = 6.241509696e+9f |
Ampere
Definition at line 126 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat atm = 101325.0f*6.241509766e+3f |
Atmosphere
Definition at line 123 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat b = 1.e-22f |
Barn
Definition at line 69 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat bar = 100000.0f*6.241509766e+3f |
Bar
Definition at line 122 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat Bq = 1.e-9f |
Becquerel
Definition at line 164 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat C = 1.f/1.602176487e-19f |
Coulomb = 6.24150e+18 * eplus
Definition at line 98 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat cd = 1.0f |
Candela (REFERENCE)
Definition at line 179 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat Ci = 3.7e+10f/1.e+9f |
Curie (Bq.ns-1)
Definition at line 168 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat cm = 10.f |
Centimeter
Definition at line 57 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat cm2 = 1.e2f |
Squared centimeter
Definition at line 58 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat cm3 = 1.e3f |
Cubic centimeter
Definition at line 59 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat deg = 3.141592653589793238463f/180.0f |
Degree
Definition at line 78 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat eplus = 1.f |
Positron charge
Definition at line 96 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat eV = 1.e-6f |
Electronvolt
Definition at line 101 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat F = 6.241509468e+24f |
Farad
Definition at line 140 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat g = 6.241509704e+21f |
gram
Definition at line 111 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat G = 1.e-7f |
Gauss
Definition at line 151 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat GBq = 1.0f |
Gigabecquerel (REFERENCE)
Definition at line 167 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat GeV = 1.e+3f |
Gigaelectronvolt
Definition at line 104 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat Gy = 1.0e-12f |
Gray
Definition at line 173 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat H = 1.602176383e-07f |
Henry 1.60217e-7*MeV*(ns/eplus)^2
Definition at line 155 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat Hz = 1.f/(1.e+9f) |
Hertz
Definition at line 91 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat J = 1.e-6f/1.602176487e-19f |
Joule 6.24150 e+12 * MeV
Definition at line 107 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat K = 1.0f |
Kelvin (REFERENCE)
Definition at line 158 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat kBq = 1.e-6f |
Kilobecquerel
Definition at line 165 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat keV = 1.e-3f |
kiloelectronvolt
Definition at line 102 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat kg = 6.241509704e+24f |
Kilogram
Definition at line 110 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat kG = 1.e-4f |
Kilogauss
Definition at line 152 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat kGy = 1.0e-9f |
Kilogray
Definition at line 174 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat kHz = 1.e-6f |
Kilohertz
Definition at line 92 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat km = 1.e6f |
Kilometer
Definition at line 63 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat km2 = 1.e12f |
Squared kilometer
Definition at line 64 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat km3 = 1.e18f |
Cubic kilometer
Definition at line 65 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat kV = 1.e-3f |
Kilovolt
Definition at line 133 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat lm = 1.0f |
Lumen (REFERENCE)
Definition at line 182 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat lx = 1.e-6f |
Lux
Definition at line 185 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat m = 1.e3f |
Meter
Definition at line 60 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat m2 = 1.e6f |
Squared meter
Definition at line 61 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat m3 = 1.e9f |
Cubic meter
Definition at line 62 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mA = 6.241509696e+6f |
Milliampere
Definition at line 127 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mb = 1.e-25f |
millibarn
Definition at line 70 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat MBq = 1.e-3f |
Megabecquerel
Definition at line 166 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mCi = 3.7e-2f |
Millicurie
Definition at line 169 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat MeV = 1.f |
Megaelectronvolt (REFERENCE)
Definition at line 103 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mF = 6.241509468e+21f |
millifarad
Definition at line 141 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mg = 6.241509704e+18f |
milligram
Definition at line 112 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mGy = 1.0e-15f |
Milligray
Definition at line 175 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat MHz = 1.e-3f |
Megahertz
Definition at line 93 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mm = 1.0f |
Millimeter (REFERENCE)
Definition at line 54 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mm2 = 1.0f |
Squared millimeter (REFERENCE)
Definition at line 55 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mm3 = 1.0f |
Cubic millimeter (REFERENCE)
Definition at line 56 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mol = 1.0f |
Mole (REFERENCE)
Definition at line 161 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat mrad = 1.e-3f |
milliradian
Definition at line 77 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat ms = 1.e+6f |
Millisecond
Definition at line 86 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat MV = 1.0f |
Megavolt (REFERENCE)
Definition at line 132 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat N = 6.241509766e+9f |
Newton
Definition at line 118 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat nA = 6.241509696f |
Nanoampere
Definition at line 129 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat nb = 1.e-31f |
nanobarn
Definition at line 72 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat nF = 6.241509468e+15f |
nanofarad
Definition at line 143 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat nm = 1.e-6f |
Nanometer
Definition at line 52 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat ns = 1.f |
Nanosecond (REFERENCE)
Definition at line 84 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat OHM = 1.602176452e-16f |
OHM 1.60217e-16*(MeV/eplus)/(eplus/ns)
Definition at line 137 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat Pa = 6.241509766e+3f |
Pascal
Definition at line 121 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat pb = 1.e-34f |
picobarn
Definition at line 73 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat pc = 3.0856775807e+19f |
Parsec
Definition at line 66 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat percent = 0.01f |
Percent value
Definition at line 188 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat permillion = 0.000001f |
Permillion value
Definition at line 190 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat perthousant = 0.001f |
Perthousand value
Definition at line 189 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat PeV = 1.e+9f |
Petaelectronvolt
Definition at line 106 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat pF = 6.241509468e+12f |
picofarad
Definition at line 144 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat ps = 1.e-3f |
Picosecond
Definition at line 88 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat qe = 1.602176487e-19f |
elementary charge in coulomb (C)
Definition at line 97 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat rad = 1.0f |
Radian (REFERENCE)
Definition at line 76 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat s = 1.e+9f |
Second
Definition at line 85 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat sr = 1.0f |
Steradian (REFERENCE)
Definition at line 81 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat T = 0.001f |
Tesla 0.001*megavolt*ns/mm2
Definition at line 150 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat TeV = 1.e+6f |
Teraelectronvolt
Definition at line 105 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat uA = 6.241509696e+3f |
Microampere
Definition at line 128 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat ub = 1.e-28f |
microbarn
Definition at line 71 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat uCi = 3.7e-5f |
Microcurie
Definition at line 170 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat uF = 6.241509468e+18f |
microfarad
Definition at line 142 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat uGy = 1.0e-18f |
Microgray
Definition at line 176 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat um = 1.e-3f |
Micrometer
Definition at line 53 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat us = 1.e+3f |
Microsecond
Definition at line 87 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat V = 1.e-6f |
Volt
Definition at line 134 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat W = 6.241509766e+3f |
Watt
Definition at line 115 of file GGEMSSystemOfUnits.hh.
| __constant GGfloat Wb = 1000.0f |
Weber 1000*megavolt*ns
Definition at line 147 of file GGEMSSystemOfUnits.hh.