|
32 | 32 | #include <Math/Vector4D.h> // IWYU pragma: keep (do not replace with Math/Vector4Dfwd.h) |
33 | 33 | #include <Math/Vector4Dfwd.h> |
34 | 34 | #include <TH1.h> |
| 35 | +#include <TH3.h> |
35 | 36 |
|
36 | 37 | #include <algorithm> |
37 | 38 | #include <array> |
@@ -220,6 +221,7 @@ struct ConfPairBinning : o2::framework::ConfigurableGroup { |
220 | 221 | o2::framework::ConfigurableAxis shKstar{"shKstar", {{60, 0.0f, 0.3f}}, "k*/qinv binning for SH histograms"}; |
221 | 222 | o2::framework::ConfigurableAxis shCentBins{"shCentBins", {o2::framework::VARIABLE_WIDTH, 0.0f, 200.0f}, "SH: multiplicity/centrality bin edges (like FemtoUniverse confMultKstarBins)"}; |
222 | 223 | o2::framework::ConfigurableAxis shKtBins{"shKtBins", {o2::framework::VARIABLE_WIDTH, 0.1f, 0.2f, 0.3f, 0.4f}, "SH: kT bin edges (like FemtoUniverse confKtKstarBins)"}; |
| 224 | + o2::framework::Configurable<bool> shPlot1D{"shPlot1D", false, "(SH) Also fill 1D qinv/k* numerator/denominator (h1D) per (mult,kT) bin"}; |
223 | 225 | }; |
224 | 226 |
|
225 | 227 | struct ConfPairCuts : o2::framework::ConfigurableGroup { |
@@ -542,6 +544,7 @@ class PairHistManager |
542 | 544 | mPlotSH = ConfPairBinning.plotSH.value; |
543 | 545 | mShLMax = ConfPairBinning.shLMax.value; |
544 | 546 | mShFrame = ConfPairBinning.shFrame.value; |
| 547 | + mShPlot1D = ConfPairBinning.shPlot1D.value; |
545 | 548 | if (mPlotSH) { |
546 | 549 | mShKstarSpec = {ConfPairBinning.shKstar, "k* (GeV/#it{c})"}; |
547 | 550 | mYlm.initializeYlms(); |
@@ -975,9 +978,15 @@ class PairHistManager |
975 | 978 |
|
976 | 979 | mShReal.resize(nCent); |
977 | 980 | mShImag.resize(nCent); |
| 981 | + mShCov.resize(nCent); |
| 982 | + mSh1D.resize(nCent); |
| 983 | + mShBinCount.resize(nCent); |
978 | 984 | for (int iCent = 0; iCent < nCent; ++iCent) { |
979 | 985 | mShReal[iCent].resize(nKt); |
980 | 986 | mShImag[iCent].resize(nKt); |
| 987 | + mShCov[iCent].resize(nKt); |
| 988 | + mSh1D[iCent].resize(nKt); |
| 989 | + mShBinCount[iCent].resize(nKt); |
981 | 990 | // folder name: mult_{low}_{high} |
982 | 991 | const std::string centFolder = "mult_" + std::to_string(static_cast<int>(mShCentEdges[iCent])) + |
983 | 992 | "_" + std::to_string(static_cast<int>(mShCentEdges[iCent + 1])); |
@@ -1020,9 +1029,30 @@ class PairHistManager |
1020 | 1029 | titleIm += "; k* (GeV/#it{c}); Im[A_{l}^{m}]"; |
1021 | 1030 | mShReal[iCent][iKt][ihist] = mHistogramRegistry->add<TH1>(nameRe.c_str(), titleRe.c_str(), o2::framework::kTH1D, {mShKstarSpec}); |
1022 | 1031 | mShImag[iCent][iKt][ihist] = mHistogramRegistry->add<TH1>(nameIm.c_str(), titleIm.c_str(), o2::framework::kTH1D, {mShKstarSpec}); |
| 1032 | + mShReal[iCent][iKt][ihist]->Sumw2(); |
| 1033 | + mShImag[iCent][iKt][ihist]->Sumw2(); |
1023 | 1034 | ++ihist; |
1024 | 1035 | } |
1025 | 1036 | } |
| 1037 | + |
| 1038 | + // SH covariance TH3D |
| 1039 | + const int nAxisLM = 2 * nJM; |
| 1040 | + const o2::framework::AxisSpec covLmAxis{nAxisLM, -0.5, static_cast<double>(nAxisLM) - 0.5, "l,m #times (re,im)"}; |
| 1041 | + std::string nameCov = dir; |
| 1042 | + nameCov += "Cov"; |
| 1043 | + mShCov[iCent][iKt] = mHistogramRegistry->add<TH3>(nameCov.c_str(), "SH covariance; k* (GeV/#it{c}); l,m; l,m", o2::framework::kTH3D, {mShKstarSpec, covLmAxis, covLmAxis}); |
| 1044 | + mShCov[iCent][iKt]->Sumw2(); |
| 1045 | + |
| 1046 | + std::string nameBinCount = dir; |
| 1047 | + nameBinCount += "BinCount"; |
| 1048 | + mShBinCount[iCent][iKt] = mHistogramRegistry->add<TH1>(nameBinCount.c_str(), "SH bin occupancy; k* (GeV/#it{c}); Entries", o2::framework::kTH1D, {mShKstarSpec}); |
| 1049 | + |
| 1050 | + if (mShPlot1D) { |
| 1051 | + std::string name1D = dir; |
| 1052 | + name1D += "h1D"; |
| 1053 | + mSh1D[iCent][iKt] = mHistogramRegistry->add<TH1>(name1D.c_str(), "1D distribution; k* (GeV/#it{c}); Entries", o2::framework::kTH1D, {mShKstarSpec}); |
| 1054 | + mSh1D[iCent][iKt]->Sumw2(); |
| 1055 | + } |
1026 | 1056 | } |
1027 | 1057 | } |
1028 | 1058 | } |
@@ -1214,6 +1244,24 @@ class PairHistManager |
1214 | 1244 | mShReal[iCent][iKt][i]->Fill(mShKv, std::real(mShYlmBuffer[i])); |
1215 | 1245 | mShImag[iCent][iKt][i]->Fill(mShKv, -std::imag(mShYlmBuffer[i])); |
1216 | 1246 | } |
| 1247 | + // covariance: outer product of the (re, -im) Ylm vector packed on 2*nJM axes |
| 1248 | + // (each Ylm contributes two consecutive axis bins: even = real, odd = -imag) |
| 1249 | + static constexpr int ComponentsPerLM = 2; |
| 1250 | + const int nAxisLM = ComponentsPerLM * static_cast<int>(mShYlmBuffer.size()); |
| 1251 | + for (int iz = 0; iz < nAxisLM; ++iz) { |
| 1252 | + const double vz = (iz % ComponentsPerLM == 0) ? std::real(mShYlmBuffer[iz / ComponentsPerLM]) : -std::imag(mShYlmBuffer[iz / ComponentsPerLM]); |
| 1253 | + for (int ip = 0; ip < nAxisLM; ++ip) { |
| 1254 | + const double vp = (ip % ComponentsPerLM == 0) ? std::real(mShYlmBuffer[ip / ComponentsPerLM]) : -std::imag(mShYlmBuffer[ip / ComponentsPerLM]); |
| 1255 | + mShCov[iCent][iKt]->Fill(mShKv, static_cast<double>(iz), static_cast<double>(ip), vz * vp); |
| 1256 | + } |
| 1257 | + } |
| 1258 | + |
| 1259 | + mShBinCount[iCent][iKt]->Fill(mShKv, 1.0); |
| 1260 | + if (mShPlot1D) { |
| 1261 | + // FemtoUniverse h1D = f3d[0]: qinv (=2k*) for identical-LCMS, else k*. |
| 1262 | + const float sh1DValue = (mShFrame == ShFrameLcmsIdentical) ? (2.0f * mKstar) : mKstar; |
| 1263 | + mSh1D[iCent][iKt]->Fill(sh1DValue); |
| 1264 | + } |
1217 | 1265 | } |
1218 | 1266 | } |
1219 | 1267 | } |
@@ -1580,6 +1628,11 @@ class PairHistManager |
1580 | 1628 | // SH histograms binned in [iCent][iKt][ihist]; ihist = l*(l+1)+m |
1581 | 1629 | std::vector<std::vector<std::vector<std::shared_ptr<TH1>>>> mShReal; |
1582 | 1630 | std::vector<std::vector<std::vector<std::shared_ptr<TH1>>>> mShImag; |
| 1631 | + // SH covariance matrix per [iCent][iKt]; TH3d: k* on X, 2*nJM (l,m x re/im) |
| 1632 | + std::vector<std::vector<std::shared_ptr<TH3>>> mShCov; |
| 1633 | + bool mShPlot1D = false; |
| 1634 | + std::vector<std::vector<std::shared_ptr<TH1>>> mSh1D; |
| 1635 | + std::vector<std::vector<std::shared_ptr<TH1>>> mShBinCount; |
1583 | 1636 | std::vector<std::complex<double>> mShYlmBuffer; // reused, allocated once |
1584 | 1637 | std::vector<double> mShCentEdges; |
1585 | 1638 | std::vector<double> mShKtEdges; |
|
0 commit comments