Reading leaf from a tree

Hi, all.

I am trying to read a leaf from a tree (I would like to get data from @size leaf), but without any progress so far.
I have tried the following code:

void treereader2()
	TFile *f = TFile::Open("bmndst4700_BMNHF_BMNTF.root");
	TTree *bmndata = (TTree*)f->Get("bmndata");

	Float_t track_amount[209723];
	TBranch *tr_a = bmndata->GetBranch("BmnGlobalTrack@.GetEntries()");
	Int_t nevent = (Int_t)bmndata->GetEntries();
	for (Int_t i=0;i<nevent;i++) {
	printf("Amount of tracks:",track_amount[i]);


Any help would be appreciated.
With kind regards,

_ROOT Version: 6.26/02
_Platform: Linux 3.10.0-1062.12.1.el7.x86_64
_Compiler: Red Hat 4.8.5-39


The problem might be the name of the leaf you are passing to GetBranch? How is the leaf called? To find it out, you can do bmndata->Print().

Here’s a link to the docs in case it can help:

Hello etejedor,

I have tried something similar and it works. Thanks for your help.

With kind regards,