3 modified files
lcsim/src/org/lcsim/contrib/onoprien/tracking/hit/base
diff -u -r1.3 -r1.4
--- TrackerHitAdapter.java 25 Sep 2007 03:16:33 -0000 1.3
+++ TrackerHitAdapter.java 9 Oct 2007 18:08:54 -0000 1.4
@@ -19,13 +19,23 @@
* methods returning position and covariance matrix in local frame, and vice versa.
*
* @author D.Onoprienko
- * @version $Id: TrackerHitAdapter.java,v 1.3 2007/09/25 03:16:33 onoprien Exp $
+ * @version $Id: TrackerHitAdapter.java,v 1.4 2007/10/09 18:08:54 onoprien Exp $
*/
abstract public class TrackerHitAdapter implements TrackerHit {
// -- Constructors : ----------------------------------------------------------
- protected TrackerHitAdapter(TrackerCluster cluster) {_cluster = cluster;}
+ protected TrackerHitAdapter(TrackerCluster cluster) {
+ _cluster = cluster;
+ _signal = cluster.getSignal();
+ _time = cluster.getTime();
+ }
+
+ protected TrackerHitAdapter(TrackerCluster cluster, double signal, double time) {
+ _cluster = cluster;
+ _signal = signal;
+ _time = time;
+ }
// -- Position and covariance matrix in local coordinates : -------------------
@@ -43,7 +53,7 @@
* Default implementation relies on {@link #getCovMatrix()} method.
*/
public SymmetricMatrix getLocalCovMatrix() {
- return getSensor().globalToLocal(getCovMatrix());
+ return getSensor().globalToLocal(getCovMatrix(), getPosition());
}
/**
@@ -75,7 +85,7 @@
* Default implementation relies on {@link #getLocalCovMatrix()} method.
*/
public SymmetricMatrix getCovMatrix() {
- return getSensor().localToGlobal(getLocalCovMatrix());
+ return getSensor().localToGlobal(getLocalCovMatrix(), getLocalPosition());
}
/**
@@ -84,7 +94,7 @@
* Default implementation relies on {@link #getLocalSegment()} method.
*/
public SpacePointVector getSegment() {
- SpacePointVector local = getSegment();
+ SpacePointVector local = getLocalSegment();
Sensor sensor = getSensor();
return new SpacePointVector(new SpacePoint(sensor.localToGlobal(local.getStartPoint())),
new SpacePoint(sensor.localToGlobal(local.getEndPoint())));
@@ -101,6 +111,20 @@
return getSegment().magnitude();
}
+// -- Signal and time : -------------------------------------------------------
+
+ /** Returns signal amplitude associated with this hit. */
+ public double getSignal() {return _signal;}
+
+ /** Set signal value associated with this hit. */
+ public void setSignal(double signal) {_signal = signal;}
+
+ /** Returns time associated with this hit. */
+ public double getTime() {return _time;}
+
+ /** Set time associated with this hit. */
+ public void setTime(double time) {_time = time;}
+
// -- Access to underlying Sensor and TrackerCluster objects : ----------------
/** Returns {@link Sensor} object for this hit. */
@@ -114,5 +138,7 @@
// -- Private parts : ---------------------------------------------------------
protected TrackerCluster _cluster;
+ protected double _signal;
+ protected double _time;
}
lcsim/src/org/lcsim/contrib/onoprien/tracking/hit/base
diff -u -r1.2 -r1.3
--- TrackerHitPoint.java 25 Sep 2007 03:16:33 -0000 1.2
+++ TrackerHitPoint.java 9 Oct 2007 18:08:54 -0000 1.3
@@ -17,7 +17,7 @@
* done if needed, and the results will be cached.
*
* @author D.Onoprienko
- * @version $Id: TrackerHitPoint.java,v 1.2 2007/09/25 03:16:33 onoprien Exp $
+ * @version $Id: TrackerHitPoint.java,v 1.3 2007/10/09 18:08:54 onoprien Exp $
*/
public class TrackerHitPoint extends TrackerHitAdapter {
@@ -26,6 +26,7 @@
/**
* Construct a new TrackerHit.
* Vector and matrix supplied to the constructor will be owned by the created hit.
+ * Signal and time associated with this hit will be set to those of the <tt>TrackerCluster</tt>.
*
* @param cluster {@link TrackerCluster} from which this hit was created.
* @param position Position of the hit.
@@ -33,7 +34,6 @@
* @param isLocal <tt>true</tt> if position and covariance matrix are given
* in the <tt>Sensor</tt> local reference frame, <tt>false</tt>
* if they are given in the global frame.
- *
*/
public TrackerHitPoint(TrackerCluster cluster, Hep3Vector position, SymmetricMatrix covMatrix, boolean isLocal) {
super(cluster);
@@ -46,6 +46,31 @@
}
}
+ /**
+ * Construct a new TrackerHit.
+ * Vector and matrix supplied to the constructor will be owned by the created hit.
+ *
+ * @param cluster {@link TrackerCluster} from which this hit was created.
+ * @param position Position of the hit.
+ * @param covMatrix Covariance matrix
+ * @param isLocal <tt>true</tt> if position and covariance matrix are given
+ * in the <tt>Sensor</tt> local reference frame, <tt>false</tt>
+ * if they are given in the global frame.
+ * @param signal Signal amplitude to be associated with this hit.
+ * @param time Time to be associated with this hit.
+ */
+ public TrackerHitPoint(TrackerCluster cluster, Hep3Vector position, SymmetricMatrix covMatrix, boolean isLocal,
+ double signal, double time) {
+ super(cluster, signal, time);
+ if (isLocal) {
+ _posLocal = position;
+ _covLocal = covMatrix;
+ } else {
+ _posGlobal = position;
+ _covGlobal = covMatrix;
+ }
+ }
+
// -- Position and covariance matrix in local coordinates : -------------------
/**
lcsim/src/org/lcsim/contrib/onoprien/tracking/hit/base
diff -u -r1.1 -r1.2
--- TrackerHitSegment.java 25 Sep 2007 03:28:36 -0000 1.1
+++ TrackerHitSegment.java 9 Oct 2007 18:08:54 -0000 1.2
@@ -19,7 +19,7 @@
* if needed, and the results will be cached.
*
* @author D.Onoprienko
- * @version $Id: TrackerHitSegment.java,v 1.1 2007/09/25 03:28:36 onoprien Exp $
+ * @version $Id: TrackerHitSegment.java,v 1.2 2007/10/09 18:08:54 onoprien Exp $
*/
public class TrackerHitSegment extends TrackerHitAdapter {
@@ -28,6 +28,7 @@
/**
* Construct a new TrackerHit.
* Vector and matrix supplied to the constructor will be owned by the created hit.
+ * Signal and time associated with this hit will be set to those of the <tt>TrackerCluster</tt>.
*
* @param cluster {@link TrackerCluster} from which this hit was created.
* @param position Position of the hit.
@@ -51,6 +52,33 @@
_length = length;
}
+ /**
+ * Construct a new TrackerHit.
+ * Vector and matrix supplied to the constructor will be owned by the created hit.
+ *
+ * @param cluster {@link TrackerCluster} from which this hit was created.
+ * @param position Position of the hit.
+ * @param length Length of segment defining the hit.
+ * @param covMatrix Covariance matrix
+ * @param isLocal <tt>true</tt> if position and covariance matrix are given
+ * in the <tt>Sensor</tt> local reference frame, <tt>false</tt>
+ * if they are given in the global frame.
+ * @param signal Signal amplitude to be associated with this hit.
+ * @param time Time to be associated with this hit.
+ */
+ public TrackerHitSegment(TrackerCluster cluster, Hep3Vector position, double length,
+ SymmetricMatrix covMatrix, boolean isLocal, double signal, double time) {
+ super(cluster, signal, time);
+ if (isLocal) {
+ _posLocal = position;
+ _covLocal = covMatrix;
+ } else {
+ _posGlobal = position;
+ _covGlobal = covMatrix;
+ }
+ _length = length;
+ }
+
// -- Position and covariance matrix in local coordinates : -------------------
/**
CVSspam 0.2.8