Print

Print


Commit in lcsim/src/org/lcsim/event/base on MAIN
BaseHitWithPosition.java+7-11.1 -> 1.2
default to id lookup before using position (should improve performance a lot)

lcsim/src/org/lcsim/event/base
BaseHitWithPosition.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- BaseHitWithPosition.java	17 Mar 2009 22:45:44 -0000	1.1
+++ BaseHitWithPosition.java	23 Apr 2009 23:09:53 -0000	1.2
@@ -31,8 +31,14 @@
      */
     public IDetectorElement getDetectorElement()
     {
-    	if (de == null)
+    	try 
     	{
+    		// First try id lookup using superclass's method, because it is fast.
+    		super.getDetectorElement();
+    	}
+    	catch (RuntimeException x)
+    	{
+    		// Id lookup failed.  Try using the position.
     		de = getSubdetector().getDetectorElement().findDetectorElement(getPositionVec());
     	}
     	return de;
CVSspam 0.2.8