MakeClass() question

I was trying to use MakeClass on a fairly complicated Tree, and it seems to choke on our Tree structure:

[ul]root [1] T->MakeClass(“MyClass”)
Info in TTreePlayer::MakeClass: Files: MyClass.h and MyClass.C generated from TTree: T
(Int_t)(0)
root [2] .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]

where you see bad looking things like:

dPadRawWrapper *DST/dPc1Raw; dPadRawWrapper *DST/dPc2Raw; dPadRawWrapper *DST/dPc3Raw; dPadClusterWrapper *DST/dPc1Cluster; dPadClusterWrapper *DST/dPc2Cluster; dPadClusterWrapper *DST/dPc3Cluster;

I suppose this comes about because of the tree structure:

[ul]
*Br 101 :smiley:ST/dPc1Raw : *
*Entries : 3617 : Total Size= 6727569 bytes File Size = 1791144 *
*Baskets : 890 : Basket Size= 8000 bytes Compression= 3.74 *

*Br 102 :smiley:ST/dPc2Raw : *
*Entries : 3617 : Total Size= 1147575 bytes File Size = 321596 *
*Baskets : 148 : Basket Size= 8000 bytes Compression= 3.55 *[/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.

Hi,

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:

DST_dPc1Raw
DST_dPc2Raw

Your can still analyze your file but you will need to write your own selector.

Cheers,
Philippe.

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 :wink: ).

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.