Skip to content

Commit 0ba7cfb

Browse files
Merge pull request #65 from Radonirinaunimi/tmdlib-interface
Interface `TMDlib` to `NeoPDF`
2 parents 49e7ea5 + 7263cc0 commit 0ba7cfb

File tree

23 files changed

+1142
-31
lines changed

23 files changed

+1142
-31
lines changed

.github/workflows/run-rust.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ jobs:
3636
RUSTFLAGS: '-Cinstrument-coverage -Clink-dead-code'
3737
run: |
3838
export NEOPDF_DATA_PATH=${PWD}/neopdf-data
39-
cargo test --workspace --exclude neopdf_pyapi --no-fail-fast 2> >(tee stderr 1>&2)
39+
cargo test --workspace --exclude neopdf_pyapi --exclude neopdf_tmdlib --no-fail-fast 2> >(tee stderr 1>&2)
4040
sed -i 's/\x1B\[[0-9;]\{1,\}[A-Za-z]//g' stderr
4141
4242
- name: Generate code coverage

Cargo.lock

Lines changed: 173 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
[workspace]
2-
members = ["neopdf", "neopdf_capi", "neopdf_cli", "neopdf_pyapi"]
2+
members = ["neopdf", "neopdf_capi", "neopdf_cli", "neopdf_pyapi", "neopdf_tmdlib"]
3+
default-members = ["neopdf", "neopdf_capi", "neopdf_cli", "neopdf_pyapi"]
34
resolver = "2"
45

56
[workspace.package]

docs/cli-tutorials.md

Lines changed: 44 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ neopdf read num_subgrids --pdf-name NNPDF40_nnlo_as_01180
6464
To get the knot values for a given subgrid:
6565

6666
```bash
67-
neopdf read subgrid_info --pdf-name NNPDF40_nnlo_as_01180 --member 0 --subgrid-index 1
67+
neopdf read subgrid-info --pdf-name NNPDF40_nnlo_as_01180 --member 0 --subgrid-index 1
6868
```
6969

7070
- `--pdf-name`: Name of the PDF set.
@@ -74,13 +74,18 @@ neopdf read subgrid_info --pdf-name NNPDF40_nnlo_as_01180 --member 0 --subgrid-i
7474
The above command will print out the following output:
7575

7676
```yaml
77-
Nucleon Numbers A: [1.0], shape=[1], strides=[1], layout=CFcf (0xf), const ndim=1
78-
Alphas values: [0.118], shape=[1], strides=[1], layout=CFcf (0xf), const ndim=1
77+
Nucleon Numbers A: [0.0], shape=[1], strides=[1], layout=CFcf (0xf), const ndim=1
78+
Alphas values: [0.0], shape=[1], strides=[1], layout=CFcf (0xf), const ndim=1
7979
kT values: [0.0], shape=[1], strides=[1], layout=CFcf (0xf), const ndim=1
8080
x values: [1e-9, 1.2970848e-9, ...], shape=[196], strides=[1], layout=CFcf (0xf), const ndim=1
8181
Q2 values: [2.7224999999999997, ...], shape=[12], strides=[1], layout=CFcf (0xf), const ndim=1
8282
```
8383
84+
!!! note
85+
86+
Note that the values of `A` and `alphas` are set to zero by default as there is no
87+
proper way to extract their values from LHAPDF.
88+
8489
### Updating Grid Metadata
8590

8691
The metadata of a given `NeoPDF` grid can be updated by running the following command:
@@ -242,3 +247,39 @@ neopdf compute xfx_q2 --pdf-name NNPDF40_nnlo.neopdf.lz4 --member 0 --pid 21 0.1
242247
```
243248

244249
This approach is not fullproof and some PDF sets might not be supported at all.
250+
251+
---
252+
253+
## Inspecting subgrid contents
254+
255+
The contents of the subgrids can be printed into human-readable format. Given that a set might contain
256+
multiple subgrids (as we have seen before using the `subgrid-info` command), it is instructive to check
257+
first how many subgrids a given set member contains.
258+
259+
```bash
260+
> neopdf read num_subgrids --pdf-name NNPDF40_nnlo_as_01180.neopdf.lz4
261+
262+
2
263+
```
264+
265+
We can look at the contents of the first subgrid for the **gluon** PDF:
266+
267+
```bash
268+
> neopdf read subgrid --pdf-name NNPDF40_nnlo_as_01180.neopdf.lz4 --member 0 --subgrid-index 0 --pid 21
269+
270+
[x | Q2] 2.72250e0 3.19494e0 3.77488e0 4.49175e0 5.38430e0 6.50400e0 7.91974e0
271+
1.00000e-9 1.48441e-1 -1.47266e0 -3.42816e0 -5.57841e0 -7.73893e0 -9.65268e0 -1.10375e1
272+
1.29708e-9 1.53954e-1 -1.36579e0 -3.16487e0 -5.10066e0 -6.98714e0 -8.57386e0 -9.57904e0
273+
1.68243e-9 1.59670e-1 -1.26122e0 -2.90961e0 -4.64076e0 -6.26809e0 -7.54804e0 -8.20073e0
274+
2.18225e-9 1.65601e-1 -1.15891e0 -2.66220e0 -4.19823e0 -5.58080e0 -6.57342e0 -6.89951e0
275+
2.83057e-9 1.71754e-1 -1.05882e0 -2.42248e0 -3.77263e0 -4.92430e0 -5.64825e0 -5.67242e0
276+
3.67149e-9 1.78142e-1 -9.60911e-1 -2.19028e0 -3.36352e0 -4.29764e0 -4.77083e0 -4.51658e0
277+
...
278+
[x | Q2] 9.72449e0 1.20449e1 1.50550e1 1.89961e1 2.42064e1
279+
1.00000e-9 -1.15252e1 -1.06011e1 -7.88260e0 -2.66303e0 5.44604e0
280+
1.29708e-9 -9.64489e0 -8.29955e0 -5.12278e0 5.21491e-1 8.89615e0
281+
1.68243e-9 -7.87939e0 -6.15103e0 -2.56742e0 3.44402e0 1.20386e1
282+
2.18225e-9 -6.22381e0 -4.14868e0 -2.06304e-1 6.11881e0 1.48905e1
283+
2.83057e-9 -4.67345e0 -2.28589e0 1.97036e0 8.55949e0 1.74680e1
284+
...
285+
```

docs/custom.css

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,3 +99,10 @@ div.highlight pre,
9999
pre {
100100
font-size: 1.06em !important;
101101
}
102+
103+
.center-medium {
104+
display: block;
105+
margin: 0 auto;
106+
width: 75%;
107+
height: auto;
108+
}

0 commit comments

Comments
 (0)