Calculates the temperature profile of \( \chi^2 \) of a fit to the ALICE 2.76 TeV data, 0-5% centrality, as in 1512.08046
#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[])
{
string listname = string(ThermalFIST_INPUT_FOLDER) + "/list/thermus23/list.dat";
int config = 0;
if (argc > 1)
config = atoi(argv[1]);
string modeltype;
if (config == 0)
{
printf("#Fitting 2.76 TeV ALICE data at \\mu = 0 in Id-HRG model\n");
modeltype = "Id-HRG";
}
else if (config == 1)
{
double rad = 0.3;
for (int i = 0; i < model->TPS()->ComponentsNumber(); ++i) {
if (model->TPS()->Particle(i).BaryonCharge() == 0) model->
SetRadius(i, 0.);
}
printf("#Fitting 2.76 TeV ALICE data at \\mu = 0 in EV-HRG model with r = %lf fm for baryons, and r = 0 for mesons\n", rad);
modeltype = "EV-HRG-TwoComponent";
}
else if (config == 2)
{
double radProton = 0.5;
for (int i = 0; i < model->TPS()->ComponentsNumber(); ++i) {
model->
SetRadius(i, radProton * pow(model->TPS()->Particle(i).Mass() / 0.938, 1/3.));
}
printf("#Fitting 2.76 TeV ALICE data at \\mu = 0 in Bag Model EV-HRG model with proton r = %lf fm\n", radProton);
modeltype = "EV-HRG-BagModel";
}
else if (config == 3)
{
double a = 0.329;
double b = 3.42;
for (int i = 0; i < model->TPS()->ComponentsNumber(); ++i) {
for (int j = 0; j < model->TPS()->ComponentsNumber(); ++j) {
int B1 = model->TPS()->Particle(i).BaryonCharge();
int B2 = model->TPS()->Particle(j).BaryonCharge();
if ((B1 > 0 && B2 > 0) || (B1 < 0 && B2 < 0))
{
}
else
{
}
}
}
printf("#Fitting 2.76 TeV ALICE data at \\mu = 0 in QvdW-HRG model\n");
modeltype = "QvdW-HRG";
}
else
{
modeltype = "Id-HRG";
}
double Rinit = 10.0;
double Rdelta = 1.0;
double Rmin = 0.0;
double Rmax = 30.0;
printf("%15s%15s%15s%15s\n",
"T[MeV]",
"R[fm]",
"chi2",
"chi2_dof"
);
char tmpc[1000];
sprintf(tmpc, "cpc2.%s.ALICE2_76.chi2.TDep.out", modeltype.c_str());
FILE *fout = fopen(tmpc, "w");
fprintf(fout, "%15s%15s%15s%15s\n",
"T[MeV]",
"R[fm]",
"chi2",
"chi2_dof"
);
int iters = 0;
double Tmin = 0.100;
double Tmax = 0.2501;
double dT = 0.002;
if (config == 0)
dT = 0.001;
if (config == 2) {
dT = 0.005;
Tmax = 0.4001;
}
for (double T = Tmin; T <= Tmax; T += dT) {
double chi2 = result.
chi2;
printf(
"%15lf%15lf%15lf%15lf\n", T * 1000., Rfit, chi2, chi2 / (result.
ndf - 1.));
fprintf(fout,
"%15lf%15lf%15lf%15lf\n", T * 1000., Rfit, chi2, chi2 / (result.
ndf - 1.));
iters++;
fflush(stdout);
}
fclose(fout);
delete model;
printf("%30s %lf s\n", "Running time:", (wt2 - wt1));
printf("%30s %lf s\n", "Time per single calculation:", (wt2 - wt1) / iters);
return 0;
}
int main(int argc, char *argv[])
Abstract base class for an HRG model implementation.
virtual void SetVirial(int, int, double)
Set the excluded volume coefficient .
virtual void FillChemicalPotentials()
Sets the chemical potentials of all particles.
void SetUseWidth(bool useWidth)
Sets whether finite resonance widths are used. Deprecated.
virtual void SetBaryonChemicalPotential(double muB)
Set the baryon chemical potential.
virtual void SetRadius(double)
Set the same excluded volume radius parameter for all species.
virtual void SetElectricChemicalPotential(double muQ)
Set the electric chemical potential.
virtual void SetStrangenessChemicalPotential(double muS)
Set the strangeness chemical potential.
virtual void SetAttraction(int, int, double)
Set the vdW mean field attraction coefficient .
virtual void SetCharmChemicalPotential(double muC)
Set the charm chemical potential.
virtual void SetStatistics(bool stats)
Class implementing the diagonal excluded-volume model.
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 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 implementing the Ideal HRG model.
@ BWTwoGamma
Energy-independent Breit-Wigner in +-2\Gamma interval.
Class containing the particle list.
The main namespace where all classes and functions of the Thermal-FIST library reside.
ThermalModelVDW ThermalModelVDWFull
For backward compatibility.
Structure holding information about parameters of a thermal fit.
int ndf
Number of degrees of freedom.
double chi2
Value of the function.