15 using namespace Pythia8;
28 string pdfSet =
"MRST2001lo.LHgrid";
31 double nMax = (machine == 1) ? 199.5 : 399.5;
32 Hist nChargedOld(
"n_charged old PDF", 100, -0.5, nMax);
33 Hist nChargedNew(
"n_charged new PDF", 100, -0.5, nMax);
34 Hist nChargedRat(
"n_charged new/old PDF", 100, -0.5, nMax);
35 Hist ySpecOld(
"y charged distribution old PDF", 100, -10., 10.);
36 Hist ySpecNew(
"y charged distribution new PDF", 100, -10., 10.);
37 Hist ySpecRat(
"y charged distribution new/old PDF", 100, -10., 10.);
38 Hist pTSpecOld(
"pT charged distribution old PDF", 100, 0., 20.);
39 Hist pTSpecNew(
"pT charged distribution new PDF", 100, 0., 20.);
40 Hist pTSpecRat(
"pT charged distribution new/old PDF", 100, 0., 20.);
41 Hist avgPTnChOld(
"<pT>(n_charged) old PDF", 100, -0.5, nMax);
42 Hist avgPTnChNew(
"<pT>(n_charged) new PDF", 100, -0.5, nMax);
43 Hist avgPTnChRat(
"<pT>(n_charged) new/old PDF", 100, -0.5, nMax);
46 Hist xDistOld(
"MPI log(x) distribution old PDF", 80, -8., 0.);
47 Hist xDistNew(
"MPI log(x) distribution new PDF", 80, -8., 0.);
48 Hist xDistRat(
"MPI log(x) distribution new/old PDF", 80, -8., 0.);
49 Hist pTDistOld(
"MPI pT (=Q) distribution old PDF", 100, 0., 20.);
50 Hist pTDistNew(
"MPI pT (=Q) distribution new PDF", 100, 0., 20.);
51 Hist pTDistRat(
"MPI pT (=Q) distribution new/old PDF", 100, 0., 20.);
54 for (
int iRun = 0; iRun < 2; ++iRun) {
57 time_t tBegin = time(0);
61 Event&
event = pythia.event;
64 pythia.readString(
"SoftQCD:minBias = on");
73 pythia.readString(
"PDF:useLHAPDF = on");
74 pythia.readString(
"PDF:LHAPDFset = " + pdfSet);
78 pythia.readString(
"PDF:extrapolateLHAPDF = on");
86 double eCM = (machine == 1) ? 1960. : 7000.;
87 pythia.settings.parm(
"Beams:eCM", eCM);
88 if (machine == 1) pythia.readString(
"Beams:idB = -2212");
92 for (
int iEvent = 0; iEvent < nEvent; ++iEvent) {
95 if (!pythia.next())
continue;
100 for (
int i = 0; i <
event.size(); ++i)
101 if (event[i].isFinal() &&
event[i].isCharged()) {
103 pTsum +=
event[i].pT();
107 ySpecOld.fill( event[i].y() );
108 pTSpecOld.fill( event[i].pT() );
110 ySpecNew.fill( event[i].y() );
111 pTSpecNew.fill( event[i].pT() );
117 nChargedOld.fill( nCh );
118 avgPTnChOld.fill( nCh, pTsum / max(1, nCh) );
120 nChargedNew.fill( nCh );
121 avgPTnChNew.fill( nCh, pTsum / max(1, nCh) );
125 for (
int i = 1; i <
event.size(); ++i)
126 if (event[i].status() == -21 ||
event[i].status() == -31) {
127 double x = 2. *
event[i].e() / eCM;
128 if (iRun == 0) xDistOld.fill( log10(x) );
129 else xDistNew.fill( log10(x) );
133 for (
int i = 0; i < pythia.info.nMPI(); ++i) {
134 double pT = pythia.info.pTMPI(i);
135 if (iRun == 0) pTDistOld.fill( pT );
136 else pTDistNew.fill( pT );
143 pythia.readString(
"Stat:showPartonLevel = on");
147 time_t tEnd = time(0);
148 cout <<
"\n This subrun took " << tEnd - tBegin <<
" seconds \n" << endl;
154 avgPTnChOld /= nChargedOld;
155 avgPTnChNew /= nChargedNew;
158 nChargedRat = nChargedNew / nChargedOld;
159 ySpecRat = ySpecNew / ySpecOld;
160 pTSpecRat = pTSpecNew / pTSpecOld;
161 avgPTnChRat = avgPTnChNew / avgPTnChOld;
162 xDistRat = xDistNew / xDistOld;
163 pTDistRat = pTDistNew / pTDistOld;
166 cout << nChargedOld << nChargedNew << nChargedRat
167 << ySpecOld << ySpecNew << ySpecRat
168 << pTSpecOld << pTSpecNew << pTSpecRat
169 << avgPTnChOld << avgPTnChNew << avgPTnChRat
170 << xDistOld << xDistNew << xDistRat
171 << pTDistOld << pTDistNew << pTDistRat;
178 PDF* newPDF =
new LHAPDF(2212, pdfSet, 0);
181 Hist effFlinOld(
"F_effective( x, Q2 = 10) old", 100 , 0., 1.);
182 Hist effFlinNew(
"F_effective( x, Q2 = 10) new", 100 , 0., 1.);
183 Hist effFlinRat(
"F_effective( x, Q2 = 10) new/old", 100 , 0., 1.);
184 Hist effFlogOld(
"F_effective( x, Q2 = 10) old", 80 , -8., 0.);
185 Hist effFlogNew(
"F_effective( x, Q2 = 10) new", 80 , -8., 0.);
186 Hist effFlogRat(
"F_effective( x, Q2 = 10) new/old", 80 , -8., 0.);
189 for (
int iX = 0; iX < 99; ++iX) {
190 double x = 0.005 + 0.01 * iX;
193 double oldSum = 2.25 * oldPDF->xf( 21, x, Q2);
194 for (
int i = 1; i < 6; ++i)
195 oldSum += oldPDF->xf( i, x, Q2) + oldPDF->xf( -i, x, Q2);
196 effFlinOld.fill ( x, oldSum );
199 double newSum = 2.25 * newPDF->xf( 21, x, Q2);
200 for (
int i = 1; i < 6; ++i)
201 newSum += newPDF->xf( i, x, Q2) + newPDF->xf( -i, x, Q2);
202 effFlinNew.fill ( x, newSum );
208 for (
int iX = 0; iX < 80; ++iX) {
209 double xLog = -(0.1 * iX + 0.05);
210 double x = pow( 10., xLog);
213 double oldSum = 2.25 * oldPDF->xf( 21, x, Q2);
214 for (
int i = 1; i < 6; ++i)
215 oldSum += oldPDF->xf( i, x, Q2) + oldPDF->xf( -i, x, Q2);
216 effFlogOld.fill ( xLog, oldSum );
219 double newSum = 2.25 * newPDF->xf( 21, x, Q2);
220 for (
int i = 1; i < 6; ++i)
221 newSum += newPDF->xf( i, x, Q2) + newPDF->xf( -i, x, Q2);
222 effFlogNew.fill ( xLog, newSum );
228 effFlinRat = effFlinNew / effFlinOld;
229 effFlogRat = effFlogNew / effFlogOld;
232 cout << effFlinOld << effFlinNew << effFlinRat
233 << effFlogOld << effFlogNew << effFlogRat;