View Javadoc

1   package org.lcsim.lcio;
2   
3   import hep.io.sio.SIOInputStream;
4   import hep.io.sio.SIOOutputStream;
5   
6   import java.io.IOException;
7   import org.lcsim.event.EventHeader.LCMetaData;
8   import org.lcsim.event.RawTrackerHit;
9   
10  /**
11   * @author tonyj
12   */
13  class SIORawTrackerHitBlockHandler extends AbstractBlockHandler
14  {
15      public String getType()
16      {
17          return "TrackerRawData";
18      }
19  
20      public Class getClassForType()
21      {
22          return RawTrackerHit.class;
23      }
24  
25      LCIOCallback addCollectionElements(LCIOEvent event, LCIOCollection collection, SIOInputStream in, int n, int version)
26              throws IOException
27      {
28          LCMetaData meta = event.getMetaData(collection);
29          for (int i = 0; i < n; i++)
30              collection.add(new SIORawTrackerHit(in, collection.getFlags(), version, meta));
31          return null;
32      }
33  
34      void writeCollectionElement(Object element, SIOOutputStream out, int flags) throws IOException
35      {
36          SIORawTrackerHit.write((RawTrackerHit) element, out, flags);
37      }
38  }