LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
util::quantities::energy_literals Namespace Reference

Literal constants for energy quantities. More...

Functions

constexpr electronvolt operator""_eV (long double v)
 Literal electronvolt value. More...
 
constexpr electronvolt operator""_eV (unsigned long long int v)
 Literal electronvolt value. More...
 
constexpr microelectronvolt operator""_ueV (long double v)
 Literal microelectronvolt value. More...
 
constexpr microelectronvolt operator""_ueV (unsigned long long int v)
 Literal microelectronvolt value. More...
 
constexpr millielectronvolt operator""_meV (long double v)
 Literal millielectronvolt value. More...
 
constexpr millielectronvolt operator""_meV (unsigned long long int v)
 Literal millielectronvolt value. More...
 
constexpr kiloelectronvolt operator""_keV (long double v)
 Literal kilovolt value. More...
 
constexpr kiloelectronvolt operator""_keV (unsigned long long int v)
 Literal kilovolt value. More...
 
constexpr megaelectronvolt operator""_MeV (long double v)
 Literal megaelectronvolt value. More...
 
constexpr megaelectronvolt operator""_MeV (unsigned long long int v)
 Literal megaelectronvolt value. More...
 
constexpr gigaelectronvolt operator""_GeV (long double v)
 Literal gigaelectronvolt value. More...
 
constexpr gigaelectronvolt operator""_GeV (unsigned long long int v)
 Literal gigaelectronvolt value. More...
 
constexpr teraelectronvolt operator""_TeV (long double v)
 Literal teraelectronvolt value. More...
 
constexpr teraelectronvolt operator""_TeV (unsigned long long int v)
 Literal teraelectronvolt value. More...
 

Detailed Description

Literal constants for energy quantities.

These functions allow a simplified syntax for specifying a energy quantity. In order to use these, their namespace must be used:

// definition of `util::quantities::megaelectronvolt` constant:
constexpr auto muon_MeV = 105.6583745_MeV;
// assignment (likely to a quantity) of
// `util::quantities::gigaelectronvolt{1.5}`
E = 1.5_GeV;

Function Documentation

constexpr electronvolt util::quantities::energy_literals::operator""_eV ( long double  v)

Literal electronvolt value.

Definition at line 158 of file energy.h.

159  {
160  return electronvolt{static_cast<double>(v)};
161  }
electronvolt_as<> electronvolt
Type of energy stored in electronvolts, in double precision.
Definition: energy.h:72
constexpr electronvolt util::quantities::energy_literals::operator""_eV ( unsigned long long int  v)

Literal electronvolt value.

Definition at line 162 of file energy.h.

163  {
164  return electronvolt{static_cast<double>(v)};
165  }
electronvolt_as<> electronvolt
Type of energy stored in electronvolts, in double precision.
Definition: energy.h:72
constexpr gigaelectronvolt util::quantities::energy_literals::operator""_GeV ( long double  v)

Literal gigaelectronvolt value.

Definition at line 218 of file energy.h.

219  {
220  return gigaelectronvolt{static_cast<double>(v)};
221  }
gigaelectronvolt_as<> gigaelectronvolt
Type of energy stored in gigaelectronvolt, in double precision.
Definition: energy.h:122
constexpr gigaelectronvolt util::quantities::energy_literals::operator""_GeV ( unsigned long long int  v)

Literal gigaelectronvolt value.

Definition at line 222 of file energy.h.

223  {
224  return gigaelectronvolt{static_cast<double>(v)};
225  }
gigaelectronvolt_as<> gigaelectronvolt
Type of energy stored in gigaelectronvolt, in double precision.
Definition: energy.h:122
constexpr kiloelectronvolt util::quantities::energy_literals::operator""_keV ( long double  v)

Literal kilovolt value.

Definition at line 194 of file energy.h.

195  {
196  return kiloelectronvolt{static_cast<double>(v)};
197  }
kiloelectronvolt_as<> kiloelectronvolt
Type of energy stored in kiloelectronvolt, in double precision.
Definition: energy.h:102
constexpr kiloelectronvolt util::quantities::energy_literals::operator""_keV ( unsigned long long int  v)

Literal kilovolt value.

Definition at line 198 of file energy.h.

199  {
200  return kiloelectronvolt{static_cast<double>(v)};
201  }
kiloelectronvolt_as<> kiloelectronvolt
Type of energy stored in kiloelectronvolt, in double precision.
Definition: energy.h:102
constexpr millielectronvolt util::quantities::energy_literals::operator""_meV ( long double  v)

Literal millielectronvolt value.

Definition at line 182 of file energy.h.

183  {
184  return millielectronvolt{static_cast<double>(v)};
185  }
millielectronvolt_as<> millielectronvolt
Type of energy stored in millielectronvolt, in double precision.
Definition: energy.h:92
constexpr millielectronvolt util::quantities::energy_literals::operator""_meV ( unsigned long long int  v)

Literal millielectronvolt value.

Definition at line 186 of file energy.h.

187  {
188  return millielectronvolt{static_cast<double>(v)};
189  }
millielectronvolt_as<> millielectronvolt
Type of energy stored in millielectronvolt, in double precision.
Definition: energy.h:92
constexpr megaelectronvolt util::quantities::energy_literals::operator""_MeV ( long double  v)

Literal megaelectronvolt value.

Definition at line 206 of file energy.h.

207  {
208  return megaelectronvolt{static_cast<double>(v)};
209  }
megaelectronvolt_as<> megaelectronvolt
Type of energy stored in megaelectronvolt, in double precision.
Definition: energy.h:112
constexpr megaelectronvolt util::quantities::energy_literals::operator""_MeV ( unsigned long long int  v)

Literal megaelectronvolt value.

Definition at line 210 of file energy.h.

211  {
212  return megaelectronvolt{static_cast<double>(v)};
213  }
megaelectronvolt_as<> megaelectronvolt
Type of energy stored in megaelectronvolt, in double precision.
Definition: energy.h:112
constexpr teraelectronvolt util::quantities::energy_literals::operator""_TeV ( long double  v)

Literal teraelectronvolt value.

Definition at line 230 of file energy.h.

231  {
232  return teraelectronvolt{static_cast<double>(v)};
233  }
teraelectronvolt_as<> teraelectronvolt
Type of energy stored in teraelectronvolt, in double precision.
Definition: energy.h:132
constexpr teraelectronvolt util::quantities::energy_literals::operator""_TeV ( unsigned long long int  v)

Literal teraelectronvolt value.

Definition at line 234 of file energy.h.

235  {
236  return teraelectronvolt{static_cast<double>(v)};
237  }
teraelectronvolt_as<> teraelectronvolt
Type of energy stored in teraelectronvolt, in double precision.
Definition: energy.h:132
constexpr microelectronvolt util::quantities::energy_literals::operator""_ueV ( long double  v)

Literal microelectronvolt value.

Definition at line 170 of file energy.h.

171  {
172  return microelectronvolt{static_cast<double>(v)};
173  }
microelectronvolt_as<> microelectronvolt
Type of energy stored in microelectronvolt, in double precision.
Definition: energy.h:82
constexpr microelectronvolt util::quantities::energy_literals::operator""_ueV ( unsigned long long int  v)

Literal microelectronvolt value.

Definition at line 174 of file energy.h.

175  {
176  return microelectronvolt{static_cast<double>(v)};
177  }
microelectronvolt_as<> microelectronvolt
Type of energy stored in microelectronvolt, in double precision.
Definition: energy.h:82