Running Pythia8 with ROOT

Dear all, I’m trying to use Pythia8 from inside root. I’m not very experienced so I’m having some problems. The versions I’m using are:
ROOT 5.34/18
Pythia 8185
Fedora 20

I’ll list what I’ve done so far:
I’ve installed Pythia enabling shared libraries then ran these commands:

export PYTHIA8=$HOME/workspace/pythia8185 export PYTHIA8DATA=$PYTHIA8/xmldoc

I’ve configured ROOT while enabling pythia8:

I’ve checked during configuration that it reads the pythia8 files. It was correct. Then I ran 'make’

Then I’ve run ‘root’ and it runs correctly.
I tried: .x $ROOTSYS/tutorials/pythia/pythia8.C
and it produces an output file by the name ‘Pythia8 test example’, where the charts are there but empty (no lines drawn) and it gives me the following warning:

[quote] ------- PYTHIA Error and Warning Messages Statistics ----------------------------------------------------------
| |
| times message |
| |
| 1 Abort from Pythia::init: some user settings did not make sense |
| 100 Abort from Pythia::next: not properly initialized so cannot generate events |
| |
------- End PYTHIA Error and Warning Messages Statistics ------------------------------------------------------

I just posted this part in case it would help identifying the main problem, which is, when I try to run the pythia example files inside root using:

I get: Error: cannot open file "Pythia8/Pythia.h" /home/omar/workspace/pythia8185/examples/ *** Interpreter error recovered ***
which I understand means that ROOT cannot use the include directory from Pythia, although it was specified.

I tried moving the Pythia libraries to /usr/include, which bypassed this error, but ran into many more errors as it seems Pythia is not properly defined inside ROOT. so I reversed that move and hoping to correctly configure Pythia with ROOT.

I’m currently stuck as to what try next so any help would be highly appreciated.



it seems that the Pythia setting “SoftQCD:minbias = on” is not recognised. To start playing with Pythia in ROOT, you can replace the three lines

   pythia8->ReadString("SoftQCD:minbias = on");
   pythia8->ReadString("SoftQCD:singleDiffractive = on");
   pythia8->ReadString("SoftQCD:doubleDiffractive = on");

in the tutorial with

pythia8->ReadString("HardQCD:all = on");

I hope this can get you started. Meanwhile, I am investigating the issue.

As for executing as a macro, this is conceptually wrong. This is a program meant to be compiled.



Thanks a lot for your help. I appreciate it :slight_smile:

Now I replaced those lines and got a correct output from Pythia.h

I now understand it is wrong to execute main files as macros, but could you help as to what is the correct way of doing it?

I did successfully compile the and other main files from outside ROOT using make, but I fail when I start including ROOT libraries.
Am I supposed to compile those files inside ROOT using CINT (not sure how to do it this way), or is the correct way is to completely run those files from outside ROOT, just linking to the ROOT libraries(which hasn’t work quite well for me so far).

I’m a bit confused on how to proceed so any help would be appreciated.



the correct way is to use a compiler (gcc, clang, icc) to compile the Pythia examples.
I am afraid that any issue encountered during this process is a candidate for a Pythia forum rather than the root one…


Okay would try to figure out how to proceed.

Thanks a lot for your help