From 7209b5a9c4b1428df74e3d6553d8888aa4bc7500 Mon Sep 17 00:00:00 2001 From: Volodymyr Vovchenko Date: Thu, 28 Apr 2022 18:42:42 -0700 Subject: [PATCH 1/2] Added scaled moments and Pearons correlation coefficients to GUI --- src/gui/QtThermalFIST/correlationsdialog.cpp | 83 ++++++++++++++++---- 1 file changed, 69 insertions(+), 14 deletions(-) diff --git a/src/gui/QtThermalFIST/correlationsdialog.cpp b/src/gui/QtThermalFIST/correlationsdialog.cpp index dc5ee50..717d08c 100644 --- a/src/gui/QtThermalFIST/correlationsdialog.cpp +++ b/src/gui/QtThermalFIST/correlationsdialog.cpp @@ -52,6 +52,8 @@ CorrelationsDialog::CorrelationsDialog(QWidget* parent, ThermalModelBase* mod) : comboQuantity = new QComboBox(); comboQuantity->addItem(tr("Susceptibility")); comboQuantity->addItem(tr("Moment")); + comboQuantity->addItem(tr("Scaled moment")); + comboQuantity->addItem(tr("Pearson correlation")); comboQuantity->addItem(tr("Delta[N1,N2]")); comboQuantity->addItem(tr("Sigma[N1,N2]")); comboQuantity->setCurrentIndex(0); @@ -149,11 +151,27 @@ void CorrelationsDialog::recalculate() tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(corr))); else if (comboQuantity->currentIndex() == 1) tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(corr * model->Volume() * pow(model->Parameters().T, 3) * pow(xMath::GeVtoifm(), 3)))); + //else if (comboQuantity->currentIndex() == 2) { + // double val = corr * model->Volume() * pow(model->Parameters().T, 3) * pow(xMath::GeVtoifm(), 3); + // double yld1 = model->GetYield(pdg1, Feeddown::Primordial); + // double yld2 = model->GetYield(pdg2, Feeddown::Primordial); + // if (comboFeeddown->currentIndex() == 1) { + // yld1 = model->GetYield(pdg1, Feeddown::StabilityFlag); + // yld2 = model->GetYield(pdg2, Feeddown::StabilityFlag); + // } + // tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(val / sqrt(yld1 * yld2)))); + //} + //else if (comboQuantity->currentIndex() == 3) { + // double val = corr; + // double var1 = model->TwoParticleSusceptibilityPrimordialByPdg(pdg1, pdg1); + // double var2 = model->TwoParticleSusceptibilityPrimordialByPdg(pdg2, pdg2); + // if (comboFeeddown->currentIndex() == 1) { + // var1 = model->TwoParticleSusceptibilityFinalByPdg(pdg1, pdg1); + // var2 = model->TwoParticleSusceptibilityFinalByPdg(pdg2, pdg2); + // } + // tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(val / sqrt(var1 * var2)))); + //} else { - if (pdg1 == pdg2) { - tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(0.))); - continue; - } double N1 = 0., N2 = 0.; double wn1 = 0., wn2 = 0.; @@ -209,17 +227,36 @@ void CorrelationsDialog::recalculate() corr *= model->Volume() * pow(model->Parameters().T, 3) * pow(xMath::GeVtoifm(), 3); - // Delta + // Scaled moment if (comboQuantity->currentIndex() == 2) { - double DeltaN1N2 = (N1 * wn2 - N2 * wn1) / (N2 - N1); - tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(DeltaN1N2))); - continue; + if (pdg1 == pdg2) { + qDebug() << pdg1 << " " << corr << " " << N1 << " " << N2 << endl; + } + tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(corr / sqrt(N1 * N2)))); + } + // Pearson + else if (comboQuantity->currentIndex() == 3) { + double var1 = wn1 * N1, var2 = wn2 * N2; + tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(corr / sqrt(var1 * var2)))); } - // Sigma else { - double SigmaN1N2 = (N1 * wn2 + N2 * wn1 - 2. * corr) / (N2 + N1); - tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(SigmaN1N2))); - continue; + if (pdg1 == pdg2) { + tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(0.))); + continue; + } + + // Delta + if (comboQuantity->currentIndex() == 4) { + double DeltaN1N2 = (N1 * wn2 - N2 * wn1) / (N2 - N1); + tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(DeltaN1N2))); + continue; + } + // Sigma + else { + double SigmaN1N2 = (N1 * wn2 + N2 * wn1 - 2. * corr) / (N2 + N1); + tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(SigmaN1N2))); + continue; + } } } } @@ -264,8 +301,17 @@ void CorrelationsDialog::recalculate() double wn1 = model->Susc((ConservedCharge::Name)i, (ConservedCharge::Name)i) * model->Volume() * pow(model->Parameters().T, 3) * pow(xMath::GeVtoifm(), 3) / N1; double wn2 = model->Susc((ConservedCharge::Name)j, (ConservedCharge::Name)j) * model->Volume() * pow(model->Parameters().T, 3) * pow(xMath::GeVtoifm(), 3) / N2; double corr = model->Susc((ConservedCharge::Name)i, (ConservedCharge::Name)j) * model->Volume() * pow(model->Parameters().T, 3) * pow(xMath::GeVtoifm(), 3); - // Delta + // Scaled moment if (comboQuantity->currentIndex() == 2) { + tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(corr / sqrt(N1 * N2)))); + } + // Pearson + else if (comboQuantity->currentIndex() == 3) { + double var1 = wn1 * N1, var2 = wn2 * N2; + tableCorr->setItem(i, j, new QTableWidgetItem(QString::number(corr / sqrt(var1 * var2)))); + } + // Delta + if (comboQuantity->currentIndex() == 4) { double DeltaN1N2 = (N1 * wn2 - N2 * wn1) / (N2 - N1); tableCorr->setItem(i1, i2, new QTableWidgetItem(QString::number(DeltaN1N2))); } @@ -386,8 +432,17 @@ void CorrelationsDialog::recalculate() corr *= model->Volume() * pow(model->Parameters().T, 3) * pow(xMath::GeVtoifm(), 3); - // Delta + // Scaled moment if (comboQuantity->currentIndex() == 2) { + tableCorr->setItem(i, i2, new QTableWidgetItem(QString::number(corr / sqrt(N1 * N2)))); + } + // Pearson + else if (comboQuantity->currentIndex() == 3) { + double var1 = wn1 * N1, var2 = wn2 * N2; + tableCorr->setItem(i, i2, new QTableWidgetItem(QString::number(corr / sqrt(var1 * var2)))); + } + // Delta + if (comboQuantity->currentIndex() == 4) { double DeltaN1N2 = (N1 * wn2 - N2 * wn1) / (N2 - N1); tableCorr->setItem(i, i2, new QTableWidgetItem(QString::number(DeltaN1N2))); } From 70fe41edc58d47157284a5eacca01ef9201551cd Mon Sep 17 00:00:00 2001 From: Volodymyr Vovchenko Date: Tue, 3 May 2022 15:19:07 -0700 Subject: [PATCH 2/2] Added scaled moments and Pearson correlation coefficients into the correlations dialog in the GUI --- CHANGELOG.md | 7 +++++++ CMakeLists.txt | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f1f7c50..daf0b33 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) +## [Version 1.3.3] + +Date: 2022-05-03 + +GUI: Added scaled moments and Pearson correlation coefficients into the correlations dialog ## [Version 1.3.2] @@ -193,6 +198,8 @@ Date: 2018-08-02 **The first public version of Thermal-FIST** +[Version 1.3.3]: https://github.com/vlvovch/Thermal-FIST/compare/v1.3.2...v1.3.3 + [Version 1.3.2]: https://github.com/vlvovch/Thermal-FIST/compare/v1.3.1...v1.3.2 [Version 1.3.1]: https://github.com/vlvovch/Thermal-FIST/compare/v1.3...v1.3.1 diff --git a/CMakeLists.txt b/CMakeLists.txt index 702c168..caf4d8b 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -8,7 +8,7 @@ project (ThermalFIST) # The version number. set (ThermalFIST_VERSION_MAJOR 1) set (ThermalFIST_VERSION_MINOR 3) -set (ThermalFIST_VERSION_DEVEL 2) +set (ThermalFIST_VERSION_DEVEL 3) # configure a header file to pass some of the CMake settings # to the source code