29 m_modelHRG->SetStrangenessChemicalPotential(0.);
39 double l = -(51. / 28.) * b;
47 vector<long long> pdgs = {22,
54 std::vector<ThermalParticle *> parts = {
59 std::vector<double> degeneracies = {
60 2., 2., 2., 2., 1., 1., 1.
63 for (
int ipdg = 0; ipdg < pdgs.size(); ++ipdg) {
64 long long pdg = pdgs[ipdg];
72 m_modelHRG->TPS()->ParticleByPDG(pdg).SetDegeneracy(0.);
74 m_modelHRG->TPS()->ParticleByPDG(-pdg).SetDegeneracy(0.);
76 if (parts[ipdg]->Degeneracy() == 0)
77 parts[ipdg]->SetDegeneracy(degeneracies[ipdg]);
108 m_modelHRG->SetElectricChemicalPotential(muQ);
124 for (
int iL = 0; iL < 3; ++iL) {
150 for (
int iL = 0; iL < 3; ++iL) {
175 for (
int iL = 0; iL < 3; ++iL) {
223 if (!absolute)
return m_modelHRG->BaryonDensity();
224 else return m_modelHRG->AbsoluteBaryonDensity();
237 for (
int iL = 0; iL < 3; ++iL) {
248 if (!absolute) ret =
m_modelHRG->ElectricChargeDensity();
249 else ret =
m_modelHRG->AbsoluteElectricChargeDensity();
257 for (
int ipart = 0; ipart <
HRGModel()->TPS()->Particles().size(); ++ipart) {
260 iso_chg = abs(iso_chg);
261 nI += iso_chg *
HRGModel()->Densities()[ipart];
277 int iL =
static_cast<int>(flavor);
311 return m_modelHRG->TPS()->Particle(pionid).Mass();
320 HRGModel()->TPS()->ParticleByPDG(211).SetGeneralizedDensity(
322 HRGModel()->TPS()->ParticleByPDG(211),
325 HRGModel()->TPS()->ParticleByPDG(111).SetGeneralizedDensity(
327 HRGModel()->TPS()->ParticleByPDG(111),
330 HRGModel()->TPS()->ParticleByPDG(-211).SetGeneralizedDensity(
332 HRGModel()->TPS()->ParticleByPDG(-211),
343 return HRGModel()->TPS()->ParticleByPDG(211).GetGeneralizedDensity()->IsBECPhase()
344 ||
HRGModel()->TPS()->ParticleByPDG(111).GetGeneralizedDensity()->IsBECPhase()
345 ||
HRGModel()->TPS()->ParticleByPDG(-211).GetGeneralizedDensity()->IsBECPhase();
369 throw std::out_of_range(
"CosmicEoS::GetSpeciesName: id = " + std::to_string(
id) +
" is out of range!");
395 throw std::out_of_range(
"CosmicEoS::GetDensity: id = " + std::to_string(
id) +
" is out of range!");
403 for (
auto& part :
m_modelHRG->TPS()->Particles()) {
404 part.ClearGeneralizedDensity();
410 std::vector<double> ret(x.size(), 0.);
415 m_THM->SetBaryonChemicalPotential(muB);
416 m_THM->SetElectricChemicalPotential(muQ);
420 m_THM->SetLeptonChemicalPotential(flavor, x[2 + iL]);
423 m_THM->CalculatePrimordialDensities();
426 vector<double> constraints = m_THM->m_Asymmetries;
428 double s = m_THM->EntropyDensity();
429 double nB = m_THM->BaryonDensity();
431 if (constraints[0] != 0.0)
432 ret[0] = (nB / s - constraints[0]) / constraints[0];
434 ret[0] = nB / m_THM->BaryonDensity(
true);
436 double nQ = m_THM->ElectricChargeDensity();
438 if (constraints[1] != 0.0)
439 ret[1] = (nQ / s - constraints[1]) / constraints[1];
443 ret[1] = nQ / m_THM->ElectricChargeDensity(
true);
450 nLs[iL] = m_THM->LeptonFlavorDensity(flavor);
452 if (constraints[2 + iL] != 0.0)
453 ret[2 + iL] = (nLs[iL] / s - constraints[2 + iL]) / constraints[2 + iL];
455 ret[2 + iL] = nLs[iL] / m_THM->LeptonFlavorDensity(flavor,
true);
Sub-class where it is determined whether the required accuracy is achieved in the Broyden's method.
Class implementing the Broyden method to solve a system of non-linear equations.
virtual std::vector< double > Solve(const std::vector< double > &x0, BroydenSolutionCriterium *solcrit=NULL, int max_iterations=MAX_ITERS)
Class implementing the Broyden equations for cosmology.
std::vector< double > Equations(const std::vector< double > &x)
Implements the equations to be solved.
double PressureHRG()
Calculates the partial pressure of the HRG part.
std::string GetSpeciesName(int id) const
Gets the name of particle species of given id.
bool m_InteractingPions
Whether to include pion interactions.
std::vector< double > SolveChemicalPotentials(double T, const std::vector< double > &muInit=std::vector< double >())
Calculates the values of the chemical potential (B,Q,{L}) that satisfy the given asymmetry constraint...
double EnergyDensity()
Calculates the total energy density.
virtual void SetElectricChemicalPotential(double muQ)
Set the electric chemical potential.
std::vector< ThermalParticle > m_Neutrinos
Neutrinos.
ThermalParticle m_Photon
Photons.
static double fpi
Pion decay constant for pion interactions a la ChPT.
double EntropyDensityHRG()
Calculates the entropy density of the HRG part.
std::vector< double > m_Asymmetries
Vector of asymmetries (baryon, charge, lepton flavors)
CosmicEoS(ThermalModelBase *THMbase, bool pionsinteract=false)
Constructor.
std::vector< double > m_ChemCurrent
Vector of chemical potentials (baryon, charge, lepton flavors)
double ElectricChargeDensity(bool absolute=false)
Calculates the electric charge density.
ThermalModelBase * HRGModel() const
Gets the pointer to the HRG model object.
double PressureChargedLepton(int iL)
Calculates the partial pressure of charged lepton flavor.
std::vector< ThermalParticle > m_ChargedLeptons
Charged leptons.
double EnergyDensityHRG()
Calculates the energy density of the HRG part.
bool InPionCondensedPhase() const
Checks if the system has non-zero BEC of pions.
double ElectricChargeDensityHRG(bool absolute=false)
Calculates the electric charge density of the HRG part.
void SetPionsInteracting(bool pionsinteract=true, double fpiChPT=fpi)
Sets whether to include pion interactions via effective mass model.
virtual void SetTemperature(double T)
Set the temperature.
double EnergyDensityChargedLepton(int iL)
Calculates the energy density of charged lepton flavor.
void CalculatePrimordialDensities()
Calculates number densities of all particle species.
double NetDensityChargedLepton(int iL)
Calculates the net density of charged lepton flavor.
void ClearEMMs()
Clears the effective mass models.
double BaryonDensity(bool absolute=false)
Calculates the total baryon density.
double GetPionMass() const
Gets the mass of pi+.
double Pressure()
Calculates the total pressure.
bool InteractingPions() const
Checks if pions are interacting in the model.
double ElectricChemicalPotential() const
Gets the current electric chemical potential.
double LeptonFlavorDensity(LeptonFlavor::Name flavor, bool absolute=false)
Calculates the lepton flavor density.
double EntropyDensity()
Calculates the total entropy density.
ThermalModelBase * m_modelHRG
Pointer to an HRG model object.
double IsospinChargeDensity(bool absolute=false)
Calculates the isospin charge density.
double GetDensity(int id) const
Gets the number density for given species.
double m_T
Temperature in GeV.
Effective mass model matched to chiral perturbation theory for pions at T = 0. See supplemental mater...
Class implementing an effective mass model for single particle species.
Abstract base class for an HRG model implementation.
Class containing all information about a particle specie.
int BaryonCharge() const
Particle's baryon number.
int Strangeness() const
Particle's strangeness.
int ElectricCharge() const
Particle's electric charge.
int Charm() const
Particle's charm.
const ThermalParticle & ParticleByPdg(long long pdg)
The main namespace where all classes and functions of the Thermal-FIST library reside.
double IsospinCharge(const ThermalParticle &part)
Calculates the isospin charge of a particle.
static const int NumberOfFlavors
Number of lepton flavors.
static double m_mu
Muon mass.
Name
Set of all conserved charges considered.
static double m_e
Electron mass.
static double m_tau
Tauon mass.