Units.h
Go to the documentation of this file.
1 //____________________________________________________________________________
2 /*!
3 
4 \namespace genie::units
5 
6 \brief Physical System of Units
7 
8 \author Costas Andreopoulos <costas.andreopoulos \at stfc.ac.uk>
9  University of Liverpool & STFC Rutherford Appleton Lab
10 
11 \created May 03, 2004
12 
13 \cpright Copyright (c) 2003-2019, The GENIE Collaboration
14  For the full text of the license visit http://copyright.genie-mc.org
15  or see $GENIE/LICENSE
16 */
17 //____________________________________________________________________________
18 
19 #ifndef _UNITS_H_
20 #define _UNITS_H_
21 
22 namespace genie {
23 
24 namespace units {
25 
26 //-- Basic unit
27 
28 static const double gigaelectronvolt = 1.;
29 static const double GeV = gigaelectronvolt;
30 
31 //-- Conversion of conventionl [L], [M], [T] units in physical units
32 
33 static const double meter = 5.07e+15 / GeV;
34 static const double kilogram = 5.61e+26 * GeV;
35 static const double second = 1.52e+24 / GeV;
36 
37 // GeV^-2 -> mbarns : x 0.389;
38 // mbarns -> cm^2 : x 1.00E-27;
39 // m -> GeV^-1 : x 5.07E+15;
40 // cm -> GeV^-1 : x 5.07E+13;
41 // kgr -> GeV : x 5.61E+26;
42 // gr -> GeV : x 5.61E+23;
43 // sec -> GeV^-1 : x 1.52E+24;
44 // gr/cm^3 -> GeV^4 : x 4.30466E-18;
45 
46 //-- [L: length],[S: area],[V: volume]
47 
48 static const double kilometer = 1000.*meter;
49 static const double millimeter = 0.001*meter;
50 static const double millimeter2 = millimeter*millimeter;
51 static const double millimeter3 = millimeter*millimeter2;
52 static const double centimeter = 0.01*meter;
53 static const double centimeter2 = centimeter*centimeter;
54 static const double centimeter3 = centimeter*centimeter2;
55 static const double decimeter = 0.1*meter;
56 static const double decimeter2 = decimeter*decimeter;
57 static const double decimeter3 = decimeter*decimeter2;
58 static const double meter2 = meter*meter;
59 static const double meter3 = meter*meter2;
60 static const double micrometer = 1.e-6 *meter;
61 static const double nanometer = 1.e-9 *meter;
62 static const double angstrom = 1.e-10*meter;
63 static const double fermi = 1.e-15*meter;
64 static const double fermi2 = fermi*fermi;
65 static const double fermi3 = fermi*fermi2;
66 static const double barn = 1.e-28*meter2;
67 static const double millibarn = 1.e-3 *barn;
68 static const double microbarn = 1.e-6 *barn;
69 static const double nanobarn = 1.e-9 *barn;
70 static const double picobarn = 1.e-12*barn;
71 
72 static const double km = kilometer;
73 static const double mm = millimeter;
74 static const double mm2 = millimeter2;
75 static const double mm3 = millimeter3;
76 static const double cm = centimeter;
77 static const double cm2 = centimeter2;
78 static const double cm3 = centimeter3;
79 static const double m = meter;
80 static const double m2 = meter2;
81 static const double m3 = meter3;
82 static const double A = angstrom;
83 static const double fm = fermi;
84 static const double fm2 = fermi2;
85 static const double fm3 = fermi3;
86 static const double b = barn;
87 static const double mb = millibarn;
88 static const double ub = microbarn;
89 static const double nb = nanobarn;
90 static const double pb = picobarn;
91 
92 //-- [T: time]
93 
94 static const double millisecond = 1.e-03 *second;
95 static const double microsecond = 1.e-06 *second;
96 static const double nanosecond = 1.e-09 *second;
97 static const double picosecond = 1.e-12 *second;
98 
99 static const double s = second;
100 static const double ms = millisecond;
101 static const double us = microsecond;
102 static const double ns = nanosecond;
103 static const double ps = picosecond;
104 
105 static const double hertz = 1./second;
106 static const double kilohertz = 1.e+3*hertz;
107 static const double megahertz = 1.e+6*hertz;
108 static const double gigahertz = 1.e+9*hertz;
109 
110 static const double Hz = hertz;
111 static const double kHz = kilohertz;
112 static const double MHz = megahertz;
113 static const double GHz = gigahertz;
114 
115 //-- [Q: Charge]
116 
117 static const double qe = 1.;
118 static const double qe_coulomb = 1.60217733e-19;
119 
120 //-- [E: Energy]
121 
122 static const double electronvolt = 1.e-09 *GeV;
123 static const double kiloelectronvolt = 1.e+03 *electronvolt;
124 static const double megaelectronvolt = 1.e+06 *electronvolt ;
125 static const double teraelectronvolt = 1.e+12 *electronvolt;
126 static const double petaelectronvolt = 1.e+15 *electronvolt;
127 
128 static const double eV = electronvolt;
129 static const double keV = kiloelectronvolt;
130 static const double MeV = megaelectronvolt;
131 static const double TeV = teraelectronvolt;
132 static const double PeV = petaelectronvolt;
133 
134 static const double GeV2 = GeV * GeV;
135 static const double GeV3 = GeV * GeV2;
136 static const double GeV4 = GeV * GeV3;
137 static const double GeV5 = GeV * GeV4;
138 
139 //-- [M: Mass]
140 
141 static const double gram = 1.e-3 *kilogram;
142 static const double milligram = 1.e-3 *gram;
143 
144 static const double kg = kilogram;
145 static const double g = gram;
146 static const double mg = milligram;
147 
148 //-- [Density]
149 
150 static const double kilogram_meter3 = kilogram / meter3;
151 static const double gram_centimeter3 = gram / centimeter3;
152 
153 static const double kg_m3 = kilogram_meter3;
154 static const double g_cm3 = gram_centimeter3;
155 
156 //-- [Dimensionless quantities]
157 
158 // Angle
159 
160 static const double radian = 1.;
161 static const double milliradian = 1.e-3*radian;
162 static const double degree = (3.14159265358979323846/180.0)*radian;
163 static const double steradian = 1.;
164 
165 static const double rad = radian;
166 static const double mrad = milliradian;
167 static const double sr = steradian;
168 static const double deg = degree;
169 
170 //-- [Etc]
171 
172 static const double clhep_def_density_unit = g_cm3/(0.62415185185E+19);
173 
174 } // namespace units
175 } // namespace genie
176 
177 #endif // _UNITS_H_
178 
static const double hertz
Definition: Units.h:105
static const double m
Definition: Units.h:79
static const double second
Definition: Units.h:35
static const double kg
Definition: Units.h:144
static const double micrometer
Definition: Units.h:60
static const double nanobarn
Definition: Units.h:69
static const double keV
Definition: Units.h:129
static const double kilogram_meter3
Definition: Units.h:150
THE MAIN GENIE PROJECT NAMESPACE
Definition: AlgCmp.h:26
static const double meter2
Definition: Units.h:58
static const double teraelectronvolt
Definition: Units.h:125
static const double ps
Definition: Units.h:103
static const double g_cm3
Definition: Units.h:154
static const double ns
Definition: Units.h:102
static const double fermi
Definition: Units.h:63
static const double gigahertz
Definition: Units.h:108
static const double nanometer
Definition: Units.h:61
static const double MeV
Definition: Units.h:130
static const double fm3
Definition: Units.h:85
static const double eV
Definition: Units.h:128
static const double millisecond
Definition: Units.h:94
static const double Hz
Definition: Units.h:110
static const double degree
Definition: Units.h:162
static const double milligram
Definition: Units.h:142
static const double microsecond
Definition: Units.h:95
static const double kiloelectronvolt
Definition: Units.h:123
static const double GeV2
Definition: Units.h:134
static const double decimeter2
Definition: Units.h:56
static const double g
Definition: Units.h:145
static const double mm2
Definition: Units.h:74
static const double cm2
Definition: Units.h:77
static const double qe
Definition: Units.h:117
static const double megaelectronvolt
Definition: Units.h:124
static const double km
Definition: Units.h:72
static const double angstrom
Definition: Units.h:62
static const double qe_coulomb
Definition: Units.h:118
static const double deg
Definition: Units.h:168
static const double pb
Definition: Units.h:90
static const double centimeter3
Definition: Units.h:54
static const double mm3
Definition: Units.h:75
static const double GeV5
Definition: Units.h:137
static const double decimeter
Definition: Units.h:55
static const double gram_centimeter3
Definition: Units.h:151
static const double milliradian
Definition: Units.h:161
static const double clhep_def_density_unit
Definition: Units.h:172
static const double meter
Definition: Units.h:33
static const double steradian
Definition: Units.h:163
static const double MHz
Definition: Units.h:112
static const double kilogram
Definition: Units.h:34
static const double kg_m3
Definition: Units.h:153
static const double fm
Definition: Units.h:83
static const double mrad
Definition: Units.h:166
static const double decimeter3
Definition: Units.h:57
static const double mg
Definition: Units.h:146
static const double kHz
Definition: Units.h:111
static const double mm
Definition: Units.h:73
static const double kilohertz
Definition: Units.h:106
static const double gram
Definition: Units.h:141
static const double picosecond
Definition: Units.h:97
static const double barn
Definition: Units.h:66
static const double GeV4
Definition: Units.h:136
static const double millimeter2
Definition: Units.h:50
static const double ub
Definition: Units.h:88
static const double megahertz
Definition: Units.h:107
static const double us
Definition: Units.h:101
static const double PeV
Definition: Units.h:132
static const double petaelectronvolt
Definition: Units.h:126
static const double nanosecond
Definition: Units.h:96
static const double rad
Definition: Units.h:165
static const double cm3
Definition: Units.h:78
static const double ms
Definition: Units.h:100
static const double GHz
Definition: Units.h:113
static const double radian
Definition: Units.h:160
static const double m2
Definition: Units.h:80
static const double meter3
Definition: Units.h:59
static const double b
Definition: Units.h:86
static const double picobarn
Definition: Units.h:70
static const double GeV3
Definition: Units.h:135
static const double fm2
Definition: Units.h:84
static const double millimeter
Definition: Units.h:49
static const double cm
Definition: Units.h:76
static const double centimeter
Definition: Units.h:52
static const double s
Definition: Units.h:99
static const double nb
Definition: Units.h:89
static const double kilometer
Definition: Units.h:48
static const double m3
Definition: Units.h:81
static const double electronvolt
Definition: Units.h:122
static const double mb
Definition: Units.h:87
static const double GeV
Definition: Units.h:29
static const double millibarn
Definition: Units.h:67
static const double sr
Definition: Units.h:167
static const double gigaelectronvolt
Definition: Units.h:28
static const double microbarn
Definition: Units.h:68
static const double TeV
Definition: Units.h:131
static const double millimeter3
Definition: Units.h:51
static const double fermi3
Definition: Units.h:65
static const double fermi2
Definition: Units.h:64
static const double centimeter2
Definition: Units.h:53