lcsim/src/org/lcsim/event/base
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;