Print

Print


Commit in GeomConverter/src/org/lcsim/units/clhep on MAIN
PhysicalConstants.java+103added 1.1
SystemOfUnits.java+249added 1.1
package.html+30added 1.1
+382
3 added files
JM: Port CLHEP SystemOfUnits.h and PhysicalConstants.h to lcsim.

GeomConverter/src/org/lcsim/units/clhep
PhysicalConstants.java added at 1.1
diff -N PhysicalConstants.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ PhysicalConstants.java	23 Feb 2007 02:36:32 -0000	1.1
@@ -0,0 +1,103 @@
+// $Id: PhysicalConstants.java,v 1.1 2007/02/23 02:36:32 jeremy Exp $
+package org.lcsim.units.clhep;
+
+import static org.lcsim.units.clhep.SystemOfUnits.MeV;
+import static org.lcsim.units.clhep.SystemOfUnits.atmosphere;
+import static org.lcsim.units.clhep.SystemOfUnits.cm3;
+import static org.lcsim.units.clhep.SystemOfUnits.eplus;
+import static org.lcsim.units.clhep.SystemOfUnits.henry;
+import static org.lcsim.units.clhep.SystemOfUnits.joule;
+import static org.lcsim.units.clhep.SystemOfUnits.kelvin;
+import static org.lcsim.units.clhep.SystemOfUnits.m;
+import static org.lcsim.units.clhep.SystemOfUnits.mg;
+import static org.lcsim.units.clhep.SystemOfUnits.mole;
+import static org.lcsim.units.clhep.SystemOfUnits.s;
+
+/**
+ * Port of CLHEP's PhysicalConstants.h C++ header file,
+ * containing common physical constants from the PDG guide.
+ * 
+ * @author Jeremy McCormick <[log in to unmask]>
+ * @version $Id: PhysicalConstants.java,v 1.1 2007/02/23 02:36:32 jeremy Exp $
+ */
+
+interface PhysicalConstants 
+{
+	public static double     pi  = 3.14159265358979323846;
+	public static double  twopi  = 2*pi;
+	public static double halfpi  = pi/2;
+	public static double     pi2 = pi*pi;
+
+	//
+	//
+	//
+	public static double Avogadro = 6.0221367e+23/mole;
+
+	//
+//	 c   = 299.792458 mm/ns
+//	 c^2 = 898.7404 (mm/ns)^2
+	//
+	public static double c_light   = 2.99792458e+8 * m/s;
+	public static double c_squared = c_light * c_light;
+
+	//
+//	 h     = 4.13566e-12 MeV*ns
+//	 hbar  = 6.58212e-13 MeV*ns
+//	 hbarc = 197.32705e-12 MeV*mm
+	//
+	public static double h_Planck      = 6.6260755e-34 * joule*s;
+	public static double hbar_Planck   = h_Planck/twopi;
+	public static double hbarc         = hbar_Planck * c_light;
+	public static double hbarc_squared = hbarc * hbarc;
+
+	//
+	//
+	//
+	public static double electron_charge = - eplus; // see SystemOfUnits.h
+	public static double e_squared = eplus * eplus;
+
+	//
+	//	 amu_c2 - atomic equivalent mass unit
+	//	 amu    - atomic mass unit
+	//
+	public static double electron_mass_c2 = 0.51099906 * MeV;
+	public static double   proton_mass_c2 = 938.27231 * MeV;
+	public static double  neutron_mass_c2 = 939.56563 * MeV;
+	public static double           amu_c2 = 931.49432 * MeV;
+	public static double              amu = amu_c2/c_squared;
+
+	//
+	//	 permeability of free space mu0    = 2.01334e-16 Mev*(ns*eplus)^2/mm
+	//	 permittivity of free space epsil0 = 5.52636e+10 eplus^2/(MeV*mm)
+	//
+	public static double mu0      = 4*pi*1.e-7 * henry/m;
+	public static double epsilon0 = 1./(c_squared*mu0);
+
+	//
+	//	 electromagnetic coupling = 1.43996e-12 MeV*mm/(eplus^2)
+	//
+	public static double elm_coupling           = e_squared/(4*pi*epsilon0);
+	public static double fine_structure_const   = elm_coupling/hbarc;
+	public static double classic_electr_radius  = elm_coupling/electron_mass_c2;
+	public static double electron_Compton_length = hbarc/electron_mass_c2;
+	public static double Bohr_radius = electron_Compton_length/fine_structure_const;
+
+	public static double alpha_rcl2 = fine_structure_const
+	                                   *classic_electr_radius
+	                                   *classic_electr_radius;
+
+	public static double twopi_mc2_rcl2 = twopi*electron_mass_c2
+	                                             *classic_electr_radius
+	                                             *classic_electr_radius;
+	//
+	//
+	//
+	public static double k_Boltzmann = 8.617385e-11 * MeV/kelvin;
+
+	//
+	//
+	//
+	public static double STP_Temperature = 273.15*kelvin;
+	public static double STP_Pressure    = 1.*atmosphere;
+	public static double kGasThreshold   = 10.*mg/cm3;
+}

GeomConverter/src/org/lcsim/units/clhep
SystemOfUnits.java added at 1.1
diff -N SystemOfUnits.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ SystemOfUnits.java	23 Feb 2007 02:36:32 -0000	1.1
@@ -0,0 +1,249 @@
+// $Id: SystemOfUnits.java,v 1.1 2007/02/23 02:36:32 jeremy Exp $
+package org.lcsim.units.clhep;
+
+/**
+ * Port of CLHEP SystemOfUnits.h C++ header file,
+ * which defines CLHEP's system of units for length,
+ * time, electric charge, mass, etc.
+ * 
+ * @author Jeremy McCormick <[log in to unmask]>
+ * @version $Id: SystemOfUnits.java,v 1.1 2007/02/23 02:36:32 jeremy Exp $
+ */
+public final class SystemOfUnits 
+{	
+	//
+	// Length [L]
+	//
+	static public final double millimeter  = 1.;
+	static public final double millimeter2 = millimeter*millimeter;
+	static public final double millimeter3 = millimeter*millimeter*millimeter;
+
+	static public final double centimeter  = 10.*millimeter;
+	static public final double centimeter2 = centimeter*centimeter;
+	static public final double centimeter3 = centimeter*centimeter*centimeter;
+
+	static public final double meter  = 1000.*millimeter;
+	static public final double meter2 = meter*meter;
+	static public final double meter3 = meter*meter*meter;
+
+	static public final double kilometer = 1000.*meter;
+	static public final double kilometer2 = kilometer*kilometer;
+	static public final double kilometer3 = kilometer*kilometer*kilometer;
+
+	static public final double parsec = 3.0856775807e+16*meter;
+
+	static public final double micrometer = 1.e-6 *meter;
+	static public final double  nanometer = 1.e-9 *meter;
+	static public final double  angstrom  = 1.e-10*meter;
+	static public final double  fermi     = 1.e-15*meter;
+
+	static public final double      barn = 1.e-28*meter2;
+	static public final double millibarn = 1.e-3 *barn;
+	static public final double microbarn = 1.e-6 *barn;
+	static public final double  nanobarn = 1.e-9 *barn;
+	static public final double  picobarn = 1.e-12*barn;
+
+	// symbols
+	static public final double nm  = nanometer;
+	static public final double um  = micrometer;
+
+	static public final double mm  = millimeter;
+	static public final double mm2 = millimeter2;
+	static public final double mm3 = millimeter3;
+
+	static public final double cm  = centimeter;
+	static public final double cm2 = centimeter2;
+	static public final double cm3 = centimeter3;
+
+	static public final double m  = meter;
+	static public final double m2 = meter2;
+	static public final double m3 = meter3;
+
+	static public final double km  = kilometer;
+	static public final double km2 = kilometer2;
+	static public final double km3 = kilometer3;
+
+	static public final double pc = parsec;
+
+	//
+	// Angle
+	//
+	static public final double radian      = 1.;
+	static public final double milliradian = 1.e-3*radian;
+	static public final double degree = (3.14159265358979323846/180.0)*radian;
+
+	static public final double   steradian = 1.;
+
+	// symbols
+	static public final double rad  = radian;
+	static public final double mrad = milliradian;
+	static public final double sr   = steradian;
+	static public final double deg  = degree;
+
+	//
+	// Time [T]
+	//
+	static public final double nanosecond  = 1.;
+	static public final double second      = 1.e+9 *nanosecond;
+	static public final double millisecond = 1.e-3 *second;
+	static public final double microsecond = 1.e-6 *second;
+	static public final double  picosecond = 1.e-12*second;
+
+	static public final double hertz = 1./second;
+	static public final double kilohertz = 1.e+3*hertz;
+	static public final double megahertz = 1.e+6*hertz;
+
+	// symbols
+	static public final double ns = nanosecond;
+	static public final double  s = second;
+	static public final double ms = millisecond;
+
+	//
+	// Electric charge [Q]
+	//
+	static public final double eplus = 1. ;// positron charge
+	static public final double e_SI  = 1.60217733e-19;// positron charge in coulomb
+	static public final double coulomb = eplus/e_SI;// coulomb = 6.24150 e+18 * eplus
+
+	//
+	// Energy [E]
+	//
+	static public final double megaelectronvolt = 1. ;
+	static public final double     electronvolt = 1.e-6*megaelectronvolt;
+	static public final double kiloelectronvolt = 1.e-3*megaelectronvolt;
+	static public final double gigaelectronvolt = 1.e+3*megaelectronvolt;
+	static public final double teraelectronvolt = 1.e+6*megaelectronvolt;
+	static public final double petaelectronvolt = 1.e+9*megaelectronvolt;
+
+	static public final double joule = electronvolt/e_SI;// joule = 6.24150 e+12 * MeV
+
+	// symbols
+	static public final double MeV = megaelectronvolt;
+	static public final double  eV = electronvolt;
+	static public final double keV = kiloelectronvolt;
+	static public final double GeV = gigaelectronvolt;
+	static public final double TeV = teraelectronvolt;
+	static public final double PeV = petaelectronvolt;
+
+	//
+	// Mass [E][T^2][L^-2]
+	//
+	static public final double  kilogram = joule*second*second/(meter*meter);
+	static public final double      gram = 1.e-3*kilogram;
+	static public final double milligram = 1.e-3*gram;
+
+	// symbols
+	static public final double  kg = kilogram;
+	static public final double   g = gram;
+	static public final double  mg = milligram;
+
+	//
+	// Power [E][T^-1]
+	//
+	static public final double watt = joule/second;// watt = 6.24150 e+3 * MeV/ns
+
+	//
+	// Force [E][L^-1]
+	//
+	static public final double newton = joule/meter;// newton = 6.24150 e+9 * MeV/mm
+
+	//
+	// Pressure [E][L^-3]
+	//
+	static public final double pascal = newton/m2;   // pascal = 6.24150 e+3 * MeV/mm3
+	static public final double bar        = 100000*pascal; // bar    = 6.24150 e+8 * MeV/mm3
+	static public final double atmosphere = 101325*pascal; // atm    = 6.32420 e+8 * MeV/mm3
+
+	//
+	// Electric current [Q][T^-1]
+	//
+	static public final double      ampere = coulomb/second; // ampere = 6.24150 e+9 * eplus/ns
+	static public final double milliampere = 1.e-3*ampere;
+	static public final double microampere = 1.e-6*ampere;
+	static public final double  nanoampere = 1.e-9*ampere;
+
+	//
+	// Electric potential [E][Q^-1]
+	//
+	static public final double megavolt = megaelectronvolt/eplus;
+	static public final double kilovolt = 1.e-3*megavolt;
+	static public final double     volt = 1.e-6*megavolt;
+
+	//
+	// Electric resistance [E][T][Q^-2]
+	//
+	static public final double ohm = volt/ampere;// ohm = 1.60217e-16*(MeV/eplus)/(eplus/ns)
+
+	//
+	// Electric capacitance [Q^2][E^-1]
+	//
+	static public final double farad = coulomb/volt;// farad = 6.24150e+24 * eplus/Megavolt
+	static public final double millifarad = 1.e-3*farad;
+	static public final double microfarad = 1.e-6*farad;
+	static public final double  nanofarad = 1.e-9*farad;
+	static public final double  picofarad = 1.e-12*farad;
+
+	//
+	// Magnetic Flux [T][E][Q^-1]
+	//
+	static public final double weber = volt*second;// weber = 1000*megavolt*ns
+
+	//
+	// Magnetic Field [T][E][Q^-1][L^-2]
+	//
+	static public final double tesla     = volt*second/meter2;// tesla =0.001*megavolt*ns/mm2
+
+	static public final double gauss     = 1.e-4*tesla;
+	static public final double kilogauss = 1.e-1*tesla;
+
+	//
+	// Inductance [T^2][E][Q^-2]
+	//
+	static public final double henry = weber/ampere;// henry = 1.60217e-7*MeV*(ns/eplus)**2
+
+	//
+	// Temperature
+	//
+	static public final double kelvin = 1.;
+
+	//
+	// Amount of substance
+	//
+	static public final double mole = 1.;
+
+	//
+	// Activity [T^-1]
+	//
+	static public final double becquerel = 1./second ;
+	static public final double curie = 3.7e+10 * becquerel;
+
+	//
+	// Absorbed dose [L^2][T^-2]
+	//
+	static public final double      gray = joule/kilogram ;
+	static public final double  kilogray = 1.e+3*gray;
+	static public final double milligray = 1.e-3*gray;
+	static public final double microgray = 1.e-6*gray;
+
+	//
+	// Luminous intensity [I]
+	//
+	static public final double candela = 1.;
+
+	//
+	// Luminous flux [I]
+	//
+	static public final double lumen = candela*steradian;
+
+	//
+	// Illuminance [I][L^-2]
+	//
+	static public final double lux = lumen/meter2;
+
+	//
+	// Miscellaneous
+	//
+	static public final double perCent     = 0.01 ;
+	static public final double perThousand = 0.001;
+	static public final double perMillion  = 0.000001;
+}
\ No newline at end of file

GeomConverter/src/org/lcsim/units/clhep
package.html added at 1.1
diff -N package.html
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ package.html	23 Feb 2007 02:36:32 -0000	1.1
@@ -0,0 +1,30 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN">
+<html>
+<head>
+<title>org.lcsim.units.clhep package</title>
+</head>
+<body>
+<p>
+The org.lcsim.units.clhep package is a straightforward port of the
+header files in the Units include directory of CLHEP 2.0.3.0.  
+<p>
+
+<p>
+The @link SystemOfUnits class defines the CLHEP numerical system of
+units, including length, energy, and so forth.
+</p>
+
+<p>
+The @link PhysicalConstants class defines commonly used physical
+constants, such as Avogadro's number, the speed of light, etc.
+</p>
+
+<p>
+<b>TODO</b> - We need to check whether the CLHEP license is open
+source or pseudo open source.  I could not find a license file in the
+CLHEP distribution.
+</p>
+</body>
+</html>
+
+
CVSspam 0.2.8