I have a compiled program that makes use of custom classes. Just before the end of execution I run a TRint instance so I can examine the results of the program interactively. Available in the TRint session are a TTree and a TH1D that I had created in my code, but not the TCustomClass that I had instantiated. I have TCustomClass inherit from TNamed and create the instance with something like:
In order for an ‘instance’ to be available on the CINT prompt, you need to explicit declared it there (and have the dictionary for its class loaded). For example:gROOT->ProcessLine(TString::Format("TCustomClass *cc = %p;",cc));
Being able to investigate variables/instances of by dumping the program into an interactive state has helped me greatly in my python development in the past (running ipython -i script.py, for example). Is the method you named above the most natural way to achieve this for a CINT interface given that I would like to compile my code using g++ for speed?
One thing you can do is to compile the code with ACLiC which will expose to the interpreter all the functions, class and global variables declared in the script.