File ROOTNTupleReader.h

namespace podio
class ROOTNTupleReader
#include <podio/ROOTNTupleReader.h>

This class has the function to read available data from disk and to prepare collections and buffers.

Public Functions

ROOTNTupleReader() = default
~ROOTNTupleReader() = default
ROOTNTupleReader(const ROOTNTupleReader&) = delete
ROOTNTupleReader &operator=(const ROOTNTupleReader&) = delete
void openFile(const std::string &filename)
void openFiles(const std::vector<std::string> &filename)
std::unique_ptr<podio::ROOTFrameData> readNextEntry(const std::string &name)

Read the next data entry from which a Frame can be constructed for the given name.

In case there are no more entries left for this name or in case there is no data for this name, this returns a nullptr.

std::unique_ptr<podio::ROOTFrameData> readEntry(const std::string &name, const unsigned entry)

Read the specified data entry from which a Frame can be constructed for the given name.

In case the entry does not exist for this name or in case there is no data for this name, this returns a nullptr.

std::vector<std::string_view> getAvailableCategories() const

Get the names of all the available Frame categories in the current file(s)

unsigned getEntries(const std::string &name)

Returns number of entries for the given name.

inline podio::version::Version currentFileVersion() const

Get the build version of podio that has been used to write the current file.

inline const std::string_view getDatamodelDefinition(const std::string &name) const

Get the datamodel definition for the given name.

inline std::vector<std::string> getAvailableDatamodels() const

Get all names of the datamodels that ara available from this reader.

void closeFile()

Private Functions

bool initCategory(const std::string &category)

Initialize the given category by filling the maps with metadata information that will be used later.

GenericParameters readEventMetaData(const std::string &name, unsigned entNum)

Read and reconstruct the generic parameters of the Frame.

template<typename T>
void readParams(const std::string &name, unsigned entNum, GenericParameters &params)

Private Members

std::unique_ptr<ROOT::Experimental::RNTupleReader> m_metadata = {}
podio::version::Version m_fileVersion = {}
DatamodelDefinitionHolder m_datamodelHolder = {}
std::unordered_map<std::string, std::vector<std::unique_ptr<ROOT::Experimental::RNTupleReader>>> m_readers = {}
std::unordered_map<std::string, std::unique_ptr<ROOT::Experimental::RNTupleReader>> m_metadata_readers = {}
std::vector<std::string> m_filenames = {}
std::unordered_map<std::string, int> m_entries = {}
std::unordered_map<std::string, unsigned> m_totalEntries = {}
std::unordered_map<std::string, CollectionInfo> m_collectionInfo = {}
std::vector<std::string> m_availableCategories = {}
std::unordered_map<std::string, std::shared_ptr<podio::CollectionIDTable>> m_idTables = {}
struct CollectionInfo

Public Members

std::vector<unsigned int> id = {}
std::vector<std::string> name = {}
std::vector<std::string> type = {}
std::vector<short> isSubsetCollection = {}
std::vector<SchemaVersionT> schemaVersion = {}