Description
(Unofficial) Rust bindings for the LHAPDF C++ library, with automatic management functions. This is the successor of https://github.com/cschwan/lhapdf.
Rust feature flags
managed: this feature flag enables the automatic downloading of PDFs. See the section below on how to configure its behavior. If you would like to disable this feature, specifyno-default-features = truewhen depending onmanaged-lhapdf.static: when enabled, the LHAPDF library will be linked statically. This allows to redistribute built binaries that run on systems where LHAPDF isn't installed.
Automatic PDF management
If enabled, this crate automatically downloads the required PDF sets. The
behavior can be controlled with the configuration file managed-lhapdf.toml in
the user's data directory.
This file is automatically created if it does not exist. An example of a
customized configuration looks as follows:
# these paths are scanned for PDF sets, in the given order, and multiple paths
# can be given as strings seperated by commas. This crate will *not* write into
# any of these directories
= []
# if the following path is an empty string, nothing will be automatically
# downloaded. If the path is given, however, this crate will download PDFs sets
# and place them in here that are not found in the previous directories
= "/home/alice/.local/share/LHAPDF"
# URL for the pdfsets.index file, which is used to translate LHAIDs to PDF set
# names
= "https://lhapdfsets.web.cern.ch/current/pdfsets.index"
# URLs from which PDF sets are downloaded, in the given order. If a set is not
# found for the first URL, the second URL (and so on) will be tried
= [
"https://lhapdfsets.web.cern.ch/current/",
"https://data.nnpdf.science/pdfs/",
"https://data.nnpdf.science/pineappl/pdfs/",
]
(Un)safeness
The struct Pdf implements Send and Sync, which is only safe as long as
the corresponding member functions in LHAPDF are truly thread safe. The
following versions are known not to be thread safe:
- 6.4.x, see LHAPDF merge request #27
- 6.3.x, see LHAPDF issue #2