Jpp
JConstants.hh
Go to the documentation of this file.
1 #ifndef __JTOOLS__JCONSTANTS__
2 #define __JTOOLS__JCONSTANTS__
3 
4 #include <math.h>
5 
6 
7 /**
8  * \file
9  * Constants.
10  * \author mdejong
11  */
12 namespace JTOOLS {}
13 namespace JPP { using namespace JTOOLS; }
14 
15 namespace JTOOLS {
16 
17  /**
18  * Constants.
19  */
20  static const double PI = 3.1415927; //!< pi
21  static const double EULER = 0.577215664901533; //!< Euler number
22  static const double C = 0.299792458; //!< Speed of light in vacuum [m/ns]
23  static const double C_INVERSE = 1.0/C; //!< Inverse speed of light in vacuum [ns/m]
24  static const double AVOGADRO = 6.0221415e23; //!< Avogadro's number [gr^-1]
25  static const double H = 4.13566733e-15; //!< Planck constant [eV s]
26  static const double HBAR = H/(2*PI); //!< Planck constant [eV s]
27  static const double HBARC = HBAR*C*1.0e9; //!< Planck constant [eV m]
28  static const double ALPHA_ELECTRO_MAGNETIC = 1.0/137.036; //!< Electro-Magnetic coupling constant
29  static const double THETA_MCS = 13.6e-3; //!< Multiple Coulomb scattering constant [GeV]
30 
31  /**
32  * Fixed environment values.
33  */
34  static const double DENSITY_SEA_WATER = 1.038; //!< Density of sea water [g/cm^3]
35  static const double DENSITY_ROCK = 2.65; //!< Density of rock [g/cm^3]
36  static const double SALINITY_SEA_WATER = 0.035; //!< Salinity of sea water
37  static const double INDEX_OF_REFRACTION_WATER = 1.3800851282; //!< average index of refraction of water
38  static const double X0_WATER_M = 0.36; //!< Radiation length pure water [m]
39 
40  /**
41  * Derived quantities of optical medium.
42  */
43  static const double TAN_THETA_C_WATER = sqrt((INDEX_OF_REFRACTION_WATER - 1.0) * (INDEX_OF_REFRACTION_WATER + 1.0));
44  static const double COS_THETA_C_WATER = 1.0 / INDEX_OF_REFRACTION_WATER;
46  static const double KAPPA_WATER = 0.96;
47 
48  /**
49  * Particle masses.
50  * Note that the neutrino masses are set to zero.
51  */
52  static const double MASS_PHOTON = 0.0; //!< photon mass [GeV]
53 
54  static const double MASS_ELECTRON_NEUTRINO = 0.0; //!< electron neutrino mass [GeV]
55  static const double MASS_MUON_NEUTRINO = 0.0; //!< muon neutrino mass [GeV]
56  static const double MASS_TAU_NEUTRINO = 0.0; //!< tau neutrino mass [GeV]
57 
58  static const double MASS_ELECTRON = 0.510998946e-3; //!< electron mass [GeV]
59  static const double MASS_MUON = 0.1056583745; //!< muon mass [GeV]
60  static const double MASS_TAU = 1.77682; //!< tau mass [GeV]
61 
62  static const double MASS_NEUTRAL_PION = 0.1349766; //!< pi_0 mass [GeV]
63  static const double MASS_CHARGED_PION = 0.13957018; //!< pi^+/- mass [GeV]
64  static const double MASS_NEUTRAL_KAON = 0.497614; //!< K_0 mass [GeV]
65  static const double MASS_CHARGED_KAON = 0.493677; //!< K^+/- mass [GeV]
66 
67  static const double MASS_PROTON = 0.9382720813; //!< proton mass [GeV]
68  static const double MASS_NEUTRON = 0.9395654133; //!< neutron mass [GeV]
69  static const double MASS_LAMBDA = 1.115683; //!< Lambda mass [GeV]
70  static const double MASS_NEUTRAL_SIGMA = 1.192642; //!< Sigma_0 mass [GeV]
71  static const double MASS_CHARGED_SIGMA = 1.18937; //!< Sigma^+/- mass [GeV]
72  static const double MASS_NEUTRAL_XI = 1.31486; //!< Xi_0 mass [GeV]
73  static const double MASS_CHARGED_XI = 1.32171; //!< Xi^+/- mass [GeV]
74  static const double MASS_CHARGED_OMEGA = 1.67245; //!< Omega^+/- mass [GeV]
75 
76  /**
77  * Computing quantities.
78  */
79  static const long long int KILOBYTE = 1024; //! Number of bytes in a kilobyte
80  static const long long int MEGABYTE = KILOBYTE*KILOBYTE; //! Number of bytes in a megabyte
81  static const long long int GIGABYTE = KILOBYTE*KILOBYTE*KILOBYTE; //! Number of bytes in a gigabyte
82 
83 
84  /**
85  * Get speed of light.
86  *
87  * return speed of light [m/ns]
88  */
89  inline const double getSpeedOfLight()
90  {
91  return C;
92  }
93 
94 
95  /**
96  * Get inverse speed of light.
97  *
98  * return inverse speed of light [ns/m]
99  */
100  inline const double getInverseSpeedOfLight()
101  {
102  return C_INVERSE;
103  }
104 
105 
106  /**
107  * Get average index of refraction of water.
108  *
109  * \return index of refraction
110  */
111  inline double getIndexOfRefraction()
112  {
114  }
115 
116 
117  /**
118  * Get average index of refraction of water.
119  *
120  * \return index of refraction
121  */
122  inline double getIndexOfRefractionPhase()
123  {
124  return 1.35;
125  }
126 
127 
128  /**
129  * Get average tangent of Cherenkov angle of water.
130  *
131  * \return tan(theta_C)
132  */
133  inline double getTanThetaC()
134  {
135  return TAN_THETA_C_WATER;
136  }
137 
138 
139  /**
140  * Get average cosine of Cherenkov angle of water.
141  *
142  * \return cos(theta_C)
143  */
144  inline double getCosThetaC()
145  {
146  return COS_THETA_C_WATER;
147  }
148 
149 
150  /**
151  * Get average sine of Cherenkov angle of water.
152  *
153  * \return sin(theta_C)
154  */
155  inline double getSinThetaC()
156  {
157  return SIN_THETA_C_WATER;
158  }
159 
160 
161  /**
162  * Get average kappa of Cherenkov light in water.
163  *
164  * \return kappa
165  */
166  inline double getKappaC()
167  {
168  return KAPPA_WATER;
169  }
170 }
171 
172 #endif
JTOOLS::MASS_CHARGED_PION
static const double MASS_CHARGED_PION
pi^+/- mass [GeV]
Definition: JConstants.hh:63
JTOOLS::MASS_TAU
static const double MASS_TAU
tau mass [GeV]
Definition: JConstants.hh:60
JTOOLS::getSinThetaC
double getSinThetaC()
Get average sine of Cherenkov angle of water.
Definition: JConstants.hh:155
JTOOLS::EULER
static const double EULER
Euler number.
Definition: JConstants.hh:21
JTOOLS::SIN_THETA_C_WATER
static const double SIN_THETA_C_WATER
Definition: JConstants.hh:45
JTOOLS::getSpeedOfLight
const double getSpeedOfLight()
Number of bytes in a gigabyte.
Definition: JConstants.hh:89
JTOOLS::MASS_MUON
static const double MASS_MUON
muon mass [GeV]
Definition: JConstants.hh:59
JTOOLS::DENSITY_SEA_WATER
static const double DENSITY_SEA_WATER
Fixed environment values.
Definition: JConstants.hh:34
JTOOLS::ALPHA_ELECTRO_MAGNETIC
static const double ALPHA_ELECTRO_MAGNETIC
Electro-Magnetic coupling constant.
Definition: JConstants.hh:28
JTOOLS::MASS_LAMBDA
static const double MASS_LAMBDA
Lambda mass [GeV].
Definition: JConstants.hh:69
JTOOLS::MASS_PROTON
static const double MASS_PROTON
proton mass [GeV]
Definition: JConstants.hh:67
JTOOLS::KAPPA_WATER
static const double KAPPA_WATER
Definition: JConstants.hh:46
JTOOLS::GIGABYTE
static const long long int GIGABYTE
Number of bytes in a megabyte.
Definition: JConstants.hh:81
JTOOLS::MASS_NEUTRAL_XI
static const double MASS_NEUTRAL_XI
Xi_0 mass [GeV].
Definition: JConstants.hh:72
JTOOLS::H
static const double H
Planck constant [eV s].
Definition: JConstants.hh:25
JTOOLS::getCosThetaC
double getCosThetaC()
Get average cosine of Cherenkov angle of water.
Definition: JConstants.hh:144
JTOOLS::AVOGADRO
static const double AVOGADRO
Avogadro's number [gr^-1].
Definition: JConstants.hh:24
JTOOLS::MASS_CHARGED_SIGMA
static const double MASS_CHARGED_SIGMA
Sigma^+/- mass [GeV].
Definition: JConstants.hh:71
JTOOLS::C
static const double C
Speed of light in vacuum [m/ns].
Definition: JConstants.hh:22
JTOOLS::COS_THETA_C_WATER
static const double COS_THETA_C_WATER
Definition: JConstants.hh:44
JTOOLS::X0_WATER_M
static const double X0_WATER_M
Radiation length pure water [m].
Definition: JConstants.hh:38
JPP
This name space includes all other name spaces (except KM3NETDAQ, KM3NET and ANTARES).
Definition: JAAnetToolkit.hh:37
JTOOLS::getInverseSpeedOfLight
const double getInverseSpeedOfLight()
Get inverse speed of light.
Definition: JConstants.hh:100
JTOOLS::MASS_CHARGED_KAON
static const double MASS_CHARGED_KAON
K^+/- mass [GeV].
Definition: JConstants.hh:65
JTOOLS::MASS_TAU_NEUTRINO
static const double MASS_TAU_NEUTRINO
tau neutrino mass [GeV]
Definition: JConstants.hh:56
JTOOLS::getIndexOfRefraction
double getIndexOfRefraction()
Get average index of refraction of water.
Definition: JConstants.hh:111
JTOOLS::INDEX_OF_REFRACTION_WATER
static const double INDEX_OF_REFRACTION_WATER
average index of refraction of water
Definition: JConstants.hh:37
JTOOLS::MASS_MUON_NEUTRINO
static const double MASS_MUON_NEUTRINO
muon neutrino mass [GeV]
Definition: JConstants.hh:55
JTOOLS::MASS_NEUTRAL_PION
static const double MASS_NEUTRAL_PION
pi_0 mass [GeV]
Definition: JConstants.hh:62
JTOOLS::MASS_ELECTRON_NEUTRINO
static const double MASS_ELECTRON_NEUTRINO
electron neutrino mass [GeV]
Definition: JConstants.hh:54
JTOOLS::HBARC
static const double HBARC
Planck constant [eV m].
Definition: JConstants.hh:27
JTOOLS::KILOBYTE
static const long long int KILOBYTE
Computing quantities.
Definition: JConstants.hh:79
JTOOLS::MASS_PHOTON
static const double MASS_PHOTON
Particle masses.
Definition: JConstants.hh:52
JTOOLS::MASS_NEUTRAL_KAON
static const double MASS_NEUTRAL_KAON
K_0 mass [GeV].
Definition: JConstants.hh:64
JTOOLS::getIndexOfRefractionPhase
double getIndexOfRefractionPhase()
Get average index of refraction of water.
Definition: JConstants.hh:122
JTOOLS::getTanThetaC
double getTanThetaC()
Get average tangent of Cherenkov angle of water.
Definition: JConstants.hh:133
JTOOLS::THETA_MCS
static const double THETA_MCS
Multiple Coulomb scattering constant [GeV].
Definition: JConstants.hh:29
JTOOLS::HBAR
static const double HBAR
Planck constant [eV s].
Definition: JConstants.hh:26
JTOOLS::getKappaC
double getKappaC()
Get average kappa of Cherenkov light in water.
Definition: JConstants.hh:166
JTOOLS::MEGABYTE
static const long long int MEGABYTE
Number of bytes in a kilobyte.
Definition: JConstants.hh:80
JTOOLS::MASS_ELECTRON
static const double MASS_ELECTRON
electron mass [GeV]
Definition: JConstants.hh:58
JTOOLS::MASS_CHARGED_XI
static const double MASS_CHARGED_XI
Xi^+/- mass [GeV].
Definition: JConstants.hh:73
JTOOLS::TAN_THETA_C_WATER
static const double TAN_THETA_C_WATER
Derived quantities of optical medium.
Definition: JConstants.hh:43
JTOOLS::DENSITY_ROCK
static const double DENSITY_ROCK
Density of rock [g/cm^3].
Definition: JConstants.hh:35
JTOOLS::PI
static const double PI
Constants.
Definition: JConstants.hh:20
JTOOLS::MASS_CHARGED_OMEGA
static const double MASS_CHARGED_OMEGA
Omega^+/- mass [GeV].
Definition: JConstants.hh:74
JTOOLS::SALINITY_SEA_WATER
static const double SALINITY_SEA_WATER
Salinity of sea water.
Definition: JConstants.hh:36
JTOOLS
Auxiliary classes and methods for multi-dimensional interpolations and histograms.
Definition: JAbstractCollection.hh:9
JTOOLS::MASS_NEUTRON
static const double MASS_NEUTRON
neutron mass [GeV]
Definition: JConstants.hh:68
JTOOLS::MASS_NEUTRAL_SIGMA
static const double MASS_NEUTRAL_SIGMA
Sigma_0 mass [GeV].
Definition: JConstants.hh:70
JTOOLS::C_INVERSE
static const double C_INVERSE
Inverse speed of light in vacuum [ns/m].
Definition: JConstants.hh:23