You can try to use this syntax: if (TVirtualPad::Pad()) {
std::cout << "OK" << std::endl;
}
else {
std::cout << "Bad" << std::endl;
}
Cheers,
Bertrand.
The ROOT global variable (gPad for example) are currently available in the interpreter only when they are not equal to zero. So you ought to use the syntax proposed by Bertrand.
I will keep Bertrand and Olivier 's sugestions. Especially Olivier’s. The reason is that my script was a bit more complex, something like:
void doIt()
{
Options options = ... ;
TH2D* histo = drawHisto(options) ; // a compiled function (in a shared library) that creates a histogram, draws it on a new TCanvas, and returns a pointer on the histogram drawn
gPad->BlahBlah(); // I wanted to do something on the TCanvas created before
}
Using AClic got rid of the problem. I can also retrieve the TCanvas through its name ang gROOT (available in scripts).
Thanks for your suggestions