Print

Print


Commit in lcsim/src/org/lcsim/util/step on MAIN
TrackStepper.java+13-91.9 -> 1.10
 CM: change steplength check

lcsim/src/org/lcsim/util/step
TrackStepper.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- TrackStepper.java	27 Dec 2005 16:15:25 -0000	1.9
+++ TrackStepper.java	27 Dec 2005 23:04:12 -0000	1.10
@@ -17,7 +17,7 @@
  * Particle assumed is a Muon, but can be changed by setting rp[6] at input
  * Units are Tesla, cm, GeV/c
  * @author C. Milstene.
- * @version $Id: TrackStepper.java,v 1.9 2005/12/27 16:15:25 caroline Exp $
+ * @version $Id: TrackStepper.java,v 1.10 2005/12/27 23:04:12 caroline Exp $
  */
 public class TrackStepper
 {
@@ -102,20 +102,23 @@
 	rpn=trakPs.getRp();       // get phaseSpace at entry
 
         double a_r = r;
+	double d=Math.abs(Math.sqrt(rpn[0]*rpn[0]+rpn[1]*rpn[1])-a_r) ;
 	double a_zmax=zmax;
+	numSteps_i =(int) stpcd[0]; BField_i  = stpcd[1];
+	double steplen = d/numSteps_i  ;
         mass_i = (rpn[6] ==-1.)?m_default:rpn[6];
-        atZmax = (Math.abs(rpn[2])>a_zmax)? 1 :0;
-        atR    = (Math.sqrt(rpn[0]*rpn[0]+rpn[1]*rpn[1])>(a_r+0.001))?1:0;  // add 0.001 in mm now-Sept05
+        atZmax = (Math.abs(rpn[2])>(a_zmax+(steplen/40)) )? 1 :0;
+        atR    = (Math.sqrt(rpn[0]*rpn[0]+rpn[1]*rpn[1])>(a_r+(steplen/20)))?1:0;  // add 0.001 in mm now-Sept05
         if(atZmax==1 || stopTkElow) return;
 
         // access values of dE/dx & number of steps from stpcd
-        numSteps_i =(int) stpcd[0]; BField_i  = stpcd[1];
-        double d=Math.abs(Math.sqrt(rpn[0]*rpn[0]+rpn[1]*rpn[1])-a_r) ;
+        
+        
 	// Check if distance cm or distance mm !!!!
         materDeDx_i= stpcd[2]/d ;
 
         // Call stepBy to do the stepping && update array[] rp
-        double steplen = d/numSteps_i  ;
+        
 	if(debug) System.out.println("Before "+numSteps_i+" steps particle Radius="+partR()+" Pabs="+ partPabs());                    ;
 
         for( int i=0; i<numSteps_i; i++)
@@ -125,9 +128,9 @@
            // System.out.println("stpr:rpn[3..5]=( "+rpn[3]+", "+rpn[4]+", "+rpn[5]+" )");
 
             // Check boundaries after each step
-            atZmax = (Math.abs(rpn[2])>a_zmax)? 1 :0; //each step
+            atZmax = (Math.abs(rpn[2])>(a_zmax+(steplen/40)))? 1 :0; //each step
 	    double aux = Math.sqrt(rpn[0]*rpn[0]+rpn[1]*rpn[1]);
-            atR    = ( Math.abs(aux-a_r) < steplen/10) ? 1 : 0; //each step
+            atR    = ( Math.abs(aux-a_r) < steplen/20) ? 1 : 0; //each step
             if(atZmax ==1 || stopTkElow )
             {
 	      if(debug) {
@@ -167,7 +170,7 @@
 	    {
 		tmpxyz   = rpn[i]  ; tmpp    = rpn[i+3];
 		rpn[i]    = tmpxyz + vstep[i]*dTof;
-                rpn[i+3]  = tmpp   + dpF[i] - dpM[i];
+                rpn[i+3]  = tmpp   + dpF[i] ;//- dpM[i];
 	    }
 	}
 	//System.out.println("stepBy end: rpn[0..2]=( "+rpn[0]+", "+rpn[1]+", "+rpn[2]+" )");
@@ -482,6 +485,7 @@
             vxyz[i]=0. ;vstep[i]=0.;
             xy[i]=0.;
         }
+	rpn[6]=m_default; rpn[7]=0.;
     }
 
 }
CVSspam 0.2.8