Commit in lcsim/src/org/lcsim/fit/helicaltrack on MAIN
HelicalTrackHit.java+17-141.5 -> 1.6
CD -added null check + cosmetic changes

lcsim/src/org/lcsim/fit/helicaltrack
HelicalTrackHit.java 1.5 -> 1.6
diff -u -r1.5 -r1.6
--- HelicalTrackHit.java	14 Mar 2008 17:49:10 -0000	1.5
+++ HelicalTrackHit.java	14 Mar 2008 18:21:50 -0000	1.6
@@ -154,19 +154,7 @@
         return 1;
     }
     
-    /**
-     * Calculate the polar coordinates _r, _phi from the cartesian
-     * coordinates _x, _y and cache them in this object since we
-     * expect them to be used repeatedly by the track finding code.
-     */
-    private void setPolarCoordinates() {
-        _r = Math.sqrt(_x * _x + _y * _y);
-        _phi = Math.atan2(_y, _x);
-        if (_phi < 0.) _phi += 2. * Math.PI;
-        return;
-    }
-
-    /**
+     /**
      * Returns a list of MCParticles belonging to this hit. 
      * null is returned if no list can be found. 
      * 
@@ -193,7 +181,7 @@
                 for (DigiTrackerHit dhit : cluster.getDigiHits()){
                     for (DigiTrackerHit dhit2 : dhit.getElementalHits()){
                         MCParticle p = dhit2.getMCParticle(); 
-                        if(!out.contains(p)) out.add(p); 
+                        if(p != null && !out.contains(p)) out.add(p); 
                     }
                 }
             }
@@ -225,4 +213,19 @@
     public List getRawHits() {
         return _trackerhit.getRawHits();
     }
+    
+    
+    /**
+     * Calculate the polar coordinates _r, _phi from the cartesian
+     * coordinates _x, _y and cache them in this object since we
+     * expect them to be used repeatedly by the track finding code.
+     */
+    private void setPolarCoordinates() {
+        _r = Math.sqrt(_x * _x + _y * _y);
+        _phi = Math.atan2(_y, _x);
+        if (_phi < 0.) _phi += 2. * Math.PI;
+        return;
+    }
+
+
 }
\ No newline at end of file
CVSspam 0.2.8