HepMC Interface

An interface to the HepMC [Dob01] standard event record format has been provided by M. Kirsanov. To use it, the relevant libraires need to be linked, as explained in the README file. Only version 2 of HepMC is supported. (Version 1 requires a different interface structure, which was only supported up until Pythia 8.107.)

The (simple) procedure to translate PYTHIA 8 events into HepMC ones is illustrated in the main31.cc, main32.cc and main54.cc main programs. At the core is a call to the

HepMC::I_Pythia8::fill_next_event( pythia, hepmcevt, ievnum = -1, convertGluonTo0 = false ) 
which takes a reference of the generator object and uses it, on the one hand, to read out and covert the event record in pythia.event and, on the other hand, to extract and store parton-density (PDF) information for the hard subprocess from pythia.info. The optional last argument, if true, allows you to store gluons as "PDG" code 0 rather than the normal 21; this only applies to the PDF information, not the event record.

The earlier version of this routine,

HepMC::I_Pythia8::fill_next_event( pythia.event, hepmcevt, ievnum = -1 ) 
is retained (for now) for backwards compatibility. It takes a PYTHIA event as input and returns a HepMC one, but without storing the PDF information. The latter could then instead be stored by a separate call
HepMC::I_Pythia8::pdf_put_info( hepmcevt, pythia, convertGluonTo0 = false ) 
or not, as wished.