]>
Commit | Line | Data |
---|---|---|
67427ff7 | 1 | /*************************************************************************** |
2 | * | |
3 | * $Id$ | |
4 | * | |
5 | * Author: blasiuk adapted from CLHEP | |
6 | *************************************************************************** | |
7 | * | |
8 | * Description: This file is based on the SystemOfUnits provided | |
9 | * in the CLHEP library v1.2: The units remain the same. | |
10 | * It is just the naming conventions that are different: | |
11 | * | |
12 | * 1) No single letter unit: | |
13 | * : m --> meter | |
14 | * : s --> second | |
15 | * : g --> gram | |
16 | * | |
17 | * 2) All prefixes are spelled out explicitly (except electron Volt): | |
18 | * : ns --> nanosecond | |
19 | * : mm --> millimeter | |
20 | * | |
21 | * 3) All units with proper names follow the international standard | |
22 | * of being lower case: | |
23 | * : farad --> farad | |
24 | * : volt --> volt | |
25 | * | |
26 | * The basic units are : | |
27 | * centimeter (centimeter) | |
28 | * second (second) | |
29 | * Giga electron Volt (GeV) | |
30 | * positron charge (eplus) | |
31 | * degree Kelvin (kelvin) | |
32 | * the amount of substance (mole) | |
33 | * radian (radian) | |
34 | * steradian (steradian) | |
35 | *************************************************************************** | |
36 | * | |
37 | * $Log$ | |
ea77036b | 38 | * Revision 1.1.2.1 2007/10/05 09:38:17 akisiel |
39 | * Fix stray colons | |
40 | * | |
41 | * Revision 1.1 2007/05/16 10:22:12 akisiel | |
42 | * Making the directory structure of AliFemto flat. All files go into one common directory | |
43 | * | |
d0e92d9a | 44 | * Revision 1.1.1.1 2007/04/25 15:38:41 panos |
45 | * Importing the HBT code dir | |
46 | * | |
67427ff7 | 47 | * Revision 1.1.1.1 2007/03/07 10:14:49 mchojnacki |
48 | * First version on CVS | |
49 | * | |
50 | * Revision 1.5 2003/09/02 17:59:35 perev | |
51 | * gcc 3.2 updates + WarnOff | |
52 | * | |
53 | * Revision 1.4 1999/03/22 16:21:38 fisyak | |
54 | * Add anti CINT flags | |
55 | * | |
56 | * Revision 1.3 1999/03/11 14:53:07 ullrich | |
57 | * Added definition of inch. | |
58 | * | |
59 | * Revision 1.2 1999/03/02 20:15:08 ullrich | |
60 | * Added millivolt. | |
61 | * | |
62 | * Revision 1.1 1999/01/30 03:59:06 fisyak | |
63 | * Root Version of StarClassLibrary | |
64 | * | |
65 | * Revision 1.1 1999/01/23 00:28:08 ullrich | |
66 | * Initial Revision | |
67 | * | |
68 | **************************************************************************/ | |
69 | #ifndef HEP_SYSTEM_OF_UNITS_H | |
70 | #define HEP_SYSTEM_OF_UNITS_H | |
71 | ||
72 | ||
73 | #ifndef M_PI | |
74 | #define M_PI 3.14159265358979312 | |
75 | #endif | |
76 | ||
77 | ||
78 | namespace units { | |
79 | // new macro for CLHEP SystemOfUnits: at end of file | |
80 | // ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS | |
81 | // | |
82 | // Length [L] | |
83 | // | |
84 | static const double millimeter = 0.1; | |
85 | static const double millimeter2 = millimeter*millimeter; | |
86 | static const double millimeter3 = millimeter*millimeter*millimeter; | |
87 | ||
88 | static const double centimeter = 10*millimeter; | |
89 | static const double centimeter2 = centimeter*centimeter; | |
90 | static const double centimeter3 = centimeter*centimeter*centimeter; | |
91 | ||
92 | static const double meter = 100.*centimeter; | |
93 | static const double meter2 = meter*meter; | |
94 | static const double meter3 = meter*meter*meter; | |
95 | ||
96 | static const double kilometer = 1000.*meter; | |
97 | static const double kilometer2 = kilometer*kilometer; | |
98 | static const double kilometer3 = kilometer*kilometer*kilometer; | |
99 | ||
100 | static const double micrometer = 1.e-6*meter; | |
101 | static const double nanometer = 1.e-9*meter; | |
102 | static const double femtometer = 1.e-15*meter; | |
103 | static const double fermi = 1*femtometer; | |
104 | ||
105 | static const double barn = 1.e-28*meter2; | |
106 | static const double millibarn = 1.e-3*barn; | |
107 | static const double microbarn = 1.e-6*barn; | |
108 | static const double nanobarn = 1.e-9*barn; | |
109 | static const double inch = 2.54*centimeter; | |
110 | ||
111 | // | |
112 | // Angle | |
113 | // | |
114 | static const double radian = 1.; | |
115 | static const double milliradian = 1.e-3*radian; | |
116 | #ifndef __CINT__ | |
117 | static const double degree = (M_PI/180.0)*radian; | |
118 | #endif | |
119 | static const double steradian = 1.; | |
120 | ||
121 | // | |
122 | // Time [T] | |
123 | // | |
124 | static const double second = 1; | |
125 | static const double millisecond = 1.e-3*second; | |
126 | static const double microsecond = 1.e-3*millisecond; | |
127 | static const double nanosecond = 1.e-3*microsecond; | |
128 | ||
129 | static const double hertz = 1./second; | |
130 | static const double kilohertz = 1.e+3*hertz; | |
131 | static const double Megahertz = 1.e+6*hertz; | |
132 | ||
133 | // but these are also unambiguous and unlikely to be used as variable! | |
134 | static const double Hz = 1*hertz; | |
135 | static const double kHz = 1*kilohertz; | |
136 | static const double MHz = 1*Megahertz; | |
137 | ||
138 | // | |
139 | // Electric charge [Q] | |
140 | // | |
141 | static const double eplus = 1. ; // positron charge | |
142 | static const double e_SI = 1.60217733e-19; // positron charge in coulomb | |
143 | static const double coulomb = eplus/e_SI; | |
144 | ||
145 | // | |
146 | // Energy [E] | |
147 | // | |
148 | static const double Gigaelectronvolt = 1.; | |
149 | static const double Megaelectronvolt = 1.e-3*Gigaelectronvolt; | |
150 | static const double electronvolt = 1.e-6*Megaelectronvolt; | |
151 | static const double kiloelectronvolt = 1.e+3*electronvolt; | |
152 | static const double Teraelectronvolt = 1.e+3*Gigaelectronvolt; | |
153 | ||
154 | // but these are also unambiguous and unlikely to be used as variables | |
155 | static const double MeV = Megaelectronvolt; | |
156 | static const double eV = electronvolt; | |
157 | static const double keV = kiloelectronvolt; | |
158 | static const double GeV = Gigaelectronvolt; | |
159 | static const double TeV = Teraelectronvolt; | |
160 | ||
161 | static const double joule = electronvolt/e_SI; | |
162 | ||
163 | // | |
164 | // Mass [E][T^2][L^-2] | |
165 | // | |
166 | static const double kilogram = joule*second*second/(meter*meter); | |
167 | static const double gram = 1.e-3*kilogram; | |
168 | static const double milligram = 1.e-3*gram; | |
169 | ||
170 | // | |
171 | // Power [E][T^-1] | |
172 | // | |
173 | static const double watt = joule/second; | |
174 | ||
175 | // | |
176 | // Force [E][L^-1] | |
177 | // | |
178 | static const double newton = joule/meter; | |
179 | ||
180 | // | |
181 | // Pressure [E][L^-3] | |
182 | // | |
183 | #ifndef __CINT__ | |
184 | #define pascal hep_pascal // a trick to avoid warnings | |
185 | static const double hep_pascal = newton/meter2; | |
186 | #else | |
187 | static const double pascal = newton/meter2; | |
188 | #endif | |
189 | static const double bar = 100000*pascal; | |
190 | static const double atmosphere = 101325*pascal; | |
191 | ||
192 | // | |
193 | // Electric current [Q][T^-1] | |
194 | // | |
195 | static const double ampere = coulomb/second; | |
196 | ||
197 | // | |
198 | // Electric potential [E][Q^-1] | |
199 | // | |
200 | static const double Megavolt = MeV/eplus; | |
201 | static const double kilovolt = 1.e-3*Megavolt; | |
202 | static const double volt = 1.e-6*Megavolt; | |
203 | static const double millivolt = 1.e-3*volt; | |
204 | ||
205 | // | |
206 | // Electric resistance [E][T][Q^-2] | |
207 | // | |
208 | static const double ohm = volt/ampere; | |
209 | ||
210 | // | |
211 | // Electric capacitance [Q^2][E^-1] | |
212 | // | |
213 | static const double farad = coulomb/volt; | |
214 | static const double millifarad = 1.e-3*farad; | |
215 | static const double microfarad = 1.e-6*farad; | |
216 | static const double nanofarad = 1.e-9*farad; | |
217 | static const double picofarad = 1.e-12*farad; | |
218 | ||
219 | // | |
220 | // Magnetic Flux [T][E][Q^-1] | |
221 | // | |
222 | static const double weber = volt*second; | |
223 | ||
224 | // | |
225 | // Magnetic Field [T][E][Q^-1][L^-2] | |
226 | // | |
227 | static const double tesla = volt*second/meter2; | |
228 | ||
229 | static const double gauss = 1.e-4*tesla; | |
230 | static const double kilogauss = 1.e-1*tesla; | |
231 | ||
232 | // | |
233 | // Inductance [T^2][E][Q^-2] | |
234 | // | |
235 | static const double henry = weber/ampere; | |
236 | ||
237 | // | |
238 | // Temperature | |
239 | // | |
240 | static const double kelvin = 1.; | |
241 | ||
242 | // | |
243 | // Amount of substance | |
244 | // | |
245 | static const double mole = 1.; | |
246 | ||
247 | // | |
248 | // Activity [T^-1] | |
249 | // | |
250 | static const double becquerel = 1./second; | |
251 | static const double curie = 3.7e+10 * becquerel; | |
252 | ||
253 | // | |
254 | // Absorbed dose [L^2][T^-2] | |
255 | // | |
256 | static const double gray = joule/kilogram ; | |
257 | ||
258 | // | |
259 | // Miscellaneous | |
260 | // | |
261 | static const double perCent = 0.01 ; | |
262 | static const double perThousand = 0.001; | |
263 | static const double perMillion = 0.000001; | |
264 | ||
265 | #ifdef ST_ADD_OLD_CLHEP_SYSTEM_OF_UNITS | |
266 | ||
267 | static const double mm = 0.1; // millimeter | |
268 | static const double mm2 = mm*mm; | |
269 | static const double mm3 = mm*mm*mm; | |
270 | ||
271 | static const double cm = 10.*mm; // centimeter | |
272 | static const double cm2 = cm*cm; | |
273 | static const double cm3 = cm*cm*cm; | |
274 | ||
275 | static const double m = 1000.*mm; // meter | |
276 | static const double m2 = m*m; | |
277 | static const double m3 = m*m*m; | |
278 | ||
279 | static const double km = 1000.*m; // kilometer | |
280 | static const double km2 = km*km; | |
281 | static const double km3 = km*km*km; | |
282 | ||
283 | static const double microm = 1.e-6*m; // micro meter | |
284 | static const double nanom = 1.e-9*m; | |
285 | //static const double fermi = 1.e-15*m; | |
286 | ||
287 | // | |
288 | // Angle | |
289 | // | |
290 | static const double rad = 1.; // radian | |
291 | static const double mrad = 1.e-3*rad; // milliradian | |
292 | static const double deg = (M_PI/180.0)*rad; | |
293 | ||
294 | static const double st = 1.; // steradian | |
295 | ||
296 | // | |
297 | // Time [T] | |
298 | // | |
299 | static const double s = 1; // second | |
300 | static const double ns = 1.e-9*s; // nano second | |
301 | static const double ms = 1.e-3*s; // milli second | |
302 | ||
303 | // Mass [E][T^2][L^-2] | |
304 | // | |
305 | static const double kg = joule*second*second/(meter*meter); // kg = 6.24150 e+24 * MeV*ns*ns/(mm*mm) | |
306 | static const double g = 1.e-3*kg; | |
307 | static const double mg = 1.e-3*g; | |
308 | ||
309 | #endif | |
310 | ||
ea77036b | 311 | } |
67427ff7 | 312 | using namespace units; |
313 | #endif /* HEP_SYSTEM_OF_UNITS_H */ |