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:

r1439 - in /java/trunk/evio: pom.xml src/test/ src/test/java/ src/test/java/org/ src/test/java/org/hps/ src/test/java/org/hps/evio/ src/test/java/org/hps/evio/LCSimEngRunEventBuilderTest.java

From:

[log in to unmask]

Reply-To:

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

Date:

Wed, 5 Nov 2014 15:25:44 -0000

Content-Type:

text/plain

Parts/Attachments:

Parts/Attachments

text/plain (126 lines)

Author: [log in to unmask]
Date: Wed Nov  5 07:25:41 2014
New Revision: 1439

Log:
Test case for Engineering Run EVIO to LCIO (currently not working).

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

Modified: java/trunk/evio/pom.xml
 =============================================================================
--- java/trunk/evio/pom.xml	(original)
+++ java/trunk/evio/pom.xml	Wed Nov  5 07:25:41 2014
@@ -28,6 +28,16 @@
     </dependencies>
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-surefire-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>org/hps/evio/LCSimEngRunEventBuilderTest.java</exclude>
+                    </excludes>
+                    <trimStackTrace>true</trimStackTrace>
+                </configuration>
+            </plugin>
             <plugin>
                 <artifactId>maven-resources-plugin</artifactId>
                 <executions>
@@ -106,4 +116,4 @@
             </plugin>
         </plugins>
     </build>
-</project>
+</project>

Added: java/trunk/evio/src/test/java/org/hps/evio/LCSimEngRunEventBuilderTest.java
 =============================================================================
--- java/trunk/evio/src/test/java/org/hps/evio/LCSimEngRunEventBuilderTest.java	(added)
+++ java/trunk/evio/src/test/java/org/hps/evio/LCSimEngRunEventBuilderTest.java	Wed Nov  5 07:25:41 2014
@@ -0,0 +1,75 @@
+package org.hps.evio;
+
+import java.io.File;
+import java.io.IOException;
+import java.net.URL;
+
+import junit.framework.TestCase;
+
+import org.hps.conditions.DatabaseConditionsManager;
+import org.jlab.coda.jevio.EvioEvent;
+import org.jlab.coda.jevio.EvioReader;
+import org.lcsim.event.EventHeader;
+import org.lcsim.lcio.LCIOWriter;
+import org.lcsim.util.cache.FileCache;
+import org.lcsim.util.test.TestUtil.TestOutputFile;
+
+/**
+ * Test conversion of EVIO to LCIO for Engineering Run EVIO data.
+ * This is ECAL data only for now.
+ * @author Jeremy McCormick <[log in to unmask]>
+ */
+public class LCSimEngRunEventBuilderTest extends TestCase {
+		
+	public void testLCSimEngRunEventBuilder() throws Exception {
+	
+		// Setup database conditions.
+		DatabaseConditionsManager conditionsManager = new DatabaseConditionsManager();
+		conditionsManager.setConnectionResource("/org/hps/conditions/config/conditions_dev.properties");
+		conditionsManager.configure("/org/hps/conditions/config/conditions_dev.xml");
+		conditionsManager.register();
+		conditionsManager.setDetector("HPS-Proposal2014-v8-6pt6", 0);
+		
+		// Configure LCIO writer.
+		new TestOutputFile(getClass().getSimpleName()).mkdirs();
+		File lcioFile = new TestOutputFile(getClass().getSimpleName() + File.separator + getClass().getSimpleName() + "_output");
+        LCIOWriter writer;
+		try {
+            writer = new LCIOWriter(lcioFile);
+        } catch (IOException e) {
+            throw new RuntimeException(e);
+        }
+		
+		// Create event builder.
+		LCSimEventBuilder builder = new LCSimEngRunEventBuilder();
+		
+		// Get remote test file.
+		FileCache cache = new FileCache();
+		File evioFile = cache.getCachedFile(new URL("http://www.lcsim.org/test/hps-java/LCSimEngRunEventBuilderTest/hps_002744.evio.0"));
+
+		// Open the EVIO reader.
+        System.out.println("Opening file " + evioFile);
+        EvioReader reader = null;
+        try {
+            reader = new EvioReader(evioFile);
+        } catch (Exception e) {
+            throw new RuntimeException(e);
+        }
+        
+        // Run the event builder on the EVIO.
+        EvioEvent evioEvent = null;
+        while ((evioEvent = reader.nextEvent()) != null) {
+        	reader.parseEvent(evioEvent);
+    		builder.readEvioEvent(evioEvent);
+        	if (builder.isPhysicsEvent(evioEvent)) {
+        		EventHeader lcsimEvent = builder.makeLCSimEvent(evioEvent);
+        		System.out.println("created LCSim event #" + lcsimEvent.getEventNumber());
+        		writer.write(lcsimEvent);
+        	}
+        }
+        
+        // Close the LCIO writer.
+        writer.flush();
+        writer.close();
+	}
+}

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