lhapdf
is hosted by
Hepforge
,
IPPP Durham
LHAPDF
6.5.4
Loading...
Searching...
No Matches
/examples/pythonexample.py
1
#! /usr/bin/env python
2
3
4
5
import
lhapdf
6
7
8
p = lhapdf.mkPDF(
"CT10nlo"
, 0)
9
p = lhapdf.mkPDF(
"CT10nlo/0"
)
10
11
12
print(p.xfxQ2(21, 1e-3, 1e4))
13
14
15
for
pid
in
p.flavors():
16
print(p.xfxQ(pid, 0.01, 91.2))
17
18
# TODO: demonstrate looping over PDF set members
19
pset = lhapdf.getPDFSet(
"CT10nlo"
)
20
print(pset.description)
21
pcentral = pset.mkPDF(0)
22
pdfs1 = pset.mkPDFs()
23
pdfs2 = lhapdf.mkPDFs(
"CT10nlo"
)
# a direct way to get all the set's PDFs
24
25
26
import
numpy
as
np
27
xs = [x
for
x
in
np.logspace(-7, 0, 5)]
28
qs = [q
for
q
in
np.logspace(1, 4, 4)]
29
gluon_xfs = np.empty([len(xs), len(qs)])
30
for
ix, x
in
enumerate(xs):
31
for
iq, q
in
enumerate(qs):
32
gluon_xfs[ix,iq] = p.xfxQ(21, x, q)
33
print(gluon_xfs)
34
35
36
print(lhapdf.version())
37
print(lhapdf.__version__)
38
lhapdf.pathsPrepend(
"/path/to/extra/pdfsets"
)
39
print(lhapdf.paths())
40
# ...
Generated on Thu Sep 26 2024 15:19:26 for LHAPDF by
1.12.0