Print

Print


Commit in GeomConverter on MAIN
src/org/lcsim/material/MaterialCalculator.java+12-41.8 -> 1.9
test/org/lcsim/material/BetheBlockTest.java+14-31.3 -> 1.4
+26-7
2 modified files
JM: Added path length to Bethe-Bloch function.

GeomConverter/src/org/lcsim/material
MaterialCalculator.java 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- MaterialCalculator.java	18 Jan 2006 22:47:24 -0000	1.8
+++ MaterialCalculator.java	18 Jan 2006 23:24:37 -0000	1.9
@@ -108,10 +108,15 @@
     
     //public static final double clight = 2.99792458e08; // m/s
     
-    // FIXME: add path length as in Lelaps
-    // FIXME: debug and check output (Matprop)
-    // FIXME: take out debug prints when completed
-    public static double computeBetheBloch(Material material, double[] pT, double mass, double charge)
+    /*
+     * @param material org.lcsim.material.Material to be used for A, Z, density, etc.
+     * @param pT particle momentum
+     * @param mass particle mass (MeV/c)
+     * @param charge particle charge
+     * @param distance path length in cm to scale the dEdx result
+     * @return computed dEdx (MeV/cm) 
+     */
+    public static double computeBetheBloch(Material material, double[] pT, double mass, double charge, double distance)
     {
         assert( pT.length == 3);
         
@@ -217,6 +222,9 @@
         result = result * material.getDensity();
         System.out.println("dEdx (MeV/cm) = " + result);
         
+        result = result * distance;
+        System.out.println("dEdx (MeV/cm) * distance = " + result);
+        
         System.out.println("----");
         return result;
     }

GeomConverter/test/org/lcsim/material
BetheBlockTest.java 1.3 -> 1.4
diff -u -r1.3 -r1.4
--- BetheBlockTest.java	18 Jan 2006 22:47:56 -0000	1.3
+++ BetheBlockTest.java	18 Jan 2006 23:24:37 -0000	1.4
@@ -42,9 +42,15 @@
         double pT[] = {1.0, 0, 0};
         double mass = 1.0;
         
-        double dEdx = MaterialCalculator.computeBetheBloch(material, pT, mass, 1.0);        
+        double dEdx = MaterialCalculator.computeBetheBloch(
+        		material, // material 
+        		pT,       // particle momentum
+        		mass,     // particle mass
+        		1.0,      // particle charge
+        		1.0);     // path length   
     }
     
+	// FIXME: Results look very wrong.
     public void testMuonInCarbon()
     {
     	MaterialManager mgr = MaterialManager.instance();
@@ -56,9 +62,14 @@
     	
     	double pT[] = {1.0, 0, 0};
     	
-    	// muon mass in MeV
+    	// muon mass in MeV 
     	double mass = 105.658369;
     	
-    	double dEdx = MaterialCalculator.computeBetheBloch(material, pT, mass, 1.0);    
+    	double dEdx = MaterialCalculator.computeBetheBloch(
+    			material, // material 
+    			pT,       // particle momentum
+    			mass,     // particle mass 
+    			1.0,      // particle charge
+    			1.0);     // path length
     }
 }
\ No newline at end of file
CVSspam 0.2.8