Logo ROOT  
Reference Guide
Loading...
Searching...
No Matches
RNTupleInspector.cxx
Go to the documentation of this file.
1/// \file RNTupleInspector.cxx
2/// \author Florine de Geus <florine.willemijn.de.geus@cern.ch>
3/// \date 2023-01-09
4/// \warning This is part of the ROOT 7 prototype! It will change without notice. It might trigger earthquakes. Feedback
5/// is welcome!
6
7/*************************************************************************
8 * Copyright (C) 1995-2023, Rene Brun and Fons Rademakers. *
9 * All rights reserved. *
10 * *
11 * For the licensing terms see $ROOTSYS/LICENSE. *
12 * For the list of contributors see $ROOTSYS/README/CREDITS. *
13 *************************************************************************/
14
16#include <ROOT/RError.hxx>
20#include <ROOT/RError.hxx>
21
22#include <TFile.h>
23
24#include <algorithm>
25#include <cstring>
26#include <deque>
27#include <exception>
28#include <iomanip>
29#include <iostream>
30
32
33ROOT::Experimental::RNTupleInspector::RNTupleInspector(std::unique_ptr<ROOT::Internal::RPageSource> pageSource)
34 : fPageSource(std::move(pageSource))
35{
36 fPageSource->Attach();
37 auto descriptorGuard = fPageSource->GetSharedDescriptorGuard();
38 fDescriptor = descriptorGuard->Clone();
39
41 CollectFieldTreeInfo(fDescriptor.GetFieldZeroId());
42}
43
44// NOTE: outlined to avoid including RPageStorage in the header
46
48{
51
52 for (const auto &colDesc : fDescriptor.GetColumnIterable()) {
53 if (colDesc.IsAliasColumn())
54 continue;
55
56 auto colId = colDesc.GetPhysicalId();
57
58 // We generate the default memory representation for the given column type in order
59 // to report the size _in memory_ of column elements.
60 std::uint32_t elemSize = RColumnElementBase::Generate(colDesc.GetType())->GetSize();
61 std::uint64_t nElems = 0;
62 std::vector<std::uint64_t> compressedPageSizes{};
63
64 for (const auto &clusterDescriptor : fDescriptor.GetClusterIterable()) {
65 if (!clusterDescriptor.ContainsColumn(colId)) {
66 continue;
67 }
68
69 auto columnRange = clusterDescriptor.GetColumnRange(colId);
70 if (columnRange.IsSuppressed())
71 continue;
72
73 nElems += columnRange.GetNElements();
74
75 if (!fCompressionSettings && columnRange.GetCompressionSettings()) {
76 fCompressionSettings = *columnRange.GetCompressionSettings();
77 } else if (fCompressionSettings && columnRange.GetCompressionSettings() &&
78 (*fCompressionSettings != *columnRange.GetCompressionSettings())) {
79 // Note that currently all clusters and columns are compressed with the same settings and it is not yet
80 // possible to do otherwise. This means that currently, this exception should never be thrown, but this
81 // could change in the future.
82 throw RException(R__FAIL("compression setting mismatch between column ranges (" +
83 std::to_string(*fCompressionSettings) + " vs " +
84 std::to_string(*columnRange.GetCompressionSettings()) +
85 ") for column with physical ID " + std::to_string(colId)));
86 }
87
88 const auto &pageRange = clusterDescriptor.GetPageRange(colId);
89
90 for (const auto &page : pageRange.GetPageInfos()) {
91 compressedPageSizes.emplace_back(page.GetLocator().GetNBytesOnStorage());
92 fUncompressedSize += page.GetNElements() * elemSize;
93 }
94 }
95
97 std::accumulate(compressedPageSizes.begin(), compressedPageSizes.end(), static_cast<std::uint64_t>(0));
98 fColumnInfo.emplace(colId, RColumnInspector(colDesc, compressedPageSizes, elemSize, nElems));
99 }
100}
101
104{
105 std::uint64_t compressedSize = 0;
106 std::uint64_t uncompressedSize = 0;
107
108 for (const auto &colDescriptor : fDescriptor.GetColumnIterable(fieldId)) {
109 auto colInfo = GetColumnInspector(colDescriptor.GetPhysicalId());
110 compressedSize += colInfo.GetCompressedSize();
111 uncompressedSize += colInfo.GetUncompressedSize();
112 }
113
114 for (const auto &subFieldDescriptor : fDescriptor.GetFieldIterable(fieldId)) {
115 auto subFieldId = subFieldDescriptor.GetId();
116
117 auto subFieldInfo = CollectFieldTreeInfo(subFieldId);
118
119 compressedSize += subFieldInfo.GetCompressedSize();
120 uncompressedSize += subFieldInfo.GetUncompressedSize();
121 }
122
123 auto fieldInfo = RFieldTreeInspector(fDescriptor.GetFieldDescriptor(fieldId), compressedSize, uncompressedSize);
124 fFieldTreeInfo.emplace(fieldId, fieldInfo);
125 return fieldInfo;
126}
127
128std::vector<ROOT::DescriptorId_t>
130{
131 std::vector<ROOT::DescriptorId_t> colIds;
132 std::deque<ROOT::DescriptorId_t> fieldIdQueue{fieldId};
133
134 while (!fieldIdQueue.empty()) {
135 auto currId = fieldIdQueue.front();
136 fieldIdQueue.pop_front();
137
138 for (const auto &col : fDescriptor.GetColumnIterable(currId)) {
139 if (col.IsAliasColumn()) {
140 continue;
141 }
142
143 colIds.emplace_back(col.GetPhysicalId());
144 }
145
146 for (const auto &fld : fDescriptor.GetFieldIterable(currId)) {
147 fieldIdQueue.push_back(fld.GetId());
148 }
149 }
150
151 return colIds;
152}
153
154std::unique_ptr<ROOT::Experimental::RNTupleInspector>
156{
157 auto pageSource = ROOT::Internal::RPageSourceFile::CreateFromAnchor(sourceNTuple);
158 return std::unique_ptr<RNTupleInspector>(new RNTupleInspector(std::move(pageSource)));
159}
160
161std::unique_ptr<ROOT::Experimental::RNTupleInspector>
162ROOT::Experimental::RNTupleInspector::Create(std::string_view ntupleName, std::string_view sourceFileName)
163{
164 auto pageSource = ROOT::Internal::RPageSource::Create(ntupleName, sourceFileName);
165 return std::unique_ptr<RNTupleInspector>(new RNTupleInspector(std::move(pageSource)));
166}
167
169{
171 return "unknown";
172
173 int algorithm = *fCompressionSettings / 100;
174 int level = *fCompressionSettings - (algorithm * 100);
175
177 " (level " + std::to_string(level) + ")";
178}
179
180//------------------------------------------------------------------------------
181
184{
185 if (physicalColumnId > fDescriptor.GetNPhysicalColumns()) {
186 throw RException(R__FAIL("No column with physical ID " + std::to_string(physicalColumnId) + " present"));
187 }
188
189 return fColumnInfo.at(physicalColumnId);
190}
191
193{
194 size_t typeCount = 0;
195
196 for (auto &[colId, colInfo] : fColumnInfo) {
197 if (colInfo.GetType() == colType) {
198 ++typeCount;
199 }
200 }
201
202 return typeCount;
203}
204
205std::vector<ROOT::DescriptorId_t>
207{
208 std::vector<ROOT::DescriptorId_t> colIds;
209
210 for (const auto &[colId, colInfo] : fColumnInfo) {
211 if (colInfo.GetType() == colType)
212 colIds.emplace_back(colId);
213 }
214
215 return colIds;
216}
217
218std::vector<ROOT::ENTupleColumnType> ROOT::Experimental::RNTupleInspector::GetColumnTypes()
219{
220 std::set<ROOT::ENTupleColumnType> colTypes;
221
222 for (const auto &[colId, colInfo] : fColumnInfo) {
223 colTypes.emplace(colInfo.GetType());
224 }
225
226 return std::vector(colTypes.begin(), colTypes.end());
227}
228
230{
231 struct ColumnTypeInfo {
232 std::uint64_t nElems = 0;
233 std::uint64_t compressedSize = 0;
234 std::uint64_t uncompressedSize = 0;
235 std::uint64_t nPages = 0;
236 std::uint32_t count = 0;
237
238 void operator+=(const RColumnInspector &colInfo)
239 {
240 this->count++;
241 this->nElems += colInfo.GetNElements();
242 this->compressedSize += colInfo.GetCompressedSize();
243 this->uncompressedSize += colInfo.GetUncompressedSize();
244 this->nPages += colInfo.GetNPages();
245 }
246
247 // Helper method to calculate compression factor
248 float GetCompressionFactor() const
249 {
250 if (compressedSize == 0)
251 return 1.0;
252 return static_cast<float>(uncompressedSize) / static_cast<float>(compressedSize);
253 }
254 };
255
256 std::map<ENTupleColumnType, ColumnTypeInfo> colTypeInfo;
257
258 // Collect information for each column
259 for (const auto &[colId, colInfo] : fColumnInfo) {
260 colTypeInfo[colInfo.GetType()] += colInfo;
261 }
262
263 switch (format) {
265 output << " column type | count | # elements | compressed bytes | uncompressed bytes | compression ratio | "
266 "# pages \n"
267 << "----------------|---------|-------------|------------------|--------------------|-------------------|-"
268 "------"
269 << std::endl;
270 for (const auto &[colType, typeInfo] : colTypeInfo)
271 output << std::setw(15) << RColumnElementBase::GetColumnTypeName(colType) << " |" << std::setw(8)
272 << typeInfo.count << " |" << std::setw(12) << typeInfo.nElems << " |" << std::setw(17)
273 << typeInfo.compressedSize << " |" << std::setw(19) << typeInfo.uncompressedSize << " |" << std::fixed
274 << std::setprecision(3) << std::setw(18) << typeInfo.GetCompressionFactor() << " |" << std::setw(6)
275 << typeInfo.nPages << " " << std::endl;
276 break;
278 output << "columnType,count,nElements,compressedSize,uncompressedSize,compressionFactor,nPages" << std::endl;
279 for (const auto &[colType, typeInfo] : colTypeInfo) {
280 output << RColumnElementBase::GetColumnTypeName(colType) << "," << typeInfo.count << "," << typeInfo.nElems
281 << "," << typeInfo.compressedSize << "," << typeInfo.uncompressedSize << "," << std::fixed
282 << std::setprecision(3) << typeInfo.GetCompressionFactor() << "," << typeInfo.nPages << std::endl;
283 }
284 break;
285 default: R__ASSERT(false && "Invalid print format");
286 }
287}
288
289std::unique_ptr<TH1D>
291 std::string_view histName, std::string_view histTitle)
292{
293 if (histName.empty()) {
294 switch (histKind) {
295 case ENTupleInspectorHist::kCount: histName = "colTypeCountHist"; break;
296 case ENTupleInspectorHist::kNElems: histName = "colTypeElemCountHist"; break;
297 case ENTupleInspectorHist::kCompressedSize: histName = "colTypeCompSizeHist"; break;
298 case ENTupleInspectorHist::kUncompressedSize: histName = "colTypeUncompSizeHist"; break;
299 default: throw RException(R__FAIL("Unknown histogram type"));
300 }
301 }
302
303 if (histTitle.empty()) {
304 switch (histKind) {
305 case ENTupleInspectorHist::kCount: histTitle = "Column count by type"; break;
306 case ENTupleInspectorHist::kNElems: histTitle = "Number of elements by column type"; break;
307 case ENTupleInspectorHist::kCompressedSize: histTitle = "Compressed size by column type"; break;
308 case ENTupleInspectorHist::kUncompressedSize: histTitle = "Uncompressed size by column type"; break;
309 default: throw RException(R__FAIL("Unknown histogram type"));
310 }
311 }
312
313 auto hist = std::make_unique<TH1D>(std::string(histName).c_str(), std::string(histTitle).c_str(), 1, 0, 1);
314
315 double data;
316 for (const auto &[colId, colInfo] : fColumnInfo) {
317 switch (histKind) {
318 case ENTupleInspectorHist::kCount: data = 1.; break;
319 case ENTupleInspectorHist::kNElems: data = colInfo.GetNElements(); break;
320 case ENTupleInspectorHist::kCompressedSize: data = colInfo.GetCompressedSize(); break;
321 case ENTupleInspectorHist::kUncompressedSize: data = colInfo.GetUncompressedSize(); break;
322 default: throw RException(R__FAIL("Unknown histogram type"));
323 }
324
325 hist->AddBinContent(hist->GetXaxis()->FindBin(RColumnElementBase::GetColumnTypeName(colInfo.GetType())), data);
326 }
327
328 return hist;
329}
330
331std::unique_ptr<TH1D>
333 std::string histName, std::string histTitle, size_t nBins)
334{
335 if (histTitle.empty())
336 histTitle = "Page size distribution for column with ID " + std::to_string(physicalColumnId);
337
338 return GetPageSizeDistribution({physicalColumnId}, histName, histTitle, nBins);
339}
340
342 std::string histName,
343 std::string histTitle, size_t nBins)
344{
345 if (histName.empty())
346 histName = "pageSizeHistCol" + std::string{RColumnElementBase::GetColumnTypeName(colType)};
347 if (histTitle.empty())
348 histTitle =
349 "Page size distribution for columns with type " + std::string{RColumnElementBase::GetColumnTypeName(colType)};
350
351 auto perTypeHist = GetPageSizeDistribution({colType}, histName, histTitle, nBins);
352
353 if (perTypeHist->GetNhists() < 1)
354 return std::make_unique<TH1D>(histName.c_str(), histTitle.c_str(), 64, 0, 0);
355
356 auto hist = std::unique_ptr<TH1D>(dynamic_cast<TH1D *>(perTypeHist->GetHists()->First()));
357
358 hist->SetName(histName.c_str());
359 hist->SetTitle(histTitle.c_str());
360 hist->SetXTitle("Page size (B)");
361 hist->SetYTitle("N_{pages}");
362 return hist;
363}
364
365std::unique_ptr<TH1D>
366ROOT::Experimental::RNTupleInspector::GetPageSizeDistribution(std::initializer_list<ROOT::DescriptorId_t> colIds,
367 std::string histName, std::string histTitle, size_t nBins)
368{
369 auto hist = std::make_unique<TH1D>();
370
371 if (histName.empty())
372 histName = "pageSizeHist";
373 hist->SetName(histName.c_str());
374 if (histTitle.empty())
375 histTitle = "Page size distribution";
376 hist->SetTitle(histTitle.c_str());
377 hist->SetXTitle("Page size (B)");
378 hist->SetYTitle("N_{pages}");
379
380 std::vector<std::uint64_t> pageSizes;
381 std::for_each(colIds.begin(), colIds.end(), [this, &pageSizes](const auto colId) {
382 auto colInfo = GetColumnInspector(colId);
383 pageSizes.insert(pageSizes.end(), colInfo.GetCompressedPageSizes().begin(),
384 colInfo.GetCompressedPageSizes().end());
385 });
386
387 if (!pageSizes.empty()) {
388 auto histMinMax = std::minmax_element(pageSizes.begin(), pageSizes.end());
389 hist->SetBins(nBins, *histMinMax.first,
390 *histMinMax.second + ((*histMinMax.second - *histMinMax.first) / static_cast<double>(nBins)));
391
392 for (const auto pageSize : pageSizes) {
393 hist->Fill(pageSize);
394 }
395 }
396
397 return hist;
398}
399
400std::unique_ptr<THStack>
401ROOT::Experimental::RNTupleInspector::GetPageSizeDistribution(std::initializer_list<ROOT::ENTupleColumnType> colTypes,
402 std::string histName, std::string histTitle, size_t nBins)
403{
404 if (histName.empty())
405 histName = "pageSizeHist";
406 if (histTitle.empty())
407 histTitle = "Per-column type page size distribution";
408
409 auto stackedHist = std::make_unique<THStack>(histName.c_str(), histTitle.c_str());
410
411 double histMin = std::numeric_limits<double>::max();
412 double histMax = 0;
413 std::map<ROOT::ENTupleColumnType, std::vector<std::uint64_t>> pageSizes;
414
415 std::vector<ROOT::ENTupleColumnType> colTypeVec = colTypes;
416 if (std::empty(colTypes)) {
417 colTypeVec = GetColumnTypes();
418 }
419
420 for (const auto colType : colTypeVec) {
421 auto colIds = GetColumnsByType(colType);
422
423 if (colIds.empty())
424 continue;
425
426 std::vector<std::uint64_t> pageSizesForColType;
427 std::for_each(colIds.cbegin(), colIds.cend(), [this, &pageSizesForColType](const auto colId) {
428 auto colInfo = GetColumnInspector(colId);
429 pageSizesForColType.insert(pageSizesForColType.end(), colInfo.GetCompressedPageSizes().begin(),
430 colInfo.GetCompressedPageSizes().end());
431 });
432 if (pageSizesForColType.empty())
433 continue;
434
435 pageSizes.emplace(colType, pageSizesForColType);
436
437 auto histMinMax = std::minmax_element(pageSizesForColType.begin(), pageSizesForColType.end());
438 histMin = std::min(histMin, static_cast<double>(*histMinMax.first));
439 histMax = std::max(histMax, static_cast<double>(*histMinMax.second));
440 }
441
442 for (const auto &[colType, pageSizesForColType] : pageSizes) {
443 auto hist = std::make_unique<TH1D>(
444 TString::Format("%s%s", histName.c_str(), RColumnElementBase::GetColumnTypeName(colType)),
445 RColumnElementBase::GetColumnTypeName(colType), nBins, histMin,
446 histMax + ((histMax - histMin) / static_cast<double>(nBins)));
447
448 for (const auto pageSize : pageSizesForColType) {
449 hist->Fill(pageSize);
450 }
451
452 stackedHist->Add(hist.release());
453 }
454
455 return stackedHist;
456}
457
458//------------------------------------------------------------------------------
459
462{
463 if (fieldId >= fDescriptor.GetNFields()) {
464 throw RException(R__FAIL("No field with ID " + std::to_string(fieldId) + " present"));
465 }
466
467 return fFieldTreeInfo.at(fieldId);
468}
469
472{
473 auto fieldId = fDescriptor.FindFieldId(fieldName);
474
475 if (fieldId == kInvalidDescriptorId) {
476 throw RException(R__FAIL("Could not find field `" + std::string(fieldName) + "`"));
477 }
478
479 return GetFieldTreeInspector(fieldId);
480}
481
482size_t ROOT::Experimental::RNTupleInspector::GetFieldCountByType(const std::regex &typeNamePattern,
483 bool includeSubfields) const
484{
485 size_t typeCount = 0;
486
487 for (auto &[fldId, fldInfo] : fFieldTreeInfo) {
488 if (!includeSubfields && fldInfo.GetDescriptor().GetParentId() != fDescriptor.GetFieldZeroId()) {
489 continue;
490 }
491
492 if (std::regex_match(fldInfo.GetDescriptor().GetTypeName(), typeNamePattern)) {
493 typeCount++;
494 }
495 }
496
497 return typeCount;
498}
499
500std::vector<ROOT::DescriptorId_t>
501ROOT::Experimental::RNTupleInspector::GetFieldsByName(const std::regex &fieldNamePattern, bool searchInSubfields) const
502{
503 std::vector<ROOT::DescriptorId_t> fieldIds;
504
505 for (auto &[fldId, fldInfo] : fFieldTreeInfo) {
506
507 if (!searchInSubfields && fldInfo.GetDescriptor().GetParentId() != fDescriptor.GetFieldZeroId()) {
508 continue;
509 }
510
511 if (std::regex_match(fldInfo.GetDescriptor().GetFieldName(), fieldNamePattern)) {
512 fieldIds.emplace_back(fldId);
513 }
514 }
515
516 return fieldIds;
517}
518
520 std::ostream &output) const
521{
522 const auto &tupleDescriptor = GetDescriptor();
523 const bool isZeroField = fieldDescriptor.GetParentId() == ROOT::kInvalidDescriptorId;
524 if (isZeroField) {
525 output << "digraph D {\n";
526 output << "node[shape=box]\n";
527 }
528 const std::string &nodeId = (isZeroField) ? "0" : std::to_string(fieldDescriptor.GetId() + 1);
529 const std::string &description = fieldDescriptor.GetFieldDescription();
530 const std::uint32_t &version = fieldDescriptor.GetFieldVersion();
531
532 auto htmlEscape = [&](const std::string &in) -> std::string {
533 std::string out;
534 out.reserve(in.size());
535 for (const char &c : in) {
536 switch (c) {
537 case '&': out += "&amp;"; break;
538 case '<': out += "&lt;"; break;
539 case '>': out += "&gt;"; break;
540 case '\"': out += "&quot;"; break;
541 case '\'': out += "&#39;"; break;
542 default: out += c; break;
543 }
544 }
545 return out;
546 };
547
548 output << nodeId << "[label=<";
549 if (!isZeroField) {
550 output << "<b>Name: </b>" << htmlEscape(fieldDescriptor.GetFieldName()) << "<br></br>";
551 output << "<b>Type: </b>" << htmlEscape(fieldDescriptor.GetTypeName()) << "<br></br>";
552 output << "<b>ID: </b>" << std::to_string(fieldDescriptor.GetId()) << "<br></br>";
553 if (description != "")
554 output << "<b>Description: </b>" << htmlEscape(description) << "<br></br>";
555 if (version != 0)
556 output << "<b>Version: </b>" << version << "<br></br>";
557 } else
558 output << "<b>RFieldZero</b>";
559 output << ">]\n";
560 for (const auto &childFieldId : fieldDescriptor.GetLinkIds()) {
561 const auto &childFieldDescriptor = tupleDescriptor.GetFieldDescriptor(childFieldId);
562 output << nodeId + "->" + std::to_string(childFieldDescriptor.GetId() + 1) + "\n";
563 PrintFieldTreeAsDot(childFieldDescriptor, output);
564 }
565 if (isZeroField)
566 output << "}";
567}
#define R__FAIL(msg)
Short-hand to return an RResult<T> in an error state; the RError is implicitly converted into RResult...
Definition RError.hxx:299
#define c(i)
Definition RSha256.hxx:101
#define R__ASSERT(e)
Checks condition e and reports a fatal error if it's false.
Definition TError.h:125
std::string & operator+=(std::string &left, const TString &right)
Definition TString.h:495
Provides column-level storage information.
float GetCompressionFactor() const
Get the compression factor of the RNTuple being inspected.
std::vector< ROOT::DescriptorId_t > GetFieldsByName(const std::regex &fieldNamePattern, bool searchInSubfields=true) const
Get the IDs of (sub-)fields whose name matches the given string.
const RFieldTreeInspector & GetFieldTreeInspector(ROOT::DescriptorId_t fieldId) const
Get storage information for a given (sub)field by ID.
std::unique_ptr< TH1D > GetPageSizeDistribution(ROOT::DescriptorId_t physicalColumnId, std::string histName="", std::string histTitle="", size_t nBins=64)
Get a histogram containing the size distribution of the compressed pages for an individual column.
const ROOT::RNTupleDescriptor & GetDescriptor() const
Get the descriptor for the RNTuple being inspected.
size_t GetColumnCountByType(ROOT::ENTupleColumnType colType) const
Get the number of columns of a given type present in the RNTuple.
std::optional< std::uint32_t > fCompressionSettings
The compression settings are unknown for an empty ntuple.
std::vector< ROOT::ENTupleColumnType > GetColumnTypes()
Get all column types present in the RNTuple being inspected.
size_t GetFieldCountByType(const std::regex &typeNamePattern, bool searchInSubfields=true) const
Get the number of fields of a given type or class present in the RNTuple.
std::vector< ROOT::DescriptorId_t > GetColumnsByType(ROOT::ENTupleColumnType colType)
Get the IDs of all columns with the given type.
std::string GetCompressionSettingsAsString() const
Get a string describing compression settings of the RNTuple being inspected.
RFieldTreeInspector CollectFieldTreeInfo(ROOT::DescriptorId_t fieldId)
Recursively gather field-level information.
RNTupleInspector(std::unique_ptr< ROOT::Internal::RPageSource > pageSource)
void PrintColumnTypeInfo(ENTupleInspectorPrintFormat format=ENTupleInspectorPrintFormat::kTable, std::ostream &output=std::cout)
Print storage information per column type.
const RColumnInspector & GetColumnInspector(ROOT::DescriptorId_t physicalColumnId) const
Get storage information for a given column.
std::unique_ptr< ROOT::Internal::RPageSource > fPageSource
static std::unique_ptr< RNTupleInspector > Create(const RNTuple &sourceNTuple)
Create a new RNTupleInspector.
std::unordered_map< int, RFieldTreeInspector > fFieldTreeInfo
void CollectColumnInfo()
Gather column-level and RNTuple-level information.
std::unordered_map< int, RColumnInspector > fColumnInfo
void PrintFieldTreeAsDot(const ROOT::RFieldDescriptor &fieldDescriptor, std::ostream &output=std::cout) const
Print a .dot string that represents the tree of the (sub)fields of an RNTuple.
std::vector< ROOT::DescriptorId_t > GetAllColumnsOfField(ROOT::DescriptorId_t fieldId) const
Get the columns that make up the given field, including its subfields.
std::unique_ptr< TH1D > GetColumnTypeInfoAsHist(ENTupleInspectorHist histKind, std::string_view histName="", std::string_view histTitle="")
Get a histogram showing information for each column type present,.
A column element encapsulates the translation between basic C++ types and their column representation...
static const char * GetColumnTypeName(ROOT::ENTupleColumnType type)
static std::unique_ptr< RColumnElementBase > Generate(ROOT::ENTupleColumnType type)
If CppT == void, use the default C++ type for the given column type.
static std::unique_ptr< RPageSourceFile > CreateFromAnchor(const RNTuple &anchor, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Used from the RNTuple class to build a datasource if the anchor is already available.
static std::unique_ptr< RPageSource > Create(std::string_view ntupleName, std::string_view location, const ROOT::RNTupleReadOptions &options=ROOT::RNTupleReadOptions())
Guess the concrete derived page source from the file name (location).
Base class for all ROOT issued exceptions.
Definition RError.hxx:78
Metadata stored for every field of an RNTuple.
ROOT::DescriptorId_t GetId() const
std::uint32_t GetFieldVersion() const
const std::vector< ROOT::DescriptorId_t > & GetLinkIds() const
ROOT::DescriptorId_t GetParentId() const
const std::string & GetFieldDescription() const
const std::string & GetFieldName() const
const std::string & GetTypeName() const
Representation of an RNTuple data set in a ROOT file.
Definition RNTuple.hxx:67
1-D histogram with a double per channel (see TH1 documentation)
Definition TH1.h:926
static TString Format(const char *fmt,...)
Static method which formats a string using a printf style format descriptor and return a TString.
Definition TString.cxx:2385
std::uint64_t DescriptorId_t
Distriniguishes elements of the same type within a descriptor, e.g. different fields.
constexpr DescriptorId_t kInvalidDescriptorId
ENTupleColumnType
EValues
Note: this is only temporarily a struct and will become a enum class hence the name convention used.
Definition Compression.h:88
static std::string AlgorithmToString(EAlgorithm::EValues algorithm)