19 #include "Minuit2/FCNBase.h" 20 #include "Minuit2/FunctionMinimum.h" 21 #include "Minuit2/MnMigrad.h" 22 #include "Minuit2/MnMinos.h" 23 #include "Minuit2/MnHesse.h" 24 #include "Minuit2/MnUserParameterState.h" 37 using namespace ROOT::Minuit2;
41 class FitFCN :
public FCNBase {
45 FitFCN(ThermalModelFit *thmfit_,
bool verbose_ =
true) : m_THMFit(thmfit_), m_verbose(verbose_) {
50 double operator()(
const std::vector<double>& par)
const {
51 m_THMFit->Increment();
53 if (par[2]<0.)
return 1e12;
54 if (par[3]<0.)
return 1e12;
56 m_THMFit->SetParameterValue(
"T", par[0]);
57 m_THMFit->SetParameterValue(
"muB", par[1]);
58 m_THMFit->SetParameterValue(
"gammaS", par[2]);
59 m_THMFit->SetParameterValue(
"R", par[3]);
60 m_THMFit->SetParameterValue(
"Rc", par[4]);
61 m_THMFit->SetParameterValue(
"gammaq", par[5]);
62 m_THMFit->SetParameterValue(
"muQ", par[6]);
63 m_THMFit->SetParameterValue(
"muS", par[7]);
64 m_THMFit->SetParameterValue(
"muC", par[8]);
65 m_THMFit->SetParameterValue(
"gammac", par[9]);
66 m_THMFit->SetParameterValue(
"Tkin", par[10]);
68 m_THMFit->model()->SetTemperature(par[0]);
70 if (!m_THMFit->model()->ConstrainMuB())
71 m_THMFit->model()->SetBaryonChemicalPotential(par[1]);
73 m_THMFit->model()->SetGammaS(par[2]);
75 m_THMFit->model()->SetVolumeRadius(par[3]);
77 if (m_THMFit->FixVcOverV())
78 m_THMFit->model()->SetCanonicalVolume(m_THMFit->model()->Volume() * m_THMFit->VcOverV());
80 m_THMFit->model()->SetCanonicalVolumeRadius(par[4]);
83 m_THMFit->model()->SetGammaq(par[5]);
85 m_THMFit->model()->SetGammaC(par[9]);
87 if (m_THMFit->model()->ConstrainMuQ())
88 m_THMFit->model()->SetElectricChemicalPotential(-par[1] / 50.);
90 m_THMFit->model()->SetElectricChemicalPotential(par[6]);
92 if (m_THMFit->model()->ConstrainMuS())
93 m_THMFit->model()->SetStrangenessChemicalPotential(par[1] / 5.);
95 m_THMFit->model()->SetStrangenessChemicalPotential(par[7]);
97 if (m_THMFit->model()->ConstrainMuC())
98 m_THMFit->model()->SetCharmChemicalPotential(par[1] / 5.);
100 m_THMFit->model()->SetCharmChemicalPotential(par[8]);
102 m_THMFit->model()->SetParameters(m_THMFit->model()->Parameters());
108 m_THMFit->model()->ConstrainChemicalPotentials();
110 if (m_THMFit->UseTkin()) {
111 m_THMFit->modelpce()->SetChemicalFreezeout(m_THMFit->model()->Parameters(), m_THMFit->model()->ChemicalPotentials());
112 m_THMFit->modelpce()->CalculatePCE(par[10]);
115 m_THMFit->model()->CalculateDensities();
122 printf(
"%15d ", m_THMFit->Iters());
123 printf(
"Issue with Bose-Einstein condensation, discarding this iteration...\n");
124 return m_THMFit->Chi2() = chi2 = 1.e12;
128 for (
size_t i = 0; i < m_THMFit->FittedQuantities().size(); ++i) {
130 const ExperimentRatio &ratio = m_THMFit->FittedQuantities()[i].ratio;
131 double dens1 = m_THMFit->model()->GetDensity(ratio.fPDGID1, ratio.fFeedDown1);
132 double dens2 = m_THMFit->model()->GetDensity(ratio.fPDGID2, ratio.fFeedDown2);
133 double ModelRatio = dens1 / dens2;
134 m_THMFit->ModelData(i) = ModelRatio;
135 if (m_THMFit->FittedQuantities()[i].toFit)
136 chi2 += (ModelRatio - ratio.fValue) * (ModelRatio - ratio.fValue) / ratio.fError / ratio.fError;
141 for (
size_t i = 0; i < m_THMFit->FittedQuantities().size(); ++i) {
143 const ExperimentMultiplicity &multiplicity = m_THMFit->FittedQuantities()[i].mult;
144 double dens = m_THMFit->model()->GetDensity(multiplicity.fPDGID, multiplicity.fFeedDown);
145 double ModelMult = dens * m_THMFit->model()->Parameters().V;
146 m_THMFit->ModelData(i) = ModelMult;
147 if (m_THMFit->FittedQuantities()[i].toFit)
148 chi2 += (ModelMult - multiplicity.fValue) * (ModelMult - multiplicity.fValue) / multiplicity.fError / multiplicity.fError;
153 printf(
"%15d ", m_THMFit->Iters());
154 printf(
"%15lf ", chi2);
155 if (m_THMFit->Parameters().T.toFit)
156 printf(
"%15lf ", par[0]);
157 if (m_THMFit->Parameters().muB.toFit)
158 printf(
"%15lf ", m_THMFit->model()->Parameters().muB);
159 if (m_THMFit->Parameters().muQ.toFit)
160 printf(
"%15lf ", m_THMFit->model()->Parameters().muQ);
161 if (m_THMFit->Parameters().muS.toFit)
162 printf(
"%15lf ", m_THMFit->model()->Parameters().muS);
163 if (m_THMFit->Parameters().muC.toFit)
164 printf(
"%15lf ", m_THMFit->model()->Parameters().muC);
165 if (m_THMFit->Parameters().R.toFit)
166 printf(
"%15lf ", par[3]);
167 if (m_THMFit->Parameters().Rc.toFit)
168 printf(
"%15lf ", par[4]);
169 if (m_THMFit->Parameters().gammaq.toFit)
170 printf(
"%15lf ", m_THMFit->model()->Parameters().gammaq);
171 if (m_THMFit->Parameters().gammaS.toFit)
172 printf(
"%15lf ", m_THMFit->model()->Parameters().gammaS);
173 if (m_THMFit->Parameters().gammaC.toFit)
174 printf(
"%15lf ", m_THMFit->model()->Parameters().gammaC);
175 if (m_THMFit->Parameters().Tkin.toFit)
176 printf(
"%15lf ", par[10]);
180 printf(
"B = %10.5lf\tQ = %10.5lf\tS = %10.5lf\tC = %10.5lf\n",
181 m_THMFit->model()->CalculateBaryonDensity() * m_THMFit->model()->Parameters().V,
182 m_THMFit->model()->CalculateChargeDensity() * m_THMFit->model()->Parameters().V,
183 m_THMFit->model()->CalculateStrangenessDensity() * m_THMFit->model()->Parameters().V,
184 m_THMFit->model()->CalculateCharmDensity() * m_THMFit->model()->Parameters().V);
187 m_THMFit->Chi2() =
chi2;
189 m_THMFit->BT() = m_THMFit->model()->CalculateBaryonDensity() * m_THMFit->model()->Parameters().V;
190 m_THMFit->QT() = m_THMFit->model()->CalculateChargeDensity() * m_THMFit->model()->Parameters().V;
191 m_THMFit->ST() = m_THMFit->model()->CalculateStrangenessDensity() * m_THMFit->model()->Parameters().V;
192 m_THMFit->CT() = m_THMFit->model()->CalculateCharmDensity() * m_THMFit->model()->Parameters().V;
197 printf(
"**WARNING** chi2 evaluated to NaN\n");
203 double Up()
const {
return 1.;}
206 ThermalModelFit *m_THMFit;
215 m_model(model_), m_modelpce(NULL), m_Parameters(model_->Parameters()), m_FixVcToV(true), m_VcOverV(1.),
216 m_YieldsAtTkin(false), m_SahaForNuclei(true), m_PCEFreezeLongLived(false), m_PCEWidthCut(0.015)
227 m_ModelData.resize(m_Quantities.size(), 0.);
235 m_modelpce =
new ThermalModelPCE(m_model, m_PCEFreezeLongLived, m_PCEWidthCut);
236 if (!m_SahaForNuclei) {
242 FitFCN mfunc(
this, verbose);
243 std::vector<double> params(11, 0.);
244 params[0] = m_Parameters.
T.
value;
247 params[3] = m_Parameters.
R.
value;
248 params[4] = m_Parameters.
Rc.
value;
256 MnUserParameters upar;
273 if (m_Multiplicities.size() == 0)
316 if (!m_Parameters.
T.
toFit) { upar.Fix(
"T"); nparams--; }
317 if (!m_Parameters.
R.
toFit) { upar.Fix(
"R"); nparams--; }
318 if (!m_Parameters.
Rc.
toFit) { upar.Fix(
"Rc"); nparams--; }
319 if (!m_Parameters.
muB.
toFit) { upar.Fix(
"muB"); nparams--; }
320 if (!m_Parameters.
muQ.
toFit) { upar.Fix(
"muQ"); nparams--; }
321 if (!m_Parameters.
muS.
toFit) { upar.Fix(
"muS"); nparams--; }
322 if (!m_Parameters.
muC.
toFit) { upar.Fix(
"muC"); nparams--; }
323 if (!m_Parameters.
gammaq.
toFit) { upar.Fix(
"gammaq"); nparams--; }
324 if (!m_Parameters.
gammaS.
toFit) { upar.Fix(
"gammaS"); nparams--; }
325 if (!m_Parameters.
gammaC.
toFit) { upar.Fix(
"gammaC"); nparams--; }
326 if (!m_Parameters.
Tkin.
toFit) { upar.Fix(
"Tkin"); nparams--; }
338 printf(
"Starting a thermal fit...\n\n");
339 printf(
"%15s ",
"Iteration");
340 printf(
"%15s ",
"chi2");
342 printf(
"%15s ",
"T [GeV]");
344 printf(
"%15s ",
"muB [GeV]");
346 printf(
"%15s ",
"muQ [GeV]");
348 printf(
"%15s ",
"muS [GeV]");
350 printf(
"%15s ",
"muC [GeV]");
352 printf(
"%15s ",
"R [fm]");
354 printf(
"%15s ",
"Rc [fm]");
356 printf(
"%15s ",
"gammaq");
358 printf(
"%15s ",
"gammaS");
360 printf(
"%15s ",
"gammaC");
362 printf(
"%15s ",
"Tkin [GeV]");
366 MnMigrad migrad(mfunc, upar);
368 FunctionMinimum min = migrad();
371 printf(
"\nMinimum found! Now calculating the error matrix...\n\n");
379 MnMinos mino(mfunc, min);
380 std::pair<double, double> errs;
381 if (m_Parameters.
T.
toFit) { errs = mino(0); ret.
T.
errm = abs(errs.first); ret.
T.
errp = abs(errs.second); }
382 if (m_Parameters.
muB.
toFit) { errs = mino(1); ret.
muB.
errm = abs(errs.first); ret.
muB.
errp = abs(errs.second); }
384 if (m_Parameters.
R.
toFit) { errs = mino(3); ret.
R.
errm = abs(errs.first); ret.
R.
errp = abs(errs.second); }
385 if (m_Parameters.
Rc.
toFit) { errs = mino(4); ret.
Rc.
errm = abs(errs.first); ret.
Rc.
errp = abs(errs.second); }
389 ret.
T.
value = (min.UserParameters()).Params()[0];
390 ret.
T.
error = (min.UserParameters()).Errors()[0];
391 ret.
muB.
value = (min.UserParameters()).Params()[1];
392 ret.
muB.
error = (min.UserParameters()).Errors()[1];
393 ret.
gammaS.
value = (min.UserParameters()).Params()[2];
394 ret.
gammaS.
error = (min.UserParameters()).Errors()[2];
395 ret.
R.
value = (min.UserParameters()).Params()[3];
396 ret.
R.
error = (min.UserParameters()).Errors()[3];
397 ret.
Rc.
value = (min.UserParameters()).Params()[4];
398 ret.
Rc.
error = (min.UserParameters()).Errors()[4];
399 ret.
gammaq.
value = (min.UserParameters()).Params()[5];
400 ret.
gammaq.
error = (min.UserParameters()).Errors()[5];
401 ret.
muQ.
value = (min.UserParameters()).Params()[6];
402 ret.
muQ.
error = (min.UserParameters()).Errors()[6];
403 ret.
muS.
value = (min.UserParameters()).Params()[7];
404 ret.
muS.
error = (min.UserParameters()).Errors()[7];
405 ret.
muC.
value = (min.UserParameters()).Params()[8];
406 ret.
muC.
error = (min.UserParameters()).Errors()[8];
407 ret.
gammaC.
value = (min.UserParameters()).Params()[9];
408 ret.
gammaC.
error = (min.UserParameters()).Errors()[9];
409 ret.
Tkin.
value = (min.UserParameters()).Params()[10];
410 ret.
Tkin.
error = (min.UserParameters()).Errors()[10];
463 ret.
T.
value = upar.Params()[0];
464 ret.
T.
error = upar.Errors()[0];
469 ret.
R.
value = upar.Params()[3];
470 ret.
R.
error = upar.Errors()[3];
471 ret.
Rc.
value = upar.Params()[4];
472 ret.
Rc.
error = upar.Errors()[4];
522 ret.
chi2 = mfunc(params);
524 for (
size_t i = 0; i < m_Quantities.size(); ++i)
525 if (m_Quantities[i].toFit) ndf++;
543 if (m_modelpce != NULL) {
549 printf(
"Thermal fit finished\n\n");
552 printf(
"**ERROR** Cannot fit without MINUIT2 library!\n");
562 for (
size_t i = 0; i < m_Quantities.size(); ++i) {
569 std::cout << m_model->
TPS()->
Particles()[ind1].Name() <<
"/" << m_model->
TPS()->
Particles()[ind2].Name() <<
" = " <<
570 dens1 / dens2 <<
" " << ratio.
fValue <<
" " << ratio.
fError <<
"\n";
576 printf(
"%20s\n",
"Fit parameters");
577 for(
int i=0;i<6;++i) {
579 if (param.
name ==
"Tkin" && !m_YieldsAtTkin)
582 printf(
"%10s = %10lf %2s %lf\n", param.
name.c_str(), param.
value,
"+-", param.
error);
601 for (
size_t i = 0; i < m_Quantities.size(); ++i) {
610 printf(
"%10s\t%11s\t%6lf %2s %lf\n",
"Npart",
"Experiment:",
612 else if (mult.
fPDGID == 33340)
616 printf(
"%10s\t%11s\t%6lf %2s %lf\n", tname.c_str(),
"Experiment:", mult.
fValue,
"+-", mult.
fError);
617 printf(
"%10s\t%11s\t%6lf %2s %lf\n",
"",
"Model:", dens1 * m_model->
Parameters().
V,
"+-", 0.);
632 for (
size_t i = 0; i < m_Quantities.size(); ++i) {
641 printf(
"%10s\t%11s\t%6lf %2s %lf\n",
"Npart",
"Experiment:",
643 else if (mult.
fPDGID == 33340)
647 printf(
"%10s\t%11s\t%6lf %2s %lf\n", tname.c_str(),
"Experiment:", mult.
fValue,
"+-", mult.
fError);
648 printf(
"%10s\t%11s\t%6lf %2s %lf\n",
"",
"Model:", dens1 * m_model->
Parameters().
V,
"+-", 0.);
655 for (
size_t i = 0; i < m_Quantities.size(); ++i) {
670 printf(
"%10s\t%11s\t%6lf %2s %lf\n", (std::string(name1 +
"/" + name2)).c_str(),
"Experiment:",
672 printf(
"%10s\t%11s\t%6lf %2s %lf\n",
"",
"Model:", dens1 / dens2,
"+-", 0.);
673 printf(
"%10s\t%11s\t%6lf\n",
"",
"Deviation:", (dens1 / dens2 - ratio.
fValue) / ratio.
fError);
680 FILE *f = fopen(filename.c_str(),
"w");
682 fprintf(f,
"%15s\t%25s\t%15s\t%15s\t%15s\t%15s\t%15s\t%15s\t%15s\t%15s\t%15s\n",
683 "N",
"Name",
"Data",
"Error",
"Fit",
"Deviation",
"Deviation2",
684 "Residual",
"ResidualError",
"Data/Model",
"Data/ModelError");
690 for(
size_t i=0;i<m_Multiplicities.size();++i) {
691 double dens1 = m_model->
GetDensity(m_Multiplicities[i].fPDGID, m_Multiplicities[i].fFeedDown);
694 if (m_Multiplicities[i].fPDGID==1) tname =
"Npart";
696 fprintf(f,
"%15d\t%25s\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\n", static_cast<int>(i)+1,
697 tname.c_str(), m_Multiplicities[i].fValue, m_Multiplicities[i].fError, dens1 * m_model->
Parameters().
V,
698 (m_Multiplicities[i].fValue-dens1 * m_model->
Parameters().
V)/m_Multiplicities[i].fError,
699 -(m_Multiplicities[i].fValue-dens1 * m_model->
Parameters().
V)/m_Multiplicities[i].fError,
701 m_Multiplicities[i].fError/(dens1 * m_model->
Parameters().
V),
702 m_Multiplicities[i].fValue/(dens1 * m_model->
Parameters().
V),
703 m_Multiplicities[i].fError/(dens1 * m_model->
Parameters().
V));
705 for(
size_t i=0;i<m_Ratios.size();++i) {
706 double dens1 = m_model->
GetDensity(m_Ratios[i].fPDGID1, m_Ratios[i].fFeedDown1);
707 double dens2 = m_model->
GetDensity(m_Ratios[i].fPDGID2, m_Ratios[i].fFeedDown2);
710 if (m_Ratios[i].fPDGID1==1) name1 =
"Npart";
711 if (m_Ratios[i].fPDGID2==1) name2 =
"Npart";
715 fprintf(f,
"%15d\t%25s\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\t%15lf\n", static_cast<int>(i)+1,
716 (std::string(name1 +
"/" + name2)).c_str(), m_Ratios[i].fValue, m_Ratios[i].fError, dens1 / dens2,
717 (m_Ratios[i].fValue - dens1 / dens2)/m_Ratios[i].fError,
718 -(m_Ratios[i].fValue - dens1 / dens2)/m_Ratios[i].fError,
719 (dens1 / dens2-m_Ratios[i].fValue)/(dens1 / dens2),
720 m_Ratios[i].fError/(dens1 / dens2),
721 m_Ratios[i].fValue/(dens1 / dens2),
722 m_Ratios[i].fError/(dens1 / dens2));
729 FILE *f = fopen(filename.c_str(),
"w");
731 fprintf(f,
"%15s\t%25s\t%15s\t%15s\t%15s\t%15s\n",
"N",
"Name",
"Data",
"Error",
"Fit",
"Deviation");
736 for(
size_t i=0;i<m_Multiplicities.size();++i) {
738 double dens1 = m_model->
GetDensity(m_Multiplicities[i].fPDGID, m_Multiplicities[i].fFeedDown);
740 if (m_Multiplicities[i].fPDGID==1) tname =
"Npart";
742 fprintf(f,
"%15lf\t%25s\t%15lf\t%15lf\t%15lf\t%15lf\n", i+1 - 0.3, tname.c_str(), m_Multiplicities[i].fValue, m_Multiplicities[i].fError, dens1 * m_model->
Parameters().
V, (m_Multiplicities[i].fValue-dens1 * m_model->
Parameters().
V)/m_Multiplicities[i].fError);
743 fprintf(f,
"%15lf\t%25s\t%15lf\t%15lf\t%15lf\t%15lf\n", i+1 + 0.3, tname.c_str(), m_Multiplicities[i].fValue, m_Multiplicities[i].fError, dens1 * m_model->
Parameters().
V, (m_Multiplicities[i].fValue-dens1 * m_model->
Parameters().
V)/m_Multiplicities[i].fError);
745 for(
size_t i=0;i<m_Ratios.size();++i) {
746 double dens1 = m_model->
GetDensity(m_Ratios[i].fPDGID1, m_Ratios[i].fFeedDown1);
747 double dens2 = m_model->
GetDensity(m_Ratios[i].fPDGID2, m_Ratios[i].fFeedDown2);
751 if (m_Ratios[i].fPDGID1==1) name1 =
"Npart";
752 if (m_Ratios[i].fPDGID2==1) name2 =
"Npart";
756 fprintf(f,
"%15lf\t%25s\t%15lf\t%15lf\t%15lf\t%15lf\n", i+1 - 0.3, (std::string(name1 +
"/" + name2)).c_str(), m_Ratios[i].fValue, m_Ratios[i].fError, dens1 / dens2, (m_Ratios[i].fValue - dens1 / dens2)/m_Ratios[i].fError);
757 fprintf(f,
"%15lf\t%25s\t%15lf\t%15lf\t%15lf\t%15lf\n", i+1 + 0.3, (std::string(name1 +
"/" + name2)).c_str(), m_Ratios[i].fValue, m_Ratios[i].fError, dens1 / dens2, (m_Ratios[i].fValue - dens1 / dens2)/m_Ratios[i].fError);
764 FILE *f = fopen(filename.c_str(),
"w");
765 fprintf(f,
"\\begin{tabular}{|c|c|c|c|}\n");
766 fprintf(f,
"\\hline\n");
767 fprintf(f,
"\\multicolumn{4}{|c|}{%s} \\\\\n", name.c_str());
768 fprintf(f,
"\\hline\n");
769 fprintf(f,
"Yield & Measurement & Fit & Deviation \\\\\n");
770 fprintf(f,
"\\hline\n");
775 for(
size_t i=0;i<m_Multiplicities.size();++i) {
776 double dens1 = m_model->
GetDensity(m_Multiplicities[i].fPDGID, m_Multiplicities[i].fFeedDown);
780 if (m_Multiplicities[i].fPDGID==1) tname =
"Npart";
782 fprintf(f,
"$%s$ & $%.4lf \\pm %.4lf$ & $%.4lf$ & $%.4lf$ \\\\\n", tname.c_str(), m_Multiplicities[i].fValue, m_Multiplicities[i].fError, dens1 * m_model->
Parameters().
V, (dens1 * m_model->
Parameters().
V-m_Multiplicities[i].fValue)/m_Multiplicities[i].fError);
784 for(
size_t i=0;i<m_Ratios.size();++i) {
785 int ind1 = m_model->
TPS()->
PdgToId(m_Ratios[i].fPDGID1);
786 int ind2 = m_model->
TPS()->
PdgToId(m_Ratios[i].fPDGID2);
787 double dens1 = m_model->
GetDensity(m_Ratios[i].fPDGID1, m_Ratios[i].fFeedDown1);
788 double dens2 = m_model->
GetDensity(m_Ratios[i].fPDGID2, m_Ratios[i].fFeedDown2);
790 std::string name1 = m_model->
TPS()->
Particles()[ind1].Name();
791 std::string name2 = m_model->
TPS()->
Particles()[ind2].Name();
792 if (m_Ratios[i].fPDGID1==1) name1 =
"Npart";
793 if (m_Ratios[i].fPDGID2==1) name2 =
"Npart";
796 fprintf(f,
"$%s$ & $%.4lf \\pm %.4lf$ & $%.4lf$ & $%.4lf$ \\\\\n", (std::string(name1 +
"/" + name2)).c_str(), m_Ratios[i].fValue, m_Ratios[i].fError, dens1 / dens2 , (dens1 / dens2 - m_Ratios[i].fValue)/m_Ratios[i].fError);
798 fprintf(f,
"\\hline\n");
799 fprintf(f,
"\\end{tabular}\n");
801 fprintf(f,
"\\begin{tabular}{|c|c|}\n");
802 fprintf(f,
"\\hline\n");
803 fprintf(f,
"\\multicolumn{2}{|c|}{%s} \\\\\n", name.c_str());
804 fprintf(f,
"\\hline\n");
805 fprintf(f,
"Parameter & Fit result \\\\\n");
806 fprintf(f,
"\\hline\n");
807 for(
int i=0;i<6;++i) {
810 double tval = param.
value, terr = param.
error;
811 if (param.
name==
"T" || param.
name.substr(0,2)==
"mu") { tval *= 1000.; terr *= 1000.; }
812 fprintf(f,
"$%s$ & $%.2lf \\pm %.2lf$ \\\\\n", param.
name.c_str(), tval, terr);
815 fprintf(f,
"$%s$ & $%.2lf/%d$ \\\\\n",
"\\chi^2/N_{\\rm df}", m_Parameters.
chi2ndf *
GetNdf(),
GetNdf());
816 fprintf(f,
"\\hline\n");
817 fprintf(f,
"\\end{tabular}\n");
823 FILE *f = fopen(filename.c_str(),
"w");
824 fprintf(f,
"\\begin{tabular}{|c|c|c|c|}\n");
825 fprintf(f,
"\\hline\n");
826 fprintf(f,
"\\multicolumn{4}{|c|}{%s} \\\\\n", name.c_str());
827 fprintf(f,
"\\hline\n");
828 fprintf(f,
"Yield & Measurement & Fit \\\\\n");
829 fprintf(f,
"\\hline\n");
835 std::vector<std::string> prt(0);
836 std::vector<long long> pdgs(0);
837 std::vector<int> fl(m_Multiplicities.size(), 0);
838 prt.push_back(
"\\pi^+"); pdgs.push_back(211);
839 prt.push_back(
"\\pi^-"); pdgs.push_back(-211);
840 prt.push_back(
"K^+"); pdgs.push_back(321);
841 prt.push_back(
"K^-"); pdgs.push_back(-321);
842 prt.push_back(
"p"); pdgs.push_back(2212);
843 prt.push_back(
"\\bar{p}"); pdgs.push_back(-2212);
844 prt.push_back(
"\\Lambda"); pdgs.push_back(3122);
845 prt.push_back(
"\\bar{\\Lambda}"); pdgs.push_back(-3122);
846 prt.push_back(
"\\Sigma^+"); pdgs.push_back(3222);
847 prt.push_back(
"\\bar{\\Sigma}^+"); pdgs.push_back(-3222);
848 prt.push_back(
"\\Sigma^-"); pdgs.push_back(3112);
849 prt.push_back(
"\\bar{\\Sigma}^-"); pdgs.push_back(-3112);
850 prt.push_back(
"\\Xi^0"); pdgs.push_back(3322);
851 prt.push_back(
"\\bar{\\Xi}^0"); pdgs.push_back(-3322);
852 prt.push_back(
"\\Xi^-"); pdgs.push_back(3312);
853 prt.push_back(
"\\bar{\\Xi}^-"); pdgs.push_back(-3312);
854 prt.push_back(
"\\Omega"); pdgs.push_back(3334);
855 prt.push_back(
"\\bar{\\Omega}"); pdgs.push_back(-3334);
856 prt.push_back(
"\\pi^0"); pdgs.push_back(111);
857 prt.push_back(
"K^0_S"); pdgs.push_back(310);
858 prt.push_back(
"\\eta"); pdgs.push_back(221);
859 prt.push_back(
"\\omega"); pdgs.push_back(223);
860 prt.push_back(
"K^{*+}"); pdgs.push_back(323);
861 prt.push_back(
"K^{*-}"); pdgs.push_back(-323);
862 prt.push_back(
"K^{*0}"); pdgs.push_back(313);
863 prt.push_back(
"\\bar{K^{*0}}"); pdgs.push_back(-313);
865 prt.push_back(
"\\rho^+"); pdgs.push_back(213);
866 prt.push_back(
"\\rho^-"); pdgs.push_back(-213);
867 prt.push_back(
"\\rho^0"); pdgs.push_back(113);
868 prt.push_back(
"\\eta'"); pdgs.push_back(331);
869 prt.push_back(
"\\phi"); pdgs.push_back(333);
870 prt.push_back(
"\\Lambda(1520)"); pdgs.push_back(3124);
874 prt.push_back(
"d"); pdgs.push_back(1000010020);
875 prt.push_back(
"^3He"); pdgs.push_back(1000020030);
876 prt.push_back(
"^3_{\\Lambda}H"); pdgs.push_back(1010010030);
877 prt.push_back(
"D^+"); pdgs.push_back(411);
878 prt.push_back(
"D^-"); pdgs.push_back(-411);
879 prt.push_back(
"D^0"); pdgs.push_back(421);
880 prt.push_back(
"\\bar{D}^0"); pdgs.push_back(-421);
882 for(
size_t i=0;i<prt.size();++i) {
885 for(
size_t j=0;j<m_Multiplicities.size();++j)
886 if (pdgs[i]==m_Multiplicities[j].fPDGID) { isexp =
true; fl[j] = 1; tj = j;
break; }
888 if (m_model->
TPS()->
PdgToId(pdgs[i]) == -1)
continue;
893 if (isexp) dens1 = m_model->
GetDensity(pdgs[i], m_Multiplicities[tj].fFeedDown);
895 std::string tname = prt[i];
898 if (dens1 * m_model->
Parameters().
V>1.e-3) fprintf(f,
"$%s$ & & $%.3g$ \\\\\n", tname.c_str(), dens1 * m_model->
Parameters().
V);
901 sprintf(tnum,
"%.2E", dens1 * m_model->
Parameters().
V);
906 for(
int ii=0;ii<4;++ii) valst[ii] = tnum[ii];
908 for(
int ii=0;ii<4;++ii) stepst[ii] = tnum[5+ii];
912 fprintf(f,
"$%s$ & & $%.2lf \\cdot 10^{%d}$ \\\\\n", tname.c_str(), val, step);
916 if (m_Multiplicities[tj].fValue>0.999) fprintf(f,
"$%s$ & $%.4g \\pm %.4g$ & $%.4g$ \\\\\n", tname.c_str(), m_Multiplicities[tj].fValue, m_Multiplicities[tj].fError, dens1 * m_model->
Parameters().
V);
917 else if (dens1 * m_model->
Parameters().
V>1.e-3) fprintf(f,
"$%s$ & $%.3g \\pm %.3g$ & $%.3g$ \\\\\n", tname.c_str(), m_Multiplicities[tj].fValue, m_Multiplicities[tj].fError, dens1 * m_model->
Parameters().
V);
918 else fprintf(f,
"$%s$ & $%.6g \\pm %.6g$ & $%.3g$ \\\\\n", tname.c_str(), m_Multiplicities[tj].fValue, m_Multiplicities[tj].fError, dens1 * m_model->
Parameters().
V);
922 for(
size_t i=0;i<m_Multiplicities.size();++i)
924 double dens1 = m_model->
GetDensity(m_Multiplicities[i].fPDGID, m_Multiplicities[i].fFeedDown);
927 if (m_Multiplicities[i].fPDGID==1) tname =
"Npart";
929 fprintf(f,
"$%s$ & $%.4lf \\pm %.4lf$ & $%.4lf$ & $%.4lf$ \\\\\n", tname.c_str(), m_Multiplicities[i].fValue, m_Multiplicities[i].fError, dens1 * m_model->
Parameters().
V, (dens1 * m_model->
Parameters().
V-m_Multiplicities[i].fValue)/m_Multiplicities[i].fError);
931 for(
size_t i=0;i<m_Ratios.size();++i) {
932 double dens1 = m_model->
GetDensity(m_Ratios[i].fPDGID1, m_Ratios[i].fFeedDown1);
933 double dens2 = m_model->
GetDensity(m_Ratios[i].fPDGID2, m_Ratios[i].fFeedDown2);
937 if (m_Ratios[i].fPDGID1==1) name1 =
"Npart";
938 if (m_Ratios[i].fPDGID2==1) name2 =
"Npart";
941 fprintf(f,
"$%s$ & $%.4lf \\pm %.4lf$ & $%.4lf$ & $%.4lf$ \\\\\n", (std::string(name1 +
"/" + name2)).c_str(), m_Ratios[i].fValue, m_Ratios[i].fError, dens1 / dens2 , (dens1 / dens2 - m_Ratios[i].fValue)/m_Ratios[i].fError);
943 fprintf(f,
"\\hline\n");
944 fprintf(f,
"\\end{tabular}\n");
946 fprintf(f,
"\\begin{tabular}{|c|c|}\n");
947 fprintf(f,
"\\hline\n");
948 fprintf(f,
"\\multicolumn{2}{|c|}{%s} \\\\\n", name.c_str());
949 fprintf(f,
"\\hline\n");
950 fprintf(f,
"Parameter & Fit result \\\\\n");
951 fprintf(f,
"\\hline\n");
952 for(
int i=0;i<9;++i) {
955 double tval = param.
value, terr = param.
error, terrp = param.
errp, terrm = param.
errm;
956 if (param.
name==
"T" || param.
name.substr(0,2)==
"mu") { tval *= 1000.; terr *= 1000.; terrp *= 1000.; terrm *= 1000.; }
957 if (!asymm) fprintf(f,
"$%s$ & $%.3lf \\pm %.3lf$ \\\\\n", param.
name.c_str(), tval, terr);
958 else fprintf(f,
"$%s$ & $%.3lf^{+%.3lf}_{-%.3lf}$ \\\\\n", param.
name.c_str(), tval, terrp, terrm);
961 fprintf(f,
"$%s$ & $%.2lf/%d$ \\\\\n",
"\\chi^2/N_{\\rm df}", m_Parameters.
chi2ndf *
GetNdf(),
GetNdf());
962 fprintf(f,
"\\hline\n");
963 fprintf(f,
"\\end{tabular}\n");
968 std::string ThermalModelFit::GetCurrentTime() {
970 struct tm * timeinfo;
974 timeinfo = localtime(&rawtime);
976 strftime(buffer,
sizeof(buffer),
"%d-%m-%Y at %I:%M:%S", timeinfo);
977 std::string str(buffer);
986 fout =
new std::ofstream(filename.c_str());
999 *fout << comment << std::endl << std::endl;
1003 *fout <<
"Performed on " << GetCurrentTime() << std::endl << std::endl;
1006 *fout <<
"chi2/dof = " << m_Parameters.
chi2 <<
"/" << m_Parameters.
ndf <<
" = " << m_Parameters.
chi2ndf << std::endl << std::endl;
1010 *fout <<
"Data description accuracy = (" 1012 << std::setprecision(2)
1013 << accuracy.first * 100. <<
" +- " << accuracy.second * 100. <<
") %" << std::endl << std::endl;
1015 fout->unsetf(std::ios_base::floatfield);
1016 *fout << std::setprecision(6);
1019 *fout <<
"Extracted parameters:" << std::endl;
1020 for (
int i = 0; i < 10 ; ++i) {
1024 std::string sunit =
"";
1025 std::string tname =
"";
1027 if (param.
name ==
"T" || param.
name.substr(0, 2) ==
"mu") {
1031 else if (param.
name ==
"R" || param.
name ==
"Rc") {
1034 tname = param.
name + sunit;
1056 double tval = param.
value, terr = param.
error, terrp = param.
errp, terrm = param.
errm;
1058 if (param.
name ==
"Tkin" && !m_YieldsAtTkin)
1061 if (param.
name !=
"R" && param.
name !=
"Rc") {
1063 *fout << std::setw(15) << tname
1065 << std::setw(15) << tval * tmn
1067 << std::left << std::setw(15) << terr * tmn << std::right
1071 *fout << std::setw(15) << tname
1073 << std::setw(15) << tval * tmn
1075 << std::left << std::setw(15) << terrp * tmn << std::right
1077 << std::left << std::setw(15) << terrm * tmn << std::right
1083 *fout << std::setw(15) << tname
1085 << std::setw(15) << tval * tmn
1087 << std::left << std::setw(15) << terr * tmn << std::right
1090 std::string tname2 =
"V[fm3]";
1091 if (param.
name ==
"Rc")
1093 *fout << std::setw(15) << tname2
1095 << std::setw(15) << 4. / 3. *
xMath::Pi() * pow(tval * tmn, 3)
1097 << std::left << std::setw(15) << 4. *
xMath::Pi() * pow(tval * tmn, 2) * terr * tmn << std::right
1102 *fout << std::setw(15) << tname
1104 << std::setw(15) << tval * tmn
1106 << std::left << std::setw(15) << terrp * tmn << std::right
1108 << std::left << std::setw(15) << terrm * tmn << std::right
1111 std::string tname2 =
"V[fm3]";
1112 if (param.
name ==
"Rc")
1114 *fout << std::setw(15) << tname2
1116 << std::setw(15) << 4. / 3. *
xMath::Pi() * pow(tval * tmn, 3)
1118 << std::left << std::setw(15) << 4. *
xMath::Pi() * pow(tval * tmn, 2) * terrp * tmn << std::right
1120 << std::left << std::setw(15) << 4. *
xMath::Pi() * pow(tval * tmn, 2) * terrm * tmn << std::right
1127 double tval = param.
value;
1128 if (param.
name !=
"R" && param.
name !=
"Rc")
1129 *fout << std::setw(15) << tname
1131 << std::setw(15) << tval * tmn
1132 <<
" (FIXED)" << std::endl;
1136 *fout << std::setw(15) << tname
1138 << std::setw(15) << tval * tmn
1139 <<
" (FIXED)" <<
"\t";
1140 std::string tname2 =
"V[fm3]";
1141 if (param.
name ==
"Rc")
1143 *fout << std::setw(15) << tname2
1145 << std::setw(15) << 4. / 3. *
xMath::Pi() * pow(tval * tmn, 3)
1146 <<
" (FIXED)" << std::endl;
1153 *fout << std::endl << std::endl;
1155 *fout <<
"Yields:" << std::endl;
1157 for (
size_t i = 0; i<m_Multiplicities.size(); ++i) {
1158 double dens1 = m_model->
GetDensity(m_Multiplicities[i].fPDGID, m_Multiplicities[i].fFeedDown);
1161 if (m_Multiplicities[i].fPDGID == 1) tname =
"Npart";
1164 *fout << std::setw(25) << tname
1167 if (m_Multiplicities[i].fValue > 1.e-5 && m_Multiplicities[i].fError > 1.e-5)
1168 fout->unsetf(std::ios_base::floatfield);
1170 *fout << std::scientific;
1172 *fout << std::setw(15) << m_Multiplicities[i].fValue;
1174 *fout << std::left << std::setw(15) << m_Multiplicities[i].fError << std::right <<
" ";
1176 *fout << std::left << std::setw(15) << dens1 * m_model->
Parameters().
V << std::right <<
" ";
1178 fout->unsetf(std::ios_base::floatfield);
1180 *fout <<
"Std.dev.: ";
1181 *fout << std::left << std::setw(15) << (dens1* m_model->
Parameters().
V - m_Multiplicities[i].fValue) / m_Multiplicities[i].fError << std::right <<
" ";
1190 for (
size_t i = 0; i<m_Ratios.size(); ++i) {
1191 double dens1 = m_model->
GetDensity(m_Ratios[i].fPDGID1, m_Ratios[i].fFeedDown1);
1192 double dens2 = m_model->
GetDensity(m_Ratios[i].fPDGID2, m_Ratios[i].fFeedDown2);
1196 if (m_Ratios[i].fPDGID1 == 1) name1 =
"Npart";
1197 if (m_Ratios[i].fPDGID2 == 1) name2 =
"Npart";
1201 *fout << std::setw(25) << std::string(name1 +
"/" + name2)
1204 if (m_Ratios[i].fValue > 1.e-5 && m_Ratios[i].fError > 1.e-5)
1205 fout->unsetf(std::ios_base::floatfield);
1207 *fout << std::scientific;
1209 *fout << std::setw(15) << m_Ratios[i].fValue;
1211 *fout << std::left << std::setw(15) << m_Ratios[i].fError << std::right <<
" ";
1213 *fout << std::left << std::setw(15) << dens1 / dens2 << std::right <<
" ";
1215 fout->unsetf(std::ios_base::floatfield);
1217 *fout <<
"Std.dev.: ";
1218 *fout << std::left << std::setw(15) << (dens1 / dens2 - m_Ratios[i].fValue) / m_Ratios[i].fError << std::right <<
" ";
1229 if (filename !=
"" && fout != NULL) {
1234 using namespace std;
1238 double chi2total = 0.;
1239 std::vector<double> weights;
1240 std::vector<double> vals, errors;
1243 if (quantity.
toFit) {
1244 vals.push_back(fabs(m_ModelData[i] / quantity.
Value() - 1));
1245 errors.push_back(quantity.
ValueError() / quantity.
Value() * m_ModelData[i] / quantity.
Value());
1249 chi2total += chi2contrib;
1250 weights.push_back(chi2contrib);
1254 for (
size_t i = 0; i < weights.size(); ++i) {
1255 weights[i] /= chi2total;
1258 double mean = 0., error = 0.;
1259 for (
size_t i = 0; i < vals.size(); ++i) {
1260 mean += vals[i] * weights[i];
1261 error += errors[i] * weights[i];
1264 return make_pair(mean, error);
1268 std::vector<FittedQuantity> ret(0);
1270 fin.open(filename.c_str());
1271 if (fin.is_open()) {
1273 fin.getline(tmpc, 2000);
1274 string tmp = string(tmpc);
1284 fin.seekg(0, ios::beg);
1287 ret = loadExpDataFromFile_NewFormat(fin);
1289 ret = loadExpDataFromFile_OldFormat(fin);
1296 std::vector<FittedQuantity> ThermalModelFit::loadExpDataFromFile_OldFormat(std::fstream & fin)
1298 std::vector<FittedQuantity> ret(0);
1299 if (fin.is_open()) {
1302 fin.getline(tmpc, 2000);
1306 if (fields.size()<4)
break;
1307 int type = atoi(fields[0].c_str());
1309 double value = 0., error = 0., error2 = 0.;
1310 int feeddown1 = 1, feeddown2 = 1;
1313 value = atof(fields[3].c_str());
1314 if (fields.size() >= 5) error = atof(fields[4].c_str());
1315 if (fields.size() >= 6) {
1316 error2 = atof(fields[5].c_str());
1317 error = sqrt(error*error + error2*error2);
1319 if (fields.size() >= 7) feeddown1 = atoi(fields[6].c_str());
1320 if (fields.size() >= 8) feeddown2 = atoi(fields[7].c_str());
1323 value = atof(fields[2].c_str());
1324 error = atof(fields[3].c_str());
1325 if (fields.size() >= 5) {
1326 error2 = atof(fields[4].c_str());
1327 error = sqrt(error*error + error2*error2);
1329 if (fields.size() >= 6) feeddown1 = atoi(fields[5].c_str());
1332 if (type) ret.push_back(
FittedQuantity(
ExperimentRatio(pdgid1, pdgid2, value, error, static_cast<Feeddown::Type>(feeddown1), static_cast<Feeddown::Type>(feeddown2))));
1335 fin.getline(tmpc, 500);
1343 std::vector<FittedQuantity> ThermalModelFit::loadExpDataFromFile_NewFormat(std::fstream & fin)
1345 std::vector<FittedQuantity> ret(0);
1346 if (fin.is_open()) {
1348 while (!fin.eof()) {
1349 fin.getline(cc, 2000);
1350 string tmp = string(cc);
1352 if (elems.size() < 1)
1355 istringstream iss(elems[0]);
1358 long long pdgid1, pdgid2;
1359 int feeddown1, feeddown2;
1360 double value, error;
1362 if (iss >> fitflag >> pdgid1 >> pdgid2 >> feeddown1 >> feeddown2 >> value >> error) {
1363 if (pdgid2 != 0) ret.push_back(
FittedQuantity(
ExperimentRatio(pdgid1, pdgid2, value, error, static_cast<Feeddown::Type>(feeddown1), static_cast<Feeddown::Type>(feeddown2))));
1367 ret[ret.size() - 1].toFit =
true;
1369 ret[ret.size() - 1].toFit =
false;
1378 std::ofstream fout(filename.c_str());
1379 if (fout.is_open()) {
1381 << std::setw(14) <<
"is_fitted" 1382 << std::setw(15) <<
"pdg1" 1383 << std::setw(15) <<
"pdg2" 1384 << std::setw(15) <<
"feeddown1" 1385 << std::setw(15) <<
"feeddown2" 1386 << std::setw(15) <<
"value" 1387 << std::setw(15) <<
"error" 1389 for (
size_t i = 0; i < outQuantities.size(); ++i) {
1391 fout << std::setw(15) << static_cast<int>(outQuantities[i].toFit)
1392 << std::setw(15) << outQuantities[i].mult.fPDGID
1393 << std::setw(15) << 0
1394 << std::setw(15) << outQuantities[i].mult.fFeedDown
1395 << std::setw(15) << 0
1396 << std::setw(15) << outQuantities[i].mult.fValue
1397 << std::setw(15) << outQuantities[i].mult.fError
1401 fout << std::setw(15) << static_cast<int>(outQuantities[i].toFit)
1402 << std::setw(15) << outQuantities[i].ratio.fPDGID1
1403 << std::setw(15) << outQuantities[i].ratio.fPDGID2
1404 << std::setw(15) << outQuantities[i].ratio.fFeedDown1
1405 << std::setw(15) << outQuantities[i].ratio.fFeedDown2
1406 << std::setw(15) << outQuantities[i].ratio.fValue
1407 << std::setw(15) << outQuantities[i].ratio.fError
1414 printf(
"**WARNING** ThermalModelFit::saveExpDataToFile: Cannot open file for writing data!");
1420 if (!m_Parameters.T.toFit) nparams--;
1421 if (!m_Parameters.muB.toFit) nparams--;
1422 if (!m_Parameters.muS.toFit) nparams--;
1423 if (!m_Parameters.muQ.toFit) nparams--;
1424 if (!m_Parameters.muC.toFit) nparams--;
1425 if (!m_Parameters.gammaq.toFit) nparams--;
1426 if (!m_Parameters.gammaS.toFit) nparams--;
1427 if (!m_Parameters.gammaC.toFit) nparams--;
1428 if (!m_Parameters.R.toFit || (m_Multiplicities.size()==0 && m_model->Ensemble() ==
ThermalModelBase::GCE)) nparams--;
1430 if (!m_Parameters.Tkin.toFit || !
UseTkin()) nparams--;
1432 for (
size_t i = 0; i < m_Quantities.size(); ++i)
1433 if (m_Quantities[i].toFit) ndof++;
1434 return (ndof - nparams);
Abstract base class for an HRG model implementation.
long long stringToLongLong(const std::string &str)
bool toFit
Whether this quantity contributes to the of a fit.
std::vector< std::string > split(const std::string &s, char delim)
int ModelDataSize() const
FitParameter T
All the fit parameters.
Class implementing HRG in partial chemical equilibrium.
void PrintMultiplicities()
bool ConstrainMuC() const
bool ConstrainMuB() const
virtual void FixParameters()
Method which actually implements ConstrainChemicalPotentials() (for backward compatibility).
double fError
Experimental error.
Contains some helper functions.
ThermalModelParameters GetThermalModelParameters()
Return ThermalModelParameters corresponding to the this ThermalModelFitParameters.
virtual void SetStabilityFlags(const std::vector< int > &StabilityFlags)
Manually set the PCE stability flags for all species.
int PdgToId(long long pdgid)
Transforms PDG ID to a 0-based particle id number.
Feeddown::Type fFeedDown2
The feeddown contributions to be included for the yield in the denominator.
std::string GetNameFromPDG(long long pdgid)
Get the name of particle species with the specified PDG ID.
double chi2
Value of the function.
Grand canonical ensemble.
int ndf
Number of degrees of freedom.
Structure describing the measurement to be fitted or compared to model.
virtual void SetParameters(const ThermalModelParameters ¶ms)
The thermal parameters.
~ThermalModelFit(void)
Destroy the Thermal Model Fit object.
Structure containing all thermal parameters of the model.
virtual double CalculateStrangenessDensity()
Charm-canonical ensemble.
void PrintYieldsLatex(std::string filename="Yield.dat", std::string name="A+A")
virtual double CalculateBaryonDensity()
long long fPDGID
PDG code of the particle yield.
ThermalModelEnsemble Ensemble()
The statistical ensemble of the current HRG model.
FitParameter GetParameter(const std::string &name) const
Get the FitParameter by its name.
long long fPDGID1
PDG code of the particle yield in the numerator.
void PrintFitLog(std::string filename="", std::string comment="Thermal fit", bool asymm=false)
Prints the result of the fitting procedure to a file.
Structure containing the experimental ratio of yields to be fitted.
virtual double CalculateChargeDensity()
Feeddown::Type fFeedDown
The feeddown contributions to be included.
ThermalModelFit(ThermalModelBase *model)
Construct a new ThermalModelFit object.
double fError
Experimental error of the yield ratio.
double fValue
Experimental value of the yield ratio.
double GetDensity(long long PDGID, int feeddown)
Same as GetDensity(int,Feeddown::Type)
const std::string & Name() const
Particle's name.
Extended structure for calculating uncertainties in non-fit quantities resulting from uncertanties in...
const std::vector< ThermalParticle > & Particles() const
Returns the vector of all particle species.
double xmax
Lower and uppers bounds on parameter value.
std::string name
Name of the parameter.
int GetNdf() const
Number of degrees of freedom in the fit.
virtual void CalculateDensities()
Calculates the primordial and total (after decays) densities of all species.
void SetParameterFitFlag(const std::string &name, bool toFit)
Set whether the FitParameter with a given name should be fitted.
Structure holding information about parameters of a thermal fit.
int B
Total charges (for CE)
std::vector< FitParameter * > ParameterList
Vector of pointer to all the parameters.
Structure for an arbitrary fit parameter.
bool ConstrainMuQ() const
bool toFit
Whether the parameter is fitted or fixed.
void PrintYieldsTable2(std::string filename="Yield.dat")
FitParameter Tkin
Since version 1.3: Kinetic freeze-out temperature.
double ValueError() const
Error of the measurement.
void PrintYieldsLatexAll(std::string filename="Yield.dat", std::string name="A+A", bool asymm=false)
Strangeness-canonical ensemble.
static std::vector< FittedQuantity > loadExpDataFromFile(const std::string &filename)
Load the experimental data from a file.
bool calculationHadBECIssue
Whether > m Bose-Einstein condensation issue was encountered for a Bose gas.
static void saveExpDataToFile(const std::vector< FittedQuantity > &outQuantities, const std::string &filename)
ThermalModelFitParameters PerformFit(bool verbose=true, bool AsymmErrors=false)
The thermal fit procedure.
double fValue
Experimental value.
void PrintYieldsTable(std::string filename="Yield.dat")
const std::vector< FittedQuantity > & FittedQuantities() const
Return a vector of the fitted quantities (data)
void PrintParameters()
Print function.
const ThermalModelParameters & Parameters() const
Structure containing the experimental yield (multiplicity) to be fitted.
long long fPDGID2
PDG code of the particle yield in the denominator.
double error
Parameter error (symmetric)
The main namespace where all classes and functions of the Thermal-FIST library reside.
double Value() const
Value of the measurement.
Feeddown::Type fFeedDown1
The feeddown contributions to be included for the yield in the numerator.
Feeddown from all particles marked as unstable.
virtual bool IsConservedChargeCanonical(ConservedCharge::Name charge) const
Whether the given conserved charge is treated canonically.
double Volume() const
System volume (fm )
ThermalParticleSystem * TPS()
double errm
Asymmetric errors.
static std::vector< int > ComputePCEStabilityFlags(const ThermalParticleSystem *TPS, bool SahaEquationForNuclei=true, bool FreezeLongLived=false, double WidthCut=0.015)
Computes the PCE stability flags based on the provided particle list and a number of parameters...
bool ConstrainMuS() const
ThermalParticle & ParticleByPDG(long long pdgid)
ThermalParticle object corresponding to particle species with a provided PDG ID.
std::pair< double, double > ModelDescriptionAccuracy() const
Returns a relative error of the data description (and its uncertainty estimate)