Parton Distributions
 
  - The PDF base class
- Symmetries and special cases
- Derived classes
The parton distributions file contains thePDF class. 
PDF is the base class, from which specific PDF 
classes are derived. 
 
 
The choice of which PDF to use is made by settings in the 
Pythia class, see here. 
These settings also allow to access all the proton PDF's available in the 
LHAPDF library [Wha05,Buc15]. Thus there is no need for a normal 
user to study the PDF class. The structure must only be 
understood when interfacing new PDF's, e.g. ones not yet found in LHAPDF. 
 
 
The PDF base class
 
 
PDF defines the interface that all PDF classes should respect. 
The constructor requires the incoming beam species to be given: 
even if used for a proton PDF, one needs to know whether the beam 
is actually an antiproton. This is one of the reasons why Pythia 
always defines two PDF objects in an event, one for each beam. 
 
PDFs should be defined by overriding the PDF base class, then 
overriding the following protected method: 
 
 virtual void PDF::xfUpdate(int id, double x, double Q2)   
Calculates the PDF distributions for the specified parton id at 
(x, Q^2) and stores the resulting values in the corresponding 
fields. If id == 9, the values should be calculated for all 
relevant partons. The user may choose to always calculate the value for 
all partons, in which case they should set idSav = 9. 
 
The PDF class flexibly handles antiparticle and isospin 
symmetries, so xfUpdate should always give the values that 
correspond to the particle with positive id and isospin. 
Further details and special cases are discussed below, and users should 
read those carefully before implementing their own PDFs. 
   
 
 
PDFs can be obtained from PYTHIA through the 
Pythia::getPDFPtr method. The PDF class offers 
a number of public methods. 
 
 double PDF::xf(int id, double x, double Q2)   
Returns x * f_id(x, Q2) for the hadron represented by the 
PDF object. The actual value is calculated by a call 
to xfUpdate, which must be overridden by classes inheriting 
from PDF. The result is cached, and subsequent calls 
with the same id, x and Q2 arguments 
will return the cached value instead of recalculating them. 
   
 
 double PDF::xfVal(int id, double x, double Q2)   
   
 double PDF::xfSea(int id, double x, double Q2)   
Returns the valence or sea part of the specified distribution. These methods 
also use caching, as described above, and will call xfUpdate 
to calculate the distributions if necessary. 
   
 
 virtual void setExtrapolate(bool extrapolate)   
Subclasses of PDF may override this method to switch 
between freezing parametrizations at the low-x boundary 
(false) or extrapolate them outside the boundary 
(true). This method works both for LHAPDF 5, LHAPDF6 and 
modern internal PDFs. (For some older PDFs the behaviour implemented by 
the original authors is maintained.) In either case the PDFs are frozen 
at Q_min and Q_max. (And also at x_max, but 
this is irrelevant when x_max = 1.) 
   
 
 virtual bool insideBounds(double x, double Q2)   
Subclasses of PDF may override this method to give the user 
information about whether the specified (x, Q^2) pair falls inside 
the fit region or not. Currently only implemented for LHAPDF6. 
   
 
 double alphaS(double Q2)   
   
 double mQuarkPDF(int id)   
Subclasses of PDF may override these methods to respectively 
give the alpha_s of the PDF at the specified Q^2 scale, 
and the quark mass used to set the flavour threshold for the specified 
quark id. Currently only implemented for LHAPDF6. 
   
 
 
Symmetries and special cases
 
The PDF class is designed to handle particles through 
charge conjugation and isospin symmetries when available. For this reason, 
xfUpdate should always behave the same way, independent of 
which beam variant is specified for the PDF. Specifically, the particle should 
always be assumed to have a positive id, and if there are isospin variants, 
it should be assumed it is the particle with the largest available isospin 
(the only exceptions are Delta^+^+ and Delta^-, which are 
treated as variants of the proton). For instance, that means that if the beam 
is n, then xfUpdate should return values as though 
it was p. 
Particles where u and d are symmetric (at least 
at LO), such as Sigma^0 and Lambda^0, use the average 
of the u and d contents. The pi^0 also uses 
the average of pi^+/pi^-, with additional complications due to 
its ambiguous valence content, as described in the next paragraph. Finally, 
K^0_S/K^0_L should be treated as K^+ by 
xfUpdate. 
 
 
Some mesons have ambiguous valence content. These are eta/eta', 
K^0_S/K^0_L, the pomeron, and all unflavoured diagonal mesons such 
as pi^0, rho^0, omega, f_0(980), etc. 
In these cases, the PDF class keeps track of the current 
valence content, and gives the corresponding PDF values. The valence content 
is randomly chosen for each generated event. When the PDF is 
created, the default choice is defined as the content that is implied by 
the particle id, i.e. d dbar for pi^0 or rho^0, 
u ubar for eta or omega, and s sbar for 
eta'. 
 
 
For diagonal mesons (except pi^0), the q and 
qbar contents are always the same. In some contexts, it is 
still physically meaningful to separate the content into valence 
and sea, but the valence content can no longer be defined as 
v(x) = q(x) - qbar(x), since qbar does not 
correspond to sea content in this scenario. To circumvent this, the 
antiquark content will instead be used to store the sea content, and the 
PDF class will take this into account when determining which 
value to return. This is implemented in the SU21 data files, e.g. 
the -4 column in SU21Jpsi.dat gives the value of 
the c/cbar sea. This is also true for eta/eta', which 
use this scheme for d/dbar, u/ubar and s/sbar. 
 
 
Derived classes
 
 
There is only one pure virtual method, xfUpdate, that 
therefore must be implemented in any derived class. A reasonable 
number of such classes come with the program: 
 
 
For any particle, including all modern proton sets and the SU21 
family covering almost all hadrons: 
 
- LHAGrid1can read and use files in the LHAPDF6 lhagrid1 
format, assuming that the same x grid is used for all Q 
subgrids. Results are not exactly identical with LHAPDF6, owing to a 
different interpolation.
For protons: 
- LHAPDFprovides a plugin interface class to the 
LHAPDF library[Wha05,Buc15]. It loads either the- LHAPDF5or- LHAPDF6class.
- GRV94Lgives the GRV 94 L parametrization 
[Glu95].
- CTEQ5Lgives the CTEQ 5 L parametrization 
[Lai00].
- MSTWpdfgives the four distributions of the 
MRST/MSTW group that have been implemented.
- CTEQ6pdfgives the six distributions of the 
CTEQ/CT group that have been implemented.
- NNPDFgives four distributions from the NNPDF 2.3 
QCD+QED sets that have been implemented.
- nPDF, Isospin, EPS09three classes allowing to introduce 
nuclear modifications to a specified proton PDF. The first is base class 
for the other two, where- Isospinonly provides the 
appropriate mix of protons and isospin-conjugate neutrons, while- EPS09also contains nuclear modification factors 
[Esk09].
The current default is NNPDF 2.3. 
 
 
For charged pions: 
- GRVpiLgives the GRV 1992 pi+ parametrization.
For Pomerons (used to describe diffraction): 
- PomFixgives a simple but flexible 
Q2-independent parametrization.
- PomH1FitABgives the H1 2006 Fit A and Fit B 
parametrizations.
- PomH1Jetsgives the H1 2007 Jets parametrization.
For photons: 
- CJKLgives the CJKL parametrization [Cor03].
- GammaPointgives the trivial distribution of a 
pointlike (i.e. unresolved) photon.
For charged leptons (e, mu, tau) and the proton: 
- Leptongives a QED parametrization [Kle89]. 
In QED there are not so many ambiguities, so here one set should be 
enough. On the other hand, there is the problem that the 
lepton-inside-lepton pdf is integrably divergent for x → 1, 
which gives numerical problems. Like in PYTHIA 6, the pdf is therefore 
made to vanish for x > 1 - 10^{-10}, and scaled up in the range 
1 - 10^{-7} < x < 1 - 10^{-10} in such a way that the 
total area under the pdf is preserved.
- LeptonPointgives the trivial distribution of a 
pointlike (i.e. unresolved) charged lepton.
- EPAexternalprovides an external photon flux to study 
photoproduction with different fluxes. Still optimized for lepton beams, 
but also other fluxes can be studied.
- Lepton2gammagives the convolution between photon 
flux from leptons and photon PDFs.
- ProtonPointgives the equivalent photon spectrum 
of an unresolved proton.
For neutrinos: 
- NeutrinoPointis the only method, so there is no choice. 
Analogously to- LeptonPointit gives the distribution of a 
pointlike (i.e. unresolved) neutrino. The fact that neutrinos are always 
lefthanded, so that there is no need to average for spin states of incoming 
fermions, is accounted in the relevant cross sections and also- NeutrinoPointPDFs are normalized to 1.
There is another method,isSetup(), that returns the 
base-class boolean variable isSet. This variable is 
initially true, but could be set false if the 
setup procedure of a PDF failed, e.g. if the user has chosen an unknown 
PDF set. 
 
 
The MRST/MSTW, CTEQ/CT, NNPDF and H1 PDF routines are based on the 
interpolation in (x, Q) grids. The grid files are stored in the 
xmldoc subdirectory, like settings and particle data. 
Only PDF sets that will be used are read in during the initialization 
stage. Just as input streams can be used to initialize the settings 
and particle data, so can the individual PDFs be constructed.   See 
the header files for explicit constructor descriptions.