9 #include "Pythia8/Pythia.h"
11 using namespace Pythia8;
29 bool completeEvents =
false;
32 bool smallOutput =
true;
36 double pTrange = (mode < 4) ? 1000. : 100.;
37 Hist pTraw(
"pTHat distribution, unweighted", nRange, 0., pTrange);
38 Hist pTnorm(
"pTHat distribution, weighted", nRange, 0., pTrange);
39 Hist pTpow3(
"pTHat distribution, pT3*weighted", nRange, 0., pTrange);
40 Hist pTpow5(
"pTHat distribution, pT5*weighted", nRange, 0., pTrange);
41 Hist pTnormPart(
"pTHat distribution, weighted", nRange, 0., pTrange);
42 Hist pTpow3Part(
"pTHat distribution, pT3*weighted", nRange, 0., pTrange);
43 Hist pTpow5Part(
"pTHat distribution, pT5*weighted", nRange, 0., pTrange);
49 Settings& settings = pythia.settings;
50 Info& info = pythia.info;
54 pythia.readString(
"Init:showProcesses = off");
55 pythia.readString(
"Init:showMultipartonInteractions = off");
56 pythia.readString(
"Init:showChangedSettings = off");
57 pythia.readString(
"Init:showChangedParticleData = off");
58 pythia.readString(
"Next:numberCount = 1000000000");
59 pythia.readString(
"Next:numberShowInfo = 0");
60 pythia.readString(
"Next:numberShowProcess = 0");
61 pythia.readString(
"Next:numberShowEvent = 0");
67 pythia.readFile(
"main08.cmnd");
68 nBin = pythia.mode(
"Main:numberOfSubruns");
70 else if (mode == 3) nBin = 1;
71 else if (mode == 4) nBin = 4;
72 else if (mode == 5) nBin = 2;
75 double pTlimit[6] = {100., 150., 250., 400., 600., 0.};
82 double pTlimitLow[6] = {0., 20., 40., 70., 100.};
83 double pTlimitTwo[3] = {0., 20., 100.};
86 for (
int iBin = 0; iBin < nBin; ++iBin) {
90 if (mode > 3 && iBin == 0) {
91 pythia.readString(
"HardQCD:all = off");
92 pythia.readString(
"SoftQCD:nonDiffractive = on");
93 if (!completeEvents) {
94 pythia.readString(
"PartonLevel:all = on");
95 pythia.readString(
"PartonLevel:ISR = off");
96 pythia.readString(
"PartonLevel:FSR = off");
97 pythia.readString(
"HadronLevel:all = off");
100 pythia.readString(
"HardQCD:all = on");
101 pythia.readString(
"SoftQCD:nonDiffractive = off");
102 if (!completeEvents) pythia.readString(
"PartonLevel:all = off");
107 settings.parm(
"PhaseSpace:pTHatMin", pTlimit[iBin]);
108 settings.parm(
"PhaseSpace:pTHatMax", pTlimit[iBin + 1]);
112 else if (mode == 2) pythia.readFile(
"main08.cmnd", iBin);
115 else if (mode == 3) {
116 settings.parm(
"PhaseSpace:pTHatMin", pTlimit[0]);
117 settings.parm(
"PhaseSpace:pTHatMax", 0.);
118 pythia.readString(
"PhaseSpace:bias2Selection = on");
119 pythia.readString(
"PhaseSpace:bias2SelectionPow = 4.");
120 pythia.readString(
"PhaseSpace:bias2SelectionRef = 100.");
124 else if (mode == 4) {
125 settings.parm(
"PhaseSpace:pTHatMin", pTlimitLow[iBin]);
126 settings.parm(
"PhaseSpace:pTHatMax", pTlimitLow[iBin + 1]);
131 else if (mode == 5) {
132 settings.parm(
"PhaseSpace:pTHatMin", pTlimitTwo[iBin]);
133 settings.parm(
"PhaseSpace:pTHatMax", pTlimitTwo[iBin + 1]);
135 pythia.readString(
"PhaseSpace:bias2Selection = on");
136 pythia.readString(
"PhaseSpace:bias2SelectionPow = 4.");
137 pythia.readString(
"PhaseSpace:bias2SelectionRef = 20.");
142 pythia.readString(
"Beams:eCM = 14000.");
151 for (
int iEvent = 0; iEvent < nEvent; ++iEvent) {
154 if (!pythia.next())
continue;
159 double pTHat = info.pTHat();
160 if (mode > 3 && iBin == 0 && info.isNonDiffractive()
161 && pTHat > pTlimitLow[1])
continue;
164 double weight = info.weight();
166 pTnormPart.fill( pTHat, weight);
167 pTpow3Part.fill( pTHat, weight * pow3(pTHat) );
168 pTpow5Part.fill( pTHat, weight * pow5(pTHat) );
172 if (!smallOutput) pythia.stat();
175 double sigmaNorm = (info.sigmaGen() / info.weightSum())
176 * (nRange / pTrange);
177 pTnorm += sigmaNorm * pTnormPart;
178 pTpow3 += sigmaNorm * pTpow3Part;
179 pTpow5 += sigmaNorm * pTpow5Part;
185 cout << pTraw << pTnorm << pTpow3 << pTpow5;