I m trying to save a canvas in batch mode with root 3.02…
It used to work with:
c->SaveAs(“xxx.eps”);
but in batch mode, it creates a C++ macro file, I get the following message:
C++ Macro file: xxx.eps has been generated
(BTW, this file is not readable with $.x xxx.eps; some of the names are like (0x34944) and it seems that root doen’t really like that)…
Therefore I tried the alternative approach:
c->Print(“xxx.eps”);
but I got the same answer (C++ Macro file generated).
What it is the solution?
Thanks by advance,
Fabrice
PS: I don t know if there is connected but, to run in batch mode, as I compile my own job with root libraries, I ve just put gROOT->SetBatch() and it seems to work, no canvas appears on the screen and it doesn’t try to make the X-connection…
when I try the latex.C with root -b latex.C it works…
I didn’t even manage to reproduce the problem by changing:
1- c1.Print(“latex.ps”) ==> c1.Print(“latex.eps”);
2- compiling myself the code by putting gROOT->SetBatch() and using my standard makefile (the same I used for my application and no direct call to root.exe). It is still working.
I will try to reproduce the problem with this little example but this is very strange…
it is related to the name of the file to save. I didn’t manage to find out exactly what is the problem, it doesn’t seem to be related with the length of the name but this, I can not tell for sure… Anyway, if I replace in the latex.C example the name :
“latex.ps” == with ==> “/afs/in2p3.fr/group/babar/myNAME/RooFit.anal14/workdir/MyAna/DataAnal.dir/Bch.data.CM/Bch.MassKsK_T_visu.eps”
then I get:
C++ Macro file: xxxx.eps file generated ; where xxxx is the name above.
instead of an eps file.
More over, the problem doesn’t seem to be related with the fact that you run iin batch mode or not. So just by replacing the name I got the problem with the command:
root -l latex.C
Is there any prescription about the names to give to eps files or is it more likely a root bug?
Cheers,
Sorry for this second post. I guess the problem is not (at least not only) related with the length of the name but more likely eith the name of the subdirectories you uses, but I still don’t know exactly the perfect dosage of “_”, “.”, numbers and subdirectories…
Fabrice is not running with the ROOT main program. He has his main executable.
My guess is that he does not create a TApplication (or TRint) object.
As a result, the plug-in manager does not exist and the auto-loading of the postscript/etc
drivers does not work.
Fabrice, please have examples of main programs using ROOT in $ROOTSYS/test
We cannot reproduce your problem here. I have even tried to create a file name like yours, and it works. Are you sure your environment is correct ? are your environment variables pointing are the right places ? (ROOTSYS, LD_LIBRARY_PATH etc …)