15 using namespace Pythia8;
23 Event&
event = pythia.event;
26 pythia.readFile(
"main04.cmnd");
29 int nEvent = pythia.mode(
"Main:numberOfEvents");
30 int nAbort = pythia.mode(
"Main:timesAllowErrors");
36 Hist nChg(
"number of charged particles; all", 100, -0.5, 799.5);
37 Hist nChgSD(
"number of charged particles; single diffraction",
39 Hist nChgDD(
"number of charged particles, double diffractive",
41 Hist nChgND(
"number of charged particles, non-diffractive",
43 Hist pTnChg(
"<pt>(n_charged) all", 100, -0.5, 799.5);
44 Hist pTnChgSD(
"<pt>(n_charged) single diffraction", 100, -0.5, 799.5);
45 Hist pTnChgDD(
"<pt>(n_charged) double diffraction", 100, -0.5, 799.5);
46 Hist pTnChgND(
"<pt>(n_charged) non-diffractive ", 100, -0.5, 799.5);
49 Hist mLogInel(
"log10(mass), by diffractive system", 100, 0., 5.);
50 Hist nChgmLog(
"<n_charged>(log10(mass))", 100, 0., 5.);
51 Hist pTmLog(
"<pT>_charged>(log10(mass))", 100, 0., 5.);
54 Hist tSpecEl(
"elastic |t| spectrum", 100, 0., 1.);
55 Hist tSpecElLog(
"elastic log10(|t|) spectrum", 100, -5., 0.);
56 Hist tSpecSD(
"single diffractive |t| spectrum", 100, 0., 2.);
57 Hist tSpecDD(
"double diffractive |t| spectrum", 100, 0., 5.);
58 Hist mSpec(
"diffractive mass spectrum", 100, 0., 100.);
59 Hist mLogSpec(
"log10(diffractive mass spectrum)", 100, 0., 4.);
64 Hist pTspec(
"total pT_hard spectrum", 100, 0., pTmax);
65 Hist pTspecND(
"nondiffractive pT_hard spectrum", 100, 0., pTmax);
66 Hist bSpec(
"b impact parameter spectrum", 100, 0., bMax);
67 Hist enhanceSpec(
"b enhancement spectrum", 100, 0., 10.);
68 Hist number(
"number of interactions", 100, -0.5, 99.5);
69 Hist pTb1(
"pT spectrum for b < 0.5", 100, 0., pTmax);
70 Hist pTb2(
"pT spectrum for 0.5 < b < 1", 100, 0., pTmax);
71 Hist pTb3(
"pT spectrum for 1 < b < 1.5", 100, 0., pTmax);
72 Hist pTb4(
"pT spectrum for 1.5 < b", 100, 0., pTmax);
73 Hist bpT1(
"b spectrum for pT < 2", 100, 0., bMax);
74 Hist bpT2(
"b spectrum for 2 < pT < 5", 100, 0., bMax);
75 Hist bpT3(
"b spectrum for 5 < pT < 15", 100, 0., bMax);
76 Hist bpT4(
"b spectrum for 15 < pT", 100, 0., bMax);
80 for (
int iEvent = 0; iEvent < nEvent; ++iEvent) {
84 if (++iAbort < nAbort)
continue;
85 cout <<
" Event generation aborted prematurely, owing to error!\n";
90 int code = pythia.info.code();
95 for (
int i = 1; i <
event.size(); ++i)
96 if (event[i].isFinal() &&
event[i].isCharged()) {
98 pTsum +=
event[i].pT();
101 if (nch > 0) pTnChg.fill( nch, pTsum/nch);
102 if (code == 103 || code == 104) {
104 if (nch > 0) pTnChgSD.fill( nch, pTsum/nch);
105 }
else if (code == 105) {
107 if (nch > 0) pTnChgDD.fill( nch, pTsum/nch);
108 }
else if (code == 101) {
110 if (nch > 0) pTnChgND.fill( nch, pTsum/nch);
111 double mLog = log10( event[0].m() );
112 mLogInel.fill( mLog );
113 nChgmLog.fill( mLog, nch );
114 if (nch > 0) pTmLog.fill( mLog, pTsum / nch );
118 for (
int iDiff = 0; iDiff < 2; ++iDiff)
119 if ( (iDiff == 0 && pythia.info.isDiffractiveA())
120 || (iDiff == 1 && pythia.info.isDiffractiveB()) ) {
123 for (
int i = 5; i <
event.size(); ++i)
124 if (event[i].isFinal() &&
event[i].isCharged()) {
127 do k =
event[k].mother1();
129 if (k == iDiff + 3) {
131 pTdiff +=
event[i].pT();
134 double mLog = log10(event[iDiff+3].m() );
135 mLogInel.fill( mLog );
136 nChgmLog.fill( mLog, ndiff );
137 if (ndiff > 0) pTmLog.fill( mLog, pTdiff / ndiff );
141 double pT = pythia.info.pTHat();
146 double tAbs = abs(pythia.info.tHat());
149 tSpecElLog.fill(log10(tAbs));
151 else if (code == 103 || code == 104) tSpecSD.fill(tAbs);
152 else if (code == 105) tSpecDD.fill(tAbs);
155 if (pythia.info.isDiffractiveA()) {
156 mSpec.fill( event[3].m() );
157 mLogSpec.fill( log10(event[3].m()) );
159 if (pythia.info.isDiffractiveB()) {
160 mSpec.fill( event[4].m() );
161 mLogSpec.fill( log10(event[4].m()) );
166 double b = pythia.info.bMPI();
167 double enhance = pythia.info.enhanceMPI();
168 int nMPI = pythia.info.nMPI();
171 enhanceSpec.fill( enhance );
173 if (b < 0.5) pTb1.fill( pT );
174 else if (b < 1.0) pTb2.fill( pT );
175 else if (b < 1.5) pTb3.fill( pT );
176 else pTb4.fill( pT );
177 if (pT < 2.) bpT1.fill( b );
178 else if (pT < 5.) bpT2.fill( b );
179 else if (pT < 15.) bpT3.fill( b );
192 nChgmLog /= mLogInel;
194 cout << nChg << nChgSD << nChgDD << nChgND
195 << pTnChg << pTnChgSD << pTnChgDD << pTnChgND
196 << mLogInel << nChgmLog << pTmLog
197 << tSpecEl << tSpecElLog << tSpecSD << tSpecDD << mSpec << mLogSpec
198 << pTspec << pTspecND << bSpec << enhanceSpec << number
199 << pTb1 << pTb2 << pTb3 << pTb4 << bpT1 << bpT2 << bpT3 << bpT4;