An example of doing the thermal fits to hadron yield data.
Performs thermal fits to ALICE Pb-Pb 0-10% data with the HRG model with excluded-volume corrections with a bag model scaling of hadron eigenvolumes.
#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[])
{
double radProton = 0.50;
if (argc>1)
radProton = atof(argv[1]);
double Tmin = 0.100;
if (argc>2)
Tmin = atof(argv[2]);
double Tmax = 0.301;
if (argc>3)
Tmax = atof(argv[3]);
double dT = 0.001;
if (argc>4)
dT = atof(argv[4]);
for (int i = 0; i < model.TPS()->Particles().size(); ++i) {
double mass = part.
Mass();
}
double Rinit = 10.0;
double Rdelta = 1.0;
double Rmin = 0.0;
double Rmax = 30.0;
printf("%15s%15s%15s\n", "T [GeV]", "R [fm]", "chi2");
for (double T = Tmin; T <= Tmax; T += dT) {
printf(
"%15lf%15lf%15lf\n", T, result.
R.
value, result.
chi2);
}
return 0;
}
int main(int argc, char *argv[])
void SetUseWidth(bool useWidth)
Sets whether finite resonance widths are used. Deprecated.
virtual void SetBaryonChemicalPotential(double muB)
Set the baryon chemical potential.
virtual void SetElectricChemicalPotential(double muQ)
Set the electric chemical potential.
virtual void SetStrangenessChemicalPotential(double muS)
Set the strangeness chemical potential.
virtual void SetCharmChemicalPotential(double muC)
Set the charm chemical potential.
virtual void SetStatistics(bool stats)
Class implementing the diagonal excluded-volume model.
void SetRadius(double rad)
Set the same excluded volume radius parameter for all species.
Class implementing the thermal model fit procedure.
void SetParameter(const std::string &name, const FitParameter ¶m)
Sets the fit parameter with a given name.
void SetParameterFitFlag(const std::string &name, bool toFit)
Sets whether the fit parameter with a given name is fitted.
void PrintFitLog(std::string filename="", std::string comment="Thermal fit", bool asymm=false)
Prints the result of the fitting procedure to a file.
void SetQuantities(const std::vector< FittedQuantity > &inQuantities)
Same as SetData()
static std::vector< FittedQuantity > loadExpDataFromFile(const std::string &filename)
Load the experimental data from a file.
void SetParameterValue(const std::string &name, double value)
Sets the (initial) value for the fit parameter with a given name.
ThermalModelFitParameters PerformFit(bool verbose=true, bool AsymmErrors=false)
The thermal fit procedure.
Class containing all information about a particle specie.
double Mass() const
Particle's mass [GeV].
@ BWTwoGamma
Energy-independent Breit-Wigner in +-2\Gamma interval.
Class containing the particle list.
constexpr double mnucleon()
Nucleon's mass. Value as in UrQMD.
The main namespace where all classes and functions of the Thermal-FIST library reside.
Structure holding information about parameters of a thermal fit.
double chi2
Value of the function.