lcsim/src/org/lcsim/recon/pfa/identifier
diff -u -r1.5 -r1.6
--- TrackHelixPlusHitExtrapolator.java 27 Oct 2008 18:48:20 -0000 1.5
+++ TrackHelixPlusHitExtrapolator.java 1 Mar 2011 16:26:47 -0000 1.6
@@ -54,6 +54,29 @@
Hep3Vector pointOfClosestApproachToTrackHit = null;
Hep3Vector offset = null;
+ Hep3Vector positionOfOutermostHit = new BasicHep3Vector(outermostHit.getPosition());
+ double rr = Math.sqrt(positionOfOutermostHit.x()*positionOfOutermostHit.x()+positionOfOutermostHit.y()*positionOfOutermostHit.y());
+ double z = positionOfOutermostHit.z();
+ if(m_ECAL_barrel_r - rr < 50.)
+ {
+ alpha = m_swimmer.getDistanceToRadius(rr);
+ pointOfClosestApproachToTrackHit = m_swimmer.getPointAtLength(alpha);
+ // Correct in xy but not in z since no z information
+ offset = new BasicHep3Vector(positionOfOutermostHit.x() - pointOfClosestApproachToTrackHit.x(), positionOfOutermostHit.y() - pointOfClosestApproachToTrackHit.y(), 0.0);
+ }
+ else if(m_ECAL_endcap_z - Math.abs(z) < 100.)
+ {
+ alpha = m_swimmer.getDistanceToZ(z);
+ pointOfClosestApproachToTrackHit = m_swimmer.getPointAtLength(alpha);
+ // Step from extrapolation point (x, y, z) to hit position (x', y', z) -- note that both have same z.
+ offset = new BasicHep3Vector(positionOfOutermostHit.x() - pointOfClosestApproachToTrackHit.x(), positionOfOutermostHit.y() - pointOfClosestApproachToTrackHit.y(), 0.0);
+ }
+ else
+ {
+ offset = new BasicHep3Vector(0.,0.,0.);
+ pointOfClosestApproachToTrackHit = positionOfOutermostHit;
+ }
+ /*
if (outermostHit instanceof org.lcsim.event.base.BaseTrackerHitMC) {
// This cheated hit has exact 3D info
Hep3Vector positionOfOutermostHit = new BasicHep3Vector(outermostHit.getPosition());
@@ -94,6 +117,8 @@
double z = positionOfOutermostHit.z();
throw new AssertionError("ERROR: Unknown hit of type "+outermostHit.getClass().getName()+" at r="+r+", z="+z);
}
+ *
+ */
Hep3Vector momentumAtPOCA = m_swimmer.getMomentumAtLength(alpha);
Hep3Vector newPoint = VecOp.add(pointOfClosestApproachToTrackHit, offset);
@@ -196,9 +221,7 @@
boolean thisHitIsHelicalHit = (hit instanceof org.lcsim.fit.helicaltrack.HelicalTrackCross || hit instanceof org.lcsim.fit.helicaltrack.HelicalTrack2DHit || hit instanceof org.lcsim.fit.helicaltrack.HelicalTrack3DHit);
if (thisHitIsCheatHit && thisHitIsHelicalHit) {
throw new AssertionError("Ambiguous hit of class "+hit.getClass().getName());
- } else if (!thisHitIsCheatHit && !thisHitIsHelicalHit) {
- throw new AssertionError("Unidentified hit of unknown class "+hit.getClass().getName());
- }
+ }
if (thisHitIsCheatHit) {
cheatHitFound = true;
}
@@ -214,7 +237,7 @@
} else if (helicalHitFound) {
return findOutermostHelicalHit(trackerHits);
} else {
- throw new AssertionError("Unclassified list of hits!");
+ return findOutermostCheatHit(trackerHits);
}
}