Utilities — decaylanguage.utils#

decaylanguage.utils.particleutils.charge_conjugate_name(name, pdg_name=False)[source]#

Return the charge-conjugate particle name matching the given name. If no matching is found, return “ChargeConj(pname)”.

Note

Search/match in order:

  1. Trivial case - does the name correspond to a self-conjugate particle? Only works for particles in the DB.

  2. Try to match the antiparticle looking for the opposite PDG ID in the list of PDG IDs - EvtGen names. This can deal with specific particles or badly-known particles not in the DB but not so rare in decay files.

Parameters:
  • name (str) – Input particle name.

  • pdg_name (str, optional, default=False) – Input particle name is the PDG name, not the (default) EvtGen name.

Returns:

out (str) – Either the EvtGen or PDG charge-conjugate particle name depending on the value of parameter pdg_name.

Parameters:
Return type:

str

decaylanguage.utils.particleutils.particle_from_string_name(name)[source]#

Get a particle from an AmpGen style name.

Note: the best match is returned.

Parameters:

name (str)

Return type:

Particle

decaylanguage.utils.particleutils.particle_list_from_string_name(name)[source]#

Get a list of particles from an AmpGen style name.

Parameters:

name (str)

Return type:

list[Particle]

exception decaylanguage.utils.errors.LineFailure(line, message)[source]#
Parameters:
Return type:

None