6 #include "HepMC/GenEvent.h" 7 #include "HepMC/WriterAscii.h" 8 #include "HepMC/Print.h" 10 #include "Pythia8/Pythia.h" 11 #include "Pythia8/Pythia8ToHepMC3.h" 14 using namespace HepMC;
17 int main(
int argc,
char **argv) {
19 cout <<
"Usage: " << argv[0] <<
" <pythia_config_file> <output_hepmc3_file>" << endl;
23 Pythia8::Pythia pythia;
24 Pythia8ToHepMC3 pythiaToHepMC;
25 pythia.readFile(argv[1]);
30 int nEvent = pythia.mode(
"Main:numberOfEvents");
32 for(
int i = 0; i< nEvent; ++i ) {
33 if( !pythia.next() )
continue;
37 pythiaToHepMC.fill_next_event(pythia.event, &hepmc, -1, &pythia.info);
40 std::cout <<
"First event: " << std::endl;
44 file.write_event(hepmc);
static void listing(const GenEvent &event, unsigned short precision=2)
Print event in listing (HepMC2) format.
Stores event-related information.
GenEvent I/O serialization for structured text files.
int main(int argc, char **argv)
Definition of template class SmartPointer.