diff --git a/include/podio/RNTupleReader.h b/include/podio/RNTupleReader.h index 2b8400fbc..28d2efc70 100644 --- a/include/podio/RNTupleReader.h +++ b/include/podio/RNTupleReader.h @@ -97,6 +97,13 @@ class RNTupleReader { return m_fileVersion; } + /// Get the (build) version of a datamodel that has been used to write the + /// current file + /// + /// @param name The name of the datamodel + /// + /// @returns The (build) version of the datamodel if available or an empty + /// optional std::optional currentFileVersion(const std::string& name) const { return m_datamodelHolder.getDatamodelVersion(name); } diff --git a/include/podio/ROOTReader.h b/include/podio/ROOTReader.h index 1baf0c1d6..7167411ec 100644 --- a/include/podio/ROOTReader.h +++ b/include/podio/ROOTReader.h @@ -104,6 +104,13 @@ class ROOTReader { return m_fileVersion; } + /// Get the (build) version of a datamodel that has been used to write the + /// current file + /// + /// @param name The name of the datamodel + /// + /// @returns The (build) version of the datamodel if available or an empty + /// optional std::optional currentFileVersion(const std::string& name) const { return m_datamodelHolder.getDatamodelVersion(name); } diff --git a/include/podio/Reader.h b/include/podio/Reader.h index 9f13faab3..09b00161d 100644 --- a/include/podio/Reader.h +++ b/include/podio/Reader.h @@ -171,6 +171,13 @@ class Reader { return m_self->currentFileVersion(); } + /// Get the (build) version of a datamodel that has been used to write the + /// current file + /// + /// @param name The name of the datamodel + /// + /// @returns The (build) version of the datamodel if available or an empty + /// optional std::optional currentFileVersion(const std::string& name) const { return m_self->currentFileVersion(name); } diff --git a/include/podio/SIOReader.h b/include/podio/SIOReader.h index a1c64ce2b..f9f5ba02a 100644 --- a/include/podio/SIOReader.h +++ b/include/podio/SIOReader.h @@ -73,6 +73,13 @@ class SIOReader { return m_fileVersion; } + /// Get the (build) version of a datamodel that has been used to write the + /// current file + /// + /// @param name The name of the datamodel + /// + /// @returns The (build) version of the datamodel if available or an empty + /// optional std::optional currentFileVersion(const std::string& name) const { return m_datamodelHolder.getDatamodelVersion(name); }