My tree consists of two branches:
*Br 1 :si : E/F:Ed/F
*Br 5 :bgo : E/F:ELayer/F:Ed/F
As you can see, both branches contain the leaf “Ed”.
How can I get the maximum of “Ed” in “bgo” branch without drawing/projecting a histogram? The method T->GetMaximum(“bgo.Ed”) doesn’t work in this case.
What is the error message? (i.e. how does it fail)?
Can you send me your root file (or a way to reproduce it)?
It doesn’t fail. Let’s consider this simple code:
TFile *pFile = new TFile(“test.root”, “recreate”);
TTree *pTree = new TTree(“T”, “test tree”);
pTree->Branch(“br1”, &branch1, “x/F:y/F”);
pTree->Branch(“br2”, &branch2, “y/F:z/F”);
for (Int_t i=0; i<5; i++)
branch1.fx = i;
branch1.fy = i2;
branch2.fy = i3;
branch2.fz = i*4;
As you can see, x and z leafs exist only in one branch (br1 and br2 accordingly), but y leaf belongs to both branches.
T->GetMaximum(“x”) gives 4 - that’s right;
T->GetMaximum(“z”) gives 16 - and that’s right too;
But my question is: how can one get the maximum of y column in the second branch, for example? I was awaiting to say:
T->GetMaximum(“br2.y”), but it gives 0 instead of 12!
The prototype of GetMaximum() method is
Double_t TTree::GetMaximum(const char *columname)
What does columname mean in this very case?
This a bug in the ROOT code. The simpliest work-around is to generate an histogram.