Commit in lcsim/src/org/lcsim/util/step on MAIN
TrackStepper.java+37-121.8 -> 1.9
CM: added setNewRp-set PhaseSpace information and update TrkPhaseSpace

lcsim/src/org/lcsim/util/step
TrackStepper.java 1.8 -> 1.9
diff -u -r1.8 -r1.9
--- TrackStepper.java	18 Dec 2005 16:40:10 -0000	1.8
+++ TrackStepper.java	27 Dec 2005 16:15:25 -0000	1.9
@@ -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.8 2005/12/18 16:40:10 caroline Exp $
+ * @version $Id: TrackStepper.java,v 1.9 2005/12/27 16:15:25 caroline Exp $
  */
 public class TrackStepper
 {
@@ -81,9 +81,12 @@
      * calculated to reach the r boundary is exhausted.  Allow a
      * Delta_r = 0.001mm for round_off differences in r.
      *
-     * @param r the radial boundary to aim for- generally r next layer
-     * @param zmax the z boundary of the detector
-     * @param stpcd an array ={xNumberOfSteps, BField, Mean_dE/dx_this layer}
+     * @param r 
+     * the radial boundary to aim for- generally r next layer
+     * @param zmax 
+     * the z boundary of the detector
+     * @param stpcd 
+     * an array ={xNumberOfSteps, BField, Mean_dE/dx_this layer}
      */
     public void tkSteps(double r,double zmax,double[]stpcd)
     {
@@ -124,7 +127,7 @@
             // Check boundaries after each step
             atZmax = (Math.abs(rpn[2])>a_zmax)? 1 :0; //each step
 	    double aux = Math.sqrt(rpn[0]*rpn[0]+rpn[1]*rpn[1]);
-            atR    = ( Math.abs(aux-a_r) < 1.e-3 ) ? 1 : 0; //each step
+            atR    = ( Math.abs(aux-a_r) < steplen/10) ? 1 : 0; //each step
             if(atZmax ==1 || stopTkElow )
             {
 	      if(debug) {
@@ -138,7 +141,8 @@
     }
     /**
      * make a step along this track
-     * @return position rp[0-5]={x,y,z,px,py,pz}after step&trp[6-7]={mass,q}
+     * @return position after step
+     * rp[0-5]={x,y,z,px,py,pz}after step&trp[6-7]={mass,q}
      */
     public double [] stepBy(double dc,double matDeDx)
     {
@@ -205,6 +209,8 @@
         return dpField;
     }
     /** Return dpx,dpy,dpz after pathLength  in Material this step
+     *@param dc steplength
+     *@param meanDeDx this layer, namely sum(dedx)*dx, on all the materiels 
      */
     private double[] dpFromMatter(double dc,double materMeanDeDx)
     {
@@ -229,7 +235,8 @@
      * Return vector rp(x,y,z,px,py,pz,mass_i=MuonMass,charge,BField)
      * from the information at the Interaction Point given by TrkParams.
      *
-     * @param tkprm TrkParams at Interaction Point (IP)
+     * @param tkprm 
+     *TrkParams at Interaction Point (IP)
      */
     public double[] rpFromTrkParams(TrkParams tkprm)
     {
@@ -245,7 +252,8 @@
     /**
      * Return vector rp(x,y,z,px,py,pz,mass_i=inMass,charge,BField)
      * from the information at the Interaction Point given by TrkParams.
-     * @param tkprm TrkParams at Interaction Point(IP
+     * @param tkprm 
+     * TrkParams at Interaction Point(IP
      * @param inMass
      */
     public double[] rpFromTrkParams(TrkParams tkprm, double inMass)
@@ -280,10 +288,10 @@
     {
         return vxyz;
     }
-
     /**
      * Set dTimeOfFlight for the step dc
-     * @param dc step
+     * @param dc 
+     * @param step
      */
     public void setDTOF(double dc)
     {
@@ -309,7 +317,8 @@
     }
     /**
      * Set path length (x,y,z) after step dc
-     * @param dc step
+     * @param dc 
+     * steplength
      */
     public void setPathLength(double dc)
     {
@@ -337,6 +346,20 @@
     {
        return p_ints=trakPs.getMomentum();
     }
+       /** Dec-25-05-
+    * Set New Phase Space point setNewRp
+    * @param []rp 
+    * containing x,y,z,px,py,pz,q,m 
+    */
+    public void setNewRp(double[] rpv)
+    {
+       for(int i=0; i<6;i++)
+       {
+          rpn[i]=rpv[i];
+       } 
+       rpn[7]=(rpv[7]<0)? m_default:rpv[7];
+       trakPs.upDateRp(rpn);
+    }
     /** @return phase-space point after step
     */
     public double [] getNewRp()
@@ -344,7 +367,9 @@
 
         return rpn= trakPs.getRp();
     }
-    /** @return Radius at which the particle is
+    /** 
+    * @return Radius 
+    * at which the particle is
     */
      public double partR()
      {
CVSspam 0.2.8