Thermal-FIST  1.3
Package for hadron resonance gas model applications
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 
23 using namespace std;
24 
25 #ifdef ThermalFIST_USENAMESPACE
26 using 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
31 int 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 reproduce arXiv:1903.10024 use the PDG2014 list
37  //ThermalParticleSystem TPS(string(ThermalFIST_INPUT_FOLDER) + "/list/PDG2014/list-withnuclei.dat");
38 
39  // Use ideal HRG model
40  ThermalModelIdeal model(&parts);
41 
42  // PCE-HRG model
43  ThermalModelPCE modelpce(&model);
44  modelpce.UseSahaForNuclei(true); // Light nuclei evaluated using the Saha equation (arXiv:1903.10024)
45  modelpce.FreezeLonglivedResonances(false); // All strongly decaying resonance are in partial equilibrium
46 
47  // Chemical freeze-out conditions: 2.76 TeV 0-10% Pb-Pb collisions
48  ThermalModelParameters params_chemical_freezeout;
49  params_chemical_freezeout.T = 0.155; // Temperature in GeV
50  params_chemical_freezeout.muB = 0.;
51  params_chemical_freezeout.V = 4700.; // Volume in fm^3
52 
53  model.SetParameters(params_chemical_freezeout);
54  model.FillChemicalPotentials(); // Fills chemical potentials for all species at Tch
55 
56  // Set the chemical freeze-out as an "initial" condition for PCE
57  modelpce.SetChemicalFreezeout(params_chemical_freezeout);
58 
59  // The list of chemical potentials for output, coded by the pdg code
60  vector<long long> pdgcodes_stable;
61  pdgcodes_stable.push_back(211); // pions (pi+)
62  pdgcodes_stable.push_back(321); // kaons (K+)
63  pdgcodes_stable.push_back(2212); // protons (p+)
64  pdgcodes_stable.push_back(3122); // Lambdas
65  pdgcodes_stable.push_back(3222); // Sigma+
66  pdgcodes_stable.push_back(3312); // Xi-
67  pdgcodes_stable.push_back(3334); // Omega
68 
69  // The list of yield ratios to output
70  vector< pair<long long, long long> > ratios;
71  // First the nuclei
72  ratios.push_back(make_pair(1000010020, 2212)); // d/p
73  ratios.push_back(make_pair(1000020030, 2212)); // He3/p
74  ratios.push_back(make_pair(1000010030, 2212)); // H3/p
75  ratios.push_back(make_pair(1000020040, 2212)); // He4/p
76  ratios.push_back(make_pair(1010010030, 2212)); // Hypertriton/p
77  ratios.push_back(make_pair(1010010040, 2212)); // HyperHydrogen4/p
78  // Now the resonances
79  ratios.push_back(make_pair(313, -321)); // K^*0 / K^-
80  ratios.push_back(make_pair(113, 211)); // rho^0/ pi^+
81  ratios.push_back(make_pair(3124, 3122)); // \Lambda(1520)/\Lambda
82  ratios.push_back(make_pair(9010221, 211)); // f0(980) / pi^+
83  ratios.push_back(make_pair(2224, 2212)); // \Delta(1232)++/p
84 
85  // Preparing the output files
86  // The file to output the parameters (volume, entropy, chemical potentials)
87  FILE* fout_params = fopen("PCE.LHC.Parameters.dat", "w");
88  fprintf(fout_params, "%15s %15s %15s ", "T[MeV]", "V/Vch", "S/Sch");
89  for (int i = 0; i < pdgcodes_stable.size(); ++i) {
90  fprintf(fout_params, "%15s ", ("mu_" + string(parts.ParticleByPDG(pdgcodes_stable[i]).Name())).c_str());
91  }
92  fprintf(fout_params, "\n");
93 
94  // The file to output the yield ratios
95  FILE* fout_ratios = fopen("PCE.LHC.Ratios.dat", "w");
96  fprintf(fout_ratios, "%15s ", "T[MeV]");
97  for (int i = 0; i < ratios.size(); ++i) {
98  fprintf(fout_ratios, "%15s ", (parts.ParticleByPDG(ratios[i].first).Name() + "/" + parts.ParticleByPDG(ratios[i].second).Name()).c_str());
99  }
100  fprintf(fout_ratios, "\n");
101 
102  // The temperature scan
103  double T0 = params_chemical_freezeout.T;
104  double dT = 0.001; // steps of 1 MeV
105  double Tmin = 0.070; // Down to 70 MeV
106 
107  // Store the value of the total entropy at the chemical freeze-out
108  double entropy_chemical_freezeout = modelpce.ThermalModel()->EntropyDensity() * params_chemical_freezeout.V;
109 
110  // Loop over temperatures
111  for (double T = T0; T >= Tmin - 1.e-9; T -= dT) {
112  printf("T = %lf MeV\n", T * 1.e3);
113 
114  // Compute the PCE chemical potentials at a given temperature
115  modelpce.CalculatePCE(T);
116 
117  // Output the parameters at the current temperature
118  fprintf(fout_params, "%15lf %15lf %15lf ",
119  T * 1.e3,
120  modelpce.ThermalModel()->Volume() / params_chemical_freezeout.V,
121  modelpce.ThermalModel()->EntropyDensity() * modelpce.ThermalModel()->Volume() / entropy_chemical_freezeout
122  );
123 
124  for (int i = 0; i < pdgcodes_stable.size(); ++i) {
125  fprintf(fout_params, "%15lf ",
126  modelpce.ChemicalPotentials()[ parts.PdgToId(pdgcodes_stable[i]) ]
127  );
128  }
129  fprintf(fout_params, "\n");
130 
131  // Output the yield ratios at the current temperature
132  fprintf(fout_ratios, "%15lf ", T * 1.e3);
133  for (int i = 0; i < ratios.size(); ++i) {
134  fprintf(fout_ratios, "%15E ",
135  modelpce.ThermalModel()->GetYield(ratios[i].first, Feeddown::Electromagnetic) /
136  modelpce.ThermalModel()->GetYield(ratios[i].second, Feeddown::Electromagnetic));
137  }
138  fprintf(fout_ratios, "\n");
139 
140  }
141 
142  fclose(fout_params);
143  fclose(fout_ratios);
144 
145  return 0;
146 }
147 
const std::vector< double > & ChemicalPotentials() const
double EntropyDensity()
Entropy density (fm )
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...
ThermalModelBase * ThermalModel() const
Pointer to the HRG model used in calculations.
int PdgToId(long long pdgid)
Transforms PDG ID to a 0-based particle id number.
Class containing the particle list.
virtual void SetParameters(const ThermalModelParameters &params)
The thermal parameters.
Structure containing all thermal parameters of the model.
virtual void CalculatePCE(double param, PCEMode mode=AtFixedTemperature)
Solves the equations of partial chemical equilibrium at a fixed temperature or a fixed volume...
void FreezeLonglivedResonances(bool flag)
Whether long-lived resonances yields should be frozen.
virtual void FillChemicalPotentials()
Sets the chemical potentials of all particles.
const std::string & Name() const
Particle&#39;s name.
int main(int argc, char *argv[])
double GetYield(long long PDGID, Feeddown::Type feeddown)
Particle number yield of species with a specified PDG ID and feeddown.
void UseSahaForNuclei(bool flag)
Whether the nuclear abundances are evaluated through the Saha equation.
Class implementing the Ideal HRG model.
The main namespace where all classes and functions of the Thermal-FIST library reside.
double Volume() const
System volume (fm )
ThermalParticle & ParticleByPDG(long long pdgid)
ThermalParticle object corresponding to particle species with a provided PDG ID.