Hi,
I just recently learned the “trick” of using a //! comment to prevent a data member of a user defined class from being made into a Tree Branch when using TTree::Bronch, i.e.
// Define some class that I intend to parse into a TTree
// using TTree::Bronch
class myclass
{
public:
double a; // This I do want to go into the tree, and it will.
double b; //! This I do not want to go into the tree, and it won't.
};
The reason I write about this here is that I would like to request that this “trick” be made more prominent in the ROOT documentation. For example, add it to the online TTree.html documentation. I have not seen it documented anywhere (granted I may have missed it, but something so useful as this should be very hard to miss); the only reason I now know of it is that I saw it used in someone else’s code which I was editing.
It would have been very useful for me to have this trick made more prominent in the documentation. I recently wrote a number of my own classes for a project, and thinking that it was impossible to have a class contain a data member which is not parsed into a TTree when using TTree::Bronch, I wasted a significant amount of time coming up with clumsy “workaround” solutions to a problem that does not actually exist.
Thanks,
Greg