lcsim/test/org/lcsim
diff -N LCIOReconReadTest.java
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ LCIOReconReadTest.java 14 Sep 2007 23:06:50 -0000 1.1
@@ -0,0 +1,60 @@
+package org.lcsim;
+
+import java.io.File;
+import java.net.URL;
+import java.util.List;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+import org.lcsim.event.EventHeader;
+import org.lcsim.event.Track;
+import org.lcsim.util.Driver;
+import org.lcsim.util.cache.FileCache;
+import org.lcsim.util.loop.LCSimLoop;
+
+/**
+ * @author tonyj
+ */
+public class LCIOReconReadTest extends TestCase
+{
+
+ public LCIOReconReadTest(String testName)
+ {
+ super(testName);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(LCIOReconReadTest.class);
+ }
+
+ public void testLCIORead() throws Exception
+ {
+ URL url = new URL("http://www.lcsim.org/test/lcio/NonTrivialPFA.slcio");
+ FileCache cache = new FileCache();
+ File file = cache.getCachedFile(url);
+
+ LCSimLoop loop = new LCSimLoop();
+ loop.setLCIORecordSource(file);
+ loop.add(new ReadDriver());
+ loop.loop(1, null);
+ loop.dispose();
+ }
+
+ private class ReadDriver extends Driver
+ {
+ private int n;
+
+ public void process(EventHeader event)
+ {
+ // Look for clusters
+ List<Track> tracks = event.get(Track.class,"Tracks_by_ron");
+ for (Track track : tracks)
+ {
+ double p = track.getPX();
+ assertTrue(p!=0);
+ }
+ }
+ }
+}