46 modified files
lcsim/src/org/lcsim/util/lcio
diff -u -r1.9 -r1.10
--- LCIOWriter.java 9 Oct 2007 22:56:22 -0000 1.9
+++ LCIOWriter.java 17 Oct 2007 02:06:23 -0000 1.10
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIOWriter;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIOWriter;
import java.io.File;
import java.io.FileOutputStream;
import java.io.IOException;
@@ -16,12 +16,15 @@
import org.lcsim.event.EventHeader.LCMetaData;
/**
- * A class for writing out LCIO files
+ * A class for writing out LCIO files.
* The LCIO writer maintains a list of collections to ignore, and also a list of collections
* to write out. If the list of collections to write out is not empty then all collections
* are written out except those in the ignore list. If the list of collections to write out
* is not empty, then only the specified collections are written out (and the ignore list is
* ignored).
+ * <p>
+ * Collections for which the <code>LCIOConstants.BITTransient</code> bit is set in the meta-data
+ * are never written out.
* @author Tony Johnson
*/
public class LCIOWriter
@@ -33,6 +36,7 @@
private String lastDetectorName = "";
private Set<String> ignore = new HashSet<String>();
private Set<String> only = new HashSet<String>();
+ private File file;
/**
* Create a writer for writing LCIO files
@@ -40,7 +44,8 @@
*/
public LCIOWriter(File file) throws IOException
{
- writer = new SIOWriter(new FileOutputStream(file));
+ this.file = file;
+ reOpen();
}
/**
* Create a writer for writing LCIO files
@@ -48,7 +53,7 @@
*/
public LCIOWriter(String file) throws IOException
{
- writer = new SIOWriter(new FileOutputStream(file));
+ this(new File(file));
}
/**
* Create a writer for writing LCIO files
@@ -125,8 +130,19 @@
public void close() throws IOException
{
writer.close();
+ writer = null;
+ }
+ public void flush() throws IOException
+ {
+ writer.flush();
+ }
+ public void reOpen() throws IOException
+ {
+ if (writer == null)
+ {
+ writer = new SIOWriter(new FileOutputStream(file));
+ }
}
-
private void writeData(EventHeader event, boolean headerOnly) throws IOException
{
if (headerOnly)
@@ -142,7 +158,8 @@
for (List<Object> collection : collections)
{
LCMetaData md = event.getMetaData(collection);
- if (!only.isEmpty() && !only.contains(md.getName())) continue;
+ if (LCIOUtil.bitTest(md.getFlags(),LCIOConstants.BITTransient)) continue;
+ else if (!only.isEmpty() && !only.contains(md.getName())) continue;
else if (ignore.contains(md.getName())) continue;
else
{
@@ -160,13 +177,8 @@
out.writeInt(blocks.size());
for (Map.Entry<String,String> entry : blocks.entrySet() )
{
- if (!only.isEmpty() && !only.contains(entry.getKey())) continue;
- else if (ignore.contains(entry.getKey())) continue;
- else
- {
- out.writeString(entry.getKey());
- out.writeString(entry.getValue());
- }
+ out.writeString(entry.getKey());
+ out.writeString(entry.getValue());
}
out.writeInt(0);
out.writeInt(0);
@@ -179,7 +191,9 @@
for (List<Object> collection : collections)
{
LCMetaData md = event.getMetaData(collection);
- if (!only.isEmpty() && !only.contains(md.getName())) continue;
+
+ if (LCIOUtil.bitTest(md.getFlags(),LCIOConstants.BITTransient)) continue;
+ else if (!only.isEmpty() && !only.contains(md.getName())) continue;
else if (ignore.contains(md.getName())) continue;
else
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.4 -r1.5
--- SIOCalorimeterHitBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.4
+++ SIOCalorimeterHitBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.5
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.CalorimeterHit;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.1 -r1.2
--- SIOTrackerHit.java 22 Feb 2005 06:37:42 -0000 1.1
+++ SIOTrackerHit.java 17 Oct 2007 02:06:23 -0000 1.2
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import java.io.IOException;
import java.util.ArrayList;
@@ -12,7 +12,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOTrackerHit.java,v 1.1 2005/02/22 06:37:42 tonyj Exp $
+ * @version $Id: SIOTrackerHit.java,v 1.2 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOTrackerHit implements TrackerHit
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.6 -r1.7
--- SIOReconstructedParticle.java 18 Sep 2007 03:46:26 -0000 1.6
+++ SIOReconstructedParticle.java 17 Oct 2007 02:06:23 -0000 1.7
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.BasicHepLorentzVector;
import hep.physics.vec.Hep3Vector;
@@ -21,7 +21,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOReconstructedParticle.java,v 1.6 2007/09/18 03:46:26 tonyj Exp $
+ * @version $Id: SIOReconstructedParticle.java,v 1.7 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOReconstructedParticle extends BaseReconstructedParticle
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.4 -r1.5
--- LCIOEvent.java 26 Jul 2005 14:44:35 -0000 1.4
+++ LCIOEvent.java 17 Oct 2007 02:06:23 -0000 1.5
@@ -1,6 +1,6 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
+import hep.io.sio.SIOInputStream;
import java.util.HashMap;
import java.util.Map;
import org.lcsim.util.event.BaseLCSimEvent;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.4 -r1.5
--- SIORawTrackerHit.java 30 May 2007 19:34:26 -0000 1.4
+++ SIORawTrackerHit.java 17 Oct 2007 02:06:23 -0000 1.5
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
@@ -13,7 +13,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIORawTrackerHit.java,v 1.4 2007/05/30 19:34:26 tonyj Exp $
+ * @version $Id: SIORawTrackerHit.java,v 1.5 2007/10/17 02:06:23 tonyj Exp $
*/
class SIORawTrackerHit extends BaseRawTrackerHit
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIOGenericObjectBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.3
+++ SIOGenericObjectBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.GenericObject;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.1 -r1.2
--- SIOTrackerData.java 4 Jun 2007 06:50:39 -0000 1.1
+++ SIOTrackerData.java 17 Oct 2007 02:06:23 -0000 1.2
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.TrackerData;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.8 -r1.9
--- SIOCalorimeterHit.java 17 Aug 2007 23:56:55 -0000 1.8
+++ SIOCalorimeterHit.java 17 Oct 2007 02:06:23 -0000 1.9
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.CalorimeterHit;
@@ -12,7 +12,7 @@
* SIO-based I/O implementation of the CalorimeterHit interface
*
* @author Guilherme Lima
- * @version $Id: SIOCalorimeterHit.java,v 1.8 2007/08/17 23:56:55 jeremy Exp $
+ * @version $Id: SIOCalorimeterHit.java,v 1.9 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOCalorimeterHit extends BaseCalorimeterHit
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.5 -r1.6
--- LCIOReader.java 9 Oct 2007 22:56:22 -0000 1.5
+++ LCIOReader.java 17 Oct 2007 02:06:23 -0000 1.6
@@ -1,9 +1,9 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOBlock;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOReader;
-import hep.lcd.io.sio.SIORecord;
+import hep.io.sio.SIOBlock;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOReader;
+import hep.io.sio.SIORecord;
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIOTPCHitBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.3
+++ SIOTPCHitBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.TPCHit;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.11 -r1.12
--- SIOSimTrackerHit.java 24 May 2007 18:14:32 -0000 1.11
+++ SIOSimTrackerHit.java 17 Oct 2007 02:06:23 -0000 1.12
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
import hep.physics.vec.VecOp;
@@ -20,7 +20,7 @@
/**
* @author Tony Johnson
- * @version $Id: SIOSimTrackerHit.java,v 1.11 2007/05/24 18:14:32 jeremy Exp $
+ * @version $Id: SIOSimTrackerHit.java,v 1.12 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOSimTrackerHit implements SimTrackerHit
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIOTrackerHitBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.3
+++ SIOTrackerHitBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.SimTrackerHit;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.5 -r1.6
--- SIOSimCalorimeterHitBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.5
+++ SIOSimCalorimeterHitBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.6
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.EventHeader.LCMetaData;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.6 -r1.7
--- SIOSimTrackerHitBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.6
+++ SIOSimTrackerHitBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.7
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.2 -r1.3
--- SIOTrackerPulseBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.2
+++ SIOTrackerPulseBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.3
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.TrackerPulse;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.1 -r1.2
--- SIOTPCHit.java 22 Feb 2005 06:37:42 -0000 1.1
+++ SIOTPCHit.java 17 Oct 2007 02:06:23 -0000 1.2
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.TPCHit;
@@ -10,7 +10,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOTPCHit.java,v 1.1 2005/02/22 06:37:42 tonyj Exp $
+ * @version $Id: SIOTPCHit.java,v 1.2 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOTPCHit implements TPCHit
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.2 -r1.3
--- SIOSiliconTrackerHitBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.2
+++ SIOSiliconTrackerHitBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.3
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.SiliconTrackerHit;
import org.lcsim.recon.tracking.digitization.SiliconRawHit;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.8 -r1.9
--- AbstractBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.8
+++ AbstractBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.9
@@ -1,9 +1,9 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOBlock;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIOWriter;
+import hep.io.sio.SIOBlock;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIOWriter;
import java.io.IOException;
import java.util.List;
import java.util.Map;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIORawCalorimeterHitBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.3
+++ SIORawCalorimeterHitBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.RawCalorimeterHit;
@@ -10,7 +10,7 @@
* Block handler for raw calorimeter hits.
*
* @author Guilherme Lima
- * @version $Id: SIORawCalorimeterHitBlockHandler.java,v 1.3 2007/10/09 22:56:22 tonyj Exp $
+ * @version $Id: SIORawCalorimeterHitBlockHandler.java,v 1.4 2007/10/17 02:06:23 tonyj Exp $
*/
class SIORawCalorimeterHitBlockHandler extends AbstractBlockHandler
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.1 -r1.2
--- SIOTrackerPulse.java 4 Jun 2007 06:50:39 -0000 1.1
+++ SIOTrackerPulse.java 17 Oct 2007 02:06:23 -0000 1.2
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import java.io.IOException;
import org.lcsim.event.TrackerData;
import org.lcsim.event.TrackerPulse;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIOClusterBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.3
+++ SIOClusterBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.Cluster;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.1 -r1.2
--- SIOReferencesBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.1
+++ SIOReferencesBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.2
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import java.io.IOException;
import java.util.ListIterator;
import org.lcsim.event.MCParticle;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.10 -r1.11
--- SIOMCParticle.java 27 Jul 2007 19:22:22 -0000 1.10
+++ SIOMCParticle.java 17 Oct 2007 02:06:23 -0000 1.11
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import hep.physics.particle.properties.ParticlePropertyManager;
import hep.physics.particle.properties.ParticleType;
import hep.physics.particle.properties.UnknownParticleIDException;
@@ -20,7 +20,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOMCParticle.java,v 1.10 2007/07/27 19:22:22 tonyj Exp $
+ * @version $Id: SIOMCParticle.java,v 1.11 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOMCParticle implements MCParticle
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.6 -r1.7
--- SIOCluster.java 9 Jul 2006 12:59:05 -0000 1.6
+++ SIOCluster.java 17 Oct 2007 02:06:23 -0000 1.7
@@ -6,9 +6,9 @@
import java.util.Set;
import java.util.HashSet;
import java.util.Collections;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import org.lcsim.event.CalorimeterHit;
import org.lcsim.event.Cluster;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.6 -r1.7
--- SIOGenericObject.java 9 Oct 2007 22:56:22 -0000 1.6
+++ SIOGenericObject.java 17 Oct 2007 02:06:23 -0000 1.7
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import org.lcsim.event.GenericObject;
import java.io.IOException;
@@ -9,7 +9,7 @@
/**
*
* @author gaede
- * @version $Id: SIOGenericObject.java,v 1.6 2007/10/09 22:56:22 tonyj Exp $
+ * @version $Id: SIOGenericObject.java,v 1.7 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOGenericObject implements GenericObject
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.1 -r1.2
--- SIOParticleID.java 30 Jun 2005 23:21:09 -0000 1.1
+++ SIOParticleID.java 17 Oct 2007 02:06:23 -0000 1.2
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.ParticleID;
@@ -9,7 +9,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOParticleID.java,v 1.1 2005/06/30 23:21:09 tonyj Exp $
+ * @version $Id: SIOParticleID.java,v 1.2 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOParticleID implements ParticleID
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIOReconstructedParticleBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.3
+++ SIOReconstructedParticleBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.ReconstructedParticle;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIOLCRelationBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.3
+++ SIOLCRelationBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.LCRelation;
@@ -10,7 +10,7 @@
* Block handler for relation objects.
*
* @author Guilherme Lima
- * @version $Id: SIOLCRelationBlockHandler.java,v 1.3 2007/10/09 22:56:22 tonyj Exp $
+ * @version $Id: SIOLCRelationBlockHandler.java,v 1.4 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOLCRelationBlockHandler extends AbstractBlockHandler
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.6 -r1.7
--- SIOSimCalorimeterHit.java 9 Feb 2006 21:15:06 -0000 1.6
+++ SIOSimCalorimeterHit.java 17 Oct 2007 02:06:23 -0000 1.7
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import java.io.IOException;
import org.lcsim.event.EventHeader.LCMetaData;
@@ -14,7 +14,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOSimCalorimeterHit.java,v 1.6 2006/02/09 21:15:06 lima Exp $
+ * @version $Id: SIOSimCalorimeterHit.java,v 1.7 2007/10/17 02:06:23 tonyj Exp $
*/
public class SIOSimCalorimeterHit extends BaseCalorimeterHit implements SimCalorimeterHit
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.2 -r1.3
--- SIOTrackerDataBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.2
+++ SIOTrackerDataBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.3
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.TrackerData;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.2 -r1.3
--- SIOVertexBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.2
+++ SIOVertexBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.3
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIOWriter;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIOWriter;
import java.io.IOException;
import java.util.ArrayList;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.2 -r1.3
--- SIORawTrackerHitBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.2
+++ SIORawTrackerHitBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.3
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.EventHeader.LCMetaData;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.5 -r1.6
--- SIOMCParticleBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.5
+++ SIOMCParticleBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.6
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.MCParticle;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIOLCRelation.java 3 May 2005 02:04:41 -0000 1.3
+++ SIOLCRelation.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import java.io.IOException;
import org.lcsim.event.LCRelation;
@@ -11,7 +11,7 @@
* SIO-based I/O implementation of the LCRelation interface
*
* @author Guilherme Lima
- * @version $Id: SIOLCRelation.java,v 1.3 2005/05/03 02:04:41 tonyj Exp $
+ * @version $Id: SIOLCRelation.java,v 1.4 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOLCRelation implements LCRelation
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- SIOLCParameters.java 26 Aug 2005 00:26:56 -0000 1.3
+++ SIOLCParameters.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import java.util.HashMap;
@@ -12,7 +12,7 @@
/**
*
* @author Frank Gaede
- * @version $Id: SIOLCParameters.java,v 1.3 2005/08/26 00:26:56 tonyj Exp $
+ * @version $Id: SIOLCParameters.java,v 1.4 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOLCParameters
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.1 -r1.2
--- SIOSiliconTrackerHit.java 19 Jun 2006 19:04:09 -0000 1.1
+++ SIOSiliconTrackerHit.java 17 Oct 2007 02:06:23 -0000 1.2
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.SiliconTrackerHit;
import org.lcsim.event.TPCHit;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.2 -r1.3
--- SIOVertex.java 25 Sep 2007 21:49:44 -0000 1.2
+++ SIOVertex.java 17 Oct 2007 02:06:23 -0000 1.3
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import hep.physics.matrix.SymmetricMatrix;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
@@ -18,7 +18,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOVertex.java,v 1.2 2007/09/25 21:49:44 tonyj Exp $
+ * @version $Id: SIOVertex.java,v 1.3 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOVertex extends BaseVertex
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.4 -r1.5
--- SIOTrack.java 11 Sep 2007 18:18:04 -0000 1.4
+++ SIOTrack.java 17 Oct 2007 02:06:23 -0000 1.5
@@ -1,8 +1,8 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
-import hep.lcd.io.sio.SIORef;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
+import hep.io.sio.SIORef;
import hep.physics.matrix.SymmetricMatrix;
import java.io.IOException;
@@ -17,7 +17,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOTrack.java,v 1.4 2007/09/11 18:18:04 tonyj Exp $
+ * @version $Id: SIOTrack.java,v 1.5 2007/10/17 02:06:23 tonyj Exp $
*/
class SIOTrack extends BaseTrack
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.2 -r1.3
--- SIORawCalorimeterHit.java 28 Apr 2005 23:27:26 -0000 1.2
+++ SIORawCalorimeterHit.java 17 Oct 2007 02:06:23 -0000 1.3
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import java.io.IOException;
import org.lcsim.event.RawCalorimeterHit;
@@ -10,7 +10,7 @@
* SIO-based I/O implementation of the RawCalorimeterHit interface
*
* @author Guilherme Lima
- * @version $Id: SIORawCalorimeterHit.java,v 1.2 2005/04/28 23:27:26 tonyj Exp $
+ * @version $Id: SIORawCalorimeterHit.java,v 1.3 2007/10/17 02:06:23 tonyj Exp $
*/
class SIORawCalorimeterHit implements RawCalorimeterHit
{
lcsim/src/org/lcsim/util/lcio
diff -u -r1.3 -r1.4
--- LCIOBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.3
+++ LCIOBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.4
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOBlock;
-import hep.lcd.io.sio.SIOWriter;
+import hep.io.sio.SIOBlock;
+import hep.io.sio.SIOWriter;
import java.io.IOException;
import java.util.List;
import org.lcsim.event.EventHeader.LCMetaData;
lcsim/src/org/lcsim/util/lcio
diff -u -r1.4 -r1.5
--- SIOTrackBlockHandler.java 9 Oct 2007 22:56:22 -0000 1.4
+++ SIOTrackBlockHandler.java 17 Oct 2007 02:06:23 -0000 1.5
@@ -1,7 +1,7 @@
package org.lcsim.util.lcio;
-import hep.lcd.io.sio.SIOInputStream;
-import hep.lcd.io.sio.SIOOutputStream;
+import hep.io.sio.SIOInputStream;
+import hep.io.sio.SIOOutputStream;
import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
lcsim/src/org/lcsim/util/loop
diff -u -r1.2 -r1.3
--- StdhepDriver.java 27 Mar 2007 17:14:29 -0000 1.2
+++ StdhepDriver.java 17 Oct 2007 02:06:25 -0000 1.3
@@ -81,4 +81,17 @@
throw new RuntimeException("Error closing Stdhep file",x);
}
}
+
+ protected void suspend()
+ {
+// We can't do this yet, the flush method is not in the current version of stdhep/MCFIO
+// try
+// {
+// writer.flush();
+// }
+// catch (IOException x)
+// {
+// throw new RuntimeException("Error flushing Stdhep file",x);
+// }
+ }
}
\ No newline at end of file
lcsim/src/org/lcsim/util/loop
diff -u -r1.7 -r1.8
--- LCIODriver.java 30 Apr 2007 23:58:54 -0000 1.7
+++ LCIODriver.java 17 Oct 2007 02:06:25 -0000 1.8
@@ -9,43 +9,71 @@
import org.lcsim.util.lcio.LCIOWriter;
/**
- * A driver for writing out LCIO events.
+ * A driver for writing out LCIO events.
+ * By default this will write out the entire event, but you can control
+ * what is written out by accessing embedded LCIOWriter, for example
+ * <pre>
+ * lcioDriver.getWriter().addWriteOnly("PFAReconstructedParticles");
+ * </pre>
+ * See the LCIOWriter documentation for more info
* @author tonyj
+ * @see org.lcsim.util.lcio.LCIOWriter
*/
public class LCIODriver extends Driver
{
private LCIOWriter writer;
- private String file;
- private Collection<String> listIgnore;
public LCIODriver(String file)
{
- this.file = file;
+ this(file,null);
}
public LCIODriver(File file)
{
- this.file = file.getAbsolutePath();
+ this(file,null);
}
public LCIODriver(String file, Collection<String> listIgnore)
{
- this.file = file;
- this.listIgnore = listIgnore;
-
+ this(new File(file),listIgnore);
}
public LCIODriver(File file, Collection<String> listIgnore)
{
- this.file = file.getAbsolutePath();
- this.listIgnore = listIgnore;
+ try
+ {
+ this.writer = new LCIOWriter(file,listIgnore == null ? Collections.EMPTY_SET : listIgnore);
+ }
+ catch (IOException x)
+ {
+ throw new RuntimeException("Error opening LCIO file",x);
+ }
+ }
+ public LCIODriver(LCIOWriter writer)
+ {
+ this.writer = writer;
+ }
+ public LCIOWriter getWriter()
+ {
+ return writer;
}
protected void startOfData()
{
try
{
- writer = new LCIOWriter(file,listIgnore == null ? Collections.EMPTY_SET : listIgnore);
+ writer.reOpen();
}
catch (IOException x)
{
- throw new RuntimeException("Error opening LCIO file",x);
+ throw new RuntimeException("Error rewinding LCIO file",x);
+ }
+ }
+ protected void endOfData()
+ {
+ try
+ {
+ writer.close();
+ }
+ catch (IOException x)
+ {
+ throw new RuntimeException("Error rewinding LCIO file",x);
}
}
protected void process(EventHeader event)
@@ -60,15 +88,15 @@
}
}
- protected void endOfData()
+ protected void suspend()
{
try
{
- writer.close();
+ writer.flush();
}
catch (IOException x)
{
- throw new RuntimeException("Error closing LCIO file",x);
+ throw new RuntimeException("Error flushing LCIO file",x);
}
}
}
lcsim/test/org/lcsim
diff -u -r1.1 -r1.2
--- LCIOReconReadTest.java 14 Sep 2007 23:06:50 -0000 1.1
+++ LCIOReconReadTest.java 17 Oct 2007 02:06:25 -0000 1.2
@@ -11,7 +11,9 @@
import org.lcsim.event.Track;
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;
/**
* @author tonyj
@@ -38,6 +40,9 @@
LCSimLoop loop = new LCSimLoop();
loop.setLCIORecordSource(file);
loop.add(new ReadDriver());
+ LCIODriver lcio = new LCIODriver(new TestOutputFile("reconOnly.slcio"));
+ lcio.getWriter().addWriteOnly("PFAReconstructedParticles");
+ loop.add(lcio);
loop.loop(1, null);
loop.dispose();
}
lcsim
diff -u -r1.63 -r1.64
--- project.xml 4 Oct 2007 22:02:07 -0000 1.63
+++ project.xml 17 Oct 2007 02:06:25 -0000 1.64
@@ -68,7 +68,7 @@
<groupId>net.java.dev</groupId>
<artifactId>truezip</artifactId>
<version>6.6</version>
- <url>https://truezip.dev.java.net</url>
+ <url>https://truezip.dev.java.net</url>
</dependency>
<dependency>
<groupId>freehep</groupId>
@@ -77,12 +77,12 @@
<url>http://java.freehep.org</url>
</dependency>
<dependency>
- <groupId>freehep</groupId>
+ <groupId>org.freehep</groupId>
<artifactId>freehep-physics</artifactId>
<version>2.1</version>
<url>http://java.freehep.org</url>
<properties>
- <jas3.bundle>true</jas3.bundle>
+ <jas3.bundle>true</jas3.bundle>
</properties>
</dependency>
<dependency>
@@ -98,12 +98,12 @@
<url>http://java.freehep.org</url>
</dependency>
<dependency>
- <groupId>lcd</groupId>
- <artifactId>sio</artifactId>
- <version>1.0</version>
+ <groupId>org.freehep</groupId>
+ <artifactId>freehep-sio</artifactId>
+ <version>2.0</version>
<url>http://java.freehep.org</url>
<properties>
- <jas3.bundle>true</jas3.bundle>
+ <jas3.bundle>true</jas3.bundle>
</properties>
</dependency>
<dependency>
@@ -112,7 +112,7 @@
<version>1.1</version>
<url>http://www.lcsim.org</url>
<properties>
- <jas3.bundle>true</jas3.bundle>
+ <jas3.bundle>true</jas3.bundle>
</properties>
</dependency>
<dependency>
@@ -133,7 +133,7 @@
<version>1.0</version>
<type>jar</type>
<properties>
- <jas3.bundle>true</jas3.bundle>
+ <jas3.bundle>true</jas3.bundle>
</properties>
</dependency>
<dependency>
@@ -142,7 +142,7 @@
<version>2.7.1</version>
<url>http://xerces.apache.org/</url>
<properties>
- <jas3.bundle>true</jas3.bundle>
+ <jas3.bundle>true</jas3.bundle>
</properties>
</dependency>
</dependencies>
@@ -150,53 +150,48 @@
<sourceDirectory>src</sourceDirectory>
<sourceModifications>
<sourceModification>
- <className>fakeClass</className>
- <excludes>
- <exclude>org/lcsim/plugin/web/**</exclude>
- </excludes>
+ <className>fakeClass</className>
+ <excludes>
+ <exclude>org/lcsim/plugin/web/**</exclude>
+ </excludes>
</sourceModification>
</sourceModifications>
<unitTestSourceDirectory>test</unitTestSourceDirectory>
<resources>
<resource>
- <directory>resources</directory>
- <includes>
- <include>**/**</include>
- </includes>
+ <directory>resources</directory>
+ <includes>
+ <include>**/**</include>
+ </includes>
</resource>
<resource>
- <directory>src</directory>
- <includes>
- <include>org/lcsim/plugin/web/examples/*.java</include>
- </includes>
+ <directory>src</directory>
+ <includes>
+ <include>org/lcsim/plugin/web/examples/*.java</include>
+ </includes>
</resource>
<resource>
- <directory>src</directory>
- <includes>
- <include>**/*.pdf</include>
- <include>**/doc-files/**</include>
- </includes>
+ <directory>src</directory>
+ <includes>
+ <include>**/*.pdf</include>
+ <include>**/doc-files/**</include>
+ </includes>
</resource>
</resources>
<unitTest>
- <resources>
- <directory>testResources</directory>
- <includes>
- <include>**/**</include>
- </includes>
- </resources>
<excludes>
- <!-- Exclude slow tests. -->
- <exclude>org/lcsim/detector/driver/SimTrackerHitIdentifierTest.java</exclude>
- <exclude>org/lcsim/detector/driver/RawTrackerHitReadoutDriverTest.java</exclude>
- <exclude>org/lcsim/detector/driver/SimTrackerHitPositionalReadoutDriverTest.java</exclude>
- <exclude>org/lcsim/detector/driver/SimTrackerHitIdentifierReadoutDriverTest.java</exclude>
- <exclude>org/lcsim/NonTrivialPFASingleEventTest.java</exclude>
+ <!-- Exclude slow tests. -->
+ <exclude>org/lcsim/detector/driver/SimTrackerHitIdentifierTest.java</exclude>
+ <exclude>org/lcsim/detector/driver/RawTrackerHitReadoutDriverTest.java</exclude>
+ <exclude>org/lcsim/detector/driver/SimTrackerHitPositionalReadoutDriverTest.java</exclude>
+ <exclude>org/lcsim/detector/driver/SimTrackerHitIdentifierReadoutDriverTest.java</exclude>
+ <exclude>org/lcsim/NonTrivialPFASingleEventTest.java</exclude>
<exclude>org/lcsim/conditions/DetectorLocator_Test.java</exclude>
<!-- Exclude broken stuff -->
<exclude>org/lcsim/detector/driver/DetectorIdHelperTest.java</exclude>
- <exclude>org/lcsim/detector/driver/NewSimTrackerDigitizationTest.java</exclude>
+ <exclude>org/lcsim/detector/driver/NewSimTrackerDigitizationTest.java</exclude>
</excludes>
</unitTest>
</build>
</project>
+
CVSspam 0.2.8