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  November 2014

HPS-SVN November 2014

Subject:

r1545 - /java/trunk/integration-tests/src/test/java/org/hps/

From:

[log in to unmask]

Reply-To:

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

Date:

Mon, 17 Nov 2014 21:41:56 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (479 lines)

Author: [log in to unmask]
Date: Mon Nov 17 13:41:52 2014
New Revision: 1545

Log:
Use new JobManager in integration-tests so conditions functions correctly.  Modify some tests so they run a sufficient number of events e.g. readout tests that need to generate triggers.

Modified:
    java/trunk/integration-tests/src/test/java/org/hps/DataQualityMonitorTest.java
    java/trunk/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java
    java/trunk/integration-tests/src/test/java/org/hps/MCFilteredReconTest.java
    java/trunk/integration-tests/src/test/java/org/hps/MockDataReconTest.java
    java/trunk/integration-tests/src/test/java/org/hps/ReadoutNoPileupTest.java
    java/trunk/integration-tests/src/test/java/org/hps/ReadoutToEvioTest.java
    java/trunk/integration-tests/src/test/java/org/hps/ReadoutToLcioTest.java
    java/trunk/integration-tests/src/test/java/org/hps/ReconClusterICTest.java
    java/trunk/integration-tests/src/test/java/org/hps/SimpleMCReconTest.java
    java/trunk/integration-tests/src/test/java/org/hps/SimpleSvtReadoutTest.java
    java/trunk/integration-tests/src/test/java/org/hps/TestRunEvioToLcioTest.java
    java/trunk/integration-tests/src/test/java/org/hps/TestRunReadoutToEvioTest.java

Modified: java/trunk/integration-tests/src/test/java/org/hps/DataQualityMonitorTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/DataQualityMonitorTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/DataQualityMonitorTest.java	Mon Nov 17 13:41:52 2014
@@ -3,8 +3,10 @@
 import java.io.File;
 import java.io.IOException;
 import java.net.URL;
+
 import junit.framework.TestCase;
-import org.lcsim.job.JobControlManager;
+
+import org.hps.job.JobManager;
 import org.lcsim.util.aida.AIDA;
 import org.lcsim.util.cache.FileCache;
 
@@ -51,7 +53,7 @@
             throw new RuntimeException(e);
         }
         System.out.println("running recon using steering resource " + steeringResource);
-        JobControlManager jobManager = new JobControlManager();
+        JobManager jobManager = new JobManager();
         jobManager.addVariableDefinition("outputFile", outputFile.getPath());
         jobManager.addInputFile(dataFile);
         jobManager.setup(steeringResource);

Modified: java/trunk/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java	Mon Nov 17 13:41:52 2014
@@ -6,10 +6,10 @@
 
 import junit.framework.TestCase;
 
+import org.hps.job.JobManager;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.ReconstructedParticle;
 import org.lcsim.event.Track;
-import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 import org.lcsim.util.cache.FileCache;
@@ -114,7 +114,7 @@
         }
 
         System.out.println("running recon using steering resource " + steeringResource);
-        JobControlManager jobManager = new JobControlManager();
+        JobManager jobManager = new JobManager();
         jobManager.addVariableDefinition("outputFile", outputFile.getPath());
         jobManager.addInputFile(mockDataFile);
         jobManager.setup(steeringResource);

Modified: java/trunk/integration-tests/src/test/java/org/hps/MCFilteredReconTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/MCFilteredReconTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/MCFilteredReconTest.java	Mon Nov 17 13:41:52 2014
@@ -7,9 +7,9 @@
 
 import junit.framework.TestCase;
 
+import org.hps.job.JobManager;
 import org.hps.readout.ecal.FADCEcalReadoutDriver;
 import org.hps.users.meeg.FilterMCBunches;
-import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.test.TestUtil.TestOutputFile;
@@ -63,7 +63,7 @@
         System.out.print("Created filtered MC file " + filteredOutputFile.getPath());
                 
         // 2) Run readout simulation.
-        JobControlManager job = new JobControlManager();        
+        JobManager job = new JobManager();        
         File readoutOutputFile = new TestOutputFile(this.getClass().getSimpleName() + File.separator + this.getClass().getSimpleName() + "_readout");
         job.addVariableDefinition("outputFile", readoutOutputFile.getPath());
         job.addInputFile(filteredOutputFile);
@@ -79,7 +79,7 @@
                 
         // 3) Run readout events through reconstruction.
         File reconOutputFile = new TestOutputFile(this.getClass().getSimpleName() + File.separator + this.getClass().getSimpleName() + "_recon");
-        job = new JobControlManager();
+        job = new JobManager();
         job.addVariableDefinition("outputFile", reconOutputFile.getPath());
         job.addInputFile(new File(readoutOutputFile.getPath() + ".slcio"));
         job.setup("/org/hps/steering/recon/HPS2014OfflineTruthRecon.lcsim");

Modified: java/trunk/integration-tests/src/test/java/org/hps/MockDataReconTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/MockDataReconTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/MockDataReconTest.java	Mon Nov 17 13:41:52 2014
@@ -6,13 +6,13 @@
 
 import junit.framework.TestCase;
 
+import org.hps.job.JobManager;
 import org.hps.users.jeremym.MockDataChallengeDiagnosticDriver;
 import org.lcsim.event.Cluster;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.ReconstructedParticle;
 import org.lcsim.event.Track;
 import org.lcsim.job.AidaSaveDriver;
-import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 import org.lcsim.util.cache.FileCache;
@@ -91,7 +91,7 @@
         }
 
         System.out.println("running recon using steering resource " + steeringResource);
-        JobControlManager jobManager = new JobControlManager();
+        JobManager jobManager = new JobManager();
         jobManager.addVariableDefinition("outputFile", outputFile.getPath());
         jobManager.addInputFile(mockDataFile);
         jobManager.setup(steeringResource);

Modified: java/trunk/integration-tests/src/test/java/org/hps/ReadoutNoPileupTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/ReadoutNoPileupTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/ReadoutNoPileupTest.java	Mon Nov 17 13:41:52 2014
@@ -3,11 +3,11 @@
 import java.io.File;
 import java.net.URL;
 
-import org.lcsim.job.JobControlManager;
+import junit.framework.TestCase;
+
+import org.hps.job.JobManager;
 import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.test.TestUtil.TestOutputFile;
-
-import junit.framework.TestCase;
 /**
  * <p>
  * This test runs the readout simulation on MC events without simulated pile-up and writes LCIO.
@@ -34,7 +34,7 @@
         FileCache cache = new FileCache();
         File inputFile = cache.getCachedFile(new URL("http://www.lcsim.org/test/hps-java/ReadoutNoPileupTest.slcio"));
         
-        JobControlManager job = new JobControlManager();
+        JobManager job = new JobManager();
         job.addInputFile(inputFile);
         File outputFile = new TestOutputFile(this.getClass().getSimpleName() + File.separator + this.getClass().getSimpleName() + "_readout");
         job.addVariableDefinition("outputFile", outputFile.getPath());

Modified: java/trunk/integration-tests/src/test/java/org/hps/ReadoutToEvioTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/ReadoutToEvioTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/ReadoutToEvioTest.java	Mon Nov 17 13:41:52 2014
@@ -5,7 +5,7 @@
 
 import junit.framework.TestCase;
 
-import org.lcsim.job.JobControlManager;
+import org.hps.job.JobManager;
 import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.test.TestUtil.TestOutputFile;
 
@@ -23,7 +23,7 @@
  */
 public class ReadoutToEvioTest extends TestCase {
     
-    static final int nEvents = 100;
+    static final int nEvents = 10000;
     
     public void testReadoutToEvio() throws Exception {
         new TestOutputFile(this.getClass().getSimpleName()).mkdir();
@@ -31,7 +31,7 @@
         FileCache cache = new FileCache();
         File inputFile = cache.getCachedFile(new URL("http://www.lcsim.org/test/hps-java/ReadoutToEvioTest.slcio"));
         
-        JobControlManager job = new JobControlManager();
+        JobManager job = new JobManager();
         job.addInputFile(inputFile);
         File outputFile = new TestOutputFile(this.getClass().getSimpleName() + File.separator + this.getClass().getSimpleName() + "_readout");
         job.addVariableDefinition("outputFile", outputFile.getPath());

Modified: java/trunk/integration-tests/src/test/java/org/hps/ReadoutToLcioTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/ReadoutToLcioTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/ReadoutToLcioTest.java	Mon Nov 17 13:41:52 2014
@@ -3,11 +3,11 @@
 import java.io.File;
 import java.net.URL;
 
-import org.lcsim.job.JobControlManager;
+import junit.framework.TestCase;
+
+import org.hps.job.JobManager;
 import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.test.TestUtil.TestOutputFile;
-
-import junit.framework.TestCase;
 
 /**
  * <p>
@@ -23,7 +23,7 @@
  */
 public class ReadoutToLcioTest extends TestCase {
     
-    static final int nEvents = 100;
+    static final int nEvents = 10000;
     
     public void testReadoutToLcio() throws Exception {
         
@@ -32,7 +32,7 @@
         FileCache cache = new FileCache();
         File inputFile = cache.getCachedFile(new URL("http://www.lcsim.org/test/hps-java/ReadoutToLcioTest.slcio"));
         
-        JobControlManager job = new JobControlManager();
+        JobManager job = new JobManager();
         job.addInputFile(inputFile);
         File outputFile = new TestOutputFile(this.getClass().getSimpleName() + File.separator + this.getClass().getSimpleName());
         job.addVariableDefinition("outputFile", outputFile.getPath());

Modified: java/trunk/integration-tests/src/test/java/org/hps/ReconClusterICTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/ReconClusterICTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/ReconClusterICTest.java	Mon Nov 17 13:41:52 2014
@@ -6,13 +6,13 @@
 
 import junit.framework.TestCase;
 
+import org.hps.job.JobManager;
 import org.hps.users.jeremym.MockDataChallengeDiagnosticDriver;
 import org.lcsim.event.Cluster;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.ReconstructedParticle;
 import org.lcsim.event.Track;
 import org.lcsim.job.AidaSaveDriver;
-import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.aida.AIDA;
 import org.lcsim.util.cache.FileCache;
@@ -27,7 +27,6 @@
 public class ReconClusterICTest extends TestCase {
 
     static final String fileLocation = "http://www.lcsim.org/test/hps-java/MockDataReconTest.slcio";
-    //static final String mockDataUrl = "http://www.slac.stanford.edu/~meeg/hps2/meeg/mock_data/tritrig-beam-tri_1-10_readout.slcio";
     
     static final String className = MockDataReconTest.class.getSimpleName();
     static final File outputDir = new File("./target/test-output/" + className);
@@ -35,16 +34,7 @@
     static final File reconFile = new File(outputFile.getAbsolutePath() + ".slcio");
     static final File aidaFile = new File(outputFile.getAbsolutePath() + ".aida");    
 
-    static final String steeringResource = "/org/hps/steering/users/holly/MockReconClusterICTest.lcsim";
-    
-    // TODO: Get some values for these and add test assertions!
-    /*
-    static final int expectedReconstructedParticles = 0;
-    static final int expectedClusters = 0;
-    static final int expectedTracks = 0;
-    static final int expectedCalorimeterHits = 0;
-    static final int expectedMCParticles = 0;
-    */
+    static final String steeringResource = "/org/hps/steering/users/holly/MockReconClusterICTest.lcsim";    
 
     static final String clusterCollectionName = "EcalClusters";
     static final String reconstructedParticleCollectionName = "FinalStateParticles";
@@ -73,9 +63,6 @@
 
         // Create the plots.
         createPlots();
-
-        // Check the statistics of the plots.
-        //checkPlots();
     }
 
     private void runRecon() {
@@ -92,17 +79,18 @@
         }
 
         System.out.println("running recon using steering resource " + steeringResource);
-        JobControlManager jobManager = new JobControlManager();
+        JobManager jobManager = new JobManager();
         jobManager.addVariableDefinition("outputFile", outputFile.getPath());
         jobManager.addInputFile(mockDataFile);
         jobManager.setup(steeringResource);
+        jobManager.setNumberOfEvents(100);
         jobManager.run();
     }
 
     private void createPlots() {
         LCSimLoop loop = new LCSimLoop();
         loop.add(new MockDataChallengeDiagnosticDriver());
-        loop.add(new CheckDriver());
+        loop.add(new ReconSummaryDriver());
         AidaSaveDriver aidaSaveDriver = new AidaSaveDriver();
         aidaSaveDriver.setOutputFileName(aidaFile.getAbsolutePath());
         loop.add(aidaSaveDriver);        
@@ -113,45 +101,8 @@
             e.printStackTrace();
         }
     }
-
-    /*
-    private void checkPlots() {
-
-        IHistogram1D reconParticleCountPlot = aida.histogram1D("/" + reconstructedParticleCollectionName + "/Item Count");
-        System.out.println("reconParticleCount sumBinHeights = " + reconParticleCountPlot.sumBinHeights());
-        System.out.println("reconParticleCount mean = " + reconParticleCountPlot.mean());
-        System.out.println("reconParticleCount itemCount = " + computeItemCount(reconParticleCountPlot));
-
-        IHistogram1D trackCountPlot = aida.histogram1D("/" + trackCollectionName + "/Item Count");
-        System.out.println("trackCount Plot sumBinHeights = " + trackCountPlot.sumBinHeights());
-        System.out.println("trackCount itemCount = " + computeItemCount(trackCountPlot));
-        //assertEquals("Wrong number of tracks counted.", expectedTracks, computeItemCount(trackCountPlot));         
-    }
-     */
-    
-    /**
-     * Compute an item count based on a histogram with bins of size 1.
-     * @param histogram
-     * @return
-     */
-    /*
-    private int computeItemCount(IHistogram1D histogram) {
-        if (histogram.axis().binUpperEdge(0) - histogram.axis().binLowerEdge(0) != 1.0)
-            throw new IllegalArgumentException("The bins are the wrong size for this method.");
-        if (!histogram.title().equals("Item Count"))
-            throw new IllegalArgumentException("The histogram doesn't appear to contain item counts.");
-        int nbins = histogram.axis().bins();
-        double total = 0;
-        for (int i = 0; i < nbins; i++) {
-            total += histogram.binHeight(i) * histogram.axis().binLowerEdge(i);
-        }
-        if (total % 1 != 0)
-            throw new RuntimeException("Nonsensical number of items computed: " + total);
-        return (int)total;
-    }
-    */
-    
-    static class CheckDriver extends Driver {
+       
+    static class ReconSummaryDriver extends Driver {
         
         int ntracks;
         int nparticles;

Modified: java/trunk/integration-tests/src/test/java/org/hps/SimpleMCReconTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/SimpleMCReconTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/SimpleMCReconTest.java	Mon Nov 17 13:41:52 2014
@@ -6,6 +6,7 @@
 
 import junit.framework.TestCase;
 
+import org.hps.job.JobManager;
 import org.lcsim.event.CalorimeterHit;
 import org.lcsim.event.Cluster;
 import org.lcsim.event.EventHeader;
@@ -13,7 +14,6 @@
 import org.lcsim.event.SimCalorimeterHit;
 import org.lcsim.event.Track;
 import org.lcsim.event.TrackerHit;
-import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.loop.LCSimLoop;
@@ -31,7 +31,7 @@
         File inputFile = cache.getCachedFile(new URL("http://www.lcsim.org/test/hps-java/SimpleMCReconTest.slcio"));
 		
         // Run the reconstruction.
-		JobControlManager job = new JobControlManager();
+		JobManager job = new JobManager();
         File outputFile = new TestOutputFile(this.getClass().getSimpleName() + File.separator + this.getClass().getSimpleName() + "_recon");
         job.addVariableDefinition("outputFile", outputFile.getPath());
         job.addInputFile(inputFile);

Modified: java/trunk/integration-tests/src/test/java/org/hps/SimpleSvtReadoutTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/SimpleSvtReadoutTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/SimpleSvtReadoutTest.java	Mon Nov 17 13:41:52 2014
@@ -4,13 +4,13 @@
 import java.net.URL;
 import java.util.List;
 
+import junit.framework.TestCase;
+
+import org.hps.job.JobManager;
 import org.lcsim.event.EventHeader;
 import org.lcsim.event.RawTrackerHit;
-import org.lcsim.job.JobControlManager;
 import org.lcsim.util.Driver;
 import org.lcsim.util.cache.FileCache;
-
-import junit.framework.TestCase;
 
 
 /**
@@ -44,13 +44,12 @@
         
         FinalCheckDriver checker = new FinalCheckDriver();
         
-        JobControlManager job = new JobControlManager();
+        JobManager job = new JobManager();
         job.addInputFile(inputFile);
         job.addVariableDefinition("outputFile", outputFile.getPath());
-        job.setup("/org/hps/steering/readout/HPS2014TruthReadoutToLcio.lcsim");
+        job.setup("/org/hps/steering/readout/HPS2014TruthReadoutToLcio.lcsim");        
+        job.getLCSimLoop().add(checker);
         job.setNumberOfEvents(10000);
-        job.getLCSimLoop().add(checker);
-        job.setNumberOfEvents(1000);
         job.run();
         
         this.printDebug("=========== Summary ===========");

Modified: java/trunk/integration-tests/src/test/java/org/hps/TestRunEvioToLcioTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/TestRunEvioToLcioTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/TestRunEvioToLcioTest.java	Mon Nov 17 13:41:52 2014
@@ -31,7 +31,7 @@
                 "outputFile=" + new TestOutputFile("TestRunEvioToLcioTest").getPath(),
                 inputFile.getPath(),
                 "-n",
-                "100"
+                "1000"
         };
         System.out.println("Running TestRunEvioToLcio.main ...");
         EvioToLcio.main(args);

Modified: java/trunk/integration-tests/src/test/java/org/hps/TestRunReadoutToEvioTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/TestRunReadoutToEvioTest.java	(original)
+++ java/trunk/integration-tests/src/test/java/org/hps/TestRunReadoutToEvioTest.java	Mon Nov 17 13:41:52 2014
@@ -5,7 +5,8 @@
 
 import junit.framework.TestCase;
 
-import org.lcsim.job.JobControlManager;
+import org.hps.conditions.database.DatabaseConditionsManager;
+import org.hps.job.JobManager;
 import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.test.TestUtil.TestOutputFile;
 
@@ -18,7 +19,7 @@
  */
 public class TestRunReadoutToEvioTest extends TestCase {
     
-    static final int nEvents = 100;
+    static final int nEvents = 10000;
     
     public void testTestRunReadoutToEvio() throws Exception {
         
@@ -27,7 +28,10 @@
         FileCache cache = new FileCache();
         File inputFile = cache.getCachedFile(new URL("http://www.lcsim.org/test/hps-java/TestRunReadoutToEvioTest.slcio"));
         
-        JobControlManager job = new JobControlManager();
+        JobManager job = new JobManager();
+        DatabaseConditionsManager conditionsManager = DatabaseConditionsManager.getInstance();
+        DatabaseConditionsManager.getInstance().setDetector("HPS-TestRun-v5", 1351);
+        conditionsManager.freeze();
         job.addInputFile(inputFile);
         File outputFile = new TestOutputFile(this.getClass().getSimpleName() + File.separator + this.getClass().getSimpleName());
         job.addVariableDefinition("outputFile", outputFile.getPath());

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