Is there a method in TTree which returns the value for branch x for entry n?
Alternatively, is there a method in TBranch which returns the value for entry n?
If not, is there a simple way of doing this (besides doing scan/show, which simply print on the screen)?
You can do
TBranch *br = tree.GetBranch("branchname");
double value = br->GetValue();
Rene, here is the error that I get when I try that:
root  TFile *_file0 = TFile::Open(“source.root”)
root  TBranch *xpos=GeomInfo->GetBranch(“xpos”)
root  xpos->ls()
OBJ: TBranch xpos xpos/D : 0 at: 0x22ca8d0
root  double x=xpos->GetValue()
Error: Can’t call TBranch::GetValue() in current scope (tmpfile):1:
Possible candidates are…(in TBranch)
*** Interpreter error recovered ***
It appears that there is no GetValue() method in TBranch.
p.s. I am using Root version 5.18.[/code]
Sorry I made a mistake, Getvalue is in TLeaf, not TBranch. Do
TLeaf *xpos = GeomInfo->GetLeaf("xpos");
I just arrived to the same solution. Thanks in any case!