IO::LCReader Class Reference

Interface for reading data from LCIO. More...

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

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

List of all members.

Public Member Functions

virtual ~LCReader ()
 Destructor.
virtual void open (const std::string &filename)=0
 Opens a file for reading (read-only).
virtual void open (const std::vector< std::string > &filenames)=0
 Opens a list of files for reading (read-only).
virtual EVENT::LCRunHeaderreadNextRunHeader ()=0
 Reads the next run header from the file.
virtual EVENT::LCRunHeaderreadNextRunHeader (int accessMode)=0
 Same as readNextRunHeader() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.
virtual EVENT::LCEventreadNextEvent ()=0
 Reads the next event from the file.
virtual EVENT::LCEventreadNextEvent (int accessMode)=0
 Same as readNextEvent() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.
virtual int getNumberOfEvents ()=0
 Return the number of events in the file - the file has to be open.
virtual int getNumberOfRuns ()=0
 Return the number of runs (run headers) in the file - the file has to be open.
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.
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.
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.
virtual void skipNEvents (int n)=0
 Skips the next n events from the current position.
virtual EVENT::LCRunHeaderreadRunHeader (int runNumber)=0
 Reads the specified runHeader from file.
virtual EVENT::LCRunHeaderreadRunHeader (int runNumber, int accessMode)=0
 Same as LCEvent* readRunHeader(int runNumber) allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.
virtual EVENT::LCEventreadEvent (int runNumber, int evtNumber)=0
 Reads the specified event from file.
virtual EVENT::LCEventreadEvent (int runNumber, int evtNumber, int accessMode)=0
 Same as LCEvent* readEvent(int runNumber, int evtNumber) allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.
virtual void close ()=0
 Closes the output file/stream etc.
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
 Reads the input stream and notifies registered listeners according to the object type found in the stream.
virtual void readStream (int maxRecord)=0
 Reads maxRecord from the input stream and notifies registered listeners according to the object type found in the stream.

Static Public Attributes

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

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 (  )  [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 (  )  [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 (  )  [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::vector< std::string > &  filenames  )  [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 void IO::LCReader::open ( const std::string &  filename  )  [pure virtual]

Opens a file for reading (read-only).

Exceptions:
IOException 

Implemented in SIO::SIOReader.

virtual EVENT::LCEvent* IO::LCReader::readEvent ( int  runNumber,
int  evtNumber,
int  accessMode 
) [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::readEvent ( int  runNumber,
int  evtNumber 
) [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::readNextEvent ( int  accessMode  )  [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::LCEvent* IO::LCReader::readNextEvent (  )  [pure virtual]

Reads the next event from the file.

Returns NULL if 'EOF' read.

Exceptions:
IOException 

Implemented in SIO::SIOReader.

virtual EVENT::LCRunHeader* IO::LCReader::readNextRunHeader ( int  accessMode  )  [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::readNextRunHeader (  )  [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::readRunHeader ( int  runNumber,
int  accessMode 
) [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 EVENT::LCRunHeader* IO::LCReader::readRunHeader ( int  runNumber  )  [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 void IO::LCReader::readStream ( int  maxRecord  )  [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::readStream (  )  [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::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  )  [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:
 All Classes Namespaces Functions Variables Typedefs Friends

Generated on 6 Mar 2020 for LCIO by  doxygen 1.6.1