Get the row of the maximum

Hi Everyone !
It’s already my second time that I use ROOT and i’m stuck on getting the row of the maximum of a branche.

I have a Tree with lot of branches, with lot of rows. I have find the maximum of one variable (Max_A), but i need the all row. So i’m looking for a way to getting this row.

I already search everywhere… Thanks for any help !

Akre

Hi,

Suppose the maximum of the variable (branch) A is 7.2. Then you could do tree->Scan("A", "A>=7.2"); The “row” column will state the TTree entry number.

tree->Scan("*", "A>7.2"); will show all columns from that entry.

Cheers, Axel.

Thanks, i think we are in the good way still i got a other problems.

The value read by GetMaximum (double) is 4.38403e+09, but the real value is 4384028000 (in my file) ,and when i wish convert 4.38403e+09 in string i have 4384028160.000000…

What are you doing to do this “conversion” ?

Because i can’t find the row of the maximum… I will never reach 4.38403e+09 (given by get maximum) if my real maxium is 4384028160.000000.

That’s a precision problem. You could subtract some small fraction from the floating point maximum.

Axel