Accesing members/methods descriptions defined in the header comments


I have some trees with classes mapped to branches. By now I have more variables defined that I can remember of.

I like the reflection feature in ROOT that allows me to tabulate and get definitions of methods. I was wondering if I could tabulate (or query somehow) ROOT interpreter during a tree->Draw("MyVa[TAB] to get a list or a description of variables that match this pattern. Or maybe .help MyVa[TAB]…

Thank you

Please read tips for efficient and successful posting and posting code

_ROOT Version: v6-16-00
_Platform: Ubuntu 16.04
_Compiler: g++ 5.4.0

AFAIK there is no tab completion for the variable inside the tree, but you can use TTree::Print() to see the data in your tree. But maybe @Axel has another idea or advice

Thank you very much. I tried as well compiling the class:
.L MyClass.cpp++

then I can do
.class MyClass

but it strips off the comments after each variable, that would be the optimal --for me-- way to access the info

Hum, this works as well:

gSystem->Exec(“grep MyVar $SRC/*.h”)

1 Like

And finally :stuck_out_tongue:

 void MyHelp( TString what ) {
  TString MyQuery="grep -i "+what+" $DEVEL/*.h";
  gSystem->Exec( MyQuery.Data() );

And in ROOT I do:

.L MyHelp.C
1 Like

Note that it only works if you have the headers… :wink: