8 #define IO_LCREADER_H 1
13 #include "EVENT/LCEvent.h"
14 #include "EVENT/LCRunHeader.h"
15 #include "Exceptions.h"
16 #include "LCIOSTLTypes.h"
20 class LCEventListener;
46 virtual void open(
const std::string & filename)
throw (
IOException, std::exception ) = 0;
55 virtual void open(
const std::vector<std::string> & filenames)
throw (
IOException, std::exception ) = 0;
69 virtual EVENT::LCRunHeader *
readNextRunHeader(
int accessMode) throw (IOException, std::exception ) = 0;
76 virtual EVENT::LCEvent *
readNextEvent() throw (IOException, std::exception ) = 0;
83 virtual EVENT::LCEvent *
readNextEvent(
int accessMode) throw (IOException, std::exception ) = 0;
101 virtual
void getRuns(EVENT::IntVec & runs) = 0;
109 virtual
void getEvents(EVENT::IntVec & events) = 0;
120 virtual
void skipNEvents(
int n) throw (IOException, std::exception ) = 0;
127 virtual EVENT::LCRunHeader *
readRunHeader(
int runNumber) throw (IOException, std::exception ) = 0;
134 virtual EVENT::LCRunHeader *
readRunHeader(
int runNumber,
int accessMode) throw (IOException, std::exception ) = 0;
141 virtual EVENT::LCEvent *
readEvent(
int runNumber,
int evtNumber) throw (IOException, std::exception ) = 0;
148 virtual EVENT::LCEvent *
readEvent(
int runNumber,
int evtNumber,
int accessMode) throw (IOException, std::exception ) = 0;
154 virtual
void close() throw (IOException, std::exception ) = 0;
178 virtual
void readStream() throw (IOException, std::exception ) = 0;
186 virtual
void readStream(
int maxRecord) throw (IOException, std::exception ) = 0;
virtual void registerLCRunListener(LCRunListener *ls)=0
Registers a listener for reading LCEventsLCRunHeaders from a stream.
virtual EVENT::LCRunHeader * readNextRunHeader()=0
Reads the next run header from the file.
virtual EVENT::LCEvent * readEvent(int runNumber, int evtNumber)=0
Reads the specified event from file.
virtual int getNumberOfEvents()=0
Return the number of events 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 int getNumberOfRuns()=0
Return the number of runs (run headers) in the file - the file has to be open.
Listener for the occurence of LCEvents when reading a stream.
Definition: LCEventListener.h:24
virtual EVENT::LCEvent * readNextEvent()=0
Reads the next event from the file.
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 co...
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 skipNEvents(int n)=0
Skips the next n events from the current position.
Listener for the occurence of LCRunHeader when reading a stream.
Definition: LCRunListener.h:24
IOException used for reading/writing errors.
Definition: Exceptions.h:92
Interface for reading data from LCIO.
Definition: LCReader.h:32
virtual EVENT::LCRunHeader * readRunHeader(int runNumber)=0
Reads the specified runHeader from file.
virtual void removeLCEventListener(LCEventListener *ls)=0
Remove a listener for reading LCEvents from a stream.
static const int directAccess
Configuration flags for the LCReader instance - to be used with LCFactory::createLCReader().
Definition: LCReader.h:41
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 st...
virtual void close()=0
Closes the output file/stream etc.
virtual void open(const std::string &filename)=0
Opens a file for reading (read-only).
virtual void registerLCEventListener(LCEventListener *ls)=0
Registers a listener for reading LCEvents from a stream.
virtual ~LCReader()
Destructor.
Definition: LCReader.h:36