Commit in lcsim/src/org/lcsim/util/heprep on MAIN
VertexConverter.java+13-51.1 -> 1.2
fixed error ellipsoid size calculation.
added nSigma attribute and position to heprep.

lcsim/src/org/lcsim/util/heprep
VertexConverter.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- VertexConverter.java	20 Sep 2007 23:17:55 -0000	1.1
+++ VertexConverter.java	25 Sep 2007 21:41:54 -0000	1.2
@@ -26,7 +26,7 @@
  * Representation of the Candidate vertices before fitting
  * 
  * @author jstrube
- * @version $Id: VertexConverter.java,v 1.1 2007/09/20 23:17:55 jstrube Exp $
+ * @version $Id: VertexConverter.java,v 1.2 2007/09/25 21:41:54 ngraf Exp $
  * 
  */
 public class VertexConverter implements HepRepCollectionConverter {
@@ -59,6 +59,9 @@
         typeX.addAttValue("MarkName", "Box");
         typeX.addAttDef("nTracks", "number of Tracks", "physics", "");
         
+        double nSigma = 30.; // TODO fix this, make it an attribute?
+        typeX.addAttValue("sigma", nSigma);
+        
 //        HepRepType typeY = factory.createHepRepType(typeTree, name);
 //        typeY.addAttValue("layer", LCSimHepRepConverter.PARTICLES_LAYER);
 //        typeY.addAttValue("drawAs","Line");
@@ -70,6 +73,7 @@
         typeY.addAttValue("layer", LCSimHepRepConverter.PARTICLES_LAYER);
         typeY.addAttValue("drawAs", "Line");
         
+        
         for (Vertex vtx : (List<Vertex>) collection) {
             Color vertexColor = colors[iColor];
             iColor = (iColor+2) % colors.length;
@@ -78,13 +82,14 @@
             instanceV.addAttValue("color", vertexColor);
             instanceV.addAttValue("fillColor", vertexColor);
             
+            //FIXME uncomment the following once the logic is debugged.
             SymmetricMatrix covMatrix = vtx.getCovMatrix();
-            covMatrix.invert();
+//            covMatrix.invert();
             EigenvalueDecomposition vtxEigen = new EigenvalueDecomposition(Jama.util.Maths.toJamaMatrix(covMatrix));
             Matrix eigenVals = vtxEigen.getD();
-            instanceV.addAttValue("Radius", Math.sqrt(eigenVals.get(0, 0)));
-            instanceV.addAttValue("Radius2", Math.sqrt(eigenVals.get(1, 1)));
-            instanceV.addAttValue("Radius3", Math.sqrt(eigenVals.get(2, 2)));
+            instanceV.addAttValue("Radius", nSigma*Math.sqrt(eigenVals.get(0, 0)));
+            instanceV.addAttValue("Radius2", nSigma*Math.sqrt(eigenVals.get(1, 1)));
+            instanceV.addAttValue("Radius3", nSigma*Math.sqrt(eigenVals.get(2, 2)));
             
             /*
              * FIXME angles are not implemented, yet
@@ -94,6 +99,9 @@
             instanceV.addAttValue("Phi", 0);
             instanceV.addAttValue("Theta", 0);
             instanceV.addAttValue("Omega", 0);
+            instanceV.addAttValue("x", pos.x());
+            instanceV.addAttValue("y", pos.y());
+            instanceV.addAttValue("z", pos.z());
             HepRepPoint pp = factory.createHepRepPoint(instanceV, pos.x(), pos.y(), pos.z());
             
         }
CVSspam 0.2.8