]> git.uio.no Git - u/mrichter/AliRoot.git/blame - PYTHIA8/pythia8145/examples/main11.cc
New pythia8 version
[u/mrichter/AliRoot.git] / PYTHIA8 / pythia8145 / examples / main11.cc
CommitLineData
9419eeef 1// main11.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.
5
6// Generate a predetermined second hard interaction.
7
8#include "Pythia.h"
9
10using namespace Pythia8;
11
12int main() {
13
14 // Generator.
15 Pythia pythia;
16 Event& process = pythia.process;
17 Event& event = pythia.event;
18
19 // Select first hard process (just a small sample of possibilities).
20 //pythia.readString("HardQCD:all = on");
21 pythia.readString("Top:all = on");
22 //pythia.readString("WeakSingleBoson:ffbar2gmZ = on");
23 //pythia.readString("WeakSingleBoson:ffbar2W = on");
24
25 // Select second hard process (complete list of options).
26 pythia.readString("SecondHard:generate = on");
27 //pythia.readString("SecondHard:TwoJets = on");
28 pythia.readString("SecondHard:PhotonAndJet = on");
29 //pythia.readString("SecondHard:TwoPhotons = on");
30 //pythia.readString("SecondHard:SingleGmZ = on");
31 //pythia.readString("SecondHard:SingleW = on");
32 //pythia.readString("SecondHard:TwoBJets = on");
33
34 // Kinematics cuts, common for the two.
35 pythia.readString("PhaseSpace:mHatMin = 40.");
36 pythia.readString("PhaseSpace:pTHatMin = 20.");
37
38 // Initialize for LHC.
39 pythia.init( 2212, 2212, 14000.);
40
41 // Show changed settings.
42 pythia.settings.listChanged();
43
44 // Histogram.
45 Hist pTfirst("pT first collision", 100, 0., 200.);
46 Hist pTsecond("pT second collision", 100, 0., 200.);
47 Hist pTdiff("pT first-second collision", 100, -100., 100.);
48 Hist nMult("number of multiple interactions", 100, -0.5, 99.5);
49 Hist bMore("b enhancement factor", 100, 0., 10.);
50 Hist nChg("charged multiplicity", 100, -0.5, 999.5);
51
52 // Generate events. List first few.
53 for (int iev = 0; iev < 200; ++iev) {
54 pythia.next();
55 if (iev < 1) {
56 pythia.info.list();
57 process.list();
58 event.list();
59 }
60
61 // Histogram pT.
62 double pT1 = pythia.info.pTMI(0);
63 double pT2 = pythia.info.pTMI(1);
64 pTfirst.fill( pT1 );
65 pTsecond.fill( pT2 );
66 pTdiff.fill( pT1 - pT2 );
67
68 // Histogram multiple interactions
69 double nMI = pythia.info.nMI();
70 nMult.fill( nMI );
71 bMore.fill( pythia.info.enhanceMI() );
72
73 // Histogram charged multiplicity.
74 int nCharged = 0;
75 for (int i = 0; i < event.size(); ++i)
76 if (event[i].isFinal() && event[i].isCharged()) ++nCharged;
77 nChg.fill( nCharged );
78
79 }
80
81 // Compare full statistics listing with what is set in info.
82 pythia.statistics();
83 cout << scientific << setprecision(3) << " pythia.info: sigma = "
84 << pythia.info.sigmaGen() << " +- " << pythia.info.sigmaErr()
85 << endl;
86
87 // Print histograms.
88 cout << pTfirst << pTsecond << pTdiff << nMult << bMore << nChg;
89
90 // Done.
91 return 0;
92}