Commit in GeomConverter/src/org/lcsim/detector/tracker/silicon on MAIN
ChargeDistribution.java+38added 1.1
GaussianDistribution2D.java+129added 1.1
SiSensor.java+30-281.15 -> 1.16
SiSensorElectrodes.java+22-41.6 -> 1.7
SiStrips.java+140-391.9 -> 1.10
ErrorEllipse2D.java-901.2 removed
TrackSegment.java-1011.3 removed
+359-262
2 added + 2 removed + 3 modified, total 7 files
- Removing obsolete classes.
- Adding new classes for supporting integration of charge distributions on electrodes.
- Changes to SiSensor and electrode classes to make handling electrode coordinates more transparent: the first step towards making electrodes extend DetectorElement.

GeomConverter/src/org/lcsim/detector/tracker/silicon
ChargeDistribution.java added at 1.1
diff -N ChargeDistribution.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ ChargeDistribution.java	14 Oct 2007 06:13:09 -0000	1.1
@@ -0,0 +1,38 @@
+/*
+ * ChargeDistribution.java
+ *
+ * Created on October 10, 2007, 10:26 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.lcsim.detector.tracker.silicon;
+
+import org.lcsim.detector.ITransform3D;
+import hep.physics.vec.Hep3Vector;
+
+/**
+ *
+ * @author tknelson
+ */
+public interface ChargeDistribution
+{
+    // Transform this charge distribution into new coordinates in place
+    public void transform(ITransform3D transform);
+    
+    // Charge distribution transformed into new coordinates
+    public ChargeDistribution transformed(ITransform3D transform);
+    
+    // Normalization of distribution
+    public double getNormalization();
+    
+    // Mean of distribution
+    public Hep3Vector getMean();
+    
+    // One standard deviation along given axis
+    public double sigma1D(Hep3Vector axis);
+    
+    // One dimensional upper integral of charge distribution along a given axis 
+    public double upperIntegral1D(Hep3Vector axis, double integration_limit);            
+}

GeomConverter/src/org/lcsim/detector/tracker/silicon
GaussianDistribution2D.java added at 1.1
diff -N GaussianDistribution2D.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ GaussianDistribution2D.java	14 Oct 2007 06:13:10 -0000	1.1
@@ -0,0 +1,129 @@
+/*
+ * GaussianDistribution2D.java
+ *
+ * Created on October 10, 2007, 10:36 AM
+ *
+ * To change this template, choose Tools | Template Manager
+ * and open the template in the editor.
+ */
+
+package org.lcsim.detector.tracker.silicon;
+
+import org.lcsim.detector.ITransform3D;
+import hep.physics.vec.Hep3Vector;
+import hep.physics.vec.BasicHep3Vector;
+import hep.physics.vec.VecOp;
+import org.apache.commons.math.MathException;
+import org.apache.commons.math.special.Erf;
+
+/**
+ *
+ * @author tknelson
+ */
+public class GaussianDistribution2D implements ChargeDistribution
+{
+    private double _normalization; // = 1.0;
+    private Hep3Vector _mean; // = new BasicHep3Vector(0.0,0.0,0.0);
+    private Hep3Vector _major_axis; // = new BasicHep3Vector(1.0,0.0,0.0);
+    private Hep3Vector _minor_axis; // = new BasicHep3Vector(0.0,1.0,0.0);
+    
+    /** Creates a new instance of GaussianDistribution2D */
+    public GaussianDistribution2D(double normalization, Hep3Vector mean, Hep3Vector major_axis, Hep3Vector minor_axis)
+    {
+//        System.out.println("Constructing GaussianDistribution2D");
+        
+        _normalization = normalization;
+        _mean = mean;
+        
+        if (VecOp.dot(major_axis,minor_axis) == 0.0)
+        {
+            _major_axis = major_axis;
+            _minor_axis = minor_axis;
+        }
+        else
+        {
+            throw new RuntimeException("Axes not perpendicular!");
+        }
+        
+        
+//        System.out.println("normalization: "+_normalization);
+//        System.out.println("mean: "+_mean);
+//        System.out.println("major axis: "+_major_axis);
+//        System.out.println("minor axis: "+_minor_axis);
+        
+    }
+    
+    public void transform(ITransform3D transform)
+    {
+        transform.transform(_mean);
+        transform.rotate(_major_axis);
+        transform.rotate(_major_axis);
+    }
+    
+    public ChargeDistribution transformed(ITransform3D transform)
+    {
+        Hep3Vector transformed_mean = transform.transformed(_mean);
+        Hep3Vector transformed_major_axis = transform.rotated(_major_axis);
+        Hep3Vector transformed_minor_axis = transform.rotated(_minor_axis);
+        return new GaussianDistribution2D(_normalization, transformed_mean, transformed_major_axis, transformed_minor_axis);
+    }
+    
+    public double getNormalization()
+    {
+        return _normalization;
+    }
+    
+    public Hep3Vector getMean()
+    {
+        return _mean;
+    }
+    
+    public double sigma1D(Hep3Vector axis)
+    {
+        axis = VecOp.unit(axis);
+        return Math.sqrt( Math.pow(VecOp.dot(axis,_major_axis),2) + Math.pow(VecOp.dot(axis,_minor_axis),2) );
+    }
+    
+    // One dimensional upper integral of charge distribution along a given axis
+    public double upperIntegral1D(Hep3Vector axis, double integration_limit)
+    {
+        double integral = 0.0;
+        double normalized_integration_limit = (integration_limit-VecOp.dot(getMean(),axis))/sigma1D(axis);
+        
+//        System.out.println("Integration limit: "+integration_limit);
+//        System.out.println("Mean: "+getMean());
+//        System.out.println("Axis: "+axis);
+//        System.out.println("VecOp.dot(getMean(),axis)): "+VecOp.dot(getMean(),axis));
+//        System.out.println("integration_limit-VecOp.dot(getMean(),axis)): "+(integration_limit - VecOp.dot(getMean(),axis)));
+//        System.out.println("sigma1D(axis): "+sigma1D(axis));
+//        System.out.println("Normalized integration limit: "+normalized_integration_limit);
+        
+        if (normalized_integration_limit < -5.0)
+        {
+            integral = 1.0;
+        }
+        else if (normalized_integration_limit > 5.0)
+        {
+            integral = 0.0;
+        }
+        else
+        {
+            try
+                    
+            {
+                integral = (1.0-Erf.erf( normalized_integration_limit/Math.sqrt(2.0)))/2.0;
+            }
+            catch (MathException no_convergence)
+            {
+                System.out.println("Warning: erf fails to converge!! ");
+                System.out.println("    integration limit: "+integration_limit);
+                System.out.println("    sigma: "+sigma1D(axis));
+                System.out.println("    limit/sigma: "+normalized_integration_limit);
+            }
+        }
+        
+        return _normalization*integral;
+        
+    }
+    
+}

GeomConverter/src/org/lcsim/detector/tracker/silicon
SiSensor.java 1.15 -> 1.16
diff -u -r1.15 -r1.16
--- SiSensor.java	25 Sep 2007 23:52:54 -0000	1.15
+++ SiSensor.java	14 Oct 2007 06:13:09 -0000	1.16
@@ -58,7 +58,7 @@
     private Map<ChargeCarrier, SiSensorElectrodes> _sense_electrodes = new EnumMap<ChargeCarrier,SiSensorElectrodes>(ChargeCarrier.class);
     private Map<ChargeCarrier, SiSensorElectrodes> _readout_electrodes = new EnumMap<ChargeCarrier,SiSensorElectrodes>(ChargeCarrier.class);
     private Map<ChargeCarrier, BasicMatrix> _transfer_efficiencies = new EnumMap<ChargeCarrier,BasicMatrix>(ChargeCarrier.class);
-    private Map<ChargeCarrier, Double> _electrode_angles = new EnumMap<ChargeCarrier,Double>(ChargeCarrier.class);
+//    private Map<ChargeCarrier, Double> _electrode_angles = new EnumMap<ChargeCarrier,Double>(ChargeCarrier.class);
     private Orientation _orientation;
 
     // bulk - propoerties of the bulk
@@ -72,7 +72,7 @@
     // derived properties
     //-------------------
     // measured coordinates in local coordinates
-    private EnumMap<ChargeCarrier, Hep3Vector[]> _measured_coordinates = new EnumMap<ChargeCarrier,Hep3Vector[]>(ChargeCarrier.class);
+//    private EnumMap<ChargeCarrier, Hep3Vector[]> _measured_coordinates = new EnumMap<ChargeCarrier,Hep3Vector[]>(ChargeCarrier.class);
     
     // Constructors
     //=============
@@ -124,10 +124,10 @@
         _transfer_efficiencies.put(carrier,transfer_efficiencies);
     }
     
-    public void setElectrodeAngle(ChargeCarrier carrier, double electrode_angle)
-    {
-        _electrode_angles.put(carrier,electrode_angle);
-    }
+//    public void setElectrodeAngle(ChargeCarrier carrier, double electrode_angle)
+//    {
+//        _electrode_angles.put(carrier,electrode_angle);
+//    }
     
     public void setOrientation(Orientation orientation)
     {
@@ -175,10 +175,10 @@
         return _transfer_efficiencies.get(carrier);
     }
     
-    public double getElectrodeAngle(ChargeCarrier carrier)
-    {
-        return _electrode_angles.get(carrier);
-    }
+//    public double getElectrodeAngle(ChargeCarrier carrier)
+//    {
+//        return _electrode_angles.get(carrier);
+//    }
     
     public Orientation getOrientation()
     {
@@ -222,10 +222,10 @@
         
     }
         
-    public Hep3Vector[] getMeasuredCoordinates(ChargeCarrier carrier)
-    {
-        return _measured_coordinates.get(carrier);
-    }
+//    public Hep3Vector[] getMeasuredCoordinates(ChargeCarrier carrier)
+//    {
+//        return _measured_coordinates.get(carrier);
+//    }
     
     
     // Operators
@@ -241,16 +241,18 @@
         {
             if (hasElectrodesOnSide(carrier)) {  
                 
-                // cache coordinates measured by the pattern of electrodes on each side
-                double electrode_angle = getElectrodeAngle(carrier); 
-                int naxes = _sense_electrodes.get(carrier).getNAxes();
-                Hep3Vector[] measured_coordinates = new Hep3Vector[naxes];
-                
-                for (int iaxis = 0; iaxis < naxes ; iaxis++)
-                {
-                    measured_coordinates[iaxis] = measuredCoordinate(electrode_angle + iaxis*Math.PI/naxes);
-                }
-                _measured_coordinates.put(carrier,measured_coordinates);
+//                // cache coordinates measured by the pattern of electrodes on each side
+//                double electrode_angle = getElectrodeAngle(carrier); 
+//                int naxes = _sense_electrodes.get(carrier).getNAxes();
+//                Hep3Vector[] measured_coordinates = new Hep3Vector[naxes];
+//                
+//                for (int iaxis = 0; iaxis < naxes ; iaxis++)
+//                {
+//                    measured_coordinates[iaxis] = measuredCoordinate(electrode_angle + iaxis*Math.PI/naxes);
+//                }
+//                _measured_coordinates.put(carrier,measured_coordinates);
+
+            
             }
         }
 
@@ -279,10 +281,10 @@
         else return true;
     }
     
-    private Hep3Vector measuredCoordinate(double electrode_angle)
-    {
-        return new BasicHep3Vector(Math.cos(electrode_angle),Math.sin(electrode_angle),0.0);
-    }
+//    private Hep3Vector measuredCoordinate(double electrode_angle)
+//    {
+//        return new BasicHep3Vector(Math.cos(electrode_angle),Math.sin(electrode_angle),0.0);
+//    }
     
     public Hep3Vector electricField(Hep3Vector position)
     {

GeomConverter/src/org/lcsim/detector/tracker/silicon
SiSensorElectrodes.java 1.6 -> 1.7
diff -u -r1.6 -r1.7
--- SiSensorElectrodes.java	10 Jul 2007 23:42:42 -0000	1.6
+++ SiSensorElectrodes.java	14 Oct 2007 06:13:10 -0000	1.7
@@ -9,6 +9,8 @@
 
 package org.lcsim.detector.tracker.silicon;
 
+import org.lcsim.detector.IDetectorElement;
+import org.lcsim.detector.ITransform3D;
 import hep.physics.vec.Hep3Vector;
 import java.util.SortedMap;
 import java.util.Set;
@@ -22,15 +24,30 @@
     // Cell shape, assumed to be strips or rectancular pixels
     public int getNAxes();
     
+    // Get Detector element for associated sensor
+    public IDetectorElement getDetectorElement();
+    
+    // Transformation from sensor coordinates to electrode coordinates
+    public ITransform3D getParentToLocal();    
+    
+    // Transformation from electrode coordinates to global coordinates
+    public ITransform3D getLocalToGlobal();
+    
+    // Transformation from gloabl coordinates to electrode coordinates
+    public ITransform3D getGlobalToLocal();
+    
     // Direction of each measured coordinate
     public Hep3Vector getMeasuredCoordinate(int axis);
     
+    // Direction of each non-measured coordinate (i.e. strip axis for strips)
+    public Hep3Vector getUnmeasuredCoordinate(int axis);
+    
     // Neigbor ncells away along each axis
     public int getNeighborCell(int cell, int ncells_0, int ncells_1);
     
     // Get all nearest neighbor cells
     public Set<Integer> getNearestNeighborCells(int cell);
-
+    
     // Cell number is valid
     public boolean isValidCell(int cell);
     
@@ -56,11 +73,11 @@
     public int getColumnNumber(Hep3Vector position);
     
     // Row number of cell at given position
-    public int getRowNumber(Hep3Vector position);   
+    public int getRowNumber(Hep3Vector position);
     
     // ID of cell from row and column number
     public int getCellID(int row_number, int column_number);
-   
+    
     // Column number of cell from ID
     public int getColumnNumber(int cell_id);
     
@@ -71,6 +88,7 @@
     public Hep3Vector getPositionInCell(Hep3Vector position);
     
     // Compute Gaussian-distributed charge on electrodes
-    public SortedMap<Integer,Integer> computeElectrodeData(double charge, Hep3Vector position, ErrorEllipse2D distribution);
+    public SortedMap<Integer,Integer> computeElectrodeData(ChargeDistribution distribution);
+//    public SortedMap<Integer,Integer> computeElectrodeData(double charge, Hep3Vector position, ErrorEllipse2D distribution);
     
 }

GeomConverter/src/org/lcsim/detector/tracker/silicon
SiStrips.java 1.9 -> 1.10
diff -u -r1.9 -r1.10
--- SiStrips.java	10 Jul 2007 23:42:43 -0000	1.9
+++ SiStrips.java	14 Oct 2007 06:13:10 -0000	1.10
@@ -10,11 +10,12 @@
  */
 
 //import static org.lcsim.units.clhep.SystemOfUnits.*;
+import org.lcsim.detector.IDetectorElement;
+import org.lcsim.detector.ITransform3D;
+import org.lcsim.detector.Transform3D;
 import hep.physics.vec.Hep3Vector;
 import hep.physics.vec.BasicHep3Vector;
 import hep.physics.vec.VecOp;
-import org.apache.commons.math.special.Erf;
-import org.apache.commons.math.MathException;
 import java.util.SortedMap;
 import java.util.TreeMap;
 import java.util.Set;
@@ -26,32 +27,60 @@
  */
 public class SiStrips implements SiSensorElectrodes
 {
-
+    
     // Fields
     private int _nstrips; // number of strips
     private double _pitch; // sense pitch
-
+    private IDetectorElement _detector; // associated detector element
+    private ITransform3D _parent_to_local; // parent to local transform
+    private ITransform3D _local_to_global; // transformation to global coordinates
+    private ITransform3D _global_to_local; // transformation from global coordinates
+    
     // Constructors
     //=============
     
-    public SiStrips(int nstrips, double pitch, int floating_strips)
+    public SiStrips(int nstrips, double pitch, IDetectorElement detector, ITransform3D parent_to_local)
     {
         setNStrips(nstrips);
         setPitch(pitch);
+        setDetectorElement(detector);
+        setParentToLocal(parent_to_local);
+        setGlobalToLocal(Transform3D.multiply(parent_to_local,detector.getGeometry().getGlobalToLocal()));
+        setLocalToGlobal(getGlobalToLocal().inverse());
     }
     
     // Setters
     //==================
-    public void setNStrips(int nstrips)
+    private void setNStrips(int nstrips)
     {
         _nstrips = nstrips;
     }
     
-    public void setPitch(double pitch)
+    private void setPitch(double pitch)
     {
         _pitch = pitch;
     }
- 
+    
+    private void setDetectorElement(IDetectorElement detector)
+    {
+        _detector = detector;
+    }
+    
+    private void setParentToLocal(ITransform3D parent_to_local)
+    {
+        _parent_to_local = parent_to_local;
+    }
+    
+    private void setLocalToGlobal(ITransform3D local_to_global)
+    {
+        _local_to_global = local_to_global;
+    }
+    
+    private void setGlobalToLocal(ITransform3D global_to_local)
+    {
+        _global_to_local = global_to_local;
+    }
+    
     // Getters
     //===================
     public int getNAxes()
@@ -59,19 +88,45 @@
         return 1;
     }
     
+    public IDetectorElement getDetectorElement()
+    {
+        return _detector;
+    }
+    
+    public ITransform3D getParentToLocal()
+    {
+        return _parent_to_local;
+    }
+    
+    public ITransform3D getLocalToGlobal()
+    {
+        return _local_to_global;
+    }
+    
+    public ITransform3D getGlobalToLocal()
+    {
+        return _global_to_local;
+    }
+    
     public Hep3Vector getMeasuredCoordinate(int axis)
     {
         if (axis == 0) return new BasicHep3Vector(1.0,0.0,0.0);
         else return null;
     }
     
+    public Hep3Vector getUnmeasuredCoordinate(int axis)
+    {
+        if (axis == 0) return new BasicHep3Vector(0.0,1.0,0.0);
+        else return null;
+    }
+    
     public int getNeighborCell(int cell, int ncells_0, int ncells_1)
     {
         int neighbor_cell = cell + ncells_0;
         if (isValidCell(neighbor_cell)) return neighbor_cell;
-        else return -1;        
+        else return -1;
     }
-
+    
     public Set<Integer> getNearestNeighborCells(int cell)
     {
         Set<Integer> neighbors = new HashSet<Integer>();
@@ -105,22 +160,22 @@
             return _nstrips;
         }
         else return 1;
-    }    
+    }
     
     public double getPitch(int axis)
     {
         return _pitch;
-    }    
-        public int getCellID(Hep3Vector position)
+    }
+    public int getCellID(Hep3Vector position)
     {
         return (int)Math.round((position.x()+getStripOffset())/_pitch);
     }
     
-
+    
     public int getRowNumber(Hep3Vector position)
     {
         return 0;
-    }   
+    }
     
     public int getColumnNumber(Hep3Vector position)
     {
@@ -135,7 +190,7 @@
     public int getRowNumber(int cell_id)
     {
         return 0;
-    }   
+    }
     
     public int getColumnNumber(int cell_id)
     {
@@ -146,54 +201,100 @@
     {
         return VecOp.sub(position,getCellPosition(getCellID(position)));
     }
-   
+    
     public Hep3Vector getCellPosition(int strip_number)
     {
         return new BasicHep3Vector(strip_number*_pitch-getStripOffset(),0.0,0.0);
     }
     
-    public SortedMap<Integer,Integer> computeElectrodeData(double charge, Hep3Vector position, ErrorEllipse2D distribution)
+    public SortedMap<Integer,Integer> computeElectrodeData(ChargeDistribution distribution)
     {
-
         SortedMap<Integer,Integer> electrode_data = new TreeMap<Integer,Integer>();
         
-        int base_strip = getCellID(position);
-
-        Hep3Vector interstrip_position = getPositionInCell(position);
-
+        int base_strip = getCellID(distribution.getMean());
+        Hep3Vector interstrip_position = getPositionInCell(distribution.getMean());
+        
         // put charge on strips in window 3-sigma strips on each side of base strip
-        double pitch = _pitch;
-        double axis_angle = 0.0;
+        int axis = 0;
+        int window_size = (int)Math.ceil(3.0*distribution.sigma1D(getMeasuredCoordinate(axis))/getPitch(axis));
         
-        int window_size = (int)Math.ceil(3.0*distribution.sigma1D(axis_angle)/pitch);
+        double integral_lower = distribution.getNormalization();
+        double integral_upper = distribution.getNormalization();
         
-        double erfc_lower = 1.0;
-        double erfc_upper = 1.0;
-    
         for (int istrip = base_strip-window_size; istrip <= base_strip+window_size; istrip++)
         {
+            double cell_edge_upper = getCellPosition(istrip).x() + getPitch(axis)/2.0;
             
-            double cell_edge_upper = getCellPosition(istrip).x() + pitch/2.0;
-          
-            double erfc_limit = cell_edge_upper-position.x();
+//            System.out.println("cell_edge_upper: "+cell_edge_upper);
             
-            erfc_upper = distribution.erfc1D(erfc_limit,axis_angle);
-
-            if (erfc_lower<erfc_upper) System.out.println("SQUEAL LIKE A PIG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+            double integration_limit = cell_edge_upper;        //cell_edge_upper-distribution.mean().x();
+            
+//            System.out.println("integration_limit: "+integration_limit);
+            
+            integral_upper = distribution.upperIntegral1D(getMeasuredCoordinate(axis),integration_limit);
+            
+//            System.out.println("integral_upper: "+integral_upper);
+            
+            if (integral_lower<integral_upper) System.out.println("SQUEAL LIKE A PIG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+            
+            int strip_charge = (int)Math.round(integral_lower-integral_upper);
+            
+//            System.out.println("strip_charge: "+strip_charge);
             
-            int strip_charge = (int)Math.round( (erfc_lower-erfc_upper) * charge);
-                        
             if (strip_charge != 0)
             {
                 electrode_data.put(istrip,strip_charge);
             }
             
-            erfc_lower = erfc_upper;
-            
+            integral_lower = integral_upper;
         }
+        
         return electrode_data;
+        
     }
     
+//    public SortedMap<Integer,Integer> computeElectrodeData(double charge, Hep3Vector position, ChargeDistribution distribution)
+//    {
+//        
+//        SortedMap<Integer,Integer> electrode_data = new TreeMap<Integer,Integer>();
+//        
+//        int base_strip = getCellID(position);
+//        
+//        Hep3Vector interstrip_position = getPositionInCell(position);
+//        
+//        // put charge on strips in window 3-sigma strips on each side of base strip
+//        double pitch = _pitch;
+//        double axis_angle = 0.0;
+//        
+//        int window_size = (int)Math.ceil(3.0*distribution.sigma1D(axis_angle)/pitch);
+//        
+//        double erfc_lower = 1.0;
+//        double erfc_upper = 1.0;
+//        
+//        for (int istrip = base_strip-window_size; istrip <= base_strip+window_size; istrip++)
+//        {
+//            
+//            double cell_edge_upper = getCellPosition(istrip).x() + pitch/2.0;
+//            
+//            double erfc_limit = cell_edge_upper-position.x();
+//            
+//            erfc_upper = distribution.erfc1D(erfc_limit,axis_angle);
+//            
+//            if (erfc_lower<erfc_upper) System.out.println("SQUEAL LIKE A PIG!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!");
+//            
+//            int strip_charge = (int)Math.round( (erfc_lower-erfc_upper) * charge);
+//            
+//            if (strip_charge != 0)
+//            {
+//                electrode_data.put(istrip,strip_charge);
+//            }
+//            
+//            erfc_lower = erfc_upper;
+//            
+//        }
+//        return electrode_data;
+//    }
+    
     // Private
     private double getStripOffset()
     {

GeomConverter/src/org/lcsim/detector/tracker/silicon
ErrorEllipse2D.java removed after 1.2
diff -N ErrorEllipse2D.java
--- ErrorEllipse2D.java	7 May 2007 21:22:49 -0000	1.2
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,90 +0,0 @@
-/*
- * ErrorEllipse2D.java
- *
- * Created on April 18, 2007, 3:08 PM
- *
- * To change this template, choose Tools | Template Manager
- * and open the template in the editor.
- */
-
-package org.lcsim.detector.tracker.silicon;
-
-import org.apache.commons.math.special.Erf;
-import org.apache.commons.math.MathException;
-
-/**
- *
- * @author tknelson
- */
-public class ErrorEllipse2D
-{
-    // size and orientation of error ellipse
-    private double _major_axis;
-    private double _minor_axis;
-    private double _major_axis_angle;
-    
-    /** Creates a new instance of ErrorEllipse2D */
-    public ErrorEllipse2D()
-    {
-        // Unit circle by default
-        _major_axis = 1.0;
-        _minor_axis = 1.0;
-        _major_axis_angle = 0.0;
-    }
-    
-    public ErrorEllipse2D(double major_axis, double minor_axis, double major_axis_angle)
-    {
-        _major_axis = major_axis;
-        _minor_axis = minor_axis;
-        _major_axis_angle = major_axis_angle;
-    }
-    
-    public ErrorEllipse2D rotate(double rotation_angle)
-    {
-        _major_axis_angle += rotation_angle;
-        return this;
-    }
-    
-    public double erfc1D(double integration_limit, double axis_angle)
-    {
-//        double angle_diff = axis_angle - _major_axis_angle;
-//        double sigma = Math.sqrt( Math.pow(_major_axis*Math.cos(angle_diff),2) + Math.pow(_minor_axis*Math.sin(angle_diff),2) );
-        
-        double erfc=0.0;
-        
-        double normalized_integration_limit = integration_limit/sigma1D(axis_angle);
-        if (normalized_integration_limit < -5.0)
-        {
-            erfc = 1.0;
-        }
-        else if (normalized_integration_limit > 5.0)
-        {
-            erfc = 0.0;
-        }
-        else
-        {
-            try
-                    
-            {
-                erfc = (1.0-Erf.erf( normalized_integration_limit/Math.sqrt(2.0)))/2.0;
-            }
-            catch (MathException no_convergence)
-            {
-                System.out.println("Warning: erf fails to converge!! ");
-                System.out.println("    integration limit: "+integration_limit);
-                System.out.println("    sigma: "+sigma1D(axis_angle));
-                System.out.println("    limit/sigma: "+normalized_integration_limit);
-            }
-        }
-
-        return erfc;        
-    }
-    
-    public double sigma1D(double axis_angle)
-    {
-        double angle_diff = axis_angle - _major_axis_angle;
-        return Math.sqrt( Math.pow(_major_axis*Math.cos(angle_diff),2) + Math.pow(_minor_axis*Math.sin(angle_diff),2) );
-    }
-    
-    
-}

GeomConverter/src/org/lcsim/detector/tracker/silicon
TrackSegment.java removed after 1.3
diff -N TrackSegment.java
--- TrackSegment.java	20 Apr 2007 06:31:27 -0000	1.3
+++ /dev/null	1 Jan 1970 00:00:00 -0000
@@ -1,101 +0,0 @@
-package org.lcsim.detector.tracker.silicon;
-/*
- * TrackSegment.java
- *
- * Created on July 27, 2005, 3:34 PM
- *
- * To change this template, choose Tools | Options and locate the template under
- * the Source Creation and Management node. Right-click the template and choose
- * Open. You can then make changes to the template in the Source Editor.
- */
-
-import hep.physics.vec.Hep3Vector;
-import hep.physics.vec.BasicHep3Vector;
-import hep.physics.vec.VecOp;
-
-import org.lcsim.detector.ITransform3D;
-import org.lcsim.geometry.IDDecoder;
-
-import java.util.*;
-
-/**
- *
- * @author tknelson
- */
-public class TrackSegment
-{
-    
-    // Fields
-    private Hep3Vector _p1;
-    private Hep3Vector _p2;
-    private double _energy_loss;
-    
-    /**
-     * Creates a new instance of TrackSegment 
-     */
-      
-    public TrackSegment(Hep3Vector p1, Hep3Vector p2, double energy_loss)
-    {
-        _p1 = p1;
-        _p2 = p2;
-        _energy_loss = energy_loss;
-    }
-    
-    // Accessors
-    public Hep3Vector getP1()
-    {
-        return _p1;
-    }
-    
-    public Hep3Vector getP2()
-    {
-        return _p2;
-    }
-    
-    public double getEloss()
-    {
-        return _energy_loss;
-    }
-    
-    public Hep3Vector getVector()
-    {
-        return VecOp.sub(_p2,_p1);
-    }
-    
-    public Hep3Vector getDirection()
-    {
-        return VecOp.unit(getVector());
-    }
-    
-    public double getLength()
-    {
-        return getVector().magnitude();
-    }
-    
-    public double getDedx()
-    {
-        return _energy_loss/getLength();
-    }
-    
-    public void transform(ITransform3D transformation)
-    {
-        transformation.transform(_p1);
-        transformation.transform(_p2);
-    }
-    
-//    public void rotateMedium(Hep3Vector axis, double center, double angle)
-//    {           
-//        double old_length = getLength();
-//        rotateMedium(_p1,axis,center,angle);
-//        rotateMedium(_p2,axis,center,angle);
-//        _energy_loss *= getLength()/old_length;        
-//    }
-//    
-//    private void rotateMedium(Hep3Vector point, Hep3Vector axis, double center, double angle)
-//    {
-//        assert (axis.z() == 0.0); // assumed that we are rotating silicon z-planes        
-//        point = VecOp.add(point,VecOp.mult(Math.tan(angle)*(center - point.z()),
-//                VecOp.unit(VecOp.cross(axis, new BasicHep3Vector(0,0,1)))));
-//    }
-    
-}
CVSspam 0.2.8