29 m_Virial.resize(m_densities.size(), vector<double>(m_densities.size(), 0.));
31 m_TAG =
"ThermalModelVDWCanonicalStrangeness";
34 m_InteractionModel =
QvdW;
46 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
50 m_GCECalculated =
true;
58 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
69 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
82 vector<double> xi(3, 0.), yi(3, 0.);
84 for (
size_t i = 0; i <
m_StrVals.size(); ++i) {
86 for (
int j = 0; j < m_TPS->ComponentsNumber(); ++j)
87 if (
m_StrVals[i] == m_TPS->Particles()[j].Strangeness())
91 for (
int i = 0; i < 3; ++i) {
99 for (
unsigned int i = 0; i <
m_StrVals.size(); ++i) {
102 for (
int m = -iters; m <= iters; ++m)
103 for (
int n = -iters; n <= iters; ++n) {
107 pow(yi[0],
m_StrVals[i] - 3 * m - 2 * n) *
110 if (tmp != tmp)
continue;
119 assert(m_IGFExtraConfig.MagneticField.B == 0.);
121 m_FluctuationsCalculated =
false;
130 std::vector<double> Vcs(m_TPS->Particles().size(), 0.);
131 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i)
136 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
137 if (
m_StrMap.count(-m_TPS->Particles()[i].Strangeness()))
143 printf(
"%s%lf\n",
"PS/P = ", (tP -
m_PNS) / tP);
148 m_LastCalculationSuccessFlag =
true;
164 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i)
165 if (m_TPS->Particles()[i].Strangeness() != 0)
166 if (
m_StrMap.count(-m_TPS->Particles()[i].Strangeness()))
182 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i)
183 if (m_TPS->Particles()[i].Strangeness() != 0)
184 if (
m_StrMap.count(-m_TPS->Particles()[i].Strangeness()))
198 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i)
199 if (m_TPS->Particles()[i].Strangeness() != 0)
200 if (
m_StrMap.count(-m_TPS->Particles()[i].Strangeness()))
207 if (
id >= 0. &&
id <
static_cast<int>(
m_Virial.size()))
221 for (
size_t i = 0; i < TPSnew->
Particles().size(); ++i) {
237 std::vector<double> PidNS(
m_modelVDW->Densities().size(), 0.);
238 for (
size_t j = 0; j <
m_modelVDW->Densities().size(); ++j) {
245 m_MuStar.resize(TPS()->Particles().size());
248 for (
size_t j = 0; j <
m_modelVDW->Densities().size(); ++j) {
253 for (
size_t j = 0; j <
m_modelVDW->Densities().size(); ++j) {
273 if (ri.size() != m_TPS->Particles().size()) {
274 throw std::invalid_argument(m_TAG +
"::FillVirial(const std::vector<double> & ri): size of ri does not match number of hadrons in the list");
276 m_Virial.resize(m_TPS->Particles().size());
277 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
278 m_Virial[i].resize(m_TPS->Particles().size());
279 for (
int j = 0; j < m_TPS->ComponentsNumber(); ++j)
284 std::vector< std::vector<double> > fVirialTmp =
m_Virial;
285 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i)
286 for (
int j = 0; j < m_TPS->ComponentsNumber(); ++j) {
287 if (i == j)
m_Virial[i][j] = fVirialTmp[i][j];
288 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]);
294 if (bij.size() != m_TPS->Particles().size()) {
295 throw std::invalid_argument(m_TAG +
"::FillVirialEV(const std::vector<double> & bij): size of bij does not match number of hadrons in the list");
302 if (aij.size() != m_TPS->Particles().size()) {
303 throw std::invalid_argument(m_TAG +
"::FillAttraction(const std::vector<double> & aij): size of aij does not match number of hadrons in the list");
310 m_Virial = std::vector< std::vector<double> >(m_TPS->Particles().size(), std::vector<double>(m_TPS->Particles().size(), 0.));
311 m_Attr = std::vector< std::vector<double> >(m_TPS->Particles().size(), std::vector<double>(m_TPS->Particles().size(), 0.));
313 ifstream fin(filename.c_str());
316 fin.getline(cc, 2000);
317 string tmp = string(cc);
319 if (elems.size() < 1)
321 istringstream iss(elems[0]);
324 if (iss >> pdgid1 >> pdgid2 >> b) {
327 int ind1 = m_TPS->PdgToId(pdgid1);
328 int ind2 = m_TPS->PdgToId(pdgid2);
329 if (ind1 != -1 && ind2 != -1) {
340 ofstream fout(filename.c_str());
341 for (
int i = 0; i < m_TPS->ComponentsNumber(); ++i) {
342 for (
int j = 0; j < m_TPS->ComponentsNumber(); ++j) {
343 fout << std::setw(15) << m_TPS->Particle(i).PdgId();
344 fout << std::setw(15) << m_TPS->Particle(j).PdgId();
345 fout << std::setw(15) <<
m_Virial[i][j];
346 fout << std::setw(15) <<
m_Attr[i][j];
355 if (i < 0 || i >=
static_cast<int>(
m_Virial.size()) || j < 0 || j >=
static_cast<int>(
m_Virial.size()))
362 if (i < 0 || i >=
static_cast<int>(
m_Attr.size()) || j < 0 || j >=
static_cast<int>(
m_Attr.size()))
Contains some functions to deal with excluded volumes.
map< string, double > params
@ QvdW
Quantum van der Waals model.
virtual void CalculateFeeddown()
Calculates the total densities which include feeddown contributions.
virtual void CalculateDensities()
Calculates the primordial and total (after decays) densities of all species.
@ SCE
Strangeness-canonical ensemble.
std::vector< double > m_Zsum
ThermalModelCanonicalStrangeness(ThermalParticleSystem *TPS, const ThermalModelParameters ¶ms=ThermalModelParameters())
Construct a new ThermalModelCanonicalStrangeness object.
std::vector< int > m_StrVals
std::map< int, int > m_StrMap
std::vector< double > m_partialS
std::vector< double > m_pressuresGCE
std::vector< double > m_densitiesGCE
std::vector< double > m_energydensitiesGCE
virtual bool IsConservedChargeCanonical(ConservedCharge::Name charge) const
void ClearModelVDW()
Clears m_modelVDW.
std::vector< double > m_MuStar
virtual void WriteInteractionParameters(const std::string &filename)
Write the QvdW interaction parameters to a file.
virtual double MuShift(int id) const
The shift in the chemical potential of particle species i due to the QvdW interactions.
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 CalculateSums(const std::vector< double > &Vcs)
Calculates the necessary strangeness-canonical partition functions.
double VirialCoefficient(int i, int j) const
Excluded volume coefficient .
virtual void CalculateDensitiesGCE()
Calculates the particle densities in a grand-canonical ensemble.
virtual void CalculatePrimordialDensities()
Calculates the primordial densities of all species.
virtual double CalculateEntropyDensity()
virtual double CalculatePressure()
double AttractionCoefficient(int i, int j) const
QvdW mean field attraction coefficient .
virtual double CalculateEnergyDensity()
std::vector< std::vector< double > > m_Virial
ThermalModelVDWFull * m_modelVDW
virtual void CalculatePressuresGCE()
Calculates the grand-canonical pressures.
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.
ThermalModelVDWCanonicalStrangeness(ThermalParticleSystem *TPS, const ThermalModelParameters ¶ms=ThermalModelParameters())
Construct a new Thermal ModelEVCanonicalStrangeness object.
std::vector< std::vector< double > > m_Attr
void FillAttraction(const std::vector< std::vector< double > > &aij=std::vector< std::vector< double > >(0))
std::vector< double > m_Suppression
virtual void CalculateEnergyDensitiesGCE()
Calculates the grand-canonical energy densities.
virtual void ReadInteractionParameters(const std::string &filename)
Reads the QvdW interaction parameters from a file.
virtual ~ThermalModelVDWCanonicalStrangeness(void)
Destroy the ThermalModelEVCanonicalStrangeness object.
Class containing all information about a particle specie.
int Strangeness() const
Particle's strangeness.
void SetDegeneracy(double deg)
Set particle's internal degeneracy factor.
Class containing the particle list.
const std::vector< ThermalParticle > & Particles() const
Returns the vector of all particle species.
const ThermalParticle & Particle(int id) const
ThermalParticle object corresponding to particle species with a provided 0-based index.
std::vector< std::string > split(const std::string &s, char delim)
double brr(double r1, double r2)
Computes the symmetric 2nd virial coefficient of the classical hard spheres equation of state from t...
double BesselI(int n, double x)
Integer order modified Bessel function I_n(x)
The main namespace where all classes and functions of the Thermal-FIST library reside.
ThermalModelVDW ThermalModelVDWFull
For backward compatibility.
Name
Set of all conserved charges considered.
@ StrangenessCharge
Strangeness.
Structure containing all thermal parameters of the model.
Contains some extra mathematical functions used in the code.