lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.2 -r1.3
--- StereoHitMaker.java 4 Jul 2008 00:07:08 -0000 1.2
+++ StereoHitMaker.java 7 Jul 2008 18:40:56 -0000 1.3
@@ -13,6 +13,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.lcsim.event.MCParticle;
+
/**
*
* @author partridge
@@ -65,9 +67,10 @@
double seperation = Math.abs(VecOp.dot(dp, strip1.w()));
if (seperation > _maxsep) continue;
- // Check that the strips aren't colinear'
+ // Check that the strips aren't colinear
double salpha = VecOp.dot(strip1.v(), strip2.u());
if (Math.abs(salpha) < _eps) continue;
+
// Check if we can form a cross within tolerances
double v1 = VecOp.dot(dp, strip2.u()) / salpha;
if (v1 > strip1.vmax() + seperation * _tolerance) continue;
@@ -75,10 +78,17 @@
double v2 = VecOp.dot(dp, strip1.u()) / salpha;
if (v2 > strip2.vmax() + seperation * _tolerance) continue;
if (v2 < strip2.vmin() - seperation * _tolerance) continue;
-
- // Strip pair passes all requirements, make a new cross
- crosscol.add(new HelicalTrackCross(strip1, strip2));
+ // Strip pair passes all requirements, make a new cross and add it to the collection
+ HelicalTrackCross cross = new HelicalTrackCross(strip1, strip2);
+ crosscol.add(cross);
+
+ // Add any matching MC hits to the cross
+ for (MCParticle mcp : strip1.MCParticles()) {
+ if (strip2.MCParticles().contains(mcp)) {
+ cross.addMCParticle(mcp);
+ }
+ }
}
}
return crosscol;