lcsim/src/org/lcsim/event/base
diff -u -r1.2 -r1.3
--- BaseTrack.java 25 Mar 2006 20:45:56 -0000 1.2
+++ BaseTrack.java 28 Mar 2006 06:55:24 -0000 1.3
@@ -3,13 +3,13 @@
*
* Created on March 24, 2006, 9:18 PM
*
- * $Id: BaseTrack.java,v 1.2 2006/03/25 20:45:56 ngraf Exp $
+ * $Id: BaseTrack.java,v 1.3 2006/03/28 06:55:24 ngraf Exp $
*/
package org.lcsim.event.base;
-import java.util.ArrayList;
import java.util.List;
+import org.lcsim.constants.Constants;
import org.lcsim.event.Track;
import org.lcsim.event.TrackerHit;
@@ -82,16 +82,24 @@
* @see Track.Parameters
* @param params The array of track parameters.
*/
- public void setTrackParameters(double[] params)
- {
- _parameters = params;
+ // TODO remove hard-coded track parameter indices.
+ // TODO calculate charge from omega.
+ public void setTrackParameters(double[] params, double magneticField)
+ {
+ System.arraycopy(params, 0, _parameters, 0, 5);
+ double omega = _parameters[2];
+ if(Math.abs(omega) < 0.0000001) omega=0.0000001;
+ double Pt = (1./omega) * magneticField* Constants.fieldConversion;
+ _momentum[0] = Pt * Math.cos(_parameters[1]);
+ _momentum[1] = Pt * Math.sin(_parameters[1]);
+ _momentum[2] = Pt * _parameters[4];
}
/**
* Set the covariance matrix for the track parameters.
* @param cov The covariance matrix as a double array.
*/
- // TODO replace this with Matrix
+// TODO replace this with Matrix
public void setCovarianceMatrix( double[][] cov)
{
_covMatrix = cov;
@@ -102,7 +110,7 @@
* Not defined whether this is the full or reduced chi-squared.
* @param chisq The value of the track fit chi-squared.
*/
- // TODO verify if this is full or reduced chi-squared.
+// TODO verify if this is full or reduced chi-squared.
public void setChisq( double chisq)
{
_chi2 = chisq;
@@ -121,7 +129,7 @@
* Set the track type. Note that this is still undefined.
* @param type The track type
*/
- // TODO define this. replace int by enumeration.
+// TODO define this. replace int by enumeration.
public void setTrackType(int type)
{
_type = type;
@@ -162,8 +170,8 @@
}
}
- // TODO add convenience methods to replace clunky interface
- // Track interface
+// TODO add convenience methods to replace clunky interface
+// Track interface
/**
* The charge of the particle creating this track in units of the electron charge.
@@ -179,7 +187,7 @@
* on the track or not.
* @return The reference point for this track.
*/
- // TODO augment this with a SpacePoint.
+// TODO augment this with a SpacePoint.
public double[] getReferencePoint()
{
return _refPoint;
@@ -212,7 +220,7 @@
* Is the reference point for this track the DCA? This needs clarification
* @return true if the reference point is the dca.
*/
- // TODO clarify what this means.
+// TODO clarify what this means.
public boolean isReferencePointPCA()
{
return false;
@@ -262,7 +270,7 @@
* Return an individual track parameter
*@see Track.Parameter
* @param i the index of the track parameter desired
- * @return The value of the ith track parameter
+ * @return The value of the ith track parameter
*/
public double getTrackParameter(int i)
{
@@ -330,10 +338,10 @@
}
/**
* The innermost radius of a hit on this track. For values smaller than this
- * the track must be, or has been, extrapolated.
+ * the track must be, or has been, extrapolated.
* @return The innermost radius of a hit on this track.
*/
- // TODO verify that this is in global coordinates, not wrt reference point.
+// TODO verify that this is in global coordinates, not wrt reference point.
public double getRadiusOfInnermostHit()
{
return _innermostHitRadius;
@@ -342,7 +350,7 @@
* The ids of the subdetectors hit by this track. Not yet defined.
* @return a list of integers representing the subdetector ids hit by this track.
*/
- // TODO establish what this means.
+// TODO establish what this means.
public int[] getSubdetectorHitNumbers()
{
return _subdetId;
@@ -367,7 +375,7 @@
* Return the type of this track. Not yet defined.
* @return an integer representation of the type of this track.
*/
- // TODO define what this means.
+// TODO define what this means.
public int getType()
{
return _type;