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

HPS-SVN December 2014

Subject:

r1693 - in /java/trunk/integration-tests: ./ src/test/java/org/hps/ src/test/resources/org/hps/steering/test/

From:

[log in to unmask]

Reply-To:

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

Date:

Thu, 11 Dec 2014 19:34:53 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (290 lines)

Author: phansson
Date: Thu Dec 11 11:34:48 2014
New Revision: 1693

Log:
Add 2014 detector track recon test.

Added:
    java/trunk/integration-tests/src/test/java/org/hps/HPSTracker2014GeometryTrackReconTest.java
    java/trunk/integration-tests/src/test/resources/org/hps/steering/test/HPSTestRunTrackingDefaults.lcsim
      - copied unchanged from r1658, java/trunk/integration-tests/src/test/resources/org/hps/steering/test/SVTTrackingRecon.lcsim
    java/trunk/integration-tests/src/test/resources/org/hps/steering/test/HPSTrackingDefaults.lcsim
Removed:
    java/trunk/integration-tests/src/test/resources/org/hps/steering/test/SVTTrackingRecon.lcsim
Modified:
    java/trunk/integration-tests/pom.xml
    java/trunk/integration-tests/src/test/java/org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java

Modified: java/trunk/integration-tests/pom.xml
 =============================================================================
--- java/trunk/integration-tests/pom.xml	(original)
+++ java/trunk/integration-tests/pom.xml	Thu Dec 11 11:34:48 2014
@@ -31,6 +31,7 @@
                         <exclude>org/hps/EtSystemTest.java</exclude>
                         <exclude>org/hps/DataQualityMonitorTest.java</exclude>
                         <exclude>org/hps/HPSTestRunTracker2014GeometryTrackReconTest.java</exclude>
+                        <exclude>org/hps/HPSTracker2014GeometryTrackReconTest.java</exclude>
                         <exclude>org/hps/MCFilteredReconTest.java</exclude>
                         <exclude>org/hps/ReadoutToEvioTest.java</exclude>
                         <exclude>org/hps/ReadoutToLcioTest.java</exclude>

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	Thu Dec 11 11:34:48 2014
@@ -24,23 +24,14 @@
 
     static final String fileLocationBottom = "http://www.lcsim.org/test/hps-java/HPSTestRunTracker2014GeometryTrackerRecon-bottom.slcio";
     static final String fileLocationTop = "http://www.lcsim.org/test/hps-java/HPSTestRunTracker2014GeometryTrackerRecon-top.slcio";
-    //static final String fileLocationBottom = "http://www.lcsim.org/test/hps-java/mu-_10GeV_SLIC-v04-00-00_Geant4-v10-00-02_QGSP_BERT_HPSTestRunTracker2014-v0-50-bottom-tracks.slcio";
-    //static final String fileLocationTop = "http://www.lcsim.org/test/hps-java/mu-_10GeV_SLIC-v04-00-00_Geant4-v10-00-02_QGSP_BERT_HPSTestRunTracker2014-v0-50-top-tracks.slcio";
-    //static final String fileLocationBottom = "http://www.lcsim.org/test/hps-java/HPSTestRunTracker2014GeometryTrackerRecon-bottom.slcio";
-    //static final String fileLocationTop = "http://www.lcsim.org/test/hps-java/HPSTestRunTracker2014GeometryTrackerRecon-bottom.slcio";
-    //static final String fileLocationBottom = "http://www.slac.stanford.edu/~phansson/files/temp/mu-_10GeV_SLIC-v04-00-00_Geant4-v10-00-02_QGSP_BERT_HPSTestRunTracker2014-v0-50-bottom-tracks.slcio";
-    //static final String fileLocationTop = "http://www.slac.stanford.edu/~phansson/files/temp/mu-_10GeV_SLIC-v04-00-00_Geant4-v10-00-02_QGSP_BERT_HPSTestRunTracker2014-v0-50-top-tracks.slcio";
-    //static final String fileLocation = "/Users/phansson/work/HPS/software/run/geomDev/mu-_10GeV_SLIC-v04-00-00_Geant4-v10-00-02_QGSP_BERT_HPSTestRunTracker2014-v0.slcio";
-    //static final String fileLocation = "http://www.lcsim.org/test/hps-java/MockDataReconTest.slcio";
-    
+   
     static final String className = HPSTestRunTracker2014GeometryTrackReconTest.class.getSimpleName();
     static final File outputDir = new File("./target/test-output/" + className);
     static final File outputFile = new File(outputDir.getAbsolutePath() + File.separator + className);
     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/test/SVTTrackingRecon.lcsim";
-    //static final String steeringResource = "/org/hps/steering/readout/HPSTrackingDefaults.lcsim";
+    static final String steeringResource = "/org/hps/steering/test/HPSTestRunTrackingDefaults.lcsim";
     
     static final int expectedTracks = 50;
    

Added: java/trunk/integration-tests/src/test/java/org/hps/HPSTracker2014GeometryTrackReconTest.java
 =============================================================================
--- java/trunk/integration-tests/src/test/java/org/hps/HPSTracker2014GeometryTrackReconTest.java	(added)
+++ java/trunk/integration-tests/src/test/java/org/hps/HPSTracker2014GeometryTrackReconTest.java	Thu Dec 11 11:34:48 2014
@@ -0,0 +1,156 @@
+package org.hps;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+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.util.Driver;
+import org.lcsim.util.aida.AIDA;
+import org.lcsim.util.cache.FileCache;
+import org.lcsim.util.loop.LCSimLoop;
+
+/**
+ * This test runs the standard reconstruction on a small set of input events.
+ * 
+ * @author Per Hansson Adrian <[log in to unmask]>
+ */
+public class HPSTracker2014GeometryTrackReconTest extends TestCase {
+
+    static final String fileLocationBottom = "http://www.lcsim.org/test/hps-java/mu-_10GeV_SLIC-v04-00-00_Geant4-v10-00-02_QGSP_BERT_HPSTracker2014-v0-bot-50k.slcio";
+    static final String fileLocationTop = "http://www.lcsim.org/test/hps-java/mu-_10GeV_SLIC-v04-00-00_Geant4-v10-00-02_QGSP_BERT_HPSTracker2014-v0-top-50k.slcio";
+    
+    static final String className = HPSTracker2014GeometryTrackReconTest.class.getSimpleName();
+    static final File outputDir = new File("./target/test-output/" + className);
+    static final File outputFile = new File(outputDir.getAbsolutePath() + File.separator + className);
+    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/test//HPSTrackingDefaults.lcsim";
+    
+    static final int expectedTracks = 50;
+   
+    static final String reconstructedParticleCollectionName = "MCParticle";
+    static final String trackCollectionName = "MatchedTracks";
+
+    AIDA aida = AIDA.defaultInstance();
+
+    public void setUp() {
+        clear();
+    }
+    
+    private void clear() {
+        // Delete files if they already exist.
+        if (reconFile.exists())
+            reconFile.delete();
+        if (aidaFile.exists())
+            aidaFile.delete();
+        
+        // Create output dir.
+        outputDir.mkdirs();
+        if (!outputDir.exists()) {
+            throw new RuntimeException("Failed to create test output dir.");
+        }
+    }
+
+    public void testTrackRecon() {
+        runTrackReconBottom();
+        checkOutput();
+        //checkPlots();
+        runTrackReconTop();
+        checkOutput();
+        //checkPlots();
+        
+    }
+    
+    private void runTrackReconBottom() {
+        
+        //setup dirs and files
+        clear();
+        
+        // Run the reconstruction over input events.
+        runRecon(fileLocationBottom);
+    
+    }
+    
+    private void runTrackReconTop() {
+        
+        //setup dirs and files
+        clear();
+        
+        // Run the reconstruction over input events.
+        runRecon(fileLocationTop);
+    
+    }
+    
+    
+
+    private void runRecon(String fileLoc) {
+        
+        System.out.println("caching file ...");
+        System.out.println(fileLoc);
+        
+        File mockDataFile = null;
+        //File mockDataFile = new File(fileLocation);
+        try {
+            FileCache cache = new FileCache();
+            mockDataFile = cache.getCachedFile(new URL(fileLoc));
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+
+        System.out.println("running recon using steering resource " + steeringResource);
+        JobManager jobManager = new JobManager();
+        jobManager.addVariableDefinition("outputFile", outputFile.getPath());
+        jobManager.addInputFile(mockDataFile);
+        jobManager.setup(steeringResource);
+        jobManager.run();
+    }
+
+    private void checkOutput() {
+        System.out.println("check output file ...");
+         LCSimLoop loop = new LCSimLoop();
+        loop.add(new CheckDriver());
+        try {
+            loop.setLCIORecordSource(reconFile);
+            loop.loop(-1);
+        } catch (IOException e) {
+            e.printStackTrace();
+        }
+    }
+
+    
+    static class CheckDriver extends Driver {
+        int ntracks;
+        int nparticles;
+        int nevents;
+        
+        public void process(EventHeader event) {
+            ++nevents;
+            ntracks += event.get(Track.class, trackCollectionName).size(); 
+            nparticles += event.get(ReconstructedParticle.class, reconstructedParticleCollectionName).size();
+        }
+        
+        public void endOfData() {
+            System.out.println("CheckDriver got the following ...");
+            System.out.println("  nevents = " + nevents);
+            System.out.println("  ntracks = " + ntracks);
+            System.out.println("  nparticles = " + nparticles);
+            System.out.println("  <ntracks / nevents> = " + ((double)ntracks / (double)nevents));
+            System.out.println("  <nparticles / nevents> = " + ((double)nparticles / (double)nevents));
+
+            // check that there is one track per event
+            assertTrue("Failed to find expected number of tracks.",Math.abs(((double)ntracks / (double)nevents) - 1) < 0.000001);
+            
+            System.out.println("CheckDriver compare to following ...");
+            
+            
+        }
+        
+    }
+}

Added: java/trunk/integration-tests/src/test/resources/org/hps/steering/test/HPSTrackingDefaults.lcsim
 =============================================================================
--- java/trunk/integration-tests/src/test/resources/org/hps/steering/test/HPSTrackingDefaults.lcsim	(added)
+++ java/trunk/integration-tests/src/test/resources/org/hps/steering/test/HPSTrackingDefaults.lcsim	Thu Dec 11 11:34:48 2014
@@ -0,0 +1,60 @@
+
+<lcsim xmlns:xs="http://www.w3.org/2001/XMLSchema-instance" 
+       xs:noNamespaceSchemaLocation="http://www.lcsim.org/schemas/lcsim/1.0/lcsim.xsd">
+    <control>
+        <printInputFiles>false</printInputFiles>
+        <printDriversDetailed>false</printDriversDetailed>
+    </control>
+    <execute>
+        <driver name="EventMarkerDriver"/>   
+        <driver name="SvtSensorSetup" />
+        <driver name="TrackerDigiDriver"/>
+        <driver name="HelicalTrackHitDriver"/>
+        <driver name="TrackerReconDriver"/>
+<!--
+        <driver name="SVTEventInfo"/>
+        <driver name="SVTHitReconstructionPlots"/>
+        <driver name="TrackingReconstructionPlots"/>
+-->    
+        <driver name="LCIOWriter"/>
+    </execute>
+    <drivers>
+        <driver name="EventMarkerDriver" type="org.lcsim.job.EventMarkerDriver">
+            <eventInterval>1</eventInterval>
+        </driver>
+        <driver name="SvtSensorSetup" type="org.hps.recon.tracking.SvtSensorSetup" />
+        <driver name="TrackerDigiDriver" type="org.hps.recon.tracking.SimpleTrackerDigiDriver">
+<!--            <dropBadChannels>true</dropBadChannels>-->
+            <debug>false</debug>
+        </driver>
+        <driver name="HelicalTrackHitDriver" type="org.hps.recon.tracking.HelicalTrackHitDriver">
+            <debug>false</debug>
+            <maxSeperation>20.0</maxSeperation>
+            <tolerance>1.0</tolerance>
+        </driver>
+        <driver name="TrackerReconDriver" type="org.hps.recon.tracking.TrackerReconDriver">
+            <debug>false</debug>
+            <strategyResource>HPS-Full-All.xml</strategyResource>
+        </driver>
+        <driver name="LCIOWriter" type="org.lcsim.util.loop.LCIODriver">
+            <outputFilePath>${outputFile}</outputFilePath>
+        </driver>
+        
+        
+        
+        
+        <driver name="TrackingReconstructionPlots" type="org.hps.monitoring.drivers.svt.TrackingReconstructionPlots">
+            <outputPlots>TrackingReconstructionPlots.aida</outputPlots>
+        </driver>
+
+        <driver name="SVTHitReconstructionPlots" type="org.hps.monitoring.drivers.svt.SVTHitReconstructionPlots">
+            <outputPlots>SVTHitReconstructionPlots.aida</outputPlots>
+        </driver>
+        
+        <driver name="SVTEventInfo" type="org.hps.monitoring.drivers.svt.SVTEventInfo">
+        </driver>
+        
+        
+        
+    </drivers>
+</lcsim>

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