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