23 _reader( lcReaderFlag ) {
138 return readEvent( runNumber, evtNumber , EVENT::LCIO::READ_ONLY ) ;
201 eventImpl->setAccessMode( EVENT::LCIO::UPDATE ) ;
202 (*iter)->modifyEvent( eventImpl ) ;
203 eventImpl->setAccessMode( EVENT::LCIO::READ_ONLY ) ;
204 (*iter)->processEvent( eventImpl ) ;
215 hdrImpl->setReadOnly(
false ) ;
216 (*iter)->modifyRunHeader( hdrImpl ) ;
217 hdrImpl->setReadOnly(
true ) ;
218 (*iter)->processRunHeader( hdrImpl ) ;
void registerLCRunListener(IO::LCRunListener *ls) override
Registers a listener for reading LCEventsLCRunHeaders from a stream.
void readStream(const LCReaderListenerList &listeners)
Reads the input stream and notifies listeners according to the object type found in the stream...
void open(const std::string &filename)
Opens a file for reading (read-only).
int getNumberOfEvents()
Return the number of events in the file - the file has to be open.
EVENT::LCEvent * readEvent(int runNumber, int evtNumber) override
Reads the specified event from file.
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 co...
MT::LCReader _reader
The underlying implementation of the LCReader.
std::unique_ptr< EVENT::LCEvent > readEvent(int runNumber, int evtNumber, int accessMode=EVENT::LCIO::READ_ONLY)
Reads the specified event from file.
std::unique_ptr< EVENT::LCRunHeader > readRunHeader(int runNumber, int accessMode=EVENT::LCIO::READ_ONLY)
Reads the specified runHeader from file.
SIOReader(int lcReaderFlag=0)
Default constructor.
EVENT::LCRunHeader * readNextRunHeader() override
Reads the next run header from the file.
Listener for the occurence of LCEvents when reading a stream.
void skipNEvents(int n)
Skips the next n events from the current position.
void getRuns(EVENT::IntVec &runs) override
Return the run numbers of the runs (run headers) in the file - the file has to be open...
void getEvents(EVENT::IntVec &events) override
Return the run and event numbers of the events in the file - the file has to be open.
void removeLCEventListener(IO::LCEventListener *ls) override
Remove a listener for reading LCEvents from a stream.
void getRuns(EVENT::IntVec &runs)
Return the run numbers of the runs (run headers) in the file - the file has to be open...
int getNumberOfEvents() override
Return the number of events in the file - the file has to be open.
virtual ~SIOReader()
Destructor.
EVENT::LCRunHeader * readRunHeader(int runNumber) override
Reads the specified runHeader from file.
EVENT::LCEvent * readNextEvent() override
Reads the next event from the file.
void open(const std::vector< std::string > &filenames) override
Opens a list of files for reading (read-only).
Listener for the occurence of LCRunHeader when reading a stream.
void setReadCollectionNames(const std::vector< std::string > &colnames) override
Limit the collection names that are going to be read to the subset given in the vector - all other co...
std::unique_ptr< EVENT::LCEvent > readNextEvent(int accessMode=EVENT::LCIO::READ_ONLY)
Reads the next event from the file.
Adding stuff needed for io (friend declarations, etc.)
void registerLCEventListener(IO::LCEventListener *ls) override
Registers a listener for reading LCEvents from a stream.
std::unique_ptr< EVENT::LCRunHeader > readNextRunHeader(int accessMode=EVENT::LCIO::READ_ONLY)
Reads the next run header from the file.
The main event interface.
void removeLCRunListener(IO::LCRunListener *ls) override
Remove a listener for reading LCRunHeaders from a stream.
EVENT::LCRunHeader * _currentRun
pointer to current RunHeader
int getNumberOfRuns() override
Return the number of runs (run headers) in the file - the file has to be open.
void processRunHeader(std::shared_ptr< EVENT::LCRunHeader > hdr) override
void processEvent(std::shared_ptr< EVENT::LCEvent > event) override
EVENT::LCEvent * _currentEvent
pointer to current Event
void readStream() override
Reads the input stream and notifies registered listeners according to the object type found in the st...
std::set< IO::LCEventListener * > _evtListeners
The event listeners.
void close() override
Closes the output file/stream etc.
int getNumberOfRuns()
Return the number of runs (run headers) in the file - the file has to be open.
void skipNEvents(int n) override
Skips the next n events from the current position.
void getEvents(EVENT::IntVec &events)
Return the run and event numbers of the events in the file - the file has to be open.
void close()
Closes the output file/stream etc.
std::set< IO::LCRunListener * > _runListeners
The run listeners.