pdg.data module

Container base classes for PDG data.

All PDG data classes use lazy (i.e. only when needed) loading of data from the database as implemented in the PdgData base class. In most cases, the data is read only once and cached for subsequent use.

PdgProperty is a subclass of PdgData and adds the retrieval of summary values, measurement data, etc., that is shared by all classes supporting the retrieval of different kinds of particle physics properties such as branching fractions or particle masses.

class pdg.data.PdgConvertedValue(value, to_units)[source]

Bases: PdgSummaryValue

A PdgSummaryValue class for storing summary values after unit conversion.

class pdg.data.PdgData(api, pdgid, edition=None)[source]

Bases: object

Base class for PDG data containers.

This class implements the lazy data retrieval from the database and is the base class for all PDG data container classes.

property data_flags

Flags augmenting data type information.

property data_type

Type of data.

property description

Description of data.

property edition

Year of edition for which data is requested.

get_children(recurse=False)[source]
get_parent_pdgid(include_edition=True)[source]

Return PDG Identifiers of parent quantity.

get_particle()[source]

Returns PdgParticle for this property’s particle. Raises PdgAmbiguousValueError when there are multiple matches.

get_particles()[source]

Return PdgParticleList for this property’s particle.

class pdg.data.PdgLifetime(api, pdgid, edition=None)[source]

Bases: PdgProperty

class pdg.data.PdgMass(api, pdgid, edition=None)[source]

Bases: PdgProperty

class pdg.data.PdgProperty(api, pdgid, edition=None)[source]

Bases: PdgData

Base class for containers for data containers for particle properties.

best_summary(summary_table_only=False)[source]

Return the PDG “best” summary value for this quantity.

If there is either a single summary value in Particle Listings and Summary Tables, or there are multiple summary values but only one is included in the Summary Tables, then this value is returned as the PDG best value.

If there are multiple summary values (e.g. based on assuming or not assuming CPT in the evaluation) and PdgApi.pedantic is False, the first value shown in Summary Tables or Particle Listings will be returned. If PdgApi.pedantic is True, a PdgAmbiguousValue Exception will be raised.

If there are no summary values, None is returned.

If summary_table_only is True, then the best value must be included in the Summary Table and cannot be shown only in the Particle Listings.

property comment

Shortcut for best_summary().comment.

property confidence_level

Shortcut for best_summary().confidence_level.

property display_value_text

Shortcut for best_summary().display_value_text.

property error

Shortcut for best_summary().error.

property error_negative

Shortcut for best_summary().error.

property error_positive

Shortcut for best_summary().error.

has_best_summary(summary_table_only=False)[source]

Return True if there is a single PDG “best” value (see best_value() for definition).

property is_limit

Shortcut for best_summary().is_limit.

n_summary_table_values()[source]

Return number of summary values in Summary Table for this quantity.

property scale_factor

Shortcut for best_summary().scale_factor.

summary_values(summary_table_only=False)[source]

Return list of summary values for this quantity.

By default, all summary values are included, even if they are only shown in the Particle Listings and not listed in the Summary Tables. Set summary_table_only to True to get only summary values listed in the Summary Tables.

property units

Shortcut for best_summary().units.

property value

Shortcut for best_summary().value.

class pdg.data.PdgSummaryValue[source]

Bases: dict

Container for a single value from the Summary Tables.

property comment

Details for or comments on this value.

property confidence_level

Confidence level for limits, None otherwise.

property description

Description of quantity for which value is given

property display_in_percent

True if value is rendered in percent for display in Summary Tables.

property display_power_of_ten

Unit multiplier (as power of ten) as used for display in Summary Tables.

property display_value_text

Value and uncertainty in plain text format in units given by property units.

property error

Symmetric error or None.

Returns symmetric error as average of positive and negative errors if they differ by less than 10% of their average. Otherwise, returns None. Also returns None if the quantity is a limit.

property error_negative

Numerical value of negative error in units given by property units.

property error_positive

Numerical value of positive error in units given by property units.

get_error(units=None)[source]

Symmetric error or None, in units specified by parameter units (string).

Returns symmetric error as average of positive and negative errors if they differ by less than 10% of their average. Otherwise, returns None. Also returns None if the quantity is a limit.

get_error_negative(units=None)[source]

Return negative error after conversion into units specified by parameter units (string).

If units are not specified, the negative error is returned without conversion in the default units for this quantity.

get_error_positive(units=None)[source]

Return positive error after conversion into units specified by parameter units (string).

If units are not specified, the positive error is returned without conversion in the default units for this quantity.

get_value(units=None)[source]

Return value after conversion into units specified by parameter units (string).

If units are not specified, the value is returned without conversion in the default units for this quantity. Check properties is_limit, is_lower_limit and is_upper_limit to determine if value is a central value or limit.

property in_summary_table

True if value is included in Summary Table.

property is_limit

True if value is a limit.

property is_lower_limit

True if value is an upper limit.

property is_upper_limit

True if value is an upper limit.

property pdgid

PDG Identifier of quantity for which value is given.

pprint()[source]

Print all data in this PdgSummaryValue object in a nice format (for debugging).

property scale_factor

PDG error scale factor that was applied to error_positive and error_negative.

property units

Units (as a string) used by value, error_positive, error_negative, and display_value_text.

property value

Numerical value in units given by property units.

Check properties is_limit, is_lower_limit and is_upper_limit to determine if value is a central value or limit.

property value_type

Type of value, given as the PDG indicator string.

property value_type_key

Type of value, given by its key.

See PdgApi.doc_value_type_keys() for the meaning of the different value type keys.

class pdg.data.PdgWidth(api, pdgid, edition=None)[source]

Bases: PdgProperty