SIO::SIOReader Class Reference

Concrete implementation of LCWriter using SIO. More...

#include <SIO/SIOReader.h>

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

List of all members.

Public Member Functions

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

Protected Member Functions

void setUpHandlers ()
void readRecord ()
void postProcessEvent ()
void getEventMap ()
void recreateEventMap ()

Detailed Description

Concrete implementation of LCWriter using SIO.

Author:
gaede
Version:
Id
SIOReader.h,v 1.29 2011-03-03 16:00:12 gaede Exp

Member Function Documentation

void SIO::SIOReader::close (  )  [virtual]

Closes the output file/stream etc.

Exceptions:
IOException 

Implements IO::LCReader.

void SIO::SIOReader::getEvents ( EVENT::IntVec events  )  [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+].

Implements IO::LCReader.

References getNumberOfEvents(), and getNumberOfRuns().

int SIO::SIOReader::getNumberOfEvents (  )  [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.

Implements IO::LCReader.

Referenced by getEvents().

int SIO::SIOReader::getNumberOfRuns (  )  [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.

Implements IO::LCReader.

Referenced by getEvents(), and getRuns().

void SIO::SIOReader::getRuns ( EVENT::IntVec runs  )  [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.

Implements IO::LCReader.

References getNumberOfRuns().

void SIO::SIOReader::open ( const std::string &  filename  )  [virtual]

Opens a file for reading (read-only).

Exceptions:
IOException 

Implements IO::LCReader.

References SIO::LCSIO::getValidSIOName().

void SIO::SIOReader::open ( const std::vector< std::string > &  filenames  )  [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 

Implements IO::LCReader.

EVENT::LCEvent * SIO::SIOReader::readEvent ( int  runNumber,
int  evtNumber,
int  accessMode 
) [virtual]

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

Exceptions:
IOException 

Implements IO::LCReader.

References readNextEvent(), and readNextRunHeader().

EVENT::LCEvent * SIO::SIOReader::readEvent ( int  runNumber,
int  evtNumber 
) [virtual]

Reads the specified event from file.

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

Exceptions:
IOException 

Implements IO::LCReader.

LCEvent * SIO::SIOReader::readNextEvent ( int  accessMode  )  [virtual]

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

Exceptions:
IOException 

Implements IO::LCReader.

LCEvent * SIO::SIOReader::readNextEvent (  )  [virtual]

Reads the next event from the file.

Exceptions:
IOException 

Implements IO::LCReader.

Referenced by readEvent().

LCRunHeader * SIO::SIOReader::readNextRunHeader ( int  accessMode  )  [virtual]

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

Exceptions:
IOException 

Implements IO::LCReader.

LCRunHeader * SIO::SIOReader::readNextRunHeader (  )  [virtual]

Reads the next run header from the file.

Exceptions:
IOException 

Implements IO::LCReader.

Referenced by readEvent(), and readRunHeader().

EVENT::LCRunHeader * SIO::SIOReader::readRunHeader ( int  runNumber,
int  accessMode 
) [virtual]

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

Exceptions:
IOException 

Implements IO::LCReader.

References readNextRunHeader().

EVENT::LCRunHeader * SIO::SIOReader::readRunHeader ( int  runNumber  )  [virtual]

Reads the specified runHeader from file.

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

Exceptions:
IOException 

Implements IO::LCReader.

void SIO::SIOReader::readStream ( int  maxRecord  )  [virtual]

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

Throws EndOfException if less than maxRecord records are found in the stream.

Exceptions:
IOException 
EndOfException 

Implements IO::LCReader.

void SIO::SIOReader::readStream (  )  [virtual]

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

Exceptions:
IOException 
EndOfException 

Implements IO::LCReader.

void SIO::SIOReader::setReadCollectionNames ( const std::vector< std::string > &  colnames  )  [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.

Implements IO::LCReader.

void SIO::SIOReader::skipNEvents ( int  n  )  [virtual]

Skips the next n events from the current position.

In fact simply reads the next n event headers so that the next event read is the (n+1)-th event.

Implements IO::LCReader.


The documentation for this class was generated from the following files:
 All Classes Namespaces Functions Variables Typedefs Friends

Generated on 6 Mar 2020 for LCIO by  doxygen 1.6.1