22 #ifndef Pythia8_PartonDistributions_H
23 #define Pythia8_PartonDistributions_H
25 #include "Pythia8/Basics.h"
26 #include "Pythia8/Info.h"
27 #include "Pythia8/ParticleData.h"
28 #include "Pythia8/PythiaStdlib.h"
41 PDF(
int idBeamIn = 2212) {idBeam = idBeamIn; idBeamAbs = abs(idBeam);
42 setValenceContent(); idSav = 9; xSav = -1.; Q2Sav = -1.;
43 xu = 0.; xd = 0.; xs = 0.; xubar = 0.; xdbar = 0.; xsbar = 0.; xc = 0.;
44 xb = 0.; xg = 0.; xlepton = 0.; xgamma = 0.; xuVal = 0.; xuSea = 0.;
45 xdVal = 0.; xdSea = 0.; isSet =
true; isInit =
false;}
51 bool isSetup() {
return isSet;}
54 void newValenceContent(
int idVal1In,
int idVal2In) {
55 idVal1 = idVal1In; idVal2 = idVal2In;}
58 virtual void setExtrapolate(
bool) {}
61 double xf(
int id,
double x,
double Q2);
64 double xfVal(
int id,
double x,
double Q2);
65 double xfSea(
int id,
double x,
double Q2);
70 int idBeam, idBeamAbs, idSav, idVal1, idVal2;
72 double xu, xd, xs, xubar, xdbar, xsbar, xc, xb, xg, xlepton, xgamma,
73 xuVal, xuSea, xdVal, xdSea;
77 void setValenceContent();
80 virtual void xfUpdate(
int id,
double x,
double Q2) = 0;
88 class LHAPDF :
public PDF {
93 LHAPDF(
int idBeamIn,
string setName,
int member,
int nSetIn = 1,
94 Info* infoPtr = 0) : PDF(idBeamIn), nSet(nSetIn)
95 {init( setName, member, infoPtr);}
98 void setExtrapolate(
bool extrapol);
102 static int findNSet(
string setName,
int member);
105 static int freeNSet();
110 void init(
string setName,
int member, Info* infoPtr);
113 void xfUpdate(
int ,
double x,
double Q2);
123 static map< int, pair<string, int> > initializedSets;
132 class GRV94L :
public PDF {
137 GRV94L(
int idBeamIn = 2212) : PDF(idBeamIn) {}
142 void xfUpdate(
int ,
double x,
double Q2);
145 double grvv (
double x,
double n,
double ak,
double bk,
double a,
146 double b,
double c,
double d);
147 double grvw (
double x,
double s,
double al,
double be,
double ak,
148 double bk,
double a,
double b,
double c,
double d,
double e,
double es);
149 double grvs (
double x,
double s,
double sth,
double al,
double be,
150 double ak,
double ag,
double b,
double d,
double e,
double es);
159 class CTEQ5L :
public PDF {
164 CTEQ5L(
int idBeamIn = 2212) : PDF(idBeamIn) {}
169 void xfUpdate(
int ,
double x,
double Q2);
185 class MSTWpdf :
public PDF {
190 MSTWpdf(
int idBeamIn = 2212,
int iFitIn = 1,
string xmlPath =
"../xmldoc/",
191 Info* infoPtr = 0) : PDF(idBeamIn) {init( iFitIn, xmlPath, infoPtr);}
196 static const int np, nx, nq, nqc0, nqb0;
197 static const double xmin, xmax, qsqmin, qsqmax, xxInit[65], qqInit[49];
200 int iFit, alphaSorder, alphaSnfmax;
201 double mCharm, mBottom, alphaSQ0, alphaSMZ, distance, tolerance,
202 xx[65], qq[49], c[13][64][48][5][5];
205 void init(
int iFitIn,
string xmlPath, Info* infoPtr);
208 void xfUpdate(
int ,
double x,
double Q2);
211 double parton(
int flavour,
double x,
double q);
212 double parton_interpolate(
int flavour,
double xxx,
double qqq);
213 double parton_extrapolate(
int flavour,
double xxx,
double qqq);
216 int locate(
double xx[],
int n,
double x);
217 double polderivative1(
double x1,
double x2,
double x3,
double y1,
218 double y2,
double y3);
219 double polderivative2(
double x1,
double x2,
double x3,
double y1,
220 double y2,
double y3);
221 double polderivative3(
double x1,
double x2,
double x3,
double y1,
222 double y2,
double y3);
237 class CTEQ6pdf :
public PDF {
242 CTEQ6pdf(
int idBeamIn = 2212,
int iFitIn = 1,
string xmlPath =
"../xmldoc/",
243 Info* infoPtr = 0) : PDF(idBeamIn) {init( iFitIn, xmlPath, infoPtr);}
248 static const double EPSILON, XPOWER;
251 int iFit, order, nQuark, nfMx, mxVal, nX, nT, nG,
252 iGridX, iGridQ, iGridLX, iGridLQ;
253 double lambda, mQ[7], qIni, qMax, tv[26], xMin, xv[202], upd[57773],
254 xvpow[202], xMinEps, xMaxEps, qMinEps, qMaxEps, fVec[5],
255 tConst[9], xConst[9], xLast, qLast;
258 void init(
int iFitIn,
string xmlPath, Info* infoPtr);
261 void xfUpdate(
int id,
double x,
double Q2);
264 double parton6(
int iParton,
double x,
double q);
267 double polint4F(
double xgrid[],
double fgrid[],
double xin);
277 class ProtonPoint :
public PDF {
282 ProtonPoint(
int idBeamIn = 2212, Info* infoPtrIn = 0) :
283 PDF(idBeamIn), m_infoPtr(infoPtrIn) {}
288 static const double ALPHAEM, Q2MAX, Q20, A, B, C;
291 void xfUpdate(
int ,
double x,
double Q2);
294 double phiFunc(
double x,
double Q);
306 class GRVpiL :
public PDF {
311 GRVpiL(
int idBeamIn = 221) : PDF(idBeamIn) {}
316 void xfUpdate(
int ,
double x,
double Q2);
324 class PomFix :
public PDF {
329 PomFix(
int idBeamIn = 990,
double PomGluonAIn = 0.,
330 double PomGluonBIn = 0.,
double PomQuarkAIn = 0.,
331 double PomQuarkBIn = 0.,
double PomQuarkFracIn = 0.,
332 double PomStrangeSuppIn = 0.) : PDF(idBeamIn),
333 PomGluonA(PomGluonAIn), PomGluonB(PomGluonBIn),
334 PomQuarkA(PomQuarkAIn), PomQuarkB(PomQuarkBIn),
335 PomQuarkFrac(PomQuarkFracIn), PomStrangeSupp(PomStrangeSuppIn)
341 double PomGluonA, PomGluonB, PomQuarkA, PomQuarkB, PomQuarkFrac,
342 PomStrangeSupp, normGluon, normQuark;
348 void xfUpdate(
int ,
double x,
double);
359 class PomH1FitAB :
public PDF {
364 PomH1FitAB(
int idBeamIn = 990,
int iFit = 1,
double rescaleIn = 1.,
365 string xmlPath =
"../xmldoc/", Info* infoPtr = 0) : PDF(idBeamIn)
366 {rescale = rescaleIn; init( iFit, xmlPath, infoPtr);}
372 double rescale, xlow, xupp, dx, Q2low, Q2upp, dQ2;
373 double gluonGrid[100][30];
374 double quarkGrid[100][30];
377 void init(
int iFit,
string xmlPath, Info* infoPtr);
380 void xfUpdate(
int ,
double x,
double );
391 class PomH1Jets :
public PDF {
396 PomH1Jets(
int idBeamIn = 990,
double rescaleIn = 1.,
397 string xmlPath =
"../xmldoc/", Info* infoPtr = 0) : PDF(idBeamIn)
398 {rescale = rescaleIn; init( xmlPath, infoPtr);}
406 double gluonGrid[100][88];
407 double singletGrid[100][88];
408 double charmGrid[100][88];
411 void init(
string xmlPath, Info* infoPtr);
414 void xfUpdate(
int id,
double x,
double );
422 class Lepton :
public PDF {
427 Lepton(
int idBeamIn = 11) : PDF(idBeamIn) {}
432 static const double ALPHAEM, ME, MMU, MTAU;
435 void xfUpdate(
int id,
double x,
double Q2);
446 class LeptonPoint :
public PDF {
451 LeptonPoint(
int idBeamIn = 11) : PDF(idBeamIn) {}
456 void xfUpdate(
int ,
double ,
double ) {xlepton = 1; xgamma = 0.;}
465 class NeutrinoPoint :
public PDF {
470 NeutrinoPoint(
int idBeamIn = 12) : PDF(idBeamIn) {}
475 void xfUpdate(
int ,
double ,
double ) {xlepton = 2; xgamma = 0.;}
496 NNPDF(
int idBeamIn = 2212,
int iFitIn = 1,
string xmlPath =
"../xmldoc/",
497 Info* infoPtr = 0) :
PDF(idBeamIn), fPDFGrid(NULL), fXGrid(NULL),
498 fLogXGrid(NULL), fQ2Grid(NULL), fLogQ2Grid(NULL), fRes(NULL) {
499 init( iFitIn, xmlPath, infoPtr); };
504 for (
int i = 0; i < fNFL; i++) {
505 for (
int j = 0; j < fNX; j++)
506 if (fPDFGrid[i][j])
delete[] fPDFGrid[i][j];
507 if (fPDFGrid[i])
delete[] fPDFGrid[i];
511 if (fXGrid)
delete[] fXGrid;
512 if (fLogXGrid)
delete[] fLogXGrid;
513 if (fQ2Grid)
delete[] fQ2Grid;
514 if (fLogQ2Grid)
delete[] fLogQ2Grid;
515 if (fRes)
delete[] fRes;
521 static const double fXMINGRID;
524 static const int fNFL = 14;
525 static const int fM = 4;
526 static const int fN = 2;
538 void init(
int iFitIn,
string xmlPath,
Info* infoPtr);
541 void xfUpdate(
int id,
double x,
double Q2);
544 void xfxevolve(
double x,
double Q2);
547 void polint(
double xa[],
double ya[],
int n,
double x,
548 double& y,
double& dy);
549 void polin2(
double x1a[],
double x2a[],
double ya[][fN],
550 double x1,
double x2,
double& y,
double& dy);
558 #endif // Pythia8_PartonDistributions_H