hps-java/src/main/java/org/lcsim/hps/recon/tracking/gbl
diff -u -r1.4 -r1.5
--- GBLFileIO.java 21 Aug 2013 20:13:58 -0000 1.4
+++ GBLFileIO.java 25 Aug 2013 21:42:19 -0000 1.5
@@ -190,6 +190,10 @@
addLine(String.format("Strip pathLen %f", s));
}
+ void printStripPathLen3D(double s) {
+ addLine(String.format("Strip pathLen 3D %f", s));
+ }
+
void printStereoAngle(double stereoAngle) {
addLine(String.format("Strip stereo angle %f", stereoAngle));
}
hps-java/src/main/java/org/lcsim/hps/recon/tracking/gbl
diff -u -r1.6 -r1.7
--- GBLOutput.java 22 Aug 2013 00:29:41 -0000 1.6
+++ GBLOutput.java 25 Aug 2013 21:42:19 -0000 1.7
@@ -207,8 +207,10 @@
//Find intercept point with sensor in tracking frame
Hep3Vector trkpos = TrackUtils.getHelixPlaneIntercept(htf, strip, Math.abs(_B.z()));
+ Hep3Vector trkposXPlane = TrackUtils.getHelixXPlaneIntercept(htf, strip.w(), origin);
if(_debug>0) {
System.out.printf("trkpos at intercept %s\n",trkpos.toString());
+ System.out.printf("trkposXPlane at intercept %s\n",trkposXPlane.toString());
}
Hep3Vector trkposTruth = TrackUtils.getHelixPlaneIntercept(htfTruth, strip, Math.abs(_B.z()));
@@ -248,11 +250,28 @@
}
//path length to intercept
- double s = HelixUtils.PathToXPlane(htf,trkpos.x(),0,0).get(0);
- double s_hit = HelixUtils.PathLength(htf, hit); //cross-check
+ double s = HelixUtils.PathToXPlane(htf,trkpos.x(),0,0).get(0);
+ double s3D = s / Math.cos(Math.atan(htf.slope()));
- //print the track direction
+ if(_debug>0) {
+ double s_XPlane = HelixUtils.PathToXPlane(htf,trkposXPlane.x(),0,0).get(0);
+ double s_truth = HelixUtils.PathToXPlane(htfTruth, trkposTruth.x(), 0, 0).get(0);
+ double s3D_truth = s_truth / Math.cos(Math.atan(htfTruth.slope()));
+ double s3D_XPlane = s_XPlane / Math.cos(Math.atan(htf.slope()));
+ System.out.printf("s = %f (s_3D=%f) trkpos %s (initial)\n", s, s3D , trkpos.toString());
+ System.out.printf("s = %f (s_3D=%f) trkpos %s (truth) \n", s_truth, s3D_truth, trkposTruth.toString());
+ System.out.printf("s = %f (s_3D=%f) trkpos %s (XPlane) \n", s_XPlane, s3D_XPlane, trkposXPlane.toString());
+ double s_test = 88.8207081021 * Math.cos(Math.atan(htf.slope()));
+ Hep3Vector trkpos_test = HelixUtils.PointOnHelix(htf, s_test);
+ System.out.printf("s = %f trkpos %s (initial)\n", s_test, trkpos_test.toString());
+ s_test = 88.8103791522 * Math.cos(Math.atan(htfTruth.slope()));
+ trkpos_test = HelixUtils.PointOnHelix(htfTruth, s_test);
+ System.out.printf("s = %f trkpos %s (truth)\n", s_test, trkpos_test.toString());
+ }
+
+ //print the path length
file.printStripPathLen(s);
+ file.printStripPathLen3D(s3D);
//file.addLine(String.format("trkpos at s=%f is %s",88.7866518242,HelixUtils.PointOnHelix(htf, 88.7866518242).toString()));