lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter
diff -u -r1.2 -r1.3
--- VertexFactoryTest.java 28 Jun 2006 07:06:54 -0000 1.2
+++ VertexFactoryTest.java 28 Jun 2006 20:01:18 -0000 1.3
@@ -38,14 +38,14 @@
part = fac.makeVertex(x, p, 4);
assertEquals(p.equals(part.getMomentum(), 5e-2), true);
assertEquals(x.equals(part.origin()), true);
- assertEquals(part.getCharge(), 0);
+ assertEquals(part.getCharge(), 0.);
assertEquals(part.getTracks().size(), 4);
- // neutral Vertex
+ // negatively charged Vertex
part = fac.makeVertex(x, p, 7);
- assertEquals(p.equals(part.getMomentum()), true);
+ assertEquals(p.equals(part.getMomentum(), 5e-2), true);
assertEquals(x.equals(part.origin()), true);
- assertEquals(part.getCharge(), -1);
+ assertEquals(part.getCharge(), 1.);
assertEquals(part.getTracks().size(), 7);
}
lcsim/src/org/lcsim/contrib/JanStrube/vtxFitter
diff -u -r1.2 -r1.3
--- VertexFactory.java 28 Jun 2006 07:06:54 -0000 1.2
+++ VertexFactory.java 28 Jun 2006 20:01:18 -0000 1.3
@@ -39,7 +39,7 @@
particle.setOrigin(pos);
MCFastTrackFactory fac = new MCFastTrackFactory();
for (int i=0; i<nTracks-1; i++) {
- int c = (int) Math.pow(-1, Math.round(i+1/2));
+ int c = (int) Math.pow(-1, Math.round((i+1)/2));
double px = flat(-momentum.x(), momentum.x());
double py = flat(-momentum.y(), momentum.y());
double pz = flat(-momentum.z(), momentum.z());
@@ -48,7 +48,7 @@
Track t = fac.getMCTrack(p, pos, c);
particle.addTrack(t);
}
- int c = (int)Math.pow(-1, Math.round(nTracks+1/2));
+ int c = (int)Math.pow(-1, Math.round((nTracks+1)/2));
particle.addTrack(fac.getMCTrack(momentum, pos, c));
return particle;
}