View Javadoc

1   /*
2    * SiliconRawHit.java
3    *
4    * Created on February 21, 2006, 5:41 PM
5    *
6    * To change this template, choose Tools | Template Manager
7    * and open the template in the editor.
8    */
9   
10  package org.lcsim.event.base;
11  
12  /**
13   *
14   * @author ngraf
15   */
16  public class SiliconRawHit
17  {
18      private int _cellID0;
19      private int _cellID1;
20      private int _timeStamp;
21      private int _adcCounts;
22      
23      /** Creates a new instance of SiliconRawHit */
24      public SiliconRawHit(int cellID0, int cellID1, int timeStamp, int adcCounts)
25      {
26          _cellID0 = cellID0;
27          _cellID1 = cellID1;
28          _timeStamp = timeStamp;
29          _adcCounts = adcCounts;
30      }
31  
32      /** The id0 of the cell that recorded the hit.
33       */
34      public int getCellID0()
35      {
36          return _cellID0;
37      }
38  
39      /** The id1 of the cell that recorded the hit.
40       */
41      public int getCellID1()
42      {
43          return _cellID1;
44      }
45  
46      /** The detector specific time stamp of the hit.
47       */
48      public int getTimeStamp()
49      {
50          return _timeStamp;
51      }
52  
53      /** The ADC counts of the hit.
54       */
55      public int getADCCounts()
56      {
57          return _adcCounts;
58      }
59      
60      /** Adds counts adcCounts at time timeStamp.
61       * If timeStamp is prior to current time, time will be overwritten. 
62       */
63      public void addHit(int timeStamp, int adcCounts)
64      {
65          _adcCounts+=adcCounts;
66          if(timeStamp<_timeStamp) _timeStamp=timeStamp;
67      }
68      
69  }