Commit in lcsim/test on MAIN
MokkaTest.java+57added 1.1
JM: Beginning basic test for Mokka compatibility with IDDecoder.

lcsim/test
MokkaTest.java added at 1.1
diff -N MokkaTest.java
--- /dev/null	1 Jan 1970 00:00:00 -0000
+++ MokkaTest.java	18 Jan 2006 01:48:10 -0000	1.1
@@ -0,0 +1,57 @@
+import java.io.File;
+import java.net.URL;
+
+import org.lcsim.util.Driver;
+import org.lcsim.util.cache.FileCache;
+import org.lcsim.util.loop.LCSimLoop;
+import org.lcsim.event.EventHeader;
+import org.lcsim.geometry.Detector;
+import org.lcsim.geometry.Subdetector;
+import org.lcsim.geometry.IDDecoder;
+
+import junit.framework.Test;
+import junit.framework.TestCase;
+import junit.framework.TestSuite;
+
+/**
+ *
+ * @author jeremym
+ * @version $Id: MokkaTest.java,v 1.1 2006/01/18 01:48:10 jeremy Exp $
+ */
+public class MokkaTest extends TestCase
+{
+    public MokkaTest(String testName)
+    {
+        super(testName);
+    }
+
+    public static Test suite()
+    {
+        return new TestSuite(MokkaTest.class);
+    }
+
+    public void testMokka() throws Exception
+    {
+	//        URL url = new URL("http://www.lcsim.org/test/lcio/D12_mokka_muons.slcio");
+	URL url = new URL("http://www.lcsim.org/test/lcio/hcalFeRPC1_Mokka_muons.slcio");
+        FileCache cache = new FileCache();
+        File file = cache.getCachedFile(url);
+
+        LCSimLoop loop = new LCSimLoop();
+        loop.setLCIORecordSource(file);
+        loop.add(new MokkaDriver());
+        loop.loop(-1);
+        loop.dispose();
+    }
+
+    private class MokkaDriver extends Driver
+    {
+        protected void process(EventHeader event)
+        {
+ 	    for ( Subdetector sub : event.getDetector().getSubdetectors().values() )
+            {
+		IDDecoder decoder = sub.getIDDecoder();
+	    }
+        }
+    }
+}
CVSspam 0.2.8