TTree Draw multiple Iteration$

Hello,

I have question about looping within TTree::Draw.
Say I have two TClonesArrays and I want to loop over both of them with an iterator. Is there a way i can do this and still have access to each iterator?
If I do

t->Draw("array1->fValue[]:array2->fValue[]","array1->fValue2[Iteration$]==123&&array2->fValue2[Iteration$]==456")

what will be the resulting iteration? Is there only one Iteration$ variable or are there two and it knows which array I am indexing?

Thanks in advance.

Whitney Armstrong

1 Like

In reviewing root.cern.ch/root/html/TTree.html#TTree:Draw%2

I suppose my question is, can I use and refer to two different iteration variables somehow in Draw?

[quote]I suppose my question is, can I use and refer to two different iteration variables somehow in Draw?[/quote]No. This is not possible, TTreeFormula can only do one loop within an entry and Iteration$ is a reflection of where it is in the loop (and is not a way to control the iteration through the loop)

Cheers,
Philippe.