Version: SMASH-2.0
smash::KaonNucleonRatios Class Reference

#include <parametrizations.h>

Calculate and store isospin ratios for K N -> K Delta reactions.

The ratios are given by the squared Clebsch-Gordan coefficient for the respective reaction, divided by the sum of the squared coefficients of all possible isospin-symmetric reactions. They are used when calculating the corresponding cross sections from the parametrizations of experimental data.

Definition at line 459 of file parametrizations.h.

Collaboration diagram for smash::KaonNucleonRatios:
[legend]

Public Member Functions

 KaonNucleonRatios ()
 Create an empty K N -> K Delta isospin ratio storage. More...
 
double get_ratio (const ParticleType &a, const ParticleType &b, const ParticleType &c, const ParticleType &d) const
 Return the isospin ratio of the given K N -> K Delta cross section. More...
 

Private Attributes

std::unordered_map< std::pair< uint64_t, uint64_t >, double, pair_hashratios_
 Internal representation of isospin weights once calculated. More...
 

Constructor & Destructor Documentation

◆ KaonNucleonRatios()

smash::KaonNucleonRatios::KaonNucleonRatios ( )
inline

Create an empty K N -> K Delta isospin ratio storage.

Definition at line 467 of file parametrizations.h.

467 : ratios_({}) {}

Member Function Documentation

◆ get_ratio()

double smash::KaonNucleonRatios::get_ratio ( const ParticleType a,
const ParticleType b,
const ParticleType c,
const ParticleType d 
) const

Return the isospin ratio of the given K N -> K Delta cross section.

On the first call all ratios are calculated.

Definition at line 641 of file parametrizations.cc.

644  {
645  /* If this method is called with anti-nucleons, flip all particles to
646  * anti-particles;
647  * the ratio is equal */
648  int flip = 0;
649  for (const auto& p : {&a, &b, &c, &d}) {
650  if (p->is_nucleon()) {
651  if (flip == 0) {
652  flip = p->antiparticle_sign();
653  } else {
654  assert(p->antiparticle_sign() == flip);
655  }
656  }
657  }
658  const auto key = std::make_pair(
659  pack(a.pdgcode().code() * flip, b.pdgcode().code() * flip),
660  pack(c.pdgcode().code() * flip, d.pdgcode().code() * flip));
661  if (ratios_.empty()) {
663  }
664  return ratios_.at(key);
665 }
Here is the call graph for this function:
Here is the caller graph for this function:

Member Data Documentation

◆ ratios_

std::unordered_map<std::pair<uint64_t, uint64_t>, double, pair_hash> smash::KaonNucleonRatios::ratios_
mutableprivate

Internal representation of isospin weights once calculated.

Definition at line 463 of file parametrizations.h.


The documentation for this class was generated from the following files:
smash::initialize
static void initialize(std::unordered_map< std::pair< uint64_t, uint64_t >, double, pair_hash > &ratios)
Calculate and store isospin ratios for K N -> K Delta reactions.
Definition: parametrizations.cc:572
smash::KaonNucleonRatios::ratios_
std::unordered_map< std::pair< uint64_t, uint64_t >, double, pair_hash > ratios_
Internal representation of isospin weights once calculated.
Definition: parametrizations.h:463
smash::pdg::p
constexpr int p
Proton.
Definition: pdgcode_constants.h:28
smash::pack
constexpr uint64_t pack(int32_t x, int32_t y)
Pack two int32_t into an uint64_t.
Definition: pdgcode_constants.h:107