Commit in lcsim/src/org/lcsim/util/step on MAIN
StepConditions.java+64-51.1 -> 1.2
Judith Odili - 07/13/06
Taking care of the coil in the class StepConditions

lcsim/src/org/lcsim/util/step
StepConditions.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- StepConditions.java	13 Jul 2006 23:33:39 -0000	1.1
+++ StepConditions.java	14 Jul 2006 15:54:08 -0000	1.2
@@ -40,8 +40,8 @@
 	public Detector det;
         public CylindricalBarrelCalorimeter calsub;
         public String subdetName, materialName, sublayerMat, name;
-	public int layerN;
-	public double rNow, rToGo, layerthickness,materialthickness, layerDEdx=0., matterDEdx = 0., mass, charge, distance;
+	public int layerN, sliceN;
+	public double rNow, rToGo, layerthickness,materialthickness,coilthickness, totaldedx= 0., layerDEdx=0., matterDEdx = 0., mass, charge, distance;
 	public Map<String, Double> materials;
         public DeDx dedx;
         public double []rpVect       = new double[8] ;
@@ -51,13 +51,44 @@
         public MaterialManager manager;
         public FieldOverlay Field = new FieldOverlay();
         public double[] b = new double[3];
-        private Vector<CoilSubLayer> coilSlices;
-        private static AIDA aida = AIDA.defaultInstance();
+        public Vector<CoilSubLayer> coilSlices;
+        public static AIDA aida = AIDA.defaultInstance();
         public TrackStepper stpr = new TrackStepper();
         public double rmin,  rLayer0Mid, rmax,  nLayers, zmax;
         
 	/**
          Constructor for the Subdetectors
+         @param det The Detector
+         */
+        public StepConditions(Detector det)
+        {
+            this.det = det;
+             if(dedx==null) dedx = DeDx.instance();
+            MultiLayerTracker coilsub = (MultiLayerTracker)det.getSubdetectors().get("SolenoidCoilBarrel");
+            LayerStack layers = coilsub.getLayering().getLayers();
+            double[] tmpRmin = coilsub.getInnerR();
+            double[] tmpZmax = coilsub.getOuterZ();
+
+            int nsublayers = layers.getNumberOfLayers();
+            coilSlices = new Vector<CoilSubLayer>();
+            for(int i=0; i<nsublayers; ++i) {
+                List<LayerSlice> slices
+                    = coilsub.getLayering().getLayers().getLayer(i).getSlices();
+            double raux = tmpRmin[i];
+            for ( Object o : slices ) {
+                LayerSlice ls = (LayerSlice) o;
+                String matName = ls.getMaterial().getName();
+                double thickness = ls.getThickness();
+                double matdedx = dedx.getDeDx(matName)/10;  // Eloss this material
+                coilSlices.add( new CoilSubLayer(matName, thickness, raux, tmpZmax[i], matdedx) );
+                raux += thickness;
+                }
+            }
+                
+           
+        }
+        /**
+         Constructor for the Subdetectors
         
          @param rpvect Array containing the postion, momentum , mass and charge of the particle reconstructed. 
          @param det The Detector
@@ -213,11 +244,39 @@
          @return The magntic field  at the position.
          
          */	
-         public double[] getField()
+         public double[] getField(double [] rpvect)
          {
+             this.rpVect = rpvect;
              double[] b = det.getFieldMap().getField(rpVect);    
              
              return b;
                  
          }
+         /**
+          @return coilSlices
+          */
+         public Vector<CoilSubLayer> getCoilSlices()
+         {
+             return coilSlices;
+         }
+         /**
+          *@return coilThickness
+          */
+         public double getSliceThickness (int sliceN)
+         {
+             this.sliceN = sliceN;
+             CoilSubLayer slice = coilSlices.get(sliceN);
+                 coilthickness = slice.getThickness();
+                 return coilthickness;
+         }
+         /**
+          @return totalded of the Coil
+          */
+          public double getSliceDeDx (int sliceN)
+         {
+                this.sliceN = sliceN;
+              CoilSubLayer slice = coilSlices.get(sliceN);
+                 totaldedx = slice.getdEdx() * coilthickness;
+                 return totaldedx;
+         }
 }
\ No newline at end of file
CVSspam 0.2.8