PODIO v00-16-03
An Event-Data-Model Toolkit for High Energy Physics Experiments
Loading...
Searching...
No Matches
IReader.h
Go to the documentation of this file.
1#ifndef PODIO_IREADER_H
2#define PODIO_IREADER_H
3
4#include "podio/podioVersion.h"
6
7#include <algorithm>
8#include <map>
9#include <memory>
10#include <string>
11#include <vector>
12
13/*
14
15This class has the function to read available data from disk
16and to prepare collections and buffers.
17
18*/
19
20namespace podio {
21
22class CollectionBase;
23class CollectionIDTable;
24class GenericParameters;
25
27public:
28 virtual ~IReader() = default;
29 /// Read Collection of given name
30 /// Does not set references yet.
31 virtual CollectionBase* readCollection(const std::string& name) = 0;
32 /// Get CollectionIDTable of read-in data
33 virtual std::shared_ptr<CollectionIDTable> getCollectionIDTable() = 0;
34 /// read event meta data from file
36 virtual std::map<int, GenericParameters>* readCollectionMetaData() = 0;
37 virtual std::map<int, GenericParameters>* readRunMetaData() = 0;
38 /// get the number of events available from this reader
39 virtual unsigned getEntries() const = 0;
40 /// Prepare the reader to read the next event
41 virtual void endOfEvent() = 0;
42 // TODO: decide on smart-pointers for passing of objects
43 /// Check if reader is valid
44 virtual bool isValid() const = 0;
45
46 virtual void openFile(const std::string& filename) = 0;
47 virtual void closeFile() = 0;
48
49 virtual void readEvent() = 0;
50 virtual void goToEvent(unsigned iEvent) = 0;
51
52 /// Get the podio version with which the current file has been written
54};
55
56} // namespace podio
57
58#endif
#define DEPR_EVTSTORE
Definition: Deprecated.h:4
virtual CollectionBase * readCollection(const std::string &name)=0
virtual std::shared_ptr< CollectionIDTable > getCollectionIDTable()=0
Get CollectionIDTable of read-in data.
virtual bool isValid() const =0
Check if reader is valid.
virtual podio::version::Version currentFileVersion() const =0
Get the podio version with which the current file has been written.
virtual void endOfEvent()=0
Prepare the reader to read the next event.
virtual void openFile(const std::string &filename)=0
virtual std::map< int, GenericParameters > * readRunMetaData()=0
virtual GenericParameters * readEventMetaData()=0
read event meta data from file
virtual ~IReader()=default
virtual void goToEvent(unsigned iEvent)=0
virtual unsigned getEntries() const =0
get the number of events available from this reader
virtual void closeFile()=0
virtual void readEvent()=0
virtual std::map< int, GenericParameters > * readCollectionMetaData()=0