Print

Print


Commit in lcsim/src/org/lcsim/event/base on MAIN
BaseRawCalorimeterHit.java+44-261.1 -> 1.2
base RawCalorimeterHit impl now implements BaseHitWithPosition which should automatically setup links to detector components

lcsim/src/org/lcsim/event/base
BaseRawCalorimeterHit.java 1.1 -> 1.2
diff -u -r1.1 -r1.2
--- BaseRawCalorimeterHit.java	21 Mar 2012 01:25:57 -0000	1.1
+++ BaseRawCalorimeterHit.java	30 Apr 2012 22:54:11 -0000	1.2
@@ -1,34 +1,52 @@
 package org.lcsim.event.base;
 
+import org.lcsim.detector.IDetectorElement;
 import org.lcsim.event.RawCalorimeterHit;
 
 /**
  * This is a basic implementation of {@link org.lcsim.event.RawCalorimeterHit}.
+ * 
  * @author Jeremy McCormick <[log in to unmask]>
  */
-public class BaseRawCalorimeterHit implements RawCalorimeterHit {
-	
-	long id;
-	int amplitude;
-	int timestamp;
-
-	protected BaseRawCalorimeterHit() {}
-	
-	public BaseRawCalorimeterHit(long id, int amplitude, int timestamp) {
-		this.id = id;
-		this.amplitude = amplitude;
-		this.timestamp = timestamp;
-	}
-
-	public long getCellID() {
-		return id;
-	}
-
-	public int getAmplitude() {
-		return amplitude;
-	}
-
-	public int getTimeStamp() {
-		return timestamp;
-	}	
-}
+public class BaseRawCalorimeterHit extends BaseHitWithPosition implements RawCalorimeterHit {
+
+    long id;
+    int amplitude;
+    int timestamp;
+
+    protected BaseRawCalorimeterHit() {
+    }
+
+    public BaseRawCalorimeterHit(long id, int amplitude, int timestamp) {
+        this.id = id;
+        this.amplitude = amplitude;
+        this.timestamp = timestamp;
+    }
+
+    public BaseRawCalorimeterHit(long id, int amplitude, int timestamp, IDetectorElement de) {
+        this.id = id;
+        this.amplitude = amplitude;
+        this.timestamp = timestamp;
+        this.de = de;
+    }
+
+    public long getCellID() {
+        return id;
+    }
+
+    public int getAmplitude() {
+        return amplitude;
+    }
+
+    public int getTimeStamp() {
+        return timestamp;
+    }
+
+    /**
+     * The default position is that of the associated DetectorElement.
+     * @return The position as a size 3 double array.
+     */
+    public double[] getPosition() {
+        return getDetectorElement().getGeometry().getPosition().v();
+    }
+}
\ No newline at end of file
CVSspam 0.2.12


Use REPLY-ALL to reply to list

To unsubscribe from the LCD-CVS list, click the following link:
https://listserv.slac.stanford.edu/cgi-bin/wa?SUBED1=LCD-CVS&A=1