lcsim/src/org/lcsim/recon/vertexing/zvtop4
diff -u -r1.7 -r1.8
--- ZvTop.java 29 Jun 2005 00:58:32 -0000 1.7
+++ ZvTop.java 18 Jul 2005 02:34:12 -0000 1.8
@@ -138,8 +138,9 @@
trackList.clear();
System.err.println("entering findVertives\n");
// empty track to represent IP
- ZvTrack ipTrack = new ZvTrack();
- trackList.add(ipTrack);
+ // FIXME Put in IP as constraint
+// ZvTrack ipTrack = new ZvTrack();
+// trackList.add(ipTrack);
for (Track iTrack : list) {
trackList.add(new ZvTrack(iTrack));
}
@@ -284,7 +285,12 @@
private List<ZvVertex> makeVertices() {
List<ZvVertex> l = new ArrayList<ZvVertex>();
Set<ZvTrack> unavailableTracks = new HashSet<ZvTrack>();
- System.err.printf("found %d Candidates\n", _vertexCandidateList.size());
+ System.err.printf("found %d Candidates\n", _vertexCandidateList.size());^M
+ for (Set<ZvMaximum> iCand : _vertexCandidateList) {
+ for (ZvMaximum iMax : iCand) {
+ System.err.printf(iMax.getLocation().toString());
+ }
+ }
// The Maxima are clustered according to the resolution function
// A Cluster is a Set of ZvMaxima
// Add all tracks from a cluster to the vertex
@@ -304,12 +310,12 @@
}
}
iVtx.setVtxTracks(iVtxTracks);
- vtxFitter.doFit(iVtx);
+ ZvFitStatus status = vtxFitter.doFit(iVtx);
// TODO fit the vertex, make sure the tracks in the vertex
// are below the chi2 cut, so that at any time only good tracks are in the
// vertex
if (! iVtx.getFitStatus().isOK()) {
- System.err.println("FitStatus not OK");
+ System.err.printf("FitStatus is: %s\n", status);
continue;
}
else {
lcsim/src/org/lcsim/recon/vertexing/zvtop4
diff -u -r1.8 -r1.9
--- ZvSwimmer.java 17 May 2005 01:25:27 -0000 1.8
+++ ZvSwimmer.java 18 Jul 2005 02:34:12 -0000 1.9
@@ -82,7 +82,7 @@
ZvParameters orgParameters = new ZvParameters(track.zvParameters());
Matrix orgErrorMatrix = new Matrix(track.getErrorMatrix());
- // TODO detector radius
+ // FIXME detector radius
double radius = 100;
// set and check if target position is outside the detector
if (targetPosition.rxyz()> radius)
@@ -223,7 +223,7 @@
// swumTrack.setZvTrackParam(hlxPar);
// swumTrack.setZvTrackError(dHlxPar);
// swumTrack.setSwimStatus(new ZvSwimStatus(status));
- return status;
+ return ZvFitStatus.OK;
}
// FIXME bad example of global variable
static Hep3Vector globalpUnit;
lcsim/src/org/lcsim/recon/vertexing/zvtop4
diff -u -r1.11 -r1.12
--- ZvFitter.java 29 Jun 2005 00:58:32 -0000 1.11
+++ ZvFitter.java 18 Jul 2005 02:34:13 -0000 1.12
@@ -10,6 +10,7 @@
import hep.physics.vec.Hep3Vector;
import java.util.Collection;
+import java.util.List;
import java.util.Set;
import org.lcsim.geometry.Detector;
@@ -24,7 +25,7 @@
* Fitter class based on a least squares method
*
* @author W.Walkowiak, 09/18/00
- * @version $Id: ZvFitter.java,v 1.11 2005/06/29 00:58:32 jstrube Exp $
+ * @version $Id: ZvFitter.java,v 1.12 2005/07/18 02:34:13 jstrube Exp $
*/
/* TODO static members only
@@ -56,7 +57,6 @@
// TODO proper constructor;
public void setDetector(Detector d) {
- System.out.println("Setting detector to " + d.toString());
detector = d;
}
@@ -156,9 +156,9 @@
do {
// find Vertex try
fittedVertex = findVertex(trackList, vVtxTry, vInVtxErr);
- if (fittedVertex == null)
+ if (fittedVertex == null) {
return status;
-
+ }
vVtxPos = fittedVertex.getPosition();
dis = (subtract(vVtxPos, vVtxTry)).magnitude();
@@ -185,7 +185,7 @@
* private methods
* --------------------------------------------------------------------
*/
- private ZvVertex findVertex(Collection<ZvTrack> trackList, SpacePoint location,
+ private ZvVertex findVertex(Set<ZvTrack> trackList, SpacePoint location,
Matrix error) {
double[] viVtxErr = new double[]{error.get(1, 1), error.get(2, 2), error.get(3, 3)};
// preset result to null
@@ -212,16 +212,18 @@
Matrix mR0Err = new Matrix(3, 3, 0.);
for (int i = 0; i < nTrk; i++) {
ZvTrack track = trackArray[i];
-
// reswim track, if necessary
// TODO move swimTo into HelicalSwimmer
if (subtract(location, track.referencePoint()).magnitude() > swimDistMin) {
+ trackList.remove(track);
ZvTrack orgTrack = new ZvTrack(track);
+ trackList.add(orgTrack);
ZvFitStatus swimStatus = swimmer.swimTo(track, location);
if (swimStatus.success()) {
trackList.remove(orgTrack);
trackList.add(track);
} else {
+ System.out.println("SwimStatus is (in ZvFitter): " + swimStatus);
status = ZvFitStatus.SWIM_FAILURE;
return vertex;
}
@@ -239,10 +241,8 @@
// create unit vectors
// TODO Horrible !!!
- if (detector == null) System.err.println("WARNING!");
- FieldMap f = detector.getFieldMap();
double[] where = tDee[i].getCartesianArray();
- double[] bb = f.getField(where);
+ double[] bb = detector.getFieldMap().getField(where);
Hep3Vector vmUnit = unit(new BasicHep3Vector(bb[0], bb[1], bb[2]));
{
Hep3Vector x = unit(track.momentum());
@@ -426,6 +426,7 @@
ZvFitStatus swimStatus = swimmer.swimTo(track, vR0);
if (! swimStatus.success()) {
+ System.out.println("SwimStatus is " + swimStatus);
status = ZvFitStatus.SWIM_FAILURE;
return null;
}