View Javadoc

1   package org.lcsim.event.base;
2   
3   import org.lcsim.detector.IDetectorElement;
4   import org.lcsim.detector.identifier.Identifier;
5   import org.lcsim.event.RawCalorimeterHit;
6   
7   /**
8    * This is a basic implementation of {@link org.lcsim.event.RawCalorimeterHit}.
9    * 
10   * @author Jeremy McCormick <jeremym@slac.stanford.edu>
11   */
12  public class BaseRawCalorimeterHit extends BaseHit implements RawCalorimeterHit {
13  
14      long id;
15      int amplitude;
16      int timestamp;
17  
18      protected BaseRawCalorimeterHit() {
19      }
20  
21      public BaseRawCalorimeterHit(long id, int amplitude, int timestamp) {
22          this.id = id;
23          this.amplitude = amplitude;
24          this.timestamp = timestamp;
25          this.packedID = new Identifier(id);
26      }
27  
28      public BaseRawCalorimeterHit(long id, int amplitude, int timestamp, IDetectorElement de) {
29          this.id = id;
30          this.amplitude = amplitude;
31          this.timestamp = timestamp;
32          this.detectorElement = de;
33      }
34  
35      public long getCellID() {
36          return id;
37      }
38  
39      public int getAmplitude() {
40          return amplitude;
41      }
42  
43      public int getTimeStamp() {
44          return timestamp;
45      }
46  
47      /**
48       * The default position is that of the associated DetectorElement.
49       * @return The position as a size 3 double array.
50       */
51      public double[] getPosition() {
52          return getDetectorElement().getGeometry().getPosition().v();
53      }
54  }