#include <string.h>
#include <fstream>
#include <iostream>
#include <iomanip>
#include <ctime>
#include <cstdio>
#include "ThermalFISTConfig.h"
#ifdef ThermalFIST_USENAMESPACE
#endif
int main(
int argc,
char *argv[])
{
string listname = string(ThermalFIST_INPUT_FOLDER) + "/list/PDG2014/list.dat";
int config = 0;
if (argc > 1)
config = atoi(argv[1]);
string fittype;
if (config == 1)
fittype = "NEQ";
else
fittype = "EQ";
char tmpc[1000];
sprintf(tmpc, "cpc3.%s.chi2.out", fittype.c_str());
FILE *fout = fopen(tmpc, "w");
printf("%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s\n",
"Dataset",
"T[MeV]",
"T_err[MeV]",
"muB[MeV]",
"muB_err[MeV]",
"R[fm]",
"R_err[fm]",
"gammaq",
"gammaq_err",
"gammaS",
"gammaS_err",
"chi2",
"chi2/dof"
);
fprintf(fout, "%15s%15s%15s%15s%15s%15s%15s%15s%15s%15s\n",
"Dataset",
"T[MeV]",
"muB[MeV]",
"R[fm]",
"gammaq",
"gammaS",
"chi2",
"chi2/dof",
"Q/B",
"S/|S|"
);
vector<string> names;
vector<string> filenames;
names.push_back("NA49-30GeV-4pi");
filenames.push_back(string(ThermalFIST_INPUT_FOLDER) + "/data/NA49/NA49-PbPb30AGeV-4pi.dat");
names.push_back("NA49-40GeV-4pi");
filenames.push_back(string(ThermalFIST_INPUT_FOLDER) + "/data/NA49/NA49-PbPb40AGeV-4pi.dat");
names.push_back("NA49-80GeV-4pi");
filenames.push_back(string(ThermalFIST_INPUT_FOLDER) + "/data/NA49/NA49-PbPb80AGeV-4pi.dat");
names.push_back("NA49-158GeV-4pi");
filenames.push_back(string(ThermalFIST_INPUT_FOLDER) + "/data/NA49/NA49-PbPb158AGeV-4pi.dat");
names.push_back("ALICE-2_76-0-5");
filenames.push_back(string(ThermalFIST_INPUT_FOLDER) + "/data/ALICE-PbPb2.76TeV-0-5-1512.08046.dat");
int iters = 0;
for(size_t ind = 0; ind < names.size(); ++ind)
{
vector<FittedQuantity> quantities = ThermalModelFit::loadExpDataFromFile(filenames[ind]);
double Tinit = 0.140;
double Tdelta = 0.030;
double Tmin = 0.050;
double Tmax = 0.170;
double muBinit = 0.250;
double muBdelta = 0.150;
double muBmin = -0.050;
double muBmax = 1.000;
fitter.
SetParameter(
"muB", muBinit, muBdelta, muBmin, muBmax);
double Rinit = 10.0;
double Rdelta = 1.0;
double Rmin = 0.0;
double Rmax = 30.0;
double gqinit = 1.0;
double gqdelta = 0.6;
double gqmin = 0.001;
double gqmax = 1.800;
if (config != 0) {
fitter.
SetParameter(
"gammaq", gqinit, gqdelta, gqmin, gqmax);
}
if (config != 0) {
double gSinit = 1.0;
double gSdelta = 0.6;
double gSmin = 0.001;
double gSmax = 3.000;
fitter.
SetParameter(
"gammaS", gSinit, gSdelta, gSmin, gSmax);
}
printf("%15s%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15lf",
names[ind].c_str(),
Tfit * 1000.,
Terr * 1000.,
muBfit * 1000.,
muBerr * 1000.,
Rfit,
Rerr,
gqfit,
gqerr,
gSfit,
gSerr,
chi2,
chi2dof);
printf("\n");
fprintf(fout, "%15s%15lf%15lf%15lf%15lf%15lf%15lf%15lf%15E%15E\n",
names[ind].c_str(),
Tfit * 1000.,
muBfit * 1000.,
Rfit,
gqfit,
gSfit,
chi2,
chi2dof,
fflush(fout);
iters++;
}
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;
}