Belle II Software  release-08-01-10
Belle2::EvtPDLUtil Namespace Reference

Utilities for converting PDG codes into particle names. More...

Functions

bool hasAntiParticle (int pdgCode)
 Checks if the particle with given pdg code has an anti-particle or not. More...
 
std::string particleName (int pdgCode)
 Returns the name of a particle with given pdg code.
 
std::string antiParticleName (int pdgCode)
 Returns the name of the anti-particle of a particle with given pdg code. More...
 
std::string antiParticleListName (int pdgCode, const std::string &label)
 Returns the name of the anti-particle ParticleList for particles with given pdg code and with given label. More...
 
std::string particleListName (int pdgCode, const std::string &label)
 Returns the name of the particle ParticleList for particles with given pdg code and with given label.
 
double charge (int pdgCode)
 Returns electric charge of a particle with given pdg code.
 

Detailed Description

Utilities for converting PDG codes into particle names.

Uses the TDatabasePDG class, which is filled from evt.pdl by basf2.

Function Documentation

◆ antiParticleListName()

std::string antiParticleListName ( int  pdgCode,
const std::string &  label 
)

Returns the name of the anti-particle ParticleList for particles with given pdg code and with given label.

If the anti-particle does not exist the particle's name is returned instead

Definition at line 30 of file EvtPDLUtil.cc.

31 {
32  if (label.empty())
33  return antiParticleName(pdgCode);
34  return antiParticleName(pdgCode) + ":" + label;
35 }
std::string antiParticleName(int pdgCode)
Returns the name of the anti-particle of a particle with given pdg code.
Definition: EvtPDLUtil.cc:25

◆ antiParticleName()

std::string antiParticleName ( int  pdgCode)

Returns the name of the anti-particle of a particle with given pdg code.

If the anti-particle does not exist the particle's name is returned instead.

Definition at line 25 of file EvtPDLUtil.cc.

◆ hasAntiParticle()

bool hasAntiParticle ( int  pdgCode)

Checks if the particle with given pdg code has an anti-particle or not.

Parameters
pdgCodeof the particle
Returns
true/false if anti-particle does/does not exist

Definition at line 12 of file EvtPDLUtil.cc.