Hello,
I use ROOT 4.04/02.
When I draw an histogram and print it into a png file, the result is not the same if I have a TApplication or not…
I don’t want to have a TApplication because I don’t want the TCanvas to display on the screen, since this program will be run on a cluster. When I have this line in my program :
TApplication theApp(“App”,&argc,argv);
the histogram are drawn correctly.
However, if I comment this line, the bins for which the content is 0 aren’t correctly displayed. There are bars that are displayed going in the negative direction.
I join two images generated, with and without including the TApplication line.
Ok, I generated my histogram and I exported it as a macro, which I edited to make a runing program.
I joined the code, compile it with :
g++ -O2 c.C -o test.out -I/usr/local/root/include/root/ -L/usr/local/root/lib/root/ -lCore -lCint -lGui -lGpad -lHist -lGraf -lMatrix -lGeom
Then, run ./test.out and look at the file test.png that is generated.
Now, uncomment the line
// TApplication theApp(“App”,&argc,argv);
in the c.C file, recompile, and look again at the test.png. c.C (2.02 KB)
Hello fine,
It’s not that I don’t want to read the documentation, but I don’t really have time to do it. Can you just tell me what I need to change to my code to enable Qt layer (which, by the way, I have no clues of what it is)
[quote=“mboisso”]Hello fine,
It’s not that I don’t want to read the documentation, but I don’t really have time to do it. Can you just tell me what I need to change to my code to enable Qt layer (which, by the way, I have no clues of what it is)[/quote]
I think if you have no time you should read docs or just forget my advice.
What about your code. You need change no line in your code.
The documentation in question is 2 pages. I really have no time to re-type these pages here
If you have Qt but have no Qt layer installed you can add it alone.
To adjust the brand new ROOT version do:
cvs -d :pserver:cvsuser@cvs.bnl.gov:/data01/CVS co -d qtRoot root
cd qtRoot
# define where you want to install the Qt components
export QTROOTSYSDIR=`pwd`/qtrootsys
# you may want to add Qt components into your ROOT installation
# directly. In this case replace "qtrootsys" directory
# name with $ROOTSYS
# -- For example:
# -- export QTROOTSYSDIR=$ROOTSYS
qmake # Do not mess QMAKE with GMAKE.
# At this point you need QMAKE
# use > qmake "CONFIG+=debug" # if you want to install the Qt components
# with the debug information attached
make install
# Note: Please disregard the warning messages:
# "WARNING: Failure to find: ${QMAKE_TARGET}Dict.cxx"
ls ${QTROOTSYSDIR}
# clean the redundant files
make distclean
Of course I can go further but then … then many people on this forum may have been forced wasting their time reading once again what they had already read from root.cern.ch/phpBB2/viewtopic.php?t=2231
Please send me a message if you want me reply you directly.