Print

Print


Commit in GeomConverter/src/org/lcsim/material on MAIN
MaterialElement.java+21-111.9 -> 1.10


GeomConverter/src/org/lcsim/material
MaterialElement.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- MaterialElement.java	20 Jul 2005 01:01:28 -0000	1.9
+++ MaterialElement.java	22 Jul 2005 23:22:41 -0000	1.10
@@ -2,17 +2,18 @@
 
 public class MaterialElement
 {
-    private String _name;                 // Element 1 or 2 letter name
-    private String _fullName;             // Element full name
-    private double _Z;                    // Element Z
-    private double _A;                    // Atomic weight in mol/cc
-    private double _N;                    // effective number of nucleons
-    private double _density;              // Density in g/cm^3 at 25 degrees C or at boiling point for liquids
-    private double _meltingPoint;         // Melting point (K)
-    private double _boilingPoint;         // Boiling point (K)
-    private double _ionizationPotential;  // Ionization potential (eV)        
-    private double _nuclearInteractionLength;
-    private double _radiationLength;    
+    private String _name;                     // Element 1 or 2 letter abbreviation
+    private String _fullName;                 // Element full name
+    private double _Z;                        // Element Z
+    private double _A;                        // Atomic weight in mol/cc
+    private double _N;                        // effective number of nucleons
+    private double _density;                  // Density in g/cm^3 at 25 degrees C or at boiling point for liquids
+    private double _meltingPoint;             // Melting point (K)
+    private double _boilingPoint;             // Boiling point (K)
+    private double _ionizationPotential;      // Ionization potential (eV)        
+    private double _nuclearInteractionLength; // lambda
+    private double _radiationLength;          // X0 
+    private double _molecularWeight;          // molecular weight = A * natoms
         
     MaterialElement(String name,
             String fullName,
@@ -38,6 +39,10 @@
         _boilingPoint = bp;
         _ionizationPotential = ip;
         
+        /* FIXME: Wrong for isotopes. */
+        double natoms = 1.0;
+        _molecularWeight =  _A * natoms;
+        
         computeDerivedQuantities();
         
         MaterialManager.addElement(this);                      
@@ -112,6 +117,11 @@
         return _radiationLength;
     }
     
+    public double getMolecularWeight()
+    {
+        return _molecularWeight;
+    }
+    
 //    public void computeCoulombFactor()
 //    {
         /* calculate radiation length */
CVSspam 0.2.8