I was trying to use MakeClass on a fairly complicated Tree, and it seems to choke on our Tree structure:
[ul]root  T->MakeClass(“MyClass”)
Info in TTreePlayer::MakeClass: Files: MyClass.h and MyClass.C generated from TTree: T
root  .L MyClass.C
Error: Symbol dPadRawWrapper is not defined in current scope MyClass.h:174:
Error: Symbol DST is not defined in current scope MyClass.h:174:
Error: Symbol dPc1Raw is not defined in current scope MyClass.h:174:
Error: operator ‘/’ divided by zero MyClass.h:174:[/ul]
since I have used MakeClass with no problem on trees of my own making. Is this a deficiency of the tree I have to use here, or of MakeClass, or is there some workaround possible for this? This is with version 5.17/01 in Linux, but I see the same thing in 5.18/00 in Cygwin. Thanks for any insight into this.
Due to the non-standard use of ‘/’ in the branch name none of the automatic tools in ROOT (TTree::Draw,MakeProxy,MakeClass) will be able to handle your branch.
If you want to use the automatic tools, you must use branch names that can be used as C++ symbols. For example use:
Your can still analyze your file but you will need to write your own selector.
PS. Practically one issue is what should MakeClass replace ‘DST/dPc1Raw’ with. One possibility would be to automatically replace them with ‘_’ but then if you have the branches DST/dPc1Raw, DST_dPc1Raw and DST+dPc1Raw then your make class will have 3 times the same variables (or I will have to add some semi random prefix that you might or might be able to guess when writing your analysis code ).
I know I’m building my own prejudice in here, but I’m just trying to access this tree based on what the tree says about itself, which seems to me is everything I need to know. For example, T->Print() tells me:
so it seems to know everything I need to know already, including the data types. Is there not some way to take the tree, get all the variable names and types, and access the data in a macro without any information outside what’s in the tree itself?
I’m probably being stupid or not reading the right sections of the documentation, but I just can’t seem to do this… or is it impossible to do without the structures used to make the tree? If someone could point me in the right direction (or go give up), perhaps I could overcome this particular obsession.