Class podio::SIOReader
-
class SIOReader
The SIOReader can be used to read files that have been written with the SIO backend.
The SIOReader provides the data as SIOFrameData from which a podio::Frame can be constructed. It can be used to read files written by the SIOWriter.
Public Functions
-
SIOReader()
Create an SIOReader.
-
~SIOReader() = default
SIOReader destructor.
-
std::unique_ptr<podio::SIOFrameData> readNextEntry(const std::string &name)
Read the next data entry for a given category.
- Parameters:
name – The category name for which to read the next entry
- Returns:
FrameData from which a podio::Frame can be constructed if the category exists and if there are still entries left to read. Otherwise a nullptr
-
std::unique_ptr<podio::SIOFrameData> readEntry(const std::string &name, const unsigned entry)
Read the desired data entry for a given category.
- Parameters:
name – The category name for which to read the next entry
entry – The entry number to read
- Returns:
FrameData from which a podio::Frame can be constructed if the category and the desired entry exist. Otherwise a nullptr
-
unsigned getEntries(const std::string &name) const
Get the number of entries for the given name.
- Parameters:
name – The name of the category
- Returns:
The number of entries that are available for the category
-
void openFile(const std::string &filename)
Open the passed file for reading.
- Parameters:
filename – The path to the file to read from
-
inline podio::version::Version currentFileVersion() const
Get the build version of podio that has been used to write the current file.
- Returns:
The podio build version
-
std::vector<std::string_view> getAvailableCategories() const
Get the names of all the available Frame categories in the current file.
- Returns:
The names of the available categores from the file
-
inline const std::string_view getDatamodelDefinition(const std::string &name) const
Get the datamodel definition for the given name.
- Parameters:
name – The name of the datamodel
- Returns:
The high level definition of the datamodel in JSON format
-
inline std::vector<std::string> getAvailableDatamodels() const
Get all names of the datamodels that are available from this reader.
- Returns:
The names of the datamodels
-
SIOReader()