[ntuple] implement feature to draw storage layout#4634
Conversation
|
Can one of the admins verify this patch? |
| // ROOT. | ||
| std::vector<TCanvas *> fCanvasPtrs; | ||
| RDrawStorage(RNTupleReader *reader); | ||
| /// holds all created RDrawStorage instances until the lifetime |
There was a problem hiding this comment.
until the lifetime --> for the lifetime of the process?
There was a problem hiding this comment.
Good catch, it's until the ROOT program is terminated to be on the safe side. I updated the comment.
| { | ||
| switch (columnType) { | ||
| case EColumnType::kIndex: | ||
| fColumnType = "Index"; |
There was a problem hiding this comment.
I think we should put that information in RColumnModel.hxx. There can be static arrays with the names and on disk sizes, so that we can use something like kColumnNames[static_cast<int>(columnType)]
There was a problem hiding this comment.
Good idea, I implemented it.
|
|
||
| // ------------------------------ RNTupleDraw ------------------------------- | ||
|
|
||
| ROOT::Experimental::RNTupleDraw::RNTupleDraw(const std::unique_ptr<RNTupleReader> &reader) |
There was a problem hiding this comment.
Can we just pass an RNTupleReader *reader? The Draw object does not own the reader, correct?
There was a problem hiding this comment.
Originally I also wanted to just pass a raw pointer to avoid complications. But since RNTupleReader::Open() returns a unique_ptr and there might be non-C++ inclined users who don't know how to get the raw pointer form a unique_ptr, I thought it would be less confusing for users this way. I would leave the decision up to you if it should accept a raw pointer, reference to unique_ptr or allow both.
|
Replaced by #22641 |
This new feature allows to display the storage layout of an RNTuple and to click on its pages to display information about a page. It creates a new ntupledraw library to limit dependencies.
Syntax is similar to RNTupleReader and RNTupleWriter:
auto reader = RNTupleReader::Open("ntupleName", "fileName");auto draw = RNTupleDraw::Open(reader);draw->Draw();or
auto draw = RNTupleDraw(reader);draw.Draw();An example of a displayed RNTuple is shown below, zooming into the pages is possible:
