LCIO  "2.7.4"
 All Classes Namespaces Functions Variables Typedefs Friends Pages
Public Member Functions | Static Public Attributes | List of all members
IO::LCReader Class Referenceabstract

Interface for reading data from LCIO. More...

#include <pre-generated/IO/LCReader.h>

Inheritance diagram for IO::LCReader:
SIO::SIOReader

Public Member Functions

virtual ~LCReader ()
 Destructor.
 
virtual void open (const std::string &filename)=0 throw (IOException, std::exception )
 Opens a file for reading (read-only). More...
 
virtual void open (const std::vector< std::string > &filenames)=0 throw (IOException, std::exception )
 Opens a list of files for reading (read-only). More...
 
virtual EVENT::LCRunHeaderreadNextRunHeader ()=0 throw (IOException, std::exception )
 Reads the next run header from the file. More...
 
virtual EVENT::LCRunHeaderreadNextRunHeader (int accessMode)=0 throw (IOException, std::exception )
 Same as readNextRunHeader() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. More...
 
virtual EVENT::LCEventreadNextEvent ()=0 throw (IOException, std::exception )
 Reads the next event from the file. More...
 
virtual EVENT::LCEventreadNextEvent (int accessMode)=0 throw (IOException, std::exception )
 Same as readNextEvent() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. More...
 
virtual int getNumberOfEvents ()=0 throw (IOException, std::exception )
 Return the number of events in the file - the file has to be open. More...
 
virtual int getNumberOfRuns ()=0 throw (IOException, std::exception )
 Return the number of runs (run headers) in the file - the file has to be open. More...
 
virtual void getRuns (EVENT::IntVec &runs)=0
 Return the run numbers of the runs (run headers) in the file - the file has to be open. More...
 
virtual void getEvents (EVENT::IntVec &events)=0
 Return the run and event numbers of the events in the file - the file has to be open. More...
 
virtual void setReadCollectionNames (const std::vector< std::string > &colnames)=0
 Limit the collection names that are going to be read to the subset given in the vector - all other collection will be ignored. More...
 
virtual void skipNEvents (int n)=0 throw (IOException, std::exception )
 Skips the next n events from the current position. More...
 
virtual EVENT::LCRunHeaderreadRunHeader (int runNumber)=0 throw (IOException, std::exception )
 Reads the specified runHeader from file. More...
 
virtual EVENT::LCRunHeaderreadRunHeader (int runNumber, int accessMode)=0 throw (IOException, std::exception )
 Same as LCEvent* readRunHeader(int runNumber) allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. More...
 
virtual EVENT::LCEventreadEvent (int runNumber, int evtNumber)=0 throw (IOException, std::exception )
 Reads the specified event from file. More...
 
virtual EVENT::LCEventreadEvent (int runNumber, int evtNumber, int accessMode)=0 throw (IOException, std::exception )
 Same as LCEvent* readEvent(int runNumber, int evtNumber) allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. More...
 
virtual void close ()=0 throw (IOException, std::exception )
 Closes the output file/stream etc. More...
 
virtual void registerLCEventListener (LCEventListener *ls)=0
 Registers a listener for reading LCEvents from a stream.
 
virtual void removeLCEventListener (LCEventListener *ls)=0
 Remove a listener for reading LCEvents from a stream.
 
virtual void registerLCRunListener (LCRunListener *ls)=0
 Registers a listener for reading LCEventsLCRunHeaders from a stream.
 
virtual void removeLCRunListener (LCRunListener *ls)=0
 Remove a listener for reading LCRunHeaders from a stream.
 
virtual void readStream ()=0 throw (IOException, std::exception )
 Reads the input stream and notifies registered listeners according to the object type found in the stream. More...
 
virtual void readStream (int maxRecord)=0 throw (IOException, std::exception )
 Reads maxRecord from the input stream and notifies registered listeners according to the object type found in the stream. More...
 

Static Public Attributes

static const int directAccess = 0x00000001 << 0
 Configuration flags for the LCReader instance - to be used with LCFactory::createLCReader(). More...
 

Detailed Description

Interface for reading data from LCIO.

Use LCFactory to instantiate a corresponding LCWriter object for the output format at hand (SIO only, so far).

See Also
LCFactory
Author
gaede
Version
Mar 4, 2003

Member Function Documentation

virtual void IO::LCReader::close ( )
throw (IOException,
std::exception
)
pure virtual

Closes the output file/stream etc.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual void IO::LCReader::getEvents ( EVENT::IntVec events)
pure virtual

Return the run and event numbers of the events in the file - the file has to be open.

In case several input files are specified in the open() method - the run and event numbers of the events in the file that is currently open are returned. The size of the vector events will be twice the number of events, where i-th run number will be in events[2*i] and the i-th event number in events[2*i+].

Implemented in SIO::SIOReader.

virtual int IO::LCReader::getNumberOfEvents ( )
throw (IOException,
std::exception
)
pure virtual

Return the number of events in the file - the file has to be open.

In case several input files are specified in the open() method - the number of events in the file that is currently open is returned.

Implemented in SIO::SIOReader.

virtual int IO::LCReader::getNumberOfRuns ( )
throw (IOException,
std::exception
)
pure virtual

Return the number of runs (run headers) in the file - the file has to be open.

In case several input files are specified in the open() method - the number of runs (run headers) in the file that is currently open is returned.

Implemented in SIO::SIOReader.

virtual void IO::LCReader::getRuns ( EVENT::IntVec runs)
pure virtual

Return the run numbers of the runs (run headers) in the file - the file has to be open.

In case several input files are specified in the open() method - the run numbers of the runs (run headers) in the file that is currently open is returned.

Implemented in SIO::SIOReader.

virtual void IO::LCReader::open ( const std::string &  filename)
throw (IOException,
std::exception
)
pure virtual

Opens a file for reading (read-only).

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual void IO::LCReader::open ( const std::vector< std::string > &  filenames)
throw (IOException,
std::exception
)
pure virtual

Opens a list of files for reading (read-only).

All subsequent read operations will operate on the list, i.e. if an EOF is encountered the next file in the list will be opened and read transparently to the user.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual EVENT::LCEvent* IO::LCReader::readEvent ( int  runNumber,
int  evtNumber 
)
throw (IOException,
std::exception
)
pure virtual

Reads the specified event from file.

Returns NULL if the specified event hasn't been found in the file.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual EVENT::LCEvent* IO::LCReader::readEvent ( int  runNumber,
int  evtNumber,
int  accessMode 
)
throw (IOException,
std::exception
)
pure virtual

Same as LCEvent* readEvent(int runNumber, int evtNumber) allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual EVENT::LCEvent* IO::LCReader::readNextEvent ( )
throw (IOException,
std::exception
)
pure virtual

Reads the next event from the file.

Returns NULL if 'EOF' read.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual EVENT::LCEvent* IO::LCReader::readNextEvent ( int  accessMode)
throw (IOException,
std::exception
)
pure virtual

Same as readNextEvent() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual EVENT::LCRunHeader* IO::LCReader::readNextRunHeader ( )
throw (IOException,
std::exception
)
pure virtual

Reads the next run header from the file.

Returns NULL if 'EOF' read.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual EVENT::LCRunHeader* IO::LCReader::readNextRunHeader ( int  accessMode)
throw (IOException,
std::exception
)
pure virtual

Same as readNextRunHeader() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual EVENT::LCRunHeader* IO::LCReader::readRunHeader ( int  runNumber)
throw (IOException,
std::exception
)
pure virtual

Reads the specified runHeader from file.

Returns NULL if the specified runHeader hasn't been found in the file.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual EVENT::LCRunHeader* IO::LCReader::readRunHeader ( int  runNumber,
int  accessMode 
)
throw (IOException,
std::exception
)
pure virtual

Same as LCEvent* readRunHeader(int runNumber) allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual void IO::LCReader::readStream ( )
throw (IOException,
std::exception
)
pure virtual

Reads the input stream and notifies registered listeners according to the object type found in the stream.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual void IO::LCReader::readStream ( int  maxRecord)
throw (IOException,
std::exception
)
pure virtual

Reads maxRecord from the input stream and notifies registered listeners according to the object type found in the stream.

An exception is thrown if less than maxRecord where read from the file.

Exceptions
IOException

Implemented in SIO::SIOReader.

virtual void IO::LCReader::setReadCollectionNames ( const std::vector< std::string > &  colnames)
pure virtual

Limit the collection names that are going to be read to the subset given in the vector - all other collection will be ignored.

This might improve the reading performance considerably in cases where only a small subset of the collections in the event is needed.

Implemented in SIO::SIOReader.

virtual void IO::LCReader::skipNEvents ( int  n)
throw (IOException,
std::exception
)
pure virtual

Skips the next n events from the current position.

Exceptions
IOException

Implemented in SIO::SIOReader.

Member Data Documentation

const int IO::LCReader::directAccess = 0x00000001 << 0
static

Configuration flags for the LCReader instance - to be used with LCFactory::createLCReader().


The documentation for this class was generated from the following file: