LHAPDF
6.5.4
|
Class for PDF-set metadata and manipulation. More...
#include <PDFSet.h>
Public Member Functions | |
PDFSet () | |
PDFSet (const std::string &setname) | |
void | print (std::ostream &os=std::cout, int verbosity=1) const |
Summary printout. | |
PDF set metadata specialisations | |
std::string | name () const |
PDF set name. More... | |
std::string | description () const |
Description of the set. | |
int | lhapdfID () const |
First LHAPDF global index in this PDF set. | |
int | dataversion () const |
Version of this PDF set's data files. | |
std::string | errorType () const |
Get the type of PDF errors in this set (replicas, symmhessian, hessian, custom, etc.) | |
PDFErrInfo | errorInfo () const |
Get the structured decomposition of the error-type string. | |
double | errorConfLevel () const |
Get the confidence level of the Hessian eigenvectors, in percent. More... | |
size_t | size () const |
Number of members in this set. | |
size_t | errorSize () const |
size_t | errSize () const |
Creating PDF members | |
PDF * | mkPDF (size_t member) const |
template<typename PTR > | |
void | mkPDFs (std::vector< PTR > &pdfs) const |
std::vector< PDF * > | mkPDFs () const |
template<typename PTR > | |
std::vector< PTR > | mkPDFs () const |
Generic metadata cascading mechanism | |
std::vector< std::string > | keys () const |
Get the keys defined on this object or higher. | |
bool | has_key (const std::string &key) const |
Can this Info object return a value for the given key? (it may be defined non-locally) | |
const std::string & | get_entry (const std::string &key) const |
Retrieve a metadata string by key name. | |
const std::string & | get_entry (const std::string &key, const std::string &fallback) const |
Retrieve a metadata string by key name, with a fallback. | |
PDF set uncertainty functions | |
See the Calculating PDF uncertainties group for more details | |
PDFUncertainty | uncertainty (const std::vector< double > &values, double cl=CL1SIGMA, bool alternative=false) const |
Calculate the central value and PDF uncertainty on an observable. More... | |
void | uncertainty (PDFUncertainty &rtn, const std::vector< double > &values, double cl=CL1SIGMA, bool alternative=false) const |
Calculate the PDF uncertainty on an observable (as above), with efficient no-copy return to the rtn argument. More... | |
std::vector< PDFUncertainty > | uncertainties (const std::vector< std::vector< double >> &observables_values, double cl=CL1SIGMA, bool alternative=false) const |
Calculate PDF uncertainties on multiple observables at once. More... | |
void | uncertainties (std::vector< PDFUncertainty > &rtn, const std::vector< std::vector< double >> &observables_values, double cl=CL1SIGMA, bool alternative=false) const |
Calculate multiple PDF uncertainties (as above), with efficient no-copy return to the rtn argument. More... | |
double | correlation (const std::vector< double > &valuesA, const std::vector< double > &valuesB) const |
Calculate the PDF correlation between valuesA and valuesB using appropriate formulae for this set. More... | |
double | randomValueFromHessian (const std::vector< double > &values, const std::vector< double > &randoms, bool symmetrise=true) const |
Generate a random value from Hessian values and Gaussian random numbers. More... | |
void | _checkPdfType (const std::vector< string > &pdftypes) const |
Public Member Functions inherited from LHAPDF::Info | |
Info () | |
Default constructor. | |
Info (const std::string &path) | |
Constructor. | |
virtual | ~Info () |
Virtual destructor to allow inheritance. | |
void | load (const std::string &filepath) |
std::vector< std::string > | keys_local () const |
Get the keys defined on this specific object. | |
std::vector< std::string > | keys () const |
bool | has_key_local (const std::string &key) const |
Is a value defined for the given key on this specific object? | |
const std::string & | get_entry_local (const std::string &key) const |
Retrieve a metadata string by key name, as defined on this specific object. | |
template<typename T > | |
T | get_entry_as (const std::string &key) const |
template<typename T > | |
T | get_entry_as (const std::string &key, const T &fallback) const |
Retrieve a metadata entry by key name, with an inline type cast and default fallback. | |
template<typename T > | |
void | set_entry (const std::string &key, const T &val) |
Set a keyed value entry. | |
template<> | |
bool | get_entry_as (const std::string &key) const |
Private Attributes | |
std::string | _setname |
Name of this set. | |
PDFErrInfo | _errinfo |
Cached PDF error-info breakdown struct. | |
Additional Inherited Members | |
Protected Attributes inherited from LHAPDF::Info | |
std::map< std::string, std::string > | _metadict |
The string -> string native metadata storage container. | |
Class for PDF-set metadata and manipulation.
|
inline |
Default constructor (for container compatibility)
LHAPDF::PDFSet::PDFSet | ( | const std::string & | setname | ) |
Constructor from a set name
void LHAPDF::PDFSet::_checkPdfType | ( | const std::vector< string > & | pdftypes | ) | const |
double LHAPDF::PDFSet::correlation | ( | const std::vector< double > & | valuesA, |
const std::vector< double > & | valuesB | ||
) | const |
Calculate the PDF correlation between valuesA
and valuesB
using appropriate formulae for this set.
The correlation can vary between -1 and +1 where values close to {-1,0,+1} mean that the two quantities A and B are {anticorrelated,uncorrelated,correlated}, respectively.
For a combined set, the parameter variations are not included in the calculation of the correlation.
See the Calculating PDF uncertainties group for more details
double LHAPDF::PDFSet::errorConfLevel | ( | ) | const |
Get the confidence level of the Hessian eigenvectors, in percent.
If not defined, assume 1-sigma = erf(1/sqrt(2)) =~ 68.268949% by default, unless this is a replica set for which return -1.
|
inline |
Number of error members in this set
|
inline |
Number of error members in this set
|
inline |
|
inline |
|
inline |
|
inline |
Make all the PDFs in this set, filling a supplied vector with PDF pointers
This version may be preferred in many circumstances, since it can avoid the overhead of creating a new temporary vector.
A vector of smart pointers can be used, for any smart pointer type which supports construction from a raw pointer argument, e.g. unique_ptr<PDF>(PDF*).
|
inline |
double LHAPDF::PDFSet::randomValueFromHessian | ( | const std::vector< double > & | values, |
const std::vector< double > & | randoms, | ||
bool | symmetrise = true |
||
) | const |
Generate a random value from Hessian values
and Gaussian random numbers.
See Section 6 of G. Watt and R.S. Thorne, JHEP 1208 (2012) 052 [arXiv:1205.4024 [hep-ph]].
Pass a vector values
containing a value for each member of the Hessian PDF set. Pass a vector randoms
containing neigen random numbers, where neigen is the number of distinct eigenvectors.
Option symmetrise
equal to true will symmetrise the random values (in the case of an asymmetric Hessian set) using a corrected Eq. (6.5) of arXiv:1205.4024v2, so that the average tends to the best-fit for a large number of replicas.
Option symmetrise
equal to false will use Eq. (6.4) of arXiv:1205.4024v2 (for an asymmetric Hessian set), then the average differs from the best-fit. Option symmetrise
has no effect for a symmetric Hessian set.
Random values generated in this way can subsequently be used for applications such as Bayesian reweighting or combining predictions from different groups (as an alternative to taking the envelope). See, for example, supplementary material at http://mstwpdf.hepforge.org/random/.
Use of this routine with a non-Hessian PDF set will throw a UserError.
For a combined set, the parameter variations are not included in the generation of the random value.
See the Calculating PDF uncertainties group for more details
|
inline |
Calculate PDF uncertainties on multiple observables at once.
The observables_values
nested vector is a list of variation-value lists, with the first (outer) index corresponding to the M observables, e.g. a set of differential-observable bins, and the inner index the N PDF members.
The return value is an M-element vector of PDFUncertainty summaray structs, one per observable.
_values
vector corresponds to the members of this PDF set and must be ordered accordingly. void LHAPDF::PDFSet::uncertainties | ( | std::vector< PDFUncertainty > & | rtn, |
const std::vector< std::vector< double >> & | observables_values, | ||
double | cl = CL1SIGMA , |
||
bool | alternative = false |
||
) | const |
|
inline |
Calculate the central value and PDF uncertainty on an observable.
values
vector corresponds to the members of this PDF set and must be ordered accordingly.In the Hessian approach, the central value is the best-fit "values[0]" and the uncertainty is given by either the symmetric or asymmetric formula using eigenvector PDF sets.
If the PDF set is given in the form of replicas, by default, the central value is given by the mean and is not necessarily "values[0]" for quantities with a non-linear dependence on PDFs, while the uncertainty is given by the standard deviation.
Optional argument cl
is used to rescale uncertainties to a particular confidence level (in percent); a negative number will rescale to the default CL for this set.
cl
is omitted, automatically rescale to normal 1-sigma ~ 68.268949% uncertainties.If the PDF set is given in the form of replicas, then optional argument alternative
equal to true (default: false) will construct a confidence interval from the probability distribution of replicas, with the central value given by the median.
For a combined set, a breakdown of the separate PDF and parameter variation uncertainties is available. The parameter variation uncertainties are computed from the last 2*n members of the set, with n the number of parameters.
See the Calculating PDF uncertainties group for more details
void LHAPDF::PDFSet::uncertainty | ( | PDFUncertainty & | rtn, |
const std::vector< double > & | values, | ||
double | cl = CL1SIGMA , |
||
bool | alternative = false |
||
) | const |
Calculate the PDF uncertainty on an observable (as above), with efficient no-copy return to the rtn
argument.
values
vector corresponds to the members of this PDF set and must be ordered accordingly.See the Calculating PDF uncertainties group for more details