rivet is hosted by Hepforge, IPPP Durham
Rivet  2.7.0
Units.hh
1 #ifndef RIVET_MATH_UNITS
2 #define RIVET_MATH_UNITS
3 
4 #include "Rivet/Math/MathHeader.hh"
5 
6 namespace Rivet {
7 
8  //
9  // Length [L]
10  //
11  static const double millimeter = 1.;
12  static const double millimeter2 = millimeter*millimeter;
13  static const double millimeter3 = millimeter*millimeter*millimeter;
14 
15  static const double centimeter = 10.*millimeter;
16  static const double centimeter2 = centimeter*centimeter;
17  static const double centimeter3 = centimeter*centimeter*centimeter;
18 
19  static const double meter = 1000.*millimeter;
20  static const double meter2 = meter*meter;
21  static const double meter3 = meter*meter*meter;
22 
23  static const double kilometer = 1000.*meter;
24  static const double kilometer2 = kilometer*kilometer;
25  static const double kilometer3 = kilometer*kilometer*kilometer;
26 
27  static const double parsec = 3.0856775807e+16*meter;
28 
29  static const double micrometer = 1.e-6 *meter;
30  static const double nanometer = 1.e-9 *meter;
31  static const double angstrom = 1.e-10*meter;
32  static const double picometer = 1.e-12*meter;
33  static const double femtometer = 1.e-15*meter;
34  static const double attometer = 1.e-18*meter;
35  static const double fermi = femtometer;
36 
37  // symbols
38  static const double mm = millimeter;
39  static const double mm2 = millimeter2;
40  static const double mm3 = millimeter3;
41 
42  static const double cm = centimeter;
43  static const double cm2 = centimeter2;
44  static const double cm3 = centimeter3;
45 
46  static const double m = meter;
47  static const double m2 = meter2;
48  static const double m3 = meter3;
49 
50  static const double km = kilometer;
51  static const double km2 = kilometer2;
52  static const double km3 = kilometer3;
53 
54  static const double pc = parsec;
55 
56 
57  // static const double barn = 1.e-28*meter2;
58  // Barn-units in terms of the pb returned by AGILe
59  static const double picobarn = 1.0;
60  static const double barn = 1.0e+12* picobarn;
61  static const double millibarn = 1.0e-3 * barn;
62  static const double microbarn = 1.0e-6 * barn;
63  static const double nanobarn = 1.0e-9 * barn;
64  static const double femtobarn = 1.0e-15 * barn;
65  static const double attobarn = 1.0e-18 * barn;
66 
67  //
68  // Angle
69  //
70  static const double radian = 1.;
71  static const double milliradian = 1.e-3*radian;
72  static const double degree = (3.14159265358979323846/180.0)*radian;
73  static const double steradian = 1.;
74 
75  // symbols
76  static const double rad = radian;
77  static const double mrad = milliradian;
78  static const double sr = steradian;
79  static const double deg = degree;
80 
81  //
82  // Time [T]
83  //
84  static const double nanosecond = 1.0;
85  static const double second = 1.e+9 *nanosecond;
86  static const double millisecond = 1.e-3 *second;
87  static const double microsecond = 1.e-6 *second;
88  static const double picosecond = 1.e-12*second;
89 
90  static const double hertz = 1.0/second;
91  static const double kilohertz = 1.e+3*hertz;
92  static const double megahertz = 1.e+6*hertz;
93 
94  // symbols
95  static const double ns = nanosecond;
96  static const double s = second;
97  static const double ms = millisecond;
98 
99  //
100  // Electric charge [Q]
101  //
102  static const double eplus = 1.0; // positron charge
103  static const double e_SI = 1.60217733e-19; // positron charge in coulomb
104  static const double coulomb = eplus/e_SI; // coulomb = 6.24150 e+18 * eplus
105 
106  //
107  // Energy [E]
108  //
109  static const double gigaelectronvolt = 1.;
110  static const double electronvolt = 1.e-9*gigaelectronvolt;
111  static const double kiloelectronvolt = 1.e-6*gigaelectronvolt;
112  static const double megaelectronvolt = 1.e-3*gigaelectronvolt;
113  static const double teraelectronvolt = 1.e+3*gigaelectronvolt;
114  static const double petaelectronvolt = 1.e+6*gigaelectronvolt;
115  static const double joule = electronvolt/e_SI; // joule = 6.24150 e+12 * MeV
116 
117  // symbols
118  static const double eV = electronvolt;
119  static const double keV = kiloelectronvolt;
120  static const double MeV = megaelectronvolt;
121  static const double GeV = gigaelectronvolt;
122  static const double TeV = teraelectronvolt;
123  static const double PeV = petaelectronvolt;
124 
125  static const double eV2 = eV*eV;
126  static const double keV2 = keV*keV;
127  static const double MeV2 = MeV*MeV;
128  static const double GeV2 = GeV*GeV;
129  static const double TeV2 = TeV*TeV;
130  static const double PeV2 = PeV*PeV;
131 
132  //
133  // Mass [E][T^2][L^-2]
134  //
135  static const double kilogram = joule*second*second/(meter*meter);
136  static const double gram = 1.e-3*kilogram;
137  static const double milligram = 1.e-3*gram;
138 
139  // symbols
140  static const double kg = kilogram;
141  static const double g = gram;
142  static const double mg = milligram;
143 
144  //
145  // Power [E][T^-1]
146  //
147  static const double watt = joule/second; // watt = 6.24150 e+3 * MeV/ns
148 
149  //
150  // Force [E][L^-1]
151  //
152  static const double newton = joule/meter; // newton = 6.24150 e+9 * MeV/mm
153 
154  //
155  // Pressure [E][L^-3]
156  //
157  #define pascal hep_pascal // a trick to avoid warnings
158  static const double hep_pascal = newton/m2; // pascal = 6.24150 e+3 * MeV/mm3
159  static const double bar = 100000*pascal; // bar = 6.24150 e+8 * MeV/mm3
160  static const double atmosphere = 101325*pascal; // atm = 6.32420 e+8 * MeV/mm3
161 
162  //
163  // Electric current [Q][T^-1]
164  //
165  static const double ampere = coulomb/second; // ampere = 6.24150 e+9 * eplus/ns
166  static const double milliampere = 1.e-3*ampere;
167  static const double microampere = 1.e-6*ampere;
168  static const double nanoampere = 1.e-9*ampere;
169 
170  //
171  // Electric potential [E][Q^-1]
172  //
173  static const double megavolt = megaelectronvolt/eplus;
174  static const double kilovolt = 1.e-3*megavolt;
175  static const double volt = 1.e-6*megavolt;
176 
177  //
178  // Electric resistance [E][T][Q^-2]
179  //
180  static const double ohm = volt/ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
181 
182  //
183  // Electric capacitance [Q^2][E^-1]
184  //
185  static const double farad = coulomb/volt; // farad = 6.24150e+24 * eplus/Megavolt
186  static const double millifarad = 1.e-3*farad;
187  static const double microfarad = 1.e-6*farad;
188  static const double nanofarad = 1.e-9*farad;
189  static const double picofarad = 1.e-12*farad;
190 
191  //
192  // Magnetic Flux [T][E][Q^-1]
193  //
194  static const double weber = volt*second; // weber = 1000*megavolt*ns
195 
196  //
197  // Magnetic Field [T][E][Q^-1][L^-2]
198  //
199  static const double tesla = volt*second/meter2; // tesla =0.001*megavolt*ns/mm2
200 
201  static const double gauss = 1.e-4*tesla;
202  static const double kilogauss = 1.e-1*tesla;
203 
204  //
205  // Inductance [T^2][E][Q^-2]
206  //
207  static const double henry = weber/ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2
208 
209  //
210  // Temperature
211  //
212  static const double kelvin = 1.;
213 
214  //
215  // Amount of substance
216  //
217  static const double mole = 1.;
218 
219  //
220  // Activity [T^-1]
221  //
222  static const double becquerel = 1./second ;
223  static const double curie = 3.7e+10 * becquerel;
224 
225  //
226  // Absorbed dose [L^2][T^-2]
227  //
228  static const double gray = joule/kilogram ;
229 
230  //
231  // Luminous intensity [I]
232  //
233  static const double candela = 1.;
234 
235  //
236  // Luminous flux [I]
237  //
238  static const double lumen = candela*steradian;
239 
240  //
241  // Illuminance [I][L^-2]
242  //
243  static const double lux = lumen/meter2;
244 
245  //
246  // Miscellaneous
247  //
248  static const double perCent = 0.01 ;
249  static const double perThousand = 0.001;
250  static const double perMillion = 0.000001;
251 
252 }
253 
254 #endif
Definition: ALICE_2010_I880049.cc:13