1 // main20.cc is a part of the PYTHIA event generator.
2 // Copyright (C) 2010 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 // Tevatron initialization.
32 pythia.init( 2212, -2212, 1960.);
34 // Store initialization info in the LHAup object.
37 // Write out this initialization info on the file.
41 for (int i = 0; i < 100; ++i) {
46 // Store event info in the LHAup object.
49 // Write out this event info on the file.
53 // Statistics: full printout.
56 // Update the cross section info based on Monte Carlo integration during run.
59 // Write endtag. Overwrite initialization info with new cross sections.
60 myLHA.closeLHEF(true);