1#ifndef PODIO_ROOTFRAMEREADER_H
2#define PODIO_ROOTFRAMEREADER_H
6#include "podio/podioVersion.h"
54 void openFile(
const std::string& filename);
56 void openFiles(
const std::vector<std::string>& filenames);
63 std::unique_ptr<podio::ROOTFrameData>
readNextEntry(
const std::string& name);
70 std::unique_ptr<podio::ROOTFrameData>
readEntry(
const std::string& name,
const unsigned entry);
73 unsigned getEntries(
const std::string& name)
const;
101 struct CategoryInfo {
103 CategoryInfo(std::unique_ptr<TChain>&& c) : chain(std::move(c)) {
105 std::unique_ptr<TChain> chain{
nullptr};
107 std::vector<std::pair<std::string, detail::CollectionInfo>> storedClasses{};
109 std::vector<root_utils::CollectionBranches> branches{};
110 std::shared_ptr<CollectionIDTable> table{
nullptr};
118 void initCategory(CategoryInfo& catInfo,
const std::string& name);
125 CategoryInfo& getCategoryInfo(
const std::string& name);
127 GenericParameters readEventMetaData(CategoryInfo& catInfo);
134 std::unique_ptr<podio::ROOTFrameData>
readEntry(ROOTFrameReader::CategoryInfo& catInfo);
141 std::unique_ptr<TChain> m_metaChain{
nullptr};
142 std::unordered_map<std::string, CategoryInfo> m_categories{};
143 std::vector<std::string> m_availCategories{};
146 DatamodelDefinitionHolder m_datamodelHolder{};
std::vector< std::string > getAvailableDatamodels() const
const std::string_view getDatamodelDefinition(const std::string &name) const
void openFile(const std::string &filename)
const std::string_view getDatamodelDefinition(const std::string &name) const
Get the datamodel definition for the given name.
ROOTFrameReader()=default
std::unique_ptr< podio::ROOTFrameData > readNextEntry(const std::string &name)
void openFiles(const std::vector< std::string > &filenames)
podio::version::Version currentFileVersion() const
Get the build version of podio that has been used to write the current file.
std::vector< std::string_view > getAvailableCategories() const
Get the names of all the availalable Frame categories in the current file(s)
unsigned getEntries(const std::string &name) const
Returns number of entries for the given name.
std::vector< std::string > getAvailableDatamodels() const
Get all names of the datamodels that ara available from this reader.
~ROOTFrameReader()=default
ROOTFrameReader(const ROOTFrameReader &)=delete
ROOTFrameReader & operator=(const ROOTFrameReader &)=delete
std::unique_ptr< podio::ROOTFrameData > readEntry(const std::string &name, const unsigned entry)
std::tuple< const TClass *, const TClass *, size_t > CollectionInfo