FreeHEP API
Version current

hep.io.mcfio
Class MCFIOReader

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

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

A class for reading MCFIO files

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

Field Summary
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
MCFIOReader(InputStream input)
           
MCFIOReader(String file)
           
 
Method Summary
 void close()
           
protected  MCFIOBlock createUserBlock(int id)
          Override this method to create user defined blocks
 String getComment()
          Get the comment associated with the file
 String getDate()
          Get the date when the file was created
 int getNumberOfEvents()
          The actual number of events on the file
 int getNumberOfEventsExpected()
          The expected number of events in the file
 String getTitle()
          Get the title of the file
 MCFIOEvent nextEvent()
          Get the next event.
 void rewind()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

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

MCFIOReader

public MCFIOReader(String file)
            throws IOException

MCFIOReader

public MCFIOReader(InputStream input)
            throws IOException
Method Detail

getComment

public String getComment()
Get the comment associated with the file


getDate

public String getDate()
Get the date when the file was created


getNumberOfEvents

public int getNumberOfEvents()
The actual number of events on the file


getNumberOfEventsExpected

public int getNumberOfEventsExpected()
The expected number of events in the file


getTitle

public String getTitle()
Get the title of the file


close

public void close()
           throws IOException
Throws:
IOException

nextEvent

public MCFIOEvent nextEvent()
                     throws IOException
Get the next event. Calling this method does not necessarily mean the full event data will be read. Initially only the event number, store number, run number, and trigger mask are available. Once one of the methods requiring information about the blocks inside the event are called the entire event will be read. Thus it is possible to loop over events looking for events which satisfy some criterion, without actually paying the overhead of decoding the whole event.

Throws:
IOException

rewind

public void rewind()
            throws IOException
Throws:
IOException

createUserBlock

protected MCFIOBlock createUserBlock(int id)
                              throws IOException
Override this method to create user defined blocks

Throws:
IOException

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.