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);
}
}
-
-
|