TPythia and Pythia connection

Hello everyone,

I could use some help on an issue,

So, I have a code based on TPythia, but recently i have to use an .lhe file (input from another generator) which can only be done in Pythia.
The problem is I use the class TParticle from TPythia where I loop and fill histograms.
Pythia has a totally different stracture with other classes and members.
Also the code cant be compiled at all with included Pythia.h and TPythia.h, it is “confused”.

Is there any straightforward way to do it or I should rewrite the code from scratch?

Thank you in advance.
Kind Regards.

Nobody encountered something similar before?

Just a hint anyone?

To anyone that has encountered this, just ask me (pm), I have found a way


Could you give me a hint how you linked a new pythia library with lhe reading support with TPythia6?


If you are talking about PYTHIA6, see the [url= a PDFset for pythia6 inside Root"[/url] topic and note the two additional ROOT configure options “–enable-pythia6 --with-pythia6-libdir=/your/pythia6/lib/subdirectory”.

Hi Wile ,

I know this topic. I’ve probed the easest way, taking 2-3 minutes. Here is an example.
I wanted insert into TPythia6 EG wrapper my own upinit.f and upevnt.f doing showering and hadronization
of a few processes from NLO MCFM (that’s another story how I’v connected MCFM and Pythia). So I had several files:

pythia-6.4.12.f – needed version >6.3,at least, where I’ve removed dummy upevnt, upinit and upveto
readevent.C – file which is a bridge to MCFM code, it requires ROOT libs

So, next, I did:
gfortran -c -m32 -fPIC pythia-6.4.12.f
gfortran -c -m32 -fPIC upinit.f
gfortran -c -m32 -fPIC upevnt.f
g++ -c -m32 -fPIC $ROOTSYS/bin/root-config --cflags readevent.C
gfortran -m32 -shared -Wl,-soname, -o readevent.o upinit.o upevnt.o pythia-6.4.12.o

root -l
.L test_root_pythia.C+
test_root_pythia(); > log

where test_root_pythia.C

void test_root_pythia()
// gSystem->Load(“”);
TPythia6 Pythia;
Pythia.Initialize(“USER”, “p”, “p”,0 );
for (int i=0; i<10; i++ ) {
TClonesArray *all_part = new TClonesArray(“TParticle”, 1000);
cout << "Event No.: " << i << endl;
// to print test events
///all and decayed particles
Int_t nAll = Pythia.ImportParticles(all_part, “All”);
std::cout<<"All particle size "<<all_part->GetEntries()<<std::endl;

It seems that libEGPythia6 correctly links to modified pythia6 library ( in my case)