lcsim/test
diff -u -r1.11 -r1.12
--- HitPositionTest.java 18 Jul 2005 18:00:56 -0000 1.11
+++ HitPositionTest.java 20 Jul 2005 19:12:22 -0000 1.12
@@ -2,16 +2,17 @@
import java.net.URL;
import java.util.List;
import java.util.ArrayList;
-import junit.framework.Test;
-import junit.framework.TestCase;
-import junit.framework.TestSuite;
import org.lcsim.event.EventHeader;
import org.lcsim.event.SimCalorimeterHit;
-import org.lcsim.geometry.CalorimeterIDDecoder;
import org.lcsim.util.Driver;
import org.lcsim.util.cache.FileCache;
import org.lcsim.util.loop.LCSimLoop;
-import org.lcsim.geometry.segmentation.GridXYZ;
+import org.lcsim.geometry.CalorimeterIDDecoder;
+import org.lcsim.geometry.Subdetector;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
/**
*
@@ -128,9 +129,26 @@
assertEquals(decoder.getX(), pos[0], 0.001);
assertEquals(decoder.getY(), pos[1], 0.001);
assertEquals(decoder.getZ(), pos[2], 0.001);
+
+ Subdetector subdet = decoder.getSubdetector();
+
+ if ( subdet == null )
+ {
+ throw new RuntimeException("IDDecoder's Subdetector is null.");
+ }
+
+ /* subdetector and decoder should agree on basic flags... */
+ if ( subdet.isBarrel() )
+ {
+ assertTrue(decoder.isBarrel());
+ }
+
+ if ( subdet.isEndcap())
+ {
+ assertTrue(decoder.isEndcap());
+ }
}
}
}
}
-}
-
+}
\ No newline at end of file