10 using namespace Pythia8;
16 double integrate(
PDF* nowPDF,
double Q2) {
23 double dxLin = (1. - xLin) / nLin;
24 double dxLog = log(xLin / xLog) / nLog;
29 for (
int iLin = 0; iLin < nLin; ++iLin) {
30 x = xLin + (iLin + 0.5) * dxLin;
31 sumNow = nowPDF->xf( 21, x, Q2);
32 for (
int i = 1; i < 6; ++i)
33 sumNow += nowPDF->xf( i, x, Q2) + nowPDF->xf( -i, x, Q2);
34 sum += dxLin * sumNow;
38 for (
int iLog = 0; iLog < nLog; ++iLog) {
39 x = xLog * pow( xLin / xLog, (iLog + 0.5) / nLog );
40 sumNow = nowPDF->xf( 21, x, Q2);
41 for (
int i = 1; i < 6; ++i)
42 sumNow += nowPDF->xf( i, x, Q2) + nowPDF->xf( -i, x, Q2);
43 sum += dxLog * x * sumNow;
64 string pdfSet =
"MRST2007lomod.LHgrid";
68 PDF* newPDF =
new LHAPDF(2212, pdfSet, 0);
78 newPDF->setExtrapolate(
true);
82 Hist oldF4(
"F( x, Q2 = 4) old", 80 , -8., 0.);
83 Hist newF4(
"F( x, Q2 = 4) new", 80 , -8., 0.);
84 Hist ratF4(
"F( x, Q2 = 4) new/old", 80 , -8., 0.);
85 Hist oldF100(
"F( x, Q2 = 100) old", 80 , -8., 0.);
86 Hist newF100(
"F( x, Q2 = 100) new", 80 , -8., 0.);
87 Hist ratF100(
"F( x, Q2 = 100) new/old", 80 , -8., 0.);
90 for (
int iQ = 0; iQ < 2; ++iQ) {
91 double Q2 = (iQ == 0) ? 4. : 100;
94 for (
int iX = 0; iX < 80; ++iX) {
95 double xLog = -(0.1 * iX + 0.05);
96 double x = pow( 10., xLog);
99 double oldSum = 2.25 * oldPDF->xf( 21, x, Q2);
100 for (
int i = 1; i < 6; ++i)
101 oldSum += oldPDF->xf( i, x, Q2) + oldPDF->xf( -i, x, Q2);
102 if (iQ == 0) oldF4.fill ( xLog, oldSum );
103 else oldF100.fill ( xLog, oldSum );
106 double newSum = 2.25 * newPDF->xf( 21, x, Q2);
107 for (
int i = 1; i < 6; ++i)
108 newSum += newPDF->xf( i, x, Q2) + newPDF->xf( -i, x, Q2);
109 if (iQ == 0) newF4.fill ( xLog, newSum );
110 else newF100.fill ( xLog, newSum );
117 ratF4 = newF4 / oldF4;
118 ratF100 = newF100 / oldF100;
119 cout << oldF4 << newF4 << ratF4 << oldF100 << newF100 << ratF100;
122 Hist oldXSum(
"momentum sum(log10(Q2)) old", 100, -2., 8.);
123 Hist newXSum(
"momentum sum(log10(Q2)) new", 100, -2., 8.);
126 for (
int iQ = 0; iQ < 100; ++iQ) {
127 double log10Q2 = -2.0 + 0.1 * iQ + 0.05;
128 double Q2 = pow( 10., log10Q2);
131 double oldSum = integrate( oldPDF, Q2);
132 oldXSum.fill( log10Q2, oldSum);
133 double newSum = integrate( newPDF, Q2);
134 newXSum.fill( log10Q2, newSum);
138 cout << oldXSum << newXSum;