1 // main20.cc is a part of the PYTHIA event generator.
2 // Copyright (C) 2013 Torbjorn Sjostrand.
3 // PYTHIA is licenced under the GNU GPL version 2, see COPYING for details.
4 // Please respect the MCnet Guidelines, see GUIDELINES for details.
6 // This is a simple test program. It shows how PYTHIA 8 can write
7 // a Les Houches Event File based on its process-level events.
10 using namespace Pythia8;
16 // Process selection. Minimal masses for gamma*/Z and W+-.
17 pythia.readString("WeakDoubleBoson:all = on");
18 pythia.readString("23:mMin = 50.");
19 pythia.readString("24:mMin = 50.");
21 // Switch off generation of steps subsequent to the process level one.
22 // (These will not be stored anyway, so only steal time.)
23 pythia.readString("PartonLevel:all = off");
25 // Create an LHAup object that can access relevant information in pythia.
26 LHAupFromPYTHIA8 myLHA(&pythia.process, &pythia.info);
28 // Open a file on which LHEF events should be stored, and write header.
29 myLHA.openLHEF("weakbosons.lhe");
31 // LHC 8 TeV initialization.
32 pythia.readString("Beams:eCM = 8000.");
35 // Store initialization info in the LHAup object.
38 // Write out this initialization info on the file.
42 for (int i = 0; i < 100; ++i) {
47 // Store event info in the LHAup object.
50 // Write out this event info on the file.
51 // With optional argument (verbose =) false the file is smaller.
55 // Statistics: full printout.
58 // Update the cross section info based on Monte Carlo integration during run.
61 // Write endtag. Overwrite initialization info with new cross sections.
62 myLHA.closeLHEF(true);