Concrete implementation of LCWriter using SIO. More...
#include <SIO/SIOReader.h>
Public Member Functions | |
SIOReader (int lcReaderFlag=0) | |
Default constructor. | |
virtual void | open (const std::vector< std::string > &filenames) throw (IO::IOException, std::exception) |
Opens a list of files for reading (read-only). More... | |
virtual void | open (const std::string &filename) throw (IO::IOException, std::exception) |
Opens a file for reading (read-only). More... | |
virtual EVENT::LCRunHeader * | readNextRunHeader () throw (IO::IOException, std::exception) |
Reads the next run header from the file. More... | |
virtual EVENT::LCRunHeader * | readNextRunHeader (int accessMode) throw (IO::IOException, std::exception) |
Same as readNextRunHeader() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. More... | |
virtual EVENT::LCEvent * | readNextEvent () throw (IO::IOException, std::exception) |
Reads the next event from the file. More... | |
virtual EVENT::LCEvent * | readNextEvent (int accessMode) throw (IO::IOException, std::exception) |
Same as readNextRunHeader() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update. More... | |
virtual int | getNumberOfEvents () throw (IO::IOException, std::exception ) |
Return the number of events in the file - the file has to be open. More... | |
virtual int | getNumberOfRuns () throw (IO::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) |
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) |
Return the run and event numbers of the events in the file - the file has to be open. More... | |
virtual void | skipNEvents (int n) throw (IO::IOException, std::exception ) |
Skips the next n events from the current position. More... | |
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. More... | |
virtual EVENT::LCRunHeader * | readRunHeader (int runNumber) throw (IO::IOException , std::exception) |
Reads the specified runHeader from file. More... | |
virtual EVENT::LCRunHeader * | readRunHeader (int runNumber, int accessMode) throw (IO::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::LCEvent * | readEvent (int runNumber, int evtNumber) throw (IO::IOException, std::exception ) |
Reads the specified event from file. More... | |
virtual EVENT::LCEvent * | readEvent (int runNumber, int evtNumber, int accessMode) throw (IO::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 () throw (IO::IOException, std::exception) |
Closes the output file/stream etc. More... | |
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 () throw (IO::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) throw (IO::IOException, std::exception) |
Reads maxRecord from the input stream and notifies registered listeners according to the object type found in the stream. More... | |
![]() | |
virtual | ~LCReader () |
Destructor. | |
Protected Attributes | |
SIO_record * | _dummyRecord |
SIO_stream * | _stream |
SIORunHeaderHandler * | _runHandler |
SIOEventHandler * | _evtHandler |
Additional Inherited Members | |
![]() | |
static const int | directAccess = 0x00000001 << 0 |
Configuration flags for the LCReader instance - to be used with LCFactory::createLCReader(). More... | |
Concrete implementation of LCWriter using SIO.
|
virtual |
Closes the output file/stream etc.
IOException |
Implements IO::LCReader.
References SIO::LCIORandomAccessMgr::clear().
|
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 SIO::LCIORandomAccessMgr::getEventMap(), getNumberOfEvents(), and getNumberOfRuns().
|
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.
References SIO::LCIORandomAccessMgr::getEventMap().
Referenced by getEvents().
|
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.
References SIO::LCIORandomAccessMgr::getEventMap().
Referenced by getEvents(), and getRuns().
|
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 SIO::LCIORandomAccessMgr::getEventMap(), and getNumberOfRuns().
|
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.
IOException |
Implements IO::LCReader.
|
virtual |
Opens a file for reading (read-only).
IOException |
Implements IO::LCReader.
References SIO::LCSIO::getValidSIOName().
|
virtual |
Reads the specified event from file.
Returns NULL if the specified event hasn't been found in the file.
IOException |
Implements IO::LCReader.
|
virtual |
Same as LCEvent* readEvent(int runNumber, int evtNumber allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.
IOException |
Implements IO::LCReader.
|
virtual |
|
virtual |
Same as readNextRunHeader() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.
IOException |
Implements IO::LCReader.
|
virtual |
|
virtual |
Same as readNextRunHeader() but allows to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.
IOException |
Implements IO::LCReader.
|
virtual |
Reads the specified runHeader from file.
Returns NULL if the specified runHeader hasn't been found in the file.
IOException |
Implements IO::LCReader.
|
virtual |
Same as LCEvent* readRunHeader(int runNumber) allowing to set the access mode LCIO::READ_ONLY (default) or LCIO::Update.
IOException |
Implements IO::LCReader.
|
virtual |
Reads the input stream and notifies registered listeners according to the object type found in the stream.
IOException | |
EndOfException |
Implements IO::LCReader.
|
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.
IOException | |
EndOfException |
Implements IO::LCReader.
|
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.
|
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.