SND@LHC Software
Loading...
Searching...
No Matches
ShipUnit.h
Go to the documentation of this file.
1//
2// ShipUnit.h
3//
4//
5
6#ifndef ____ShipUnit__
7#define ____ShipUnit__
8
9namespace ShipUnit
10{
11
12 //
13 // Length [L]
14 //
15 static const Double_t millimeter = 1./10.;
16 static const Double_t millimeter2 = millimeter*millimeter;
17 static const Double_t millimeter3 = millimeter*millimeter*millimeter;
18
19 static const Double_t centimeter = 10.*millimeter;
20 static const Double_t centimeter2 = centimeter*centimeter;
21 static const Double_t centimeter3 = centimeter*centimeter*centimeter;
22
23 static const Double_t meter = 1000.*millimeter;
24 static const Double_t meter2 = meter*meter;
25 static const Double_t meter3 = meter*meter*meter;
26
27 static const Double_t kilometer = 1000.*meter;
28 static const Double_t kilometer2 = kilometer*kilometer;
29 static const Double_t kilometer3 = kilometer*kilometer*kilometer;
30
31 static const Double_t parsec = 3.0856775807e+16*meter;
32
33 static const Double_t micrometer = 1.e-6 *meter;
34 static const Double_t nanometer = 1.e-9 *meter;
35 static const Double_t angstrom = 1.e-10*meter;
36 static const Double_t fermi = 1.e-15*meter;
37
38 static const Double_t barn = 1.e-28*meter2;
39 static const Double_t millibarn = 1.e-3 *barn;
40 static const Double_t microbarn = 1.e-6 *barn;
41 static const Double_t nanobarn = 1.e-9 *barn;
42 static const Double_t picobarn = 1.e-12*barn;
43
44 // symbols
45 static const Double_t nm = nanometer;
46 static const Double_t um = micrometer;
47
48 static const Double_t mm = millimeter;
49 static const Double_t mm2 = millimeter2;
50 static const Double_t mm3 = millimeter3;
51
52 static const Double_t cm = centimeter;
53 static const Double_t cm2 = centimeter2;
54 static const Double_t cm3 = centimeter3;
55
56 static const Double_t m = meter;
57 static const Double_t m2 = meter2;
58 static const Double_t m3 = meter3;
59
60 static const Double_t km = kilometer;
61 static const Double_t km2 = kilometer2;
62 static const Double_t km3 = kilometer3;
63
64 static const Double_t pc = parsec;
65
66 //
67 // Angle
68 //
69 static const Double_t radian = 1.;
70 static const Double_t milliradian = 1.e-3*radian;
71 static const Double_t degree = (3.14159265358979323846/180.0)*radian;
72
73 static const Double_t steradian = 1.;
74
75 // symbols
76 static const Double_t rad = radian;
77 static const Double_t mrad = milliradian;
78 static const Double_t sr = steradian;
79 static const Double_t deg = degree;
80
81 //
82 // Time [T]
83 //
84 static const Double_t nanosecond = 1.;
85 static const Double_t second = 1.e+9 *nanosecond;
86 static const Double_t millisecond = 1.e-3 *second;
87 static const Double_t microsecond = 1.e-6 *second;
88 static const Double_t picosecond = 1.e-12*second;
89
90 static const Double_t hertz = 1./second;
91 static const Double_t kilohertz = 1.e+3*hertz;
92 static const Double_t megahertz = 1.e+6*hertz;
93
94 // symbols
95 static const Double_t ns = nanosecond;
96 static const Double_t s = second;
97 static const Double_t ms = millisecond;
98
99 //
100 // Electric charge [Q]
101 //
102 static const Double_t eplus = 1. ;// positron charge
103 static const Double_t e_SI = 1.602176487e-19;// positron charge in coulomb
104 static const Double_t coulomb = eplus/e_SI;// coulomb = 6.24150 e+18 * eplus
105
106 //
107 // Energy [E]
108 //
109 static const Double_t megaelectronvolt = 1. ;
110 static const Double_t electronvolt = 1.e-6*megaelectronvolt;
111 static const Double_t kiloelectronvolt = 1.e-3*megaelectronvolt;
112 static const Double_t gigaelectronvolt = 1.e+3*megaelectronvolt;
113 static const Double_t teraelectronvolt = 1.e+6*megaelectronvolt;
114 static const Double_t petaelectronvolt = 1.e+9*megaelectronvolt;
115
116 static const Double_t joule = electronvolt/e_SI;// joule = 6.24150 e+12 * MeV
117
118 // symbols
119 static const Double_t MeV = megaelectronvolt;
120 static const Double_t eV = electronvolt;
121 static const Double_t keV = kiloelectronvolt;
122 static const Double_t GeV = gigaelectronvolt;
123 static const Double_t TeV = teraelectronvolt;
124 static const Double_t PeV = petaelectronvolt;
125
126 //
127 // Mass [E][T^2][L^-2]
128 //
129 static const Double_t kilogram = joule*second*second/(meter*meter);
130 static const Double_t gram = 1.e-3*kilogram;
131 static const Double_t milligram = 1.e-3*gram;
132
133 // symbols
134 static const Double_t kg = kilogram;
135 static const Double_t g = gram;
136 static const Double_t mg = milligram;
137
138 //
139 // Power [E][T^-1]
140 //
141 static const Double_t watt = joule/second;// watt = 6.24150 e+3 * MeV/ns
142
143 //
144 // Force [E][L^-1]
145 //
146 static const Double_t newton = joule/meter;// newton = 6.24150 e+9 * MeV/mm
147
148 //
149 // Pressure [E][L^-3]
150 //
151 #define pascal hep_pascal // a trick to avoid warnings
152 static const Double_t hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3
153 static const Double_t bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3
154 static const Double_t atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3
155
156 //
157 // Electric current [Q][T^-1]
158 //
159 static const Double_t ampere = coulomb/second; // ampere = 6.24150 e+9 * eplus/ns
160 static const Double_t milliampere = 1.e-3*ampere;
161 static const Double_t microampere = 1.e-6*ampere;
162 static const Double_t nanoampere = 1.e-9*ampere;
163
164 //
165 // Electric potential [E][Q^-1]
166 //
167 static const Double_t megavolt = megaelectronvolt/eplus;
168 static const Double_t kilovolt = 1.e-3*megavolt;
169 static const Double_t volt = 1.e-6*megavolt;
170
171 //
172 // Electric resistance [E][T][Q^-2]
173 //
174 static const Double_t ohm = volt/ampere;// ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
175
176 //
177 // Electric capacitance [Q^2][E^-1]
178 //
179 static const Double_t farad = coulomb/volt;// farad = 6.24150e+24 * eplus/Megavolt
180 static const Double_t millifarad = 1.e-3*farad;
181 static const Double_t microfarad = 1.e-6*farad;
182 static const Double_t nanofarad = 1.e-9*farad;
183 static const Double_t picofarad = 1.e-12*farad;
184
185 //
186 // Magnetic Flux [T][E][Q^-1]
187 //
188 static const Double_t weber = volt*second;// weber = 1000*megavolt*ns
189
190 //
191 // Magnetic Field [T][E][Q^-1][L^-2]
192 //
193 //static const Double_t tesla = volt*second/meter2;// tesla =0.001*megavolt*ns/mm2
194 //static const Double_t gauss = 1.e-4*tesla;
195 //static const Double_t kilogauss = 1.e-1*tesla;
196
197 static const Double_t kilogauss = 1.;
198 static const Double_t tesla = 10*kilogauss;
199 static const Double_t gauss = 1.e-4*tesla;
200
201 //
202 // Inductance [T^2][E][Q^-2]
203 //
204 static const Double_t henry = weber/ampere;// henry = 1.60217e-7*MeV*(ns/eplus)**2
205
206 //
207 // Temperature
208 //
209 static const Double_t kelvin = 1.;
210
211 //
212 // Amount of substance
213 //
214 static const Double_t mole = 1.;
215
216 //
217 // Activity [T^-1]
218 //
219 static const Double_t becquerel = 1./second ;
220 static const Double_t curie = 3.7e+10 * becquerel;
221 static const Double_t kilobecquerel = 1.e+3*becquerel;
222 static const Double_t megabecquerel = 1.e+6*becquerel;
223 static const Double_t gigabecquerel = 1.e+9*becquerel;
224 static const Double_t millicurie = 1.e-3*curie;
225 static const Double_t microcurie = 1.e-6*curie;
226 static const Double_t Bq = becquerel;
227 static const Double_t kBq = kilobecquerel;
228 static const Double_t MBq = megabecquerel;
229 static const Double_t GBq = gigabecquerel;
230 static const Double_t Ci = curie;
231 static const Double_t mCi = millicurie;
232 static const Double_t uCi = microcurie;
233
234 //
235 // Absorbed dose [L^2][T^-2]
236 //
237 static const Double_t gray = joule/kilogram ;
238 static const Double_t kilogray = 1.e+3*gray;
239 static const Double_t milligray = 1.e-3*gray;
240 static const Double_t microgray = 1.e-6*gray;
241
242 //
243 // Luminous intensity [I]
244 //
245 static const Double_t candela = 1.;
246
247 //
248 // Luminous flux [I]
249 //
250 static const Double_t lumen = candela*steradian;
251
252 //
253 // Illuminance [I][L^-2]
254 //
255 static const Double_t lux = lumen/meter2;
256
257 //
258 // Miscellaneous
259 //
260 static const Double_t perCent = 0.01 ;
261 static const Double_t perThousand = 0.001;
262 static const Double_t perMillion = 0.000001;
263
264 //
265 //Physical Constants
266 //
267
268 static const Double_t pi = 3.14159265358979323846;
269 static const Double_t twopi = 2.*pi;
270 static const Double_t halfpi = pi/2.;
271 static const Double_t pi2 = pi*pi;
272
273 //
274 static const Double_t Avogadro = 6.0221367e+23/mole;
275
276 // c = 299.792458 mm/ns
277 // c^2 = 898.7404 (mm/ns)^2
278 static const Double_t c_light = 2.99792458e+8 * m/s;
279 static const Double_t c_squared = c_light * c_light;
280
281 // h = 4.13566e-12 MeV*ns
282 // hbar = 6.58212e-13 MeV*ns
283 // hbarc = 197.32705e-12 MeV*mm
284 static const Double_t h_Planck = 6.6260755e-34 * joule*s;
285 static const Double_t hbar_Planck = h_Planck/twopi;
286 static const Double_t hbarc = hbar_Planck * c_light;
287 static const Double_t hbarc_squared = hbarc * hbarc;
288
289 //
290 static const Double_t electron_charge = - eplus; // see SystemOfUnits.h
291 static const Double_t e_squared = eplus * eplus;
292
293 // amu_c2 - atomic equivalent mass unit
294 // amu - atomic mass unit
295 static const Double_t electron_mass_c2 = 0.51099906 * MeV;
296 static const Double_t proton_mass_c2 = 938.27231 * MeV;
297 static const Double_t neutron_mass_c2 = 939.56563 * MeV;
298 static const Double_t amu_c2 = 931.49432 * MeV;
299 static const Double_t amu = amu_c2/c_squared;
300
301 // permeability of free space mu0 = 2.01334e-16 Mev*(ns*eplus)^2/mm
302 // permittivity of free space epsil0 = 5.52636e+10 eplus^2/(MeV*mm)
303 static const Double_t mu0 = 4*pi*1.e-7 * henry/m;
304 static const Double_t epsilon0 = 1./(c_squared*mu0);
305
306 // electromagnetic coupling = 1.43996e-12 MeV*mm/(eplus^2)
307 static const Double_t elm_coupling = e_squared/(4*pi*epsilon0);
308 static const Double_t fine_structure_const = elm_coupling/hbarc;
309 static const Double_t classic_electr_radius = elm_coupling/electron_mass_c2;
310 static const Double_t electron_Compton_length = hbarc/electron_mass_c2;
311 static const Double_t Bohr_radius = electron_Compton_length/fine_structure_const;
312
313 static const Double_t alpha_rcl2 = fine_structure_const * classic_electr_radius * classic_electr_radius;
314 static const Double_t twopi_mc2_rcl2 = twopi * electron_mass_c2 * classic_electr_radius * classic_electr_radius;
315
316 //
317 static const Double_t k_Boltzmann = 8.617385e-11 * MeV/kelvin;
318
319 //
320 static const Double_t STP_Temperature = 273.15*kelvin;
321 static const Double_t STP_Pressure = 1.*atmosphere;
322 static const Double_t kGasThreshold = 10.*mg/cm3;
323
324 //
325 static const Double_t universe_mean_density = 1.e-25*g/cm3;
326
327 // speed of light in vacuum
328 static const Double_t speedOfLight = 299792458*m/s;
329
330 // specific SNDLHC constants
331 static const Double_t snd_freq = 160.316*megahertz; // sndlhc clock
332 static const Double_t snd_TDC2ns = (1E9/snd_freq)*ns;
333 };
334
335#endif /* defined(____ShipUnit__) */
Double_t meter
Definition BellField.cc:27
Double_t tesla
Double_t cm
Double_t m
Double_t kilogauss
Double_t mm
#define pascal
Definition ShipUnit.h:151
Double_t speedOfLight
Definition muonHit.cxx:27