Possible to show aliases when loading a tree?

Dear all,

I define my event structure in a class inherited from TNamed. All data members have long names like fLongNameToAvoidAmbiguousness I then save many events in a tree and browse the tree in the TBrowser. Of course, all branches and leaves are shown in such long names. There is no ambiguousness any more. However, it is painful to type tree->Draw("fAVeryLongVariableName") in an interactive session. So I create short aliases for frequently used variables, for example, “fTotalE” is aliased to “e”. But users must call tree->GetListOfAliases()->Print() to see the definition of aliases. Is there a way to show the list of all aliases automatically when an user loads the tree from a ROOT file in an interactive session? Or is there a better way to do the whole thing?

Thanks,

Jing

If the tree loading is done with thanks to some C macro you can put (in that macro) the list directive just after the tree loading.

[quote=“couet”]
If the tree loading is done with thanks to some C macro you can put (in that macro) the list directive just after the tree loading.[/quote]

Dear couet,

thank you for the suggestion. Unfortunately, most of the time a user opens the ROOT file containing the tree, launches a TBrowser to check what’s in the tree or type tree->Show(1) There is no common macro for everybody to use.

I save a class called “Event” into the tree. I am wondering if it is possible to modify the streamer in this class to output something on the screen when it is called. What do you think?

Cheers, Jing