lhapdf is hosted by Hepforge, IPPP Durham
LHAPDF 6.5.3
Loading...
Searching...
No Matches
LHAPDF::PDFInfo Class Reference

Metadata class for PDF members. More...

#include <PDFInfo.h>

Inheritance diagram for LHAPDF::PDFInfo:
LHAPDF::Info

Public Member Functions

 PDFInfo ()
 
 PDFInfo (const std::string &mempath)
 
 PDFInfo (const std::string &setname, int member)
 Constructor from a set name and member ID.
 
 PDFInfo (int lhaid)
 Constructor from an LHAPDF ID code.
 
Metadata accessors
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) More...
 
const std::string & get_entry (const std::string &key) const
 Retrieve a metadata string by key name. More...
 
const std::string & get_entry (const std::string &key, const std::string &fallback) const
 Retrieve a metadata string by key name, with a fallback. More...
 
- 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)
 
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 >
get_entry_as (const std::string &key) const
 
template<typename 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 the set in which this PDF is contained (for PDFSet lookup)
 
int _member
 

Additional Inherited Members

- Protected Attributes inherited from LHAPDF::Info
std::map< std::string, std::string > _metadict
 The string -> string native metadata storage container.
 

Detailed Description

Metadata class for PDF members.

Examples
/tests/testinfo.cc.

Constructor & Destructor Documentation

◆ PDFInfo() [1/2]

LHAPDF::PDFInfo::PDFInfo ( )
inline

Default constructor (for container compatibility)

Note
Don't use explicitly!
Todo:
Remove?

◆ PDFInfo() [2/2]

LHAPDF::PDFInfo::PDFInfo ( const std::string &  mempath)

Constructor from a PDF member's data path.

Todo:
Bypasses standard path searching hence used by the path-based GridPDF constructor, for example.

Member Function Documentation

◆ get_entry() [1/2]

const std::string & LHAPDF::PDFInfo::get_entry ( const std::string &  key) const
virtual

Retrieve a metadata string by key name.

Reimplemented from LHAPDF::Info.

Examples
/tests/testgrid.cc, and /tests/testinfo.cc.

◆ get_entry() [2/2]

const std::string & LHAPDF::PDFInfo::get_entry ( const std::string &  key,
const std::string &  fallback 
) const
inlinevirtual

Retrieve a metadata string by key name, with a fallback.

Reimplemented from LHAPDF::Info.

◆ has_key()

bool LHAPDF::PDFInfo::has_key ( const std::string &  key) const
virtual

Can this Info object return a value for the given key? (it may be defined non-locally)

Reimplemented from LHAPDF::Info.

Examples
/tests/testgrid.cc, and /tests/testinfo.cc.

Member Data Documentation

◆ _member

int LHAPDF::PDFInfo::_member
private

Member ID in PDF set

Note
Not currently used, but could be useful if a memberID method is exposed.

The documentation for this class was generated from the following file: