An example of doing partial chemical equilibrium HRG model calculations at the LHC energies using Thermal-FIST
Calculates the evolution of the non-equilibrium chemical potentials (fugacities) and various particle ratios in the hadronic phase of 0-10% central 2.76 TeV Pb-Pb collisions at the LHC.
The particle yield ratios at each temperature are written to a file ‘PCE.LHC.Ratios.dat’.
The abundances of light nuclei are calculated using the Saha equation.
The source code can be modified to obtain other particle yields, to change the particle list or or the HRG model type (e.g. an excluded volume HRG instead of an ideal HRG), or to explore other collision energies.
#include <string.h>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdio>
#include "ThermalFISTConfig.h"
using namespace std;
#ifdef ThermalFIST_USENAMESPACE
#endif
int main(
int argc,
char *argv[])
{
params_chemical_freezeout.
T = 0.155;
params_chemical_freezeout.
muB = 0.;
params_chemical_freezeout.
V = 4700.;
vector<long long> pdgcodes_stable;
pdgcodes_stable.push_back(211);
pdgcodes_stable.push_back(321);
pdgcodes_stable.push_back(2212);
pdgcodes_stable.push_back(3122);
pdgcodes_stable.push_back(3222);
pdgcodes_stable.push_back(3312);
pdgcodes_stable.push_back(3334);
vector< pair<long long, long long> > ratios;
ratios.push_back(make_pair(1000010020, 2212));
ratios.push_back(make_pair(1000020030, 2212));
ratios.push_back(make_pair(1000010030, 2212));
ratios.push_back(make_pair(1000020040, 2212));
ratios.push_back(make_pair(1010010030, 2212));
ratios.push_back(make_pair(1010010040, 2212));
ratios.push_back(make_pair(313, -321));
ratios.push_back(make_pair(113, 211));
ratios.push_back(make_pair(3124, 3122));
ratios.push_back(make_pair(9010221, 211));
ratios.push_back(make_pair(2224, 2212));
FILE* fout_params = fopen("PCE.LHC.Parameters.dat", "w");
fprintf(fout_params, "%15s %15s %15s ", "T[MeV]", "V/Vch", "S/Sch");
for (int i = 0; i < pdgcodes_stable.size(); ++i) {
fprintf(fout_params,
"%15s ", (
"mu_" +
string(parts.
ParticleByPDG(pdgcodes_stable[i]).
Name())).c_str());
}
fprintf(fout_params, "\n");
FILE* fout_ratios = fopen("PCE.LHC.Ratios.dat", "w");
fprintf(fout_ratios, "%15s ", "T[MeV]");
for (int i = 0; i < ratios.size(); ++i) {
}
fprintf(fout_ratios, "\n");
double T0 = params_chemical_freezeout.
T;
double dT = 0.001;
double Tmin = 0.070;
double entropy_chemical_freezeout = modelpce.
ThermalModel()->EntropyDensity() * params_chemical_freezeout.
V;
for (double T = T0; T >= Tmin - 1.e-9; T -= dT) {
printf("T = %lf MeV\n", T * 1.e3);
fprintf(fout_params, "%15lf %15lf %15lf ",
T * 1.e3,
);
for (int i = 0; i < pdgcodes_stable.size(); ++i) {
fprintf(fout_params, "%15lf ",
);
}
fprintf(fout_params, "\n");
fprintf(fout_ratios, "%15lf ", T * 1.e3);
for (int i = 0; i < ratios.size(); ++i) {
fprintf(fout_ratios, "%15E ",
}
fprintf(fout_ratios, "\n");
}
fclose(fout_params);
fclose(fout_ratios);
return 0;
}
int main(int argc, char *argv[])
virtual void FillChemicalPotentials()
Sets the chemical potentials of all particles.
void ConstrainChemicalPotentials(bool resetInitialValues=true)
Constrains the chemical potentials by the conservation laws imposed.
virtual void SetParameters(const ThermalModelParameters ¶ms)
The thermal parameters.
const ThermalModelParameters & Parameters() const
double Volume() const
System volume (fm )
Class implementing the Ideal HRG model.
Class implementing HRG in partial chemical equilibrium.
void SetChemicalFreezeout(const ThermalModelParameters ¶ms, const std::vector< double > &ChemInit=std::vector< double >(0))
Sets the chemical freeze-out conditions to be used as an initial condition for PCE calculations.
void FreezeLonglivedResonances(bool flag)
Whether long-lived resonances yields should be frozen.
const std::vector< double > & ChemicalPotentials() const
void UseSahaForNuclei(bool flag)
Whether the nuclear abundances are evaluated through the Saha equation.
ThermalModelBase * ThermalModel() const
Pointer to the HRG model used in calculations.
virtual void CalculatePCE(double param, PCEMode mode=AtFixedTemperature)
Solves the equations of partial chemical equilibrium at a fixed temperature or a fixed volume.
const std::string & Name() const
Particle's name.
Class containing the particle list.
int PdgToId(long long pdgid) const
Transforms PDG ID to a 0-based particle id number.
const ThermalParticle & ParticleByPDG(long long pdgid) const
ThermalParticle object corresponding to particle species with a provided PDG ID.
The main namespace where all classes and functions of the Thermal-FIST library reside.
@ Electromagnetic
Feeddown from strong and electromagnetic decays.
Structure containing all thermal parameters of the model.