hps-java/src/main/java/org/lcsim/hps/recon/tracking
diff -u -r1.13 -r1.14
--- TrackUtils.java 19 Jan 2013 00:54:21 -0000 1.13
+++ TrackUtils.java 23 Jan 2013 17:47:29 -0000 1.14
@@ -23,7 +23,7 @@
/**
*
* @author Omar Moreno <[log in to unmask]>
- * @version $Id: TrackUtils.java,v 1.13 2013/01/19 00:54:21 phansson Exp $
+ * @version $Id: TrackUtils.java,v 1.14 2013/01/23 17:47:29 phansson Exp $
* TODO: Switch to JLab coordinates
*/
@@ -435,20 +435,18 @@
//Now the residual for the "measurement" direction z
double resz = hth.z() - posOnHelix.z();
- //double dz = HitUtils.zres(hth, msmap, track);
-
- double slope = hth.z() / hth.r();
- // Don't use the helix slope if the magnitude of the slope is smaller than its uncertainty
- if (Math.abs(track.slope()) > track.getSlopeError()) slope = track.slope();
- // Take the resolution uncertainty to be dr * |slope|
- double dzres = hth.dr() * Math.abs(slope);
- // Combine resolution and multiple scattering uncertainties in quadrature
- double dz = dzres; //Math.sqrt(dzres*dzres + msdz*msdz);
+ double dz_res = HitUtils.zres(hth, msmap, track);
+ double dz_res2 = hth.getCorrectedCovMatrix().diagonal(2);
+
residuals.put("resz",resz);
- residuals.put("errz",dz);
- residuals.put("dr",hth.dr());
- residuals.put("slope",Math.abs(slope));
+ residuals.put("errz",dz_res);
+ residuals.put("dz_res",Math.sqrt(dz_res2));
+ residuals.put("msdz",msdz);
+
+ //System.out.printf("calculateTrackHitResidual: for hit (%f,%f,%f) on helix at s=%f with chi2=%f \n",hth.x(),hth.y(),hth.z(),s,track.chisqtot(),track.chisqtot());
+ //System.out.printf("calculateTrackHitResidual: resy=%f eresy=%f drphi=%f msdrphi=%f \n",resy,erry,drphi_res,msdrphi);
+ //System.out.printf("calculateTrackHitResidual: resz=%f eresz=%f dz_res=%f msdz=%f \n",resz,dz_res,Math.sqrt(dz_res2),msdz);
return residuals;