Geant4 Cross Reference

Cross-Referencing   Geant4
Geant4/externals/clhep/src/setSystemOfUnits.cc

Version: [ ReleaseNotes ] [ 1.0 ] [ 1.1 ] [ 2.0 ] [ 3.0 ] [ 3.1 ] [ 3.2 ] [ 4.0 ] [ 4.0.p1 ] [ 4.0.p2 ] [ 4.1 ] [ 4.1.p1 ] [ 5.0 ] [ 5.0.p1 ] [ 5.1 ] [ 5.1.p1 ] [ 5.2 ] [ 5.2.p1 ] [ 5.2.p2 ] [ 6.0 ] [ 6.0.p1 ] [ 6.1 ] [ 6.2 ] [ 6.2.p1 ] [ 6.2.p2 ] [ 7.0 ] [ 7.0.p1 ] [ 7.1 ] [ 7.1.p1 ] [ 8.0 ] [ 8.0.p1 ] [ 8.1 ] [ 8.1.p1 ] [ 8.1.p2 ] [ 8.2 ] [ 8.2.p1 ] [ 8.3 ] [ 8.3.p1 ] [ 8.3.p2 ] [ 9.0 ] [ 9.0.p1 ] [ 9.0.p2 ] [ 9.1 ] [ 9.1.p1 ] [ 9.1.p2 ] [ 9.1.p3 ] [ 9.2 ] [ 9.2.p1 ] [ 9.2.p2 ] [ 9.2.p3 ] [ 9.2.p4 ] [ 9.3 ] [ 9.3.p1 ] [ 9.3.p2 ] [ 9.4 ] [ 9.4.p1 ] [ 9.4.p2 ] [ 9.4.p3 ] [ 9.4.p4 ] [ 9.5 ] [ 9.5.p1 ] [ 9.5.p2 ] [ 9.6 ] [ 9.6.p1 ] [ 9.6.p2 ] [ 9.6.p3 ] [ 9.6.p4 ] [ 10.0 ] [ 10.0.p1 ] [ 10.0.p2 ] [ 10.0.p3 ] [ 10.0.p4 ] [ 10.1 ] [ 10.1.p1 ] [ 10.1.p2 ] [ 10.1.p3 ] [ 10.2 ] [ 10.2.p1 ] [ 10.2.p2 ] [ 10.2.p3 ] [ 10.3 ] [ 10.3.p1 ] [ 10.3.p2 ] [ 10.3.p3 ] [ 10.4 ] [ 10.4.p1 ] [ 10.4.p2 ] [ 10.4.p3 ] [ 10.5 ] [ 10.5.p1 ] [ 10.6 ] [ 10.6.p1 ] [ 10.6.p2 ] [ 10.6.p3 ] [ 10.7 ] [ 10.7.p1 ] [ 10.7.p2 ] [ 10.7.p3 ] [ 10.7.p4 ] [ 11.0 ] [ 11.0.p1 ] [ 11.0.p2 ] [ 11.0.p3, ] [ 11.0.p4 ] [ 11.1 ] [ 11.1.1 ] [ 11.1.2 ] [ 11.1.3 ] [ 11.2 ] [ 11.2.1 ] [ 11.2.2 ] [ 11.3.0 ]

Diff markup

Differences between /externals/clhep/src/setSystemOfUnits.cc (Version 11.3.0) and /externals/clhep/src/setSystemOfUnits.cc (Version 11.0.p1)


  1 // -*- C++ -*-                                      1 // -*- C++ -*-
  2 // -------------------------------------------      2 // ----------------------------------------------------------------------
  3                                                     3 
  4 #include "CLHEP/Evaluator/Evaluator.h"              4 #include "CLHEP/Evaluator/Evaluator.h"
  5                                                     5 
  6 namespace HepTool {                                 6 namespace HepTool {
  7                                                     7 
  8 void Evaluator::setSystemOfUnits(double meter,      8 void Evaluator::setSystemOfUnits(double meter,
  9          double kilogram,                           9          double kilogram,
 10          double second,                            10          double second,
 11          double ampere,                            11          double ampere,
 12          double kelvin,                            12          double kelvin,
 13          double mole,                              13          double mole,
 14          double candela)                           14          double candela)
 15 {                                                  15 {         
 16   const double kilo_  = 1.e+03; // chilioi (Gr     16   const double kilo_  = 1.e+03; // chilioi (Greek) "thousand"
 17   const double mega_  = 1.e+06; // megas (Gree     17   const double mega_  = 1.e+06; // megas (Greek) "large"
 18   const double giga_  = 1.e+09; // gigas (Gree     18   const double giga_  = 1.e+09; // gigas (Greek) "giant"
 19   const double tera_  = 1.e+12; // teras (Gree     19   const double tera_  = 1.e+12; // teras (Greek) "monster"
 20   const double peta_  = 1.e+15; // pente (Gree     20   const double peta_  = 1.e+15; // pente (Greek) "five"
 21                                                    21 
 22   const double deci_  = 1.e-01; // decimus (La     22   const double deci_  = 1.e-01; // decimus (Latin) "tenth"
 23   const double centi_ = 1.e-02; // centum  (La     23   const double centi_ = 1.e-02; // centum  (Latin) "hundred"
 24   const double milli_ = 1.e-03; // mille   (La     24   const double milli_ = 1.e-03; // mille   (Latin) "thousand"
 25   const double micro_ = 1.e-06; // micro (Lati     25   const double micro_ = 1.e-06; // micro (Latin) or mikros (Greek) "small"
 26   const double nano_  = 1.e-09; // nanus (Lati     26   const double nano_  = 1.e-09; // nanus (Latin) or nanos  (Greek) "dwarf"
 27   const double pico_  = 1.e-12; // pico (Spani     27   const double pico_  = 1.e-12; // pico (Spanish) "bit"
 28                                                    28 
 29   // =========================================     29   // ======================================================================
 30   //                                               30   //
 31   // Base (default) SI units                       31   // Base (default) SI units
 32   // for the basic measurable quantities (dime     32   // for the basic measurable quantities (dimensions):
 33   //                                               33   //
 34   // =========================================     34   // ======================================================================
 35                                                    35   
 36   // Length                                        36   // Length
 37   // metrum (Latin) and metron (Greek) "measur     37   // metrum (Latin) and metron (Greek) "measure"
 38   const double m = meter;                          38   const double m = meter;
 39   setVariable("meter", m);                         39   setVariable("meter", m);
 40   setVariable("metre", m);                         40   setVariable("metre", m);
 41   setVariable("m",     m);                         41   setVariable("m",     m);
 42                                                    42   
 43   // Mass                                          43   // Mass
 44   const double kg = kilogram;                      44   const double kg = kilogram;
 45   setVariable("kilogram", kg);                     45   setVariable("kilogram", kg);
 46   setVariable("kg",       kg);                     46   setVariable("kg",       kg);
 47                                                    47   
 48   // Time                                          48   // Time
 49   // minuta secundam (Latin) "second small one     49   // minuta secundam (Latin) "second small one"
 50   const double s = second;                         50   const double s = second;
 51   setVariable("second", s);                        51   setVariable("second", s);
 52   setVariable("s",      s);                        52   setVariable("s",      s);
 53                                                    53   
 54   // Current                                       54   // Current
 55   // ---  honors Andre-Marie Ampere (1775-1836     55   // ---  honors Andre-Marie Ampere (1775-1836) of France
 56   const double A = ampere;                         56   const double A = ampere;
 57   setVariable("ampere", A);                        57   setVariable("ampere", A);
 58   setVariable("amp",    A);                        58   setVariable("amp",    A);
 59   setVariable("A",      A);                        59   setVariable("A",      A);
 60                                                    60   
 61   // Temperature                                   61   // Temperature
 62   // ---  honors William Thomson, 1st Baron Lo     62   // ---  honors William Thomson, 1st Baron Lord Kelvin (1824-1907) of England
 63   const double K = kelvin;                         63   const double K = kelvin;
 64   setVariable("kelvin", K);                        64   setVariable("kelvin", K);
 65   setVariable("K",      K);                        65   setVariable("K",      K);
 66                                                    66   
 67   // Amount of substance                           67   // Amount of substance
 68   const double mol = mole;                         68   const double mol = mole;
 69   setVariable("mole", mol);                        69   setVariable("mole", mol);
 70   setVariable("mol",  mol);                        70   setVariable("mol",  mol);
 71                                                    71   
 72   // Luminous intensity                            72   // Luminous intensity
 73   const double cd  = candela;                      73   const double cd  = candela;
 74   setVariable("candela", cd);                      74   setVariable("candela", cd);
 75   setVariable("cd",      cd);                      75   setVariable("cd",      cd);
 76                                                    76 
 77   // =========================================     77   // ======================================================================
 78   //                                               78   //
 79   // Supplementary SI units having special sym     79   // Supplementary SI units having special symbols:
 80   //                                               80   //
 81   // =========================================     81   // ======================================================================
 82                                                    82 
 83   // Plane angle                                   83   // Plane angle 
 84   const double rad = 1.;                           84   const double rad = 1.;
 85   setVariable("radian", rad);                      85   setVariable("radian", rad);
 86   setVariable("rad",    rad);                      86   setVariable("rad",    rad);
 87   setVariable("milliradian", milli_ * rad);        87   setVariable("milliradian", milli_ * rad);
 88   setVariable("mrad",        milli_ * rad);        88   setVariable("mrad",        milli_ * rad);
 89                                                    89 
 90   const double pi  = 3.14159265358979323846;       90   const double pi  = 3.14159265358979323846;
 91   const double deg = rad*pi/180.;                  91   const double deg = rad*pi/180.;
 92   setVariable("degree", deg);                      92   setVariable("degree", deg);
 93   setVariable("deg",    deg);                      93   setVariable("deg",    deg);
 94                                                    94 
 95   // Solid angle                                   95   // Solid angle
 96   const double sr  = 1.;                           96   const double sr  = 1.;
 97   setVariable("steradian", sr);                    97   setVariable("steradian", sr);
 98   setVariable("sr",        sr);                    98   setVariable("sr",        sr);
 99                                                    99 
100   // =========================================    100   // ======================================================================
101   //                                              101   //
102   // Derived SI units having special symbols:     102   // Derived SI units having special symbols:
103   //                                              103   //
104   // =========================================    104   // ======================================================================
105                                                   105 
106   // Frequency                                    106   // Frequency
107   // ---  honors Heinrich Rudolf Hertz (1857-1    107   // ---  honors Heinrich Rudolf Hertz (1857-1894) of Germany
108   const double Hz = 1./s;                         108   const double Hz = 1./s;
109   setVariable("hertz", Hz);                       109   setVariable("hertz", Hz);
110   setVariable("Hz",    Hz);                       110   setVariable("Hz",    Hz);
111                                                   111 
112   // Force                                        112   // Force
113   // ---  honors Sir Isaac Newton (1642-1727)     113   // ---  honors Sir Isaac Newton (1642-1727) of England
114   const double N = m * kg / (s*s);                114   const double N = m * kg / (s*s);
115   setVariable("newton", N);                       115   setVariable("newton", N);
116   setVariable("N",      N);                       116   setVariable("N",      N);
117                                                   117 
118   // Pressure                                     118   // Pressure
119   // ---  honors Blaise Pascal (1623-1662) of     119   // ---  honors Blaise Pascal (1623-1662) of France
120   const double Pa = N / (m*m);                    120   const double Pa = N / (m*m);
121   setVariable("pascal", Pa);                      121   setVariable("pascal", Pa);
122   setVariable("Pa",     Pa);                      122   setVariable("Pa",     Pa);
123                                                   123 
124   const double atm = 101325. * Pa;                124   const double atm = 101325. * Pa;
125   setVariable("atmosphere", atm);                 125   setVariable("atmosphere", atm);
126   setVariable("atm",        atm);                 126   setVariable("atm",        atm);
127                                                   127 
128   const double bar = 100000*Pa;                   128   const double bar = 100000*Pa;
129   setVariable("bar", bar);                        129   setVariable("bar", bar);
130                                                   130 
131   // Energy                                       131   // Energy
132   // ---  honors James Prescott Joule (1818-18    132   // ---  honors James Prescott Joule (1818-1889) of England
133   const double J = N * m;                         133   const double J = N * m;
134   setVariable("joule", J);                        134   setVariable("joule", J);
135   setVariable("J",     J);                        135   setVariable("J",     J);
136                                                   136 
137   // Power                                        137   // Power
138   // ---  honors James Watt (1736-1819) of Sco    138   // ---  honors James Watt (1736-1819) of Scotland
139   const double W = J / s;                         139   const double W = J / s;
140   setVariable("watt", W);                         140   setVariable("watt", W);
141   setVariable("W",    W);                         141   setVariable("W",    W);
142                                                   142 
143   // Electric charge                              143   // Electric charge
144   // ---  honors Charles-Augustin de Coulomb (    144   // ---  honors Charles-Augustin de Coulomb (1736-1806) of France
145   const double C = A * s;                         145   const double C = A * s;
146   setVariable("coulomb", C);                      146   setVariable("coulomb", C);
147   setVariable("C",       C);                      147   setVariable("C",       C);
148                                                   148 
149   // Electric potential                           149   // Electric potential  
150   // ---  honors Count Alessandro Volta (1745-    150   // ---  honors Count Alessandro Volta (1745-1827) of Italy
151   const double V = J / C;                         151   const double V = J / C;
152   setVariable("volt", V);                         152   setVariable("volt", V);
153   setVariable("V",    V);                         153   setVariable("V",    V);
154                                                   154 
155   // Electric resistance                          155   // Electric resistance
156   // ---  honors Georg Simon Ohm (1787-1854) o    156   // ---  honors Georg Simon Ohm (1787-1854) of Germany
157   const double ohm = V / A;                       157   const double ohm = V / A;
158   setVariable("ohm", ohm);                        158   setVariable("ohm", ohm);
159                                                   159 
160   // Electric conductance                         160   // Electric conductance
161   // ---  honors Ernst Werner von Siemens (181    161   // ---  honors Ernst Werner von Siemens (1816-1892) or
162   //      his brother Sir William (Karl Wilhel    162   //      his brother Sir William (Karl Wilhelm von) Siemens (1823-1883)
163   //      of Germany (England)                    163   //      of Germany (England)
164   const double S = 1./ ohm;                       164   const double S = 1./ ohm;
165   setVariable("siemens", S);                      165   setVariable("siemens", S);
166   setVariable("S",       S);                      166   setVariable("S",       S);
167                                                   167 
168   // Electric capacitance                         168   // Electric capacitance
169   // ---  honors Michael Faraday (1791-1867) o    169   // ---  honors Michael Faraday (1791-1867) of England
170   const double F = C / V;                         170   const double F = C / V;
171   setVariable("farad", F);                        171   setVariable("farad", F);
172   setVariable("F",     F);                        172   setVariable("F",     F);
173                                                   173 
174   // Magnetic flux density                        174   // Magnetic flux density
175   // ---  honors Nikola Tesla (1856-1943) of C    175   // ---  honors Nikola Tesla (1856-1943) of Croatia (United States)
176   const double T = V * s / (m*m);                 176   const double T = V * s / (m*m);
177   setVariable("tesla", T);                        177   setVariable("tesla", T);
178   setVariable("T",     T);                        178   setVariable("T",     T);
179                                                   179 
180   // ---  honors Karl Friedrich Gauss (1777-18    180   // ---  honors Karl Friedrich Gauss (1777-1855) of Germany
181   const double Gs = 1.e-4*T;                      181   const double Gs = 1.e-4*T;
182   setVariable("gauss", Gs);                       182   setVariable("gauss", Gs);
183   setVariable("Gs",    Gs);                       183   setVariable("Gs",    Gs);
184                                                   184 
185   // Magnetic flux                                185   // Magnetic flux
186   // ---  honors Wilhelm Eduard Weber (1804-18    186   // ---  honors Wilhelm Eduard Weber (1804-1891) of Germany
187   const double Wb = V * s;                        187   const double Wb = V * s;
188   setVariable("weber", Wb);                       188   setVariable("weber", Wb);
189   setVariable("Wb",    Wb);                       189   setVariable("Wb",    Wb);
190                                                   190 
191   // Inductance                                   191   // Inductance
192   // ---  honors Joseph Henry (1797-1878) of t    192   // ---  honors Joseph Henry (1797-1878) of the United States
193   const double H = Wb / A;                        193   const double H = Wb / A;
194   setVariable("henry", H);                        194   setVariable("henry", H);
195   setVariable("H",     H);                        195   setVariable("H",     H);
196                                                   196 
197   // Luminous flux                                197   // Luminous flux
198   const double lm = cd * sr;                      198   const double lm = cd * sr;
199   setVariable("lumen", lm);                       199   setVariable("lumen", lm);
200   setVariable("lm",    lm);                       200   setVariable("lm",    lm);
201                                                   201 
202   // Illuminace                                   202   // Illuminace
203   const double lx = lm / (m*m);                   203   const double lx = lm / (m*m);
204   setVariable("lux", lx);                         204   setVariable("lux", lx);
205   setVariable("lx",  lx);                         205   setVariable("lx",  lx);
206                                                   206 
207   // Radioactivity                                207   // Radioactivity
208   // ---  honors Antoine-Henri Becquerel (1852    208   // ---  honors Antoine-Henri Becquerel (1852-1908) of France
209   const double Bq = 1./s;                         209   const double Bq = 1./s;
210   setVariable("becquerel", Bq);                   210   setVariable("becquerel", Bq);
211   setVariable("Bq",        Bq);                   211   setVariable("Bq",        Bq);
212   setVariable("kilobecquerel",  kilo_ * Bq);      212   setVariable("kilobecquerel",  kilo_ * Bq);
213   setVariable("kBq",            kilo_ * Bq);      213   setVariable("kBq",            kilo_ * Bq);
214   setVariable("megabecquerel",  mega_ * Bq);      214   setVariable("megabecquerel",  mega_ * Bq);
215   setVariable("MBq",            mega_ * Bq);      215   setVariable("MBq",            mega_ * Bq);
216   setVariable("gigabecquerel",  giga_ * Bq);      216   setVariable("gigabecquerel",  giga_ * Bq);
217   setVariable("GBq",            giga_ * Bq);      217   setVariable("GBq",            giga_ * Bq);
218                                                   218 
219   // ---  honors Pierre Curie (1859-1906) of F    219   // ---  honors Pierre Curie (1859-1906) of France
220   //      and Marie Sklodowska Curie (1867-193    220   //      and Marie Sklodowska Curie (1867-1934) of Poland
221   setVariable("curie", 3.7e+10 * Bq);             221   setVariable("curie", 3.7e+10 * Bq);
222   setVariable("Ci",    3.7e+10 * Bq);             222   setVariable("Ci",    3.7e+10 * Bq);
223   setVariable("millicurie", milli_ * 3.7e+10 *    223   setVariable("millicurie", milli_ * 3.7e+10 * Bq);
224   setVariable("mCi",        milli_ * 3.7e+10 *    224   setVariable("mCi",        milli_ * 3.7e+10 * Bq);
225   setVariable("microcurie", micro_ * 3.7e+10 *    225   setVariable("microcurie", micro_ * 3.7e+10 * Bq);
226   setVariable("uCi",        micro_ * 3.7e+10 *    226   setVariable("uCi",        micro_ * 3.7e+10 * Bq);
227                                                   227 
228   // Specific energy                              228   // Specific energy
229   // ---  honors Louis Harold Gray, F.R.S. (19    229   // ---  honors Louis Harold Gray, F.R.S. (1905-1965) of England
230   const double Gy = J / kg;                       230   const double Gy = J / kg;
231   setVariable("gray", Gy);                        231   setVariable("gray", Gy);
232   setVariable("Gy",   Gy);                        232   setVariable("Gy",   Gy);
233   setVariable("kilogray",   kilo_ * Gy);          233   setVariable("kilogray",   kilo_ * Gy);
234   setVariable("milligray", milli_ * Gy);          234   setVariable("milligray", milli_ * Gy);
235   setVariable("microgray", micro_ * Gy);          235   setVariable("microgray", micro_ * Gy);
236                                                   236 
237   // Dose equivalent                              237   // Dose equivalent
238   const double Sv = J / kg;                       238   const double Sv = J / kg;
239   setVariable("sievert", Sv);                     239   setVariable("sievert", Sv);
240   setVariable("Sv",      Sv);                     240   setVariable("Sv",      Sv);
241                                                   241 
242   // =========================================    242   // ======================================================================
243   //                                              243   //
244   // Selected units:                              244   // Selected units:
245   //                                              245   //
246   // =========================================    246   // ======================================================================
247                                                   247 
248   // Length                                       248   // Length
249                                                   249 
250   const double mm = milli_ * m;                   250   const double mm = milli_ * m;
251   setVariable("millimeter", mm);                  251   setVariable("millimeter", mm);
252   setVariable("mm",         mm);                  252   setVariable("mm",         mm);
253                                                   253 
254   const double cm = centi_ * m;                   254   const double cm = centi_ * m;
255   setVariable("centimeter", cm);                  255   setVariable("centimeter", cm);
256   setVariable("cm",         cm);                  256   setVariable("cm",         cm);
257                                                   257 
258   setVariable("decimeter",  deci_ * m);           258   setVariable("decimeter",  deci_ * m);
259                                                   259 
260   const double km = kilo_ * m;                    260   const double km = kilo_ * m; 
261   setVariable("kilometer",  km);                  261   setVariable("kilometer",  km);
262   setVariable("km",         km);                  262   setVariable("km",         km);
263                                                   263 
264   setVariable("micrometer", micro_ * m);          264   setVariable("micrometer", micro_ * m);
265   setVariable("micron",     micro_ * m);          265   setVariable("micron",     micro_ * m);
266   setVariable("um",         micro_ * m);       << 
267   setVariable("nanometer",  nano_  * m);          266   setVariable("nanometer",  nano_  * m);
268   setVariable("nm",         nano_  * m);       << 
269                                                << 
270   const double parsec = 3.0856775807e+16 * m;  << 
271   setVariable("parsec",     parsec);           << 
272   setVariable("pc",         parsec);           << 
273                                                   267 
274   // ---  honors Anders Jonas Angstrom (1814-1    268   // ---  honors Anders Jonas Angstrom (1814-1874) of Sweden
275   setVariable("angstrom",   1.e-10 * m);          269   setVariable("angstrom",   1.e-10 * m);
276                                                   270 
277   // ---  honors Enrico Fermi (1901-1954) of I    271   // ---  honors Enrico Fermi (1901-1954) of Italy
278   setVariable("fermi",      1.e-15 * m);          272   setVariable("fermi",      1.e-15 * m);
279                                                   273 
280   // Length^2                                     274   // Length^2
281                                                   275 
282   setVariable("m2",  m*m);                        276   setVariable("m2",  m*m);
283   setVariable("mm2", mm*mm);                      277   setVariable("mm2", mm*mm);
284   setVariable("cm2", cm*cm);                      278   setVariable("cm2", cm*cm);
285   setVariable("km2", km*km);                      279   setVariable("km2", km*km);
286                                                   280 
287   const double barn = 1.e-28 * m*m;               281   const double barn = 1.e-28 * m*m; 
288   setVariable("barn",      barn);                 282   setVariable("barn",      barn);
289   setVariable("millibarn", milli_ * barn);        283   setVariable("millibarn", milli_ * barn);
290   setVariable("mbarn",     milli_ * barn);        284   setVariable("mbarn",     milli_ * barn);
291   setVariable("microbarn", micro_ * barn);        285   setVariable("microbarn", micro_ * barn);
292   setVariable("nanobarn",  nano_  * barn);        286   setVariable("nanobarn",  nano_  * barn);
293   setVariable("picobarn",  pico_  * barn);        287   setVariable("picobarn",  pico_  * barn);
294                                                   288 
295   // LengthL^3                                    289   // LengthL^3
296                                                   290 
297   setVariable("m3",  m*m*m);                      291   setVariable("m3",  m*m*m);
298   setVariable("mm3", mm*mm*mm);                   292   setVariable("mm3", mm*mm*mm);
299   setVariable("cm3", cm*cm*cm);                   293   setVariable("cm3", cm*cm*cm);
300   setVariable("cc",  cm*cm*cm);                   294   setVariable("cc",  cm*cm*cm);
301   setVariable("km3", km*km*km);                   295   setVariable("km3", km*km*km);
302                                                   296 
303   const double L = 1.e-3*m*m*m;                   297   const double L = 1.e-3*m*m*m;
304   setVariable("liter", L);                        298   setVariable("liter", L);  
305   setVariable("litre", L);                        299   setVariable("litre", L);  
306   setVariable("L",     L);                        300   setVariable("L",     L);  
307   setVariable("centiliter",  centi_ * L);         301   setVariable("centiliter",  centi_ * L);
308   setVariable("cL",          centi_ * L);         302   setVariable("cL",          centi_ * L);
309   setVariable("milliliter",  milli_ * L);         303   setVariable("milliliter",  milli_ * L);
310   setVariable("mL",          milli_ * L);         304   setVariable("mL",          milli_ * L);
311                                                   305 
312   // Length^-1                                    306   // Length^-1
313                                                   307 
314   const double dpt = 1./m;                        308   const double dpt = 1./m;
315   setVariable("diopter", dpt);                    309   setVariable("diopter", dpt);
316   setVariable("dioptre", dpt);                    310   setVariable("dioptre", dpt);
317   setVariable("dpt",     dpt);                    311   setVariable("dpt",     dpt);
318                                                   312 
319   // Mass                                         313   // Mass
320                                                   314 
321   const double g = 0.001*kg;                      315   const double g = 0.001*kg;
322   setVariable("gram", g);                         316   setVariable("gram", g);
323   setVariable("g",    g);                         317   setVariable("g",    g);
324   setVariable("milligram",   milli_ * g);         318   setVariable("milligram",   milli_ * g);
325   setVariable("mg",          milli_ * g);         319   setVariable("mg",          milli_ * g);
326                                                   320   
327   // Time                                         321   // Time
328                                                   322 
329   setVariable("millisecond", milli_ * s);         323   setVariable("millisecond", milli_ * s);
330   setVariable("ms",          milli_ * s);         324   setVariable("ms",          milli_ * s);
331   setVariable("microsecond", micro_ * s);         325   setVariable("microsecond", micro_ * s);
332   setVariable("us",          micro_ * s);         326   setVariable("us",          micro_ * s);
333   setVariable("nanosecond",  nano_  * s);         327   setVariable("nanosecond",  nano_  * s);
334   setVariable("ns",          nano_  * s);         328   setVariable("ns",          nano_  * s);
335   setVariable("picosecond",  pico_  * s);         329   setVariable("picosecond",  pico_  * s);
336   setVariable("ps",          pico_  * s);         330   setVariable("ps",          pico_  * s);
337                                                   331 
338   const double minute = 60*s;                  << 
339   setVariable("minute", minute);               << 
340   const double hour   = 60*minute;             << 
341   setVariable("hour", hour);                   << 
342   const double day    = 24*hour;               << 
343   setVariable("day", day);                     << 
344   const double year   = 365*day;               << 
345   setVariable("year", year);                   << 
346                                                << 
347   // Current                                      332   // Current
348                                                   333 
349   setVariable("milliampere", milli_ * A);         334   setVariable("milliampere", milli_ * A);
350   setVariable("mA",          milli_ * A);         335   setVariable("mA",          milli_ * A);
351   setVariable("microampere", micro_ * A);         336   setVariable("microampere", micro_ * A);
352   setVariable("nanoampere",  nano_  * A);         337   setVariable("nanoampere",  nano_  * A);
353                                                   338 
354   // Frequency                                    339   // Frequency
355                                                   340 
356   setVariable("kilohertz",   kilo_ * Hz);         341   setVariable("kilohertz",   kilo_ * Hz);
357   setVariable("kHz",         kilo_ * Hz);         342   setVariable("kHz",         kilo_ * Hz);
358   setVariable("megahertz",   mega_ * Hz);         343   setVariable("megahertz",   mega_ * Hz);
359   setVariable("MHz",         mega_ * Hz);         344   setVariable("MHz",         mega_ * Hz);
360                                                   345 
361   // Force                                        346   // Force
362   setVariable("kilonewton",  kilo_ * N);          347   setVariable("kilonewton",  kilo_ * N);
363   setVariable("kN",          kilo_ * N);          348   setVariable("kN",          kilo_ * N);
364                                                   349 
365   // Pressure                                     350   // Pressure
366   setVariable("kilobar",     kilo_ * bar);        351   setVariable("kilobar",     kilo_ * bar);
367   setVariable("kbar",        kilo_ * bar);        352   setVariable("kbar",        kilo_ * bar);
368   setVariable("millibar",    milli_ * bar);       353   setVariable("millibar",    milli_ * bar);
369   setVariable("mbar",        milli_ * bar);       354   setVariable("mbar",        milli_ * bar);
370                                                   355 
371   // Energy                                       356   // Energy
372   setVariable("kilojoule",   kilo_ * J);          357   setVariable("kilojoule",   kilo_ * J);
373   setVariable("kJ",          kilo_ * J);          358   setVariable("kJ",          kilo_ * J);
374   setVariable("megajoule",   mega_ * J);          359   setVariable("megajoule",   mega_ * J);
375   setVariable("MJ",          mega_ * J);          360   setVariable("MJ",          mega_ * J);
376   setVariable("gigajoule",   giga_ * J);          361   setVariable("gigajoule",   giga_ * J);
377   setVariable("GJ",          giga_ * J);          362   setVariable("GJ",          giga_ * J);
378                                                   363 
379   const double e_SI  = 1.602176634e-19; // pos << 364   const double e_SI  = 1.60217733e-19;  // positron charge in coulomb
380   const double ePlus = e_SI * C;        // pos    365   const double ePlus = e_SI * C;        // positron charge
381   const double eV    = ePlus * V;                 366   const double eV    = ePlus * V;
382   setVariable("electronvolt", eV);                367   setVariable("electronvolt", eV);
383   setVariable("eV",           eV);                368   setVariable("eV",           eV);
384   setVariable("millielectronvolt", milli_ * eV << 
385   setVariable("kiloelectronvolt", kilo_ * eV);    369   setVariable("kiloelectronvolt", kilo_ * eV);
386   setVariable("keV",              kilo_ * eV);    370   setVariable("keV",              kilo_ * eV);
387   setVariable("megaelectronvolt", mega_ * eV);    371   setVariable("megaelectronvolt", mega_ * eV);
388   setVariable("MeV",              mega_ * eV);    372   setVariable("MeV",              mega_ * eV);
389   setVariable("gigaelectronvolt", giga_ * eV);    373   setVariable("gigaelectronvolt", giga_ * eV);
390   setVariable("GeV",              giga_ * eV);    374   setVariable("GeV",              giga_ * eV);
391   setVariable("teraelectronvolt", tera_ * eV);    375   setVariable("teraelectronvolt", tera_ * eV);
392   setVariable("TeV",              tera_ * eV);    376   setVariable("TeV",              tera_ * eV);
393   setVariable("petaelectronvolt", peta_ * eV);    377   setVariable("petaelectronvolt", peta_ * eV);
394   setVariable("PeV",              peta_ * eV);    378   setVariable("PeV",              peta_ * eV);
395                                                   379 
396   // Power                                        380   // Power
397   setVariable("kilowatt",    kilo_ * W);          381   setVariable("kilowatt",    kilo_ * W);
398   setVariable("kW",          kilo_ * W);          382   setVariable("kW",          kilo_ * W);
399   setVariable("megawatt",    mega_ * W);          383   setVariable("megawatt",    mega_ * W);
400   setVariable("MW",          mega_ * W);          384   setVariable("MW",          mega_ * W);
401   setVariable("gigawatt",    giga_ * W);          385   setVariable("gigawatt",    giga_ * W);
402   setVariable("GW",          giga_ * W);          386   setVariable("GW",          giga_ * W);
403                                                   387 
404   // Electric potential                           388   // Electric potential  
405   setVariable("kilovolt",    kilo_ * V);          389   setVariable("kilovolt",    kilo_ * V);
406   setVariable("kV",          kilo_ * V);          390   setVariable("kV",          kilo_ * V);
407   setVariable("megavolt",    mega_ * V);          391   setVariable("megavolt",    mega_ * V);
408   setVariable("MV",          mega_ * V);          392   setVariable("MV",          mega_ * V);
409                                                   393 
410   // Electric capacitance                         394   // Electric capacitance
411   setVariable("millifarad",  milli_ * F);         395   setVariable("millifarad",  milli_ * F);
412   setVariable("mF",          milli_ * F);         396   setVariable("mF",          milli_ * F);
413   setVariable("microfarad",  micro_ * F);         397   setVariable("microfarad",  micro_ * F);
414   setVariable("uF",          micro_ * F);         398   setVariable("uF",          micro_ * F);
415   setVariable("nanofarad",   nano_  * F);         399   setVariable("nanofarad",   nano_  * F);
416   setVariable("nF",          nano_  * F);         400   setVariable("nF",          nano_  * F);
417   setVariable("picofarad",   pico_  * F);         401   setVariable("picofarad",   pico_  * F);
418   setVariable("pF",          pico_  * F);         402   setVariable("pF",          pico_  * F);
419                                                   403 
420   // Magnetic flux density                        404   // Magnetic flux density
421   setVariable("kilogauss",   kilo_ * Gs);         405   setVariable("kilogauss",   kilo_ * Gs);
422   setVariable("kGs",         kilo_ * Gs);         406   setVariable("kGs",         kilo_ * Gs);
423 }                                                 407 }
424                                                   408 
425 } // namespace HepTool                            409 } // namespace HepTool
426                                                   410