View Javadoc

1   package org.lcsim.lcio;
2   
3   import hep.io.sio.SIOInputStream;
4   import hep.io.sio.SIOOutputStream;
5   import java.io.IOException;
6   import org.lcsim.event.SiliconTrackerHit;
7   import org.lcsim.event.TPCHit;
8   
9   /**
10   * Simple implementation of LCIO SiliconTrackerHit IO
11   * @author tonyj
12   */
13  class SIOSiliconTrackerHit implements SiliconTrackerHit
14  {
15     private final long cellID;
16     private final int timestamp;
17     private final int adcCounts;
18     
19     public SIOSiliconTrackerHit(SIOInputStream in, int flags, int version) throws IOException
20     {
21        cellID = in.readLong();
22        timestamp = in.readInt();
23        adcCounts = in.readInt();
24        in.readPTag(this);
25     }
26     
27     public long getCellID()
28     {
29        return cellID;
30     }
31     
32     public int getTimestamp()
33     {
34        return timestamp;
35     }
36     
37     public int getADCCounts()
38     {
39        return adcCounts;
40     }
41     
42     static void write(SiliconTrackerHit hit, SIOOutputStream out, int flags) throws IOException
43     {
44        out.writeLong(hit.getCellID());
45        out.writeInt(hit.getTimestamp());
46        out.writeInt(hit.getADCCounts());
47        out.writePTag(hit);
48     }
49  }