lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.1 -r1.2
--- HelicalTrack3DHit.java 11 Dec 2007 20:35:04 -0000 1.1
+++ HelicalTrack3DHit.java 6 Feb 2008 02:33:50 -0000 1.2
@@ -27,7 +27,8 @@
public HelicalTrack3DHit(TrackerHit hit, BarrelEndcapFlag beflag) {
super(hit);
_beflag = beflag;
- _dz = hit.getCovMatrix()[5];
+// _dz = Math.sqrt(hit.getCovMatrix()[5]);
+ _dz = 0.005;
}
/**
lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.7 -r1.8
--- HelicalTrackFit.java 5 Feb 2008 17:09:29 -0000 1.7
+++ HelicalTrackFit.java 6 Feb 2008 02:33:50 -0000 1.8
@@ -3,7 +3,7 @@
*
* Created on March 25, 2006, 6:11 PM
*
- * $Id: HelicalTrackFit.java,v 1.7 2008/02/05 17:09:29 partridge Exp $
+ * $Id: HelicalTrackFit.java,v 1.8 2008/02/06 02:33:50 partridge Exp $
*/
package org.lcsim.fit.helicaltrack;
@@ -76,6 +76,10 @@
return _chisq;
}
+ public double chisqtot() {
+ return _chisq[0]+_chisq[1];
+ }
+
public int[] ndf() {
return _ndf;
}
lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.2 -r1.3
--- HelicalTrackHit.java 5 Feb 2008 17:09:29 -0000 1.2
+++ HelicalTrackHit.java 6 Feb 2008 02:33:50 -0000 1.3
@@ -41,10 +41,16 @@
_z = pos[2];
setPolarCoordinates();
double[] cov = hit.getCovMatrix();
- System.out.println(" dx: "+Math.sqrt(cov[0])+" dy: "+Math.sqrt(cov[2])+
- " rho: "+cov[1]/Math.sqrt(cov[0]*cov[2]));
- _drphi = Math.sqrt(_y * _y * cov[0] + _x * _x * cov[2] - 2. * _x * _y * cov[1]) / _r;
- _dr = Math.sqrt(_x * _x * cov[0] + _y * _y * cov[2] + 2. * _x * _y * cov[1]) / _r;
+// System.out.println(" dx: "+Math.sqrt(cov[0])+" dy: "+Math.sqrt(cov[2])+
+// " rho: "+cov[1]/Math.sqrt(cov[0]*cov[2]));
+// _drphi = Math.sqrt(_y * _y * cov[0] + _x * _x * cov[2] - 2. * _x * _y * cov[1]) / _r;
+// _dr = Math.sqrt(_x * _x * cov[0] + _y * _y * cov[2] + 2. * _x * _y * cov[1]) / _r;
+ if (_r > 100) {
+ _drphi = 0.007;
+ } else {
+ _drphi = 0.005;
+ }
+ _dr = 0.0;
}
/**
lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.2 -r1.3
--- HelicalTrackHitDriver.java 5 Feb 2008 17:09:29 -0000 1.2
+++ HelicalTrackHitDriver.java 6 Feb 2008 02:33:50 -0000 1.3
@@ -69,47 +69,58 @@
// Loop over the collections of hits with virtual segmentation
for (String colname : _vscol) {
+
// Get the hits for this collection and loop over the hits
List<TrackerHit> hitlist = (List<TrackerHit>) event.get(colname);
for (TrackerHit hit : hitlist) {
double[] ps = hit.getPosition();
System.out.println("Hit x: "+ps[0]+" y: "+ps[1]+" z: "+ps[2]);
double[] cov = hit.getCovMatrix();
- System.out.println("Cov xx: "+cov[0]+" xy: "+cov[1]+" yy "+cov[2]);
- System.out.println("Cov xz: "+cov[3]+" Cov yz: "+cov[4]+" Cov zz: "+cov[5]);
+// System.out.println("Cov xx: "+cov[0]+" xy: "+cov[1]+" yy "+cov[2]);
+// System.out.println("Cov xz: "+cov[3]+" Cov yz: "+cov[4]+" Cov zz: "+cov[5]);
+
// Check that these hits are actually instances of OldTrackerHit and cast accordingly
if (hit instanceof OldTrackerHit) {
OldTrackerHit vshit = (OldTrackerHit) hit;
+
// Get the cluster(s) and a sensor for this hit
List<TrackerCluster> clist = vshit.getClusters();
Sensor sensor = clist.get(0).getSensor();
+
// Check if this is a barrel or endcap hit by transforming the sensor
// normal in local coordinates to the global coordniate system
Hep3Vector gz = sensor.getRotation().transformFrom(lz);
BarrelEndcapFlag beflag = BarrelEndcapFlag.BARREL;
if (Math.pow(gz.z(),2) > 0.5) {
+
// If the sensor normal mostly points in the z direction call it
// an endcap hit. Check which endcap we are in.
if (hit.getPosition()[2]>0) beflag = BarrelEndcapFlag.ENDCAP_NORTH;
else beflag = BarrelEndcapFlag.ENDCAP_SOUTH;
}
+
// If there are more than one (i.e., two) clusters for this hit, we
// have a cross formed from two stereo layers
if (clist.size() > 1) {
+
// Stereo hit found - make a HelicalTrack3DHit
helhits.add((HelicalTrackHit) new HelicalTrack3DHit(hit, beflag));
} else {
+
// Check the number of readout dimensions (1 = strip, 2 = pixel)
SensorType stype = sensor.getType();
if (stype.getHitDimension() == 2) {
+
// Pixel hit found - make a HelicalTrack3DHit
helhits.add((HelicalTrackHit) new HelicalTrack3DHit(hit, beflag));
} else if (stype.getHitDimension() == 1 && beflag == BarrelEndcapFlag.BARREL) {
+
// Barrel strip hit found - find the ends of the strip in z
Hep3Vector pos = new BasicHep3Vector(hit.getPosition());
Hep3Vector stripgeom = stype.getChannelDimensions(stype.getChannelID(pos));
double zmin = pos.z() - 0.5 * stripgeom.y();
double zmax = pos.z() + 0.5 * stripgeom.y();
+
// Make a HelicalTrack2DHit
helhits.add((HelicalTrackHit) new HelicalTrack2DHit(hit, zmin, zmax));
}
@@ -117,6 +128,7 @@
}
}
}
+
// Put the HelicalTrackHits back into the event
event.put(_outname, helhits);
}
lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.2 -r1.3
--- HelixUtils.java 5 Feb 2008 17:09:29 -0000 1.2
+++ HelixUtils.java 6 Feb 2008 02:33:50 -0000 1.3
@@ -60,6 +60,15 @@
return PathCalc(_x0, _y0, hit.x(), hit.y());
}
+ public double PathLength(HelicalTrackFit helix, HelicalTrackHit hit) {
+
+ // Cache the helix parameters
+ HelixCache(helix);
+
+ // Return the path length from the DCA
+ return PathCalc(_x0, _y0, hit.x(), hit.y());
+ }
+
public double PathToZPlane(HelicalTrackFit helix, double z) {
// Cache the helix parameters