Commit in lcio on v01-07-vtx |
build.xml | +26 | -2 | 1.21 -> 1.21.4.1 |
src/java/hep/lcio/implementation/sio/SIOVertex.java | +73 | -64 | 1.1.2.3 -> 1.1.2.4 |
/SIOEvent.java | +3 | -9 | 1.41.2.2 -> 1.41.2.3 |
| +102 | -75 | |
3 modified files
lcio
diff -u -r1.21 -r1.21.4.1
--- build.xml 24 Apr 2006 22:08:33 -0000 1.21
+++ build.xml 7 Dec 2006 18:52:49 -0000 1.21.4.1
@@ -5,7 +5,7 @@
<!-- this file is used for FreeHEP and WIRED -->
<!-- -->
<!-- Author: Mark Donszelmann -->
-<!-- Version: $Id: build.xml,v 1.21 2006/04/24 22:08:33 jeremy Exp $ -->
+<!-- Version: $Id: build.xml,v 1.21.4.1 2006/12/07 18:52:49 tonyj Exp $ -->
<!-- -->
<!-- ======================================================================= -->
@@ -87,6 +87,9 @@
file="config/version.template"
tofile="${jar.dir}/${projectname}-version.txt"
/>
+ <condition property="isJDK1.4">
+ <equals arg1="${ant.java.version}" arg2="1.4"/>
+ </condition>
</target>
<target name="init.jar" depends="init">
@@ -378,7 +381,8 @@
<freehep.defined property="src.dir" target="compile.ok"/>
</target>
- <target name="compile.ok">
+ <target name="compile.ok" depends="compile.15,compile.14"/>
+ <target name="compile.15" unless="isJDK1.4">
<echo message=" Building module '${projectname}-${jar}'"/>
<freehep.javac srcdir="${src.dir}"
@@ -394,6 +398,26 @@
</freehep.javac>
</target>
+ <target name="compile.14" if="isJDK1.4">
+ <echo message=" Building module '${projectname}-${jar}'"/>
+
+ <echo message="*******************************************"/>
+ <echo message="* Skipping hep.lcio.util because JDK 1.4 *"/>
+ <echo message="*******************************************"/>
+
+ <freehep.javac srcdir="${src.dir}"
+ destdir="${src.dir}"
+ classpath="${exp.classpath};${classpath}"
+ debug="${debug}"
+ deprecation="${deprecation}"
+ optimize="${optimization}"
+ packages="${packages}"
+ excludepackages="hep.lcio.util"
+ includes="${compile.includes}"
+ excludes="${compile.excludes}">
+ </freehep.javac>
+
+ </target>
<!-- =================================================================== -->
<!-- Creates the rmi stubs and skeletons -->
lcio/src/java/hep/lcio/implementation/sio
diff -u -r1.1.2.3 -r1.1.2.4
--- SIOVertex.java 11 Sep 2006 13:05:39 -0000 1.1.2.3
+++ SIOVertex.java 7 Dec 2006 18:52:49 -0000 1.1.2.4
@@ -2,6 +2,7 @@
import hep.lcd.io.sio.SIOInputStream;
import hep.lcd.io.sio.SIOOutputStream;
+import hep.lcd.io.sio.SIORef;
import hep.lcio.event.Vertex;
import hep.lcio.event.ReconstructedParticle;
import hep.lcio.implementation.event.IVertex;
@@ -11,69 +12,77 @@
import java.io.IOException;
/**
-* @author engels
-*/
+ * @author engels
+ */
-class SIOVertex extends IVertex{
- public SIOVertex(SIOInputStream in, SIOEvent owner, String[] keys, int major, int minor) throws IOException{
- this.primary = in.readInt();
-
- //dbg
- //int t=in.readInt();
- //this.type = keys[t];
- //System.out.println("Reading... (int)["+t+"] (string)["+type+"]");
-
- this.type = keys[in.readInt()];
- this.chi2 = in.readFloat();
- this.probability = in.readFloat();
- for (int i=0; i<3; i++) this.position[i] = in.readFloat();
- for (int i=0; i<6; i++) this.covMatrix[i] = in.readFloat();
- int n = in.readInt();
- this.parameters = new float[n];
- for (int i=0; i<n; i++) this.parameters[i] = in.readInt();
- this.aRecP = (ReconstructedParticle) in.readPntr().getObject();
- in.readPTag(this);
- }
- static void write(Vertex v, SIOOutputStream out, TreeMap keys) throws IOException{
- if (v instanceof SIOVertex){
- ((SIOVertex) v).write(out, keys);
- }
- else{
- out.writeInt(v.isPrimary()?1:0);
- int at=(Integer)keys.get(v.getAlgorithmType());
- out.writeInt(at);
- //int[] at=(int[])keys.get(v.getAlgorithmType());
- //out.writeInt(at[0]);
-
- //dbg
- //System.out.println("Writing... (string)["+v.getAlgorithmType()+"] (int)["+at+"]");
-
- out.writeFloat(v.getChi2());
- out.writeFloat(v.getProbability());
- float[] pos = v.getPosition();
- for (int i=0; i<3; i++) out.writeFloat(pos[i]);
- float[] matrix = v.getCovMatrix();
- for (int i=0; i<6; i++) out.writeFloat(matrix[i]);
- float[] pars = v.getParameters();
- int n = (pars == null ? 0 : pars.length);
- out.writeInt(n);
- for (int i=0; i<n; i++) out.writeFloat(pars[i]);
- out.writePntr(v.getAssociatedParticle());
- out.writePTag(v);
- }
- }
- private void write(SIOOutputStream out, TreeMap keys) throws IOException{
- out.writeInt(primary);
- int at=(Integer)keys.get(type);
- out.writeInt(at);
- out.writeFloat(chi2);
- out.writeFloat(probability);
- for (int i=0; i<3; i++) out.writeFloat(position[i]);
- for (int i=0; i<6; i++) out.writeFloat(covMatrix[i]);
- int n = parameters == null ? 0 : parameters.length;
- out.writeInt(n);
- for (int i=0; i<n; i++) out.writeFloat(parameters[i]);
- out.writePntr(aRecP);
- out.writePTag(this);
- }
+class SIOVertex extends IVertex
+{
+ private SIORef recPRef;
+
+ public SIOVertex(SIOInputStream in, SIOEvent owner, String[] keys, int major, int minor) throws IOException
+ {
+ this.primary = in.readInt();
+
+ this.type = keys[in.readInt()];
+ this.chi2 = in.readFloat();
+ this.probability = in.readFloat();
+ for (int i=0; i<3; i++) this.position[i] = in.readFloat();
+ for (int i=0; i<6; i++) this.covMatrix[i] = in.readFloat();
+ int n = in.readInt();
+ this.parameters = new float[n];
+ for (int i=0; i<n; i++) this.parameters[i] = in.readInt();
+ this.recPRef = in.readPntr();
+ in.readPTag(this);
+ }
+ static void write(Vertex v, SIOOutputStream out, TreeMap keys) throws IOException
+ {
+ if (v instanceof SIOVertex)
+ {
+ ((SIOVertex) v).write(out, keys);
+ }
+ else
+ {
+ out.writeInt(v.isPrimary()?1:0);
+ int at= ((Integer) keys.get(v.getAlgorithmType())).intValue();
+ out.writeInt(at);
+
+ out.writeFloat(v.getChi2());
+ out.writeFloat(v.getProbability());
+ float[] pos = v.getPosition();
+ for (int i=0; i<3; i++) out.writeFloat(pos[i]);
+ float[] matrix = v.getCovMatrix();
+ for (int i=0; i<6; i++) out.writeFloat(matrix[i]);
+ float[] pars = v.getParameters();
+ int n = (pars == null ? 0 : pars.length);
+ out.writeInt(n);
+ for (int i=0; i<n; i++) out.writeFloat(pars[i]);
+ out.writePntr(v.getAssociatedParticle());
+ out.writePTag(v);
+ }
+ }
+ private void write(SIOOutputStream out, TreeMap keys) throws IOException
+ {
+ out.writeInt(primary);
+ int at = ((Integer) keys.get(type)).intValue();
+ out.writeInt(at);
+ out.writeFloat(chi2);
+ out.writeFloat(probability);
+ for (int i=0; i<3; i++) out.writeFloat(position[i]);
+ for (int i=0; i<6; i++) out.writeFloat(covMatrix[i]);
+ int n = parameters == null ? 0 : parameters.length;
+ out.writeInt(n);
+ for (int i=0; i<n; i++) out.writeFloat(parameters[i]);
+ out.writePntr(aRecP);
+ out.writePTag(this);
+ }
+
+ public ReconstructedParticle getAssociatedParticle()
+ {
+ if (this.aRecP == null && recPRef != null)
+ {
+ aRecP = (ReconstructedParticle) recPRef.getObject();
+ recPRef = null;
+ }
+ return super.getAssociatedParticle();
+ }
}
lcio/src/java/hep/lcio/implementation/sio
diff -u -r1.41.2.2 -r1.41.2.3
--- SIOEvent.java 11 Sep 2006 13:05:37 -0000 1.41.2.2
+++ SIOEvent.java 7 Dec 2006 18:52:49 -0000 1.41.2.3
@@ -17,7 +17,7 @@
/**
*
* @author Tony Johnson
- * @version $Id: SIOEvent.java,v 1.41.2.2 2006/09/11 13:05:37 engels Exp $
+ * @version $Id: SIOEvent.java,v 1.41.2.3 2006/12/07 18:52:49 tonyj Exp $
*/
class SIOEvent extends ILCEvent
{
@@ -575,18 +575,12 @@
else if (type.equals(LCIO.VERTEX))
{
//index strings to integers (writing)
-
- /* THIS DOES NOT WORK!!!
- //add parameters to collection
- col.getParameters().setValues( "_lcio.VertexAlgorithmTypes", keys );
- SIOLCParameters.write( col.getParameters() , out ) ;
- */
-
+
TreeMap _map = new TreeMap();
String[] keys = new String[ col.getParameters().getStringVals("_lcio.VertexAlgorithmTypes").length ] ;
keys=col.getParameters().getStringVals("_lcio.VertexAlgorithmTypes");
for (int i=0; i < keys.length; i++){
- _map.put(keys[i],i);
+ _map.put(keys[i],new Integer(i));
}
for (int i=0; i < n; i++)
CVSspam 0.2.8