hep.io.mcfio
Class MCFIOReader

java.lang.Object
  extended by hep.io.mcfio.MCFIOReader

public class MCFIOReader
extends java.lang.Object

A class for reading MCFIO files

Version:
$Id: MCFIOReader.java 13660 2009-10-09 23:26:27Z tonyj $
Author:
Tony Johnson (tonyj@slac.stanford.edu)

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(java.io.InputStream input)
           
MCFIOReader(java.lang.String file)
           
 
Method Summary
 void close()
           
protected  MCFIOBlock createUserBlock(int id)
          Override this method to create user defined blocks
 java.lang.String getComment()
          Get the comment associated with the file
 java.lang.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
 java.lang.String getTitle()
          Get the title of the file
 MCFIOEvent nextEvent()
          Get the next event.
 void rewind()
           
 void skip(int nEvents)
          Skip events
 
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(java.lang.String file)
            throws java.io.IOException
Throws:
java.io.IOException

MCFIOReader

public MCFIOReader(java.io.InputStream input)
            throws java.io.IOException
Throws:
java.io.IOException
Method Detail

getComment

public java.lang.String getComment()
Get the comment associated with the file


getDate

public java.lang.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 java.lang.String getTitle()
Get the title of the file


close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

skip

public void skip(int nEvents)
          throws java.io.IOException
Skip events

Parameters:
nEvents - The number of events to skip. Must be >= 0.
Throws:
java.io.IOException

nextEvent

public MCFIOEvent nextEvent()
                     throws java.io.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:
java.io.IOException

rewind

public void rewind()
            throws java.io.IOException
Throws:
java.io.IOException

createUserBlock

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

Throws:
java.io.IOException


Copyright © 2000-2010 FreeHEP. All Rights Reserved.