7 #ifndef LHAPDF_PDFSet_H 8 #define LHAPDF_PDFSet_H 10 #include "LHAPDF/Info.h" 11 #include "LHAPDF/Factories.h" 12 #include "LHAPDF/Version.h" 13 #include "LHAPDF/Config.h" 14 #include "LHAPDF/Utils.h" 26 PDFUncertainty(
double cent=0,
double eplus=0,
double eminus=0,
double esymm=0,
double scalefactor=1,
27 double eplus_pdf=0,
double eminus_pdf=0,
double esymm_pdf=0,
double e_par=0)
28 :
central(cent), errplus(eplus), errminus(eminus), errsymm(esymm), scale(scalefactor),
29 errplus_pdf(eplus_pdf), errminus_pdf(eminus_pdf), errsymm_pdf(esymm_pdf), err_par(e_par)
32 double central, errplus, errminus, errsymm, scale;
51 PDFSet(
const std::string& setname);
68 return get_entry(
"SetDesc");
73 return get_entry_as<int>(
"SetIndex", -1);
78 return get_entry_as<int>(
"DataVersion", -1);
83 return to_lower(get_entry(
"ErrorType",
"UNKNOWN"));
90 double errorConfLevel()
const;
97 return get_entry_as<unsigned int>(
"NumMembers");
104 void print(std::ostream& os=std::cout,
int verbosity=1)
const;
142 template <
typename PTR>
143 void mkPDFs(std::vector<PTR>& pdfs)
const {
146 std::cout <<
"LHAPDF " <<
version() <<
" loading all " << size() <<
" PDFs in set " << name() << std::endl;
147 this->print(std::cout, v);
148 if (this->
has_key(
"Note")) std::cout << get_entry(
"Note") << std::endl;
151 pdfs.reserve(size());
153 for (
size_t i = 0; i < size(); ++i) {
155 pdfs.push_back( PTR(
mkPDF(i)) );
166 std::vector<PDF*> rtn;
173 template <
typename PTR>
175 std::vector<PTR> rtn;
195 const std::string&
get_entry(
const std::string& key)
const {
196 if (has_key_local(key))
return get_entry_local(key);
201 const std::string&
get_entry(
const std::string& key,
const std::string& fallback)
const {
237 double cl=100*erf(1/sqrt(2)),
bool alternative=
false)
const;
242 const std::vector<double>& values,
243 double cl=100*erf(1/sqrt(2)),
bool alternative=
false)
const {
244 rtn = uncertainty(values, cl, alternative);
253 double correlation(
const std::vector<double>& valuesA,
const std::vector<double>& valuesB)
const;
277 double randomValueFromHessian(
const std::vector<double>& values,
const std::vector<double>& randoms,
bool symmetrise=
true)
const;
284 void _checkPdfType(
const std::vector<string>& pdftypes)
const;
double errplus_pdf
Add extra variables for separate PDF and parameter variation errors with combined sets...
Definition: PDFSet.h:34
std::string version()
Get the LHAPDF library version code (as a string)
Definition: Version.h:33
std::string description() const
Description of the set.
Definition: PDFSet.h:67
PDF is the general interface for access to parton density information.
Definition: PDF.h:26
double central
Variables for the central value, +ve, -ve & symmetrised errors, and a CL scalefactor.
Definition: PDFSet.h:32
const std::string & get_entry(const std::string &key, const std::string &fallback) const
Retrieve a metadata string by key name, with a fallback.
Definition: PDFSet.h:201
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) ...
Definition: PDFSet.h:190
std::string _setname
Name of this set.
Definition: PDFSet.h:292
PDFUncertainty(double cent=0, double eplus=0, double eminus=0, double esymm=0, double scalefactor=1, double eplus_pdf=0, double eminus_pdf=0, double esymm_pdf=0, double e_par=0)
Constructor.
Definition: PDFSet.h:26
PDF * mkPDF(const std::string &setname, int member)
void uncertainty(PDFUncertainty &rtn, const std::vector< double > &values, double cl=100 *erf(1/sqrt(2)), bool alternative=false) const
Definition: PDFSet.h:241
virtual bool has_key(const std::string &key) const
Definition: Info.h:89
PDF * mkPDF(int member) const
Definition: PDFSet.h:115
virtual const std::string & get_entry(const std::string &key) const
Definition: Info.h:108
int dataversion() const
Version of this PDF set's data files.
Definition: PDFSet.h:77
PDFSet()
Definition: PDFSet.h:47
void mkPDFs(const std::string &setname, std::vector< PDF *> &pdfs)
Get all PDFs in a named set (return by filling the supplied vector).
std::string to_lower(const std::string &s)
Convert a string to lower-case (not in-place)
Definition: Utils.h:137
const std::string & get_entry(const std::string &key) const
Retrieve a metadata string by key name.
Definition: PDFSet.h:195
Class for PDF set metadata and manipulation.
Definition: PDFSet.h:39
int verbosity()
Definition: Config.h:65
Namespace for all LHAPDF functions and classes.
Definition: AlphaS.h:14
std::string errorType() const
Get the type of PDF errors in this set (replicas, symmhessian, hessian, custom, etc.)
Definition: PDFSet.h:82
void setVerbosity(int v)
Definition: Config.h:72
bool has_key(const std::map< K, T > &container, const K &key)
Does the map<K,T> container have a key K key?
Definition: Utils.h:259
size_t size() const
Number of members in this set.
Definition: PDFSet.h:96
Metadata base class for PDFs, PDF sets, or global configuration.
Definition: Info.h:30
std::vector< PTR > mkPDFs() const
Definition: PDFSet.h:174
Structure for storage of uncertainty info calculated over a PDF error set.
Definition: PDFSet.h:24
int lhapdfID() const
First LHAPDF global index in this PDF set.
Definition: PDFSet.h:72
std::vector< PDF * > mkPDFs() const
Definition: PDFSet.h:165
void mkPDFs(std::vector< PTR > &pdfs) const
Definition: PDFSet.h:143
std::string name() const
PDF set name.
Definition: PDFSet.h:62