This example demonstrates how to interface primary particles in Geant4 with various event generators via the HepMC Monte Carlo event interface. This is another example having the same generator action as HepMCEx01, but much simpler user control.
H02PrimaryGeneratorAction has HepMCG4Interface as the generator. There are two types of generators provided as samples. One generator reads primary information from a HepMC Ascii file (data/example_MyPythia.dat). The other one generates primaries directly invoking PYTHIA routines in every event.
A simplified collider-type geometry, which consists of
FTFP_BERT predefined physics list
All particles except muons are killed in the calorimeter section.
See Category "eventgenerator/HepMC" how to build this example.
% HepMCEx02 hepmc_pygen.in