How to use TTree member function GetMaximum

Dear friends of root,

I have a root file containing branches made from custom classes. When I want to draw a 1D histogram I can use:
e.g.:
mytree->Draw(“angles.layerVecData[3][1]”)
and this works!

But when I want to do something simple like getting the maximum value of the data sample behind angles.layerVecData[3][1] I cannot use:
double maxValue = mytree->GetMaximum(“angles.layerVecData[3][1]”)
It just always returns 0 although the maximum value is not zero.

What do I have to do to get the maximum value of the data sample?

Thanks in advance and kind regards!

Hi,

Currently TTree::GetMinimum and TTree::GetMaximum only support the case where the expression points directly to a leaf. To get the maximum, you can use codemytree->SetEstimate(mytree->GetEntries()+1); mytree->Draw("angles.layerVecData[3][1]");and the use tree->GetV1() to find the max.

Cheers,
Philippe.