lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.7 -r1.8
--- HelicalTrackCross.java 29 Aug 2008 00:06:22 -0000 1.7
+++ HelicalTrackCross.java 4 Sep 2008 17:22:08 -0000 1.8
@@ -15,6 +15,8 @@
import java.util.ArrayList;
import java.util.List;
+import org.lcsim.event.RawTrackerHit;
+
/**
* Encapsulate cross (stereo) hit information needed by HelicalTrackFitter.
* The separation between the two sensor planes makes the hit position and
@@ -42,12 +44,24 @@
*/
public HelicalTrackCross(HelicalTrackStrip strip1, HelicalTrackStrip strip2) {
super(HitUtils.PositionFromOrigin(strip1, strip2), HitUtils.CovarianceFromOrigin(strip1, strip2),
- strip1.dEdx()+strip2.dEdx(), 0.5*(strip1.time() + strip2.time()), _type, strip1.rawhits(),
+ strip1.dEdx()+strip2.dEdx(), 0.5*(strip1.time() + strip2.time()), _type, null,
strip1.detector(), strip1.layer(), strip1.BarrelEndcapFlag());
// Save the strips
_strip1 = strip1;
_strip2 = strip2;
+ // Put the raw hits from the strips into the hit list
+ if (strip1.rawhits() != null) {
+ for (RawTrackerHit rawhit : (List<RawTrackerHit>) strip1.rawhits()) {
+ super.addRawHit(rawhit);
+ }
+ }
+ if (strip2.rawhits() != null) {
+ for (RawTrackerHit rawhit : (List<RawTrackerHit>) strip2.rawhits()) {
+ super.addRawHit(rawhit);
+ }
+ }
+
// Check if the sensors are parallel to each other
if (VecOp.cross(_strip1.w(),_strip2.w()).magnitude() > _eps) {
throw new RuntimeException("Trying to construct a stereo hit from non-parallel sensor planes!");
@@ -96,8 +110,8 @@
// Check to make sure we have sane errors in r-phi, r, and z - problems can occur
// if the track direction is nearly parallel to the sensor plane
boolean errok = (drphicalc(poscor, covcor) < drphicalc(pos, cov) + _eps) &&
- (drcalc(poscor, covcor) < drcalc(pos, cov) + _eps) &&
- (Math.sqrt(covcor.e(2,2)) < Math.sqrt(cov.e(2,2)) + _eps);
+ (drcalc(poscor, covcor) < drcalc(pos, cov) + _eps) &&
+ (Math.sqrt(covcor.e(2,2)) < Math.sqrt(cov.e(2,2)) + _eps);
if (errok) {
super.setCorrectedPosition(poscor);
super.setCorrectedCovMatrix(covcor);
@@ -125,7 +139,6 @@
super.setChisq(0.);
}
-
/**
* Calculate a chi^2 penalty if one or both unmeasured coordinates for the hit lie
* outside the extant of their respective strips.
lcsim/src/org/lcsim/fit/helicaltrack
diff -u -r1.13 -r1.14
--- HelicalTrackHit.java 28 Aug 2008 01:20:58 -0000 1.13
+++ HelicalTrackHit.java 4 Sep 2008 17:22:08 -0000 1.14
@@ -8,13 +8,13 @@
package org.lcsim.fit.helicaltrack;
import hep.physics.matrix.SymmetricMatrix;
-import hep.physics.vec.BasicHep3Vector;
import hep.physics.vec.Hep3Vector;
import java.util.ArrayList;
import java.util.List;
import org.lcsim.event.MCParticle;
+import org.lcsim.event.RawTrackerHit;
import org.lcsim.event.TrackerHit;
import org.lcsim.geometry.subdetector.BarrelEndcapFlag;
@@ -41,7 +41,7 @@
private double _dEdx;
private double _time;
private int _type;
- private List _rawhits;
+ private List<RawTrackerHit> _rawhits;
private String _detname;
private int _layer;
private BarrelEndcapFlag _beflag;
@@ -61,7 +61,13 @@
_dEdx = dEdx;
_time = time;
_type = type;
- _rawhits = rawhits;
+ // If we are passed a list of raw tracker hits use it, otherwise, create a new list
+ if (rawhits != null) {
+ _rawhits = rawhits;
+ }
+ else {
+ _rawhits = new ArrayList<RawTrackerHit>();
+ }
_detname = detname;
_layer = layer;
_beflag = beflag;
@@ -288,6 +294,11 @@
return;
}
+ protected void addRawHit(RawTrackerHit rawhit) {
+ _rawhits.add(rawhit);
+ return;
+ }
+
/**
* Set the chi^2 penalty for the hit (used by cross hits when one or both of
* the unmeasured coordinates is beyond its allowed range).