Commit in lcsim/src/org/lcsim/recon/muon on MAIN
MuonCalSegmentFinder.java+33-201.10 -> 1.11
New modifications by Judith Odili and Caroline Milstene - 07/13/06 - 
 Modified so the Stepper information get read 
 directly from StepConditions class.

lcsim/src/org/lcsim/recon/muon
MuonCalSegmentFinder.java 1.10 -> 1.11
diff -u -r1.10 -r1.11
--- MuonCalSegmentFinder.java	16 Jun 2006 20:43:08 -0000	1.10
+++ MuonCalSegmentFinder.java	13 Jul 2006 23:35:45 -0000	1.11
@@ -15,12 +15,18 @@
 import org.lcsim.geometry.layer.LayerSlice;
 import org.lcsim.event.CalorimeterHit;
 
+
 /**
  * Muon Segment Finder for muon calorimeter
  * Modified to use the Stepper.class in org.lcsim.util.step,
  * whenever the Swimmer class was used and in between
  * elements as well and to replace the Inner Class Extrapolate
  * of the Class MuonCalSegmentFinder- C. Milstene-January-02-04
+ *
+ New modifications by Judith Odili and Caroline Milstene - 07/13/06 - 
+ Modified so the Stepper information get read 
+ directly from StepConditions class.
+ 
  */
 final public class MuonCalSegmentFinder extends BarrelCalSegmentFinder
 {
@@ -75,6 +81,7 @@
         double rNow  ;  double xNSteps;
         double r;
         double[] pos;  double[] field;
+        String materialName;
          if(stpr.getStopTkELow()) return;
         numLayersHit = 0;
         double rr=0.;
@@ -94,21 +101,20 @@
         //First in the Air Before the COIL
         rNow = Math.sqrt(rpVect[0]*rpVect[0]+rpVect[1]*rpVect[1]);
         r = coilSlices.get(0).getRmin();
+        materialName = "Air";
 	   pos = new double[]{rpVect[0], rpVect[1], rpVect[2]};
 	   field = det.getFieldMap().getField(pos); // C.M.-June-03
-	   System.out.println("COIL BField: ("+field[0]+", "+field[1]+", "+field[2]+")");
+
 	   BField = field[2];
         double dist= Math.abs(r-stpr.partR(rpVect));
-        stpr.setDTOF(rpVect,dist);
-        double dt_dist=stpr.getDTOF();
-        stepConditions =steprConditions(dist,BField,0.,dt_dist);  // C.M. Information for he stepper
-        stpr.tkSteps(r,zmax,stepConditions);                 //goes up to the coil
+        stpr.tkSteps(r,zmax,det, materialName);                 //goes up to the coil
         rpVect =stpr.getNewRp();                         // get coordinates
         // From the COIL on
 
         double muField =-0.6;
+        //double muField=StepConditions
         double zCoil;
-	    double zmxCoil = coilSlices.get(0).getZmax();
+	    double zmxCoil = coilSlices.get(0).getZmax(); 
         int atZMax = stpr.getAtZmax();
         boolean hitsCoil;
         if(rpVect[2]== zmxCoil||stpr.getAtZmax()==1||stpr.getStopTkELow())
@@ -117,10 +123,10 @@
 	    System.out.println("*** Aborting at the coil");
             return;    // does not hit the coil
         }
-
+      System.out.println("TAKING CARE OF THE COIL");
         // In the COIL
 	    int islice = 0;
-        double dt_r;
+            double dt_r;
 	    for(int ii=0; ii<coilSlices.size(); ++ii) {
 	    CoilSubLayer slice = coilSlices.get(ii);
 	    if(stpr.getStopTkELow()) {
@@ -147,19 +153,27 @@
  			       +", rad="+radius+", z="+rpVect[2] );
 
 	    stepConditions = steprConditions(dr, field[2], totalDedx,dt_r);
+            
 	    stpr.tkSteps(r,zmaxSlice,stepConditions);
 	    rpVect   = stpr.getNewRp();
 	    ++islice;
 	}
+//--------------------------------------------------------------------------------------
+	
+            
+
+        field = det.getFieldMap().getField(rpVect);	     // C.M.-June-03
+        
 
-	field = det.getFieldMap().getField(rpVect);	     // C.M.-June-03
-	if(debug)System.out.println("MuonCalSegFinder: muonRadius="+rmin+", field="+muField);
+        System.out.println("MuonCalSegFinder: muonRadius="+rmin+", field="+muField);
 
 	muField = field[2];
+        
         double d0=10.;
         stpr.setDTOF(rpVect,d0);
         double dt0=stpr.getDTOF();
         stepConditions = steprConditions(10.,muField,(4.36E-03*500.),dt0);
+       
         stpr.tkSteps(r,zmax,stepConditions);
         rpVect          = stpr.getNewRp();
 
@@ -178,11 +192,9 @@
         rNow=Math.sqrt(rpVect[0]*rpVect[0]+rpVect[1]*rpVect[1]);
         // Air after the COIL
         xNSteps=rmin-stpr.partR(rpVect);
-        stpr.setDTOF(rpVect,xNSteps);
-        dt_r=stpr.getDTOF();
-        stepConditions = steprConditions(xNSteps,muField,0.,dt_r);
+        
         r= r + (rmin-stpr.partR(rpVect));
-        stpr.tkSteps(r,zmax,stepConditions);
+        stpr.tkSteps(r,zmax,det, materialName);
         rpVect=stpr.getNewRp();
         r = rLayer0Mid;
         if(debug)
@@ -190,10 +202,8 @@
 
         double muFieldNorm = 0.;
         dist =r-stpr.partR(rpVect);
-        stpr.setDTOF(rpVect,dist);
-        dt_r=stpr.getDTOF();
-        stepConditions = steprConditions(dist,muFieldNorm,meanDEdxPerLay(subdetName),dt_r);
-        stpr.tkSteps(r,zmax,stepConditions);
+        
+        stpr.tkSteps(r, zmax,det, subdetName, nr);
         rpVect          = stpr.getNewRp();
         // Get intersections with succesive layers as long as track is
         // within the detector
@@ -209,14 +219,16 @@
 	    if(nr!=(nLayers-1)) r = r + dr;
 	    else              { r = rmin + nLayers*dr; }
             dist=(nr!=(nLayers-1))?dr:(dr+dr-(rLayer0Mid-rmin));
-	    stepConditions = steprConditions(dist,muFieldNorm,meanDEdxPerLay(subdetName),dt_r);
-	    stpr.tkSteps(r,zmax,stepConditions);
+
+	    stpr.tkSteps(r, zmax,det, subdetName, nr);
 	    rpVect   = stpr.getNewRp();
 	    nr++;
         }
 
         // Save number of layers track passed through
         numLayersHit = nr;
+        field = det.getFieldMap().getField( rpVect );
+
         rpVect=stpr.getNewRp();
         if((rpVect[2]>=zmax)||stpr.getStopTkELow())
         {
@@ -237,4 +249,5 @@
     private  static double materDedxMudet;  // C.M. get the dEdx
     private String muonName = "MuonBarrHits";
     private Vector<CoilSubLayer> coilSlices;
+    
 }
CVSspam 0.2.8