[skip-ci][DF] Add translations of TTree::Draw to RDataFrame#20284
[skip-ci][DF] Add translations of TTree::Draw to RDataFrame#20284martamaja10 merged 1 commit intoroot-project:masterfrom
Conversation
Test Results0 tests 0 ✅ 0s ⏱️ Results for commit 10c84e0. |
|
Would it make sense to have 3 columns on the table: one with TTree::Draw, one with "RDF one-liner" (interpreted, as few intermediate variables as possible) and one with "RDF fully compiled", with proper lambdas/types and not as brief as the second column? |
Thanks for this comment Jack! You're right, maybe having the minimal version here could be better and then showing the fully compiled version separately would also make sense. What I fear with 3 columns here is that maybe it will make it hard to read/comprehend quickly. Maybe this PR should focus on the simplest translation and then we add on top of it later? What do you think @vepadulano @hageboeck ? |
We could surely merge it now with these two columns, wait one night for it to show up in the docs, and subsequently test if the space allows us to have the third column. Maybe one could make a table with the most concise one-liners (actually, one statement), in C++ and Python. And then we could think about a second table with the "expert" fully compiled versions? auto histo = df.Filter(...)
.Define(....)
.Histo1D(...);seems easier to present and read than: auto histo = df.Filter(...).Define(....).Histo1D(...); |
|
Let's not forget that if the table is meant to be viewed on a webpage we can also have it dynamic (keep it with 2 columns but let the user decide which "flavor" of RDF is displayed with a dropdown menu or similar) - similarly to what e.g. Windows does for the WPF docs (notice the little dropdown menu that lets you select the programming language) |
|
Thanks for this! It's not for TTree::Draw but it would be nice to also document a translation of: (if a histogram of time differences of consecutive entries can be achieved at all with non-multithreaded RDF) |
I believe this PR should show the simplest/shortest way to represent in RDF an equivalent TTree::Draw query. Doing it in C++ or Python would be equivalent, it's fine to start with C++. Probably the string-expressions are the shortest way of representing the TTree::Draw queries in RDF (being those queries string expressions in the first place). If in any case having a C++ lambda makes the code shorter, then it's also fine to use that. |
vepadulano
left a comment
There was a problem hiding this comment.
Thank you so much! This is great! I have left a few comments
|
This is a great start! Thanks. For later PRs, there are several other cases (see for example dt_DrawTest.C that we should also tackle (in particular array element selection and indexing). |

First attempt of adding some "Rosetta stone" table. Open to discussion what else to include already now and what should be removed (note the last two rows of the table). The location of this table can also be modified.
Screenshots updated after second round of fixes (post Stephan's and Vincenzo's review)