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  March 2015

HPS-SVN March 2015

Subject:

r2526 - in /java/trunk/evio: pom.xml src/test/java/org/hps/evio/EpicsScalarDataTest.java

From:

[log in to unmask]

Reply-To:

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

Date:

Tue, 24 Mar 2015 22:23:27 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (103 lines)

Author: [log in to unmask]
Date: Tue Mar 24 15:23:22 2015
New Revision: 2526

Log:
Use file cache to make test portable.

Modified:
    java/trunk/evio/pom.xml
    java/trunk/evio/src/test/java/org/hps/evio/EpicsScalarDataTest.java

Modified: java/trunk/evio/pom.xml
 =============================================================================
--- java/trunk/evio/pom.xml	(original)
+++ java/trunk/evio/pom.xml	Tue Mar 24 15:23:22 2015
@@ -35,7 +35,6 @@
                         <exclude>org/hps/evio/LCSimEngRunEventBuilderTest.java</exclude>
                         <exclude>org/hps/evio/SvtEvioReaderTest.java</exclude>
                         <exclude>org/hps/evio/TestRunSvtEvioReaderTest.java</exclude>
-                        <exclude>org/hps/evio/EpicsScalarDataTest.java</exclude>
                     </excludes>
                     <trimStackTrace>true</trimStackTrace>
                 </configuration>

Modified: java/trunk/evio/src/test/java/org/hps/evio/EpicsScalarDataTest.java
 =============================================================================
--- java/trunk/evio/src/test/java/org/hps/evio/EpicsScalarDataTest.java	(original)
+++ java/trunk/evio/src/test/java/org/hps/evio/EpicsScalarDataTest.java	Tue Mar 24 15:23:22 2015
@@ -2,6 +2,7 @@
 
 import java.io.File;
 import java.io.IOException;
+import java.net.URL;
 
 import junit.framework.TestCase;
 
@@ -16,34 +17,50 @@
 import org.hps.record.evio.EvioDetectorConditionsProcessor;
 import org.lcsim.event.EventHeader;
 import org.lcsim.util.Driver;
+import org.lcsim.util.cache.FileCache;
 import org.lcsim.util.loop.LCIODriver;
 import org.lcsim.util.loop.LCSimLoop;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
 
+/**
+ * Test of reading EPICs scalar data from EVIO and writing it out to LCIO.
+ * 
+ * @author Jeremy McCormick <[log in to unmask]>
+ */
 public class EpicsScalarDataTest extends TestCase {
     
+    static final String TEST_FILE_URL = "http://www.lcsim.org/test/hps-java/ScalarsTest/hpsecal_004469_1000_events.evio.0";
+        
     public void test() throws IOException {
         
+        // Cache input data file.
+        FileCache cache = new FileCache();
+        File inputFile = cache.getCachedFile(new URL(TEST_FILE_URL));
+        
+        // Setup conditions and event building.
         DatabaseConditionsManager manager = new DatabaseConditionsManager();
         LCSimEventBuilder builder = new LCSimEngRunEventBuilder();
         manager.addConditionsListener(builder);
         
+        // Setup and run the loop to write out LCIO events with the EPICS scalar data.
         CompositeLoopConfiguration configuration = new CompositeLoopConfiguration();
         configuration.add(new EpicsEvioProcessor());
         configuration.setDataSourceType(DataSourceType.EVIO_FILE);
-        //configuration.setFilePath("/u1/data/hps/eng_run/hps_004385.evio.0");
         configuration.add(new EvioDetectorConditionsProcessor("HPS-ECalCommissioning-v2"));
         configuration.setLCSimEventBuilder(builder);
-        configuration.setFilePath("/work/data/hps/engrun/hps_004385.evio.0");
+        configuration.setFilePath(inputFile.getPath());
         configuration.setProcessingStage(ProcessingStage.LCIO);
         configuration.setStopOnEndRun(false);
         configuration.setStopOnErrors(false);
-        configuration.add(new LCIODriver("EpicsScalarDataTest"));        
+        File outputFile = new TestOutputFile("EpicsScalarDataTest.slcio");
+        configuration.add(new LCIODriver(outputFile.getPath()));        
         CompositeLoop loop = new CompositeLoop();
         loop.setConfiguration(configuration);        
-        loop.loop(100);                
+        loop.loop(100);
         
+        // Read back and print out the scalar data.
         LCSimLoop readLoop = new LCSimLoop();
-        readLoop.setLCIORecordSource(new File("EpicsScalarDataTest.slcio"));
+        readLoop.setLCIORecordSource(outputFile);
         readLoop.add(new Driver() {
             public void process(EventHeader event) {                
                 EpicsScalarData data = EpicsScalarData.read(event);
@@ -52,8 +69,7 @@
                     System.out.println(data.toString());
                 }                   
             }
-        });
-        
+        });        
         readLoop.loop(-1);
     }
 

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