Hello,
I’m trying to read a TTree file with four branches. However when implementing the code analogous to how it is done in some of the simple Tree examples, it gives an error message when setting the Branch address:
"Error: Can't call TTree::SetBranchAdress("edep",&edep) in current scope C:\Users\Jerom\pixelanalysis.cpp(22)
Possible candidates are...
(in TTree)"
I tried to search for this error message but couldn’t find any clues. Below is the code that I am using:
void pixelanalysis()
{
TFile *my_file = new TFile("B4Grid.root");
TTree *my_tree = (TTree*)my_file->Get("B4Grid");
Double_t edep,xpos,ypos,zpos;
my_tree->SetBranchAdress("edep",&edep);
my_tree->SetBranchAdress("xpos",&xpos);
my_tree->SetBranchAdress("ypos",&ypos);
my_tree->SetBranchAdress("zpos",&zpos);
}