Back to home page

EIC code displayed by LXR

 
 

    


Warning, file /include/root/TGeoSystemOfUnits.h was not indexed or was modified since last indexation (in which case cross-reference links may be missing, inaccurate or erroneous).

0001 /*************************************************************************
0002  * Copyright (C) 1995-2000, Rene Brun and Fons Rademakers.               *
0003  * All rights reserved.                                                  *
0004  *                                                                       *
0005  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0006  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0007  *************************************************************************/
0008 
0009 // ----------------------------------------------------------------------
0010 // HEP coherent system of Units
0011 //
0012 // This file has been provided to CLHEP by Geant4 (simulation toolkit for HEP).
0013 // Adapted to TGeo units base by Marko Petric
0014 //
0015 // The basic units are :
0016 // millimeter              (millimeter)
0017 // nanosecond              (nanosecond)
0018 // Mega electron Volt      (MeV)
0019 // positron charge         (eplus)
0020 // degree Kelvin           (kelvin)
0021 // the amount of substance (mole)
0022 // luminous intensity      (candela)
0023 // radian                  (radian)
0024 // steradian               (steradian)
0025 //
0026 // Below is a non exhaustive list of derived and pratical units
0027 // (i.e. mostly the SI units).
0028 // You can add your own units.
0029 //
0030 // The SI numerical value of the positron charge is defined here,
0031 // as it is needed for conversion factor : positron charge = e_SI (coulomb)
0032 //
0033 // The others physical constants are defined in the header file :
0034 // PhysicalConstants.h
0035 //
0036 // Authors: M.Maire, S.Giani
0037 //
0038 // History:
0039 //
0040 // 06.02.96   Created.
0041 // 28.03.96   Added miscellaneous constants.
0042 // 05.12.97   E.Tcherniaev: Redefined pascal (to avoid warnings on WinNT)
0043 // 20.05.98   names: meter, second, gram, radian, degree
0044 //            (from Brian.Lasiuk@yale.edu (STAR)). Added luminous units.
0045 // 05.08.98   angstrom, picobarn, microsecond, picosecond, petaelectronvolt
0046 // 01.03.01   parsec
0047 // 31.01.06   kilogray, milligray, microgray
0048 // 29.04.08   use PDG 2006 value of e_SI
0049 // 03.11.08   use PDG 2008 value of e_SI
0050 // 19.08.15   added liter and its sub units (mma)
0051 // 12.01.16   added symbols for microsecond (us) and picosecond (ps) (mma)
0052 // 02.10.17   addopted units from CLHEP 2.3.4.3 and converted to TGeo unit base
0053 
0054 #ifndef TGEO_SYSTEM_OF_UNITS_H
0055 #define TGEO_SYSTEM_OF_UNITS_H
0056 
0057 #ifndef HAVE_GEANT4_UNITS
0058 //#define HAVE_GEANT4_UNITS
0059 #endif
0060 
0061 namespace TGeoUnit {
0062 
0063 //
0064 // TGeo follows Geant3 convention as specified in manual
0065 // "Unless otherwise specified, the following units are used throughout the program:
0066 // centimeter, second, degree, GeV"
0067 
0068 //
0069 //
0070 //
0071 static constexpr double pi = 3.14159265358979323846;
0072 static constexpr double twopi = 2 * pi;
0073 static constexpr double halfpi = pi / 2;
0074 static constexpr double pi2 = pi * pi;
0075 
0076 //
0077 // Length [L]
0078 //
0079 static constexpr double millimeter = 0.1;
0080 static constexpr double millimeter2 = millimeter * millimeter;
0081 static constexpr double millimeter3 = millimeter * millimeter * millimeter;
0082 
0083 static constexpr double centimeter = 10. * millimeter; // Base unit
0084 static constexpr double centimeter2 = centimeter * centimeter;
0085 static constexpr double centimeter3 = centimeter * centimeter * centimeter;
0086 
0087 static constexpr double meter = 1000. * millimeter;
0088 static constexpr double meter2 = meter * meter;
0089 static constexpr double meter3 = meter * meter * meter;
0090 
0091 static constexpr double kilometer = 1000. * meter;
0092 static constexpr double kilometer2 = kilometer * kilometer;
0093 static constexpr double kilometer3 = kilometer * kilometer * kilometer;
0094 
0095 static constexpr double parsec = 3.0856775807e+16 * meter;
0096 
0097 static constexpr double micrometer = 1.e-6 * meter;
0098 static constexpr double nanometer = 1.e-9 * meter;
0099 static constexpr double angstrom = 1.e-10 * meter;
0100 static constexpr double fermi = 1.e-15 * meter;
0101 
0102 static constexpr double barn = 1.e-28 * meter2;
0103 static constexpr double millibarn = 1.e-3 * barn;
0104 static constexpr double microbarn = 1.e-6 * barn;
0105 static constexpr double nanobarn = 1.e-9 * barn;
0106 static constexpr double picobarn = 1.e-12 * barn;
0107 
0108 // symbols
0109 static constexpr double nm = nanometer;
0110 static constexpr double um = micrometer;
0111 
0112 static constexpr double mm = millimeter;
0113 static constexpr double mm2 = millimeter2;
0114 static constexpr double mm3 = millimeter3;
0115 
0116 static constexpr double cm = centimeter;
0117 static constexpr double cm2 = centimeter2;
0118 static constexpr double cm3 = centimeter3;
0119 
0120 static constexpr double liter = 1.e+3 * cm3;
0121 static constexpr double L = liter;
0122 static constexpr double dL = 1.e-1 * liter;
0123 static constexpr double cL = 1.e-2 * liter;
0124 static constexpr double mL = 1.e-3 * liter;
0125 
0126 static constexpr double m = meter;
0127 static constexpr double m2 = meter2;
0128 static constexpr double m3 = meter3;
0129 
0130 static constexpr double km = kilometer;
0131 static constexpr double km2 = kilometer2;
0132 static constexpr double km3 = kilometer3;
0133 
0134 static constexpr double pc = parsec;
0135 
0136 //
0137 // Angle
0138 //
0139 static constexpr double degree = 1.0; // Base unit
0140 static constexpr double radian = (180.0 / pi) * degree;
0141 static constexpr double milliradian = 1.e-3 * radian;
0142 
0143 static constexpr double steradian = 1.;
0144 
0145 // symbols
0146 static constexpr double rad = radian;
0147 static constexpr double mrad = milliradian;
0148 static constexpr double sr = steradian;
0149 static constexpr double deg = degree;
0150 
0151 //
0152 // Time [T]
0153 //
0154 static constexpr double nanosecond = 1.e-9;
0155 static constexpr double second = 1.e+9 * nanosecond; // Base unit
0156 static constexpr double millisecond = 1.e-3 * second;
0157 static constexpr double microsecond = 1.e-6 * second;
0158 static constexpr double picosecond = 1.e-12 * second;
0159 
0160 static constexpr double hertz = 1. / second;
0161 static constexpr double kilohertz = 1.e+3 * hertz;
0162 static constexpr double megahertz = 1.e+6 * hertz;
0163 
0164 // symbols
0165 static constexpr double ns = nanosecond;
0166 static constexpr double s = second;
0167 static constexpr double ms = millisecond;
0168 static constexpr double us = microsecond;
0169 static constexpr double ps = picosecond;
0170 
0171 //
0172 // Electric charge [Q]
0173 //
0174 static constexpr double eplus = 1.;             // positron charge
0175 static constexpr double e_SI = 1.602176487e-19; // positron charge in coulomb
0176 static constexpr double coulomb = eplus / e_SI; // coulomb = 6.24150 e+18 * eplus
0177 
0178 //
0179 // Energy [E]
0180 //
0181 static constexpr double megaelectronvolt = 1.e-3;
0182 static constexpr double electronvolt = 1.e-6 * megaelectronvolt;
0183 static constexpr double kiloelectronvolt = 1.e-3 * megaelectronvolt;
0184 static constexpr double gigaelectronvolt = 1.e+3 * megaelectronvolt; // Base unit
0185 static constexpr double teraelectronvolt = 1.e+6 * megaelectronvolt;
0186 static constexpr double petaelectronvolt = 1.e+9 * megaelectronvolt;
0187 
0188 static constexpr double joule = electronvolt / e_SI; // joule = 6.24150 e+12 * MeV
0189 
0190 // symbols
0191 static constexpr double MeV = megaelectronvolt;
0192 static constexpr double eV = electronvolt;
0193 static constexpr double keV = kiloelectronvolt;
0194 static constexpr double GeV = gigaelectronvolt;
0195 static constexpr double TeV = teraelectronvolt;
0196 static constexpr double PeV = petaelectronvolt;
0197 
0198 //
0199 // Mass [E][T^2][L^-2]
0200 //
0201 static constexpr double kilogram = joule * second * second / (meter * meter);
0202 static constexpr double gram = 1.e-3 * kilogram;
0203 static constexpr double milligram = 1.e-3 * gram;
0204 
0205 // symbols
0206 static constexpr double kg = kilogram;
0207 static constexpr double g = gram;
0208 static constexpr double mg = milligram;
0209 
0210 //
0211 // Power [E][T^-1]
0212 //
0213 static constexpr double watt = joule / second; // watt = 6.24150 e+3 * MeV/ns
0214 
0215 //
0216 // Force [E][L^-1]
0217 //
0218 static constexpr double newton = joule / meter; // newton = 6.24150 e+9 * MeV/mm
0219 
0220 //
0221 // Pressure [E][L^-3]
0222 //
0223 #define pascal hep_pascal                             // a trick to avoid warnings
0224 static constexpr double hep_pascal = newton / m2;     // pascal = 6.24150 e+3 * MeV/mm3
0225 static constexpr double bar = 100000 * pascal;        // bar    = 6.24150 e+8 * MeV/mm3
0226 static constexpr double atmosphere = 101325 * pascal; // atm    = 6.32420 e+8 * MeV/mm3
0227 
0228 //
0229 // Electric current [Q][T^-1]
0230 //
0231 static constexpr double ampere = coulomb / second; // ampere = 6.24150 e+9 * eplus/ns
0232 static constexpr double milliampere = 1.e-3 * ampere;
0233 static constexpr double microampere = 1.e-6 * ampere;
0234 static constexpr double nanoampere = 1.e-9 * ampere;
0235 
0236 //
0237 // Electric potential [E][Q^-1]
0238 //
0239 static constexpr double megavolt = megaelectronvolt / eplus;
0240 static constexpr double kilovolt = 1.e-3 * megavolt;
0241 static constexpr double volt = 1.e-6 * megavolt;
0242 
0243 //
0244 // Electric resistance [E][T][Q^-2]
0245 //
0246 static constexpr double ohm = volt / ampere; // ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
0247 
0248 //
0249 // Electric capacitance [Q^2][E^-1]
0250 //
0251 static constexpr double farad = coulomb / volt; // farad = 6.24150e+24 * eplus/Megavolt
0252 static constexpr double millifarad = 1.e-3 * farad;
0253 static constexpr double microfarad = 1.e-6 * farad;
0254 static constexpr double nanofarad = 1.e-9 * farad;
0255 static constexpr double picofarad = 1.e-12 * farad;
0256 
0257 //
0258 // Magnetic Flux [T][E][Q^-1]
0259 //
0260 static constexpr double weber = volt * second; // weber = 1000*megavolt*ns
0261 
0262 //
0263 // Magnetic Field [T][E][Q^-1][L^-2]
0264 //
0265 static constexpr double tesla = volt * second / meter2; // tesla =0.001*megavolt*ns/mm2
0266 
0267 static constexpr double gauss = 1.e-4 * tesla;
0268 static constexpr double kilogauss = 1.e-1 * tesla;
0269 
0270 //
0271 // Inductance [T^2][E][Q^-2]
0272 //
0273 static constexpr double henry = weber / ampere; // henry = 1.60217e-7*MeV*(ns/eplus)**2
0274 
0275 //
0276 // Temperature
0277 //
0278 static constexpr double kelvin = 1.;
0279 
0280 //
0281 // Amount of substance
0282 //
0283 static constexpr double mole = 1.;
0284 
0285 //
0286 // Activity [T^-1]
0287 //
0288 static constexpr double becquerel = 1. / second;
0289 static constexpr double curie = 3.7e+10 * becquerel;
0290 static constexpr double kilobecquerel = 1.e+3 * becquerel;
0291 static constexpr double megabecquerel = 1.e+6 * becquerel;
0292 static constexpr double gigabecquerel = 1.e+9 * becquerel;
0293 static constexpr double millicurie = 1.e-3 * curie;
0294 static constexpr double microcurie = 1.e-6 * curie;
0295 static constexpr double Bq = becquerel;
0296 static constexpr double kBq = kilobecquerel;
0297 static constexpr double MBq = megabecquerel;
0298 static constexpr double GBq = gigabecquerel;
0299 static constexpr double Ci = curie;
0300 static constexpr double mCi = millicurie;
0301 static constexpr double uCi = microcurie;
0302 
0303 //
0304 // Absorbed dose [L^2][T^-2]
0305 //
0306 static constexpr double gray = joule / kilogram;
0307 static constexpr double kilogray = 1.e+3 * gray;
0308 static constexpr double milligray = 1.e-3 * gray;
0309 static constexpr double microgray = 1.e-6 * gray;
0310 
0311 //
0312 // Luminous intensity [I]
0313 //
0314 static constexpr double candela = 1.;
0315 
0316 //
0317 // Luminous flux [I]
0318 //
0319 static constexpr double lumen = candela * steradian;
0320 
0321 //
0322 // Illuminance [I][L^-2]
0323 //
0324 static constexpr double lux = lumen / meter2;
0325 
0326 //
0327 // Miscellaneous
0328 //
0329 static constexpr double perCent = 0.01;
0330 static constexpr double perThousand = 0.001;
0331 static constexpr double perMillion = 0.000001;
0332 } // namespace TGeoUnit
0333 #endif /* TGEO_SYSTEM_OF_UNITS_H */