Hi there,
I am trying to combine Root and Pythia 8 on my lxplus account. Pythia and Root work both fine by themselves, but the combination of the two doesn’t work. I tried to import the Root libraries in Pythia but I get several errors.
To get Root working on lxplus, I use the commands:
setenv ROOTSYS /afs/cern.ch/sw/lcg/external/root/5.12.00/slc4_ia32_gcc345/root
set path= ( $path $ROOTSYS/bin )
I have installed Pythia in my own directories:
I followed an example of what to change in the Pythia Makefile to be able to import Root, but unfortunately it doesn’t work. This example said that I needed to include the following lines in my Pythia .cc-file:
#include "TApplication.h"
#include "TROOT.h"
plus some other includes (TCanvas, TH2F, …). The main part has been changed to:
int main(int argc, char *argv[]) {
TApplication* rootapp = new TApplication("app", &argc, argv);
...(code)...
rootapp->Terminate();
return 0;
My Makefile was the standard Pythia 8 examples makefile, plus the added lines:
COMPILER = g++ Wno-long-long -g -Well
CFLAGS = $(shell root-config --cflags)
LIBS = $(shell root-config --libs) -lPhysics -lThread -lMinuit -lHtml -lVMC -lEG -lGeom
In my pythia8140/examples directory I then give the commands:
and I get the message:
rm -rf ../bin
rm -rf *.exe
rm -f *~; rm -f \#*; rm -f core*
g++ -O2 -ansi -pedantic -W -Wall -Wshadow -I../include CERN_pion_kaon_ratio.cc -o ../bin/CERN_pion_kaon_ratio.exe -pthread -I/afs/cern.ch/sw/lcg/external/root/5.12.00/slc4_ia32_gcc345/root/include -L/afs/cern.ch/sw/lcg/external/root/5.12.00/slc4_ia32_gcc345/root/lib -lCore -lCint -lHist -lGraf -lGraf3d -lGpad -lTree -lRint -lPostscript -lMatrix -lPhysics -pthread -lm -ldl -rdynamic -lPhysics -lThread -lMinuit -lHtml -lVMC -lEG -lGeom \
-L../lib/archive -lpythia8 -llhapdfdummy
In file included from /afs/cern.ch/sw/lcg/external/root/5.12.00/slc4_ia32_gcc345/root/include/TObject.h:31,
from /afs/cern.ch/sw/lcg/external/root/5.12.00/slc4_ia32_gcc345/root/include/TApplication.h:29,
from CERN_pion_kaon_ratio.cc:11:
/afs/cern.ch/sw/lcg/external/root/5.12.00/slc4_ia32_gcc345/root/include/Rtypes.h:123:1: warning: use of C99 long long integer constant
/afs/cern.ch/sw/lcg/external/root/5.12.00/slc4_ia32_gcc345/root/include/Rtypes.h:82: error: ISO C++ does not support ‘long long’
/afs/cern.ch/sw/lcg/external/root/5.12.00/slc4_ia32_gcc345/root/include/Rtypes.h:83: error: ISO C++ does not support ‘long long’
Is this a problem I can solve by just changing a few lines, or do I need a different method to combine Pythia and Root? Any help would be really appreciated.