FreeHEP API
Version current

hep.io.mcfio
Class MCFIOWriter

java.lang.Object
  extended byhep.io.mcfio.MCFIOWriter
All Implemented Interfaces:
hep.io.mcfio.MCFIOConstants
Direct Known Subclasses:
StdhepWriter

public class MCFIOWriter
extends Object
implements hep.io.mcfio.MCFIOConstants

A class for writing MCFIO files.

Version:
$Id: MCFIOWriter.java,v 1.3 2003/09/16 23:11:54 tonyj Exp $
Author:
Tony Johnson (tonyj@slac.stanford.edu)
Source Code:
MCFIOWriter.java

Field Summary
protected static boolean compatibilityMode
           
static int EVENTHEADER
           
static int EVENTTABLE
           
static int FILEHEADER
           
static int MCF_DEFAULT_TABLE_SIZE
           
static int MCF_XDR_F_TITLE_LENGTH
           
static int MCF_XDR_VERSION_LENGTH
           
 
Constructor Summary
MCFIOWriter(String file, String title, String comment, int numevts, int[] blockIds, String[] blockNames)
          Open an MCFIO file for writing.
 
Method Summary
 void close()
           
 void setCompatibilityMode(boolean mode)
          Set compatibility mode.
 void write(MCFIOEvent event)
          Write an event
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

compatibilityMode

protected static boolean compatibilityMode

MCF_XDR_F_TITLE_LENGTH

public static final int MCF_XDR_F_TITLE_LENGTH
See Also:
Constant Field Values

MCF_XDR_VERSION_LENGTH

public static final int MCF_XDR_VERSION_LENGTH
See Also:
Constant Field Values

MCF_DEFAULT_TABLE_SIZE

public static final int MCF_DEFAULT_TABLE_SIZE
See Also:
Constant Field Values

FILEHEADER

public static final int FILEHEADER
See Also:
Constant Field Values

EVENTTABLE

public static final int EVENTTABLE
See Also:
Constant Field Values

EVENTHEADER

public static final int EVENTHEADER
See Also:
Constant Field Values
Constructor Detail

MCFIOWriter

public MCFIOWriter(String file,
                   String title,
                   String comment,
                   int numevts,
                   int[] blockIds,
                   String[] blockNames)
            throws IOException
Open an MCFIO file for writing.

Parameters:
title - The title of the file
comment - The comment associate with the file
numevts - The number of events expected to be written
blockIds - The user defined blocks that will be included in this file
blockNames - Names for the blocks defined by blockIds
Method Detail

setCompatibilityMode

public void setCompatibilityMode(boolean mode)
Set compatibility mode. In the old C implementation there were various limits, such as the length of some strings and the maximum number of particles that could be written to stdhep events. There is no reason to have any of these limits in the Java implementation, but if we ignore them then the resulting file might not be readable by the old C implementation. By default this implementation enforces the same limits as the C implementation, but setting compatibilyMode to false will turn off this limitation.


close

public void close()
           throws IOException
Throws:
IOException

write

public void write(MCFIOEvent event)
           throws IOException
Write an event

Throws:
IOException

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.