Hello,
Using TTree::Scan(), I would like to be able to print index for a structure or array element satisfying Max$(structure)
or Max$(array)
.
I found this related post, and this reference for commands to use within TTrees under the heading “Special functions and variables”. But neither really appears to provide an idea of what I want to achieve.
To try and explain what I want, I will provide examples of what I have tried. Suppose I have TTree object TreeA
and within that object I have a structure structB
or array arrB
. Here are some of the commands that I have tried:
TreeA.Scan("Iteration$", "max$(structB) == structB");
TreeA.Scan("Iteration$", "max$(structB) == structB && Iteration$");
TreeA.Scan("TMath::LocMax(length(structB), structB)");
TreeA.Scan("TMath::LocMax(N, {structB.object_1, structB.object_2, ..., structB.object_N})");
For the above the structB
contains only double values and nothing else. Perhaps there could be a way to cast the entries in the structure into an array to be used? That is what I tried doing in the last example, but the use objects within braces didn’t seem to be recognized as an array by TMath::LocMax()
didn’t seem to work.