29 m_TAG =
"ThermalModelVDWCanonicalStrangeness";
80 vector<double> xi(3, 0.), yi(3, 0.);
82 for (
size_t i = 0; i <
m_StrVals.size(); ++i) {
89 for (
int i = 0; i < 3; ++i) {
97 for (
unsigned int i = 0; i <
m_StrVals.size(); ++i) {
100 for (
int m = -iters; m <= iters; ++m)
101 for (
int n = -iters; n <= iters; ++n) {
105 pow(yi[0],
m_StrVals[i] - 3 * m - 2 * n) *
108 if (tmp != tmp)
continue;
139 printf(
"%s%lf\n",
"PS/P = ", (tP -
m_PNS) / tP);
203 if (
id >= 0. &&
id < static_cast<int>(
m_Virial.size()))
217 for (
size_t i = 0; i < TPSnew->
Particles().size(); ++i) {
270 printf(
"**WARNING** %s::FillVirial(const std::vector<double> & ri): size of ri does not match number of hadrons in the list",
m_TAG.c_str());
281 std::vector< std::vector<double> > fVirialTmp =
m_Virial;
284 if (i == j)
m_Virial[i][j] = fVirialTmp[i][j];
285 else if ((fVirialTmp[i][i] + fVirialTmp[j][j]) > 0.0)
m_Virial[i][j] = 2. * fVirialTmp[i][j] * fVirialTmp[i][i] / (fVirialTmp[i][i] + fVirialTmp[j][j]);
292 printf(
"**WARNING** %s::FillVirialEV(const std::vector<double> & bij): size of bij does not match number of hadrons in the list",
m_TAG.c_str());
301 printf(
"**WARNING** %s::FillAttraction(const std::vector<double> & aij): size of aij does not match number of hadrons in the list",
m_TAG.c_str());
312 ifstream fin(filename.c_str());
315 fin.getline(cc, 2000);
316 string tmp = string(cc);
318 if (elems.size() < 1)
320 istringstream iss(elems[0]);
323 if (iss >> pdgid1 >> pdgid2 >> b) {
328 if (ind1 != -1 && ind2 != -1) {
330 m_Attr[ind1][ind2] = a;
339 ofstream fout(filename.c_str());
344 fout << std::setw(15) <<
m_Virial[i][j];
345 fout << std::setw(15) <<
m_Attr[i][j];
354 if (i < 0 || i >= static_cast<int>(
m_Virial.size()) || j < 0 || j >= static_cast<int>(
m_Virial.size()))
361 if (i < 0 || i >= static_cast<int>(
m_Attr.size()) || j < 0 || j >= static_cast<int>(
m_Attr.size()))
std::map< int, int > m_StrMap
std::vector< std::string > split(const std::string &s, char delim)
std::vector< double > m_Chem
Quantum van der Waals model.
const std::vector< double > & Densities() const
virtual void SetChemicalPotentials(const std::vector< double > &chem=std::vector< double >(0))
Sets the chemical potentials of all particles.
double VirialCoefficient(int i, int j) const
Excluded volume coefficient .
virtual double CalculateEntropyDensity()
virtual void CalculateSums(const std::vector< double > &Vcs)
Calculates the necessary strangeness-canonical partition functions.
const ThermalParticle & Particle(int id) const
ThermalParticle object corresponding to particle species with a provided 0-based index.
virtual void CalculatePressuresGCE()
Calculates the grand-canonical pressures.
bool m_FluctuationsCalculated
double AttractionCoefficient(int i, int j) const
QvdW mean field attraction coefficient .
void FillVirialEV(const std::vector< std::vector< double > > &bij=std::vector< std::vector< double > >(0))
Same as FillVirial() but uses the matrix of excluded-volume coefficients as input instead of radii...
void SetUseWidth(bool useWidth)
Sets whether finite resonance widths are used. Deprecated.
int PdgToId(long long pdgid)
Transforms PDG ID to a 0-based particle id number.
Class implementing the ideal HRG model with exact conservation of strangeness (strangeness-canonical ...
void FillAttraction(const std::vector< std::vector< double > > &aij=std::vector< std::vector< double > >(0))
long long PdgId() const
Particle's Particle Data Group (PDG) ID number.
Class containing the particle list.
virtual void SetParameters(const ThermalModelParameters ¶ms)
The thermal parameters.
std::vector< double > m_MuStar
ThermalModelParameters m_Parameters
std::vector< std::vector< double > > m_Virial
Structure containing all thermal parameters of the model.
void ClearModelVDW()
Clears m_modelVDW.
int ComponentsNumber() const
Number of different particle species in the list.
virtual double MuShift(int id) const
The shift in the chemical potential of particle species i due to the QvdW interactions.
virtual void CalculatePrimordialDensities()
Calculates the primordial densities of all species.
std::vector< double > m_Suppression
virtual bool IsConservedChargeCanonical(ConservedCharge::Name charge) const
Whether the given conserved charge is treated canonically.
virtual void WriteInteractionParameters(const std::string &filename)
Write the QvdW interaction parameters to a file.
Contains some extra mathematical functions used in the code.
ThermalParticleSystem * m_TPS
std::vector< double > m_pressuresGCE
double BesselI(int n, double x)
integer order modified Bessel function I_n(x)
std::vector< double > m_energydensitiesGCE
virtual ~ThermalModelVDWCanonicalStrangeness(void)
Destroy the ThermalModelEVCanonicalStrangeness object.
virtual void CalculateEnergyDensitiesGCE()
Calculates the grand-canonical energy densities.
Class containing all information about a particle specie.
std::vector< std::vector< double > > m_Attr
std::vector< int > m_StrVals
double brr(double r1, double r2)
Computes the symmetric 2nd virial coefficient of the classical hard spheres equation of state from t...
const std::vector< ThermalParticle > & Particles() const
Returns the vector of all particle species.
double MuStar(int i) const
The shifted chemical potential of particle species i.
std::vector< double > m_partialS
ThermalModelInteraction m_InteractionModel
Contains some functions do deal with excluded volumes.
Name
Set of all conserved charges considered.
bool UseWidth() const
Whether finite resonance widths are considered.
std::vector< double > m_Zsum
virtual double CalculateEnergyDensity()
virtual double CalculateEntropyDensity()
virtual void CalculateDensities()
Calculates the primordial and total (after decays) densities of all species.
virtual double CalculatePressure()
Implementation of the equation of state functions.
std::vector< double > m_densities
virtual double CalculatePressure()
Implementation of the equation of state functions.
void SetDegeneracy(double deg)
Set particle's internal degeneracy factor.
Strangeness-canonical ensemble.
ThermalModelEnsemble m_Ensemble
virtual void CalculateFeeddown()
Calculates the total densities which include feeddown contributions.
ThermalModelVDW ThermalModelVDWFull
For backward compatibility.
void FillVirial(const std::vector< double > &ri=std::vector< double >(0))
Fills the excluded volume coefficients based on the provided radii parameters for all species...
virtual void ReadInteractionParameters(const std::string &filename)
Reads the QvdW interaction parameters from a file.
int Strangeness() const
Particle's strangeness.
ThermalModelVDWFull * m_modelVDW
const ThermalModelParameters & Parameters() const
std::vector< double > m_densitiesGCE
virtual void CalculateDensitiesGCE()
Calculates the particle densities in a grand-canonical ensemble.
bool m_LastCalculationSuccessFlag
The main namespace where all classes and functions of the Thermal-FIST library reside.
virtual double CalculateEnergyDensity()
ThermalParticleSystem * TPS()
void FillVirialEV(const std::vector< std::vector< double > > &bij=std::vector< std::vector< double > >(0))
Same as FillVirial() but uses the matrix of excluded-volume coefficients as input instead of radii...
void SetVolume(double Volume)
Sets the system volume.
void FillAttraction(const std::vector< std::vector< double > > &aij=std::vector< std::vector< double > >(0))