Thermal-FIST 1.5
Package for hadron resonance gas model applications
Loading...
Searching...
No Matches
PCE-Saha-LHC.cpp
Go to the documentation of this file.
1/*
2 * Thermal-FIST package
3 *
4 * Copyright (c) 2014-2020 Volodymyr Vovchenko
5 *
6 * GNU General Public License (GPLv3 or later)
7 */
8#include <string.h>
9#include <fstream>
10#include <iostream>
11#include <iomanip>
12#include <ctime>
13#include <cstdio>
14
15#include "HRGBase.h"
16#include "HRGEV.h"
17#include "HRGFit.h"
18#include "HRGVDW.h"
19#include "HRGPCE.h"
20
21#include "ThermalFISTConfig.h"
22
23using namespace std;
24
25#ifdef ThermalFIST_USENAMESPACE
26using namespace thermalfist;
27#endif
28
29// This is an example of doing PCE-HRG model calculations at the LHC energies using Thermal-FIST
30// Usage: PCE-Saha-LHC
31int main(int argc, char *argv[])
32{
33 // The default particle list. As of version 1.3 this is PDG2020 list including light nuclei
34 ThermalParticleSystem parts(ThermalFIST_DEFAULT_LIST_FILE);
35
36 // To include excited nuclei use the following line instead
37 //ThermalParticleSystem parts(string(ThermalFIST_INPUT_FOLDER) + "/list/PDG2020/list-withexcitednuclei.dat");
38
39 // To reproduce arXiv:1903.10024 use the PDG2014 list
40 //ThermalParticleSystem TPS(string(ThermalFIST_INPUT_FOLDER) + "/list/PDG2014/list-withnuclei.dat");
41
42 // Use ideal HRG model
43 ThermalModelIdeal model(&parts);
44
45 // PCE-HRG model
46 ThermalModelPCE modelpce(&model);
47 modelpce.UseSahaForNuclei(true); // Light nuclei evaluated using the Saha equation (arXiv:1903.10024)
48 modelpce.FreezeLonglivedResonances(false); // All strongly decaying resonance are in partial equilibrium
49
50 // Chemical freeze-out conditions: 2.76 TeV 0-10% Pb-Pb collisions
51 ThermalModelParameters params_chemical_freezeout;
52 params_chemical_freezeout.T = 0.155; // Temperature in GeV
53 params_chemical_freezeout.muB = 0.;
54 params_chemical_freezeout.V = 4700.; // Volume in fm^3
55
56 model.SetParameters(params_chemical_freezeout);
57
58 // For finite baryon density: constrain muQ and muS
60 params_chemical_freezeout = model.Parameters();
61
62 model.FillChemicalPotentials(); // Fills chemical potentials for all species at Tch
63
64 // Set the chemical freeze-out as an "initial" condition for PCE
65 modelpce.SetChemicalFreezeout(params_chemical_freezeout);
66
67 // The list of chemical potentials for output, coded by the pdg code
68 vector<long long> pdgcodes_stable;
69 pdgcodes_stable.push_back(211); // pions (pi+)
70 pdgcodes_stable.push_back(321); // kaons (K+)
71 pdgcodes_stable.push_back(2212); // protons (p+)
72 pdgcodes_stable.push_back(3122); // Lambdas
73 pdgcodes_stable.push_back(3222); // Sigma+
74 pdgcodes_stable.push_back(3312); // Xi-
75 pdgcodes_stable.push_back(3334); // Omega
76
77 // The list of yield ratios to output
78 vector< pair<long long, long long> > ratios;
79 // First the nuclei
80 ratios.push_back(make_pair(1000010020, 2212)); // d/p
81 ratios.push_back(make_pair(1000020030, 2212)); // He3/p
82 ratios.push_back(make_pair(1000010030, 2212)); // H3/p
83 ratios.push_back(make_pair(1000020040, 2212)); // He4/p
84 ratios.push_back(make_pair(1010010030, 2212)); // Hypertriton/p
85 ratios.push_back(make_pair(1010010040, 2212)); // HyperHydrogen4/p
86 // Now the resonances
87 ratios.push_back(make_pair(313, -321)); // K^*0 / K^-
88 ratios.push_back(make_pair(113, 211)); // rho^0/ pi^+
89 ratios.push_back(make_pair(3124, 3122)); // \Lambda(1520)/\Lambda
90 ratios.push_back(make_pair(9010221, 211)); // f0(980) / pi^+
91 ratios.push_back(make_pair(2224, 2212)); // \Delta(1232)++/p
92
93 // Preparing the output files
94 // The file to output the parameters (volume, entropy, chemical potentials)
95 FILE* fout_params = fopen("PCE.LHC.Parameters.dat", "w");
96 fprintf(fout_params, "%15s %15s %15s ", "T[MeV]", "V/Vch", "S/Sch");
97 for (int i = 0; i < pdgcodes_stable.size(); ++i) {
98 fprintf(fout_params, "%15s ", ("mu_" + string(parts.ParticleByPDG(pdgcodes_stable[i]).Name())).c_str());
99 }
100 fprintf(fout_params, "\n");
101
102 // The file to output the yield ratios
103 FILE* fout_ratios = fopen("PCE.LHC.Ratios.dat", "w");
104 fprintf(fout_ratios, "%15s ", "T[MeV]");
105 for (int i = 0; i < ratios.size(); ++i) {
106 fprintf(fout_ratios, "%15s ", (parts.ParticleByPDG(ratios[i].first).Name() + "/" + parts.ParticleByPDG(ratios[i].second).Name()).c_str());
107 }
108 fprintf(fout_ratios, "\n");
109
110 // The temperature scan
111 double T0 = params_chemical_freezeout.T;
112 double dT = 0.001; // steps of 1 MeV
113 double Tmin = 0.070; // Down to 70 MeV
114
115 // Store the value of the total entropy at the chemical freeze-out
116 double entropy_chemical_freezeout = modelpce.ThermalModel()->EntropyDensity() * params_chemical_freezeout.V;
117
118 // Loop over temperatures
119 for (double T = T0; T >= Tmin - 1.e-9; T -= dT) {
120 printf("T = %lf MeV\n", T * 1.e3);
121
122 // Compute the PCE chemical potentials at a given temperature
123 modelpce.CalculatePCE(T);
124
125 // Output the parameters at the current temperature
126 fprintf(fout_params, "%15lf %15lf %15lf ",
127 T * 1.e3,
128 modelpce.ThermalModel()->Volume() / params_chemical_freezeout.V,
129 modelpce.ThermalModel()->EntropyDensity() * modelpce.ThermalModel()->Volume() / entropy_chemical_freezeout
130 );
131
132 for (int i = 0; i < pdgcodes_stable.size(); ++i) {
133 fprintf(fout_params, "%15lf ",
134 modelpce.ChemicalPotentials()[ parts.PdgToId(pdgcodes_stable[i]) ]
135 );
136 }
137 fprintf(fout_params, "\n");
138
139 // Output the yield ratios at the current temperature
140 fprintf(fout_ratios, "%15lf ", T * 1.e3);
141 for (int i = 0; i < ratios.size(); ++i) {
142 fprintf(fout_ratios, "%15E ",
143 modelpce.ThermalModel()->GetYield(ratios[i].first, Feeddown::Electromagnetic) /
144 modelpce.ThermalModel()->GetYield(ratios[i].second, Feeddown::Electromagnetic));
145 }
146 fprintf(fout_ratios, "\n");
147
148 }
149
150 fclose(fout_params);
151 fclose(fout_ratios);
152
153 return 0;
154}
155
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 &params)
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 &params, 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.
Definition CosmicEoS.h:9
@ Electromagnetic
Feeddown from strong and electromagnetic decays.
Structure containing all thermal parameters of the model.