LISTSERV mailing list manager LISTSERV 16.5

Help for HPS-SVN Archives


HPS-SVN Archives

HPS-SVN Archives


HPS-SVN@LISTSERV.SLAC.STANFORD.EDU


View:

Message:

[

First

|

Previous

|

Next

|

Last

]

By Topic:

[

First

|

Previous

|

Next

|

Last

]

By Author:

[

First

|

Previous

|

Next

|

Last

]

Font:

Proportional Font

LISTSERV Archives

LISTSERV Archives

HPS-SVN Home

HPS-SVN Home

HPS-SVN  February 2016

HPS-SVN February 2016

Subject:

r4177 - /java/trunk/integration-tests/src/test/java/org/hps/test/it/ReconSteeringTest.java

From:

[log in to unmask]

Reply-To:

Notification of commits to the hps svn repository <[log in to unmask]>

Date:

Sat, 6 Feb 2016 00:35:05 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (134 lines)

Author: [log in to unmask]
Date: Fri Feb  5 16:35:04 2016
New Revision: 4177

Log:
Simplify recon test so it only runs the current steering file; use new LCIO test data; do not run DQM after recon (takes too much memory).

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

Modified: java/trunk/integration-tests/src/test/java/org/hps/test/it/ReconSteeringTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/test/it/ReconSteeringTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/test/it/ReconSteeringTest.java	Fri Feb  5 16:35:04 2016
@@ -1,100 +1,41 @@
 package org.hps.test.it;
 
 import java.io.File;
-import java.io.IOException;
-import java.net.URL;
 
 import junit.framework.TestCase;
 
 import org.hps.data.test.TestDataUtility;
 import org.hps.job.JobManager;
-import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.test.TestUtil.TestOutputFile;
 
 /**
- * Test that production MC recon steering files are not broken by running an LCSim job on them
- * using an LCIO file.
+ * Run a test job on Eng Run 2015 data.
  * 
  * @author Jeremy McCormick, SLAC
  */
 public class ReconSteeringTest extends TestCase {
     
-    /**
-     * List of steering files to run.
-     */
-    final static String[] STEERING_FILES = {
-        "EngineeringRun2014EcalRecon_Pass1.lcsim",
-        "EngineeringRun2014EcalRecon.lcsim",
-        "EngineeringRun2015EcalRecon.lcsim",
-        "EngineeringRun2015FullRecon.lcsim",
-        "EngineeringRun2015FullRecon_Pass2.lcsim",
-        "EngineeringRun2015HitRecon.lcsim",
-        "HPSTrackingDefaultsRecon.lcsim"
-    };
-            
-    /**
-     * Test recon steering files.
-     * @throws Exception if any error occurs running the recon job
-     */
-    public void testSteeringFiles() {
+    final static String STEERING_RESOURCE = "/org/hps/steering/recon/EngineeringRun2015FullRecon.lcsim";
+              
+    public void testReconSteering() throws Exception {
         
-        File inputFile = new TestDataUtility().getTestData("tritrigv1-egsv3-triv2-g4v1_s2d6_HPS-EngRun2015-Nominal-v3_3.4.0_pairs1_1.slcio");
-        
-        for (String steeringFile : STEERING_FILES) {
-            
-            // Run the reconstruction steering file.
-            File outputFile = null;
-            try {
-                outputFile = new TestOutputFile(new File(steeringFile).getName().replace(".lcsim", ""));
-                runSteering("/org/hps/steering/recon/" + steeringFile, inputFile, outputFile);
-            } catch (Throwable e) {
-                System.err.println("Job with steering " + steeringFile + " failed!");
-                throw new RuntimeException("Recon job failed.", e);
-            }
-            
-            Runtime runtime = Runtime.getRuntime();
-            
-            int mb = 1024 * 1024;
-            
-            System.out.println("total memory: " + runtime.totalMemory() / mb);
-            System.out.println("free memory: " + runtime.freeMemory() / mb);
-            System.out.println("max memory: " + runtime.maxMemory() / mb);
-            System.out.println("used memory: " + (runtime.totalMemory() - runtime.freeMemory()) / mb);
-            
-            System.gc();
-            
-            // Create DQM output for QA.
-            try {
-                runDQM(outputFile);
-            } catch (Throwable e) {
-                throw new RuntimeException("The DQM job failed.", e);
-            }
-        }
-    }
-       
-    private void runSteering(String steeringFile, File inputFile, File outputFile) {
-        System.out.println("Testing steering file " + steeringFile + " ...");
+        File inputFile = new TestDataUtility().getTestData("run_5772_data_only.slcio");
+                           
+        File outputFile = null;
+        outputFile = new TestOutputFile(new File(STEERING_RESOURCE).getName().replace(".lcsim", ""));
+        System.out.println("Testing steering " + STEERING_RESOURCE + " ...");
         JobManager job = new JobManager();
         job.addVariableDefinition("outputFile", outputFile.getPath());
-        job.addVariableDefinition("detector", "HPS-EngRun2015-Nominal-v3");
-        job.addVariableDefinition("run", "5772");
-        job.addVariableDefinition("isMC", "true");
         job.addInputFile(inputFile);
-        job.setup(steeringFile);
+        job.setup(STEERING_RESOURCE);
         job.run();
-        System.out.println("Job with steering " + steeringFile + " successfully processed " + job.getLCSimLoop().getTotalCountableConsumed() + " events.");
-    }
-    
-    private void runDQM(File outputFile) {
-        System.out.println("Running DQM on " + outputFile.getPath() + " ...");
-        JobManager job = new JobManager();
-        File inputFile = new File(outputFile.getPath() + ".slcio");
-        job.addInputFile(inputFile);
-        job.addVariableDefinition("outputFile", outputFile.getPath().replace(".slcio", ""));
-        job.setup("/org/hps/steering/production/DataQualityRecon.lcsim");
-        job.run();
-        System.out.println("DQM processed " + job.getLCSimLoop().getTotalCountableConsumed() + " events from " + outputFile + ".");
+        System.out.println("Done processing " + job.getLCSimLoop().getTotalCountableConsumed() + " events.");
+                            
+        Runtime runtime = Runtime.getRuntime();
+        int mb = 1024 * 1024; 
+        System.out.printf("total memory: %d mb\n", runtime.totalMemory() / mb); 
+        System.out.printf("free memory: %d mb\n", runtime.freeMemory() / mb);
+        System.out.printf("max memory: %d mb\n", runtime.maxMemory() / mb);
+        System.out.printf("used memory: %d mb\n", (runtime.totalMemory() - runtime.freeMemory()) / mb);
     }
 }
-
-

Top of Message | Previous Page | Permalink

Advanced Options


Options

Log In

Log In

Get Password

Get Password


Search Archives

Search Archives


Subscribe or Unsubscribe

Subscribe or Unsubscribe


Archives

November 2017
August 2017
July 2017
January 2017
December 2016
November 2016
October 2016
September 2016
August 2016
July 2016
June 2016
May 2016
April 2016
March 2016
February 2016
January 2016
December 2015
November 2015
October 2015
September 2015
August 2015
July 2015
June 2015
May 2015
April 2015
March 2015
February 2015
January 2015
December 2014
November 2014
October 2014
September 2014
August 2014
July 2014
June 2014
May 2014
April 2014
March 2014
February 2014
January 2014
December 2013
November 2013

ATOM RSS1 RSS2



LISTSERV.SLAC.STANFORD.EDU

Secured by F-Secure Anti-Virus CataList Email List Search Powered by the LISTSERV Email List Manager

Privacy Notice, Security Notice and Terms of Use