Ok it is solved
[code]void simple_dump(){
gSystem->Load(âHptEventOld.soâ); // <â Create and load the library using TFile::MakeProject class
TFile *file = new TFile (âP1G.rootâ);
TTree tree = (TTree)file->Get(âUSR1â);
if(tree==0) return;
//tree->SetMakeClass(1); // no need to SetMakeClass()
Int_t Run;
Int_t Spill;
Int_t Evinspill;
//tree->SetBranchStatus("*", 0); // no need to âturn offâ all branches
HptEventOld *ptr = 0; // <â create a pointer for the structure
tree->SetBranchAddress(âEventâ,&ptr); // <â and use to hold the whole tree
// no need of these too
// tree->SetBranchAddress(âeRunâ,&Run);
// tree->SetBranchAddress(âeSpillâ,&Spill);
// tree->SetBranchAddress(âeEvinspillâ,&Evinspill);
Long64_t events = tree->GetEntries();
cout<<"****"<<events<<endl;
cout<<âEvt\tâ<<âSpill\tâ<<âRun\tâ<<endl;
for(Long64_t i = 0; i<events; i++)
{
tree->GetEntry(i);
cout<<ptr->eEvinspill<<'\t'<<ptr->eSpill<<'\t'<<ptr->eRun<<endl; // <--- the way to access the leafs
}
}[/code]
Long time passed since PCanal reply and Iâve hadnât the time to say thank you. This is also an embarrasing situation.
But now I had the opportunity, and this time I wonât wasted: Thank PCanal for your reply ([url]Problem while reading from tree using SetBranchAddress()
Cheers,
LuĂs.