lcsim/test/org/lcsim/recon/cluster/nn
diff -u -r1.4 -r1.5
--- NearestNeighborClustererTest.java 18 Jul 2005 03:07:12 -0000 1.4
+++ NearestNeighborClustererTest.java 8 Feb 2006 00:49:43 -0000 1.5
@@ -1,7 +1,5 @@
/*
- * NearestNeighborClustererTest.java
- *
- * Created on March 4, 2005, 10:38 AM
+ * NearestNeighborClustererTest.java Created on March 4, 2005, 10:38 AM
*/
package org.lcsim.recon.cluster.nn;
@@ -20,73 +18,66 @@
import org.lcsim.util.lcio.LCIOReader;
import org.lcsim.util.lcio.LCIOWriter;
-
/**
- *
* @author ngraf
*/
public class NearestNeighborClustererTest extends TestCase
{
- public NearestNeighborClustererTest(String testName)
- {
- super(testName);
- }
-
- public static Test suite()
- {
- return new TestSuite(NearestNeighborClustererTest.class);
- }
-
- public static void testNNClusterer() throws IOException
- {
- URL url = new URL("http://www.lcsim.org/datasamples/slic_sdjan03_muons_Theta4-176_1-10GeV.slcio");
- FileCache cache = new FileCache();
- File file = cache.getCachedFile(url);
-
- LCIOReader reader = new LCIOReader(file);
- LCIOWriter writer = new LCIOWriter("NearestNeighborRecon.slcio");
- int minNumberOfCells = 5;
- NearestNeighborClusterDriver driver = new NearestNeighborClusterDriver(minNumberOfCells);
- System.out.println("Processing events with "+driver);
- int n = 0;
- long start = System.currentTimeMillis();
- try
- {
- for (int i=0; i<10;++i)
- {
- EventHeader event = reader.read();
- driver.process(event);
-
-/*
- //if (n == 0)
+ public NearestNeighborClustererTest(String testName)
+ {
+ super(testName);
+ }
+
+ public static Test suite()
+ {
+ return new TestSuite(NearestNeighborClustererTest.class);
+ }
+
+ public static void testNNClusterer() throws IOException
+ {
+ // URL url = new
+ // URL("http://www.lcsim.org/datasamples/slic_sdjan03_muons_Theta4-176_1-10GeV.slcio");
+ URL url = new URL("http://www.lcsim.org/test/lcio/muons_SLIC_v1r9p1_sidmay05.slcio");
+ FileCache cache = new FileCache();
+ File file = cache.getCachedFile(url);
+
+ LCIOReader reader = new LCIOReader(file);
+ LCIOWriter writer = new LCIOWriter("NearestNeighborRecon.slcio");
+ int minNumberOfCells = 5;
+ NearestNeighborClusterDriver driver = new NearestNeighborClusterDriver(minNumberOfCells);
+ System.out.println("Processing events with " + driver);
+ int n = 0;
+ long start = System.currentTimeMillis();
+ try
+ {
+ for (int i = 0; i < 10; ++i)
{
- // Look for clusters
- List<List<Cluster>> collections = event.get(Cluster.class);
- System.out.println("Found "+collections.size() +" cluster collection"+(collections.size()==1?" ":"s ")+"in the event");
- for(List<Cluster> clusterList : collections)
- {
- for(Cluster clus : clusterList)
- {
- System.out.println(clus);
- }
- }
-// assertEquals(4,collections.size());
+ EventHeader event = reader.read();
+ driver.process(event);
+
+ /*
+ * //if (n == 0) { // Look for clusters List<List<Cluster>>
+ * collections = event.get(Cluster.class);
+ * System.out.println("Found "+collections.size() +" cluster
+ * collection"+(collections.size()==1?" ":"s ")+"in the event");
+ * for(List<Cluster> clusterList : collections) { for(Cluster
+ * clus : clusterList) { System.out.println(clus); } } //
+ * assertEquals(4,collections.size()); }
+ */
+ writer.write(event);
+ n++;
}
-*/
- writer.write(event);
- n++;
- }
- }
- catch (EOFException x)
- {
- System.out.println("End of file reached");
- }
- finally
- {
- long stop = System.currentTimeMillis();
- System.out.printf("Read %d events in %dms\n",n,stop-start);
- reader.close();
- writer.close();
- }
- }
+ }
+ catch (EOFException x)
+ {
+ System.out.println("End of file reached");
+ }
+ finally
+ {
+ long stop = System.currentTimeMillis();
+ System.out.printf("Read %d events in %dms\n", n, stop - start);
+ reader.close();
+ writer.close();
+ }
+ }
}