1
// main09.cc is a part of the PYTHIA event generator.
2
// Copyright (C) 2012 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
// Generate a predetermined second hard interaction.
10
using namespace Pythia8;
16
Event& event = pythia.event;
18
// Select first hard process (just a small sample of possibilities).
19
//pythia.readString("HardQCD:all = on");
20
pythia.readString("Top:all = on");
21
//pythia.readString("WeakSingleBoson:ffbar2gmZ = on");
22
//pythia.readString("WeakSingleBoson:ffbar2W = on");
24
// Select second hard process (complete list of options).
25
pythia.readString("SecondHard:generate = on");
26
//pythia.readString("SecondHard:TwoJets = on");
27
pythia.readString("SecondHard:PhotonAndJet = on");
28
//pythia.readString("SecondHard:TwoPhotons = on");
29
//pythia.readString("SecondHard:SingleGmZ = on");
30
//pythia.readString("SecondHard:SingleW = on");
31
//pythia.readString("SecondHard:TwoBJets = on");
33
// Kinematics cuts, common for the two.
34
pythia.readString("PhaseSpace:mHatMin = 40.");
35
pythia.readString("PhaseSpace:pTHatMin = 20.");
37
// Initialize for LHC at 8 TeV.
38
pythia.readString("Beams:eCM = 8000.");
42
Hist pTfirst("pT first collision", 100, 0., 400.);
43
Hist pTsecond("pT second collision", 100, 0., 200.);
44
Hist pTdiff("pT first-second collision", 100, -100., 300.);
45
Hist nMult("number of multiparton interactions", 100, -0.5, 99.5);
46
Hist bMore("b enhancement factor", 100, 0., 10.);
47
Hist nChg("charged multiplicity", 100, -0.5, 999.5);
50
for (int iev = 0; iev < 1000; ++iev) {
54
double pT1 = pythia.info.pTMPI(0);
55
double pT2 = pythia.info.pTMPI(1);
58
pTdiff.fill( pT1 - pT2 );
60
// Histogram multiparton interactions
61
double nMPI = pythia.info.nMPI();
63
bMore.fill( pythia.info.enhanceMPI() );
65
// Histogram charged multiplicity.
67
for (int i = 0; i < event.size(); ++i)
68
if (event[i].isFinal() && event[i].isCharged()) ++nCharged;
69
nChg.fill( nCharged );
73
// Compare full statistics listing with what is set in info.
75
cout << scientific << setprecision(3) << "\n From pythia.info: sigma = "
76
<< pythia.info.sigmaGen() << " +- " << pythia.info.sigmaErr()
80
cout << pTfirst << pTsecond << pTdiff << nMult << bMore << nChg;