I would like to write a class object to tree.
I find the following method TTree::Branch() appropriate.
classname match the output of TObject::ClassName() and why at all is it necessary to indicated classname as this information is available to ROOT via
Please read tips for efficient and successful posting and posting code
ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided
You should not need it. This should work/be-sufficient:
MyClass *ptr = ....
Why do you put
& before the pointer? I conclude that you refer to TBranch * TTree::Branch (const char * name, T * obj, Int_t bufsize = 32000, Int_t splitlevel = 99 ) and there
obj is not a double pointer.
I was actually using: template TBranch * TTree::Branch ( const char * name, T ** addobj, Int_t bufsize = 32000, Int_t splitlevel = 99 )
But indeed you can also use the other alternative;
PS. Of course, there is other possible variation on how to use those functions
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.