22#define PODIO_RNTUPLEREADER_H
33
44#include " podio/ROOTFrameData.h"
5- #include " podio/podioVersion.h"
6- #include " podio/utilities/DatamodelRegistryIOHelpers.h"
5+ #include " podio/utilities/ReaderCommon.h"
76#include " podio/utilities/RootHelpers.h"
87
98#include < string>
@@ -32,7 +31,7 @@ namespace root_compat {
3231// /
3332// / The RNTupleReader provides the data as ROOTFrameData from which a podio::Frame
3433// / can be constructed. It can be used to read files written by the RNTupleWriter.
35- class RNTupleReader {
34+ class RNTupleReader : public ReaderCommon {
3635
3736public:
3837 RNTupleReader () = default ;
@@ -91,53 +90,13 @@ class RNTupleReader {
9190 std::unique_ptr<podio::ROOTFrameData> readEntry (std::string_view name, const unsigned entry,
9291 const std::vector<std::string>& collsToRead = {});
9392
94- // / Get the names of all the available Frame categories in the current file(s).
95- // /
96- // / @returns The names of the available categores from the file
97- std::vector<std::string_view> getAvailableCategories () const ;
98-
9993 // / Get the number of entries for the given name
10094 // /
10195 // / @param name The name of the category
10296 // /
10397 // / @returns The number of entries that are available for the category
10498 unsigned getEntries (std::string_view name) const ;
10599
106- // / Get the build version of podio that has been used to write the current
107- // / file
108- // /
109- // / @returns The podio build version
110- podio::version::Version currentFileVersion () const {
111- return m_fileVersion;
112- }
113-
114- // / Get the (build) version of a datamodel that has been used to write the
115- // / current file
116- // /
117- // / @param name The name of the datamodel
118- // /
119- // / @returns The (build) version of the datamodel if available or an empty
120- // / optional
121- std::optional<podio::version::Version> currentFileVersion (std::string_view name) const {
122- return m_datamodelHolder.getDatamodelVersion (name);
123- }
124-
125- // / Get the datamodel definition for the given name
126- // /
127- // / @param name The name of the datamodel
128- // /
129- // / @returns The high level definition of the datamodel in JSON format
130- const std::string_view getDatamodelDefinition (std::string_view name) const {
131- return m_datamodelHolder.getDatamodelDefinition (name);
132- }
133-
134- // / Get all names of the datamodels that are available from this reader
135- // /
136- // / @returns The names of the datamodels
137- std::vector<std::string> getAvailableDatamodels () const {
138- return m_datamodelHolder.getAvailableDatamodels ();
139- }
140-
141100private:
142101 /* *
143102 * Initialize the given category by filling the maps with metadata information
@@ -152,9 +111,6 @@ class RNTupleReader {
152111
153112 std::unique_ptr<root_compat::RNTupleReader> m_metadata{};
154113
155- podio::version::Version m_fileVersion{};
156- DatamodelDefinitionHolder m_datamodelHolder{};
157-
158114 std::unordered_map<std::string_view, std::vector<std::unique_ptr<root_compat::RNTupleReader>>> m_readers{};
159115 std::unordered_map<std::string, std::unique_ptr<root_compat::RNTupleReader>> m_metadata_readers{};
160116 std::vector<std::string> m_filenames{};
@@ -170,8 +126,6 @@ class RNTupleReader {
170126 // / Map each category to the collections that have been written and are available
171127 std::unordered_map<std::string_view, std::vector<podio::root_utils::CollectionWriteInfo>> m_collectionInfo{};
172128
173- std::vector<std::string> m_availableCategories{};
174-
175129 std::unordered_map<std::string_view, std::shared_ptr<podio::CollectionIDTable>> m_idTables{};
176130};
177131
0 commit comments