@@ -40,8 +40,16 @@ class RPageSource;
4040
4141namespace Experimental {
4242
43- enum class ENTupleInspectorPrintFormat { kTable , kCSV };
44- enum class ENTupleInspectorHist { kCount , kNElems , kCompressedSize , kUncompressedSize };
43+ enum class ENTupleInspectorPrintFormat {
44+ kTable ,
45+ kCSV
46+ };
47+ enum class ENTupleInspectorHist {
48+ kCount ,
49+ kNElems ,
50+ kCompressedSize ,
51+ kUncompressedSize
52+ };
4553
4654// clang-format off
4755/* *
@@ -93,15 +101,16 @@ public:
93101 : fColumnDescriptor (colDesc),
94102 fCompressedPageSizes (compressedPageSizes),
95103 fElementSize(elemSize),
96- fNElements(nElems) {};
104+ fNElements(nElems){};
97105 ~RColumnInspector () = default ;
98106
99107 const ROOT::RColumnDescriptor &GetDescriptor () const { return fColumnDescriptor ; }
100108 const std::vector<std::uint64_t > &GetCompressedPageSizes () const { return fCompressedPageSizes ; }
101109 std::uint64_t GetNPages () const { return fCompressedPageSizes .size (); }
102110 std::uint64_t GetCompressedSize () const
103111 {
104- return std::accumulate (fCompressedPageSizes .begin (), fCompressedPageSizes .end (), static_cast <std::uint64_t >(0 ));
112+ return std::accumulate (fCompressedPageSizes .begin (), fCompressedPageSizes .end (),
113+ static_cast <std::uint64_t >(0 ));
105114 }
106115 std::uint64_t GetUncompressedSize () const { return fElementSize * fNElements ; }
107116 std::uint64_t GetElementSize () const { return fElementSize ; }
@@ -123,7 +132,7 @@ public:
123132
124133 public:
125134 RFieldTreeInspector (const ROOT::RFieldDescriptor &fieldDesc, std::uint64_t onDiskSize, std::uint64_t inMemSize)
126- : fRootFieldDescriptor (fieldDesc), fCompressedSize (onDiskSize), fUncompressedSize (inMemSize) {};
135+ : fRootFieldDescriptor (fieldDesc), fCompressedSize (onDiskSize), fUncompressedSize (inMemSize){};
127136 ~RFieldTreeInspector () = default ;
128137
129138 const ROOT::RFieldDescriptor &GetDescriptor () const { return fRootFieldDescriptor ; }
@@ -469,6 +478,23 @@ public:
469478 {
470479 return GetFieldsByName (std::regex{std::string (fieldNamePattern)}, searchInSubfields);
471480 }
481+ // ///////////////////////////////////////////////////////////////////////////
482+ // / \brief Print a .dot string that represents the tree of the (sub)fields of an RNTuple
483+ // /
484+ // / \param[in] fieldDescriptor The descriptor of the root field (this method works recursively)
485+ // /
486+
487+ void PrintFieldTreeAsDot (const ROOT::RFieldDescriptor &fieldDescriptor, std::ostream &output = std::cout) const ;
488+
489+ // ///////////////////////////////////////////////////////////////////////////
490+ // / \brief Print the tree of all the (sub)fields of an RNTuple
491+ // / \param[in] output
492+ // /
493+ // / \see PrintFieldTreeAsDot(const ROOT::RFieldDescriptor &fieldDescriptor, std::ostream &output=std::cout) const
494+ void PrintFieldTreeAsDot (std::ostream &output = std::cout) const
495+ {
496+ PrintFieldTreeAsDot (GetDescriptor ().GetFieldZero (), output);
497+ }
472498};
473499} // namespace Experimental
474500} // namespace ROOT
0 commit comments