Print

Print


Author: [log in to unmask]
Date: Thu Sep 24 07:43:57 2015
New Revision: 3688

Log:
Fixed test by updating the sample of evio events and now requiring two electrons per event, since we now use both the Helical Track and the GBL Track.
Still need to improve the checks on the quality of the output file.

Modified:
    java/trunk/integration-tests/src/test/java/org/hps/test/it/EngRun2015ReconTest.java

Modified: java/trunk/integration-tests/src/test/java/org/hps/test/it/EngRun2015ReconTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/test/it/EngRun2015ReconTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/test/it/EngRun2015ReconTest.java	Thu Sep 24 07:43:57 2015
@@ -18,28 +18,34 @@
 import org.lcsim.util.test.TestUtil.TestOutputFile;
 
 /**
- * Test to run the standard reconstruction on Engineering Run 2015 EVIO data. Full energy electron candidate events were
- * selected from pass1 output. The current test runs the default reconstruction over the evio file then analyzes the
- * output lcio file. The current checks are minimal and need to be improved.
+ * Test to run the standard reconstruction on Engineering Run 2015 EVIO data.
+ * Full energy electron candidate events were selected from pass1 output. The
+ * current test runs the default reconstruction over the evio file then analyzes
+ * the output lcio file. The current checks are minimal and need to be improved.
  *
  * @author Norman A Graf
  */
-public class EngRun2015ReconTest extends TestCase {
+public class EngRun2015ReconTest extends TestCase
+{
 
-    final static String fileLocation = "http://www.lcsim.org/test/hps-java/run5772_pass1_stripOneFee_1000Events.evio";
+    final static String fileLocation = "http://www.lcsim.org/test/hps-java/run5772_integrationTest.evio";
+//final static String fileLocation = "http://www.lcsim.org/test/hps-java/run5772_pass1_stripOneFee_5000Events.evio";
 
-    public void testEngRun2015Recon() throws Exception {
+    public void testEngRun2015Recon() throws Exception
+    {
         System.out.println("Caching file...");
         FileCache cache = new FileCache();
         File inputFile = cache.getCachedFile(new URL(fileLocation));
         File outputFile = new TestOutputFile("EngRun2015ReconTest");
         String args[] = {"-r", "-x", "/org/hps/steering/recon/EngineeringRun2015FullRecon_Pass2.lcsim", "-d",
-                "HPS-EngRun2015-Nominal-v2", "-D", "outputFile=" + outputFile.getPath(), inputFile.getPath(), "-n",
-                "1000"};
+            "HPS-EngRun2015-Nominal-v2", "-D", "outputFile=" + outputFile.getPath(), inputFile.getPath(), "-n",
+            "1000"};
         System.out.println("Running EngRun2015ReconTest.main ...");
         System.out.println("writing to: " + outputFile.getPath());
+        long startTime = System.currentTimeMillis();
         EvioToLcio.main(args);
-
+        long endTime = System.currentTimeMillis();
+        System.out.println("That took " + (endTime - startTime) + " milliseconds");
         // Read in the LCIO event file and print out summary information.
         System.out.println("Running ReconCheckDriver on output ...");
         LCSimLoop loop = new LCSimLoop();
@@ -54,12 +60,14 @@
         System.out.println("Done!");
     }
 
-    static class ReconCheckDriver extends Driver {
+    static class ReconCheckDriver extends Driver
+    {
 
         int nFail;
         int nProcessed;
 
-        public void process(EventHeader event) {
+        public void process(EventHeader event)
+        {
             boolean fail = false;
             List<ReconstructedParticle> rps = event.get(ReconstructedParticle.class, "FinalStateParticles");
             int nrp = rps.size();
@@ -82,7 +90,7 @@
                     ++npositron;
                 }
             }
-            if (nelectron != 1) {
+            if (nelectron != 2) {
                 fail = true;
             }
             if (npositron != 0) {
@@ -100,7 +108,8 @@
             // TODO add checks on quality of output (chi2, p, E, E/p matching, position matching, etc.)
         }
 
-        public void endOfData() {
+        public void endOfData()
+        {
             System.out.println(nFail + " of " + nProcessed + " events failed");
             assertEquals("Expected no events to fail", nFail, 0);
         }