Print

Print


Author: [log in to unmask]
Date: Wed Apr 13 12:53:02 2016
New Revision: 4341

Log:
change access

Modified:
    java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java
    java/trunk/recon/src/main/java/org/hps/recon/vertexing/BilliorVertexer.java

Modified: java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java
 =============================================================================
--- java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java	(original)
+++ java/trunk/recon/src/main/java/org/hps/recon/particle/HpsReconParticleDriver.java	Wed Apr 13 12:53:02 2016
@@ -320,7 +320,7 @@
 
             // Generate a candidate vertex and particle.
             BilliorVertex vtxFit = fitVertex(constraint, firstElectronBTrack, secondElectronBTrack);
-            ReconstructedParticle candidate = this.makeReconstructedParticle(topElectron, botElectron, vtxFit);
+            ReconstructedParticle candidate = makeReconstructedParticle(topElectron, botElectron, vtxFit);
 
             // Add the candidate vertex and particle to the
             // appropriate LCIO collection.
@@ -355,7 +355,7 @@
      * @return Returns a reconstructed particle with properties generated from
      * the child particles and vertex given as an argument.
      */
-    private ReconstructedParticle makeReconstructedParticle(ReconstructedParticle electron, ReconstructedParticle positron, BilliorVertex vtxFit) {
+    public static ReconstructedParticle makeReconstructedParticle(ReconstructedParticle electron, ReconstructedParticle positron, BilliorVertex vtxFit) {
 
         // Create a new reconstructed particle to represent the V0
         // candidate and populate it with the electron and positron.
@@ -397,9 +397,8 @@
         ((BaseReconstructedParticle) candidate).setCharge(particleCharge);
 
         // VERBOSE :: Output the fitted momentum data.
-        printDebug("Fitted momentum in tracking frame: " + fittedMomentum.toString());
-        printDebug("Fitted momentum in detector frame: " + fittedMomentum.toString());
-
+//        printDebug("Fitted momentum in tracking frame: " + fittedMomentum.toString());
+//        printDebug("Fitted momentum in detector frame: " + fittedMomentum.toString());
         // Add the ReconstructedParticle to the vertex.
         vtxFit.setAssociatedParticle(candidate);
 

Modified: java/trunk/recon/src/main/java/org/hps/recon/vertexing/BilliorVertexer.java
 =============================================================================
--- java/trunk/recon/src/main/java/org/hps/recon/vertexing/BilliorVertexer.java	(original)
+++ java/trunk/recon/src/main/java/org/hps/recon/vertexing/BilliorVertexer.java	Wed Apr 13 12:53:02 2016
@@ -153,7 +153,7 @@
             System.out.println(methodName + "::rk = " + rk);
         }
 
-        BasicMatrix Hk = makeHk(_ntracks, pxtot, pytot, pztot, pointback);
+        BasicMatrix Hk = makeHk(Vx, pxtot, pytot, pztot, pointback);
         if (_debug) {
             System.out.println(methodName + "::Hk = " + Hk);
         }
@@ -226,11 +226,8 @@
 //        if(_debug)System.out.println("Constrained chi^2 = "+_chiSq);
     }
 
-    private BasicMatrix makeHk(int ntracks, double pxtot, double pytot, double pztot, boolean bscon) {
-        double Vx = _vertexPosition.e(0, 0);
-//        double Vy = _vertexPosition.e(1, 0);
-//        double Vz = _vertexPosition.e(2, 0);
-        BasicMatrix Hk = new BasicMatrix(3 * (ntracks + 1), 3);
+    private BasicMatrix makeHk(double Vx, double pxtot, double pytot, double pztot, boolean bscon) {
+        BasicMatrix Hk = new BasicMatrix(3 * (_ntracks + 1), 3);
 //  ok, can set the derivitives wrt to V
         if (bscon) {
             Hk.setElement(0, 0, 0);
@@ -248,7 +245,7 @@
         Hk.setElement(2, 1, 0);
         Hk.setElement(2, 2, 1);
 //ok, loop over tracks again to set the derivitives wrt track momenta (theta,phi,rho)
-        for (int i = 0; i < ntracks; i++) {
+        for (int i = 0; i < _ntracks; i++) {
             BasicMatrix pi = (BasicMatrix) _pFit.get(i);
             double theta = pi.e(0, 0);
             double phiv = pi.e(1, 0);
@@ -262,7 +259,7 @@
             Hk.setElement(3 * (i + 1), 1, 0);
             if (bscon) {
                 Hk.setElement(3 * (i + 1), 2,
-                        -Pt / Math.pow(sin(theta), 2) * Vx);
+                        -Pt / Math.pow(sin(theta), 2) * (Vx - _beamPosition[0]));
             } else {
                 Hk.setElement(3 * (i + 1), 2, 0);
             }
@@ -270,9 +267,9 @@
             Hk.setElement(3 * (i + 1) + 1, 0, 0);
             if (bscon) {
                 Hk.setElement(3 * (i + 1) + 1, 1,
-                        (Pt * Pt * cos(phiv) * sin(phiv) / (pxtot * pxtot)) * Vx);
+                        (Pt * Pt * cos(phiv) * sin(phiv) / (pxtot * pxtot)) * (Vx - _beamPosition[0]));
                 Hk.setElement(3 * (i + 1) + 1, 2,
-                        (Pt * sin(phiv) / (pxtot * pxtot)) * Vx * pztot);
+                        (Pt * sin(phiv) / (pxtot * pxtot)) * (Vx - _beamPosition[0]) * pztot);
             } else {
                 Hk.setElement(3 * (i + 1) + 1, 1, 0);
                 Hk.setElement(3 * (i + 1) + 1, 2, 0);
@@ -285,9 +282,9 @@
 //                    (pztot / pxtot - 1) * (Pt / rho) * (1 / pxtot) * Vx);
             if (bscon) {
                 Hk.setElement(3 * (i + 1) + 2, 1,
-                        (cos(phiv) * pytot / pxtot - sin(phiv)) * (Pt / rho) * (1 / pxtot) * Vx);
+                        (cos(phiv) * pytot / pxtot - sin(phiv)) * (Pt / rho) * (1 / pxtot) * (Vx - _beamPosition[0]));
                 Hk.setElement(3 * (i + 1) + 2, 2,
-                        (cos(phiv) * pztot / pxtot - sin(phiv)) * (Pt / rho) * (1 / pxtot) * Vx);
+                        (cos(phiv) * pztot / pxtot - sin(phiv)) * (Pt / rho) * (1 / pxtot) * (Vx - _beamPosition[0]));
             } else {
                 Hk.setElement(3 * (i + 1) + 2, 1, 0);
                 Hk.setElement(3 * (i + 1) + 2, 2, 0);
@@ -299,7 +296,7 @@
         return Hk;
     }
 
-    public BasicMatrix makeRk(double Vx, double Vy, double Vz, double pxtot, double pytot, double pztot, boolean bscon) {
+    private BasicMatrix makeRk(double Vx, double Vy, double Vz, double pxtot, double pytot, double pztot, boolean bscon) {
         //calculate the position of the A' at X=0
         BasicMatrix rk = new BasicMatrix(3, 1);
         if (_debug) {