Print

Print


Commit in hps-java/src/main/java/org/lcsim/hps/recon/tracking/gbl on MAIN
GBLOutput.java+11-21.2 -> 1.3
FIxed debug output

hps-java/src/main/java/org/lcsim/hps/recon/tracking/gbl
GBLOutput.java 1.2 -> 1.3
diff -u -r1.2 -r1.3
--- GBLOutput.java	13 Aug 2013 22:24:16 -0000	1.2
+++ GBLOutput.java	14 Aug 2013 00:47:33 -0000	1.3
@@ -5,6 +5,7 @@
 package org.lcsim.hps.recon.tracking.gbl;
 
 import hep.physics.matrix.BasicMatrix;
+import hep.physics.matrix.Matrix;
 import hep.physics.matrix.MatrixOp;
 import hep.physics.matrix.SymmetricMatrix;
 import hep.physics.vec.*;
@@ -149,9 +150,10 @@
         // calculate truth chi2
         double chi2 = truthTrackFitChi2(perPar,perParTruth,htf.covariance());
         
-        //if(_debug>0) 
+        if(_debug>0) {
             System.out.printf("%s: perPar covariance matrix\n%s\n",this.getClass().getSimpleName(),htf.covariance().toString());
             System.out.printf("%s: truth perPar chi2 %f\n",this.getClass().getSimpleName(),chi2);
+        }
 
             
         BasicMatrix clCov = new BasicMatrix(5,5);
@@ -491,8 +493,15 @@
         pt.setElement(0, 2, perParTruth.getKappa());
         pt.setElement(0, 0, perParTruth.getZ0());
         pt.setElement(0, 4, Math.tan(Math.PI/2.0-perParTruth.getTheta()));
+        Matrix error_matrix = MatrixOp.inverse(covariance);
         BasicMatrix res = (BasicMatrix) MatrixOp.sub(p, pt);
-        BasicMatrix chi2 = (BasicMatrix) MatrixOp.mult(res,MatrixOp.mult(covariance, MatrixOp.transposed(res)));
+//        for(int i=0;i<res.getNRows();++i) {
+//            for(int j=0;j<res.getNColumns();++j) {
+//                    double v = res.e(i, j)*res.e(i, j);
+//                    res.setElement(i, j, v);
+//            }    
+//        }
+        BasicMatrix chi2 = (BasicMatrix) MatrixOp.mult(res,MatrixOp.mult(error_matrix, MatrixOp.transposed(res)));
         if(chi2.getNColumns()!=1 ||chi2.getNRows()!=1) {
             throw new RuntimeException("matrix dim is screwed up!");
         }
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1