PYTHIA object not working in ROOT macro

I am trying to compile a ROOT macro with PYTHIA on it by doing

.L ./HV_Pythia_ima.C++

It imports the headers well

#include "Pythia8/Pythia.h"
#include "Pythia8Plugins/HepMC3.h"
#include "Pythia8/Info.h"
#include "Pythia8/Analysis.h"
#include "Pythia8/Settings.h"

and it does not complain when doing the object initialization

Pythia* pythia8;

However, when I try to do something, like

pythia8->ReadString("PDF:lepton = on");

It shows an error

error: no member named 'ReadString' in 'Pythia8::Pythia'
pythia8->ReadString("PDF:lepton = on");

I am telling ROOT in the console where is my PYTHIA library by doing

gSystem->SetIncludePath("-I/Users/corredoira097/Desktop/PhD/HV/code/pythia8307/include/ -I/Users/corredoira097/Desktop/PhD/HV/code/fastjet-install/include/ -I/usr/local/include/")
gSystem->Load("/Users/corredoira097/Desktop/PhD/HV/code/fastjet-install/lib/libfastjet")
gSystem->Load("/Users/corredoira097/Desktop/PhD/HV/code/pythia8307/lib/libpythia8")
gSystem->Load("libEG")

And PYTHIA was compiled with -with-root configure option

Do you know what is the problem?


Please read tips for efficient and successful posting and posting code

Please fill also the fields below. Note that root -b -q will tell you this info, and starting from 6.28/06 upwards, you can call .forum bug from the ROOT prompt to pre-populate a topic.

ROOT Version: Not Provided
Platform: Not Provided
Compiler: Not Provided


Hi @imanol097,

thank you for your question. I found a similar problem on the forum here: Error when compiling macro: "'Pythia8/Analysis.h' file not found" , especially if you scroll a bit down, maybe try also adding: gSystem->Load("libEGPythia8"). If this doesn’t help, please provide us with a reproducer of your problem, and we will try to debug locally.

Cheers,
Marta

Hi,

I tried that and gives the same error. What kind of info you need ?

Imanol

Hi @imanol097,

sorry for a bit of delay in responding. What would be best is some kind of minimal code example that shows your problem so that I can try and reproduce it on my machine.

Cheers,
Marta

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.