Skip to content

Commit

Permalink
net-Q to net-pion for proxy charge susceptibility, PCE fix for canoni…
Browse files Browse the repository at this point in the history
…cal ensemble
  • Loading branch information
vlvovch committed Jun 14, 2019
1 parent 40cc609 commit b1c22af
Show file tree
Hide file tree
Showing 3 changed files with 45 additions and 8 deletions.
18 changes: 18 additions & 0 deletions src/gui/QtThermalFIST/resultdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -239,6 +239,24 @@ QString ResultDialog::GetResults() {
ret += QString(cc);
ret += QString::number((model->CalculateEntropyDensity()) / model->Parameters().T / model->Parameters().T / model->Parameters().T / xMath::GeVtoifm() / xMath::GeVtoifm() / xMath::GeVtoifm()) + "\r\n";

if (model->TPS()->PdgToId(2212) != -1 && model->TPS()->PdgToId(1000010020) != -1) {
ret += "\r\n";

sprintf(cc, "%-25s = ", "O_p,d = N_d/N_p^2");
ret += QString(cc);
ret += QString::number( model->TotalDensities()[model->TPS()->PdgToId(1000010020)] / model->TotalDensities()[model->TPS()->PdgToId(2212)] / model->TotalDensities()[model->TPS()->PdgToId(2212)] ) + "\r\n";

if (model->TPS()->PdgToId(1000010020) != -1) {
sprintf(cc, "%-25s = ", "O_p,d,t = N_p N_t/N_d^2");
ret += QString(cc);
ret += QString::number( model->TotalDensities()[model->TPS()->PdgToId(2212)] * model->TotalDensities()[model->TPS()->PdgToId(1000010030)] / model->TotalDensities()[model->TPS()->PdgToId(1000010020)] / model->TotalDensities()[model->TPS()->PdgToId(1000010020)] ) + "\r\n";

sprintf(cc, "%-25s = ", "delta_n");
ret += QString(cc);
ret += QString::number( (9./4.) * pow(4./3., 3./2.) * model->TotalDensities()[model->TPS()->PdgToId(2212)] * model->TotalDensities()[model->TPS()->PdgToId(1000010030)] / model->TotalDensities()[model->TPS()->PdgToId(1000010020)] / model->TotalDensities()[model->TPS()->PdgToId(1000010020)] - 1.) + "\r\n";
}
}

if (model->IsFluctuationsCalculated()) {
ret += "\r\n";

Expand Down
9 changes: 7 additions & 2 deletions src/library/HRGBase/ThermalModelBase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -946,15 +946,17 @@ namespace thermalfist {
int c1 = 0;
//if (i == 0) c1 = m_TPS->Particles()[k].BaryonCharge();
if (i == 0) c1 = 1 * (m_TPS->Particles()[k].PdgId() == 2212) - 1 * (m_TPS->Particles()[k].PdgId() == -2212);
if (i == 1) c1 = m_TPS->Particles()[k].ElectricCharge();
//if (i == 1) c1 = m_TPS->Particles()[k].ElectricCharge();
if (i == 1) c1 = 1 * (m_TPS->Particles()[k].PdgId() == 211) - 1 * (m_TPS->Particles()[k].PdgId() == -211);
if (i == 2) c1 = 1 * (m_TPS->Particles()[k].PdgId() == 321) - 1 * (m_TPS->Particles()[k].PdgId() == -321);
if (i == 3) c1 = m_TPS->Particles()[k].Charm();
for (size_t kp = 0; kp < m_TotalCorrel.size(); ++kp) {
if (m_TPS->Particles()[kp].IsStable()) {
int c2 = 0;
//if (j == 0) c2 = m_TPS->Particles()[kp].BaryonCharge();
if (j == 0) c2 = 1 * (m_TPS->Particles()[kp].PdgId() == 2212) - 1 * (m_TPS->Particles()[kp].PdgId() == -2212);
if (j == 1) c2 = m_TPS->Particles()[kp].ElectricCharge();
//if (j == 1) c2 = m_TPS->Particles()[kp].ElectricCharge();
if (j == 1) c2 = 1 * (m_TPS->Particles()[kp].PdgId() == 211) - 1 * (m_TPS->Particles()[kp].PdgId() == -211);
if (j == 2) c2 = 1 * (m_TPS->Particles()[kp].PdgId() == 321) - 1 * (m_TPS->Particles()[kp].PdgId() == -321);
if (j == 3) c2 = m_TPS->Particles()[kp].Charm();
m_ProxySusc[i][j] += c1 * c2 * m_TotalCorrel[k][kp];
Expand All @@ -965,6 +967,9 @@ namespace thermalfist {
m_ProxySusc[i][j] = m_ProxySusc[i][j] / m_Parameters.T / m_Parameters.T / xMath::GeVtoifm() / xMath::GeVtoifm() / xMath::GeVtoifm();
}
}

printf("chi2netp/chi2skellam = %lf\n", m_ProxySusc[0][0] / (m_densitiestotal[m_TPS->PdgToId(2212)] + m_densitiestotal[m_TPS->PdgToId(-2212)]) * pow(m_Parameters.T * xMath::GeVtoifm(), 3));
printf("chi2netpi/chi2skellam = %lf\n", m_ProxySusc[1][1] / (m_densitiestotal[m_TPS->PdgToId(211)] + m_densitiestotal[m_TPS->PdgToId(-211)]) * pow(m_Parameters.T * xMath::GeVtoifm(), 3));
}

void ThermalModelBase::CalculateFluctuations() {
Expand Down
26 changes: 20 additions & 6 deletions src/library/HRGBase/ThermalModelCanonical.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -323,18 +323,32 @@ Obtained: %lf\n\
|| tpart.CalculationType() != IdealGasFunctions::ClusterExpansion) {
int ind = m_QNMap[QuantumNumbers(m_BCE * tpart.BaryonCharge(), m_QCE * tpart.ElectricCharge(), m_SCE * tpart.Strangeness(), m_CCE * tpart.Charm())];
if (ind < static_cast<int>(Nsx.size())) {
double tdens = tpart.DensityCluster(1, m_Parameters, IdealGasFunctions::ParticleDensity, m_UseWidth, 0.);
Nsx[ind] += tdens * cosh(m_Chem[i] / m_Parameters.T);
Nsy[ind] += tdens * sinh(m_Chem[i] / m_Parameters.T);
if (!UsePartialChemicalEquilibrium()) {
double tdens = tpart.DensityCluster(1, m_Parameters, IdealGasFunctions::ParticleDensity, m_UseWidth, 0.);
Nsx[ind] += tdens * cosh(m_Chem[i] / m_Parameters.T);
Nsy[ind] += tdens * sinh(m_Chem[i] / m_Parameters.T);
}
// Currently only works at mu = 0!!
else {
double tdens = tpart.DensityCluster(1, m_Parameters, IdealGasFunctions::ParticleDensity, m_UseWidth, m_Chem[i]);
Nsx[ind] += tdens;
}
}
}
else {
for (int n = 1; n <= tpart.ClusterExpansionOrder(); ++n) {
int ind = m_QNMap[QuantumNumbers(m_BCE*n*tpart.BaryonCharge(), m_QCE*n*tpart.ElectricCharge(), m_SCE*n*tpart.Strangeness(), m_CCE*n*tpart.Charm())];
if (ind < static_cast<int>(Nsx.size())) {
double tdens = tpart.DensityCluster(n, m_Parameters, IdealGasFunctions::ParticleDensity, m_UseWidth, 0.) / static_cast<double>(n); // TODO: Check
Nsx[ind] += tdens * cosh(n * m_Chem[i] / m_Parameters.T);
Nsy[ind] += tdens * sinh(n * m_Chem[i] / m_Parameters.T);
if (!UsePartialChemicalEquilibrium()) {
double tdens = tpart.DensityCluster(n, m_Parameters, IdealGasFunctions::ParticleDensity, m_UseWidth, 0.) / static_cast<double>(n); // TODO: Check
Nsx[ind] += tdens * cosh(n * m_Chem[i] / m_Parameters.T);
Nsy[ind] += tdens * sinh(n * m_Chem[i] / m_Parameters.T);
}
// Currently only works at mu = 0!!
else {
double tdens = tpart.DensityCluster(n, m_Parameters, IdealGasFunctions::ParticleDensity, m_UseWidth, m_Chem[i]) / static_cast<double>(n); // TODO: Check
Nsx[ind] += tdens;
}
}
}
}
Expand Down

0 comments on commit b1c22af

Please sign in to comment.