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   
8   import org.lcsim.event.SimTrackerHit;
9   import org.lcsim.event.EventHeader.LCMetaData;
10  
11  /**
12   * @author tonyj
13   */
14  class SIOSimTrackerHitBlockHandler extends AbstractBlockHandler
15  {
16      public String getType()
17      {
18          return "SimTrackerHit";
19      }
20  
21      public Class getClassForType()
22      {
23          return SimTrackerHit.class;
24      }
25  
26      LCIOCallback addCollectionElements(LCIOEvent event, LCIOCollection collection, SIOInputStream in, int n, int version)
27              throws IOException
28      {
29          LCMetaData meta = event.getMetaData(collection);
30          for (int i = 0; i < n; i++)
31              collection.add(new SIOSimTrackerHit(in, collection.getFlags(), version, meta));
32          return null;
33      }
34  
35      void writeCollectionElement(Object element, SIOOutputStream out, int flags) throws IOException
36      {
37          SIOSimTrackerHit.write((SimTrackerHit) element, out, flags);
38      }
39  }