ParticleSelector
symbolica.community.hepkit Class
ParticleSelector()A model-independent way to identify an external particle.
Selectors may use a UFO particle name or a signed PDG code, making process definitions convenient while deferring validation to a concrete model.
Examples
from symbolica.community import hepkit as hep
electron = hep.ParticleSelector.by_pdg(11)
positron = hep.ParticleSelector.by_name("e+")Member details
name
Property · read-only#name: strReturn the selected particle name.
Raises TypeError for a PDG selector. Use is_name to distinguish the selector variants before accessing their payloads.
Examples
Using the setup in the ParticleSelector class example:
assert hep.ParticleSelector.by_name("e-").name == "e-"pdg
Property · read-only#pdg: intReturn the selected PDG code.
Raises TypeError for a name selector. Use is_pdg to distinguish the selector variants before accessing their payloads.
Examples
Using the setup in the ParticleSelector class example:
assert hep.ParticleSelector.by_pdg(11).pdg == 11is_name
Property · read-only#is_name: boolReport whether this selector identifies a particle by name.
Examples
Using the setup in the ParticleSelector class example:
assert hep.ParticleSelector.by_name("e-").is_nameis_pdg
Property · read-only#is_pdg: boolReport whether this selector identifies a particle by PDG code.
Examples
Using the setup in the ParticleSelector class example:
assert hep.ParticleSelector.by_pdg(11).is_pdgby_name
Static method#by_name(name: str) -> ParticleSelectorSelect a particle by its model name.
Examples
Using the setup in the ParticleSelector class example:
hep.ParticleSelector.by_name("e-").nameParameters
| Name | Type | Default | Description |
|---|---|---|---|
name | str | — | Particle name as it appears in the model. |
by_pdg
Static method#by_pdg(pdg: int) -> ParticleSelectorSelect a particle by its signed PDG code.
Examples
Using the setup in the ParticleSelector class example:
hep.ParticleSelector.by_pdg(11).pdgParameters
| Name | Type | Default | Description |
|---|---|---|---|
pdg | int | — | Signed PDG code of the particle. |
__str__
Method#__str__() -> strFormat the selector as its particle name or signed PDG code.
Examples
Using the setup in the ParticleSelector class example:
str(hep.ParticleSelector.by_pdg(11))__repr__
Method#__repr__() -> strReturn a constructor-style representation of the selector.
Examples
Using the setup in the ParticleSelector class example:
print(hep.ParticleSelector.by_pdg(11)) # electron selector in a process__eq__
Method#__eq__(other: Any) -> boolCompare with another selector, a particle name, or a PDG code.
Examples
Using the setup in the ParticleSelector class example:
hep.ParticleSelector.by_pdg(11) == 11Parameters
| Name | Type | Default | Description |
|---|---|---|---|
other | Any | — | Selector, particle-name string, or integer PDG code to compare with. |
View generated signature source: docs/api/python/feynkit-community.pyi:9365