G4SIunits.hh

Go to the documentation of this file.
00001 //
00002 // ********************************************************************
00003 // * License and Disclaimer                                           *
00004 // *                                                                  *
00005 // * The  Geant4 software  is  copyright of the Copyright Holders  of *
00006 // * the Geant4 Collaboration.  It is provided  under  the terms  and *
00007 // * conditions of the Geant4 Software License,  included in the file *
00008 // * LICENSE and available at  http://cern.ch/geant4/license .  These *
00009 // * include a list of copyright holders.                             *
00010 // *                                                                  *
00011 // * Neither the authors of this software system, nor their employing *
00012 // * institutes,nor the agencies providing financial support for this *
00013 // * work  make  any representation or  warranty, express or implied, *
00014 // * regarding  this  software system or assume any liability for its *
00015 // * use.  Please see the license in the file  LICENSE  and URL above *
00016 // * for the full disclaimer and the limitation of liability.         *
00017 // *                                                                  *
00018 // * This  code  implementation is the result of  the  scientific and *
00019 // * technical work of the GEANT4 collaboration.                      *
00020 // * By using,  copying,  modifying or  distributing the software (or *
00021 // * any work based  on the software)  you  agree  to acknowledge its *
00022 // * use  in  resulting  scientific  publications,  and indicate your *
00023 // * acceptance of all terms of the Geant4 Software license.          *
00024 // ********************************************************************
00025 //
00026 //
00027 // $Id$
00028 // 
00029 // ----------------------------------------------------------------------
00030 //
00031 // Class description:
00032 //
00033 // This file is a modified version of SystemOfUnits.h
00034 // It is provided for checking the overall 'units coherence' of the
00035 // Geant4 kernel.
00036 // -------
00037 // Warning: if you use it, do not forget to recompile the whole Geant4 kernel
00038 // ------- 
00039 // The basic units are those of the International System:
00040 //
00041 //              meter             
00042 //              second             
00043 //              kilogram      
00044 //              ampere         
00045 //              degree kelvin          
00046 //              the amount of substance (mole)
00047 //              luminous intensity      (candela)
00048 //              radian                  
00049 //              steradian              
00050 //
00051 //
00052 // The SI numerical value of the positron charge is defined here,
00053 // as it is needed for conversion factor : positron charge = e_SI (coulomb)
00054 //
00055 // The others physical constants are defined in the header file :
00056 //                      PhysicalConstants.h
00057 //
00058 
00059 // Authors: M.Maire, S.Giani
00060 //
00061 // History:
00062 //
00063 // 10.03.99   created
00064 // 01.03.01   parsec      
00065 
00066 #ifndef G4UNITSTEST_HH
00067 #define G4UNITSTEST_HH
00068 
00069 // 
00070 // Length [L]
00071 //
00072 static const double meter  = 1.;                  
00073 static const double meter2 = meter*meter;
00074 static const double meter3 = meter*meter*meter;
00075 
00076 static const double millimeter  = 0.001*meter;                        
00077 static const double millimeter2 = millimeter*millimeter;
00078 static const double millimeter3 = millimeter*millimeter*millimeter;
00079 
00080 static const double centimeter  = 10.*millimeter;   
00081 static const double centimeter2 = centimeter*centimeter;
00082 static const double centimeter3 = centimeter*centimeter*centimeter;
00083 
00084 static const double kilometer = 1000.*meter;                   
00085 static const double kilometer2 = kilometer*kilometer;
00086 static const double kilometer3 = kilometer*kilometer*kilometer;
00087 
00088 static const double parsec = 3.0856775807e+16*meter;
00089 
00090 static const double micrometer = 1.e-6 *meter;             
00091 static const double  nanometer = 1.e-9 *meter;
00092 static const double  angstrom  = 1.e-10*meter;
00093 static const double  fermi     = 1.e-15*meter;
00094 
00095 static const double      barn = 1.e-28*meter2;
00096 static const double millibarn = 1.e-3 *barn;
00097 static const double microbarn = 1.e-6 *barn;
00098 static const double  nanobarn = 1.e-9 *barn;
00099 static const double  picobarn = 1.e-12*barn;
00100 
00101 // symbols
00102 static const double mm  = millimeter;                        
00103 static const double mm2 = millimeter2;
00104 static const double mm3 = millimeter3;
00105 
00106 static const double cm  = centimeter;   
00107 static const double cm2 = centimeter2;
00108 static const double cm3 = centimeter3;
00109 
00110 static const double m  = meter;                  
00111 static const double m2 = meter2;
00112 static const double m3 = meter3;
00113 
00114 static const double km  = kilometer;                   
00115 static const double km2 = kilometer2;
00116 static const double km3 = kilometer3;
00117 
00118 static const double pc = parsec;
00119 
00120 //
00121 // Angle
00122 //
00123 static const double radian      = 1.;                  
00124 static const double milliradian = 1.e-3*radian;
00125 static const double degree = (3.14159265358979323846/180.0)*radian;
00126 
00127 static const double   steradian = 1.;
00128         
00129 // symbols
00130 static const double rad  = radian;      
00131 static const double mrad = milliradian;
00132 static const double sr   = steradian;
00133 static const double deg  = degree;
00134 
00135 //
00136 // Time [T]
00137 //
00138 static const double second      = 1.;
00139 static const double nanosecond  = 1.e-9 *second;
00140 static const double millisecond = 1.e-3 *second;
00141 static const double microsecond = 1.e-6 *second;
00142 static const double  picosecond = 1.e-12*second;
00143 
00144 static const double hertz = 1./second;
00145 static const double kilohertz = 1.e+3*hertz;
00146 static const double megahertz = 1.e+6*hertz;
00147 
00148 // symbols
00149 static const double ns = nanosecond;                    
00150 static const double  s = second;
00151 static const double ms = millisecond;
00152 
00153 //
00154 // Mass [E][T^2][L^-2]
00155 //
00156 static const double  kilogram = 1.;   
00157 static const double      gram = 1.e-3*kilogram;
00158 static const double milligram = 1.e-3*gram;
00159 
00160 // symbols
00161 static const double  kg = kilogram;
00162 static const double   g = gram;
00163 static const double  mg = milligram;
00164 
00165 //
00166 // Electric current [Q][T^-1]
00167 //
00168 static const double      ampere = 1.;
00169 static const double milliampere = 1.e-3*ampere;
00170 static const double microampere = 1.e-6*ampere;
00171 static const double  nanoampere = 1.e-9*ampere;
00172 
00173 //
00174 // Electric charge [Q]
00175 //
00176 static const double coulomb = ampere*second;
00177 static const double e_SI  = 1.60217733e-19;     // positron charge in coulomb
00178 static const double eplus = e_SI*coulomb ;              // positron charge
00179 
00180 //
00181 // Energy [E]
00182 //
00183 static const double joule = kg*m*m/(s*s);
00184 
00185 static const double     electronvolt = e_SI*joule;
00186 static const double kiloelectronvolt = 1.e+3*electronvolt;
00187 static const double megaelectronvolt = 1.e+6*electronvolt; 
00188 static const double gigaelectronvolt = 1.e+9*electronvolt;
00189 static const double teraelectronvolt = 1.e+12*electronvolt;
00190 static const double petaelectronvolt = 1.e+15*electronvolt;
00191 
00192 // symbols
00193 static const double MeV = megaelectronvolt;
00194 static const double  eV = electronvolt;
00195 static const double keV = kiloelectronvolt;
00196 static const double GeV = gigaelectronvolt;
00197 static const double TeV = teraelectronvolt;
00198 static const double PeV = petaelectronvolt;
00199 
00200 //
00201 // Power [E][T^-1]
00202 //
00203 static const double watt = joule/second;        // watt = 6.24150 e+3 * MeV/ns
00204 
00205 //
00206 // Force [E][L^-1]
00207 //
00208 static const double newton = joule/meter;       // newton = 6.24150 e+9 * MeV/mm
00209 
00210 //
00211 // Pressure [E][L^-3]
00212 //
00213 #define pascal hep_pascal                          // a trick to avoid warnings 
00214 static const double hep_pascal = newton/m2;        // pascal = 6.24150 e+3 * MeV/mm3
00215 static const double bar        = 100000*pascal; // bar    = 6.24150 e+8 * MeV/mm3
00216 static const double atmosphere = 101325*pascal; // atm    = 6.32420 e+8 * MeV/mm3
00217 
00218 //
00219 // Electric potential [E][Q^-1]
00220 //
00221 static const double megavolt = megaelectronvolt/eplus;
00222 static const double kilovolt = 1.e-3*megavolt;
00223 static const double     volt = 1.e-6*megavolt;
00224 
00225 //
00226 // Electric resistance [E][T][Q^-2]
00227 //
00228 static const double ohm = volt/ampere;  // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
00229 
00230 //
00231 // Electric capacitance [Q^2][E^-1]
00232 //
00233 static const double farad = coulomb/volt;       // farad = 6.24150e+24 * eplus/Megavolt
00234 static const double millifarad = 1.e-3*farad;
00235 static const double microfarad = 1.e-6*farad;
00236 static const double  nanofarad = 1.e-9*farad;
00237 static const double  picofarad = 1.e-12*farad;
00238 
00239 //
00240 // Magnetic Flux [T][E][Q^-1]
00241 //
00242 static const double weber = volt*second;        // weber = 1000*megavolt*ns
00243 
00244 //
00245 // Magnetic Field [T][E][Q^-1][L^-2]
00246 //
00247 static const double tesla     = volt*second/meter2;     // tesla =0.001*megavolt*ns/mm2
00248 
00249 static const double gauss     = 1.e-4*tesla;
00250 static const double kilogauss = 1.e-1*tesla;
00251 
00252 //
00253 // Inductance [T^2][E][Q^-2]
00254 //
00255 static const double henry = weber/ampere;       // henry = 1.60217e-7*MeV*(ns/eplus)**2
00256 
00257 //
00258 // Temperature
00259 //
00260 static const double kelvin = 1.;
00261 
00262 //
00263 // Amount of substance
00264 //
00265 static const double mole = 1.;
00266 
00267 //
00268 // Activity [T^-1]
00269 //
00270 static const double becquerel = 1./second ;
00271 static const double curie = 3.7e+10 * becquerel;
00272 
00273 //
00274 // Absorbed dose [L^2][T^-2]
00275 //
00276 static const double gray = joule/kilogram ;
00277 
00278 //
00279 // Luminous intensity [I]
00280 //
00281 static const double candela = 1.;
00282 
00283 //
00284 // Luminous flux [I]
00285 //
00286 static const double lumen = candela*steradian;
00287 
00288 //
00289 // Illuminance [I][L^-2]
00290 //
00291 static const double lux = lumen/meter2;
00292 
00293 //
00294 // Miscellaneous
00295 //
00296 static const double perCent     = 0.01 ;
00297 static const double perThousand = 0.001;
00298 static const double perMillion  = 0.000001;
00299 
00300 #endif /* G4UNITSTEST_HH */

Generated on Mon May 27 17:49:51 2013 for Geant4 by  doxygen 1.4.7