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.base.SiliconRawHit;
8   
9   /**
10   *
11   * @author tonyj
12   */
13  class SIOSiliconTrackerHitBlockHandler extends AbstractBlockHandler
14  {
15     public String getType() { return "SiliconRawHit"; }
16     public Class getClassForType() { return SiliconRawHit.class; }
17     LCIOCallback addCollectionElements(LCIOEvent event, LCIOCollection collection, SIOInputStream in, int n, int version) throws IOException
18     {
19        for (int i = 0; i < n; i++)
20           collection.add(new SIOSiliconTrackerHit(in, collection.getFlags(), version));
21        return null;
22     }
23     
24     void writeCollectionElement(Object element, SIOOutputStream out, int flags) throws IOException
25     {
26        SIOSiliconTrackerHit.write((SiliconTrackerHit) element, out, flags);
27     }
28  }