Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-09-17 09:14:30

0001 /// \file ROOT/RNTupleInspector.hxx
0002 /// \ingroup NTuple ROOT7
0003 /// \author Florine de Geus <florine.de.geus@cern.ch>
0004 /// \date 2023-01-09
0005 /// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
0006 /// is welcome!
0007 
0008 /*************************************************************************
0009  * Copyright (C) 1995-2023, Rene Brun and Fons Rademakers.               *
0010  * All rights reserved.                                                  *
0011  *                                                                       *
0012  * For the licensing terms see $ROOTSYS/LICENSE.                         *
0013  * For the list of contributors see $ROOTSYS/README/CREDITS.             *
0014  *************************************************************************/
0015 
0016 #ifndef ROOT7_RNTupleInspector
0017 #define ROOT7_RNTupleInspector
0018 
0019 #include <ROOT/RError.hxx>
0020 #include <ROOT/RNTupleDescriptor.hxx>
0021 
0022 #include <TFile.h>
0023 #include <TH1D.h>
0024 #include <THStack.h>
0025 
0026 #include <cstdlib>
0027 #include <iostream>
0028 #include <memory>
0029 #include <numeric>
0030 #include <optional>
0031 #include <regex>
0032 #include <vector>
0033 
0034 namespace ROOT {
0035 class RNTuple;
0036 
0037 namespace Internal {
0038 class RPageSource;
0039 } // namespace Internal
0040 
0041 namespace Experimental {
0042 
0043 enum class ENTupleInspectorPrintFormat { kTable, kCSV };
0044 enum class ENTupleInspectorHist { kCount, kNElems, kCompressedSize, kUncompressedSize };
0045 
0046 // clang-format off
0047 /**
0048 \class ROOT::Experimental::RNTupleInspector
0049 \ingroup NTuple
0050 \brief Inspect on-disk and storage-related information of an RNTuple.
0051 
0052 The RNTupleInspector can be used for studying an RNTuple in terms of its storage efficiency. It provides information on
0053 the level of the RNTuple itself, on the (sub)field level and on the column level.
0054 
0055 Example usage:
0056 
0057 ~~~ {.cpp}
0058 #include <ROOT/RNTuple.hxx>
0059 #include <ROOT/RNTupleInspector.hxx>
0060 
0061 #include <iostream>
0062 
0063 using ROOT::Experimental::RNTuple;
0064 using ROOT::Experimental::RNTupleInspector;
0065 
0066 auto file = TFile::Open("data.rntuple");
0067 auto rntuple = std::unique_ptr<RNTuple>(file->Get<RNTuple>("NTupleName"));
0068 auto inspector = RNTupleInspector::Create(*rntuple);
0069 
0070 std::cout << "The compression factor is " << inspector->GetCompressionFactor()
0071           << " using compression settings " << inspector->GetCompressionSettingsAsString()
0072           << std::endl;
0073 ~~~
0074 */
0075 // clang-format on
0076 class RNTupleInspector {
0077 public:
0078    /////////////////////////////////////////////////////////////////////////////
0079    /// \brief Provides column-level storage information.
0080    ///
0081    /// The RColumnInspector class provides storage information for an individual column. This information is partly
0082    /// collected during the construction of the RNTupleInspector object, and can partly be accessed using the
0083    /// RColumnInspector that belongs to this field.
0084    class RColumnInspector {
0085    private:
0086       const ROOT::RColumnDescriptor &fColumnDescriptor;
0087       const std::vector<std::uint64_t> fCompressedPageSizes = {};
0088       std::uint32_t fElementSize = 0;
0089       std::uint64_t fNElements = 0;
0090 
0091    public:
0092       RColumnInspector(const ROOT::RColumnDescriptor &colDesc, const std::vector<std::uint64_t> &compressedPageSizes,
0093                        std::uint32_t elemSize, std::uint64_t nElems)
0094          : fColumnDescriptor(colDesc),
0095            fCompressedPageSizes(compressedPageSizes),
0096            fElementSize(elemSize),
0097            fNElements(nElems) {};
0098       ~RColumnInspector() = default;
0099 
0100       const ROOT::RColumnDescriptor &GetDescriptor() const { return fColumnDescriptor; }
0101       const std::vector<std::uint64_t> &GetCompressedPageSizes() const { return fCompressedPageSizes; }
0102       std::uint64_t GetNPages() const { return fCompressedPageSizes.size(); }
0103       std::uint64_t GetCompressedSize() const
0104       {
0105          return std::accumulate(fCompressedPageSizes.begin(), fCompressedPageSizes.end(), static_cast<std::uint64_t>(0));
0106       }
0107       std::uint64_t GetUncompressedSize() const { return fElementSize * fNElements; }
0108       std::uint64_t GetElementSize() const { return fElementSize; }
0109       std::uint64_t GetNElements() const { return fNElements; }
0110       ROOT::ENTupleColumnType GetType() const { return fColumnDescriptor.GetType(); }
0111    };
0112 
0113    /////////////////////////////////////////////////////////////////////////////
0114    /// \brief Provides field-level storage information.
0115    ///
0116    /// The RFieldTreeInspector class provides storage information for a field **and** its subfields. This information is
0117    /// partly collected during the construction of the RNTupleInspector object, and can partly be accessed using
0118    /// the RFieldDescriptor that belongs to this field.
0119    class RFieldTreeInspector {
0120    private:
0121       const ROOT::RFieldDescriptor &fRootFieldDescriptor;
0122       std::uint64_t fCompressedSize = 0;
0123       std::uint64_t fUncompressedSize = 0;
0124 
0125    public:
0126       RFieldTreeInspector(const ROOT::RFieldDescriptor &fieldDesc, std::uint64_t onDiskSize, std::uint64_t inMemSize)
0127          : fRootFieldDescriptor(fieldDesc), fCompressedSize(onDiskSize), fUncompressedSize(inMemSize) {};
0128       ~RFieldTreeInspector() = default;
0129 
0130       const ROOT::RFieldDescriptor &GetDescriptor() const { return fRootFieldDescriptor; }
0131       std::uint64_t GetCompressedSize() const { return fCompressedSize; }
0132       std::uint64_t GetUncompressedSize() const { return fUncompressedSize; }
0133    };
0134 
0135 private:
0136    std::unique_ptr<ROOT::Internal::RPageSource> fPageSource;
0137    ROOT::RNTupleDescriptor fDescriptor;
0138    std::optional<std::uint32_t> fCompressionSettings; ///< The compression settings are unknown for an empty ntuple
0139    std::uint64_t fCompressedSize = 0;
0140    std::uint64_t fUncompressedSize = 0;
0141 
0142    std::unordered_map<int, RColumnInspector> fColumnInfo;
0143    std::unordered_map<int, RFieldTreeInspector> fFieldTreeInfo;
0144 
0145    RNTupleInspector(std::unique_ptr<ROOT::Internal::RPageSource> pageSource);
0146 
0147    /////////////////////////////////////////////////////////////////////////////
0148    /// \brief Gather column-level and RNTuple-level information.
0149    ///
0150    /// \note This method is called when the RNTupleInspector is initially created. This means that anything unexpected
0151    /// about the RNTuple itself (e.g. inconsistent compression settings across clusters) will be detected here.
0152    /// Therefore, any related exceptions will be thrown on creation of the inspector.
0153    void CollectColumnInfo();
0154 
0155    /////////////////////////////////////////////////////////////////////////////
0156    /// \brief Recursively gather field-level information.
0157    ///
0158    /// \param[in] fieldId The ID of the field from which to start the recursive traversal. Typically this is the "zero
0159    /// ID", i.e. the logical parent of all top-level fields.
0160    ///
0161    /// \return The RFieldTreeInspector for the provided field ID.
0162    ///
0163    /// This method is called when the RNTupleInspector is initially created.
0164    RFieldTreeInspector CollectFieldTreeInfo(ROOT::DescriptorId_t fieldId);
0165 
0166    /////////////////////////////////////////////////////////////////////////////
0167    /// \brief Get the columns that make up the given field, including its subfields.
0168    ///
0169    /// \param [in] fieldId The ID of the field for which to collect the columns.
0170    ///
0171    /// \return A vector containing the IDs of all columns for the provided field ID.
0172    std::vector<ROOT::DescriptorId_t> GetColumnsByFieldId(ROOT::DescriptorId_t fieldId) const;
0173 
0174 public:
0175    RNTupleInspector(const RNTupleInspector &other) = delete;
0176    RNTupleInspector &operator=(const RNTupleInspector &other) = delete;
0177    RNTupleInspector(RNTupleInspector &&other) = delete;
0178    RNTupleInspector &operator=(RNTupleInspector &&other) = delete;
0179    ~RNTupleInspector();
0180 
0181    /////////////////////////////////////////////////////////////////////////////
0182    /// \brief Create a new RNTupleInspector.
0183    ///
0184    /// \param[in] sourceNTuple A pointer to the RNTuple to be inspected.
0185    ///
0186    /// \return A pointer to the newly created RNTupleInspector.
0187    ///
0188    /// \note When this factory method is called, all required static information is collected from the RNTuple's fields
0189    /// and underlying columns are collected at ones. This means that when any inconsistencies are encountered (e.g.
0190    /// inconsistent compression across clusters), it will throw an error here.
0191    static std::unique_ptr<RNTupleInspector> Create(const RNTuple &sourceNTuple);
0192 
0193    /////////////////////////////////////////////////////////////////////////////
0194    /// \brief Create a new RNTupleInspector.
0195    ///
0196    /// \param[in] ntupleName The name of the RNTuple to be inspected.
0197    /// \param[in] storage The path or URI to the RNTuple to be inspected.
0198    ///
0199    /// \see Create(RNTuple *sourceNTuple)
0200    static std::unique_ptr<RNTupleInspector> Create(std::string_view ntupleName, std::string_view storage);
0201 
0202    /////////////////////////////////////////////////////////////////////////////
0203    /// \brief Get the descriptor for the RNTuple being inspected.
0204    ///
0205    /// \return A static copy of the ROOT::RNTupleDescriptor belonging to the inspected RNTuple.
0206    const ROOT::RNTupleDescriptor &GetDescriptor() const { return fDescriptor; }
0207 
0208    /////////////////////////////////////////////////////////////////////////////
0209    /// \brief Get the compression settings of the RNTuple being inspected.
0210    ///
0211    /// \return The integer representation (\f$algorithm * 10 + level\f$, where \f$algorithm\f$ follows
0212    /// ROOT::RCompressionSetting::ELevel::EValues) of the compression settings used for the inspected RNTuple.
0213    /// Empty for an empty ntuple.
0214    ///
0215    /// \note Here, we assume that the compression settings are consistent across all clusters and columns. If this is
0216    /// not the case, an exception will be thrown when RNTupleInspector::Create is called.
0217    std::optional<std::uint32_t> GetCompressionSettings() const { return fCompressionSettings; }
0218 
0219    /////////////////////////////////////////////////////////////////////////////
0220    /// \brief Get a string describing compression settings of the RNTuple being inspected.
0221    ///
0222    /// \return A string describing the compression used for the inspected RNTuple. The format of the string is
0223    /// `"A (level L)"`, where `A` is the name of the compression algorithm and `L` the compression level.
0224    ///
0225    /// \note Here, we assume that the compression settings are consistent across all clusters and columns. If this is
0226    /// not the case, an exception will be thrown when RNTupleInspector::Create is called.
0227    std::string GetCompressionSettingsAsString() const;
0228 
0229    /////////////////////////////////////////////////////////////////////////////
0230    /// \brief Get the compressed, on-disk size of the RNTuple being inspected.
0231    ///
0232    /// \return The compressed size of the inspected RNTuple, in bytes, excluding the size of the header and footer.
0233    std::uint64_t GetCompressedSize() const { return fCompressedSize; }
0234 
0235    /////////////////////////////////////////////////////////////////////////////
0236    /// \brief Get the uncompressed total size of the RNTuple being inspected.
0237    ///
0238    /// \return The uncompressed size of the inspected RNTuple, in bytes, excluding the size of the header and footer.
0239    std::uint64_t GetUncompressedSize() const { return fUncompressedSize; }
0240 
0241    /////////////////////////////////////////////////////////////////////////////
0242    /// \brief Get the compression factor of the RNTuple being inspected.
0243    ///
0244    /// \return The compression factor of the inspected RNTuple.
0245    ///
0246    /// The compression factor shows how well the data present in the RNTuple is compressed by the compression settings
0247    /// that were used. The compression factor is calculated as \f$size_{uncompressed} / size_{compressed}\f$.
0248    float GetCompressionFactor() const { return (float)fUncompressedSize / (float)fCompressedSize; }
0249 
0250    /////////////////////////////////////////////////////////////////////////////
0251    /// \brief Get storage information for a given column.
0252    ///
0253    /// \param[in] physicalColumnId The physical ID of the column for which to get the information.
0254    ///
0255    /// \return The storage information for the provided column.
0256    const RColumnInspector &GetColumnInspector(ROOT::DescriptorId_t physicalColumnId) const;
0257 
0258    /////////////////////////////////////////////////////////////////////////////
0259    /// \brief Get the number of columns of a given type present in the RNTuple.
0260    ///
0261    /// \param[in] colType The column type to count, as defined by ROOT::ENTupleColumnType.
0262    ///
0263    /// \return The number of columns present in the inspected RNTuple of the provided type.
0264    size_t GetColumnCountByType(ROOT::ENTupleColumnType colType) const;
0265 
0266    /////////////////////////////////////////////////////////////////////////////
0267    /// \brief Get the IDs of all columns with the given type.
0268    ///
0269    /// \param[in] colType The column type to collect, as defined by ROOT::ENTupleColumnType.
0270    ///
0271    /// \return A vector containing the physical IDs of columns of the provided type.
0272    const std::vector<ROOT::DescriptorId_t> GetColumnsByType(ROOT::ENTupleColumnType colType);
0273 
0274    /////////////////////////////////////////////////////////////////////////////
0275    /// \brief Get all column types present in the RNTuple being inspected.
0276    ///
0277    /// \return A vector containing all column types present in the RNTuple.
0278    const std::vector<ROOT::ENTupleColumnType> GetColumnTypes();
0279 
0280    /////////////////////////////////////////////////////////////////////////////
0281    /// \brief Print storage information per column type.
0282    ///
0283    /// \param[in] format Whether to print the information as a (markdown-parseable) table or in CSV format.
0284    /// \param[in] output Where to write the output to. Default is `stdout`.
0285    ///
0286    /// The output includes for each column type its count, the total number of elements, the compressed size and the
0287    /// uncompressed size.
0288    ///
0289    /// **Example: printing the column type information of an RNTuple as a table**
0290    /// ~~~ {.cpp}
0291    /// #include <ROOT/RNTupleInspector.hxx>
0292    /// using ROOT::Experimental::RNTupleInspector;
0293    /// using ROOT::Experimental::ENTupleInspectorPrintFormat;
0294    ///
0295    /// auto inspector = RNTupleInspector::Create("myNTuple", "some/file.root");
0296    /// inspector->PrintColumnTypeInfo();
0297    /// ~~~
0298    /// Output:
0299    /// ~~~
0300    ///  column type    | count   | # elements      | compressed bytes  | uncompressed bytes
0301    /// ----------------|---------|-----------------|-------------------|--------------------
0302    ///    SplitIndex64 |       2 |             150 |                72 |               1200
0303    ///     SplitReal32 |       4 |             300 |               189 |               1200
0304    ///     SplitUInt32 |       3 |             225 |               123 |                900
0305    /// ~~~
0306    ///
0307    /// **Example: printing the column type information of an RNTuple in CSV format**
0308    /// ~~~ {.cpp}
0309    /// #include <ROOT/RNTupleInspector.hxx>
0310    /// using ROOT::Experimental::RNTupleInspector;
0311    /// using ROOT::Experimental::ENTupleInspectorPrintFormat;
0312    ///
0313    /// auto inspector = RNTupleInspector::Create("myNTuple", "some/file.root");
0314    /// inspector->PrintColumnTypeInfo();
0315    /// ~~~
0316    /// Output:
0317    /// ~~~
0318    /// columnType,count,nElements,compressedSize,uncompressedSize
0319    /// SplitIndex64,2,150,72,1200
0320    /// SplitReal32,4,300,189,1200
0321    /// SplitUInt32,3,225,123,900
0322    /// ~~~
0323    void PrintColumnTypeInfo(ENTupleInspectorPrintFormat format = ENTupleInspectorPrintFormat::kTable,
0324                             std::ostream &output = std::cout);
0325 
0326    /////////////////////////////////////////////////////////////////////////////
0327    /// \brief Get a histogram showing information for each column type present,
0328    ///
0329    /// \param[in] histKind Which type of information should be returned.
0330    /// \param[in] histName The name of the histogram. An empty string means a default name will be used.
0331    /// \param[in] histTitle The title of the histogram. An empty string means a default title will be used.
0332    ///
0333    /// \return A pointer to a `TH1D` containing the specified kind of information.
0334    ///
0335    /// Get a histogram showing the count, number of elements, size on disk, or size in memory for each column
0336    /// type present in the inspected RNTuple.
0337    std::unique_ptr<TH1D> GetColumnTypeInfoAsHist(ENTupleInspectorHist histKind, std::string_view histName = "",
0338                                                  std::string_view histTitle = "");
0339 
0340    /////////////////////////////////////////////////////////////////////////////
0341    /// \brief Get a histogram containing the size distribution of the compressed pages for an individual column.
0342    ///
0343    /// \param[in] physicalColumnId The physical ID of the column for which to get the page size distribution.
0344    /// \param[in] histName The name of the histogram. An empty string means a default name will be used.
0345    /// \param[in] histTitle The title of the histogram. An empty string means a default title will be used.
0346    /// \param[in] nBins The desired number of histogram bins.
0347    ///
0348    /// \return A pointer to a `TH1D` containing the page size distribution.
0349    ///
0350    /// The x-axis will range from the smallest page size, to the largest (inclusive).
0351    std::unique_ptr<TH1D> GetPageSizeDistribution(ROOT::DescriptorId_t physicalColumnId, std::string histName = "",
0352                                                  std::string histTitle = "", size_t nBins = 64);
0353 
0354    /////////////////////////////////////////////////////////////////////////////
0355    /// \brief Get a histogram containing the size distribution of the compressed pages for all columns of a given type.
0356    ///
0357    /// \param[in] colType The column type for which to get the size distribution, as defined by ROOT::ENTupleColumnType.
0358    /// \param[in] histName The name of the histogram. An empty string means a default name will be used.
0359    /// \param[in] histTitle The title of the histogram. An empty string means a default title will be used.
0360    /// \param[in] nBins The desired number of histogram bins.
0361    ///
0362    /// \return A pointer to a `TH1D` containing the page size distribution.
0363    ///
0364    /// The x-axis will range from the smallest page size, to the largest (inclusive).
0365    std::unique_ptr<TH1D> GetPageSizeDistribution(ROOT::ENTupleColumnType colType, std::string histName = "",
0366                                                  std::string histTitle = "", size_t nBins = 64);
0367 
0368    /////////////////////////////////////////////////////////////////////////////
0369    /// \brief Get a histogram containing the size distribution of the compressed pages for a collection columns.
0370    ///
0371    /// \param[in] colIds The physical IDs of the columns for which to get the page size distribution.
0372    /// \param[in] histName The name of the histogram. An empty string means a default name will be used.
0373    /// \param[in] histTitle The title of the histogram. An empty string means a default title will be used.
0374    /// \param[in] nBins The desired number of histogram bins.
0375    ///
0376    /// \return A pointer to a `TH1D` containing the (cumulative) page size distribution.
0377    ///
0378    /// The x-axis will range from the smallest page size, to the largest (inclusive).
0379    std::unique_ptr<TH1D> GetPageSizeDistribution(std::initializer_list<ROOT::DescriptorId_t> colIds,
0380                                                  std::string histName = "", std::string histTitle = "",
0381                                                  size_t nBins = 64);
0382 
0383    /////////////////////////////////////////////////////////////////////////////
0384    /// \brief Get a histogram containing the size distribution of the compressed pages for all columns of a given list
0385    /// of types.
0386    ///
0387    /// \param[in] colTypes The column types for which to get the size distribution, as defined by
0388    /// ROOT::ENTupleColumnType. The default is an empty vector, which indicates that the distribution
0389    /// for *all* physical columns will be returned.
0390    /// \param[in] histName The name of the histogram. An empty string means a default name will be used. The name of
0391    /// each histogram inside the `THStack` will be `histName + colType`.
0392    /// \param[in] histTitle The title of the histogram. An empty string means a default title will be used.
0393    /// \param[in] nBins The desired number of histogram bins.
0394    ///
0395    /// \return A pointer to a `THStack` with one histogram for each column type.
0396    ///
0397    /// The x-axis will range from the smallest page size, to the largest (inclusive).
0398    ///
0399    /// **Example: Drawing a non-stacked page size distribution with a legend**
0400    /// ~~~ {.cpp}
0401    /// auto canvas = std::make_unique<TCanvas>();
0402    /// auto inspector = RNTupleInspector::Create("myNTuple", "ntuple.root");
0403    ///
0404    /// // We want to show the page size distributions of columns with type `kSplitReal32` and `kSplitReal64`.
0405    /// auto hist = inspector->GetPageSizeDistribution(
0406    ///     {ROOT::ENTupleColumnType::kSplitReal32, ROOT::ENTupleColumnType::kSplitReal64});
0407    /// // The "PLC" option automatically sets the line color for each histogram in the `THStack`.
0408    /// // The "NOSTACK" option will draw the histograms on top of each other instead of stacked.
0409    /// hist->DrawClone("PLC NOSTACK");
0410    /// canvas->BuildLegend(0.7, 0.8, 0.89, 0.89);
0411    /// canvas->DrawClone();
0412    /// ~~~
0413    std::unique_ptr<THStack> GetPageSizeDistribution(std::initializer_list<ROOT::ENTupleColumnType> colTypes = {},
0414                                                     std::string histName = "", std::string histTitle = "",
0415                                                     size_t nBins = 64);
0416 
0417    /////////////////////////////////////////////////////////////////////////////
0418    /// \brief Get storage information for a given (sub)field by ID.
0419    ///
0420    /// \param[in] fieldId The ID of the (sub)field for which to get the information.
0421    ///
0422    /// \return The storage information inspector for the provided (sub)field tree.
0423    const RFieldTreeInspector &GetFieldTreeInspector(ROOT::DescriptorId_t fieldId) const;
0424 
0425    /////////////////////////////////////////////////////////////////////////////
0426    /// \brief Get a storage information inspector for a given (sub)field by name, including its subfields.
0427    ///
0428    /// \param[in] fieldName The name of the (sub)field for which to get the information.
0429    ///
0430    /// \return The storage information inspector for the provided (sub)field tree.
0431    const RFieldTreeInspector &GetFieldTreeInspector(std::string_view fieldName) const;
0432 
0433    /////////////////////////////////////////////////////////////////////////////
0434    /// \brief Get the number of fields of a given type or class present in the RNTuple.
0435    ///
0436    /// \param[in] typeNamePattern The type or class name to count. May contain regular expression patterns for grouping
0437    /// multiple kinds of types or classes.
0438    /// \param[in] searchInSubfields If set to `false`, only top-level fields will be considered.
0439    ///
0440    /// \return The number of fields that matches the provided type.
0441    size_t GetFieldCountByType(const std::regex &typeNamePattern, bool searchInSubfields = true) const;
0442 
0443    /////////////////////////////////////////////////////////////////////////////
0444    /// \brief Get the number of fields of a given type or class present in the RNTuple.
0445    ///
0446    /// \see GetFieldCountByType(const std::regex &typeNamePattern, bool searchInSubfields) const
0447    size_t GetFieldCountByType(std::string_view typeNamePattern, bool searchInSubfields = true) const
0448    {
0449       return GetFieldCountByType(std::regex{std::string(typeNamePattern)}, searchInSubfields);
0450    }
0451 
0452    /////////////////////////////////////////////////////////////////////////////
0453    /// \brief Get the IDs of (sub-)fields whose name matches the given string.
0454    ///
0455    /// \param[in] fieldNamePattern The name of the field name to get. Because field names are unique by design,
0456    /// providing a single field name will return a vector containing just the ID of that field. However, regular
0457    /// expression patterns are supported in order to get the IDs of all fields whose name follow a certain structure.
0458    /// \param[in] searchInSubfields If set to `false`, only top-level fields will be considered.
0459    ///
0460    /// \return A vector containing the IDs of fields that match the provided name.
0461    const std::vector<ROOT::DescriptorId_t>
0462    GetFieldsByName(const std::regex &fieldNamePattern, bool searchInSubfields = true) const;
0463 
0464    /////////////////////////////////////////////////////////////////////////////
0465    /// \brief Get the IDs of (sub-)fields whose name matches the given string.
0466    ///
0467    /// \see GetFieldsByName(const std::regex &fieldNamePattern, bool searchInSubfields) const
0468    const std::vector<ROOT::DescriptorId_t>
0469    GetFieldsByName(std::string_view fieldNamePattern, bool searchInSubfields = true)
0470    {
0471       return GetFieldsByName(std::regex{std::string(fieldNamePattern)}, searchInSubfields);
0472    }
0473 };
0474 } // namespace Experimental
0475 } // namespace ROOT
0476 
0477 #endif // ROOT7_RNTupleInspector