Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

rtree: possibility to implement buildIndex() ? #830

Open
rmadar opened this issue Dec 3, 2020 · 4 comments
Open

rtree: possibility to implement buildIndex() ? #830

rmadar opened this issue Dec 3, 2020 · 4 comments

Comments

@rmadar
Copy link
Member

rmadar commented Dec 3, 2020

I was just wondering how difficult would be to implement the t->BuildIndex("br1", "br2") function and the corresponding t->GetEntryWithIndex(v2, v2) function? I might need it in my analysis, but I can also probably find a work around if that's a lot of work

@sbinet
Copy link
Member

sbinet commented Dec 3, 2020

probably not too complicated. (famous last words)

do you have an example or use case for this?

the rtree.Reader interface is "batch oriented".
what the TTreeIndex class provides is something more akin to a random access cursor into entries. (so there might be some impedance mismatch)

@rmadar
Copy link
Member Author

rmadar commented Dec 3, 2020

Hum ok ... It is still a bit of work then. The use case is exactly the one discussed here: https://root-forum.cern.ch/t/size-limit-in-t-buildindex-function/42318. I can provide a small example later (tomorrow, probably). But I think it might be reasonable to postpone it to later (I am not even sure to really need it at the end).

@sbinet
Copy link
Member

sbinet commented Dec 3, 2020

from that little snippet, it seems what you are aiming at is a way to "add columns" to a tree, from another tree, aligned with some column values of the first tree.

ie: a way to modify rtree.Join so the rows of the other tree are in some user-defined order.

a possible API:

var (
    recTree = ...
    mcTree  = ...
)

r, err := rtree.Join(recTree, rtree.IndexedTree(mcTree, "branch1", "branch2").OrderBy(recTree))

(well, something along these lines, I guess.)

@rmadar
Copy link
Member Author

rmadar commented Dec 4, 2020

It is indeed something similar to adding column, except that the number of entries in the two trees can be different, and then not a perfect match beteween the two sets of events. Some events can be only in the first tree, while other can be only in the second.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants