LArSoft  v09_90_00
Liquid Argon Software toolkit - https://larsoft.org/
PhysicalConstants.h
Go to the documentation of this file.
1 #ifndef UTIL_PHYSICALCONSTANTS_H
9 #define UTIL_PHYSICALCONSTANTS_H
10 
21 namespace util {
22 
35  constexpr double kRecombA = 0.800;
36  constexpr double kRecombk = 0.0486;
37 
49  constexpr double kModBoxA = 0.930;
50  constexpr double kModBoxB = 0.212;
51  // constexpr double kWion = 23.6e-6; ///< ionization potenial in LAr, 23.6 eV = 1e, Wion in MeV/e
53 
54  // Conversion for energy deposited in GeV to number of ionization electrons produced
55  constexpr double kGeVToElectrons = 4.237e7;
56 
57  // More constants
59  constexpr double kc = 29.9792458;
60  //static double khbar = 6.58211899e-22; ///< MeVs
61 
62  // Conversion factors
63  constexpr double kMeterToCentimeter = 1.e2;
64  constexpr double kCentimeterToMeter = 1. / kMeterToCentimeter;
65  constexpr double kMeterToKilometer = 1.e-3;
66  constexpr double kKilometerToMeter = 1. / kMeterToKilometer;
67 
68  constexpr double keVToMeV = 1.e-6;
69  constexpr double kMeVToeV = 1. / keVToMeV;
70 
71  constexpr double kBogusD = -999.;
72  constexpr int kBogusI = -999;
73  constexpr float kBogusF = -999.;
74 
75  constexpr double quietCompiler =
76  kBogusD * kBogusI * kBogusF * kRecombA * kRecombk * kGeVToElectrons;
77 
79  template <typename T = double>
80  inline constexpr T pi()
81  {
82  return 3.14159265358979323846264338327950288L;
83  }
84 
86  template <typename T>
87  inline constexpr T DegreesToRadians(T angle)
88  {
89  return angle / 180 * pi<T>();
90  }
91 
93  template <typename T>
94  inline constexpr T RadiansToDegrees(T angle)
95  {
96  return angle / pi<T>() * 180;
97  }
98 
99 } // namespace util
100 
101 #endif //UTIL_PHYSICALCONSTANTS_H
Namespace for general, non-LArSoft-specific utilities.
Definition: PIDAAlg.h:26
constexpr int kBogusI
obviously bogus integer value
constexpr double keVToMeV
1e6 eV = 1 MeV
constexpr double kGeVToElectrons
23.6eV per ion pair, 1e9 eV/GeV
constexpr double kc
Speed of light in vacuum in LArSoft units [cm/ns].
constexpr double kModBoxB
Modified Box Beta in g/(MeV cm²)*kV/cm.
constexpr T DegreesToRadians(T angle)
Converts the argument angle from degrees into radians.
constexpr double kCentimeterToMeter
constexpr double kMeterToKilometer
1000 m = 1 km
constexpr double kKilometerToMeter
constexpr double kMeVToeV
constexpr double quietCompiler
constexpr float kBogusF
obviously bogus float value
constexpr double kRecombk
constexpr T pi()
Returns the constant pi (up to 35 decimal digits of precision)
constexpr T RadiansToDegrees(T angle)
Converts the argument angle from radians into degrees ( )
constexpr double kBogusD
obviously bogus double value
constexpr double kRecombA
A constant.
constexpr double kModBoxA
Modified Box Alpha.
constexpr double kMeterToCentimeter
1 m = 100 cm