I did mytree->MakeClass() and found that the Notify() member function in the generated header file doesn’t have the usual:
b_fUniqueID = fChain->GetBranch(“fUniqueID”);
…
This stopped my code to compile. Is this the expected behavior? I’m running the code on solaris5.10 using the binary downloaded from the web for solaris5.9. It does compile an old program (with the header generated on a Linux machine) and runs fine. I don’t suspect the machine and compiler (CC) to be the problem though.
I do not see how this statement could be missing in the generated code.
Is this problem specific to Solaris10? Did you try on Linux?
If you cannot solve the problem, please postr a small xxx.root file that we can use to see the problem.
[quote] did mytree->MakeClass() and found that the Notify() member function in the generated header file doesn’t have the usual:
b_fUniqueID = fChain->GetBranch(“fUniqueID”);
[/quote]This is an intentional improvement. Those are now set (indirectly) via a new call to SetBranchAddress:
From the CVS log:
[quote]Enhance SetBranchAddress so that the curent recommended code:
chain->SetBranchAddres(branchname,&userdata); // once per chain
…
branchptr = chain->GetBranch(branchname); // once per tree in the chain
can be replaced by:
chain->SetBranchAddres(branchname,&userdata,&branchptr); // once per chain
As a result, branchptr will be either set to 0 when the branch does
not exist or the tree is not loaded yet and will be 'refreshed’
automatically everytime the chain loads a new tree.
MakeClass and MakeSelector have been updated to take advantage of
this new feature. This removed most the code from the Notify
method.[/quote]
[quote]This stopped my code to compile.
[/quote]How so?
Thanks for your reply. However, the error is persistent on my Linux machine too. If you T->MakeClass(“MyCode”) of the root file I supplied in the previous post and do the following:
TChain *chain = new Chain(“T”);
chain->Add(“nt_test.root”);
.L MyCode.C;
MyCode t(chain);
Symbol b_fUniqueID is not defined in current scope…
My machine is SL4.1 with gcc 3.4.3. Since I don’t compile my code here the error is compiler independent.