Projecting a branch with an uncorrelated conditional

I have a tree with nested branches:

vector<vector<payload1>> A;
vector<vector<payload2>> B;

where the outer vectors are correlated (are coherent in index) but the inner aren’t (ie have different dimension and meaning). If I project:

mytree->Draw("A[].val1","B[][0].val2 == 1");

cint draws the values of A[][0].val1 that satisfy the conditional on B. Is there a way to tell cint that I want it to ignore the index in the conditional, and loop over all the values in the inner vector of A (ie A[][0], A[][1], …? I’ve tried syntaxes like “A[][].val1” but nothing I’ve tried worked.

ROOT Version: 6.30/04
Platform: macosx64
Compiler: Apple clang version 15.0.0

Maybe @Danilo or @pcanal knows. And BTW, please read tips for efficient and successful posting and posting code, otherwise the code can become easily unreadable :wink:

Dear Dave,

In my opinion, a valid alternative to the approach you are describing is to use RDataFrame, the analysis interface we develop and maintain most. You can code the complex manipulations you are trying to achieve.

I hope this helps.


1 Like

Thanks for the suggestion, I’ll try RDataFrame.

Thanks Dave, do not hesitate to come back if you have any question!

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.