i have a tree.root file i read
and it has some branches with float variables and some with integer variables
how can i get entries from these branches above?
is there a way to get all entries at once,
or do i have to get entries of each variable one at a time?
if so, what’s the code for reading different branches?
(i’ve already set the Branch addresses
and set the variables, eg.
int x,y;
float z,w; )
and something last,
the branches are in a subfolder of the tree.root
how can i write it in TTree ttree = (TTree)myfile->Get(" … ");
gets the first entry of the tree and loads all variables at the same time. If you just want to get one variable (branch), then you just do [code]branch1->GetEntry(0)[/code]
gets the first entry of the tree and loads all variables at the same time. If you just want to get one variable (branch), then you just do branch1->GetEntry(0)
[quote]the branches are in a subfolder of the tree.root
how can i write it in TTree ttree = (TTree)myfile->Get(" … ");
[/quote]I am not sure what you are asking about there … branches are inside a TTree and so are not directly connecting to the file’s folder so I am bit confused.