gambit is hosted by Hepforge, IPPP Durham
GAMBIT  v1.5.0-2191-ga4742ac
a Global And Modular Bsm Inference Tool
Gambit::Models::partmap Class Reference

#include <partmap.hpp>

Collaboration diagram for Gambit::Models::partmap:

Public Member Functions

 partmap ()
 Constructor. More...
 
void add (str, std::pair< int, int >, int, int, int)
 Add a new particle to the database. More...
 
void add_SM (str, std::pair< int, int >, int, int, int)
 Add a new Standard Model particle to the database. More...
 
void add_generic (str, std::pair< int, int >, int, int, int)
 Add a new generic particle class to the database. More...
 
void add_with_short_pair (str, std::pair< int, int >, std::pair< str, int >, int, int, int)
 Add a new particle to the database with a short name and an index. More...
 
void add_SM_with_short_pair (str, std::pair< int, int >, std::pair< str, int >, int, int, int)
 Add a new Standard Model particle to the database with a short name and an index. More...
 
std::pair< int, intpdg_pair (str) const
 Retrieve the PDG code and context integer, from the long name. More...
 
std::pair< int, intpdg_pair (str, int) const
 Retrieve the PDG code and context integer, from the short name and index. More...
 
std::pair< int, intpdg_pair (std::pair< str, int >) const
 Retrieve the PDG code and context integer, from the short name and index pair. More...
 
str long_name (str, int) const
 Retrieve the long name, from the short name and index. More...
 
str long_name (std::pair< int, int >) const
 Retrieve the long name, from the PDG code and context integer. More...
 
str long_name (int, int) const
 Retrieve the long name, from the PDG code and context integer. More...
 
std::pair< str, intshort_name_pair (str) const
 Retrieve the short name and index, from the long name. More...
 
std::pair< str, intshort_name_pair (std::pair< int, int >) const
 Retrieve the short name and index, from the PDG code and context integer. More...
 
std::pair< str, intshort_name_pair (int, int) const
 Retrieve the short name and index, from the PDG code and context integer. More...
 
const std::vector< std::pair< int, int > > & get_SM_particles () const
 Get a vector PDG codes and context integers of Standard Model particles in the database. More...
 
const std::vector< std::pair< int, int > > & get_generic_particles () const
 Get a vector PDG codes and context integers of generic particle classes in the database. More...
 
bool has_particle (str) const
 Check if a particle is in the database, using the long name. More...
 
bool has_particle (str, int) const
 Check if a particle is in the database, using the short name and index. More...
 
bool has_particle (std::pair< str, int >) const
 
bool has_particle (std::pair< int, int >) const
 Check if a particle is in the database, using the PDG code and context integer. More...
 
str get_antiparticle (str) const
 Get the matching anti-particle long name for a particle in the database, using the long name. More...
 
bool has_antiparticle (str) const
 Check if a particle has a matching anti-particle in the database, using the long name. More...
 
bool has_short_name (str) const
 Check if a particle has a short name, using the long name. More...
 
bool has_short_name (std::pair< int, int >) const
 Check if a particle has a short name, using the PDG code and context integer. More...
 
void check_contents () const
 For debugging: use to check the contents of the particle database. More...
 
std::pair< str, intget_antiparticle (std::pair< str, int >) const
 Get the matching anti-particle short name and index for a particle in the database, using the short name and index. More...
 
std::pair< str, intget_antiparticle (str, int) const
 
std::pair< int, intget_antiparticle (std::pair< int, int >) const
 Get the matching anti-particle PDG code and index for a particle in the database, using the PDG code and index. More...
 
std::pair< int, intget_antiparticle (int, int) const
 
bool has_antiparticle (std::pair< str, int >) const
 Check if a particle has a matching anti-particle in the database, using the short name and index. More...
 
bool has_antiparticle (str, int) const
 
bool has_antiparticle (std::pair< int, int >) const
 Check if a particle has a matching anti-particle in the database, using the PDG code and context integer. More...
 
bool has_antiparticle (int, int) const
 
bool has_spinx2 (str) const
 Check if a particle has a spin (x2) entry, using the long name. More...
 
bool has_spinx2 (std::pair< int, int >) const
 Check if a particle has a spin (x2) entry, using the PDG code and context integer. More...
 
bool has_spinx2 (int, int) const
 
bool has_spinx2 (std::pair< str, int >) const
 Check if a particle has a spin (x2) entry, using the short name and index. More...
 
bool has_spinx2 (str, int) const
 
int get_spinx2 (std::pair< int, int >) const
 Get spin (x2) of a given particle, using the PDG code and context integer. More...
 
int get_spinx2 (int, int) const
 
int get_spinx2 (str) const
 Get spin (x2) of a given particle, using the long name. More...
 
int get_spinx2 (std::pair< str, int >) const
 Get spin (x2) of a given particle, using the short name and index. More...
 
int get_spinx2 (str, int) const
 
bool has_chargex3 (str) const
 Check if a particle has a charge (x3) entry, using the long name. More...
 
bool has_chargex3 (std::pair< int, int >) const
 Check if a particle has a charge (x3) entry, using the PDG code and context integer. More...
 
bool has_chargex3 (int, int) const
 
bool has_chargex3 (std::pair< str, int >) const
 Check if a particle has a charge (x3) entry, using the short name and index. More...
 
bool has_chargex3 (str, int) const
 
int get_chargex3 (std::pair< int, int >) const
 Get charge (x3) of a given particle, using the PDG code and context integer. More...
 
int get_chargex3 (int, int) const
 
int get_chargex3 (str) const
 Get charge (x3) of a given particle, using the long name. More...
 
int get_chargex3 (std::pair< str, int >) const
 Get charge (x3) of a given particle, using the short name and index. More...
 
int get_chargex3 (str, int) const
 
bool has_color (str) const
 Check if a particle has a color entry, using the long name. More...
 
bool has_color (std::pair< int, int >) const
 Check if a particle has a color entry, using the PDG code and context integer. More...
 
bool has_color (int, int) const
 
bool has_color (std::pair< str, int >) const
 Check if a particle has a color entry, using the short name and index. More...
 
bool has_color (str, int) const
 
int get_color (std::pair< int, int >) const
 Get color of a given particle, using the PDG code and context integer. More...
 
int get_color (int, int) const
 
int get_color (str) const
 Get color of a given particle, using the long name. More...
 
int get_color (std::pair< str, int >) const
 Get color of a given particle, using the short name and index. More...
 
int get_color (str, int) const
 

Private Attributes

std::vector< std::pair< int, int > > SM
 All SM particles in the database, by PDG code and context integer. More...
 
std::vector< std::pair< int, int > > generic
 All generic particle classes in the database, by PDG code and context integer. More...
 
std::map< str, std::pair< int, int > > long_name_to_pdg_pair
 Map from long name to PDG code and context integer. More...
 
std::map< std::pair< int, int >, strpdg_pair_to_long_name
 Map from PDG code and context integer to long name. More...
 
std::map< std::pair< str, int >, std::pair< int, int > > short_name_pair_to_pdg_pair
 Map from short name and index to PDG code and context integer. More...
 
std::map< std::pair< int, int >, std::pair< str, int > > pdg_pair_to_short_name_pair
 Map from PDG code and context integer to short name and index. More...
 
std::map< str, std::pair< str, int > > long_name_to_short_name_pair
 Map from long name to short name and index. More...
 
std::map< std::pair< str, int >, strshort_name_pair_to_long_name
 Map from short name and index to long name. More...
 
std::map< str, intlong_name_to_spinx2
 Map from long name to twice the spin of particle. More...
 
std::map< str, intlong_name_to_chargex3
 Map from long name to three times the charge of particle. More...
 
std::map< str, intlong_name_to_color
 Map from long name to color representation of particle. More...
 

Detailed Description

Definition at line 37 of file partmap.hpp.

Constructor & Destructor Documentation

◆ partmap()

Gambit::Models::partmap::partmap ( )

Constructor.

Definition at line 46 of file partmap.cpp.

References Gambit::Models::define_particles().

46 { define_particles(this); }
void define_particles(partmap *)
Declare redirected constructor.
Here is the call graph for this function:

Member Function Documentation

◆ add()

void Gambit::Models::partmap::add ( str  long_name,
std::pair< int, int pdgpr,
int  spinx2,
int  chargex3,
int  color 
)

Add a new particle to the database.

Definition at line 49 of file partmap.cpp.

References has_particle(), LOCAL_INFO, long_name(), long_name_to_chargex3, long_name_to_color, long_name_to_pdg_pair, long_name_to_spinx2, Gambit::model_error(), and pdg_pair_to_long_name.

Referenced by add_generic(), add_SM(), and add_with_short_pair().

50  {
52  {
53  model_error().raise(LOCAL_INFO,"Particle "+long_name+" is multiply defined.");
54  }
57 
59  long_name_to_chargex3[long_name] = chargex3;
61  }
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::map< std::pair< int, int >, str > pdg_pair_to_long_name
Map from PDG code and context integer to long name.
Definition: partmap.hpp:235
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
std::map< str, std::pair< int, int > > long_name_to_pdg_pair
Map from long name to PDG code and context integer.
Definition: partmap.hpp:233
std::map< str, int > long_name_to_chargex3
Map from long name to three times the charge of particle.
Definition: partmap.hpp:247
std::map< str, int > long_name_to_spinx2
Map from long name to twice the spin of particle.
Definition: partmap.hpp:245
error & model_error()
Model errors.
std::map< str, int > long_name_to_color
Map from long name to color representation of particle.
Definition: partmap.hpp:249
Here is the call graph for this function:
Here is the caller graph for this function:

◆ add_generic()

void Gambit::Models::partmap::add_generic ( str  long_name,
std::pair< int, int pdgpr,
int  spinx2,
int  chargex3,
int  color 
)

Add a new generic particle class to the database.

Definition at line 71 of file partmap.cpp.

References add().

72  {
73  add(long_name, pdgpr, spinx2, chargex3, color);
74  generic.push_back(pdgpr);
75  }
void add(str, std::pair< int, int >, int, int, int)
Add a new particle to the database.
Definition: partmap.cpp:49
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
Here is the call graph for this function:

◆ add_SM()

void Gambit::Models::partmap::add_SM ( str  long_name,
std::pair< int, int pdgpr,
int  spinx2,
int  chargex3,
int  color 
)

Add a new Standard Model particle to the database.

Definition at line 64 of file partmap.cpp.

References add(), and SM.

65  {
66  add(long_name, pdgpr, spinx2, chargex3, color);
67  SM.push_back(pdgpr);
68  }
void add(str, std::pair< int, int >, int, int, int)
Add a new particle to the database.
Definition: partmap.cpp:49
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::vector< std::pair< int, int > > SM
All SM particles in the database, by PDG code and context integer.
Definition: partmap.hpp:229
Here is the call graph for this function:

◆ add_SM_with_short_pair()

void Gambit::Models::partmap::add_SM_with_short_pair ( str  long_name,
std::pair< int, int pdgpr,
std::pair< str, int shortpr,
int  spinx2,
int  chargex3,
int  color 
)

Add a new Standard Model particle to the database with a short name and an index.

Definition at line 88 of file partmap.cpp.

References add_with_short_pair(), and SM.

89  {
90  add_with_short_pair(long_name, pdgpr, shortpr, spinx2, chargex3, color);
91  SM.push_back(pdgpr);
92  }
void add_with_short_pair(str, std::pair< int, int >, std::pair< str, int >, int, int, int)
Add a new particle to the database with a short name and an index.
Definition: partmap.cpp:78
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::vector< std::pair< int, int > > SM
All SM particles in the database, by PDG code and context integer.
Definition: partmap.hpp:229
Here is the call graph for this function:

◆ add_with_short_pair()

void Gambit::Models::partmap::add_with_short_pair ( str  long_name,
std::pair< int, int pdgpr,
std::pair< str, int shortpr,
int  spinx2,
int  chargex3,
int  color 
)

Add a new particle to the database with a short name and an index.

Definition at line 78 of file partmap.cpp.

References add(), long_name(), long_name_to_short_name_pair, pdg_pair_to_short_name_pair, short_name_pair_to_long_name, and short_name_pair_to_pdg_pair.

Referenced by add_SM_with_short_pair().

79  {
80  add(long_name, pdgpr, spinx2, chargex3, color);
81  short_name_pair_to_pdg_pair[shortpr] = pdgpr;
83  pdg_pair_to_short_name_pair[pdgpr] = shortpr;
85  }
std::map< std::pair< int, int >, std::pair< str, int > > pdg_pair_to_short_name_pair
Map from PDG code and context integer to short name and index.
Definition: partmap.hpp:239
void add(str, std::pair< int, int >, int, int, int)
Add a new particle to the database.
Definition: partmap.cpp:49
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::map< std::pair< str, int >, str > short_name_pair_to_long_name
Map from short name and index to long name.
Definition: partmap.hpp:243
std::map< std::pair< str, int >, std::pair< int, int > > short_name_pair_to_pdg_pair
Map from short name and index to PDG code and context integer.
Definition: partmap.hpp:237
std::map< str, std::pair< str, int > > long_name_to_short_name_pair
Map from long name to short name and index.
Definition: partmap.hpp:241
Here is the call graph for this function:
Here is the caller graph for this function:

◆ check_contents()

void Gambit::Models::partmap::check_contents ( ) const

For debugging: use to check the contents of the particle database.

Definition at line 527 of file partmap.cpp.

References has_short_name(), long_name_to_pdg_pair, long_name_to_short_name_pair, pdg_pair_to_long_name, pdg_pair_to_short_name_pair, short_name_pair_to_long_name, and short_name_pair_to_pdg_pair.

528  {
529  // Check that long and short names retrieve same information (when short name exists)
530  typedef std::map<str, std::pair<int, int> >::const_iterator it_long_name_to_pdg_pair;
531  typedef std::map<std::pair<int, int>, str>::const_iterator it_pdg_pair_to_long_name;
532  typedef std::map<std::pair<str, int>, str>::const_iterator it_short_name_pair_to_long_name;
533  //typedef std::map<std::pair<str, int>, std::pair<int, int> >::const_iterator it_short_name_pair_to_pdg_pair;
534  //typedef std::map<std::pair<int, int>, std::pair<str, int> >::const_iterator it_pdg_pair_to_short_name_pair;
535  //typedef std::map<str, std::pair<str, int> >::const_iterator it_long_name_to_short_name_pair;
536 
537  cout << "PDB: long name as key" << endl;
538  for(it_long_name_to_pdg_pair it = long_name_to_pdg_pair.begin(); it != long_name_to_pdg_pair.end(); it++) {
539  cout << " long_name_to_pdg_pair [" << it->first << "] => " << it->second << endl;
540  if(has_short_name(it->first))
541  { cout << " long_name_to_short_name_pair[" << it->first << "] => " << long_name_to_short_name_pair.at(it->first) << endl; }
542  else
543  { cout << " long_name_to_short_name_pair[" << it->first << "] => " << "Has no short name!" << endl; }
544  }
545  cout << endl << "PDB: pdg_pair as key" << endl;
546  for(it_pdg_pair_to_long_name it = pdg_pair_to_long_name.begin(); it != pdg_pair_to_long_name.end(); it++) {
547  cout << " pdg_pair_to_long_name [" << it->first << "] => " << it->second << endl;
548  if(has_short_name(it->second))
549  { cout << " pdg_pair_to_short_name[" << it->first << "] => " << pdg_pair_to_short_name_pair.at(it->first) << endl; }
550  else
551  { cout << " pdg_pair_to_short_name[" << it->first << "] => " << "Has no short name!" << endl; }
552  }
553  cout << endl << "PDB: short name pair as key" << endl;
554  for(it_short_name_pair_to_long_name it = short_name_pair_to_long_name.begin(); it != short_name_pair_to_long_name.end(); it++) {
555  cout << " short_name_pair_to_long_name[" << it->first << "] => " << it->second << endl;
556  cout << " short_name_pair_to_pdg_pair [" << it->first << "] => " << short_name_pair_to_pdg_pair.at(it->first) << endl;
557  }
558  }
bool has_short_name(str) const
Check if a particle has a short name, using the long name.
Definition: partmap.cpp:227
std::map< std::pair< int, int >, std::pair< str, int > > pdg_pair_to_short_name_pair
Map from PDG code and context integer to short name and index.
Definition: partmap.hpp:239
std::string str
Definition: models.hpp:49
std::map< std::pair< int, int >, str > pdg_pair_to_long_name
Map from PDG code and context integer to long name.
Definition: partmap.hpp:235
std::map< std::pair< str, int >, str > short_name_pair_to_long_name
Map from short name and index to long name.
Definition: partmap.hpp:243
std::map< str, std::pair< int, int > > long_name_to_pdg_pair
Map from long name to PDG code and context integer.
Definition: partmap.hpp:233
std::map< std::pair< str, int >, std::pair< int, int > > short_name_pair_to_pdg_pair
Map from short name and index to PDG code and context integer.
Definition: partmap.hpp:237
std::map< str, std::pair< str, int > > long_name_to_short_name_pair
Map from long name to short name and index.
Definition: partmap.hpp:241
Here is the call graph for this function:

◆ get_antiparticle() [1/5]

str Gambit::Models::partmap::get_antiparticle ( str  lname) const

Get the matching anti-particle long name for a particle in the database, using the long name.

Definition at line 239 of file partmap.cpp.

References long_name(), and pdg_pair().

Referenced by Gambit::slhahelp::add_MSSM_spectrum_to_SLHAea(), get_antiparticle(), and Gambit::SubSpectrum::set_override().

240  {
241  return long_name(get_antiparticle(pdg_pair(lname)));
242  }
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
str get_antiparticle(str) const
Get the matching anti-particle long name for a particle in the database, using the long name...
Definition: partmap.cpp:239
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_antiparticle() [2/5]

std::pair< str, int > Gambit::Models::partmap::get_antiparticle ( std::pair< str, int shortpr) const

Get the matching anti-particle short name and index for a particle in the database, using the short name and index.

Definition at line 246 of file partmap.cpp.

References get_antiparticle(), pdg_pair(), and short_name_pair().

247  {
248  return short_name_pair(get_antiparticle(pdg_pair(shortpr)));
249  }
std::pair< str, int > short_name_pair(str) const
Retrieve the short name and index, from the long name.
Definition: partmap.cpp:155
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
str get_antiparticle(str) const
Get the matching anti-particle long name for a particle in the database, using the long name...
Definition: partmap.cpp:239
Here is the call graph for this function:

◆ get_antiparticle() [3/5]

std::pair< str, int > Gambit::Models::partmap::get_antiparticle ( str  name,
int  index 
) const

Definition at line 250 of file partmap.cpp.

References get_antiparticle().

251  {
252  return get_antiparticle(std::make_pair(name,index));
253  }
str get_antiparticle(str) const
Get the matching anti-particle long name for a particle in the database, using the long name...
Definition: partmap.cpp:239
Here is the call graph for this function:

◆ get_antiparticle() [4/5]

std::pair< int, int > Gambit::Models::partmap::get_antiparticle ( std::pair< int, int pdgpr) const

Get the matching anti-particle PDG code and index for a particle in the database, using the PDG code and index.

Antiparticles are identified by having the opposite sign PDG code to a particle

Else assume particle is its own antiparticle (if this may not be true, use has_anti_particle to check explicitly for match)

Definition at line 258 of file partmap.cpp.

References has_antiparticle().

259  {
260  if (has_antiparticle(pdgpr))
261  {
263  pdgpr.first = -pdgpr.first;
264  }
267  return pdgpr;
268  }
bool has_antiparticle(str) const
Check if a particle has a matching anti-particle in the database, using the long name.
Definition: partmap.cpp:277
Here is the call graph for this function:

◆ get_antiparticle() [5/5]

std::pair< int, int > Gambit::Models::partmap::get_antiparticle ( int  pdgcode,
int  context 
) const

Definition at line 269 of file partmap.cpp.

References get_antiparticle().

270  {
271  return get_antiparticle(std::make_pair(pdgcode,context));
272  }
str get_antiparticle(str) const
Get the matching anti-particle long name for a particle in the database, using the long name...
Definition: partmap.cpp:239
Here is the call graph for this function:

◆ get_chargex3() [1/5]

int Gambit::Models::partmap::get_chargex3 ( std::pair< int, int pdgpr) const

Get charge (x3) of a given particle, using the PDG code and context integer.

Get charge of a given particle, using the PDG code and context integer.

Definition at line 432 of file partmap.cpp.

References long_name().

Referenced by get_chargex3(), and Gambit::SLHAea_add_QNumbers_from_subspec().

433  {
434  return get_chargex3(long_name(pdgpr));
435  }
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
int get_chargex3(std::pair< int, int >) const
Get charge (x3) of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:432
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_chargex3() [2/5]

int Gambit::Models::partmap::get_chargex3 ( int  pdg_code,
int  context 
) const

Definition at line 436 of file partmap.cpp.

References get_chargex3().

437  {
438  return get_chargex3(std::make_pair(pdg_code,context));
439  }
int get_chargex3(std::pair< int, int >) const
Get charge (x3) of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:432
Here is the call graph for this function:

◆ get_chargex3() [3/5]

int Gambit::Models::partmap::get_chargex3 ( str  long_name) const

Get charge (x3) of a given particle, using the long name.

Get charge of a given particle, using the long name.

Definition at line 420 of file partmap.cpp.

References has_chargex3(), LOCAL_INFO, long_name_to_chargex3, and Gambit::model_error().

421  {
422  if (not has_chargex3(long_name))
423  {
424  model_error().raise(LOCAL_INFO,"Particle long name "+long_name+" does not provide any charge information (chargeformation).");
425  }
426  return long_name_to_chargex3.at(long_name);
427  }
bool has_chargex3(str) const
Check if a particle has a charge (x3) entry, using the long name.
Definition: partmap.cpp:384
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::map< str, int > long_name_to_chargex3
Map from long name to three times the charge of particle.
Definition: partmap.hpp:247
error & model_error()
Model errors.
Here is the call graph for this function:

◆ get_chargex3() [4/5]

int Gambit::Models::partmap::get_chargex3 ( std::pair< str, int shortpr) const

Get charge (x3) of a given particle, using the short name and index.

Get charge of a given particle, using short name and index.

Definition at line 444 of file partmap.cpp.

References get_chargex3(), and pdg_pair().

445  {
446  return get_chargex3(pdg_pair(shortpr));
447  }
int get_chargex3(std::pair< int, int >) const
Get charge (x3) of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:432
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
Here is the call graph for this function:

◆ get_chargex3() [5/5]

int Gambit::Models::partmap::get_chargex3 ( str  name,
int  index 
) const

Definition at line 448 of file partmap.cpp.

References get_chargex3().

449  {
450  return get_chargex3(std::make_pair(name, index));
451  }
int get_chargex3(std::pair< int, int >) const
Get charge (x3) of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:432
Here is the call graph for this function:

◆ get_color() [1/5]

int Gambit::Models::partmap::get_color ( std::pair< int, int pdgpr) const

Get color of a given particle, using the PDG code and context integer.

Definition at line 504 of file partmap.cpp.

References long_name().

Referenced by get_color(), and Gambit::SLHAea_add_QNumbers_from_subspec().

505  {
506  return get_color(long_name(pdgpr));
507  }
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
int get_color(std::pair< int, int >) const
Get color of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:504
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_color() [2/5]

int Gambit::Models::partmap::get_color ( int  pdg_code,
int  context 
) const

Definition at line 508 of file partmap.cpp.

References get_color().

509  {
510  return get_color(std::make_pair(pdg_code,context));
511  }
int get_color(std::pair< int, int >) const
Get color of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:504
Here is the call graph for this function:

◆ get_color() [3/5]

int Gambit::Models::partmap::get_color ( str  long_name) const

Get color of a given particle, using the long name.

Definition at line 492 of file partmap.cpp.

References has_color(), LOCAL_INFO, long_name_to_color, and Gambit::model_error().

493  {
494  if (not has_color(long_name))
495  {
496  model_error().raise(LOCAL_INFO,"Particle long name "+long_name+" does not provide any color information (colorformation).");
497  }
498  return long_name_to_color.at(long_name);
499  }
bool has_color(str) const
Check if a particle has a color entry, using the long name.
Definition: partmap.cpp:456
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
error & model_error()
Model errors.
std::map< str, int > long_name_to_color
Map from long name to color representation of particle.
Definition: partmap.hpp:249
Here is the call graph for this function:

◆ get_color() [4/5]

int Gambit::Models::partmap::get_color ( std::pair< str, int shortpr) const

Get color of a given particle, using the short name and index.

Get color of a given particle, using short name and index.

Definition at line 516 of file partmap.cpp.

References get_color(), and pdg_pair().

517  {
518  return get_color(pdg_pair(shortpr));
519  }
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
int get_color(std::pair< int, int >) const
Get color of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:504
Here is the call graph for this function:

◆ get_color() [5/5]

int Gambit::Models::partmap::get_color ( str  name,
int  index 
) const

Definition at line 520 of file partmap.cpp.

References get_color().

521  {
522  return get_color(std::make_pair(name, index));
523  }
int get_color(std::pair< int, int >) const
Get color of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:504
Here is the call graph for this function:

◆ get_generic_particles()

const std::vector< std::pair< int, int > > & Gambit::Models::partmap::get_generic_particles ( ) const

Get a vector PDG codes and context integers of generic particle classes in the database.

Get a vector of PDG codes and context integers of generic particle classes in the database.

Definition at line 199 of file partmap.cpp.

200  {
201  return generic;
202  }

◆ get_SM_particles()

const std::vector< std::pair< int, int > > & Gambit::Models::partmap::get_SM_particles ( ) const

Get a vector PDG codes and context integers of Standard Model particles in the database.

Get a vector of PDG codes and context integers of Standard Model particles in the database.

Definition at line 193 of file partmap.cpp.

References SM.

194  {
195  return SM;
196  }
std::vector< std::pair< int, int > > SM
All SM particles in the database, by PDG code and context integer.
Definition: partmap.hpp:229

◆ get_spinx2() [1/5]

int Gambit::Models::partmap::get_spinx2 ( std::pair< int, int pdgpr) const

Get spin (x2) of a given particle, using the PDG code and context integer.

Get spin of a given particle, using the PDG code and context integer.

Definition at line 360 of file partmap.cpp.

References long_name().

Referenced by get_spinx2(), and Gambit::SLHAea_add_QNumbers_from_subspec().

361  {
362  return get_spinx2(long_name(pdgpr));
363  }
int get_spinx2(std::pair< int, int >) const
Get spin (x2) of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:360
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_spinx2() [2/5]

int Gambit::Models::partmap::get_spinx2 ( int  pdg_code,
int  context 
) const

Definition at line 364 of file partmap.cpp.

References get_spinx2().

365  {
366  return get_spinx2(std::make_pair(pdg_code,context));
367  }
int get_spinx2(std::pair< int, int >) const
Get spin (x2) of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:360
Here is the call graph for this function:

◆ get_spinx2() [3/5]

int Gambit::Models::partmap::get_spinx2 ( str  long_name) const

Get spin (x2) of a given particle, using the long name.

Get spin of a given particle, using the long name.

Definition at line 348 of file partmap.cpp.

References has_spinx2(), LOCAL_INFO, long_name_to_spinx2, and Gambit::model_error().

349  {
350  if (not has_spinx2(long_name))
351  {
352  model_error().raise(LOCAL_INFO,"Particle long name "+long_name+" does not provide any spin information (spinformation).");
353  }
354  return long_name_to_spinx2.at(long_name);
355  }
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
bool has_spinx2(str) const
Check if a particle has a spin (x2) entry, using the long name.
Definition: partmap.cpp:312
std::map< str, int > long_name_to_spinx2
Map from long name to twice the spin of particle.
Definition: partmap.hpp:245
error & model_error()
Model errors.
Here is the call graph for this function:

◆ get_spinx2() [4/5]

int Gambit::Models::partmap::get_spinx2 ( std::pair< str, int shortpr) const

Get spin (x2) of a given particle, using the short name and index.

Get spin of a given particle, using short name and index.

Definition at line 372 of file partmap.cpp.

References get_spinx2(), and pdg_pair().

373  {
374  return get_spinx2(pdg_pair(shortpr));
375  }
int get_spinx2(std::pair< int, int >) const
Get spin (x2) of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:360
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
Here is the call graph for this function:

◆ get_spinx2() [5/5]

int Gambit::Models::partmap::get_spinx2 ( str  name,
int  index 
) const

Definition at line 376 of file partmap.cpp.

References get_spinx2().

377  {
378  return get_spinx2(std::make_pair(name, index));
379  }
int get_spinx2(std::pair< int, int >) const
Get spin (x2) of a given particle, using the PDG code and context integer.
Definition: partmap.cpp:360
Here is the call graph for this function:

◆ has_antiparticle() [1/5]

bool Gambit::Models::partmap::has_antiparticle ( str  long_name) const

Check if a particle has a matching anti-particle in the database, using the long name.

Check if a particle has a matching anti-particle in the database, using the long name Note: will throw an error if the particle itself is not in the database!

Definition at line 277 of file partmap.cpp.

References pdg_pair().

Referenced by get_antiparticle(), has_antiparticle(), Gambit::SubSpectrum::set_override(), and Gambit::SLHAea_add_QNumbers_from_subspec().

278  {
280  }
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
bool has_antiparticle(str) const
Check if a particle has a matching anti-particle in the database, using the long name.
Definition: partmap.cpp:277
Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_antiparticle() [2/5]

bool Gambit::Models::partmap::has_antiparticle ( std::pair< str, int shortpr) const

Check if a particle has a matching anti-particle in the database, using the short name and index.

Definition at line 284 of file partmap.cpp.

References has_antiparticle(), and pdg_pair().

285  {
286  return has_antiparticle(pdg_pair(shortpr));
287  }
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
bool has_antiparticle(str) const
Check if a particle has a matching anti-particle in the database, using the long name.
Definition: partmap.cpp:277
Here is the call graph for this function:

◆ has_antiparticle() [3/5]

bool Gambit::Models::partmap::has_antiparticle ( str  name,
int  index 
) const

Definition at line 288 of file partmap.cpp.

References has_antiparticle().

289  {
290  return has_antiparticle(std::make_pair(name,index));
291  }
bool has_antiparticle(str) const
Check if a particle has a matching anti-particle in the database, using the long name.
Definition: partmap.cpp:277
Here is the call graph for this function:

◆ has_antiparticle() [4/5]

bool Gambit::Models::partmap::has_antiparticle ( std::pair< int, int pdgpr) const

Check if a particle has a matching anti-particle in the database, using the PDG code and context integer.

Antiparticles are identified by having the opposite sign PDG code to a particle

Definition at line 296 of file partmap.cpp.

References has_particle().

297  {
299  pdgpr.first = -pdgpr.first;
300  return has_particle(pdgpr);
301  }
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
Here is the call graph for this function:

◆ has_antiparticle() [5/5]

bool Gambit::Models::partmap::has_antiparticle ( int  pdgcode,
int  context 
) const

Definition at line 302 of file partmap.cpp.

References has_antiparticle().

303  {
304  return has_antiparticle(std::make_pair(pdgcode,context));
305  }
bool has_antiparticle(str) const
Check if a particle has a matching anti-particle in the database, using the long name.
Definition: partmap.cpp:277
Here is the call graph for this function:

◆ has_chargex3() [1/5]

bool Gambit::Models::partmap::has_chargex3 ( str  long_name) const

Check if a particle has a charge (x3) entry, using the long name.

Check if a particle has the charge (x3), using the long name.

Definition at line 384 of file partmap.cpp.

References has_particle(), LOCAL_INFO, long_name_to_chargex3, and Gambit::model_error().

Referenced by get_chargex3(), and has_chargex3().

385  {
386  if (not has_particle(long_name))
387  {
388  model_error().raise(LOCAL_INFO,"Particle long name "+long_name+" is not in the particle database.");
389  }
390  return (long_name_to_chargex3.find(long_name) != long_name_to_chargex3.end());
391  }
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
std::map< str, int > long_name_to_chargex3
Map from long name to three times the charge of particle.
Definition: partmap.hpp:247
error & model_error()
Model errors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_chargex3() [2/5]

bool Gambit::Models::partmap::has_chargex3 ( std::pair< int, int pdgpr) const

Check if a particle has a charge (x3) entry, using the PDG code and context integer.

Check if a particle has the charge (x3), using the PDG code and context integer.

Definition at line 396 of file partmap.cpp.

References has_chargex3(), long_name(), and pdg_pair().

397  {
398  return has_chargex3(pdg_pair(long_name(pdgpr)));
399  }
bool has_chargex3(str) const
Check if a particle has a charge (x3) entry, using the long name.
Definition: partmap.cpp:384
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
Here is the call graph for this function:

◆ has_chargex3() [3/5]

bool Gambit::Models::partmap::has_chargex3 ( int  pdg_code,
int  context 
) const

Definition at line 400 of file partmap.cpp.

References has_chargex3().

401  {
402  return has_chargex3(std::make_pair(pdg_code, context));
403  }
bool has_chargex3(str) const
Check if a particle has a charge (x3) entry, using the long name.
Definition: partmap.cpp:384
Here is the call graph for this function:

◆ has_chargex3() [4/5]

bool Gambit::Models::partmap::has_chargex3 ( std::pair< str, int shortpr) const

Check if a particle has a charge (x3) entry, using the short name and index.

Check if a particle has the charge (x3), using short name and index.

Definition at line 408 of file partmap.cpp.

References has_chargex3(), and pdg_pair().

409  {
410  return has_chargex3(pdg_pair(shortpr));
411  }
bool has_chargex3(str) const
Check if a particle has a charge (x3) entry, using the long name.
Definition: partmap.cpp:384
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
Here is the call graph for this function:

◆ has_chargex3() [5/5]

bool Gambit::Models::partmap::has_chargex3 ( str  name,
int  index 
) const

Definition at line 412 of file partmap.cpp.

References has_chargex3().

413  {
414  return has_chargex3(std::make_pair(name, index));
415  }
bool has_chargex3(str) const
Check if a particle has a charge (x3) entry, using the long name.
Definition: partmap.cpp:384
Here is the call graph for this function:

◆ has_color() [1/5]

bool Gambit::Models::partmap::has_color ( str  long_name) const

Check if a particle has a color entry, using the long name.

Check if a particle has color information, using the long name.

Definition at line 456 of file partmap.cpp.

References has_particle(), LOCAL_INFO, long_name_to_color, and Gambit::model_error().

Referenced by get_color(), and has_color().

457  {
458  if (not has_particle(long_name))
459  {
460  model_error().raise(LOCAL_INFO,"Particle long name "+long_name+" is not in the particle database.");
461  }
462  return (long_name_to_color.find(long_name) != long_name_to_color.end());
463  }
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
error & model_error()
Model errors.
std::map< str, int > long_name_to_color
Map from long name to color representation of particle.
Definition: partmap.hpp:249
Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_color() [2/5]

bool Gambit::Models::partmap::has_color ( std::pair< int, int pdgpr) const

Check if a particle has a color entry, using the PDG code and context integer.

Check if a particle has color information, using the PDG code and context integer.

Definition at line 468 of file partmap.cpp.

References has_color(), long_name(), and pdg_pair().

469  {
470  return has_color(pdg_pair(long_name(pdgpr)));
471  }
bool has_color(str) const
Check if a particle has a color entry, using the long name.
Definition: partmap.cpp:456
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
Here is the call graph for this function:

◆ has_color() [3/5]

bool Gambit::Models::partmap::has_color ( int  pdg_code,
int  context 
) const

Definition at line 472 of file partmap.cpp.

References has_color().

473  {
474  return has_color(std::make_pair(pdg_code, context));
475  }
bool has_color(str) const
Check if a particle has a color entry, using the long name.
Definition: partmap.cpp:456
Here is the call graph for this function:

◆ has_color() [4/5]

bool Gambit::Models::partmap::has_color ( std::pair< str, int shortpr) const

Check if a particle has a color entry, using the short name and index.

Check if a particle has color information, using short name and index.

Definition at line 480 of file partmap.cpp.

References has_color(), and pdg_pair().

481  {
482  return has_color(pdg_pair(shortpr));
483  }
bool has_color(str) const
Check if a particle has a color entry, using the long name.
Definition: partmap.cpp:456
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
Here is the call graph for this function:

◆ has_color() [5/5]

bool Gambit::Models::partmap::has_color ( str  name,
int  index 
) const

Definition at line 484 of file partmap.cpp.

References has_color().

485  {
486  return has_color(std::make_pair(name, index));
487  }
bool has_color(str) const
Check if a particle has a color entry, using the long name.
Definition: partmap.cpp:456
Here is the call graph for this function:

◆ has_particle() [1/4]

bool Gambit::Models::partmap::has_particle ( str  long_name) const

Check if a particle is in the database, using the long name.

Definition at line 205 of file partmap.cpp.

References long_name_to_pdg_pair.

Referenced by add(), Gambit::DecayTable::Entry::check_particles_exist(), Gambit::DecayTable::Entry::getSLHAea_block(), has_antiparticle(), has_chargex3(), has_color(), has_particle(), has_spinx2(), long_name(), pdg_pair(), Gambit::SubSpectrum::set_override(), and short_name_pair().

206  {
207  return (long_name_to_pdg_pair.find(long_name) != long_name_to_pdg_pair.end());
208  }
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::map< str, std::pair< int, int > > long_name_to_pdg_pair
Map from long name to PDG code and context integer.
Definition: partmap.hpp:233
Here is the caller graph for this function:

◆ has_particle() [2/4]

bool Gambit::Models::partmap::has_particle ( str  short_name,
int  i 
) const

Check if a particle is in the database, using the short name and index.

Definition at line 211 of file partmap.cpp.

References has_particle().

212  {
213  return has_particle(std::make_pair(short_name,i));
214  }
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
Here is the call graph for this function:

◆ has_particle() [3/4]

bool Gambit::Models::partmap::has_particle ( std::pair< str, int shortpr) const

Definition at line 215 of file partmap.cpp.

References short_name_pair_to_pdg_pair.

216  {
217  return (short_name_pair_to_pdg_pair.find(shortpr) != short_name_pair_to_pdg_pair.end());
218  }
std::map< std::pair< str, int >, std::pair< int, int > > short_name_pair_to_pdg_pair
Map from short name and index to PDG code and context integer.
Definition: partmap.hpp:237

◆ has_particle() [4/4]

bool Gambit::Models::partmap::has_particle ( std::pair< int, int pdgpr) const

Check if a particle is in the database, using the PDG code and context integer.

Definition at line 221 of file partmap.cpp.

References pdg_pair_to_long_name.

222  {
223  return (pdg_pair_to_long_name.find(pdgpr) != pdg_pair_to_long_name.end());
224  }
std::map< std::pair< int, int >, str > pdg_pair_to_long_name
Map from PDG code and context integer to long name.
Definition: partmap.hpp:235

◆ has_short_name() [1/2]

bool Gambit::Models::partmap::has_short_name ( str  long_name) const

Check if a particle has a short name, using the long name.

Definition at line 227 of file partmap.cpp.

References long_name_to_short_name_pair.

Referenced by check_contents(), and short_name_pair().

228  {
230  }
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::map< str, std::pair< str, int > > long_name_to_short_name_pair
Map from long name to short name and index.
Definition: partmap.hpp:241
Here is the caller graph for this function:

◆ has_short_name() [2/2]

bool Gambit::Models::partmap::has_short_name ( std::pair< int, int pdgpr) const

Check if a particle has a short name, using the PDG code and context integer.

Definition at line 233 of file partmap.cpp.

References pdg_pair_to_short_name_pair.

234  {
235  return (pdg_pair_to_short_name_pair.find(pdgpr) != pdg_pair_to_short_name_pair.end());
236  }
std::map< std::pair< int, int >, std::pair< str, int > > pdg_pair_to_short_name_pair
Map from PDG code and context integer to short name and index.
Definition: partmap.hpp:239

◆ has_spinx2() [1/5]

bool Gambit::Models::partmap::has_spinx2 ( str  long_name) const

Check if a particle has a spin (x2) entry, using the long name.


Check if a particle has the spin (x2), using the long name

Definition at line 312 of file partmap.cpp.

References has_particle(), LOCAL_INFO, long_name_to_spinx2, and Gambit::model_error().

Referenced by get_spinx2(), and has_spinx2().

313  {
314  if (not has_particle(long_name))
315  {
316  model_error().raise(LOCAL_INFO,"Particle long name "+long_name+" is not in the particle database.");
317  }
318  return (long_name_to_spinx2.find(long_name) != long_name_to_spinx2.end());
319  }
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
std::map< str, int > long_name_to_spinx2
Map from long name to twice the spin of particle.
Definition: partmap.hpp:245
error & model_error()
Model errors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ has_spinx2() [2/5]

bool Gambit::Models::partmap::has_spinx2 ( std::pair< int, int pdgpr) const

Check if a particle has a spin (x2) entry, using the PDG code and context integer.

Check if a particle has the spin (x2), using the PDG code and context integer.

Definition at line 324 of file partmap.cpp.

References has_spinx2(), long_name(), and pdg_pair().

325  {
326  return has_spinx2(pdg_pair(long_name(pdgpr)));
327  }
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
bool has_spinx2(str) const
Check if a particle has a spin (x2) entry, using the long name.
Definition: partmap.cpp:312
Here is the call graph for this function:

◆ has_spinx2() [3/5]

bool Gambit::Models::partmap::has_spinx2 ( int  pdg_code,
int  context 
) const

Definition at line 328 of file partmap.cpp.

References has_spinx2().

329  {
330  return has_spinx2(std::make_pair(pdg_code, context));
331  }
bool has_spinx2(str) const
Check if a particle has a spin (x2) entry, using the long name.
Definition: partmap.cpp:312
Here is the call graph for this function:

◆ has_spinx2() [4/5]

bool Gambit::Models::partmap::has_spinx2 ( std::pair< str, int shortpr) const

Check if a particle has a spin (x2) entry, using the short name and index.

Check if a particle has the spin (x2), using short name and index.

Definition at line 336 of file partmap.cpp.

References has_spinx2(), and pdg_pair().

337  {
338  return has_spinx2(pdg_pair(shortpr));
339  }
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
bool has_spinx2(str) const
Check if a particle has a spin (x2) entry, using the long name.
Definition: partmap.cpp:312
Here is the call graph for this function:

◆ has_spinx2() [5/5]

bool Gambit::Models::partmap::has_spinx2 ( str  name,
int  index 
) const

Definition at line 340 of file partmap.cpp.

References has_spinx2().

341  {
342  return has_spinx2(std::make_pair(name, index));
343  }
bool has_spinx2(str) const
Check if a particle has a spin (x2) entry, using the long name.
Definition: partmap.cpp:312
Here is the call graph for this function:

◆ long_name() [1/3]

str Gambit::Models::partmap::long_name ( str  short_name,
int  i 
) const

Retrieve the long name, from the short name and index.

Definition at line 124 of file partmap.cpp.

References has_particle(), LOCAL_INFO, Gambit::model_error(), and short_name_pair_to_long_name.

Referenced by add(), add_with_short_pair(), Gambit::DecayTable::Entry::check_BF_validity(), Gambit::SubSpectrum::get(), Gambit::Spectrum::get(), get_antiparticle(), get_chargex3(), get_color(), get_spinx2(), Gambit::DecayTable::Entry::getSLHAea_block(), has_chargex3(), has_color(), has_spinx2(), Gambit::DarkBit::DarkBit_utils::ImportDecays(), long_name(), Gambit::DarkBit::RD_spectrum_MSSM(), Gambit::SubSpectrum::set_override(), and Gambit::SLHAea_add_QNumbers_from_subspec().

125  {
126  std::pair<str, int> shortpr(short_name, i);
127  if (not has_particle(std::pair<str, int>(short_name, i)))
128  {
129  std::ostringstream ss;
130  ss << "Short name " << short_name << " and index " << i << " are not in the particle database.";
131  model_error().raise(LOCAL_INFO,ss.str());
132  }
133  return short_name_pair_to_long_name.at(shortpr);
134  }
#define LOCAL_INFO
Definition: local_info.hpp:34
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
std::map< std::pair< str, int >, str > short_name_pair_to_long_name
Map from short name and index to long name.
Definition: partmap.hpp:243
error & model_error()
Model errors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ long_name() [2/3]

str Gambit::Models::partmap::long_name ( std::pair< int, int pdgpr) const

Retrieve the long name, from the PDG code and context integer.

Definition at line 137 of file partmap.cpp.

References has_particle(), LOCAL_INFO, Gambit::model_error(), and pdg_pair_to_long_name.

138  {
139  if (not has_particle(pdgpr))
140  {
141  std::ostringstream ss;
142  ss << "Particle with PDG code " << pdgpr.first << " and context integer " << pdgpr.second << " is not in the particle database.";
143  model_error().raise(LOCAL_INFO,ss.str());
144  }
145  return pdg_pair_to_long_name.at(pdgpr);
146  }
#define LOCAL_INFO
Definition: local_info.hpp:34
std::map< std::pair< int, int >, str > pdg_pair_to_long_name
Map from PDG code and context integer to long name.
Definition: partmap.hpp:235
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
error & model_error()
Model errors.
Here is the call graph for this function:

◆ long_name() [3/3]

str Gambit::Models::partmap::long_name ( int  pdg_code,
int  context 
) const

Retrieve the long name, from the PDG code and context integer.

Definition at line 149 of file partmap.cpp.

References long_name().

150  {
151  return long_name(std::make_pair(pdg_code,context));
152  }
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
Here is the call graph for this function:

◆ pdg_pair() [1/3]

std::pair< int, int > Gambit::Models::partmap::pdg_pair ( str  long_name) const

Retrieve the PDG code and context integer, from the long name.

Definition at line 95 of file partmap.cpp.

References has_particle(), LOCAL_INFO, long_name_to_pdg_pair, and Gambit::model_error().

Referenced by Gambit::add_SimpleSpec_to_SLHAea(), Gambit::DecayTable::Entry::BF(), get_antiparticle(), get_chargex3(), get_color(), get_spinx2(), has_antiparticle(), Gambit::DecayTable::Entry::has_channel(), has_chargex3(), has_color(), has_spinx2(), Gambit::DecayTable::operator()(), pdg_pair(), and Gambit::DecayTable::Entry::set_BF().

96  {
97  if (not has_particle(long_name))
98  {
99  model_error().raise(LOCAL_INFO,"Particle long name "+long_name+" is not in the particle database.");
100  }
101  return long_name_to_pdg_pair.at(long_name);
102  }
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
std::map< str, std::pair< int, int > > long_name_to_pdg_pair
Map from long name to PDG code and context integer.
Definition: partmap.hpp:233
error & model_error()
Model errors.
Here is the call graph for this function:
Here is the caller graph for this function:

◆ pdg_pair() [2/3]

std::pair< int, int > Gambit::Models::partmap::pdg_pair ( str  short_name,
int  i 
) const

Retrieve the PDG code and context integer, from the short name and index.

Definition at line 111 of file partmap.cpp.

References has_particle(), LOCAL_INFO, Gambit::model_error(), and short_name_pair_to_pdg_pair.

112  {
113  std::pair<str, int> shortpr(short_name, i);
114  if (not has_particle(shortpr))
115  {
116  std::ostringstream ss;
117  ss << "Short name " << short_name << " and index " << i << " are not in the particle database.";
118  model_error().raise(LOCAL_INFO,ss.str());
119  }
120  return short_name_pair_to_pdg_pair.at(shortpr);
121  }
#define LOCAL_INFO
Definition: local_info.hpp:34
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
std::map< std::pair< str, int >, std::pair< int, int > > short_name_pair_to_pdg_pair
Map from short name and index to PDG code and context integer.
Definition: partmap.hpp:237
error & model_error()
Model errors.
Here is the call graph for this function:

◆ pdg_pair() [3/3]

std::pair< int, int > Gambit::Models::partmap::pdg_pair ( std::pair< str, int shortpr) const

Retrieve the PDG code and context integer, from the short name and index pair.

Definition at line 105 of file partmap.cpp.

References pdg_pair().

106  {
107  return pdg_pair(shortpr.first,shortpr.second);
108  }
std::pair< int, int > pdg_pair(str) const
Retrieve the PDG code and context integer, from the long name.
Definition: partmap.cpp:95
Here is the call graph for this function:

◆ short_name_pair() [1/3]

std::pair< str, int > Gambit::Models::partmap::short_name_pair ( str  long_name) const

Retrieve the short name and index, from the long name.

Definition at line 155 of file partmap.cpp.

References has_particle(), has_short_name(), LOCAL_INFO, long_name_to_short_name_pair, and Gambit::model_error().

Referenced by Gambit::Spectrum::get(), get_antiparticle(), Gambit::SubSpectrum::set_override(), and short_name_pair().

156  {
157  if (not has_particle(long_name))
158  {
159  model_error().raise(LOCAL_INFO,"Particle "+long_name+" is not in the particle database.");
160  }
161  if (not has_short_name(long_name))
162  {
163  model_error().raise(LOCAL_INFO,"Particle "+long_name+" does not have a short name.");
164  }
166  }
bool has_short_name(str) const
Check if a particle has a short name, using the long name.
Definition: partmap.cpp:227
#define LOCAL_INFO
Definition: local_info.hpp:34
str long_name(str, int) const
Retrieve the long name, from the short name and index.
Definition: partmap.cpp:124
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
error & model_error()
Model errors.
std::map< str, std::pair< str, int > > long_name_to_short_name_pair
Map from long name to short name and index.
Definition: partmap.hpp:241
Here is the call graph for this function:
Here is the caller graph for this function:

◆ short_name_pair() [2/3]

std::pair< str, int > Gambit::Models::partmap::short_name_pair ( std::pair< int, int pdgpr) const

Retrieve the short name and index, from the PDG code and context integer.

Definition at line 169 of file partmap.cpp.

References has_particle(), has_short_name(), LOCAL_INFO, Gambit::model_error(), and pdg_pair_to_short_name_pair.

170  {
171  if (not has_particle(pdgpr))
172  {
173  std::ostringstream ss;
174  ss << "Particle with PDG code " << pdgpr.first << " and context integer " << pdgpr.second << " is not in the particle database.";
175  model_error().raise(LOCAL_INFO,ss.str());
176  }
177  if (not has_short_name(pdgpr))
178  {
179  std::ostringstream ss;
180  ss << "Particle with PDG code " << pdgpr.first << " and context integer " << pdgpr.second << " does not have a short name.";
181  model_error().raise(LOCAL_INFO,ss.str());
182  }
183  return pdg_pair_to_short_name_pair.at(pdgpr);
184  }
bool has_short_name(str) const
Check if a particle has a short name, using the long name.
Definition: partmap.cpp:227
std::map< std::pair< int, int >, std::pair< str, int > > pdg_pair_to_short_name_pair
Map from PDG code and context integer to short name and index.
Definition: partmap.hpp:239
#define LOCAL_INFO
Definition: local_info.hpp:34
bool has_particle(str) const
Check if a particle is in the database, using the long name.
Definition: partmap.cpp:205
error & model_error()
Model errors.
Here is the call graph for this function:

◆ short_name_pair() [3/3]

std::pair< str, int > Gambit::Models::partmap::short_name_pair ( int  pdg_code,
int  context 
) const

Retrieve the short name and index, from the PDG code and context integer.

Definition at line 187 of file partmap.cpp.

References short_name_pair().

188  {
189  return short_name_pair(std::make_pair(pdg_code,context));
190  }
std::pair< str, int > short_name_pair(str) const
Retrieve the short name and index, from the long name.
Definition: partmap.cpp:155
Here is the call graph for this function:

Member Data Documentation

◆ generic

std::vector<std::pair<int, int> > Gambit::Models::partmap::generic
private

All generic particle classes in the database, by PDG code and context integer.

Definition at line 231 of file partmap.hpp.

◆ long_name_to_chargex3

std::map<str, int> Gambit::Models::partmap::long_name_to_chargex3
private

Map from long name to three times the charge of particle.

Definition at line 247 of file partmap.hpp.

Referenced by add(), get_chargex3(), and has_chargex3().

◆ long_name_to_color

std::map<str, int> Gambit::Models::partmap::long_name_to_color
private

Map from long name to color representation of particle.

Definition at line 249 of file partmap.hpp.

Referenced by add(), get_color(), and has_color().

◆ long_name_to_pdg_pair

std::map<str, std::pair<int, int> > Gambit::Models::partmap::long_name_to_pdg_pair
private

Map from long name to PDG code and context integer.

Definition at line 233 of file partmap.hpp.

Referenced by add(), check_contents(), has_particle(), and pdg_pair().

◆ long_name_to_short_name_pair

std::map<str, std::pair<str, int> > Gambit::Models::partmap::long_name_to_short_name_pair
private

Map from long name to short name and index.

Definition at line 241 of file partmap.hpp.

Referenced by add_with_short_pair(), check_contents(), has_short_name(), and short_name_pair().

◆ long_name_to_spinx2

std::map<str, int> Gambit::Models::partmap::long_name_to_spinx2
private

Map from long name to twice the spin of particle.

Definition at line 245 of file partmap.hpp.

Referenced by add(), get_spinx2(), and has_spinx2().

◆ pdg_pair_to_long_name

std::map<std::pair<int, int>, str> Gambit::Models::partmap::pdg_pair_to_long_name
private

Map from PDG code and context integer to long name.

Definition at line 235 of file partmap.hpp.

Referenced by add(), check_contents(), has_particle(), and long_name().

◆ pdg_pair_to_short_name_pair

std::map<std::pair<int, int>, std::pair<str, int> > Gambit::Models::partmap::pdg_pair_to_short_name_pair
private

Map from PDG code and context integer to short name and index.

Definition at line 239 of file partmap.hpp.

Referenced by add_with_short_pair(), check_contents(), has_short_name(), and short_name_pair().

◆ short_name_pair_to_long_name

std::map<std::pair<str, int>, str> Gambit::Models::partmap::short_name_pair_to_long_name
private

Map from short name and index to long name.

Definition at line 243 of file partmap.hpp.

Referenced by add_with_short_pair(), check_contents(), and long_name().

◆ short_name_pair_to_pdg_pair

std::map<std::pair<str, int>, std::pair<int, int> > Gambit::Models::partmap::short_name_pair_to_pdg_pair
private

Map from short name and index to PDG code and context integer.

Definition at line 237 of file partmap.hpp.

Referenced by add_with_short_pair(), check_contents(), has_particle(), and pdg_pair().

◆ SM

std::vector<std::pair<int, int> > Gambit::Models::partmap::SM
private

All SM particles in the database, by PDG code and context integer.

Definition at line 229 of file partmap.hpp.

Referenced by add_SM(), add_SM_with_short_pair(), and get_SM_particles().


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